forked from qiao/vimfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
172 lines (137 loc) · 4.32 KB
/
vimrc
File metadata and controls
172 lines (137 loc) · 4.32 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
" Don't be compatible with vi
set nocompatible
filetype off
" Use Vundle to manage plugins
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" Bundles
source ~/.vim/vimrc.bundles
filetype plugin indent on
" More powerful backspacing
set backspace=indent,eol,start
" Larger history storage
set history=1000
" Enalbe syntax highlighting
syntax on
" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
set background=dark
" Color settings
set t_Co=256
color tir_black
" highlight current cursor line and column
" use \c to switch on and off
au WinLeave * set nocursorline nocursorcolumn
au WinEnter * set cursorline cursorcolumn
set cursorcolumn cursorline
hi CursorLine cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
hi CursorColumn cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
nnoremap <Leader>c :set cursorline! cursorcolumn!<CR>
" JQuery syntax support
autocmd Syntax javascript set syntax=jquery
" Uncomment the following to have Vim jump to the last position when
" reopening a file
"if has("autocmd")
" au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
"endif
" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local
endif
" Matching
set showmatch " Show matching brackets.
set smartcase " Do smart case matching
set incsearch " Incremental search
set ignorecase " Do case insensitive matching
" Status
set showcmd " Show (partial) command in status line.
set laststatus=2 " Always show status bar
set ruler " Show cursor position
set number " Show line number
" Indentation
set autoindent
set expandtab
set tabstop=4
set shiftwidth=4
set linespace=4
autocmd Syntax html,css,ruby,javascript,coffee set tabstop=2 shiftwidth=2 linespace=2
" Indent guides (default toggle key is <leader>ig)
let g:indent_guides_auto_colors=0
let g:indent_guides_start_level=2
let g:indent_guides_guide_size=1
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd ctermbg=239
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven ctermbg=242
" NeoComplCache
let g:neocomplcache_force_overwrite_completefunc = 1
let g:neocomplcache_enable_at_startup=1
let g:neocomplcache_enable_smart_case=1
let g:neocomplcache_min_syntax_length = 3
let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'
autocmd Syntax html let g:neocomplcache_disable_auto_complete=1
set completeopt-=preview
" Snippet
" Enable snipMate compatibility feature.
let g:neosnippet#enable_snipmate_compatibility = 1
" Tell Neosnippet about the other snippets
let g:neosnippet#snippets_directory='~/.vim/bundle/vim-snippets/snippets'
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
imap <expr><TAB> neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : pumvisible() ? "\<C-n>" : "\<TAB>"
smap <expr><TAB> neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
if has('conceal')
set conceallevel=2 concealcursor=i
endif
" SuperTab
let g:SuperTabDefaultCompletionType="<c-n>"
" Zen-coding
let g:user_emmet_expandabbr_key='<c-j>'
let g:user_emmet_settings={
\ 'indentation': ' ',
\}
" Nerd Tree
let NERDChristmasTree=1
let NERDTreeWinSize=25
" Tab Bar
let g:Tb_MaxSize = 2
let g:Tb_TabWrap = 1
" Tagbar
let g:tagbar_left=0
let g:tagbar_width=30
" Rainbow parentheses for Lisp and variants
let g:rbpt_colorpairs = [
\ [172, 172],
\ [167, 167],
\ [141, 141],
\ [39, 39],
\ [49, 49],
\ [82, 82],
\ [11, 11],
\ [172, 172],
\ [167, 167],
\ [141, 141],
\ [39, 39],
\ [49, 49],
\ [82, 82],
\ [11, 11],
\ [172, 172],
\ [167, 167],
\ ]
let g:rbpt_max = 32
autocmd Syntax lisp,scheme,clojure RainbowParenthesesToggle
" Easymotion leader key
let g:EasyMotion_leader_key = '<Leader>'
" Key mappings
nmap <F4> :IndentGuidesToggle<cr>
nmap <F5> :NERDTreeToggle<cr>
nmap <F6> :TagbarToggle<cr>
" Extra commands
command W w
command WQ wq
command Wq wq
command Q q
command Qa qa
command QA qa
" Nginx syntax highlighting
autocmd BufNew,BufRead,BufNewFile,BufEnter /etc/nginx/*,/usr/local/nginx/*,/usr/local/etc/nginx/* setfiletype nginx
" Slim syntax highlighting
autocmd BufNew,BufRead,BufNewFile,BufEnter *.slim setfiletype slim