public
Last active

  • Download Gist
gistfile1.vim
VimL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
set nocompatible
filetype off
 
"Bundles
 
set rtp+=~/.vim/bundle/vundle
call vundle#rc()
 
Bundle 'gmarik/vundle'
Bundle 'embear/vim-localvimrc'
Bundle 'kchmck/vim-coffee-script'
Bundle 'wincent/Command-T'
Bundle 'bitc/vim-hdevtools.git'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'flazz/vim-colorschemes'
Bundle 'scrooloose/nerdcommenter'
Bundle 'scrooloose/syntastic'
Bundle 'airblade/vim-gitgutter'
Bundle 'vim-scripts/a.vim'
Bundle 'Valloric/YouCompleteMe'
 
"Bundles
 
filetype plugin indent on
syntax on
 
colorscheme ir_black
 
set laststatus=2
set shortmess=aoOW
 
set showcmd
set noswapfile
set nowritebackup
set undolevels=1000
set undoreload=-1
 
if has('persistent_undo')
set undodir=~/.vim/backups
set undofile
endif
 
au BufWinLeave *.* silent! mkview
au BufWinEnter *.* silent! loadview
 
set number
set cursorline
set showmatch
set matchpairs+=<:>
set hlsearch
set incsearch
 
set list
set listchars=tab:::,trail:.,extends:#,nbsp:.
set textwidth=80
set colorcolumn=+1
hi ColorColumn ctermbg=black
 
set nowrap
set smartindent
set expandtab
set tabstop=3
set softtabstop=3
set shiftwidth=3
set pastetoggle=<F12>
 
set wildignore+=*.o,*.hi,*.png,*.tix
set wildignore+=node_modules
 
"Remove trailing whitespaces on write
au BufWritePre <buffer> :call setline(1, map(getline(1,"$"), 'substitute(v:val, "\\s\\+$","","")'))
 
"Add linebreaks to syntastic messages.
au FileType qf setlocal wrap linebreak
 
let mapleader=','
 
nnoremap ; :
 
set clipboard=unnamedplus
vnoremap <C-C> "+y
 
nnoremap Y y$
nnoremap <Tab> :w<CR>
nnoremap <silent> <leader>/ :nohlsearch<CR>
 
nnoremap <F11> :GitGutterToggle<CR>
 
au FileType haskell nnoremap <buffer> <F1> :HdevtoolsType<CR>
au FileType haskell nnoremap <buffer> <silent> <F2> :HdevtoolsClear<CR>
au FileType haskell setlocal tabstop=4 shiftwidth=4 softtabstop=4
 
map <C-J> <C-W>j<C-W>_
map <C-K> <C-W>k<C-W>_
map <C-L> <C-W>l<C-W>_
map <C-H> <C-W>h<C-W>_
 
map <leader>a :AS <CR>
 
" Syntastic Options
let g:syntastic_auto_loc_list=1
let g:syntastic_enable_signs=1
let g:syntastic_check_on_open=1
let g:syntastic_check_on_wq=0
 
let g:syntastic_javascript_checkers=['jshint']
let g:syntastic_haskell_checkers=['hdevtools']
 
let g:syntastic_mode_map = { 'mode': 'active',
\ 'active_filetypes': [],
\ 'passive_filetypes': [] }
 
let g:ycm_allow_changing_updatetime = 0
 
let g:localvimrc_whitelist='.*'
let g:localvimrc_sandbox=0
 
let g:hdevtools_options = '-g -Wall'
 
let g:gitgutter_enabled = 0
highlight clear SignColumn
 
" Search for selected text, forwards or backwards.
vnoremap <silent> * :<C-U>
\let old_reg=getreg('"')<Bar>let old_regtype=getregtype('"')<CR>
\gvy/<C-R><C-R>=substitute(
\escape(@", '/\.*$^~['), '\_s\+', '\\_s\\+', 'g')<CR><CR>
\gV:call setreg('"', old_reg, old_regtype)<CR>
vnoremap <silent> # :<C-U>
\let old_reg=getreg('"')<Bar>let old_regtype=getregtype('"')<CR>
\gvy?<C-R><C-R>=substitute(
\escape(@", '?\.*$^~['), '\_s\+', '\\_s\\+', 'g')<CR><CR>
\gV:call setreg('"', old_reg, old_regtype)<CR>
" End search
  • Command-T is awesome for opening files in a directory.
  • vim-localvimrc is what I use to store commands specific to a project.
  • syntastic is turned off for my videos, since it gets in the way, but this is a HUGE time-saver.
  • a.vim is used to open the corresponding .cc file or .h file to whichever you are in.
  • YouCompleteMe Is what I use for auto-complete, and one half the reason I use clang++ over g++.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.