Maintainer:
set nocompatible
set cpoptions=aABceFs
""
if !has("gui_running")
if &term == 'dterm'
set tsl=0
elseif has("terminfo") && ! (&term == 'linux' || &term == 'Eterm' || &term == 'vt220' || &term == 'nsterm-16color' || &term == 'xterm-16color')
set t_Co=16
set t_AB=^[[%?%p1%{8}%<%t%p1%{40}%+%e%p1%{92}%+%;%dm
set t_AF=^[[%?%p1%{8}%<%t%p1%{30}%+%e%p1%{82}%+%;%dm
elseif &term == 'term' || &term == 'rxvt' || &term == 'vt100' || &term == 'screen'
set t_Co=16
set t_AB=^[[%?%p1%{8}%<%t4%p1%d%e%p1%{32}%+%d;1%;m
set t_AF=^[[%?%p1%{8}%<%t3%p1%d%e%p1%{22}%+%d;1%;m
else
if &term == 'vt220'
set t_Co=8
set t_Sf=^[[3%dm
set t_Sb=^[[4%dm
elseif $TERM == 'xterm'
set term=xterm-color
endif
endif
endif
if &term == 'term' || &term == 'aterm' || &term == 'Eterm' || &term == 'nsterm-16color'
set ttyfast
endif
set backspace=2
if has("mouse")
set mouse=a
set mousehide
set mousemodel=popup_setpos
endif
if has("multi_byte")
set encoding=utf-8
if $LANG !~ '\(UTF\|utf\)-\?8' && $LC_CTYPE !~ '\(UTF\|utf\)-\?8'
set termencoding=latin1
endif
endif
if has("autocmd")
autocmd BufEnter * let &titlestring="VIM - ".expand("%:p")
endif
if version >= 600
filetype plugin indent on
else
filetype on
endif
if &t_Co > 2 || has("gui_running")
syntax on
endif
set modelines=5
set background=dark
if ( &term != "Eterm" )
colorscheme kyle
endif
if has("eval")
let is_bash=1
endif
set formatoptions+=tcrq2
set ai nosi
set winminheight=0
if has("autocmd")
autocmd Syntax mixed so ~/.vim/syntax/cmix.vim
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
au BufRead,BufNewFile *.vim set filetype=vim
au BufRead,BufNewFile *.txt setfiletype text
au BufRead,BufNewFile *.tex set filetype=tex
autocmd BufRead,BufNewFile *.gplot setfiletype gnuplot
autocmd BufRead,BufNewFile *.dt set filetype=dtrace
if $LANG =~ '^en_US.\(UTF\|utf\)-\?8$' || $LC_CTYPE =~ '^en_US.\(UTF\|utf\)-\?8$'
autocmd FileType mail if strlen($pinevim) == 0 | call UniCycleOn() | endif
endif
autocmd FileType mail set nosi textwidth=70 expandtab comments+=nb:> formatoptions+=aw
autocmd FileType mail command! Fixq call Fixflowed()
autocmd Filetype mail vmap <Esc>[1;5C :s/\(.*\)\n/>\1\r/g<CR>:nohlsearch<CR>k
autocmd Filetype mail imap <Esc>[1;5C <Esc>:s/\(.*\)\n/>\1\r/g<CR>:nohlsearch<CR>ka
autocmd Filetype mail nmap <Esc>[1;5C :s/\(.*\)\n/>\1\r/g<CR>:nohlsearch<CR>k
autocmd Filetype mail vmap <Esc>[1;5D :s/>\(.*\)\n/\1\r/g<CR>:nohlsearch<CR>k
autocmd Filetype mail imap <Esc>[1;5D <Esc>:s/>\(.*\)\n/\1\r/g<CR>:nohlsearch<CR>ka
autocmd Filetype mail nmap <Esc>[1;5D :s/>\(.*\)\n/\1\r/g<CR>:nohlsearch<CR>k
autocmd Filetype mail autocmd BufWritePre <buffer> call Fixindented()
autocmd Filetype mail call Fixapplemailflowed()
autocmd Filetype c,cpp,java,objc,cuda set cin tabstop=8 softtabstop=4 shiftwidth=4 formatoptions+=c formatoptions-=w
autocmd FileType text,tex,cvs set textwidth=78 nosi noai expandtab fo+=aw
autocmd Filetype scheme,lisp set lisp
endif
if has("eval")
let c_gnu=1
let c_space_errors=1
endif
if version >= 700
let loaded_matchparen = 1
set spelllang=en
set spellfile=~/.conf/vim/spellfile.utf-8.add
if has("autocmd")
autocmd FileType mail,tex set spell
endif
endif
if &t_Co > 2 || has("gui_running") && has("extra_search")
set hlsearch
map <C-n> :nohlsearch<CR>
imap <C-n> <Esc>:nohlsearch<CR>a
endif
set ignorecase
set smartcase
set incsearch
set grepprg=grep\ -nH\ $*
set suffixes=.bak,~,.o,.h,.info,.swp,.obj,.class,.doc,.aux,.log,.dvi,.bbl,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc,.lof,.lot,.dvi,.blg,.pdf
set pastetoggle=<F1>
if has("linebreak")
set linebreak
endif
nmap <silent> <C-p> :call setreg("z", system("pbpaste"))<CR>"zp
imap <silent> <C-p> <Esc>:call setreg("z", system("pbpaste"))<CR>"zpa
set noexpandtab
set tabstop=4
set softtabstop=0
set shiftwidth=4
set showmode
set ruler
set showmatch
set matchtime=3
set nobackup
set nowritebackup
set nojoinspaces
if has('folding')
set foldenable
set foldmethod=manual
if has('autocmd')
autocmd FileType c,cpp,java,cuda set foldmethod=marker
endif
endif
if has('wildignore')
set wildignore=*.o,*.obj,*.bak,*.tmp,*.d
endif
set wildmode=longest,list,full
if has('wildmenu')
set wildmenu
endif
map <C-E> <End>
map! <C-E> <End>
map <C-A> <Home>
map! <C-A> <Home>
map <C-U> v^x
imap <C-T> <Esc>v^xi
map <C-K> D
map! <C-K> <Esc><Right>Da
map <C-?> <C-H>
map! <C-?> <C-H>
if ! has('gui_running')
map <Esc>[F <End>
map! <Esc>[F <End>
map <Esc>[8~ <End>
map! <Esc>[8~ <End>
map <Esc>[H <Home>
map! <Esc>[H <Home>
map <Esc>[7~ <Home>
map! <Esc>[7~ <Home>
map <Esc>[5~ <PageUp>
map! <Esc>[5~ <PageUp>
map <Esc>[6~ <PageDown>
map! <Esc>[6~ <PageDown>
map <c-?> <BS>
map! <c-?> <BS>
endif
if ! has('gui_running')
map <Esc>Oy 9
map! <Esc>Oy 9
map <Esc>Ox 8
map! <Esc>Ox 8
map <Esc>Ow 7
map! <Esc>Ow 7
map <Esc>Ov 6
map! <Esc>Ov 6
map <Esc>Ou 5
map! <Esc>Ou 5
map <Esc>Ot 4
map! <Esc>Ot 4
map <Esc>Os 3
map! <Esc>Os 3
map <Esc>Or 2
map! <Esc>Or 2
map <Esc>Oq 1
map! <Esc>Oq 1
map <Esc>Op 0
map! <Esc>Op 0
map <Esc>On .
map! <Esc>On .
map <Esc>Oo /
map! <Esc>Oo /
map <Esc>Oj *
map! <Esc>Oj *
map <Esc>Om -
map! <Esc>Om -
map <Esc>Ok +
map! <Esc>Ok +
endif
if executable("gnuindent")
function! KBW_Indent()
let l = line(".")
let c = col(".")
execute '%!gnuindent'
execute l . " normal " . c . "|"
endfunction
elseif executable("indent")
function! KBW_Indent()
let l = line(".")
let c = col(".")
execute '%!indent'
execute l . " normal " . c . "|"
endfunction
else
function! KBW_Indent()
echo "Sorry, no indent was found on your system."
endfunction
endif
map <C-T> :call KBW_Indent()<CR>
imap <C-T> <Esc>:call KBW_Indent()<CR>a
map <C-P> :%!gpg --noverbose --output - --armor --textmode --
if has("user_commands")
function! ReverseVideo()
highlight Normal ctermbg=White ctermfg=Black guifg=Gray guibg=Black
endfunction
function! Fixflowed()
let pos = getpos(".")
silent! %s/\([^]> :]\)\ze\n>[> ]*[^> ]/\1 /g
silent! %s/ \+\ze\n[> ]*$//
silent! %s/ \{2,}$/ /
silent! %s/^[> ]*>\ze[^> ]/& /
while search('^>\+ >', 'w') > 0
s/^>\+\zs >/>/
endwhile
call setpos('.',pos)
endfunction
function! Fixapplemailflowed()
let pos = getpos(".")
silent! %s/ \{2,}$/ /
call setpos('.',pos)
endfunction
function! Fixindented()
silent! %s/^\s.*\zs \+$//
endfunction
function! TeX_quote()
let l = line(".")
let c = col(".")
if synIDattr(synID(l, c, 1), "name") =~ "^texMath"
\ || (c > 1 && getline(l)[c-2] == '\')
return '"'
endif
if exists("g:TeX_open")
let open = g:TeX_open
else
let open = "``"
endif
if exists("g:TeX_close")
let close = g:TeX_close
else
let close = "''"
endif
let boundary = '\|'
if exists("g:TeX_strictquote")
if( g:TeX_strictquote == "open" || g:TeX_strictquote == "both" )
let boundary = '\<' . boundary
endif
if( g:TeX_strictquote == "close" || g:TeX_strictquote == "both" )
let boundary = boundary . '\>'
endif
endif
let q = open
let ws_save = &wrapscan
set wrapscan
while 1
execute 'normal ?^$\|"\|' . open . boundary . close . "\r"
if synIDattr(synID(line("."), col("."), 1), "name") !~ "^texMath"
\ && (col(".") == 1 || getline(".")[col(".")-2] != '\')
break
endif
endwhile
if ( line(".") < l || line(".") == l && col(".") < c )
if strlen(getline("."))
if ( getline(".")[col(".")-1] == open[0] )
let q = close
endif
endif
endif
execute l . " normal " . c . "|"
let &wrapscan = ws_save
return q
endfunction
if has("autocmd")
autocmd BufEnter *.tex,*.sty inoremap "
\
autocmd BufLeave *.tex,*.sty iunmap "
endif
endif
if filereadable($HOME . '/.vimrc.local')
source $HOME/.vimrc.local
endif