Skip to content

Instantly share code, notes, and snippets.

@lmduc
Last active January 9, 2017 02:04
Show Gist options
  • Save lmduc/6439b732197d2827c0f6 to your computer and use it in GitHub Desktop.
Save lmduc/6439b732197d2827c0f6 to your computer and use it in GitHub Desktop.
set nocompatible
filetype off
let mapleader=" "
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
" NERDTree
Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
map <leader>eo :NERDTreeMirrorToggle<cr>
map <leader>ec :NERDTreeFind<cr>
let NERDTreeQuitOnOpen=1
let g:nerdtree_tabs_autofind=1
" Theme
Plugin 'altercation/vim-colors-solarized'
Plugin 'flazz/vim-colorschemes'
syntax enable
set background=dark
colorscheme flattown
" Easymotion
Plugin 'Lokaltog/vim-easymotion'
" add this line to your .vimrc file
Plugin 'mattn/emmet-vim'
" Search
Plugin 'rking/ag.vim'
" NERDTREE + ag
Plugin 'taiansu/nerdtree-ag'
" Jump files
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'tacahiroy/ctrlp-funky'
let g:ctrlp_max_depth=50000
let g:ctrlp_max_files=50000
nmap <leader>oo :CtrlP<cr>
nmap <leader>oc :CtrlPClearCache<cr>
let g:ctrlp_extensions = ['funky']
nmap <leader>of :CtrlPFunky<cr>
" Tabular
Plugin 'godlygeek/tabular'
nmap <Leader>a& :Tabularize /&<CR>
vmap <Leader>a& :Tabularize /&<CR>
nmap <Leader>a= :Tabularize /=<CR>
vmap <Leader>a= :Tabularize /=<CR>
nmap <Leader>a=> :Tabularize /=><CR>
vmap <Leader>a=> :Tabularize /=><CR>
nmap <Leader>a: :Tabularize /:<CR>
vmap <Leader>a: :Tabularize /:<CR>
nmap <Leader>a:: :Tabularize /:\zs<CR>
vmap <Leader>a:: :Tabularize /:\zs<CR>
nmap <Leader>a, :Tabularize /,<CR>
vmap <Leader>a, :Tabularize /,<CR>
nmap <Leader>a,, :Tabularize /,\zs<CR>
vmap <Leader>a,, :Tabularize /,\zs<CR>
nmap <Leader>a<Bar> :Tabularize /<Bar><CR>
vmap <Leader>a<Bar> :Tabularize /<Bar><CR>
" Auto pairs
Plugin 'jiangmiao/auto-pairs'
" Rspec
Plugin 'thoughtbot/vim-rspec'
map <leader>rt :call RunCurrentSpecFile()<cr>
map <leader>rs :call RunNearestSpec()<cr>
map <leader>ra :call RunAllSpecs()<cr>
map <leader>rl :call RunLastSpec()<cr>
let g:rspec_command = 'call Send_to_Tmux("bundle exec rspec {spec}\n")'
let g:rspec_runner = "os_x_iterm"
" Tmux
Plugin 'jgdavey/tslime.vim'
" Commenter
Plugin 'scrooloose/nerdcommenter'
" Git
Plugin 'tpope/vim-fugitive'
" EmberJS syntax
Plugin 'mustache/vim-mustache-handlebars'
call vundle#end()
filetype plugin indent on
" Fast saving
nmap <leader>w :w!<cr>
" Fast quitting
nmap <leader>q :q<cr>
" Fast copy to clipboard
vmap <leader>yc "+y
" Tabs to spaces
set expandtab
set tabstop=2
set shiftwidth=2
set smarttab
set ai "Auto indent
set si "Smart indent
set wrap "Wrap lines"
" Move between splits
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" Show line numbers
set number
" Show current line and current column
set cursorline! cursorcolumn!
" Set to auto read when a file is changed from the outside
set autoread
" Ignore case when searching
set ignorecase
" Highlight search results
set hlsearch
" Makes search act like search in modern browsers
set incsearch
" Show matching brackets when text indicator is over them
set showmatch
" How many tenths of a second to blink when matching brackets
set mat=2"
" Set utf8 as standard encoding and en_US as the standard language
set encoding=utf8
" Turn backup off, since most stuff is in SVN, git et.c anyway...
set nobackup
set nowb
set noswapfile
" Switch focus on new split
set splitbelow
set splitright
" Not show breaking line
set nowrap
" Turn off beep and flash
set noerrorbells visualbell t_vb=
autocmd GUIEnter * set visualbell t_vb=
" Remove trailing spaces when saving
autocmd BufWritePre * :%s/\s\+$//e
" Backspace
set backspace=indent,eol,start
" VIM to tmux
let g:tslime_always_current_session = 1
let g:tslime_always_current_window = 1
nmap <leader>tdg :Tmux RAILS_ENV=test spring rake docs:generate<CR>
nmap <leader>tgpo :Tmux gpo `cbr`<CR>
nmap <leader>tgru :Tmux gru<CR>
nmap <leader>tpr :Tmux hub pull-request -h Ringmd:`cbr` -b develop<CR>
nmap <leader>tmg :Tmux spring rake db:migrate && spring rake db:test:clone<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment