Skip to content

Instantly share code, notes, and snippets.

Last active Jun 25, 2016
What would you like to do?
My current .vimrc file
"let g:powerline_config_overrides={"common":{"log_file":"/tmp/powerline.log"}}
call pathogen#infect()
call pathogen#helptags()
" colors candycode
" colors borland
" colors vividchalk
" colors tango
" colors brookstream
" colors chocolateliquor
" colors candycode
" colors nightshimmer
" colors liquidcarbon
" let g:colors_name='wombat256mod'
"colors colors_name
colors railscasts2
"colors intellij
" colors blue
set ts=2
set sw=2
set et
set nu
set noswapfile
set rtp+=~/.vim/bundle/powerline/powerline/bindings/vim
set autochdir
au BufNewFile,BufRead *.markerb set filetype=markdown
au! BufNewFile,BufRead *.applescript setf applescript
au Syntax prawn setf ruby
au FileType ruby setlocal foldmethod=syntax nofoldenable
au FileType xml setlocal foldmethod=syntax nofoldenable
" via
" reformat xml with gg=G in normal/command mode
au FileType xml setlocal equalprg=xmllint\ --format\ --recover\ -\ 2>/dev/null
" Strip trailing whitespace
function! <SID>StripTrailingWhitespaces()
if &ft =~ 'markdown'
" Preparation: save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" Do the business:
" Clean up: restore previous search history, and cursor position
let @/=_s
call cursor(l, c)
autocmd BufWritePre * :call <SID>StripTrailingWhitespaces()
" Resize the current split to at least (90,25) but no more than (140,60)
" or 2/3 of the available space otherwise.
function! Splitresize()
let hmax = max([winwidth(0), float2nr(&columns*1.0/tabpagewinnr(h:), 90])
let vmax = max([winheight(0), float2nr(&lines*0.50), 25])
exe "vertical resize" . (min([hmax, 140]))
exe "resize" . (min([vmax, 60]))
com! -nargs=+ -complete=command Splitresize call Splitresize()
function! WinDo(command)
let currwin=winnr()
execute 'windo ' . a:command
execute currwin . 'wincmd w'
com! -nargs=+ -complete=command Windo call WinDo(<q-args>)
set laststatus=2
set guifont=Droid\ Sans\ Mono\ for\ Powerline:h11
set guifont=Monoisome:h11
set statusline=%t[%{strlen(&fenc)?&fenc:'none'},%{&ff}]%h%m%r%y%=%c,%l/%L\ %P
command! -bar -range=% NotRocket execute '<line1>,<line2>s/:\(\w\+\)\s*=>/\1:/e' . (&gdefault ? '' : 'g')
command! -bar -range=% Hashify execute '<line1>,<line2>s/\.\(\w\+\)\(\W*\)/[:\1]\2/e' . (&gdefault ? '' : 'g')
let @1='ciw`"`'
let @2='ciw"""'
" toggle nerdtree like split drawer vim
nmap <D-D> :NERDTreeToggle<cr>
imap <D-D> <ESC>:NERDTreeToggle<cr>
" control-<direction command> navigates splits
nmap <C-j> j
nmap <C-k> k
nmap <C-l> l
nmap <C-h> h
let g:ctrlp_working_path_mode = 'ra'
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment