if has('eval') | unlet! g:colors_name | endif
if has('multi_byte')
scriptencoding utf-8
set enc=utf-8
set fileencodings=ucs-bom,utf-8,latin1
if version >= 700
set lcs=tab:»·,trail:·,eol:¶,extends:>,precedes:<,nbsp:×
else
set lcs=tab:»·,trail:·,eol:¶,extends:>,precedes:<
endif
endif
if has('syntax') | syntax on | endif
if has('autocmd')
filetype on
filetype plugin on
endif
if has('gui_running')
if has("win16") || has("win32") || has("win95") || has("win64")
set guifont=Lucida\ Console:h10
else
set guifont=Monospace\ 9
endif
if exists('+toolbar') | set tb=icons | endif
if exists('tbis') | set tbis=tiny | endif
else
if has('eval') | let Tlist_Inc_Winwidth=0 | endif
endif
if exists('+fsync') | set nofsync | endif
set timeout timeoutlen=3000 ttimeoutlen=100
set nocompatible
set history=400
set textwidth=0
set backup
if has('persistent_undo')
set undodir=~/UNDO
set undofile
endif
if exists('+undoreload') | set undoreload=100000 | endif
if exists('+cryptmethod') | set cryptmethod=blowfish | endif
if has('mouse') | set mouse=vic | endif
set wildmode=longest,list
set wildmenu
set splitbelow
set hidden
set nostartofline
set cpoptions=ces$
set backspace=indent,eol,start
set whichwrap+=<,>,[,]
set wrap
set showbreak=:
set laststatus=2
set shiftwidth=2
set shiftround
set softtabstop=2
set autoindent
set smartindent
set expandtab
set ignorecase
set infercase
set smartcase
set cino:0
set comments=sr:/*,mb:*,ex:*/
set formatoptions=tcqor
if exists('+autochdir') | set autochdir | endif
set visualbell
if has('cmdline_info')
set ruler
set showcmd
endif
set nonumber
set showmatch
if has('extra_search')
set hlsearch
set incsearch
endif
set nolist
set matchpairs+=<:>
set virtualedit=block
set display=lastline,uhex
set tags=tags,~/tags,~/stl-tags
set thesaurus=~/thesaurus/mthesaur.txt
if has('cscope')
if filereadable(expand("$HOME/cscope.out"))
cs kill -1
cs add ~/cscope.out
endif
set cscopeverbose
set cscopequickfix=s-,c-,d-,i-,t-,e-,g-
endif
set makeprg=make\ VERBOSE=\ DEBUG=yes
if has('eval')
let g:lex_uses_cpp=1
let g:yacc_uses_cpp=1
let g:load_doxygen_syntax=1
let g:is_posix=1
let g:c_gnu=1
let g:netrw_special_syntax=1
let g:netrw_liststyle=3
let g:netrw_browse_split=4
let g:vimsyntax_noerror=1
let Tlist_Process_File_Always = 1
let html_use_css=1
let html_use_xhtml=1
let html_dynamic_folds=1
let g:CSApprox_attr_map = { 'bold' : 'bold', 'italic' : '', 'sp' : '' }
endif
vnoremap > >gv
vnoremap < <gv
noremap <c-]> g<c-]>
noremap <c-g> g<c-g>
noremap <down> gj
noremap <up> gk
map <F2> :set paste!<CR>:set paste?<CR>
imap <F2> <C-O>:set paste<CR>:set paste?<CR>
map <F3> :set number!<CR>:set number?<CR>
imap <F3> <C-O>:set number!<CR><C-O>:set number?<CR>
map <F4> :set hlsearch!<CR>:set hlsearch?<CR>
imap <F4> <C-O>:set hlsearch!<CR><C-O>:set hlsearch?<CR>
map <F5> :set list!<CR>:set list?<CR>
imap <F5> <C-O>:set list!<CR><C-O>:set list?<CR>
nnoremap <silent> <F6> :TlistToggle<CR>
if has('spell')
set spell
if has('eval')
let g:myLangIdx = 0
let g:myLangCodes = [ "en_us", "eo", "fr", "it", "br" ]
let g:myLangs = [ "language:", "lingvo:", "langue :", "lingua:", "yezh:" ]
function! MySpellLang()
let g:myLangIdx = g:myLangIdx + 1
if g:myLangIdx >= len(g:myLangs) | let g:myLangIdx = 0 | endif
if g:myLangIdx == 0 | setlocal spell spelllang=en_us | endif
if g:myLangIdx == 1 | setlocal spell spelllang=eo | endif
if g:myLangIdx == 2 | setlocal spell spelllang=fr | endif
if g:myLangIdx == 3 | setlocal spell spelllang=it | endif
if g:myLangIdx == 4 | setlocal spell spelllang=br | endif
echo g:myLangs[g:myLangIdx] g:myLangCodes[g:myLangIdx]
endf
map <F7> :call MySpellLang()<CR>
imap <F7> <C-o>:call MySpellLang()<CR>
endif
map <F8> :set spell!<CR>
endif
nnoremap <F9> yyp<c-v>$r-
inoremap <F9> <esc>yyp<c-v>$r-A
map <F10> :echo "hi<"
\ . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
\ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<"
\ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name")
\ . ">"<CR>
map <F12> :!ctags -R --c++-kinds=+p --fields=+iaSn --extra=+q .<CR>
inoremap <c-u> <c-g>u<c-u>
inoremap <c-w> <c-g>u<c-w>
inoremap <bs> <c-g>u<bs>
inoremap <del> <c-g>u<del>
inoremap <tab> <tab><c-g>u
if version >= 700 && has('autocmd')
au! CursorHoldI * call feedkeys("\<C-G>u", "nt")
endif
set undolevels=4000
function! SyntaxItem()
return synIDattr(synID(line("."),col("."),1),"name")
endfunction
fun! ShowUtf8Sequence()
try
let p = getpos('.')
redir => utfseq
sil normal! g8
redir End
call setpos('.', p)
return substitute(matchstr(utfseq, '\x\+ .*\x'), '\<\x', '0x&', 'g')
catch
return '?'
endtry
endfunction
if has('statusline')
if version >= 700
set statusline =
set statusline+=%#User1#
set statusline+=%n
set statusline+=%{'/'.bufnr('$')}\
set statusline+=%#User2#
set statusline+=%f
set statusline+=%#User1#
set statusline+=%h%m%r%w\
set statusline+=%{(&key==\"\"?\"\":\"encr,\")}
set statusline+=%{strlen(&ft)?&ft:'none'},
set statusline+=%{(&fenc==\"\"?&enc:&fenc)},
set statusline+=%{((exists(\"+bomb\")\ &&\ &bomb)?\"B,\":\"\")}
set statusline+=%{&fileformat},
set statusline+=%{&spelllang},
set statusline+=%(%{Tlist_Get_Tagname_By_Line()}%),
set statusline+=%{SyntaxItem()}
set statusline+=%=
set statusline+=%#User2#
set statusline+=%{ShowUtf8Sequence()}\
set statusline+=%#User1#
set statusline+=U+%04B\
set statusline+=%-6.(%l/%{line('$')},%c%V%)\ %<%P
let g:Active_statusline=&g:statusline
let g:NCstatusline=substitute(
\ substitute(g:Active_statusline,
\ 'User1', 'User3', 'g'),
\ 'User2', 'User4', 'g')
endif
endif
iab 8< --- 8< --- cut here --- 8< --- cut here --- 8< ---
iab fori for (i = 0; i <; i++)<cr>{<cr>}<Esc>kk0f<a
iab forj for (j = 0; j <; j++)<cr>{<cr>}<Esc>kk0f<a
if !exists(':DiffOrig')
command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
\ | wincmd p | diffthis
endif
if version >= 700
if has('insert_expand')
let OmniCpp_NamespaceSearch = 1
let OmniCpp_GlobalScopeSearch = 1
let OmniCpp_ShowAccess = 1
let OmniCpp_MayCompleteDot = 1
let OmniCpp_MayCompleteArrow = 1
let OmniCpp_MayCompleteScope = 1
let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]
if has('autocmd')
au! CursorMovedI,InsertLeave * if pumvisible() == 0 | sil! pclose | endif
set completeopt=menuone,longest,preview
endif
endif
endif
if has('autocmd')
au! BufWritePost .vimrc nested source %
if version >= 700
if &term =~ "xterm\\|rxvt"
"\033]12;red\007"
let &t_SI = "\033]12;orange\007"
let &t_EI = "\033]12;red\007"
au! VimLeave * :sil !echo -ne "\033]12;red\007"
endif
endif
augroup Binary
au!
au BufReadPre *.dat let &bin=1
au BufReadPost *.dat if &bin | %!xxd
au BufReadPost *.dat set ft=xxd | endif
au BufWritePre *.dat if &bin | %!xxd -r
au BufWritePre *.dat endif
au BufWritePost *.dat if &bin | %!xxd
au BufWritePost *.dat set nomod | endif
augroup END
augroup CursorHighlight
au!
au WinEnter * let&l:statusline = g:Active_statusline
au WinLeave * let&l:statusline = g:NCstatusline
augroup END
endif
if &term != 'cygwin' && &term != 'linux'
set t_Co=256
endif
nmap <C-_><C-_> :call SmartTag#SmartTag("goto")<CR>
nmap <C-_><C-W> :call SmartTag#SmartTag("split")<CR>
nmap <C-_><C-T> :call SmartTag#SmartTag("tab")<CR>
nmap <C-_><C-D> :call SmartTag#SmartTag("debug")<CR>
colorscheme rastafari