Skip to content

Instantly share code, notes, and snippets.

@Boztown
Last active November 3, 2015 21:24
Show Gist options
  • Save Boztown/769875a19cd59a40b3f0 to your computer and use it in GitHub Desktop.
Save Boztown/769875a19cd59a40b3f0 to your computer and use it in GitHub Desktop.
My Vim Config
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'mattn/emmet-vim'
Plugin 'othree/html5.vim'
Plugin 'othree/html5-syntax.vim'
Plugin 'scrooloose/nerdtree.git'
Plugin 'vim-ruby/vim-ruby'
Plugin 'tpope/vim-rails'
Plugin 'tpope/vim-fugitive'
Plugin 'benmills/vimux'
" Just a shitload of color schemes.
" https://github.com/flazz/vim-colorschemes#current-colorschemes
Bundle 'flazz/vim-colorschemes'
Plugin 'kien/ctrlp.vim'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
imap <expr> <tab> emmet#expandAbbrIntelligent("\<tab>")
set tabstop=4 " The width of a TAB is set to 4.
" Still it is a \t. It is just that
" Vim will interpret it to be having
" a width of 4.
set shiftwidth=4 " Indents will have a width of 4
set softtabstop=4 " Sets the number of columns for a TAB
set expandtab " Expand TABs to spaces
set number
set relativenumber
set incsearch
set hlsearch
set nowrap
" More natural splitting
set splitbelow
set splitright
" Enter for new line with no INSERT
nmap <S-Enter> O<Esc>
nmap <CR> o<Esc>
:nnoremap <C-g> :NERDTree<CR>
" tab shortcuts
nnoremap th :tabfirst<CR>
nnoremap tj :tabnext<CR>
nnoremap tk :tabprev<CR>
nnoremap tl :tablast<CR>
nnoremap tt :tabedit<Space>
nnoremap tn :tabnext<Space>
nnoremap tm :tabm<Space>
nnoremap td :tabclose<CR>
" open NERDTree automatically
autocmd VimEnter * NERDTree
autocmd VimEnter * wincmd p
syntax on
set backspace=2
set cpoptions+=$
runtime macros/matchit.vim
" set auto suffix for Ruby files (for "gf" file jumping)
augroup rubypath
autocmd!
autocmd FileType ruby setlocal suffixesadd+=.rb
augroup END
" new html 5 tags
syn keyword htmlTagName contained article aside audio canvas command datalist
syn keyword htmlTagName contained details embed figcaption figure footer header
syn keyword htmlTagName contained hgroup keygen mark meter nav output progress
syn keyword htmlTagName contained rp rt ruby section source summary time video
set wildmenu
set wildmode=longest:full,full
" map JJ to escape INSERT
imap jj <Esc>
" In many terminal emulators the mouse works just fine, thus enable it.
if has('mouse')
set mouse=a
endif
" try to make NERDTree + CTRLP work on the current directory out
let g:NERDTreeChDirMode = 2
let g:ctrlp_working_path_mode = 'rw'
if ! has("gui_running")
set t_Co=256
endif
" feel free to choose :set background=light for a different style
" set background=dark
"let g:solarized_termcolors = 256
autocmd WinEnter * call s:CloseIfOnlyNerdTreeLeft()
" Close all open buffers on entering a window if the only
" buffer that's left is the NERDTree buffer
function! s:CloseIfOnlyNerdTreeLeft()
if exists("t:NERDTreeBufName")
if bufwinnr(t:NERDTreeBufName) != -1
if winnr("$") == 1
q
endif
endif
endif
endfunction
colorscheme monokai
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment