-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
215 lines (158 loc) · 4.96 KB
/
vimrc
File metadata and controls
215 lines (158 loc) · 4.96 KB
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
set nocompatible
filetype off
filetype plugin indent on
""""""""""""""""""""""""""""""""""""""""
" Styles
""""""""""""""""""""""""""""""""""""""""
let g:solarized_termcolors=256
"colorschemes:
"colorscheme desert256
"colorscheme jellybeans
"colorscheme neverland-darker
colorscheme neverland
"colorscheme oceandeep
"colorscheme railscasts
"colorscheme solarized
"colorscheme wombat256mod
set background=dark
""""""""""""""""""""""""""""""""""""""""
" Vundle setup
""""""""""""""""""""""""""""""""""""""""
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
""""""""""""""""""""""""""""""""""""""""
" Vundle repos
""""""""""""""""""""""""""""""""""""""""
Bundle 'kien/ctrlp.vim'
Bundle 'vim-scripts/delimitMate.vim'
Bundle 'tpope/vim-endwise'
Bundle 'tpope/vim-markdown'
Bundle 'scrooloose/nerdtree'
Bundle 'vim-scripts/rubycomplete.vim'
Bundle 'tpope/vim-rails'
Bundle 'tpope/vim-surround'
Bundle 'scrooloose/syntastic'
Bundle 'godlygeek/tabular'
Bundle 'Shougo/neocomplcache'
Bundle 'Shougo/neosnippet'
""""""""""""""""""""""""""""""""""""""""
" Preferences
""""""""""""""""""""""""""""""""""""""""
" UTF-8 encoding
set enc=utf-8
" Turning on/off paste mode by F5
set pastetoggle=<F5>
"default indent settings
set shiftwidth=2 "4 by default
set softtabstop=2 "4 by default
set expandtab
set autoindent
"store lots of :cmdline history
set history=1000
"find the next match as we type the search
set incsearch
"hilight searches by default
set hlsearch
"don't wrap lines
set wrap
"wrap them only on a convinient points
set linebreak
"fold based on indent
set foldmethod=indent
"deepest fold is 3 levels
set foldnestmax=3
"dont fold by default
set nofoldenable
"dont continue comments when pushing o/O
set formatoptions-=o
"vertical/horizontal scroll off settings
set scrolloff=3
set sidescrolloff=7
set sidescroll=1
"turn on syntax highlighting
syntax enable
"syntax on
set showmatch
"some stuff to get the mouse going in term
set mouse=a
set ttymouse=xterm2
"tell the term has 256 colors
set t_Co=256
"hide buffers when not displayed
set hidden
"undo settings
set undodir=~/.vim/undofiles
set undofile
""""""""""""""""""""""""""""""""""""""""
" VIM appearence
""""""""""""""""""""""""""""""""""""""""
"hide docs preview
set completeopt-=preview
set cursorline
hi CursorLine guibg=#333333
"allow backspacing over everything in insert mode
set backspace=indent,eol,start
"show incomplete cmds down the bottom
set showcmd
"show current mode down the bottom
set showmode
"show line numbers
set number
"display tabs and trailing spaces
set list
set listchars=tab:▷⋅,trail:⋅,nbsp:⋅
"statusline
set laststatus=2
set statusline=%t "tail of the filename
set statusline+=[%{strlen(&fenc)?&fenc:'none'}, "file encoding
set statusline+=%{&ff}] "file format
set statusline+=%h "help file flag
set statusline+=%m "modified flag
set statusline+=%r "read only flag
set statusline+=%y "filetype
set statusline+=%= "left/right separator
set statusline+=%c, "cursor column
set statusline+=%l/%L "cursor line/total lines
set statusline+=\ %P "percent through file
""""""""""""""""""""""""""""""""""""""""
" NERDTree
""""""""""""""""""""""""""""""""""""""""
"open a NERDTree automatically when vim starts up if no files were specified
autocmd vimenter * if !argc() | NERDTree | endif
"close vim if the only window left open is a NERDTree
"autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
let g:NERDTreeMouseMode = 2
let g:NERDTreeWinSize = 40
""""""""""""""""""""""""""""""""""""""""
" NeoComlCache
""""""""""""""""""""""""""""""""""""""""
"enable NeoComlCache at VIM startup
let g:neocomplcache_enable_at_startup = 1
"enable smart case
let g:neocomplcache_enable_smart_case = 1
"use camel case completion
let g:neocomplcache_enable_camel_case_completion = 1
"use underbar completion
let g:neocomplcache_enable_underbar_completion = 1
" Sets minimum char length of syntax keyword.
let g:neocomplcache_min_syntax_length = 3
" Tab completion
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" Enable omni completion. Not required if they are already set elsewhere in .vimrc
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete
""""""""""""""""""""""""""""""""""""""""
" NeoSnippet
""""""""""""""""""""""""""""""""""""""""
" SuperTab like snippets behavior.
imap <expr><TAB> neosnippet#expandable() ? "\<Plug>(neosnippet_expand_or_jump)" : pumvisible() ? "\<C-n>" : "\<TAB>"
smap <expr><TAB> neosnippet#expandable() ? "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
" For snippet_complete marker.
if has('conceal')
set conceallevel=2 concealcursor=i
endif