-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.lvimrc
34 lines (24 loc) · 1.13 KB
/
.lvimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
" local vimrc for 3X
" Author: Jaeho Shin <netj@cs.stanford.edu>
" Created: 2013-01-22
let $SourceRoot = expand("<sfile>:h")
let modules = split("assembler docs gui planner results runner setup shell")
let $_3X_ROOT = $SourceRoot."/test-exp"
lcd $SourceRoot
exec "setlocal path+=".join(map(modules,'$SourceRoot."/".v:val'), ",")
setlocal autowrite undofile
" Build with Cmd-Enter
nmap <buffer> <D-CR> :set makeprg=make<CR>:make -C $SourceRoot polish<CR>
imap <buffer> <D-CR> <C-\><C-N><D-CR><CR>gi
" .module.* involves mostly local stuff
au! BufRead,BufNewFile .module.* try | lcd %:h | catch /.*/ | endtry
" Handy command for searching strings in the source code
command! -nargs=1 FindSource
\ exec "lgrep -r <args> ".join(filter(copy(modules),'v:val!=$SourceRoot."/gui"'), " ")
\ ." gui/{3x-*,.module.*,package.json} gui/client/*.{coffee,less,js,html} gui/server"
\ ." --exclude='*/.build/*'"
command! TODOs FindSource TODO
" Ack options
let $ACK_OPTIONS = join(readfile($SourceRoot."/.ackrc"))
" Open the to do list with Shift-Cmd-Enter
"nmap <buffer> <S-D-CR> :split $SourceRoot/docs/TODO.md<CR>