Sei sulla pagina 1di 3

function Filetype_c()

if (! filereadable("Makefile"))
set makeprg=g\ %
endif
endfunction
function Filetype_cxx()
if (! filereadable("Makefile"))
set makeprg=n\ %
endif
endfunction
function Filetype_perl()
setlocal cindent
endfunction
function Filetype_tab2()
setlocal shiftwidth=2
setlocal softtabstop=2
endfunction
function Filetype_tex()
if (! filereadable("Makefile"))
set makeprg=latex\ %
endif
endfunction
function Delete_empty()
if (col("$") == 1)
normal dd
else
echo "Line not empty!"
endif
endfunction
if (v:version >= 600)
filetype plugin indent on
nmap <F13> :call BE()<CR>
highlight! link Folded StatusLine
function BE()
if ! exists("b:folding")
syntax region myFold start="{" end="}" transparent fold
syntax sync fromstart
set foldmethod=syntax
set foldlevel=1
normal zR
endif
endfunction
endif
set nocompatible
set autoindent
set background=dark
set backspace=indent,eol,start
set nobackup
" set cinkeys-=o,O
set cinoptions+=:0,g0
set comments+=nb:>
set cpoptions-=B
set delcombine
set dictionary+=/usr/share/dict/words
set dictionary+=~/etc/dictionary/en
set noequalalways
set expandtab
set formatoptions+=t,c,o,q,n
set guifont=monospace\ bold\ 12
set guioptions-=T
set hlsearch
set ignorecase
set noincsearch
set infercase
set nojoinspaces
set laststatus=2
"set list
"set listchars=eol:\,,tab:>\ ,trail:+,extends:>,precedes:<
" set matchpairs+=<:>
set mouse=nv
set nrformats-=octal,hex
set shiftround
set shiftwidth=4
set shortmess=a
set showcmd
set showmatch
set smartcase
set smarttab
set softtabstop=4
set splitbelow
set splitright
set statusline=%f\ %y%r%1*%m%*%=%<x%02B%4vv%4cc%7l\ %P
highlight! link User1 ErrorMsg
set timeoutlen=100
set title
set wildignore+=*.o,*.obj,*.cmi,*.cmo,*.cma,*.cmx,*.a,*.cmxa,*.rem
set wildignore+=*.aux,*.blg,*.dvi,*.log,*.pdf,*.ps,*.eps
set wildmode=longest,list
set nowritebackup
autocmd BufEnter * let &titlestring = hostname() . ":" . expand("%f
")
autocmd FileType c call Filetype_c()
autocmd FileType cpp call Filetype_cxx()
autocmd FileType perl call Filetype_perl()
autocmd FileType help nmap <C-m> <C-]>
autocmd FileType html setlocal indentkeys-=o,O,*<Return>,<>>,<bs>
autocmd FileType mail setlocal textwidth=76
autocmd FileType html call Filetype_tab2()
autocmd FileType xml call Filetype_tab2()
autocmd FileType ocaml call Filetype_tab2()
autocmd FileType css call Filetype_tab2()
autocmd FileType tex call Filetype_tex()
autocmd BufNewFile *.c 0read ~/.vim/skel/skel.c
autocmd BufNewFile *.cxx 0read ~/.vim/skel/skel.cxx
autocmd BufNewFile *.java 0read ~/.vim/skel/skel.java
autocmd BufNewFile *.plx 0read ~/.vim/skel/skel.plx
autocmd BufRead ~/mail/* setlocal filetype=mail
autocmd BufRead /tmp/mutt* setlocal filetype=mail
autocmd BufRead ~/.signature* setlocal filetype=mail
autocmd BufRead ~/.mutt/* setlocal filetype=muttrc
autocmd BufRead ~/.sawfish/custom setlocal filetype=lisp
autocmd BufRead *.*html* setlocal filetype=html
autocmd BufRead *.blosxom setlocal filetype=html
autocmd BufRead *.css* setlocal filetype=css
autocmd BufRead *.txt* setlocal textwidth=76
highlight Normal gui=NONE guifg=white guibg=black
highlight Comment cterm=NONE ctermfg=darkcyan ctermbg=NONE
highlight StatusLine cterm=underline ctermfg=green ctermbg=NONE
highlight StatusLineNC cterm=underline ctermfg=red ctermbg=NONE
highlight VertSplit cterm=NONE ctermfg=red ctermbg=NONE
highlight htmlItalic cterm=underline ctermfg=darkgreen ctermbg=NONE
highlight htmlBold cterm=underline ctermfg=darkyellow ctermbg=NONE
highlight htmlUnderline cterm=italic
highlight Underlined cterm=underline ctermfg=green
map ' :
noremap ,, \'
nmap Y y$
nmap <M-j> <C-w>w
nmap <M-k> <C-w>W
nmap <F1> :write<CR>
map! <F1> <C-v>u
nmap <F21> :write!<CR>
nmap <F2> :make<CR>
nmap <F22> :copen<CR><C-g>
nmap <F3> :shell<CR>
nmap <F4> :quit<CR>
nmap <F14> :qall<CR>
nmap <F5> :set hlsearch!<CR>
nmap <F15> :set ignorecase!<CR>
nmap <F6> :call Delete_empty()<CR>
nmap <F16> :set makeprg=nn\ %<CR>
set pastetoggle=<F7>
nmap <F17> :set makeprg=gg\ %<CR>
nmap <F8> <C-w>w
nmap <F18> <C-w>_
set <F11>=O2P
set <F12>=O2Q
set <F13>=O2R
set <F14>=O2S
set <F15>=[15;2~
set <F16>=[17;2~
set <F17>=[18;2~
set <F18>=[19;2~
set <F19>=[20;2~
set <F20>=[21;2~
set <F21>=[23;2~
set <F22>=[24;2~
syntax enable

Potrebbero piacerti anche