Skip to content

Instantly share code, notes, and snippets.

@novasdream
Forked from gtcarlos/.vimrc
Last active August 29, 2015 14:16
Show Gist options
  • Save novasdream/e713a1c1a84372cd4459 to your computer and use it in GitHub Desktop.
Save novasdream/e713a1c1a84372cd4459 to your computer and use it in GitHub Desktop.
set nocompatible
filetype off
" Vundle
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim' " Required
Plugin 'tpope/vim-fugitive'
Plugin 'vim-scripts/closetag.vim'
Plugin 'kien/ctrlp.vim'
Plugin 'vim-scripts/delimitMate.vim'
Plugin 'mattn/emmet-vim'
Plugin 'othree/html5.vim'
Plugin 'walm/jshint.vim'
Plugin 'scrooloose/nerdcommenter'
Plugin 'scrooloose/nerdtree'
Plugin 'ervandew/supertab'
Plugin 'bling/vim-airline'
Plugin 'kchmck/vim-coffee-script'
"Plugin 'szw/vim-ctrlspace'
Plugin 'elixir-lang/vim-elixir'
Plugin 'hokaccha/vim-html5validator'
Plugin 'maksimr/vim-jsbeautify'
Plugin 'elzr/vim-json'
Plugin 'ggreer/the_silver_searcher'
call vundle#end()
filetype plugin indent on
set autoindent
set encoding=utf-8
set nu
set textwidth=80
set title
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set backspace=indent,eol,start
set noswapfile
set nobackup
" Syntax
syntax on
set t_Co=256
" Files
filetype on
filetype indent on
filetype plugin on
" Always show filename
set modeline
set ls=2
" Colorscheme
colorscheme molokai
let g:molokai_original = 1
" Vim Cursor
au InsertEnter * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape ibeam"
au InsertLeave * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape block"
au VimLeave * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape block"
au VimEnter * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape block"
" Vim splits remap
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>
" A trick for when you forgot to sudo before editing a file that requires root
" privileges (typically /etc/hosts).
" " This lets you use w!! to do that after you opened the file already:
cmap w!! w !sudo tee % >/dev/null
" CtrlSpace
let g:airline_exclude_preview = 1
hi CtrlSpaceSelected term=reverse ctermfg=187 ctermbg=23 cterm=bold
hi CtrlSpaceNormal term=NONE ctermfg=244 ctermbg=232 cterm=NONE
hi CtrlSpaceFound ctermfg=220 ctermbg=NONE cterm=bold
" Airline
let g:airline#extensions#tabline#enabled = 1
" NERDTree
map <C-n> :NERDTreeToggle<CR>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
" CtrlP + Ag
if executable('ag')
" 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment