-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
executable file
·274 lines (230 loc) · 6.77 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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
".vimrc file for setting on startup
"Setting up NeoBundle
if has('vim_starting')
set nocompatible
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
call neobundle#begin(expand('~/.vim/bundle/'))
NeoBundleFetch 'Shougo/neobundle.vim'
"Call all packages
"NeoBundle 'LaTeX-Box-Team/LaTeX-Box', {'rev' : '61528a'}
NeoBundle 'scrooloose/nerdtree', {'rev' : 'b0bb78'}
"NeoBundle 'Lokaltog/vim-powerline', {'rev' : '09c0ce'}
NeoBundle 'benmills/vimux'
NeoBundle 'majutsushi/tagbar'
"NeoBundle 'scrooloose/syntastic'
NeoBundle 'Lokaltog/vim-easymotion'
"NeoBundle 'junegunn/goyo.vim'
"NeoBundle 'junegunn/limelight.vim'
NeoBundle 'godlygeek/tabular'
NeoBundle 'christoomey/vim-tmux-navigator'
"NeoBundle 'SirVer/ultisnips'
"NeoBundle 'honza/vim-snippets'
NeoBundle 'tpope/vim-surround'
"NeoBundle 'tpope/vim-rsi'
"NeoBundle 'vimwiki/vimwiki'
NeoBundle 'altercation/vim-colors-solarized'
NeoBundle 'scrooloose/nerdcommenter'
"NeoBundle 'bling/vim-airline'
"NeoBundle 'edkolev/tmuxline.vim'
call neobundle#end()
"automatically reload the .vimrc file
autocmd! bufwritepost .vimrc source %
"only show 5 words when suggesting spelling
set spellsuggest=5
"set vim to noncompatible mode which provides the most features
set nocompatible
"omnicomplete
set omnifunc=syntaxcomplete#Complete
"set text wrap automatically and linebreak so that words are not broken between
"lines
set wrap
set linebreak
set textwidth=80
set wrapmargin=0
"show line numbers and length
set number "show line numbers
set tw=79 "width of document
"set nowrap "don't automatically wrap on load
set fo-=t "don't automatically wrap text when writing
"set colorcolumn=80
highlight ColorColumn ctermbg=233
"set vim to use the same indent as the previous line
set autoindent
"toggle set list
nmap <leader>l :set list!<CR>
"alter the deafult behaviour of j and k for long lines of softwrapped text.
"This is most useful for latex files which have very long lines.
function! Changejk()
nnoremap j gj
nnoremap k gk
vnoremap j gj
vnoremap k gk
endfunction
"open .vimrc quickly
nnoremap <leader>v :e ~/.vimrc<CR>
"run cavestory or otherwise
nnoremap <leader>g :!make && make run<CR>
"invisible characters
set listchars=tab:▸\ ,eol:¬
"set the number of commands the vim holds in its register
set history=700
set undolevels=700
"better copy and paste
set pastetoggle=<F2>
set clipboard^=unnamed
"display current cursor position in the bottom right of the screen and show incomplete commands
set ruler
set showcmd
"remap , to <leader> key
let mapleader = " "
"bind Ctrl+<movement> keys to move around the windows, instead of using
"Ctrl+w+<movement>
map <c-j> <c-w>j
map <c-k> <c-w>k
map <c-l> <c-w>l
map <c-h> <c-w>h
"remap escape in insert mode
inoremap jk <ESC>
inoremap jj <ESC>
inoremap kj <ESC>
"show dollar sign at the end of a selection
set cpoptions+=$
"vimwiki settings
let g:vimwiki_list = [{'path': '~/Dropbox/vimwiki'}]
"map sort function to a key
vnoremap <Leader>s :sort<CR>
"map for running vimux/matlab command
nmap <Leader>r :call VimuxRunCommand("run " . bufname('%'))<CR>
"easier moving of code blocks
vnoremap < <gv
vnoremap > >gv
"easier formatting of paragraphs
vmap Q gq
nmap Q gqap
"use spaces instead of tabs (especially useful for python)
set tabstop =4
set softtabstop=4
set shiftwidth=4
set shiftround
set expandtab
"make search case insensitive
"set hlsearch
set incsearch
set ignorecase
set smartcase
"NerdTree
"https://github.com/scrooloose/nerdtree.git
map <C-n> :NERDTreeToggle<CR>
"Set .tex files to latex by default
let g:tex_flavor= "latex"
"Tagbar
"nmap <C-t> :TagbarToggle<CR>
""setup pathogen to manage plugins
"execute pathogen#infect()
"call pathogen#incubate()
"call pathogen#helptags()
"filetype detection
filetype plugin indent on
syntax on
"Color scheme
set t_Co=256
set background=dark
color solarized
"airline setup
let g:airline_powerline_fonts = 1
"Matlab settings
source $VIMRUNTIME/macros/matchit.vim
"Supertab settings
let g:SuperTabDefaultCompletionType = "context"
"Setting for Latex Box
let g:LatexBox_viewer="open"
"let g:LatexBox_latexmk_options="-pdflatex='pdflatex -synctex=1'"
let g:LatexBox_latexmk_async=0
let g:LatexBox_latexmk_preview_continuosly=0
"LatexBox_quickfix enables whether the quickfix dialogs opens
let LatexBox_quickfix=2
"============================================================================
"Python IDE Setup
" ============================================================================
"
"
" " Settings for vim-powerline
" " cd ~/.vim/bundle
" " git clone git://github.com/Lokaltog/vim-powerline.git
set laststatus=2
"
"
" " Settings for ctrlp
" " cd ~/.vim/bundle
" " git clone https://github.com/kien/ctrlp.vim.git
let g:ctrlp_max_height = 30
set wildignore+=*.pyc
set wildignore+=*_build/*
set wildignore+=*/coverage/*
"
"
" " Settings for python-mode
" " Note: I'm no longer using this. Leave this commented out
" " and uncomment the part about jedi-vim instead
" " cd ~/.vim/bundle
" " git clone https://github.com/klen/python-mode
" "" map <Leader>g :call RopeGotoDefinition()<CR>
" "" let ropevim_enable_shortcuts = 1
" "" let g:pymode_rope_goto_def_newwin = "vnew"
" "" let g:pymode_rope_extended_complete = 1
" "" let g:pymode_breakpoint = 0
" "" let g:pymode_syntax = 1
" "" let g:pymode_syntax_builtin_objs = 0
" "" let g:pymode_syntax_builtin_funcs = 0
" "" map <Leader>b Oimport ipdb; ipdb.set_trace() # BREAKPOINT<C-c>
"
"" Setting up AuotmaticLatexPlugin
"
"let b:atp_OpenViewer=1
"let b:atp_viewer = "open %S"
" " Settings for jedi-vim
" " cd ~/.vim/bundle
" " git clone git://github.com/davidhalter/jedi-vim.git
" related_names is deprecated
"let g:jedi#related_names_command = "<leader>z"
let g:jedi#usages_command = "<leader>z"
let g:jedi#popup_on_dot = 0
let g:jedi#popup_select_first = 0
map <Leader>b Oimport ipdb; ipdb.set_trace() # BREAKPOINT<C-c>
"
" " Better navigating through omnicomplete option list
" " See
" http://stackoverflow.com/questions/2170023/how-to-map-keys-for-popup-menu-in-vim
" "" set completeopt=longest,menuone
" "" function! OmniPopup(action)
" "" if pumvisible()
" "" if a:action == 'j'
" "" return "\<C-N>"
" "" elseif a:action == 'k'
" "" return "\<C-P>"
" "" endif
" "" endif
" "" return a:action
" "" endfunction
"
" "" inoremap <silent><C-j> <C-R>=OmniPopup('j')<CR>
" "" inoremap <silent><C-k> <C-R>=OmniPopup('k')<CR>
"
"
" " Python folding
" " mkdir -p ~/.vim/ftplugin
" " wget -O ~/.vim/ftplugin/python_editing.vim
" http://www.vim.org/scripts/download_script.php?src_id=5492
"set nofoldenable
"================================================
"Matlab setup
"================================================
"https://github.com/sgeb/vim-matlab.git
source $VIMRUNTIME/macros/matchit.vim
"Compile checking
autocmd BufEnter *.m compiler mlint
"============
"Vimux stuff
"============
let g:VimuxUseNearest = 1