Last active
May 25, 2017 14:29
-
-
Save caiolima/de38bb328fe56cf6cb17 to your computer and use it in GitHub Desktop.
caiolima's Vim Configuration for Rails and Python development
This file contains hidden or 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
set tabstop=2 | |
set shiftwidth=4 | |
set softtabstop=4 | |
set nowrap | |
set expandtab " expand tabs to spaces | |
set smarttab | |
set hidden | |
set autoread " reload files when changed on disk, i.e. via `git checkout` | |
set backspace=2 " fix broken backspace in some setups | |
set backupcopy=yes " see :help crontab | |
set clipboard=unnamed " yank and paste with the system clipboard | |
set directory-=. " don't store swapfiles in the current directory | |
set encoding=utf-8 | |
" search sets | |
set ignorecase " case-insensitive search | |
set incsearch " search as you type | |
set smartcase " case-sensitive search if any caps | |
set laststatus=2 " always show statusline | |
set number " show line numbers | |
set ruler " show where you are | |
set wildignore=log/**,node_modules/**,target/**,tmp/**,*.rbc,*.pyc,WebKitBuild/** | |
set wildmode=longest,list,full | |
" store a ton of history (default is 20) | |
set history=1000 | |
" highlight current line | |
set cursorline | |
" show matching brackets/parenthesis | |
set showmatch | |
set noswapfile | |
" keyboard shortcuts | |
inoremap jk <esc> | |
let mapleader = ',' | |
map <silent> <leader>v :source ~/.vimrc<cr>:filetype detect<cr>:exe ":echo 'vimrc reloaded'"<cr> | |
map <c-l> $ | |
map <c-h> ^ | |
nmap <silent> <S-D-CR> :ZoomWin<CR> | |
nmap <leader>b :CtrlPBuffer<cr> | |
nmap <C-c> :ClearAllCtrlPCaches<CR> | |
nmap <leader><space> :call whitespace#strip_trailing()<cr> | |
nmap qq :w<cr> | |
nmap <C-]> :YcmCompleter GoTo<cr> | |
filetype plugin on | |
" let g:ycm_global_ycm_extra_conf = "/Users/caiolima/open_projects/WebKit/Tools/gtk/ycm_extra_conf.py" | |
" let g:user_emmet_leader_key='<C-Z>' | |
" let g:CommandTAcceptSelectionTabMap = '<CR>' | |
" let g:user_emmet_settings = webapi#json#decode(join(readfile(expand('~/emmet-snippets/snippets-pastar.json')), "\n")) | |
" let g:rsenseHome = "/Users/caiolima/opt/rsense-0.3" | |
" let g:neocomplete#enable_at_startup = 1 | |
" CtrlP settings | |
let g:ctrlp_match_window = 'bottom,order:ttb' | |
" let g:ctrlp_switch_buffer = 0 | |
let g:ctrlp_working_path_mode = "a" | |
" let g:ctrlp_user_command = 'ag %s -l --nocolor --hidden -g "' | |
let g:ctrlp_max_files=0 | |
let g:ctrlp_max_depth=40 | |
" YouCompleteMe | |
let g:ycm_global_ycm_extra_conf = '/Users/caiolima/open_projects/WebKit/Tools/gtk/ycm_extra_conf.py' | |
" Use The Silver Searcher https://github.com/ggreer/the_silver_searcher | |
if executable('ag') | |
let g:ackprg = 'ag --nogroup --column' | |
" Use Ag over Grep | |
set grepprg=ag\ --nogroup\ --nocolor | |
" use ag in ctrlp for listing files. lightning fast and respects .gitignore | |
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""' | |
endif | |
" syntax enable | |
set background=dark | |
let g:solarized_termcolors=256 | |
colorscheme solarized | |
" enable syntastic (linting) | |
" let g:syntastic_check_on_open=1 | |
" let g:syntastic_enable_signs=1 | |
" let g:syntastic_javascript_checkers = ['jslint', 'gjslint'] | |
" enable ruler | |
set colorcolumn=110 | |
"autocmd BufNewFile,BufRead *.html.erb set filetype=html | |
" enable close HTML tags | |
" au Filetype jinja,xhtml,html,xml,xsl so ~/.vim/bundle/HTML-AutoCloseTag/ftplugin/html_autoclosetag.vim | |
" remove empty spaces in the end of line before save file | |
"autocmd! bufwritepre * call whitespace#strip_trailing() | |
" increase height of focused screen part | |
set winheight=5 | |
" set winminheight=5 | |
set winheight=9999 | |
" automatically rebalance windows on vim resize | |
autocmd VimResized * :wincmd = | |
" backup files | |
set backup | |
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp | |
set backupskip=/tmp/*,/private/tmp/* | |
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp | |
set writebackup | |
" bundles | |
if has('vim_starting') | |
set nocompatible " Be iMproved | |
" Required: | |
set runtimepath+=~/.vim/bundle/neobundle.vim/ | |
endif | |
" Required: | |
call neobundle#begin(expand('~/.vim/bundle/')) | |
" Let NeoBundle manage NeoBundle | |
" Required: | |
NeoBundleFetch 'Shougo/neobundle.vim' | |
set runtimepath^=~/.vim/bundle/ctrlp.vim | |
" My Bundles here: | |
NeoBundle 'kien/ctrlp.vim' | |
NeoBundle 'mattn/emmet-vim' | |
NeoBundle 'mattn/livestyle-vim' | |
NeoBundle 'tpope/vim-commentary' | |
NeoBundle 'airblade/vim-gitgutter' | |
NeoBundle 'groenewege/vim-less' | |
NeoBundle 'bling/vim-airline' | |
NeoBundle 'nvie/vim-flake8' | |
NeoBundle 'jelera/vim-javascript-syntax' | |
NeoBundle 'tomasr/molokai' | |
NeoBundle 'pangloss/vim-javascript' | |
NeoBundle 'nathanaelkane/vim-indent-guides' | |
NeoBundle 'Raimondi/delimitMate' | |
NeoBundle 'scrooloose/syntastic' | |
NeoBundle 'marijnh/tern_for_vim' | |
NeoBundle 'vim-scripts/HTML-AutoCloseTag' | |
NeoBundle 'drn/zoomwin-vim' | |
NeoBundle 'terryma/vim-multiple-cursors' | |
NeoBundle 'Lokaltog/powerline' | |
NeoBundle 'rking/ag.vim' | |
NeoBundle 'MarcWeber/vim-addon-mw-utils' | |
NeoBundle 'tomtom/tlib_vim' | |
NeoBundle 'garbas/vim-snipmate' | |
NeoBundle 'Valloric/YouCompleteMe' | |
" NeoBundle 'Shougo/neocomplete' | |
call neobundle#end() | |
set shell=/bin/bash | |
" Required: | |
filetype plugin indent on | |
" If there are uninstalled bundles found on startup, | |
" this will conveniently prompt you to install them. | |
NeoBundleCheck |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment