Skip to content

Instantly share code, notes, and snippets.

@akvadrako
Created April 11, 2013 16:06
Show Gist options
  • Save akvadrako/5364694 to your computer and use it in GitHub Desktop.
Save akvadrako/5364694 to your computer and use it in GitHub Desktop.
""""""""""""
""
"" Devin's VIM Settings
""
"""""""""""
" Options
set autoindent
set autowrite
set backspace=indent,eol,start
set cindent
set cinkeys=0{,0},0),:,!^F,o,O,e
set cinoptions=f0,{0,t0,(0,u0,w1,W1s,)60,*60
set cpo&vim
set diffopt+=icase,iwhite,filler
set encoding=utf8
set expandtab
set fileencoding=utf8
set fileencodings=ucs-bom,utf-8,default
set foldmethod=syntax
set formatoptions=crn
set guifont=Andale\ Mono:h13
set guioptions-=tT
set history=60
set hlsearch
set incsearch
set laststatus=2
set modeline
set modelines=5
set mouse=a
set mp=gmake
set nocompatible
set runtimepath=$DEV/vim,$VIMRUNTIME
set ruler
set ruler
set shiftround
set shiftwidth=4
set shortmess-=tT
set showcmd
set showmatch
set smartindent
set smarttab
set softtabstop=4
set tabstop=8
set viminfo='20,\"80,c
" set viminfo+=,n$DEV/vim/viminfo
"map! <buffer> <C-M> <Esc>:CoffeeMake
autocmd BufWritePost *.coffee silent CoffeeMake! -b | cwindow | redraw!
syntax on
colorscheme ron
filetype plugin indent on
call pathogen#infect('$HOME/repos/vim')
" enable smart pasting on OS X
if &term =~ "xterm.*"
let &t_ti = &t_ti . "\e[?2004h"
let &t_te = "\e[?2004l" . &t_te
function XTermPasteBegin(ret)
set pastetoggle=<Esc>[201~
set paste
return a:ret
endfunction
map <expr> <Esc>[200~ XTermPasteBegin("i")
imap <expr> <Esc>[200~ XTermPasteBegin("")
cmap <Esc>[200~ <Nop>
cmap <Esc>[201~ <Nop>
endif
""""""""""""""
" from extra
hi PreProc ctermfg=Green
hi Normal guibg=grey95
" hi Comment ctermfg=cyan
" colorscheme murphy
" Other fine schemes: elflord default evening desert
imap <C-w> <C-o><C-w>
" handle quickly moving through error lists
map <C-E> :cn<CR>zx<CR>
map! <C-E> <Esc><C-E>
map <leader>\ :let @/=""<bar>echo "Search pattern cleared"<cr>
" handle Tab as autocomplete
function! CleverTab()
if strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$'
return "\<Tab>"
else
return "\<C-N>"
endfunction
inoremap <Tab> <C-R>=CleverTab()<CR>
autocmd BufRead,BufNewFile *.scss set filetype=scss
autocmd FileType python let &makeprg='pyflakes %:p'
set errorformat=%f:%l:\ %m
au BufRead,BufNewFile *.cf set ft=cf3
au BufRead,BufNewFile *.nse set ft=lua
augroup devinbayer
autocmd!
" recognize more stuff in code
autocmd BufRead,BufNewFile *.[ch] syntax match Type "\<[a-z_0-9]*_t\>"
" autocmd BufRead,BufNewFile *.[ch] syntax clear cErrInParen
autocmd BufRead,BufNewFile *.asm syntax match Number /[0-9][a-fA-F0-9]*h/
" don't un-indent CPP or labels
inoremap # <C-V>#
inoremap : <C-V>:
"add support for reading mcrypt-ed files
autocmd BufReadPre,FileReadPre *.nc setlocal viminfo=autocmd
autocmd BufReadPre,FileReadPre *.nc setlocal noswapfile
autocmd BufReadPre,FileReadPre *.nc setlocal bin
autocmd BufReadPre,FileReadPre *.nc let ch_save = &ch|set ch=2
autocmd BufReadPost,FileReadPost *.nc echo "Enter the password: "
autocmd BufReadPost,FileReadPost *.nc '[,']!mdecrypt -q 2>/dev/null
autocmd BufReadPost,FileReadPost *.nc setlocal nobin
autocmd BufReadPost,FileReadPost *.nc let &ch = ch_save|unlet ch_save
autocmd BufReadPost,FileReadPost *.nc execute ":doautocmd BufReadPost " . expand("%:r")
autocmd BufWritePre,FileWritePre *.nc echo "Enter the password twice: "
autocmd BufWritePre,FileWritePre *.nc '[,']!mcrypt -q -a blowfish 2>/dev/null
autocmd BufWritePost,FileWritePost *.nc undo
augroup END
if has("cscope") && filereadable("cscope.out")
set csprg=cscope
set csto=0
set cst
set nocsverb
cs add cscope.out
set csverb
endif
if has("spell")
"set spell
"map <F4> :set spell!<CR><Bar>:echo "Spell Check: " . strpart("OffOn", 3 * &spell, 3)<CR>
" they were using white on white
highlight PmenuSel ctermfg=black ctermbg=lightgray
" limit it to just the top 10 items
set sps=best,10
endif
func R()
echo hithere
endfunc
fun! ShowFuncName()
let lnum = line(".")
let col = col(".")
echohl ModeMsg
echo getline(search("^[^ \t#/]\\{2}.*[^:]\s*$", 'bW'))
echohl None
call search("\\%" . lnum . "l" . "\\%" . col . "c")
endfun
map f :call ShowFuncName() <CR>"
let g:GPGDefaultRecipients = [ "[email protected]" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment