diff options
author | doy <doy@tozt.net> | 2009-01-03 01:26:09 -0500 |
---|---|---|
committer | doy <doy@tozt.net> | 2009-01-03 01:26:09 -0500 |
commit | eed03516376ec595b6cc0c57f13c5e0a57e20480 (patch) | |
tree | 0cd7c20385c57ac40eb0e4ab183eb1691482702e /vim | |
parent | a65a2e3e1e74e1fb79ec98cc1c33a7ebc301f131 (diff) | |
download | conf-eed03516376ec595b6cc0c57f13c5e0a57e20480.tar.gz conf-eed03516376ec595b6cc0c57f13c5e0a57e20480.zip |
move all of the FileType autocommands into files under ftplugin/
Diffstat (limited to 'vim')
-rw-r--r-- | vim/ftplugin/help.vim | 3 | ||||
-rw-r--r-- | vim/ftplugin/lua.vim | 11 | ||||
-rw-r--r-- | vim/ftplugin/perl.vim | 14 | ||||
-rw-r--r-- | vim/ftplugin/tex.vim | 37 | ||||
-rw-r--r-- | vim/ftplugin/vim.vim | 1 |
5 files changed, 66 insertions, 0 deletions
diff --git a/vim/ftplugin/help.vim b/vim/ftplugin/help.vim new file mode 100644 index 0000000..1fbe614 --- /dev/null +++ b/vim/ftplugin/help.vim @@ -0,0 +1,3 @@ +setlocal keywordprg=:help +nnoremap <buffer> <CR> <C-]> +nnoremap <buffer> <BS> <C-T> diff --git a/vim/ftplugin/lua.vim b/vim/ftplugin/lua.vim new file mode 100644 index 0000000..fc0d0fc --- /dev/null +++ b/vim/ftplugin/lua.vim @@ -0,0 +1,11 @@ +" :make does a syntax check +setlocal makeprg=luac\ -p\ % +setlocal errorformat=luac:\ %f:%l:\ %m + +" set commentstring +setlocal commentstring=--%s + +" treat require lines as include lines (for tab completion, etc) +setlocal include=\\s*require\\s* +setlocal includeexpr=substitute(v:fname,'\\.','/','g').'.lua' +exe "setlocal path=" . system("lua -e 'local fpath = \"\" for path in package.path:gmatch(\"[^;]*\") do if path:match(\"\?\.lua$\") then fpath = fpath .. path:gsub(\"\?\.lua$\", \"\") .. \",\" end end print(fpath:gsub(\",,\", \",.,\"):sub(0, -2))'") diff --git a/vim/ftplugin/perl.vim b/vim/ftplugin/perl.vim new file mode 100644 index 0000000..ecd8f31 --- /dev/null +++ b/vim/ftplugin/perl.vim @@ -0,0 +1,14 @@ +" :make does a syntax check +setlocal makeprg=$VIMRUNTIME/tools/efm_perl.pl\ -c\ %\ $* +setlocal errorformat=%f:%l:%m + +" look up words in perldoc rather than man for K +setlocal keywordprg=perldoc\ -f + +" treat use lines as include lines (for tab completion, etc) +" XXX: it would be really sweet to make gf work with this, but unfortunately +" that checks the filename directly first, so things like 'use Moose' bring +" up the $LIB/Moose/ directory, since it exists, before evaluating includeexpr +setlocal include=\\s*use\\s* +setlocal includeexpr=substitute(v:fname,'::','/','g').'.pm' +exe "setlocal path=" . system("perl -e 'print join \",\", @INC;'") . ",lib" diff --git a/vim/ftplugin/tex.vim b/vim/ftplugin/tex.vim new file mode 100644 index 0000000..78ce3cc --- /dev/null +++ b/vim/ftplugin/tex.vim @@ -0,0 +1,37 @@ +" :make converts to pdf +if strlen(system('which xpdf')) && strlen(expand('$DISPLAY')) + setlocal makeprg=(cd\ %:h\ &&\ pdflatex\ %:t\ &&\ xpdf\ $(echo\ %:t\ \\\|\ sed\ \'s/\\(\\.[^.]*\\)\\?$/.pdf/\')) +elseif strlen(system('which evince')) && strlen(expand('$DISPLAY')) + setlocal makeprg=(cd\ %:h\ &&\ pdflatex\ %:t\ &&\ evince\ $(echo\ %:t\ \\\|\ sed\ \'s/\\(\\.[^.]*\\)\\?$/.pdf/\')) +else + setlocal makeprg=(cd\ %:h\ &&\ pdflatex\ %:t) +endif +" see :help errorformat-LaTeX +setlocal errorformat= + \%E!\ LaTeX\ %trror:\ %m, + \%E!\ %m, + \%+WLaTeX\ %.%#Warning:\ %.%#line\ %l%.%#, + \%+W%.%#\ at\ lines\ %l--%*\\d, + \%WLaTeX\ %.%#Warning:\ %m, + \%Cl.%l\ %m, + \%+C\ \ %m., + \%+C%.%#-%.%#, + \%+C%.%#[]%.%#, + \%+C[]%.%#, + \%+C%.%#%[{}\\]%.%#, + \%+C<%.%#>%.%#, + \%C\ \ %m, + \%-GSee\ the\ LaTeX%m, + \%-GType\ \ H\ <return>%m, + \%-G\ ...%.%#, + \%-G%.%#\ (C)\ %.%#, + \%-G(see\ the\ transcript%.%#), + \%-G\\s%#, + \%+O(%f)%r, + \%+P(%f%r, + \%+P\ %\\=(%f%r, + \%+P%*[^()](%f%r, + \%+P[%\\d%[^()]%#(%f%r, + \%+Q)%r, + \%+Q%*[^()])%r, + \%+Q[%\\d%*[^()])%r diff --git a/vim/ftplugin/vim.vim b/vim/ftplugin/vim.vim new file mode 100644 index 0000000..24dd22c --- /dev/null +++ b/vim/ftplugin/vim.vim @@ -0,0 +1 @@ +setlocal keywordprg=:help |