-
Notifications
You must be signed in to change notification settings - Fork 27
/
vimrc
126 lines (107 loc) · 3.4 KB
/
vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
set nocompatible " required
filetype off " required
set rtp+=$HOME/.vim/bundle/Vundle.vim " set the runtime path to include Vundle and initialize
call vundle#begin()
Plugin 'gmarik/Vundle.vim' " let Vundle manage Vundle, required
" utils
Plugin 'ap/vim-css-color'
Plugin 'bling/vim-airline'
Plugin 'bronson/vim-trailing-whitespace'
Plugin 'ervandew/supertab'
Plugin 'scrooloose/nerdtree'
Plugin 'scrooloose/syntastic'
Plugin 'tpope/vim-fugitive'
Plugin 'Yggdroot/indentLine'
Plugin 'kien/ctrlp.vim'
" languages
Plugin 'elzr/vim-json'
Plugin 'groenewege/vim-less'
Plugin 'hail2u/vim-css3-syntax'
Plugin 'jnwhiteh/vim-golang'
Plugin 'kchmck/vim-coffee-script'
Plugin 'othree/html5.vim'
Plugin 'pangloss/vim-javascript'
Plugin 'tpope/vim-haml'
Plugin 'tpope/vim-markdown'
Plugin 'tpope/vim-rails'
Plugin 'vim-ruby/vim-ruby'
" themes
Plugin 'chriskempson/vim-tomorrow-theme'
Plugin 'reedes/vim-thematic'
Plugin 'tomasr/molokai'
Plugin 'vim-scripts/ScrollColors'
call vundle#end() " required
filetype plugin indent on " required
" UI
set encoding=utf-8
set number " show line number
set autoread " watch for file changes
set autoindent
set noswapfile " disable swapfiles
set nobackup " disable backups
set backupdir=$HOME/.vim/backup " Directories for swp files
set showmatch " show matching brackets.
set showcmd " shows what you're typing as a command
set wildmenu
set ttyfast " faster redraw
set timeoutlen=1000 ttimeoutlen=0 " eliminating esc delays
set shortmess+=I " no welcome message
"set ruler
" Whitespace stuff
set nowrap
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
" Searching
set hlsearch " highlight all matches
set incsearch " do incremental searching
set ignorecase " ignore case when searching
set smartcase
set gdefault
" use normal regex for search
nnoremap / /\v
vnoremap / /\v
" Folding
set foldmethod=indent " fold based on indent level
set foldnestmax=10 " max 10 depth
set foldenable " don't fold files by default on open
nnoremap <space> za " use space to toggle folds
set foldlevelstart=10 " start with fold level of 1
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
" remap jj to escape in insert mode. You'll never type jj anyway!
inoremap jj <Esc>hh
" Removes highlight of your last search
noremap <C-n> :nohl<CR>
vnoremap <C-n> :nohl<CR>
inoremap <C-n> :nohl<CR>
" :w!! to write to a file using sudo
cmap w!! %!sudo tee > /dev/null %
" Source the vimrc file after saving it
autocmd BufWritePost $MYVIMRC source $MYVIMRC
" Disable syntax highlight for files larger than 50 MB
autocmd BufWinEnter * if line2byte(line("$") + 1) > 50000000 | syntax clear | endif
" Airline
let g:airline#extensions#tabline#left_sep = ' '
let g:airline#extensions#tabline#left_alt_sep = '|'
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_theme='powerlineish'
set laststatus=2
set background=dark
set t_Co=256
set fillchars+=stl:\ ,stlnc:\
let g:rehash256 = 1
:silent! colorscheme molokai
syntax on
if $TERM_PROGRAM =~ "iTerm"
let &t_SI = "\<Esc>]50;CursorShape=1\x7" " Vertical bar in insert mode
let &t_EI = "\<Esc>]50;CursorShape=0\x7" " Block in normal mode
endif
" Include other files
" if filereadable(expand("~/.vimrc.local"))
" source ~/.vimrc.local
" endif