diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2010-01-02 17:27:44 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2010-01-02 17:27:44 +0100 |
commit | 85b5baef260e770966cdc873a4e8eab05d935b64 (patch) | |
tree | ce4a1bb58100ad1a6307db08b40a94aa16797478 /.vim/ftplugin |
Initial commit of vim config
Diffstat (limited to '.vim/ftplugin')
-rw-r--r-- | .vim/ftplugin/c.vim | 0 | ||||
-rw-r--r-- | .vim/ftplugin/css.vim | 3 | ||||
-rw-r--r-- | .vim/ftplugin/git.vim | 70 | ||||
-rw-r--r-- | .vim/ftplugin/html.vim | 3 | ||||
-rw-r--r-- | .vim/ftplugin/java.vim | 2 | ||||
-rw-r--r-- | .vim/ftplugin/latex.vim | 24 | ||||
-rw-r--r-- | .vim/ftplugin/perl.vim | 3 | ||||
-rw-r--r-- | .vim/ftplugin/php.vim | 27 | ||||
-rw-r--r-- | .vim/ftplugin/python.vim | 7 | ||||
-rw-r--r-- | .vim/ftplugin/ruby.vim | 3 | ||||
-rw-r--r-- | .vim/ftplugin/tex.vim | 24 | ||||
-rw-r--r-- | .vim/ftplugin/udev.vim | 45 | ||||
-rw-r--r-- | .vim/ftplugin/vhdl.vim | 15 |
13 files changed, 226 insertions, 0 deletions
diff --git a/.vim/ftplugin/c.vim b/.vim/ftplugin/c.vim new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.vim/ftplugin/c.vim diff --git a/.vim/ftplugin/css.vim b/.vim/ftplugin/css.vim new file mode 100644 index 0000000..c562ed9 --- /dev/null +++ b/.vim/ftplugin/css.vim @@ -0,0 +1,3 @@ +setlocal tabstop=2 +setlocal shiftwidth=2 +setlocal textwidth=0 diff --git a/.vim/ftplugin/git.vim b/.vim/ftplugin/git.vim new file mode 100644 index 0000000..23ad0a0 --- /dev/null +++ b/.vim/ftplugin/git.vim @@ -0,0 +1,70 @@ +"============================================================================= +" Copyright: Copyright © Pierre Habouzit +" Permission is hereby granted to use and distribute this code, +" with or without modifications, provided that this copyright +" notice is copied with it. Like anything else that's free, +" bufexplorer.vim is provided *as is* and comes with no +" warranty of any kind, either expressed or implied. In no +" event will the copyright holder be liable for any damages +" resulting from the use of this software. +" Description: git-commit(1) helper +" Maintainer: Pierre Habouzit <madcoder@debian.org> +" Last Changed: Mon, 26 Nov 2007 10:06:15 +0100 +" Usage: This file should live in your ftplugin directory. +" +" The configurations variables are: +" +" g:git_diff_opts - options to add to git diff, +" (default "-C -C") +" g:git_diff_spawn_mode - use auto-split on commit ? +" * 1 == hsplit +" * 2 == vsplit +" * none else (default) +" +" The default keymaping is: +" +" <Leader>gd - view the diff in a hsplit +" <Leader>ghd - view the diff in a hsplit +" <Leader>gvd - view the diff in a vsplit +"========================================================================={{{= + +if exists("b:did_ftplugin") | finish | endif + +let b:did_ftplugin = 1 + +setlocal tw=74 +setlocal nowarn nowb + +function! Git_diff_windows(vertsplit, auto, opts) + if a:vertsplit + rightbelow vnew + else + rightbelow new + endif + silent! setlocal ft=diff previewwindow bufhidden=delete nobackup noswf nobuflisted nowrap buftype=nofile + exe "normal :r!LANG=C git diff --stat -p --cached ".a:opts."\no\<esc>1GddO\<esc>" + setlocal nomodifiable + noremap <buffer> q :bw<cr> + if a:auto + redraw! + wincmd p + redraw! + endif +endfunction + +noremap <buffer> <Leader>gd :call Git_diff_windows(0, 0)<cr> +noremap <buffer> <Leader>ghd :call Git_diff_windows(0, 0)<cr> +noremap <buffer> <Leader>gvd :call Git_diff_windows(1, 0)<cr> + +if !exists("g:git_diff_opts") + let g:git_diff_opts = "-C -C" +endif +if exists("g:git_diff_spawn_mode") + if g:git_diff_spawn_mode == 1 + call Git_diff_windows(0, 1, g:git_diff_opts) + elseif g:git_diff_spawn_mode == 2 + call Git_diff_windows(1, 1, g:git_diff_opts) + endif +endif + +" }}} diff --git a/.vim/ftplugin/html.vim b/.vim/ftplugin/html.vim new file mode 100644 index 0000000..c562ed9 --- /dev/null +++ b/.vim/ftplugin/html.vim @@ -0,0 +1,3 @@ +setlocal tabstop=2 +setlocal shiftwidth=2 +setlocal textwidth=0 diff --git a/.vim/ftplugin/java.vim b/.vim/ftplugin/java.vim new file mode 100644 index 0000000..289b7cd --- /dev/null +++ b/.vim/ftplugin/java.vim @@ -0,0 +1,2 @@ +setlocal shiftwidth=4 +setlocal tabstop=4 diff --git a/.vim/ftplugin/latex.vim b/.vim/ftplugin/latex.vim new file mode 100644 index 0000000..a218cc7 --- /dev/null +++ b/.vim/ftplugin/latex.vim @@ -0,0 +1,24 @@ +" some general options + set ai " autoindent + set et " expandtab + set ts=2 " tabstop + set tw=85 " textwidth + +" compile tex-files with latex + set makeprg=latex\ % + +" Inserting pairs of quotes: + imap Y" ``''<Left><Left> + +" Some mappings for often used commands + iab ,b \begin{}<Esc>i + iab ,e \end{}<Esc>i + +" A mapping for more effective use of latex compiling + map <F7> : call CompileRunPDF()<CR> + func! CompileRunPDF() + exec "w" + exec "!latex % && dvipdf %<.dvi && xpdf %<.pdf" + exec "i" + endfunc + diff --git a/.vim/ftplugin/perl.vim b/.vim/ftplugin/perl.vim new file mode 100644 index 0000000..6d2e027 --- /dev/null +++ b/.vim/ftplugin/perl.vim @@ -0,0 +1,3 @@ +setlocal textwidth=72 +setlocal shiftwidth=4 +setlocal tabstop=4 diff --git a/.vim/ftplugin/php.vim b/.vim/ftplugin/php.vim new file mode 100644 index 0000000..c9add0f --- /dev/null +++ b/.vim/ftplugin/php.vim @@ -0,0 +1,27 @@ +" Mostly taken from +" http://www.schlitt.info/applications/blog/index.php?/archives/331-Comfortable-PHP-editing-with-VIM-3.html + +" {{{ Settings + +" Almost PEAR coding standard +set tabstop=2 +set shiftwidth=2 + +" No autowrapping, PHP/HTML can have quite long lines :-/ +set nowrap + +" Auto indent after a { +set autoindent +set smartindent + +" Correct indentation after opening a phpdocblock and automatic * on every +" line +set formatoptions=qroct + +" }}} Settings + +" The completion dictionary is provided by Rasmus: +" http://lerdorf.com/funclist.txt +set dictionary-=/home/tklauser/.php/funclist.txt dictionary+=/home/tklauser/.php/funclist.txt +" Use the dictionary completion +set complete-=k complete+=k diff --git a/.vim/ftplugin/python.vim b/.vim/ftplugin/python.vim new file mode 100644 index 0000000..8a26a0e --- /dev/null +++ b/.vim/ftplugin/python.vim @@ -0,0 +1,7 @@ +setlocal textwidth=0 +setlocal tabstop=4 +setlocal softtabstop=4 +setlocal shiftwidth=4 +setlocal smarttab +setlocal expandtab +setlocal smartindent diff --git a/.vim/ftplugin/ruby.vim b/.vim/ftplugin/ruby.vim new file mode 100644 index 0000000..a906f7e --- /dev/null +++ b/.vim/ftplugin/ruby.vim @@ -0,0 +1,3 @@ +setlocal textwidth=72 +setlocal shiftwidth=2 +setlocal tabstop=2 diff --git a/.vim/ftplugin/tex.vim b/.vim/ftplugin/tex.vim new file mode 100644 index 0000000..a218cc7 --- /dev/null +++ b/.vim/ftplugin/tex.vim @@ -0,0 +1,24 @@ +" some general options + set ai " autoindent + set et " expandtab + set ts=2 " tabstop + set tw=85 " textwidth + +" compile tex-files with latex + set makeprg=latex\ % + +" Inserting pairs of quotes: + imap Y" ``''<Left><Left> + +" Some mappings for often used commands + iab ,b \begin{}<Esc>i + iab ,e \end{}<Esc>i + +" A mapping for more effective use of latex compiling + map <F7> : call CompileRunPDF()<CR> + func! CompileRunPDF() + exec "w" + exec "!latex % && dvipdf %<.dvi && xpdf %<.pdf" + exec "i" + endfunc + diff --git a/.vim/ftplugin/udev.vim b/.vim/ftplugin/udev.vim new file mode 100644 index 0000000..d9f88df --- /dev/null +++ b/.vim/ftplugin/udev.vim @@ -0,0 +1,45 @@ +" Vim syntax file +" Language: udev rules files +" Maintainer: Marco d'Itri <md@linux.it> +" Last Change: 2005 August +" +" This syntax file is unfinished. If you can, please clean it up and submit +" it for inclusion in the vim package. + +if exists("b:current_syntax") + finish +endif + +let b:current_syntax = "udev" + +syn keyword Ucondition ACTION ENV RESULT KERNEL SUBSYSTEM DRIVER ATTR +syn keyword Ucondition KERNELS SUBSYSTEMS DRIVERS ATTRS DEVPATH +syn keyword Ucondition nextgroup=Uparambr,Uoperator +syn keyword Uaction PROGRAM NAME SYMLINK OWNER GROUP MODE RUN OPTIONS +syn keyword Uaction IMPORT GOTO LABEL +syn keyword Uaction nextgroup=Uparambr,Uoperator +syn region Uparambr start=/{/ end=/}/ contains=Uparam +syn match Uparam '[A-Za-z0-9_]*' contained +syn match Ufnmatch "[?*|]" contained +syn region Ufnmatch start=/\[/ skip=/\\\]/ end=/\]/ contained +syn match Uprintf '%[beknMmps%]\|%c{[0-9]}' contained +syn match Ustringvar '\$[a-z]*' nextgroup=Uparambr +syn match Ustring '"[^"]*"' contains=Uprintf,Ufnmatch,Ustringvar +syn match Uoperator "==\|!=\|=\|+=\|:=\|," +syn match Ueol '\\$' +syn region Ucomment start=/#/ end=/$/ +syn keyword Utodo contained TODO FIXME XXX + +hi def link Ucondition Identifier +hi def link Uaction Identifier +hi def link Uparambr Delimiter +hi def link Uparam PreProc +hi def link Ufnmatch Special +hi def link Uprintf Special +hi def link Ustringvar Function +hi def link Ustring String +hi def link Uoperator Operator +hi def link Ueol Delimiter +hi def link Ucomment Comment +hi def link Utodo Todo + diff --git a/.vim/ftplugin/vhdl.vim b/.vim/ftplugin/vhdl.vim new file mode 100644 index 0000000..5c27d4c --- /dev/null +++ b/.vim/ftplugin/vhdl.vim @@ -0,0 +1,15 @@ +setlocal textwidth=0 +setlocal shiftwidth=2 +setlocal tabstop=2 +setlocal expandtab + +" abbreviations +iabbr dt downto +iabbr sig signal +iabbr sl std_logic +iabbr slv std_logic_vector +iabbr uns unsigned +iabbr toi to_integer +iabbr tos to_signed +iabbr tou to_unsigned + |