Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
209 lines (162 sloc) 4.39 KB
" Force read encoding
set encoding=utf-8
" To work cool, disable compatibility with Vi
set nocompatible
filetype off
" Set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
" Keep plugin commands between vundle#begin/end.
call vundle#begin()
" Indispensable
Plugin 'VundleVim/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'vim-airline/vim-airline'
Plugin 'kien/ctrlp.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'terryma/vim-multiple-cursors'
Plugin 'ludovicchabant/vim-gutentags'
Plugin 'rking/ag.vim'
Plugin 'tpope/vim-surround'
Plugin 'flazz/vim-colorschemes'
Plugin 'bronson/vim-trailing-whitespace'
" Optional tmux
Plugin 'christoomey/vim-tmux-navigator'
Plugin 'jgdavey/tslime.vim'
Plugin 'jpalardy/vim-slime'
" Choose languages
Plugin 'vim-ruby/vim-ruby'
Plugin 'tpope/vim-rails'
Plugin 'thoughtbot/vim-rspec'
Plugin 'elixir-lang/vim-elixir'
Plugin 'guns/vim-clojure-static'
Plugin 'fatih/vim-go'
Plugin 'python-mode/python-mode'
Plugin 'othree/html5.vim'
Plugin 'pangloss/vim-javascript'
Plugin 'dsawardekar/ember.vim'
Plugin 'joukevandermaas/vim-ember-hbs'
call vundle#end()
filetype plugin indent on
syntax enable
set background=dark
colorscheme hybrid
" Move the cursor to the matched string
set incsearch
" Search highlight
set hlsearch
" Search ignore case
set ignorecase
" Search do not wrap around
set nowrap
" Start scrolling 5 lines before the horizontal window border
set scrolloff=5
" Avoid lags
set lazyredraw
" Display line numbers
set number
set numberwidth=4
" To display the status line always
set laststatus=2
" Dont unload buffers
set hidden
" New window is put below the current one
set splitbelow
" New window is put right of the current one
set splitright
" Show commands
set showcmd
" Hide mode status (INSERT, VISUAL)
set noshowmode
" Show the cursor position
set ruler
" Allow backspace in insert mode
set backspace=start,eol,indent
" Reduce the need for % in matching
set showmatch
set matchtime=2
" Tab characters entered will be changed to spaces
set expandtab
" Number of space characters inserted for indentation
set shiftwidth=2
set softtabstop=2
" Avoid creation of * .ext files
set nowritebackup
set nobackup
set noswapfile
" Automatically read changes
set autoread
" Hidden buffer instead of close
set hidden
" Increase history
set history=1000
" Space as leader
map <space> <leader>
" Window buffer navigation
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
" Ctrl C + Ctrl V
vmap <C-c> "+yi
vmap <C-x> "+c
vmap <C-v> c<ESC>"+p
imap <C-v> <C-r><C-o>+
" Multi cursors mapping
let g:multi_cursor_next_key='<C-n>'
let g:multi_cursor_prev_key='<C-p>'
let g:multi_cursor_skip_key='<C-x>'
let g:multi_cursor_quit_key='<Esc>'
" Airline
let g:airline_powerline_fonts = 1
" RSpec terminal with tmux or iterm2
"let g:rspec_runner = 'os_x_iterm2'
let g:rspec_command = 'call Send_to_Tmux("rspec {spec}\n")'
" Remove Bars
set guioptions-=T
set guioptions-=t
set guioptions-=L
set guioptions-=l
set guioptions-=m
set guioptions-=r
" Clean search
nmap \hl :nohlsearch<CR>
" Open a new empty buffer
nmap <leader>N :enew<cr>
" Move to the next buffer
nmap <leader>n :bnext<CR>
" Move to the previous buffer
nmap <leader>p :bprevious<CR>
" Move to the previous buffer
nmap <leader>D :bdelete<CR>
" Close the current buffer and move to the previous one
nmap <leader>bq :bp <BAR> bd #<CR>
" Show all open buffers and their status
nmap <leader>bl :ls<CR>
" Toggle NERDTree
nmap <silent> <Leader>nt :NERDTreeToggle<CR>
" Toggle Tagbar
nmap <silent> <Leader>tt :TagbarToggle<CR>
" Remove all trailing whitespaces at save
autocmd BufWritePre * :%s/\s\+$//e
" RSpec.vim mappings
map <Leader>t :call RunCurrentSpecFile()<CR>
map <Leader>s :call RunNearestSpec()<CR>
map <Leader>l :call RunLastSpec()<CR>
map <Leader>a :call RunAllSpecs()<CR>
" Vim slime with tmux
let g:slime_target = "tmux"
let g:slime_paste_file = "$HOME/.slime_paste"
" Correct vim colors in tmux
set term=screen-256color
" Ignore some directories
set wildignore+=**/node_modules,**/bower_components,**/tmp,**/vendor,**/git
let NERDTreeIgnore=['node_modules', 'bower_components', 'tmp', 'vendor', 'tags']
let g:ctrlp_custom_ignore = 'node_modules\|bower_components\|tmp\|vendor\|DS_Store\|git|tags'
" Python mode disable some things
let g:pymode_options_colorcolumn = 0
let g:pymode_lint = 0
let g:pymode_run = 0
let g:pymode_virtualenv = 0
let g:pymode_doc = 0
let g:pymode_folding = 0
let g:pymode_rope = 0