-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc-macalester
230 lines (202 loc) · 8.78 KB
/
vimrc-macalester
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
set number "Turning line numbers on
set lines=65 columns=90
set hidden "No need to save buffers before opening a new one.
set ignorecase
set smartcase "Ignore case in search when term all lower case, else not.
set gdefault " Substitution everywhere in a line!
set nobackup "Don't save backup files. We have git nowadays.
set noswapfile "Don't save swap files (Do I want this?)
"set guioptions-=T "By default hide toolbar in gvim: less clutter, more space.
set guioptions-=r "By default hide right scrollbar in gvim
set guioptions-=L "By default hide left scrollbar in gvim
set autoindent "Self explanatory
set linebreak "Break lines above 80 characters wide
set textwidth=80
set hlsearch "Highlight search matches
set incsearch
set mouse=a "Better mouse interaction in both GUI and terminal
"set guifont=DejaVuSansMonoForPowerline:h12
set guifont=DejaVuSansMono:h12
filetype plugin on "Smart filetype recognition etc.
filetype indent on
filetype plugin indent on
set grepprg=grep\ -nH\ $*
set t_Co=256
set ofu=syntaxcomplete#Complete "Autocomplete options
set completeopt+=longest
set scrolloff=6 "Show 10 lines above/below cursor except at beg/end of files
set showtabline=1
set encoding=utf-8
let g:pymode_lint=0 " Disable PyLint in pymode. Using flake8()
"""============================================================================
" DISABLING ARROW KEYS IN VIM, GODSPEED!
"""============================================================================
inoremap <Up> <NOP>
inoremap <Down> <NOP>
inoremap <Left> <NOP>
inoremap <Right> <NOP>
nnoremap <Up> <NOP>
nnoremap <Down> <NOP>
nnoremap <Left> <NOP>
nnoremap <Right> <NOP>
vnoremap <Up> <NOP>
vnoremap <Down> <NOP>
vnoremap <Left> <NOP>
vnoremap <Right> <NOP>
"""============================================================================
"Use Pathogen to manpage plugins.
"""============================================================================
filetype off
call pathogen#infect()
call pathogen#helptags()
filetype plugin indent on
syntax on
"""============================================================================
" Rope completion in Vim
"""============================================================================
let pymode_rope_vim_completion = 1
let pymode_rope_extended_complete = 1
let g:pymode_rope_autoimport_modules = ["pandas.*","matplotlib.pyplot","scipy.*", "os.*"]
"imap <C-Space> <C-R>=RopeCodeAssistInsertMode()<CR>
"""============================================================================
" Option for persistent undo, new to Vim 7.3
"""============================================================================
set undodir=./undo/
set undofile
set undolevels=1000
set undoreload=10000
"""============================================================================
"Set options for Python files:
"""============================================================================
"au FileType python set omnifunc=pythoncomplete#Complete
au FileType python setlocal tabstop=4 expandtab shiftwidth=4 softtabstop=4
"au FileType python compiler pylint "Autoenable pylint
"let g:pylint_onwrite = 1 "Don't call pylint at every write
"let g:pylint_signs = 0 "Markers for lines with python errors
"let g:pymode_syntax = 0
"""============================================================================
" Options for MiniBufExplorer
"""============================================================================
let g:miniBufExplMapWindowNavArrows = 1
"""============================================================================
" Options for vim-powerline:
"""============================================================================
"Using the new python-based version, simply named Powerline:
python from powerline.bindings.vim import source_plugin; source_plugin()
set laststatus=2 " Always display the statusline in all windows
set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the statusline)
"let g:Powerline_theme = 'default'
" If opening gVim with no file, view NERDTree
"autocmd VimEnter * if !argc() | NERDTree | endif
"
"""============================================================================
""" TagBar options:
"""============================================================================
" Open Tagbar, return cursor to main window
autocmd VimEnter * nested :call tagbar#autoopen(1)
" Auto open tagbar if opening a supported file
autocmd FileType * nested :call tagbar#autoopen(0)
let g:tagbar_width = 35
let g:tagbar_expand = 1 "Expand the window to accomodate tagbar
let g:tagbar_foldlevel = 0 "Start tagbar with folds collapsed
"""============================================================================
" Options for autocomplete
"""============================================================================
" Disabled due to possible clash with python-mode
"let g:SuperTabDefaultCompletionType = 'context'
"let g:SuperTabLongestEnhanced = 'longest'
"set completeopt=menuone,longest,preview
"""============================================================================
" Options for indent guides
"""============================================================================
let g:indent_guides_start_level = 2
let g:indent_guides_guide_size = 1
" But actually I don't like them...
"""============================================================================
" Options for snipMate:
"""============================================================================
let g:snips_author = 'T. E. Rivera-Thorsen'
"""============================================================================
" Option for (La)TeX plugin
"""============================================================================
let g:tex_flavor = 'latex'
let g:Tex_ViewRule_pdf = 'okular'
let g:Tex_CompileRule_pdf = 'pdflatex --interaction=nonstopmode $*'
let g:solarized_termcolors = 256 "But I don't really use solarized...
"""============================================================================
"CtrlP: Fuzzy search in vim.
"""============================================================================
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlPBufTag'
let g:ctrlp_extensions = ['mixed', 'buffertag', 'line']
"let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix',
" \'dir', 'rtscript', 'undo',
" \'line', 'changes', 'mixed',
" \'bookmarkdir']
"""============================================================================
" Misc. mappings:
"""============================================================================
" change the mapleader from \ to ,
let mapleader=","
" Quickly edit/reload the vimrc file (from nvie.com/posts/how-i-boosted-my-vim/
nmap <silent> <leader>ev :e $MYVIMRC<CR>
nmap <silent> <leader>sv :so $MYVIMRC<CR>
" Map <leader>ch to make comment-headline.
nnoremap <leader>ch 3i#<ESC>76A=<ESC>yy1o#<ESC>p1k6A<Space><ESC>i
" Map <leader>W to strip trailing whitespace (steve losh)
nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<CR>
" Map <leader> N to clear search hightlighting.
nnoremap <leader>n :noh<CR>
"Map key to toggle line numbers, tagbar, gundo and NERDTree plugins:
nnoremap <F2> :set nonumber!<CR>:set foldcolumn=0<CR>
nnoremap <F5> :GundoToggle<CR>
nmap <F6> :MiniBufExplorer<CR>
nmap <S-F6> :TMiniBufExplorer<CR>
nmap <F8> :TagbarToggle<CR>
nmap <F9> :NERDTreeToggle<CR>
" Toggle the list option:
nnoremap <leader>l :set list! list?<cr>
" Easily set and unset cursorline and cursorcolumn.
map <leader>cc :set cursorcolumn!<CR>
map <leader>cl :set cursorline!<CR>
" Remap Alt-k and Alt-j to move screen contents down and up while keeping the
" cursor on the middle line:
nnoremap <D-j> jzz
nnoremap <D-k> kzz
"
" Map sort function to key:
vnoremap <leader>s :sort<CR>
" Better movement:
vnoremap < <gv
vnoremap > >gv
" Use unimpaired to "bubble" text up and down:
" Bubble single lines
nmap <D-Up> [e
nmap <D-Down> ]e
" Bubble multiple lines
vmap <D-Up> [egv
vmap <D-Down> ]egv
" Easy window navigation
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
nmap <leader>d :b#<bar>bd#<CR>
" Map TeskList plugin:
"map <leader>tl <Plug>TaskList
"colorscheme xoria256-pluk
"colorscheme molokai
colorscheme Twilight
"let g:molokai_original = 1 "Set to 1 for slightly more brownish bg
":highlight LineNr ctermbg=Black ctermfg=DarkGray
":highlight Folded ctermbg=Black ctermfg=DarkGray
":highlight LineNr guibg=#222222 guifg=DarkGray
":highlight Folded guibg=#222222 guifg=DarkGray
"set modelines
"These two: is there a better way?
set foldmethod=indent
set foldlevel=99
"Setting default size of window, should be at end of file.
"set lines=65 columns=95
set colorcolumn=80 "Marker for 80th column
"set TagbarOpen