nav-mike
7/12/2016 - 7:24 AM

my .vimrc

my .vimrc

set shell=/bin/bash

set nocompatible
filetype off

filetype plugin on
set omnifunc=syntaxcomplete#Complete

autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1 
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
autocmd BufNewFile,BufRead *.slim set ft=slim

" Add recently accessed projects menu (project plugin)
set viminfo^=!

" Minibuffer Explorer Settings
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1

function! AirlineInit()
  let g:airline_section_a = airline#section#create(['mode', ' ', 'branch'])
  let g:airline_section_b = airline#section#create_left(['ffenc', 'hunks', '%f'])
  let g:airline_section_c = airline#section#create(['filetype'])
  let g:airline_section_x = airline#section#create(['%P'])
  let g:airline_section_y = airline#section#create(['%B'])
  let g:airline_section_z = airline#section#create_right(['%l', '%c'])
endfunction
autocmd VimEnter * call AirlineInit()

let g:gruvbox_italic=1
set background=dark    " Setting dark mode

" alt+n or alt+p to navigate between entries in QuickFix
"map :cp
"map :cn

" Change which file opens after executing :Rails command
let g:rails_default_file='config/database.yml'

set cf " Enable error files & error jumping
set clipboard+=unnamed " Yanks go on clipboard instead
set history=256 " Number of things to remember in history
set autowrite " Writes on make/shell commands
set ruler " Ruler on
set nowrap " Line wrapping off
set guifont=Monaco:h20
set guifont=Monospace\ 20
set timeoutlen=250 " Time to wait after ESC (default causes an annoying delay)

" Formatting (some these are for coding in C and C++)
set ts=2 " Tabs are 2 spaces
set bs=2 " Backspace over everything in insert mode
set shiftwidth=2 " tabs under smart indent
set nocp incsearch
set cinoptions=:0,p0,t0
set cinwords=if,else,while,do,for,switch,case
set formatoptions=tcqr
set cindent
set autoindent
set smarttab
set expandtab

" Visual
set showmatch " Show matching brackets
set mat=5 " Bracket blinking
set list
set noerrorbells " No noise
set laststatus=2 " Always show status line

"syntax on
"set t_Co=256
set t_Co=256 

" copy/paste via Ctrl+C/Ctrl+V
vmap <C-C> "+yi
vmap <C-V> "+gPi

set t_Co=256 

set mouse=a " Turn on mouse support
set novisualbell " No blink
set showtabline=0
set foldcolumn=1 " + for code blocks

" disable .swp
set nobackup
set noswapfile

" syntastic plugin
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

" rspec
let mapleader=" "
map <Leader>t :call RunCurrentSpecFile()<CR>
map <Leader>s :call RunNearestSpec()<CR>
map <Leader>l :call RunLastSpec()<CR>
map <Leader>a :call RunAllSpecs()<CR>

" rubocop
let g:vimrubocop_config = '~/zeustrak/.rubocop.yml'
let g:vimrubocop_keymap = 0
map <Leader>r :RuboCop<CR>

let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

Plugin 'VundleVim/Vundle.vim'

" This is the Vundle package, which can be found on GitHub.
" For GitHub repos, you specify plugins using the
" 'user/repository' format
Plugin 'gmarik/vundle'
Plugin 'tpope/vim-rails'
Plugin 'kchmck/vim-coffee-script'
Plugin 'tpope/vim-haml'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'slim-template/vim-slim.git'
Plugin 'vim-ruby/vim-ruby'
Plugin 'thoughtbot/vim-rspec'
Plugin 'othree/html5.vim'
Plugin 'gilgigilgil/anderson.vim'
Plugin 'amiorin/vim-project'
Plugin 'morhetz/gruvbox'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'Valloric/YouCompleteMe'
Plugin 'lornix/vim-scrollbar'
Plugin 'jpo/vim-railscasts-theme'
Plugin 'tpope/vim-git'
Plugin 'tpope/vim-fugitive'
Plugin 'scrooloose/syntastic'
Plugin 'ngmy/vim-rubocop'

" comment code
Plugin 'scrooloose/nerdcommenter'

" show git diff
Plugin 'airblade/vim-gitgutter'

Plugin 'sandeepravi/refactor-rails.vim'

" We could also add repositories with a ".git" extension
Plugin 'scrooloose/nerdtree.git'

" To get plugins from Vim Scripts, you can reference the plugin
" by name as it appears on the site
Plugin 'Buffergator'

call vundle#end()

" Now we can turn our filetype functionality back on
syntax enable
colorscheme railscasts
filetype plugin indent on
autocmd VimEnter * NERDTree

:set number

" tabs
:set tabstop=2
:set shiftwidth=2
:set expandtab