Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 8925026055
Fetching contributors…

Cannot retrieve contributors at this time

executable file 216 lines (197 sloc) 6.956 kb
" Vim package management
call pathogen#infect('bundle')
call pathogen#helptags()
syntax on
"colorscheme wombat256
colorscheme molokai
set ignorecase
set smartcase
set incsearch
set hlsearch
set mouse=a
set guioptions+=a
set nocp
filetype plugin on
set t_Co=256
set number
set cc=80
set nocompatible
let g:tex_flavor='latex'
set grepprg=grep\ -nH\ $*
highlight Comment cterm=italic
highlight ColorColumn ctermbg=8
set laststatus=2
" Defaults
autocmd BufEnter *.html set ai sw=2 ts=2
autocmd BufEnter *.c set ai sw=4 ts=4
autocmd BufEnter *.py set ai et ts=4 sw=4 sts=4
autocmd BufEnter *.s set ai et ts=4 sw=4 sts=4 syn=mips
autocmd BufEnter *.lua set ai et ts=4 sw=4 sts=4
autocmd BufEnter *.hs set ai et ts=4 sw=4 sts=4
autocmd BufEnter *.java set ai et sw=4 ts=4 sts=4
autocmd BufEnter *.cpp set ai sw=4 ts=4
autocmd BufEnter *.h set ai sw=4 ts=4
" Compiz
autocmd BufEnter */Compiz/*/*.cpp set ai sw=4 sts=4 ts=8
autocmd BufEnter */Compiz/*/*.h set ai sw=4 sts=4 ts=8
autocmd BufEnter */Compiz/*/*.c set ai sw=4 sts=4 ts=8
autocmd BufEnter simple-ccsm.in set ai et ts=4 sw=4 sts=4
autocmd BufEnter sharez.in set ai et ts=4 sw=4 sts=4
" Custom filetype support
autocmd BufRead *.vala set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
autocmd BufRead *.vapi set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
au BufRead,BufNewFile *.vala setfiletype vala
au BufRead,BufNewFile *.vapi setfiletype vala
au BufRead,BufNewFile *.s setfiletype mips
" Keybinding
vmap <C-c> "*y
vmap <C-v> "*p
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
nnoremap * /\<<C-R>=expand('<cword>')<CR>\><CR>
nnoremap # ?\<<C-R>=expand('<cword>')<CR>\><CR>
nnoremap g[ :cs find 3 <C-R>=expand("<cword>")<CR><CR>
nnoremap g/ :cs find 0 <C-R>=expand("<cword>")<CR><CR>
let Tlist_Ctags_Cmd = "/usr/bin/ctags"
let Tlist_WinWidth = 50
map <F4> :TlistToggle<cr>
map <F8> :!/usr/bin/ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<cr>
map <F9> :!/usr/bin/cscope -uUR<cr>
set tags=./tags;/
if has("cscope")
set csprg=~/bin/cscope
set csto=0
set cst
set nocsverb
" add any database in current directory
if filereadable("cscope.out")
cs add cscope.out
" else add database pointed to by environment
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
endif
fun! RangerChooser()
exec "silent !ranger --choosefile=/tmp/chosenfile " . expand("%:p:h")
if filereadable('/tmp/chosenfile')
exec 'tabnew ' . system('cat /tmp/chosenfile')
call system('rm /tmp/chosenfile')
endif
redraw!
endfun
map ,r :call RangerChooser()<CR>
" TabLine {{{
set showtabline=2 " 0, 1 or 2; when to use a tab pages line
set tabline=%!MyTabLine() " custom tab pages line
function MyTabLine()
let s = '' " complete tabline goes here
" loop through each tab page
for t in range(tabpagenr('$'))
" set highlight for tab number and &modified
let s .= '%#TabLineSel#'
" set the tab page number (for mouse clicks)
let s .= '%' . (t + 1) . 'T'
" set page number string
let s .= t + 1 . ':'
" get buffer names and statuses
let n = '' "temp string for buffer names while we loop and check buftype
let m = 0 " &modified counter
let bc = len(tabpagebuflist(t + 1)) "counter to avoid last ' '
" loop through each buffer in a tab
for b in tabpagebuflist(t + 1)
" buffer types: quickfix gets a [Q], help gets [H]{base fname}
" others get 1dir/2dir/3dir/fname shortened to 1/2/3/fname
if getbufvar( b, "&buftype" ) == 'help'
let n .= '[H]' . fnamemodify( bufname(b), ':t:s/.txt$//' )
elseif getbufvar( b, "&buftype" ) == 'quickfix'
let n .= '[Q]'
else
let n .= pathshorten(bufname(b))
endif
" check and ++ tab's &modified count
if getbufvar( b, "&modified" )
let m += 1
endif
" no final ' ' added...formatting looks better done later
if bc > 1
let n .= ' '
endif
let bc -= 1
endfor
" add modified label [n+] where n pages in tab are modified
if m > 0
let s .= '[' . m . '+]'
endif
" select the highlighting for the buffer names
" my default highlighting only underlines the active tab
" buffer names.
if t + 1 == tabpagenr()
let s .= '%#TabLine#'
else
let s .= '%#TabLineSel#'
endif
" add buffer names
let s .= n
" switch to no underlining and add final space to buffer list
let s .= '%#TabLineSel#' . ' '
endfor
" after the last tab fill with TabLineFill and reset tab page nr
let s .= '%#TabLineFill#%T'
" right-align the label to close the current tab page
if tabpagenr('$') > 1
let s .= '%=%#TabLineFill#%999Xx'
endif
return s
endfunction
" }}}
" neocomplete {{{
let g:acp_enableAtStartup = 0
let g:neocomplcache_enable_at_startup = 1
let g:neocomplcache_enable_smart_case = 1
let g:neocomplcache_enable_camel_case_completion = 1
let g:neocomplcache_enable_underbar_completion = 1
let g:neocomplcache_min_syntax_length = 3
let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'
" Define dictionary.
let g:neocomplcache_dictionary_filetype_lists = {
\ 'default' : '',
\ 'vimshell' : $HOME.'/.vimshell_hist',
\ 'scheme' : $HOME.'/.gosh_completions'
\ }
" Define keyword.
if !exists('g:neocomplcache_keyword_patterns')
let g:neocomplcache_keyword_patterns = {}
endif
let g:neocomplcache_keyword_patterns['default'] = '\h\w*'
" Plugin key-mappings.
imap <C-k> <Plug>(neocomplcache_snippets_expand)
smap <C-k> <Plug>(neocomplcache_snippets_expand)
inoremap <expr><C-g> neocomplcache#undo_completion()
inoremap <expr><C-l> neocomplcache#complete_common_string()
" Recommended key-mappings.
" <CR>: close popup and save indent.
inoremap <expr><CR> neocomplcache#smart_close_popup() . "\<CR>"
" <TAB>: completion.
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" <C-h>, <BS>: close popup and delete backword char.
inoremap <expr><C-h> neocomplcache#smart_close_popup()."\<C-h>"
inoremap <expr><BS> neocomplcache#smart_close_popup()."\<C-h>"
inoremap <expr><C-y> neocomplcache#close_popup()
inoremap <expr><C-e> neocomplcache#cancel_popup()
" Enable omni completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
" Enable heavy omni completion.
if !exists('g:neocomplcache_omni_patterns')
let g:neocomplcache_omni_patterns = {}
endif
let g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::'
let g:neocomplcache_omni_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
let g:neocomplcache_omni_patterns.c = '\%(\.\|->\)\h\w*'
let g:neocomplcache_omni_patterns.cpp = '\h\w*\%(\.\|->\)\h\w*\|\h\w*::'
" }}}
Jump to Line
Something went wrong with that request. Please try again.