Skip to content

Instantly share code, notes, and snippets.

@aktau
Created June 16, 2014 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aktau/397533f03ea3bff77b19 to your computer and use it in GitHub Desktop.
Save aktau/397533f03ea3bff77b19 to your computer and use it in GitHub Desktop.
neovim: profiling vim vs. nvim after uv_hrtime()
SCRIPT /Users/Kevin/.nvimrc
Sourced 1 time
Total time: 0.080119
Self time: 0.034883
count total (s) self (s)
" some distros linux distros set filetype in /etc/vimrc
1 0.000080 filetype off
1 0.000064 filetype plugin indent off
" adjust runtime path (to test our new installation)
1 0.000014 set rtp+=~/.vim/bundle/vundle/
" let &rtp = substitute(&rtp, $HOME."/\.vim", $HOME."/newvim/\.vim", "g")
1 0.000085 set nocompatible " be iMproved
1 0.000007 set modelines=0
1 0.000010 if has('mac')
" fix clipboard on osx, do note that
" when running from within tmux, you
" might need something like
" https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
set clipboard+=unnamed
endif
1 0.000095 call vundle#rc()
" let vundle manage vundle
1 0.000442 Bundle 'gmarik/vundle'
" original repos on github
1 0.000424 Bundle 'tpope/vim-fugitive'
1 0.000455 Bundle 'tpope/vim-surround'
1 0.000485 Bundle 'tpope/vim-eunuch'
1 0.000525 Bundle 'tpope/vim-unimpaired'
1 0.000564 Bundle 'tpope/vim-commentary'
1 0.000625 Bundle 'Lokaltog/vim-powerline'
1 0.000774 Bundle 'Lokaltog/vim-easymotion'
1 0.000698 Bundle 'airblade/vim-gitgutter'
" Bundle 'terryma/vim-multiple-cursors'
" Bundle 'junegunn/vim-easy-align'
1 0.000735 Bundle 'kien/ctrlp.vim'
1 0.000763 Bundle 'rking/ag.vim'
1 0.000815 Bundle 'ervandew/supertab'
" Bundle 'tomtom/tcomment_vim'
1 0.000832 Bundle 'mattn/webapi-vim'
1 0.000879 Bundle 'mattn/gist-vim'
1 0.000909 Bundle 'scrooloose/syntastic'
" Bundle 'vim-scripts/YankRing.vim'
" Bundle 'dahu/vim-fanfingtastic'
1 0.000943 Bundle 'xolox/vim-misc'
1 0.000983 Bundle 'aktau/vim-easytags'
1 0.000997 Bundle 'ciaranm/detectindent'
1 0.000959 Bundle 'danro/rename.vim'
1 0.001034 Bundle 'xuhdev/SingleCompile'
" themes
1 0.001034 Bundle 'altercation/vim-colors-solarized'
1 0.001112 Bundle 'chriskempson/tomorrow-theme', {'rtp': 'vim/'}
1 0.001126 Bundle 'tomasr/molokai'
1 0.001345 Bundle 'zaiste/Atom'
1 0.001294 Bundle 'jnurmine/Zenburn'
1 0.001332 Bundle 'jpo/vim-railscasts-theme'
1 0.001377 Bundle 'michalbachowski/vim-wombat256mod'
" language support
1 0.001401 Bundle 'rodjek/vim-puppet'
1 0.001432 Bundle 'exu/pgsql.vim'
1 0.001477 Bundle 'leafo/moonscript-vim'
1 0.001438 Bundle 'dgryski/vim-godef'
" golang
1 0.000006 if has('mac')
set rtp+=$GOROOT/misc/vim
else
1 0.000017 set rtp+=/usr/share/vim/addons
1 0.000001 endif
1 0.000020 set rtp+=$GOPATH/src/github.com/nsf/gocode/vim
1 0.000009 autocmd FileType go let g:SuperTabDefaultCompletionType = "context"
1 0.000004 autocmd FileType go setlocal makeprg=go\ build
1 0.000003 autocmd FileType go setlocal noexpandtab shiftwidth=4 tabstop=4 softtabstop=4 nolist
1 0.000005 autocmd BufWritePre *.go Fmt
1 0.000093 set encoding=utf-8
1 0.000003 set termencoding=utf-8
1 0.000002 scriptencoding utf-8
1 0.000089 syntax enable
1 0.000303 filetype plugin indent on " load file type plugins + indentation
1 0.000007 set showcmd " display incomplete commands.
1 0.000003 set showmode " display the mode you're in.
1 0.000002 set showmatch " show matching brackets/parenthesis
1 0.000007 set mat=5 " duration to show matching tabs
1 0.000004 set autoread " reload files automagically
" text preferences
1 0.000002 set nowrap " don't wrap lines
1 0.000004 set tabstop=4 shiftwidth=4 " a tab is two spaces (or set this to 4)
1 0.000002 set softtabstop=4
1 0.000003 set expandtab " use spaces, not tabs (optional)
1 0.000003 set nosmarttab " really get rid of tabs
1 0.000006 set backspace=indent,eol,start " backspace through everything in insert mode"
1 0.000002 set autoindent " match indentation of previous line
1 0.000003 set textwidth=76 " in new gvim windows
1 0.000007 set colorcolumn=85
1 0.000008 set pastetoggle=<F2>
" show invisible characters
1 0.000002 set list
" som alternatives: tab:▸\,eol:¬
1 0.000007 set listchars=tab:\|\ ,trail:…
" searching
1 0.000031 nnoremap <CR> :noh<CR><CR>
1 0.000005 nnoremap / /\v
1 0.000005 vnoremap / /\v
1 0.000003 set incsearch " Find as you type search
1 0.000003 set hlsearch " Highlight search terms
1 0.000002 set ignorecase " Case-insensitive searching.
1 0.000002 set smartcase " But case-sensitive if expression contains a capital letter.
1 0.000002 set gdefault " Set the global flag on substitute commands by default
" set showmatch " When a bracket is inserted, briefly jump to the matching one
" undo
1 0.000005 set undofile " Save undo's after file closes
1 0.000005 set undodir=$HOME/.vim/undo " where to save undo histories
1 0.000006 set undolevels=1000 " How many undos
1 0.000003 set undoreload=10000 " number of lines to save for undo
1 0.000008 set hidden " Handle multiple buffers better.
1 0.000003 set title " Set the terminal's title
1 0.000002 set number " Show line numbers.
1 0.000002 set ruler " Show cursor position.
1 0.000002 set cursorline " Highlight current line
1 0.000003 set wildmode=list:longest " Complete files like a shell.
1 0.000002 set wildmenu " Enhanced command line completion.
1 0.000003 set wildignore=*.o,*.obj,*~ " Stuff to ignore when tab completing
1 0.000002 set magic " magic matching
" small tweaks
1 0.000002 set ttyfast " indicate a fast terminal connection
1 0.000003 set tf " improve redrawing for newer computers
1 0.000002 set nolazyredraw " turn off lazy redraw
1 0.000003 set shell=/bin/zsh
1 0.000002 set visualbell
1 0.000002 set noerrorbells
1 0.000002 set history=1000 " Store lots of :cmdline history
1 0.000002 set scrolloff=3
1 0.000002 set sidescrolloff=7
1 0.000002 set splitbelow
1 0.000002 set splitright
1 0.000003 set mouse-=a
1 0.000002 set mousehide
1 0.000005 set ttymouse=xterm2
1 0.000002 set sidescroll=1
1 0.000002 set nobackup " Don't make a backup before overwriting a file.
1 0.000002 set nowritebackup " And again.
1 0.000003 set directory=/tmp " Keep swap files in one location
1 0.000002 set noswapfile
1 0.000002 set timeoutlen=500
1 0.000008 set laststatus=2 " Show the status line all the time
1 0.000008 set statusline=[%n]\ %<%.99f\ %h%w%m%r%y\ %{exists('*CapsLockStatusline')?CapsLockStatusline():''}%=%-16(\ %l,%c-%v\ %)%P
1 0.000440 set t_Co=256 " Set terminal to 256 colors
1 0.000056 colorscheme static_tomorrownight
1 0.000353 set background=dark
1 0.000011 autocmd FileType python setlocal tabstop=8 expandtab shiftwidth=4 softtabstop=4
" clear trailing spaces on save
1 0.000014 autocmd BufWritePre * kz|:%s/\s\+$//e|'z
1 0.000004 let mapleader = ","
" indent/unindent visual mode selection with tab/shift+tab
1 0.000007 vmap <tab> >gv
1 0.000014 vmap <s-tab> <gv
" F7 reformats the whole file and leaves you where you were (unlike gg)
1 0.000012 map <silent> <F7> mzgg=G'z :delmarks z<CR>:echo "Reformatted."<CR>
" open the definition in a new split
1 0.000006 nnoremap <c-\> <c-w>g<c-]>
" fix trailing spaces
1 0.000010 nnoremap <leader>w :%s/\s\+$//<cr>:let @/=''<CR>
" map sort function to a key
1 0.000007 vnoremap <leader>s :sort<CR>
" search with ag
1 0.000007 nnoremap <leader>a :Ag<space>
" save on ctrl-s in every mode, does not work under tmux
1 0.000006 noremap <C-S> :update<CR>
1 0.000014 vnoremap <C-S> <C-C>:update<CR>
1 0.000006 inoremap <C-S> <C-O>:update<CR>
" re-hardwrap paragraphs
1 0.000007 nnoremap <leader>q gqip
1 0.000004 vmap Q gq
1 0.000004 nmap Q gqap
" close the quickfix window
1 0.000007 map <leader>qc :cclose<cr>
" switch split windows
1 0.000006 nnoremap <leader>s <C-w>v<C-w>l
1 0.000005 nnoremap <C-h> <C-w>h
1 0.000005 nnoremap <C-j> <C-w>j
1 0.000004 nnoremap <C-k> <C-w>k
1 0.000004 nnoremap <C-l> <C-w>l
" re-select text you just pasted
1 0.000006 nnoremap <leader>v V`]
" open .vimrc in a split panel and edit it
1 0.000008 nnoremap <leader>ev <C-w><C-v><C-l>:e $MYVIMRC<cr>
" clear search results
1 0.000006 nnoremap <leader><space> :noh<cr>
" select last matched item
1 0.000007 nnoremap <leader>/ //e<Enter>v??<Enter>
" make and open quickfix window
1 0.000007 map <silent> <F7> :make %<CR>:copen<CR>
" % is hard to type
" nnoremap <tab> %
" vnoremap <tab> %
" quit insert-mode by pressing jj, most people don't type jj's very often
" inoremap jj <ESC>
1 0.000004 inoremap ;; <Esc>
" enable the dot command in visual mode
1 0.000005 vnoremap . :norm.<CR>
" oh dear... disable the arrow keys
1 0.000006 map <Left> :echo "no!"<cr>
1 0.000006 map <Right> :echo "no!"<cr>
1 0.000006 map <Up> :echo "no!"<cr>
1 0.000006 map <Down> :echo "no!"<cr>
""""""""""""""""""""""
" plugin customization
""""""""""""""""""""""
" ctrlp.vim
1 0.000005 set wildignore+=*/.git/objects/*,*/.git/refs/*,*/.hg/*,*/.svn/* " for Linux/MacOSX
1 0.000004 set wildignore+=*/tmp/*,*.so,*.swp,*.zip
" vim-gitguttter
1 0.000003 highlight clear SignColumn
"let g:gitgutter_sign_column_always = 1
" yankring.vim
1 0.000006 nnoremap <silent> <F3> :YRShow<cr>
1 0.000006 inoremap <silent> <F3> <ESC>:YRShow<cr>
" gist-vim
1 0.000004 let g:gist_detect_filetype = 1
" syntastic
1 0.000005 set statusline+=%#warningmsg#
1 0.000005 set statusline+=%{SyntasticStatuslineFlag()}
1 0.000004 set statusline+=%*
" let g:syntastic_auto_loc_list=1
" let g:syntastic_loc_list_height=5
1 0.000012 let g:syntastic_c_include_dirs = [
\ '../build/include',
\ 'build/include',
\ '../build/src/nvim/auto',
\ 'build/src/nvim/auto',
\ ]
1 0.000004 let g:syntastic_c_compiler_options = '-std=gnu99 -DINCLUDE_GENERATED_DECLARATIONS'
" vim-easy-align
" vnoremap <silent> <Enter> :EasyAlign<Enter>
" nnoremap <silent> <Leader>\ :EasyAlign<Enter>
" vim-easytags
" don't enable this for now... editing a file in $HOME wrecks the HDD
" let g:easytags_autorecurse = 1
" set tags=./tags;/,tags;/
1 0.000003 let g:easytags_dynamic_files = 2
1 0.000003 let g:easytags_file = "~/.easytags"
" vim-godef
1 0.000002 let g:godef_split = 0
" detectindent
1 0.000055 autocmd BufReadPost * :DetectIndent
" SingleCompile
1 0.000009 nnoremap <leader>r :SCCompileRun<cr>
""""""""""""""""""""
" filetype detection
""""""""""""""""""""
1 0.000004 if has('autocmd')
1 0.000006 au WinEnter * setlocal cursorline
1 0.000005 au WinLeave * setlocal nocursorline
1 0.000006 hi ExtraWhitespace ctermbg=red guibg=red
1 0.000005 au ColorScheme * hi ExtraWhitespace ctermbg=red guibg=red
1 0.000006 match ExtraWhitespace /\s\+$\| \+\ze\t/
" Fix filetype detection
1 0.000067 au BufNewFile,BufRead *.inc set filetype=php
1 0.000030 au BufNewFile,BufRead *.sys set filetype=php
1 0.000037 au BufNewFile,BufRead grub.conf set filetype=grub
1 0.000031 au BufNewFile,BufRead *.blog set filetype=blog
" C file specific options
1 0.000007 au FileType c,cpp set cindent
1 0.000006 au FileType c,cpp set formatoptions+=ro
" Ruby file specific options
1 0.000008 au Filetype ruby set textwidth=80 ts=2
1 0.000005 au Filetype haml set ts=2 sw=2 sts=0 expandtab tw=120
1 0.000005 au FileType javascript setlocal nocindent
1 0.000030 au BufRead,BufNewFile *.rpdf set ft=ruby
1 0.000029 au BufRead,BufNewFile *.rxls set ft=ruby
1 0.000034 au BufRead,BufNewFile *.ru set ft=ruby
1 0.000031 au BufRead,BufNewFile *.god set ft=ruby
1 0.000029 au BufRead,BufNewFile *.rtxt set ft=html spell
1 0.000029 au BufRead,BufNewFile *.rl set ft=ragel
1 0.000034 au BufRead,BufNewFile *.haml set ft=haml
1 0.000032 au BufRead,BufNewFile *.mustache set ft=mustache
1 0.000030 au BufRead,BufNewFile *.ron set ft=mkd tw=65 ts=2 sw=2 expandtab
" Others..
1 0.000033 au BufRead,BufNewFile *.sql set ft=pgsql
1 0.000031 au BufRead,BufNewFile *.svg set ft=svg
1 0.000030 au BufRead,BufNewFile *.dasc set ft=c
1 0.000029 au BufRead,BufNewFile *.vimp set ft=vimperator
1 0.000033 au BufRead,BufNewFile *.md set ft=mkd tw=72 ts=2 sw=2 expandtab
1 0.000033 au BufRead,BufNewFile *.markdown set ft=mkd tw=72 ts=2 sw=2 expandtab
1 0.000031 au BufRead,BufNewFile *.coffee set ft=coffee
1 0.000039 au BufRead,BufNewFile mutt{ng,}-*-\w\+ set ft=mail
" Python file specific options
1 0.000006 au FileType python set omnifunc=pythoncomplete#Complete
" Compile and run keymappings
1 0.000005 au FileType php map <leader>r :!php -f %<CR>
1 0.000005 au FileType python map <leader>r :!python %<CR>
1 0.000005 au FileType perl map <leader>r :!perl %<CR>
1 0.000004 au FileType ruby map <leader>r :!ruby %<CR>
1 0.000007 au FileType lua map <leader>r :!lua %<CR>
1 0.000007 au FileType html,xhtml map <leader>r :!firefox %<CR>
1 0.000005 au FileType go unmap <leader>r
1 0.000003 au FileType go map <leader>r :update<bar>:!go run %<CR>
1 0.000003 au FileType go map <leader>b :update<bar>:!go build -o go-app && ./go-app<CR>
" MS Word document reading
1 0.000004 au BufReadPre *.doc set ro
1 0.000003 au BufReadPre *.doc set hlsearch!
1 0.000018 au BufReadPost *.doc %!antiword "%"
" Reload vimrc when we edit it
1 0.000004 au! BufWritePost .vimrc source %
1 0.000002 endif
""""""""""""""""""""""""
" hacks
""""""""""""""""""""""""
" tries to get buffer reloading to work correctly in terminals
1 0.000002 augroup checktime
1 0.000027 au!
1 0.000005 if !has("gui_running")
" silent! necessary otherwise throws errors when using command
" line window.
1 0.000005 autocmd BufEnter * silent! checktime
1 0.000008 autocmd CursorHold * silent! checktime
1 0.000005 autocmd CursorHoldI * silent! checktime
" these two _may_ slow things down. Remove if they do.
" autocmd CursorMoved * silent! checktime
" autocmd CursorMovedI * silent! checktime
1 0.000001 endif
1 0.000004 augroup END
SCRIPT /Users/.../.vimrc
Sourced 1 time
Total time: 0.083390
Self time: 0.037835
count total (s) self (s)
" some distros linux distros set filetype in /etc/vimrc
1 0.000066 filetype off
1 0.000050 filetype plugin indent off
" adjust runtime path (to test our new installation)
1 0.000013 set rtp+=~/.vim/bundle/vundle/
" let &rtp = substitute(&rtp, $HOME."/\.vim", $HOME."/newvim/\.vim", "g")
1 0.000073 set nocompatible " be iMproved
1 0.000006 set modelines=0
1 0.000007 if has('mac')
" fix clipboard on osx, do note that
" when running from within tmux, you
" might need something like
" https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
1 0.000003 set clipboard+=unnamed
1 0.000001 endif
1 0.000078 call vundle#rc()
" let vundle manage vundle
1 0.000372 Bundle 'gmarik/vundle'
" original repos on github
1 0.000402 Bundle 'tpope/vim-fugitive'
1 0.000382 Bundle 'tpope/vim-surround'
1 0.000408 Bundle 'tpope/vim-eunuch'
1 0.000481 Bundle 'tpope/vim-unimpaired'
1 0.000487 Bundle 'tpope/vim-commentary'
1 0.000547 Bundle 'Lokaltog/vim-powerline'
1 0.000565 Bundle 'Lokaltog/vim-easymotion'
1 0.000570 Bundle 'airblade/vim-gitgutter'
" Bundle 'terryma/vim-multiple-cursors'
" Bundle 'junegunn/vim-easy-align'
1 0.000617 Bundle 'kien/ctrlp.vim'
1 0.000654 Bundle 'rking/ag.vim'
1 0.000675 Bundle 'ervandew/supertab'
" Bundle 'tomtom/tcomment_vim'
1 0.000713 Bundle 'mattn/webapi-vim'
1 0.000736 Bundle 'mattn/gist-vim'
1 0.000765 Bundle 'scrooloose/syntastic'
" Bundle 'vim-scripts/YankRing.vim'
" Bundle 'dahu/vim-fanfingtastic'
1 0.000801 Bundle 'xolox/vim-misc'
1 0.000800 Bundle 'aktau/vim-easytags'
1 0.000829 Bundle 'ciaranm/detectindent'
1 0.000890 Bundle 'danro/rename.vim'
1 0.000901 Bundle 'xuhdev/SingleCompile'
" themes
1 0.001031 Bundle 'altercation/vim-colors-solarized'
1 0.001127 Bundle 'chriskempson/tomorrow-theme', {'rtp': 'vim/'}
1 0.001607 Bundle 'tomasr/molokai'
1 0.002598 Bundle 'zaiste/Atom'
1 0.002310 Bundle 'jnurmine/Zenburn'
1 0.002039 Bundle 'jpo/vim-railscasts-theme'
1 0.002158 Bundle 'michalbachowski/vim-wombat256mod'
" language support
1 0.001492 Bundle 'rodjek/vim-puppet'
1 0.001900 Bundle 'exu/pgsql.vim'
1 0.001495 Bundle 'leafo/moonscript-vim'
1 0.001921 Bundle 'dgryski/vim-godef'
" golang
1 0.000005 if has('mac')
1 0.000027 set rtp+=$GOROOT/misc/vim
1 0.000002 else
set rtp+=/usr/share/vim/addons
endif
1 0.000027 set rtp+=$GOPATH/src/github.com/nsf/gocode/vim
1 0.000012 autocmd FileType go let g:SuperTabDefaultCompletionType = "context"
1 0.000005 autocmd FileType go setlocal makeprg=go\ build
1 0.000004 autocmd FileType go setlocal noexpandtab shiftwidth=4 tabstop=4 softtabstop=4 nolist
1 0.000006 autocmd BufWritePre *.go Fmt
1 0.000145 set encoding=utf-8
1 0.000005 set termencoding=utf-8
1 0.000002 scriptencoding utf-8
1 0.000108 syntax enable
1 0.000249 filetype plugin indent on " load file type plugins + indentation
1 0.000005 set showcmd " display incomplete commands.
1 0.000002 set showmode " display the mode you're in.
1 0.000002 set showmatch " show matching brackets/parenthesis
1 0.000005 set mat=5 " duration to show matching tabs
1 0.000002 set autoread " reload files automagically
" text preferences
1 0.000002 set nowrap " don't wrap lines
1 0.000004 set tabstop=4 shiftwidth=4 " a tab is two spaces (or set this to 4)
1 0.000002 set softtabstop=4
1 0.000002 set expandtab " use spaces, not tabs (optional)
1 0.000003 set nosmarttab " really get rid of tabs
1 0.000004 set backspace=indent,eol,start " backspace through everything in insert mode"
1 0.000002 set autoindent " match indentation of previous line
1 0.000003 set textwidth=76 " in new gvim windows
1 0.000003 set colorcolumn=85
1 0.000004 set pastetoggle=<F2>
" show invisible characters
1 0.000002 set list
" som alternatives: tab:▸\,eol:¬
1 0.000005 set listchars=tab:\|\ ,trail:…
" searching
1 0.000007 nnoremap <CR> :noh<CR><CR>
1 0.000005 nnoremap / /\v
1 0.000004 vnoremap / /\v
1 0.000002 set incsearch " Find as you type search
1 0.000002 set hlsearch " Highlight search terms
1 0.000002 set ignorecase " Case-insensitive searching.
1 0.000002 set smartcase " But case-sensitive if expression contains a capital letter.
1 0.000002 set gdefault " Set the global flag on substitute commands by default
" set showmatch " When a bracket is inserted, briefly jump to the matching one
" undo
1 0.000007 set undofile " Save undo's after file closes
1 0.000004 set undodir=$HOME/.vim/undo " where to save undo histories
1 0.000005 set undolevels=1000 " How many undos
1 0.000003 set undoreload=10000 " number of lines to save for undo
1 0.000008 set hidden " Handle multiple buffers better.
1 0.000002 set title " Set the terminal's title
1 0.000003 set number " Show line numbers.
1 0.000002 set ruler " Show cursor position.
1 0.000002 set cursorline " Highlight current line
1 0.000003 set wildmode=list:longest " Complete files like a shell.
1 0.000002 set wildmenu " Enhanced command line completion.
1 0.000003 set wildignore=*.o,*.obj,*~ " Stuff to ignore when tab completing
1 0.000002 set magic " magic matching
" small tweaks
1 0.000002 set ttyfast " indicate a fast terminal connection
1 0.000003 set tf " improve redrawing for newer computers
1 0.000002 set nolazyredraw " turn off lazy redraw
1 0.000002 set shell=/bin/zsh
1 0.000001 set visualbell
1 0.000001 set noerrorbells
1 0.000002 set history=1000 " Store lots of :cmdline history
1 0.000002 set scrolloff=3
1 0.000002 set sidescrolloff=7
1 0.000002 set splitbelow
1 0.000001 set splitright
1 0.000002 set mouse-=a
1 0.000002 set mousehide
1 0.000005 set ttymouse=xterm2
1 0.000002 set sidescroll=1
1 0.000002 set nobackup " Don't make a backup before overwriting a file.
1 0.000002 set nowritebackup " And again.
1 0.000002 set directory=/tmp " Keep swap files in one location
1 0.000004 set noswapfile
1 0.000002 set timeoutlen=500
1 0.000013 set laststatus=2 " Show the status line all the time
1 0.000007 set statusline=[%n]\ %<%.99f\ %h%w%m%r%y\ %{exists('*CapsLockStatusline')?CapsLockStatusline():''}%=%-16(\ %l,%c-%v\ %)%P
1 0.000436 set t_Co=256 " Set terminal to 256 colors
1 0.000048 colorscheme static_tomorrownight
1 0.000411 set background=dark
1 0.000012 autocmd FileType python setlocal tabstop=8 expandtab shiftwidth=4 softtabstop=4
" clear trailing spaces on save
1 0.000006 autocmd BufWritePre * kz|:%s/\s\+$//e|'z
1 0.000003 let mapleader = ","
" indent/unindent visual mode selection with tab/shift+tab
1 0.000007 vmap <tab> >gv
1 0.000006 vmap <s-tab> <gv
" F7 reformats the whole file and leaves you where you were (unlike gg)
1 0.000011 map <silent> <F7> mzgg=G'z :delmarks z<CR>:echo "Reformatted."<CR>
" open the definition in a new split
1 0.000006 nnoremap <c-\> <c-w>g<c-]>
" fix trailing spaces
1 0.000011 nnoremap <leader>w :%s/\s\+$//<cr>:let @/=''<CR>
" map sort function to a key
1 0.000008 vnoremap <leader>s :sort<CR>
" search with ag
1 0.000007 nnoremap <leader>a :Ag<space>
" save on ctrl-s in every mode, does not work under tmux
1 0.000006 noremap <C-S> :update<CR>
1 0.000006 vnoremap <C-S> <C-C>:update<CR>
1 0.000006 inoremap <C-S> <C-O>:update<CR>
" re-hardwrap paragraphs
1 0.000008 nnoremap <leader>q gqip
1 0.000004 vmap Q gq
1 0.000005 nmap Q gqap
" close the quickfix window
1 0.000008 map <leader>qc :cclose<cr>
" switch split windows
1 0.000007 nnoremap <leader>s <C-w>v<C-w>l
1 0.000005 nnoremap <C-h> <C-w>h
1 0.000004 nnoremap <C-j> <C-w>j
1 0.000004 nnoremap <C-k> <C-w>k
1 0.000004 nnoremap <C-l> <C-w>l
" re-select text you just pasted
1 0.000007 nnoremap <leader>v V`]
" open .vimrc in a split panel and edit it
1 0.000009 nnoremap <leader>ev <C-w><C-v><C-l>:e $MYVIMRC<cr>
" clear search results
1 0.000007 nnoremap <leader><space> :noh<cr>
" select last matched item
1 0.000008 nnoremap <leader>/ //e<Enter>v??<Enter>
" make and open quickfix window
1 0.000007 map <silent> <F7> :make %<CR>:copen<CR>
" % is hard to type
" nnoremap <tab> %
" vnoremap <tab> %
" quit insert-mode by pressing jj, most people don't type jj's very often
" inoremap jj <ESC>
1 0.000004 inoremap ;; <Esc>
" enable the dot command in visual mode
1 0.000005 vnoremap . :norm.<CR>
" oh dear... disable the arrow keys
1 0.000006 map <Left> :echo "no!"<cr>
1 0.000007 map <Right> :echo "no!"<cr>
1 0.000006 map <Up> :echo "no!"<cr>
1 0.000006 map <Down> :echo "no!"<cr>
""""""""""""""""""""""
" plugin customization
""""""""""""""""""""""
" ctrlp.vim
1 0.000006 set wildignore+=*/.git/objects/*,*/.git/refs/*,*/.hg/*,*/.svn/* " for Linux/MacOSX
1 0.000004 set wildignore+=*/tmp/*,*.so,*.swp,*.zip
" vim-gitguttter
1 0.000003 highlight clear SignColumn
"let g:gitgutter_sign_column_always = 1
" yankring.vim
1 0.000007 nnoremap <silent> <F3> :YRShow<cr>
1 0.000006 inoremap <silent> <F3> <ESC>:YRShow<cr>
" gist-vim
1 0.000004 let g:gist_detect_filetype = 1
" syntastic
1 0.000006 set statusline+=%#warningmsg#
1 0.000005 set statusline+=%{SyntasticStatuslineFlag()}
1 0.000005 set statusline+=%*
" let g:syntastic_auto_loc_list=1
" let g:syntastic_loc_list_height=5
1 0.000014 let g:syntastic_c_include_dirs = [
\ '../build/include',
\ 'build/include',
\ '../build/src/nvim/auto',
\ 'build/src/nvim/auto',
\ ]
1 0.000004 let g:syntastic_c_compiler_options = '-std=gnu99 -DINCLUDE_GENERATED_DECLARATIONS'
" vim-easy-align
" vnoremap <silent> <Enter> :EasyAlign<Enter>
" nnoremap <silent> <Leader>\ :EasyAlign<Enter>
" vim-easytags
" don't enable this for now... editing a file in $HOME wrecks the HDD
" let g:easytags_autorecurse = 1
" set tags=./tags;/,tags;/
1 0.000003 let g:easytags_dynamic_files = 2
1 0.000003 let g:easytags_file = "~/.easytags"
" vim-godef
1 0.000002 let g:godef_split = 0
" detectindent
1 0.000065 autocmd BufReadPost * :DetectIndent
" SingleCompile
1 0.000010 nnoremap <leader>r :SCCompileRun<cr>
""""""""""""""""""""
" filetype detection
""""""""""""""""""""
1 0.000005 if has('autocmd')
1 0.000007 au WinEnter * setlocal cursorline
1 0.000005 au WinLeave * setlocal nocursorline
1 0.000006 hi ExtraWhitespace ctermbg=red guibg=red
1 0.000004 au ColorScheme * hi ExtraWhitespace ctermbg=red guibg=red
1 0.000008 match ExtraWhitespace /\s\+$\| \+\ze\t/
" Fix filetype detection
1 0.000078 au BufNewFile,BufRead *.inc set filetype=php
1 0.000036 au BufNewFile,BufRead *.sys set filetype=php
1 0.000036 au BufNewFile,BufRead grub.conf set filetype=grub
1 0.000033 au BufNewFile,BufRead *.blog set filetype=blog
" C file specific options
1 0.000007 au FileType c,cpp set cindent
1 0.000010 au FileType c,cpp set formatoptions+=ro
" Ruby file specific options
1 0.000005 au Filetype ruby set textwidth=80 ts=2
1 0.000005 au Filetype haml set ts=2 sw=2 sts=0 expandtab tw=120
1 0.000006 au FileType javascript setlocal nocindent
1 0.000032 au BufRead,BufNewFile *.rpdf set ft=ruby
1 0.000037 au BufRead,BufNewFile *.rxls set ft=ruby
1 0.000033 au BufRead,BufNewFile *.ru set ft=ruby
1 0.000031 au BufRead,BufNewFile *.god set ft=ruby
1 0.000031 au BufRead,BufNewFile *.rtxt set ft=html spell
1 0.000036 au BufRead,BufNewFile *.rl set ft=ragel
1 0.000033 au BufRead,BufNewFile *.haml set ft=haml
1 0.000033 au BufRead,BufNewFile *.mustache set ft=mustache
1 0.000036 au BufRead,BufNewFile *.ron set ft=mkd tw=65 ts=2 sw=2 expandtab
" Others..
1 0.000033 au BufRead,BufNewFile *.sql set ft=pgsql
1 0.000032 au BufRead,BufNewFile *.svg set ft=svg
1 0.000031 au BufRead,BufNewFile *.dasc set ft=c
1 0.000035 au BufRead,BufNewFile *.vimp set ft=vimperator
1 0.000034 au BufRead,BufNewFile *.md set ft=mkd tw=72 ts=2 sw=2 expandtab
1 0.000034 au BufRead,BufNewFile *.markdown set ft=mkd tw=72 ts=2 sw=2 expandtab
1 0.000032 au BufRead,BufNewFile *.coffee set ft=coffee
1 0.000042 au BufRead,BufNewFile mutt{ng,}-*-\w\+ set ft=mail
" Python file specific options
1 0.000006 au FileType python set omnifunc=pythoncomplete#Complete
" Compile and run keymappings
1 0.000005 au FileType php map <leader>r :!php -f %<CR>
1 0.000005 au FileType python map <leader>r :!python %<CR>
1 0.000009 au FileType perl map <leader>r :!perl %<CR>
1 0.000005 au FileType ruby map <leader>r :!ruby %<CR>
1 0.000005 au FileType lua map <leader>r :!lua %<CR>
1 0.000007 au FileType html,xhtml map <leader>r :!firefox %<CR>
1 0.000004 au FileType go unmap <leader>r
1 0.000004 au FileType go map <leader>r :update<bar>:!go run %<CR>
1 0.000003 au FileType go map <leader>b :update<bar>:!go build -o go-app && ./go-app<CR>
" MS Word document reading
1 0.000004 au BufReadPre *.doc set ro
1 0.000003 au BufReadPre *.doc set hlsearch!
1 0.000019 au BufReadPost *.doc %!antiword "%"
" Reload vimrc when we edit it
1 0.000007 au! BufWritePost .vimrc source %
1 0.000001 endif
""""""""""""""""""""""""
" hacks
""""""""""""""""""""""""
" tries to get buffer reloading to work correctly in terminals
1 0.000002 augroup checktime
1 0.000029 au!
1 0.000006 if !has("gui_running")
" silent! necessary otherwise throws errors when using command
" line window.
1 0.000005 autocmd BufEnter * silent! checktime
1 0.000005 autocmd CursorHold * silent! checktime
1 0.000004 autocmd CursorHoldI * silent! checktime
" these two _may_ slow things down. Remove if they do.
" autocmd CursorMoved * silent! checktime
" autocmd CursorMovedI * silent! checktime
1 0.000001 endif
1 0.000004 augroup END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment