-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
197 lines (184 loc) · 6.61 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
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
set nocompatible
set modelines=5
syntax on
filetype off
" setlocal spell spelllang=en_us
set spell
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#rc()
set t_Co=256
set background=dark
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
set nowrap
set autoindent
let mapleader = ','
nnoremap ; :
set encoding=utf-8
Bundle 'VundleVim/Vundle.vim'
Bundle 'scrooloose/nerdtree'
Bundle "jnurmine/Zenburn"
Bundle 'jistr/vim-nerdtree-tabs'
Bundle 'flazz/vim-colorschemes'
Bundle 'corntrace/bufexplorer'
Bundle 'chriskempson/tomorrow-theme', {'rtp': 'vim/'}
Bundle 'altercation/solarized', {'rtp': 'vim-colors-solarized/'}
"Bundle 'Lokaltog/vim-powerline'
Bundle 'bling/vim-airline'
Bundle 'vim-airline/vim-airline-themes'
Bundle 'benmills/vimux'
Bundle 'tpope/vim-fugitive'
Bundle 'Lokaltog/vim-easymotion'
" Pick one of the checksyntax, jslint, or syntastic
Bundle 'scrooloose/syntastic'
Bundle 'scrooloose/nerdcommenter'
Bundle 'godlygeek/tabular'
if executable('ctags')
Bundle 'majutsushi/tagbar'
Bundle 'xolox/vim-misc'
Bundle 'xolox/vim-easytags'
Bundle 'vim-scripts/taglist.vim'
endif
Bundle 'Shougo/neocomplcache'
Bundle 'honza/dockerfile.vim'
Bundle 'rodjek/vim-puppet'
Bundle 'digitaltoad/vim-jade'
Bundle "motus/pig.vim"
Bundle 'groenewege/vim-less'
Bundle 'hail2u/vim-css3-syntax'
Bundle 'tpope/vim-haml'
Bundle 'elzr/vim-json'
Bundle "pangloss/vim-javascript"
Bundle 'othree/html5.vim'
Bundle 'kchmck/vim-coffee-script'
"Bundle 'shinokada/dragvisuals.vim'
Bundle 'tpope/vim-markdown'
Bundle 'sjl/gundo.vim'
Bundle 'terryma/vim-multiple-cursors'
Bundle 'mhinz/vim-signify'
Bundle 'vim-ruby/vim-ruby'
Bundle 'ConradIrwin/vim-bracketed-paste'
map <C-e> :NERDTreeToggle<CR>:NERDTreeMirror<CR>
map <leader>e :NERDTreeFind<CR>
nmap <leader>nt :NERDTreeFind<CR>
let NERDTreeShowBookmarks=1
let NERDTreeIgnore=['\.pyc', '\~$', '\.swo$', '\.swp$', '\.git', '\.hg', '\.svn', '\.bzr']
let NERDTreeChDirMode=0
let NERDTreeQuitOnOpen=1
let NERDTreeShowHidden=1
let NERDTreeKeepTreeInNewTab=1
set backspace=indent,eol,start " backspace for dummies
set linespace=0 " No extra spaces between rows
set nu " Line numbers on
set showmatch " show matching brackets/parenthesis
set incsearch " find as you type search
set hlsearch " highlight search terms
set winminheight=0 " windows can be 0 line high
set ignorecase " case insensitive search
set smartcase " case sensitive when uc present
set wildmenu " show list instead of just completing
set wildmode=list:longest,full " command <Tab> completion, list matches, then longest common part, then all.
set whichwrap=b,s,h,l,<,>,[,] " backspace and cursor keys wrap to
set scrolljump=5 " lines to scroll when cursor leaves screen
set scrolloff=3 " minimum lines to keep above and below cursor
set foldenable " auto fold code
set list
set listchars=tab:,.,trail:.,extends:#,nbsp:. " Highlight problematic whitespace
colorscheme zenburn
set background=dark
"colorscheme solarized
let g:Tex_ViewRule_pdf='Preview'
let g:Tex_CompileRule_pdf = 'xelatex --interaction=nonstopmode --shell-escape $*'
set laststatus=2
let g:Powerline_symbols = 'fancy'
set timeoutlen=1000 ttimeoutlen=0
nnoremap <silent> <leader>tt :TagbarToggle<CR>
nnoremap <leader>i :set invpaste paste?<CR>
set pastetoggle=<leader>i
set showmode
let g:Tlist_Use_Right_Window = 1
let Tlist_WinWidth = 50
let g:neocomplcache_enable_at_startup = 1
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,eruby setlocal omnifunc=rubycomplete#Complete
autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1
let g:easytags_suppress_ctags_warning = 1
set tags=~/.vimtags
map <leader>fi :setlocal foldmethod=indent<cr>
map <leader>fs :setlocal foldmethod=syntax<cr>
let g:syntastic_always_populate_loc_list=1
filetype plugin indent on
let g:is_bash = 1
let g:sh_fold_enabled = 3
let g:vim_json_syntax_conceal = 1
set foldmethod=syntax
" http://vim.wikia.com/wiki/Keep_folds_closed_while_inserting_text
autocmd InsertEnter * if !exists('w:last_fdm') | let w:last_fdm=&foldmethod | setlocal foldmethod=manual | endif
autocmd InsertLeave,WinLeave * if exists('w:last_fdm') | let &l:foldmethod=w:last_fdm | unlet w:last_fdm | endif
" do not regard "-" as word seperator (css Files!)
set iskeyword+=-
let g:xml_syntax_folding=1
" For dragvisuals
runtime plugin/dragvisuals.vim
vmap <expr> <LEFT> DVB_Drag('left')
vmap <expr> <RIGHT> DVB_Drag('right')
vmap <expr> <DOWN> DVB_Drag('down')
vmap <expr> <UP> DVB_Drag('up')
vmap <expr> D DVB_Duplicate()
" For Gundo
nnoremap <leader>u :GundoToggle<CR>
"vim-arline"
"let g:airline_branch_prefix = '⭠'
"let g:airline_readonly_symbol = '⭤'
"let g:airline_linecolumn_prefix = '⭡'
"let g:airline_enable_branch = 1
"let g:airline_enable_syntastic = 1
"
let g:airline_theme = 'powerlineish'
let g:airline#extensions#branch#enabled = 1
let g:airline#extensions#syntastic#enabled = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#hunks#enabled = 1
let g:airline#extensions#tagbar#enabled = 1
"" vim-powerline symbols
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 = ''
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = ''
let g:airline_symbols.branch = ''
" vim-signify
let g:signify_vcs_list = [ 'git', 'svn' ]
" Sudo write
cmap w!! w !sudo tee > /dev/null %
" Custom Command
let g:silent_custom_command = 0
function! RunCustomCommand()
up
if g:silent_custom_command
execute 'silent !' . s:customcommand
else
execute '!' . s:customcommand
end
endfunction
function! SetCustomCommand()
let s:customcommand = input('Enter Custom Command$ ')
endfunction
map <leader>r :call RunCustomCommand()<cr>
map <leader>s :call SetCustomCommand()<cr>
"Autoformat JSON
nmap =j :%!python -c "import json, sys; print json.dumps(json.load(sys.stdin), indent=2)"<CR>