Last active
January 3, 2016 02:29
-
-
Save n0nick/8396253 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Use Vim settings, rather then Vi settings (much better!). | |
" This must be first, because it changes other options as a side effect. | |
set nocompatible | |
" TODO: this may not be in the correct place. It is intended to allow overriding <Leader>. | |
" source ~/.vimrc.before if it exists. | |
if filereadable(expand("~/.vimrc.before")) | |
source ~/.vimrc.before | |
endif | |
" ================ General Config ==================== | |
set number "Line numbers are good | |
set backspace=indent,eol,start "Allow backspace in insert mode | |
set history=1000 "Store lots of :cmdline history | |
set showcmd "Show incomplete cmds down the bottom | |
set showmode "Show current mode down the bottom | |
set gcr=a:blinkon0 "Disable cursor blink | |
set visualbell "No sounds | |
set autoread "Reload files changed outside vim | |
" This makes vim act like all other editors, buffers can | |
" exist in the background without being in a window. | |
" http://items.sjbach.com/319/configuring-vim-right | |
set hidden | |
"turn on syntax highlighting | |
syntax on | |
" Change leader to a comma because the backslash is too far away | |
" That means all \x commands turn into ,x | |
" The mapleader has to be set before vundle starts loading all | |
" the plugins. | |
let mapleader="," | |
" =============== Vundle Initialization =============== | |
" This loads all the plugins specified in ~/.vim/vundle.vim | |
" Use Vundle plugin to manage all other plugins | |
if filereadable(expand("~/.vim/vundles.vim")) | |
source ~/.vim/vundles.vim | |
endif | |
" ================ Turn Off Swap Files ============== | |
set noswapfile | |
set nobackup | |
set nowb | |
" ================ Persistent Undo ================== | |
" Keep undo history across sessions, by storing in file. | |
" Only works all the time. | |
silent !mkdir ~/.vim/backups > /dev/null 2>&1 | |
set undodir=~/.vim/backups | |
set undofile | |
" ================ Indentation ====================== | |
set autoindent | |
set smartindent | |
set smarttab | |
set shiftwidth=2 | |
set softtabstop=2 | |
set tabstop=2 | |
set expandtab | |
filetype plugin on | |
filetype indent on | |
" Display tabs and trailing spaces visually | |
set list listchars=tab:\ \ ,trail:· | |
set nowrap "Don't wrap lines | |
set linebreak "Wrap lines at convenient points | |
" ================ Folds ============================ | |
set foldmethod=indent "fold based on indent | |
set foldnestmax=3 "deepest fold is 3 levels | |
set nofoldenable "dont fold by default | |
" ================ Completion ======================= | |
set wildmode=list:longest | |
set wildmenu "enable ctrl-n and ctrl-p to scroll thru matches | |
set wildignore=*.o,*.obj,*~ "stuff to ignore when tab completing | |
set wildignore+=*vim/backups* | |
set wildignore+=*sass-cache* | |
set wildignore+=*DS_Store* | |
set wildignore+=vendor/rails/** | |
set wildignore+=vendor/cache/** | |
set wildignore+=*.gem | |
set wildignore+=log/** | |
set wildignore+=tmp/** | |
set wildignore+=*.png,*.jpg,*.gif | |
" | |
" ================ Scrolling ======================== | |
set scrolloff=8 "Start scrolling when we're 8 lines away from margins | |
set sidescrolloff=15 | |
set sidescroll=1 | |
" ================ After ======================== | |
" source ~/.vimrc.after if it exists. | |
if filereadable(expand("~/.vimrc.after")) | |
source ~/.vimrc.after | |
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Some helpers to edit mode | |
" http://vimcasts.org/e/14 | |
cnoremap %% <C-R>=expand('%:h').'/'<cr> | |
map <leader>ew :e %% | |
map <leader>es :sp %% | |
map <leader>ev :vsp %% | |
map <leader>et :tabe %% | |
" use node for javascript | |
let $JS_CMD='node' | |
" apertium xml files | |
au BufRead,BufNewFile *.{dix,metadix,t1x} set ft=xml | |
" arrow keys are for little kids | |
noremap <Up> <nop> | |
noremap <Down> <nop> | |
noremap <Left> <nop> | |
noremap <Right> <nop> | |
" some annoyances with capital letters | |
nmap :Q :q | |
nmap :W :w | |
" vim-gist options | |
let g:gist_clip_command = 'pbcopy' | |
let g:gist_detect_filetype = 1 | |
" overwrite TComment map to go down a line | |
map <D-/> :TComment<CR>j | |
" include matcher configuration for ctrlp | |
if filereadable(expand("~/.vimrc_matcher")) | |
source ~/.vimrc_matcher | |
endif | |
" open NERDTree tabs on GUI startup | |
let g:nerdtree_tabs_open_on_gui_startup = 1 | |
" Some more python customizations :/ | |
" stolen from http://j.mp/LMtnB7 | |
" TODO should be replaced with http://www.vim.org/scripts/script.php?script_id=974 | |
" explanation here http://henry.precheur.org/vim/python | |
autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class | |
autocmd BufWritePre *.py normal m`:%s/\s\+$//e`` | |
autocmd BufWritePre *.py set textwidth=120 | |
autocmd BufRead *.py set tabstop=4 | |
autocmd BufRead *.py set softtabstop=4 | |
autocmd BufRead *.py set shiftwidth=4 | |
" Some C customizations :( | |
au BufRead,BufNewFile *.py set expandtab | |
au BufRead,BufNewFile *.c set noexpandtab | |
au BufRead,BufNewFile *.h set noexpandtab | |
au BufRead,BufNewFile Makefile* set noexpandtab | |
" prefer jshint for javascript syntax checking | |
let g:syntastic_javascript_syntax_checker="jshint" | |
" Conque bottom panel | |
" nnoremap <Leader>` :ConqueTermSplit zsh<CR> | |
" nnoremap <silent> <Leader>[ :exe "resize " . (&lines * 3/4)<CR> | |
" nnoremap <silent> <Leader>] :exe "resize " . (&lines * 1/4)<CR> | |
" Vimux stuff | |
"let g:VimuxOrientation = "h" | |
"let g:VimuxHeight = "40" | |
"command! RailsConsole :call VimuxRunCommand('RAILS_ENV=test rails c') | |
"command! W :w | :call VimuxRunCommand("load '" . @% ."';") | |
"map <Leader>c :RailsConsole<CR> | |
"map <Leader>r :call VimuxRunCommand('rspec ' . @%)<CR> | |
"map <Leader>R :call VimuxRunCommand('rspec ' . @% . ':' . line('.'))<CR> | |
"map <Leader>\ :VimuxRunLastCommand<cr> | |
" Enable mouse mode (on terminal vim, too) | |
set mouse=a | |
" Clipboard stuff | |
"set clipboard=unnamed " this copies to OS's clipboard | |
vmap <Leader>y "*y | |
map <Leader>p "*p<CR> | |
" Refresh chrome (w/out focus) | |
nnoremap <silent> <Leader>r :<C-u>silent !osascript -e 'tell application "Google Chrome" to tell the active tab of its first window to reload'<CR>:redraw!<CR> | |
" More natural split opening | |
" http://robots.thoughtbot.com/post/48275867281/vim-splits-move-faster-and-more-naturally | |
set splitbelow | |
set splitright | |
" Fix key mapping conflict with Sparkup | |
let g:sparkupNextMapping = '<c-r>' | |
" Speed up git-gutter | |
let g:gitgutter_eager = 0 | |
" Use haml syntax for hamlc files | |
au BufRead,BufNewFile *.hamlc set ft=haml | |
" vim-latex stuff | |
set grepprg=grep\ -nH\ $* | |
let g:tex_flavor='latex' | |
"set g:Tex_ViewRule_pdf='open' | |
" Annoyances | |
:command Bd bd | |
:command -nargs=* E edit <args> | |
" JS file syntax | |
au BufRead,BufNewFile *.js set ft=javascript |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" ======================================== | |
" Vim plugin configuration | |
" ======================================== | |
" | |
" This file contains the list of plugin installed using vundle plugin manager. | |
" Once you've updated the list of plugin, you can run vundle update by issuing | |
" the command :BundleInstall from within vim or directly invoking it from the | |
" command line with the following syntax: | |
" vim --noplugin -u vim/vundles.vim -N "+set hidden" "+syntax on" +BundleClean! +BundleInstall +qall | |
" Filetype off is required by vundle | |
filetype off | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
" let Vundle manage Vundle (required) | |
Bundle "gmarik/vundle" | |
" All your bundles here | |
Bundle "Raimondi/delimitMate" | |
Bundle "tomtom/tcomment_vim.git" | |
Bundle "scrooloose/nerdtree.git" | |
Bundle "scrooloose/syntastic.git" | |
Bundle "tpope/vim-repeat.git" | |
Bundle "tpope/vim-surround.git" | |
"Bundle "tpope/vim-rails.git" | |
"Bundle "vim-ruby/vim-ruby.git" | |
Bundle "Shougo/neocomplcache.git" | |
Bundle "skwp/vim-colors-solarized" | |
Bundle "tpope/vim-fugitive" | |
Bundle "tpope/vim-git" | |
Bundle "vim-easy-align" | |
Bundle "tpope/vim-haml" | |
Bundle "kchmck/vim-coffee-script" | |
Bundle "kien/ctrlp.vim" | |
Bundle "mattn/webapi-vim.git" | |
Bundle "mattn/gist-vim" | |
"Bundle "astashov/vim-ruby-debugger" "TODO | |
Bundle "Lokaltog/powerline", {'rtp': 'powerline/bindings/vim'} | |
Bundle "pangloss/vim-javascript" | |
Bundle "tpope/vim-abolish" | |
Bundle "airblade/vim-gitgutter.git" | |
"Bundle "nelstrom/vim-visual-star-search" | |
Bundle "Valloric/YouCompleteMe" | |
Bundle "duff/vim-bufonly" | |
Bundle "aliva/vim-fish" | |
" Customization | |
" The plugins listed in ~/.vim/.vundles.local will be added here to | |
" allow the user to add vim plugins to yadr without the need for a fork. | |
if filereadable(expand("~/.yadr/vim/.vundles.local")) | |
source ~/.yadr/vim/.vundles.local | |
endif | |
"Filetype plugin indent on is required by vundle | |
filetype plugin indent on |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment