Mercurial > dotfiles
annotate vim/vimrc @ 410:5bbd5963591c
Some Vim config tweaks.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 20 Dec 2017 09:11:19 -0800 |
parents | c32b9b172314 |
children | 4a2468f72e44 |
rev | line source |
---|---|
6 | 1 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
2 " | |
0 | 3 " Ludovic Chabant's ~/.vimrc |
4 " | |
6 | 5 " http://ludovic.chabant.com |
6 " | |
7 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
0 | 8 |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
9 " Global Setup {{{ |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
10 |
0 | 11 " Use Vim settings, rather then Vi settings (much better!). |
12 " This must be first, because it changes other options as a side effect. | |
13 set nocompatible | |
14 | |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
15 " Set a variable that says we already sourced this file, for those few |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
16 " settings we don't want to re-apply. |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
17 if exists('g:sourced_vimrc') |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
18 let g:resourcing_vimrc = 1 |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
19 endif |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
20 let g:sourced_vimrc = 1 |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
21 |
83 | 22 " Get the platform we're running on. |
6 | 23 if has("win32") || has("win64") || has("dos32") |
83 | 24 let s:vim_platform = "windows" |
286
a29080fb35d9
Add support for local Vim bundle.
Ludovic Chabant <ludovic@chabant.com>
parents:
284
diff
changeset
|
25 let s:path_sep = "\\" |
6 | 26 else |
83 | 27 let s:vim_platform = "unix" |
286
a29080fb35d9
Add support for local Vim bundle.
Ludovic Chabant <ludovic@chabant.com>
parents:
284
diff
changeset
|
28 let s:path_sep = '/' |
6 | 29 endif |
30 | |
83 | 31 " Get our vim directory. |
95
b96ff0dd0137
Fixed the generated vimrc's runtimepath.
Ludovic Chabant <ludovic@chabant.com>
parents:
83
diff
changeset
|
32 let s:vim_home = expand("<sfile>:h") |
83 | 33 |
386
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
34 " Local pre-override. |
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
35 let s:local_vimrc_pre = s:vim_home.'/vimrc-local-pre' |
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
36 if filereadable(s:local_vimrc_pre) |
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
37 execute 'source' s:local_vimrc_pre |
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
38 endif |
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
39 |
127
1f709d7e03c6
Better Python dev in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
118
diff
changeset
|
40 " Make sure `filetype` stuff is turned off before loading Pathogen. |
1f709d7e03c6
Better Python dev in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
118
diff
changeset
|
41 syntax off |
1f709d7e03c6
Better Python dev in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
118
diff
changeset
|
42 filetype off |
1f709d7e03c6
Better Python dev in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
118
diff
changeset
|
43 |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
44 " Disable some plugins. |
386
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
45 let g:pathogen_disabled = get(g:, 'pathogen_disabled', []) |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
46 call add(g:pathogen_disabled, 'vimroom') |
76
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
47 call add(g:pathogen_disabled, 'minibufexpl') |
127
1f709d7e03c6
Better Python dev in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
118
diff
changeset
|
48 call add(g:pathogen_disabled, 'ragtag') |
308 | 49 call add(g:pathogen_disabled, 'interestingwords') |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
50 |
347
4d73159f56ca
Use pathogen as a sub-repo, plus a few Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
332
diff
changeset
|
51 " Load pathogen. |
349
8d68547c3660
Fix pathogen initialization.
Ludovic Chabant <ludovic@chabant.com>
parents:
347
diff
changeset
|
52 runtime bundle/pathogen/autoload/pathogen.vim |
352
9580765366a4
Fix some python indenting stuff in vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
349
diff
changeset
|
53 " Add the bundle directory, and potentially add the local one if it exists. |
9580765366a4
Fix some python indenting stuff in vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
349
diff
changeset
|
54 " Note that we pass absolute paths to make pathogen prepend stuff before Vim's |
9580765366a4
Fix some python indenting stuff in vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
349
diff
changeset
|
55 " system files otherwise stuff like indent plugins don't work. |
9580765366a4
Fix some python indenting stuff in vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
349
diff
changeset
|
56 let s:pathogen_bundles = [s:vim_home.s:path_sep.'bundle'.s:path_sep.'{}'] |
286
a29080fb35d9
Add support for local Vim bundle.
Ludovic Chabant <ludovic@chabant.com>
parents:
284
diff
changeset
|
57 if isdirectory(s:vim_home.s:path_sep.'local') |
352
9580765366a4
Fix some python indenting stuff in vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
349
diff
changeset
|
58 call add(s:pathogen_bundles, s:vim_home.s:path_sep.'local'.s:path_sep.'{}') |
286
a29080fb35d9
Add support for local Vim bundle.
Ludovic Chabant <ludovic@chabant.com>
parents:
284
diff
changeset
|
59 endif |
347
4d73159f56ca
Use pathogen as a sub-repo, plus a few Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
332
diff
changeset
|
60 call call('pathogen#infect', s:pathogen_bundles) |
0 | 61 |
10
00cac5ebf546
Added default window size. Added buffer keyboard shortcuts.
ludovicchabant
parents:
6
diff
changeset
|
62 " Hide the toolbar in MacVim/gVIM, and set a nice window size. |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
63 if has("gui_running") && !exists('g:resourcing_vimrc') |
0 | 64 set guioptions=-t |
235
ceb3f44fa2fc
Update sub-repos, make Vim maximized by default.
Ludovic Chabant <ludovic@chabant.com>
parents:
233
diff
changeset
|
65 set lines=999 |
ceb3f44fa2fc
Update sub-repos, make Vim maximized by default.
Ludovic Chabant <ludovic@chabant.com>
parents:
233
diff
changeset
|
66 set columns=999 |
323
e2d944ecda66
Maximize on startup on Windows.
Ludovic Chabant <ludovic@chabant.com>
parents:
320
diff
changeset
|
67 if has("win32") |
e2d944ecda66
Maximize on startup on Windows.
Ludovic Chabant <ludovic@chabant.com>
parents:
320
diff
changeset
|
68 au GUIEnter * simalt ~x |
e2d944ecda66
Maximize on startup on Windows.
Ludovic Chabant <ludovic@chabant.com>
parents:
320
diff
changeset
|
69 endif |
0 | 70 endif |
71 | |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
72 " }}} |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
73 |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
74 " General Settings {{{ |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
75 |
135 | 76 " Restrict modelines. |
77 set modelines=1 | |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
78 |
6 | 79 " Don't unload abandoned buffers. |
80 set hidden | |
0 | 81 |
6 | 82 " Show line numbers. |
83 set number | |
84 | |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
85 " Show what mode we're in, and what command we're typing. |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
86 set showmode |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
87 set showcmd |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
88 |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
89 " Keep the cursor off the top/bottom edges. |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
90 set scrolloff=3 |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
91 |
6 | 92 " Smart auto-indenting. |
0 | 93 set autoindent |
94 set smartindent | |
6 | 95 |
96 " Use confirmation dialog. | |
0 | 97 set confirm |
6 | 98 |
76
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
99 " Don't use annoying sounds. |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
100 set visualbell |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
101 |
6 | 102 " Remember lots of commands. |
0 | 103 set history=1000 |
6 | 104 |
76
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
105 " Try to reduce flickering. |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
106 set lazyredraw |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
107 |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
108 " Show matching braces but not for too long. |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
109 set showmatch |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
110 set matchtime=2 |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
111 |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
112 " Show soft-broken/wrapped lines with a prefix. |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
113 set showbreak=→ |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
114 |
6 | 115 " Use incremental search, with highlighting, |
116 " case-insensitive unless we actually type some | |
117 " mixed-case stuff. | |
0 | 118 set incsearch |
119 set hlsearch | |
120 set ignorecase | |
121 set smartcase | |
6 | 122 |
123 " Always show window status lines. | |
0 | 124 set laststatus=2 |
6 | 125 |
126 " Enable using the mouse like some everyday guy. | |
0 | 127 set mouse=a |
6 | 128 |
129 " Show interesting stuff at the bottom of the window. | |
0 | 130 set showcmd |
131 set ruler | |
6 | 132 |
76
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
133 " Make sure splitting windows is done in a way that makes sense. |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
134 set splitbelow |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
135 set splitright |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
136 |
6 | 137 " Don't pollute the hard-drive with *~ files. Only |
138 " create them in hidden backup/temp directories while | |
139 " we edit the file, and then get rid of it. | |
0 | 140 set nobackup |
141 set writebackup | |
83 | 142 execute('set backupdir='.s:vim_home.'/backup') |
143 execute('set directory='.s:vim_home.'/temp') | |
6 | 144 |
145 " Better command-line completion, but don't show some | |
146 " stuff we don't care about. | |
0 | 147 set wildmenu |
317 | 148 set wildmode=list:longest |
149 set wildignore+=.DS_Store,Thumbs.db | |
150 set wildignore+=*.so,*.dll,*.exe,*.lib,*.pdb | |
151 set wildignore+=*.pyc,*.pyo | |
152 set wildignore+=*.swp | |
153 | |
154 set formatoptions=croqn1 | |
6 | 155 |
156 " Always display the tab-page line. | |
0 | 157 set showtabline=2 |
6 | 158 |
159 " Set the file-formats. | |
0 | 160 set ffs=unix,mac,dos |
6 | 161 |
162 " Tabs and indenting are 4 characters, and tabs behave like | |
163 " spaces during editing. They're smart, too, and when you | |
164 " press <TAB> it actually inserts a soft-tab so everything's | |
165 " indented the same. | |
0 | 166 set tabstop=4 |
167 set shiftwidth=4 | |
168 set softtabstop=4 | |
169 set smarttab | |
170 set expandtab | |
6 | 171 |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
172 " Default encoding |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
173 set encoding=utf-8 |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
174 |
6 | 175 " Clipboard buffer. |
0 | 176 set clipboard=unnamed |
6 | 177 |
352
9580765366a4
Fix some python indenting stuff in vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
349
diff
changeset
|
178 " Smooth terminal experience. |
0 | 179 set ttyfast |
6 | 180 |
181 " Allow backspacing over anything. | |
0 | 182 set backspace=indent,eol,start |
183 | |
6 | 184 " Going left and right let you go to other lines. |
185 set whichwrap+=<,>,h,l | |
186 | |
93
822fc8b4405f
Invisible characters in vimrc.
Ludovic Chabant <ludovic@chabant.com>
parents:
92
diff
changeset
|
187 " How to show invisible characters |
822fc8b4405f
Invisible characters in vimrc.
Ludovic Chabant <ludovic@chabant.com>
parents:
92
diff
changeset
|
188 set listchars=eol:$,tab:>-,trail:-,extends:>,precedes:<,nbsp:%,conceal:. |
822fc8b4405f
Invisible characters in vimrc.
Ludovic Chabant <ludovic@chabant.com>
parents:
92
diff
changeset
|
189 |
80
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
190 " Nice auto-complete menu. |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
191 set complete=.,w,b |
80
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
192 set completeopt=longest,menuone,preview |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
193 |
121
c6f0172aac8d
Add nice column indicators in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
119
diff
changeset
|
194 " Column indicators. |
c6f0172aac8d
Add nice column indicators in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
119
diff
changeset
|
195 set colorcolumn=72,79 |
c6f0172aac8d
Add nice column indicators in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
119
diff
changeset
|
196 |
6 | 197 " And now, for some system-dependent settings: |
198 " - font to use | |
83 | 199 if s:vim_platform == "windows" |
6 | 200 set guifont=Consolas:h12 |
201 else | |
356
2060d92ccc2f
Use `hack` font if it's there.
Ludovic Chabant <ludovic@chabant.com>
parents:
352
diff
changeset
|
202 set guifont=Hack:h12,Monaco:h12 |
6 | 203 endif |
204 | |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
205 " Syntax highlighting. |
0 | 206 syntax on |
207 | |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
208 " Change the current directory to the home directory. |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
209 if !exists('g:resourcing_vimrc') |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
210 cd ~/ |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
211 endif |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
212 |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
213 " Default color scheme. |
47 | 214 if has('gui_running') |
217
6ee245fa8a3d
Proper colors in iTerm2, and now using solarized for a change.
Ludovic Chabant <ludovic@chabant.com>
parents:
213
diff
changeset
|
215 set background=dark |
47 | 216 else |
217 set background=dark | |
314 | 218 let g:solarized_termcolors = 256 |
219 let g:solarized_termtrans = 1 | |
47 | 220 endif |
217
6ee245fa8a3d
Proper colors in iTerm2, and now using solarized for a change.
Ludovic Chabant <ludovic@chabant.com>
parents:
213
diff
changeset
|
221 colorscheme solarized |
6 | 222 |
223 " Enable file type detection. | |
0 | 224 filetype indent plugin on |
225 | |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
226 " }}} |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
227 |
76
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
228 " Auto-Commands {{{ |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
229 |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
230 " Only show the highlighted cursor line in the current window. |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
231 augroup CursorLine |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
232 au! |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
233 au WinLeave * set nocursorline |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
234 au WinEnter * set cursorline |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
235 augroup END |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
236 |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
237 " }}} |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
238 |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
239 " Plugin Settings {{{ |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
240 |
309
5b7acab16766
Make NERDTree ignore stuff, and other Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
303
diff
changeset
|
241 " NERDTree {{{ |
5b7acab16766
Make NERDTree ignore stuff, and other Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
303
diff
changeset
|
242 |
320 | 243 let NERDTreeRespectWildIgnore = 1 |
309
5b7acab16766
Make NERDTree ignore stuff, and other Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
303
diff
changeset
|
244 |
5b7acab16766
Make NERDTree ignore stuff, and other Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
303
diff
changeset
|
245 " }}} |
5b7acab16766
Make NERDTree ignore stuff, and other Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
303
diff
changeset
|
246 |
178 | 247 " Ctrl-P {{{ |
248 | |
80
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
249 " We'll set our own mappings. |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
250 let g:ctrlp_map = '' |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
251 |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
252 " Ctrl-P should manage the working directory. |
173
393449253540
Use the new notation for `ctrlp` setting.
Ludovic Chabant <ludovic@chabant.com>
parents:
171
diff
changeset
|
253 let g:ctrlp_working_path_mode = 'ra' |
80
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
254 |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
255 " Ctrl-P should however ignore some stuff. |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
256 let g:ctrlp_custom_ignore = { |
233
073e7e47dbeb
Change CtrlP ignored dirs.
Ludovic Chabant <ludovic@chabant.com>
parents:
219
diff
changeset
|
257 \ 'dir': '\v[\/](\.git|\.hg|\.svn|venv|static|node_modules|_cache|_counter)$' |
80
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
258 \ } |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
259 |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
260 " Make Ctrl-P cache stuff in our temp directory. |
83 | 261 let g:ctrlp_cache_dir = s:vim_home.'/cache' |
10
00cac5ebf546
Added default window size. Added buffer keyboard shortcuts.
ludovicchabant
parents:
6
diff
changeset
|
262 |
197
4d34bf15a478
Don't clear CtrlP cache on exit, fix Windows issues.
Ludovic Chabant <ludovic@chabant.com>
parents:
193
diff
changeset
|
263 " Remember things. |
386
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
264 let g:ctrlp_clear_cache_on_exit = 0 |
197
4d34bf15a478
Don't clear CtrlP cache on exit, fix Windows issues.
Ludovic Chabant <ludovic@chabant.com>
parents:
193
diff
changeset
|
265 |
317 | 266 " Don't include some stuff in the most recently used list. |
267 let g:ctrlp_mruf_exclude = 'hg\-editor\-\d+\.txt' | |
268 | |
193
ae53d68033d9
Enable fugitive and some CtrlP extensions, include a new one of my own.
Ludovic Chabant <ludovic@chabant.com>
parents:
191
diff
changeset
|
269 " Enable some cool extensions. |
240
3a6b11d16a2a
Simpler registration for CtrlP extensions.
Ludovic Chabant <ludovic@chabant.com>
parents:
235
diff
changeset
|
270 let g:ctrlp_extensions = [ |
266
de3ef7fbcfc1
Add CtrlP's bookmarkdir extension.
Ludovic Chabant <ludovic@chabant.com>
parents:
252
diff
changeset
|
271 \'tag', 'buffertag', 'quickfix', 'mixed', 'bookmarkdir', |
288
25b672f0f6bd
Remove `projectjump` CtrlP plugin, just use the bookmarks.
Ludovic Chabant <ludovic@chabant.com>
parents:
287
diff
changeset
|
272 \'autoignore' |
240
3a6b11d16a2a
Simpler registration for CtrlP extensions.
Ludovic Chabant <ludovic@chabant.com>
parents:
235
diff
changeset
|
273 \] |
193
ae53d68033d9
Enable fugitive and some CtrlP extensions, include a new one of my own.
Ludovic Chabant <ludovic@chabant.com>
parents:
191
diff
changeset
|
274 |
367 | 275 " Use PyMatch to go faster. |
276 if has('python') || has('python3') | |
277 let g:ctrlp_match_func = {'match': 'pymatcher#PyMatch'} | |
278 let g:ctrlp_max_files = 0 | |
279 let g:ctrlp_lazy_update = 350 | |
280 endif | |
281 | |
178 | 282 " }}} |
283 | |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
284 " FZF {{{ |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
285 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
286 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
287 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
288 " }}} |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
289 |
213
769869e61101
Renamed autotags to gutentags.
Ludovic Chabant <ludovic@chabant.com>
parents:
212
diff
changeset
|
290 " Gutentags {{{ |
206 | 291 |
213
769869e61101
Renamed autotags to gutentags.
Ludovic Chabant <ludovic@chabant.com>
parents:
212
diff
changeset
|
292 let g:gutentags_cache_dir = s:vim_home.'/tags' |
373 | 293 let g:gutentags_ctags_exclude = ['venv', 'build', 'static', 'node_modules'] |
369
b87c358bd0ca
Fix/improve ctagsrc for gutentags.
Ludovic Chabant <ludovic@chabant.com>
parents:
367
diff
changeset
|
294 let g:gutentags_ctags_extra_args = ['--options='.s:vim_home.'/ctagsrc'] |
206 | 295 |
296 " }}} | |
297 | |
178 | 298 " Syntastic {{{ |
299 | |
314 | 300 let g:syntastic_auto_loc_list = 2 |
305
a333541a5c74
Syntastic config changes.
Ludovic Chabant <ludovic@chabant.com>
parents:
304
diff
changeset
|
301 let g:syntastic_check_on_open = 1 |
a333541a5c74
Syntastic config changes.
Ludovic Chabant <ludovic@chabant.com>
parents:
304
diff
changeset
|
302 let g:syntastic_check_on_wq = 0 |
a333541a5c74
Syntastic config changes.
Ludovic Chabant <ludovic@chabant.com>
parents:
304
diff
changeset
|
303 |
219
738c1a3ad786
Update Python settings for Syntastic, new settings for Supertab.
Ludovic Chabant <ludovic@chabant.com>
parents:
218
diff
changeset
|
304 " flake8 includes pyflakes, pep8, and mccabe |
738c1a3ad786
Update Python settings for Syntastic, new settings for Supertab.
Ludovic Chabant <ludovic@chabant.com>
parents:
218
diff
changeset
|
305 " I could maybe replace pyflakes with frosted? |
252
a2e31e166cb9
Just keep flake8 for Python checking in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
240
diff
changeset
|
306 let g:syntastic_python_checkers = ['flake8'] ", 'pylint'] |
219
738c1a3ad786
Update Python settings for Syntastic, new settings for Supertab.
Ludovic Chabant <ludovic@chabant.com>
parents:
218
diff
changeset
|
307 let g:syntastic_python_python_exec = 'python3' |
397
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
308 let g:syntastic_python_flake8_args='--ignore=W191,W391' |
219
738c1a3ad786
Update Python settings for Syntastic, new settings for Supertab.
Ludovic Chabant <ludovic@chabant.com>
parents:
218
diff
changeset
|
309 |
738c1a3ad786
Update Python settings for Syntastic, new settings for Supertab.
Ludovic Chabant <ludovic@chabant.com>
parents:
218
diff
changeset
|
310 " }}} |
738c1a3ad786
Update Python settings for Syntastic, new settings for Supertab.
Ludovic Chabant <ludovic@chabant.com>
parents:
218
diff
changeset
|
311 |
738c1a3ad786
Update Python settings for Syntastic, new settings for Supertab.
Ludovic Chabant <ludovic@chabant.com>
parents:
218
diff
changeset
|
312 " Supertab {{{ |
738c1a3ad786
Update Python settings for Syntastic, new settings for Supertab.
Ludovic Chabant <ludovic@chabant.com>
parents:
218
diff
changeset
|
313 |
308 | 314 let g:SuperTabDefaultCompletionType = "context" |
315 let g:SuperTabLongestEnhanced = 1 | |
316 let g:SuperTabLongestHighlight = 0 | |
219
738c1a3ad786
Update Python settings for Syntastic, new settings for Supertab.
Ludovic Chabant <ludovic@chabant.com>
parents:
218
diff
changeset
|
317 let g:SuperTabCrMapping = 1 |
178 | 318 |
319 " }}} | |
320 | |
321 " Lawrencium {{{ | |
118
c1ff96232138
New settings for Lawrencium.
Ludovic Chabant <ludovic@chabant.com>
parents:
114
diff
changeset
|
322 |
127
1f709d7e03c6
Better Python dev in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
118
diff
changeset
|
323 " Custom Mercurial commands highlighting in Lawrencium. |
118
c1ff96232138
New settings for Lawrencium.
Ludovic Chabant <ludovic@chabant.com>
parents:
114
diff
changeset
|
324 let g:lawrencium_hg_commands_file_types = { |
c1ff96232138
New settings for Lawrencium.
Ludovic Chabant <ludovic@chabant.com>
parents:
114
diff
changeset
|
325 \'clog': 'hggraphlog' |
c1ff96232138
New settings for Lawrencium.
Ludovic Chabant <ludovic@chabant.com>
parents:
114
diff
changeset
|
326 \} |
c1ff96232138
New settings for Lawrencium.
Ludovic Chabant <ludovic@chabant.com>
parents:
114
diff
changeset
|
327 |
127
1f709d7e03c6
Better Python dev in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
118
diff
changeset
|
328 " Make the annotate window better in Lawrencium. |
206 | 329 let g:lawrencium_annotate_width_offset = 1 |
127
1f709d7e03c6
Better Python dev in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
118
diff
changeset
|
330 |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
331 " }}} |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
332 |
178 | 333 " Gundo {{{ |
334 | |
335 let g:gundo_map_move_older = '<Down>' | |
336 let g:gundo_map_move_newer = '<Up>' | |
337 | |
338 " }}} | |
339 | |
340 " YankRing {{{ | |
341 | |
342 let g:yankring_replace_n_pkey = '<C-K>' | |
343 let g:yankring_replace_p_pkey = '<C-J>' | |
344 | |
345 " }}} | |
346 | |
347 " Python-Mode {{{ | |
348 | |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
349 let g:pymode = 1 |
352
9580765366a4
Fix some python indenting stuff in vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
349
diff
changeset
|
350 let g:pymode_python = 'python3' |
307
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
351 |
314 | 352 let g:pymode_syntax = 0 |
307
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
353 let g:pymode_syntax_all = 0 |
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
354 let g:pymode_syntax_builtin_objs = 1 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
355 let g:pymode_syntax_print_as_function = 1 |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
356 let g:pymode_syntax_space_errors = 1 |
307
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
357 |
352
9580765366a4
Fix some python indenting stuff in vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
349
diff
changeset
|
358 let g:pymode_indent = 0 |
9580765366a4
Fix some python indenting stuff in vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
349
diff
changeset
|
359 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
360 let g:pymode_run = 0 |
307
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
361 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
362 let g:pymode_lint = 0 |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
363 let g:pymode_trim_whitespaces = 0 |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
364 let g:pymode_folding = 1 |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
365 |
307
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
366 let g:pymode_doc = 1 |
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
367 let g:pymode_doc_bind = 'K' |
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
368 |
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
369 let g:pymode_virtualenv = 0 |
178 | 370 |
314 | 371 let g:pymode_rope = 0 |
372 | |
178 | 373 " }}} |
374 | |
379
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
375 " Lightline {{{ |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
376 let g:lightline = { |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
377 \'colorscheme': 'solarized', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
378 \'active': { |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
379 \ 'left': [ ['mode', 'paste'], |
386
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
380 \ ['fugitive', 'lawrencium', 'readonly', 'relativepath', 'modified'], |
379
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
381 \ ['ctrlpmark'] ], |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
382 \ 'right': [ ['lineinfo'], |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
383 \ ['percent'], |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
384 \ ['fileformat', 'fileencoding', 'filetype'], |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
385 \ ['gutentags', 'syntastic', 'ycm_errs', 'ycm_warns'] ] |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
386 \ }, |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
387 \'component_function': { |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
388 \ 'fugitive': '_LightlineFugitive', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
389 \ 'lawrencium': '_LightlineLawrencium', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
390 \ 'ctrlpmark': '_LightlineCtrlPMark', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
391 \ }, |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
392 \'component_expand': { |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
393 \ 'syntastic': '_LightlineSyntastic', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
394 \ 'ycm_errs': '_LightlineYcmErrors', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
395 \ 'ycm_warns': '_LightlineYcmWarnings', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
396 \ 'gutentags': '_LightlineGutentags', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
397 \ }, |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
398 \'component_type': { |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
399 \ 'syntastic': 'error', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
400 \ 'ycm_errs': 'error', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
401 \ 'ycm_warns': 'warning', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
402 \ 'gutentags': 'warning', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
403 \ }, |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
404 \} |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
405 |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
406 function! _LightlineFugitive() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
407 return fugitive#head() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
408 endfunction |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
409 |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
410 function! _LightlineLawrencium() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
411 return lawrencium#statusline() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
412 endfunction |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
413 |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
414 function! _LightlineCtrlPMark() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
415 if expand('%:t') =~ 'ControlP' && has_key(g:lightline, 'ctrlp_item') |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
416 call lightline#link('iR'[g:lightline.ctrlp_regex]) |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
417 return lightline#concatenate( |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
418 \['WAT?', g:lightline.ctrlp_prev, |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
419 \ g:lightline.ctrlp_item, |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
420 \ g:lightline.ctrlp_next], |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
421 \0) |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
422 else |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
423 return '' |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
424 endif |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
425 endfunction |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
426 |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
427 function! _LightlineGutentags() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
428 return gutentags#statusline() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
429 endfunction |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
430 |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
431 function! _LightlineSyntastic() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
432 return SyntasticStatuslineFlag() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
433 endfunction |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
434 |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
435 function! _LightlineYcmErrors() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
436 let l:cnt = youcompleteme#GetErrorCount() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
437 return l:cnt > 0 ? string(l:cnt) : '' |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
438 endfunction |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
439 |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
440 function! _LightlineYcmWarnings() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
441 let l:cnt = youcompleteme#GetWarningCount() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
442 return l:cnt > 0 ? string(l:cnt) : '' |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
443 endfunction |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
444 " }}} |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
445 |
386
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
446 " YouCompleteMe {{{ |
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
447 |
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
448 let g:ycm_always_populate_location_list = 1 |
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
449 |
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
450 " }}} |
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
451 |
178 | 452 " }}} |
453 | |
73
39a7e05637d8
Added 80 chars limit to text/markdown files.
Ludovic Chabant <ludovic@chabant.com>
parents:
67
diff
changeset
|
454 " File-Specific Settings {{{ |
39a7e05637d8
Added 80 chars limit to text/markdown files.
Ludovic Chabant <ludovic@chabant.com>
parents:
67
diff
changeset
|
455 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
456 augroup VimRCFileType_markdown |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
457 au! |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
458 autocmd FileType text,markdown setlocal textwidth=80 |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
459 autocmd FileType markdown nnoremap <buffer> <localleader>1 yypVr=:redraw<cr> |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
460 autocmd FileType markdown nnoremap <buffer> <localleader>2 yypVr-:redraw<cr> |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
461 autocmd FileType markdown nnoremap <buffer> <localleader>3 mzI###<space><esc>`z4l |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
462 autocmd FileType markdown nnoremap <buffer> <localleader>4 mzI####<space><esc>`z5l |
176 | 463 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
464 autocmd BufRead,BufNewfile */Dropbox/Personal/SimpleNote/* set ft=markdown |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
465 autocmd BufRead,BufNewFile */_content/**/*.html set ft=piecrustmarkdown |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
466 augroup END |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
467 |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
468 augroup VimRCFileType_php |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
469 au! |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
470 " Who the hell changes my matchpairs? |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
471 autocmd FileType php setlocal matchpairs-=<:> |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
472 augroup END |
83 | 473 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
474 augroup VimRCFileType_c |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
475 au! |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
476 autocmd FileType c,c++,cpp setlocal foldmethod=syntax |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
477 autocmd FileType c,c++,cpp setlocal colorcolumn=120 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
478 augroup END |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
479 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
480 augroup VimRCFileType_csharp |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
481 au! |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
482 autocmd BufNewFile,BufRead *.xaml setlocal filetype=xml |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
483 autocmd FileType cs setlocal foldmethod=syntax |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
484 autocmd FileType cs setlocal colorcolumn=120 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
485 augroup END |
83 | 486 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
487 augroup VimRCFileType_css |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
488 au! |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
489 autocmd BufNewFile,BufRead *.less setlocal filetype=less |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
490 autocmd Filetype less,css setlocal foldmethod=marker |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
491 autocmd Filetype less,css setlocal foldmarker={,} |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
492 autocmd Filetype less,css setlocal iskeyword+=- |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
493 autocmd Filetype less,css setlocal omnifunc=csscomplete#CompleteCSS |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
494 augroup END |
160 | 495 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
496 augroup VimRCTrailingWhitespaces |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
497 au! |
287
44c9d65cfa74
Readjust some Vim config stuff around folding.
Ludovic Chabant <ludovic@chabant.com>
parents:
286
diff
changeset
|
498 autocmd FileType php,ruby,python,js,css,less autocmd BufWritePre <buffer> :call <SID>StripTrailingWhitespaces() |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
499 augroup END |
73
39a7e05637d8
Added 80 chars limit to text/markdown files.
Ludovic Chabant <ludovic@chabant.com>
parents:
67
diff
changeset
|
500 |
39a7e05637d8
Added 80 chars limit to text/markdown files.
Ludovic Chabant <ludovic@chabant.com>
parents:
67
diff
changeset
|
501 " }}} |
39a7e05637d8
Added 80 chars limit to text/markdown files.
Ludovic Chabant <ludovic@chabant.com>
parents:
67
diff
changeset
|
502 |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
503 " Mappings {{{ |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
504 |
42
6b831735c092
Added french keymap support.
Ludovic Chabant <ludovic@chabant.com>
parents:
18
diff
changeset
|
505 let mapleader="," |
43
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
506 |
76
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
507 " Visual line navigation |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
508 noremap <up> g<up> |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
509 noremap <down> g<down> |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
510 noremap <home> g<home> |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
511 noremap <end> g<end> |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
512 |
367 | 513 noremap <S-up> 20<up> |
514 noremap <S-down> 20<down> | |
515 | |
169
4947d1f99b72
Better tab/buffer navigation.
Ludovic Chabant <ludovic@chabant.com>
parents:
163
diff
changeset
|
516 " Tab navigation |
178 | 517 noremap <C-Tab> :tabnext<cr> |
518 noremap <C-S-Tab> :tabprevious<cr> | |
304
50fbd059a6a1
More Vim customizations.
Ludovic Chabant <ludovic@chabant.com>
parents:
303
diff
changeset
|
519 nnoremap <leader>t :tabnew<cr> |
169
4947d1f99b72
Better tab/buffer navigation.
Ludovic Chabant <ludovic@chabant.com>
parents:
163
diff
changeset
|
520 |
80
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
521 " Window navigation |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
522 nnoremap <C-up> :wincmd k<cr> |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
523 nnoremap <C-down> :wincmd j<cr> |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
524 nnoremap <C-left> :wincmd h<cr> |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
525 nnoremap <C-right> :wincmd l<cr> |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
526 |
176 | 527 " Switch buffers. |
528 nnoremap <F2> :execute ("buffer " . bufname("#"))<cr> | |
83 | 529 |
176 | 530 " NERDTree. |
531 nnoremap <F3> :call <SID>ToggleNERDTree()<cr> | |
532 nnoremap <F4> :call <SID>FindInNERDTree()<cr> | |
83 | 533 |
157
7fd22eb11789
Added `tagbar` for Vim, with keyboard shortcut.
Ludovic Chabant <ludovic@chabant.com>
parents:
155
diff
changeset
|
534 " Tagbar. |
176 | 535 nnoremap <F5> :TagbarToggle<cr> |
536 nnoremap <F6> :TagbarOpenAutoClose<cr> | |
157
7fd22eb11789
Added `tagbar` for Vim, with keyboard shortcut.
Ludovic Chabant <ludovic@chabant.com>
parents:
155
diff
changeset
|
537 |
186
01304e9b4c19
Re-add Gundo mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
185
diff
changeset
|
538 " Gundo. |
01304e9b4c19
Re-add Gundo mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
185
diff
changeset
|
539 nnoremap <F7> :GundoToggle<cr> |
01304e9b4c19
Re-add Gundo mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
185
diff
changeset
|
540 |
83 | 541 " Common typos. |
542 nnoremap ; : | |
543 | |
80
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
544 " Split windows |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
545 nnoremap <leader>s :split<cr> |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
546 nnoremap <leader>v :vsplit<cr> |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
547 |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
548 " Easier things to type |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
549 nnoremap <leader>w :w<cr> |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
550 nnoremap <leader>q :q<cr> |
119 | 551 nnoremap <leader>hh :Hg |
552 nnoremap <leader>hg :Hg! | |
112 | 553 nnoremap <leader>hs :Hgstatus<cr> |
554 nnoremap <leader>hv :Hgvdiff<cr> | |
80
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
555 |
114
ccc3902408d2
Fix the hash key in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
113
diff
changeset
|
556 " Make the hash-key not suck. |
ccc3902408d2
Fix the hash key in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
113
diff
changeset
|
557 inoremap # X<BS># |
ccc3902408d2
Fix the hash key in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
113
diff
changeset
|
558 |
80
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
559 " Toggle invisible characters |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
560 nnoremap <leader>i :set list!<cr> |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
561 |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
562 " Clear search matches |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
563 nnoremap <leader><space> :noh<cr>:call clearmatches()<cr> |
43
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
564 |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
565 " Switch between FR and US keyboard layouts. |
119 | 566 nnoremap <C-l>f :setlocal keymap=french<cr> |
567 nnoremap <C-l>u :setlocal keymap=<cr> | |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
568 |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
569 " Toggle spell check according to current keyboard layout. |
119 | 570 nnoremap <C-l>s :call <SID>ToggleSpellCheck()<cr> |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
571 |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
572 " Simple way to close a buffer without closing the window. |
347
4d73159f56ca
Use pathogen as a sub-repo, plus a few Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
332
diff
changeset
|
573 nnoremap <leader>d :bprevious<cr>:bdelete #<cr> |
43
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
574 |
119 | 575 " Use sane regexes. |
576 nnoremap / /\v | |
577 vnoremap / /\v | |
578 | |
289
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
579 " Next/previous quickfix and location messages. |
303
01ec865443b6
Update NERDTree macros and tweak more Vim stuff.
Ludovic Chabant <ludovic@chabant.com>
parents:
294
diff
changeset
|
580 " This is meant to be similar to ]c and [c for the diff navigation. |
289
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
581 nnoremap ]q :cnext<cr>zvzz |
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
582 nnoremap [q :cprevious<cr>zvzz |
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
583 nnoremap ]l :lnext<cr>zvzz |
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
584 nnoremap [l :lprevious<cr>zvzz |
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
585 |
304
50fbd059a6a1
More Vim customizations.
Ludovic Chabant <ludovic@chabant.com>
parents:
303
diff
changeset
|
586 " Same with change and jump lists. |
367 | 587 nnoremap ]e g,zz |
588 nnoremap [e g;zz | |
304
50fbd059a6a1
More Vim customizations.
Ludovic Chabant <ludovic@chabant.com>
parents:
303
diff
changeset
|
589 nnoremap ]j <C-I> |
50fbd059a6a1
More Vim customizations.
Ludovic Chabant <ludovic@chabant.com>
parents:
303
diff
changeset
|
590 nnoremap [j <C-O> |
289
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
591 |
367 | 592 " Copy the current buffer's info. |
386
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
593 nnoremap <leader>cp :let @+ = expand('%:p')<cr>:echo @+<cr> |
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
594 nnoremap <leader>cf :let @+ = expand('%:h')<cr>:echo @+<cr> |
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
595 nnoremap <leader>cw :let @+ = getcwd()<cr>:echo @+<cr> |
367 | 596 |
303
01ec865443b6
Update NERDTree macros and tweak more Vim stuff.
Ludovic Chabant <ludovic@chabant.com>
parents:
294
diff
changeset
|
597 " Make the diff navigation also center things. |
289
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
598 nnoremap ]c ]czvzz |
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
599 nnoremap [c [czvzz |
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
600 |
103
a755319f124e
Added mappings for substitutions.
Ludovic Chabant <ludovic@chabant.com>
parents:
101
diff
changeset
|
601 " Quick search and replace. |
119 | 602 function! s:VSetSearch() |
294
8bc056d80c39
Remove unused stuff, add grepping, shorter status line.
Ludovic Chabant <ludovic@chabant.com>
parents:
291
diff
changeset
|
603 let temp = @@ |
8bc056d80c39
Remove unused stuff, add grepping, shorter status line.
Ludovic Chabant <ludovic@chabant.com>
parents:
291
diff
changeset
|
604 norm! gvy |
8bc056d80c39
Remove unused stuff, add grepping, shorter status line.
Ludovic Chabant <ludovic@chabant.com>
parents:
291
diff
changeset
|
605 let @/ = '\V' . substitute(escape(@@, '\'), '\n', '\\n', 'g') |
8bc056d80c39
Remove unused stuff, add grepping, shorter status line.
Ludovic Chabant <ludovic@chabant.com>
parents:
291
diff
changeset
|
606 let @@ = temp |
119 | 607 endfunction |
608 vnoremap * :<C-u>call <SID>VSetSearch()<CR>//<CR><c-o> | |
609 vnoremap # :<C-u>call <SID>VSetSearch()<CR>??<CR><c-o> | |
118
c1ff96232138
New settings for Lawrencium.
Ludovic Chabant <ludovic@chabant.com>
parents:
114
diff
changeset
|
610 |
294
8bc056d80c39
Remove unused stuff, add grepping, shorter status line.
Ludovic Chabant <ludovic@chabant.com>
parents:
291
diff
changeset
|
611 nnoremap <leader>fa :vimgrep /<C-R><C-W>/ |
8bc056d80c39
Remove unused stuff, add grepping, shorter status line.
Ludovic Chabant <ludovic@chabant.com>
parents:
291
diff
changeset
|
612 vnoremap <leader>fa "zy:vimgrep /<C-R>z/ |
8bc056d80c39
Remove unused stuff, add grepping, shorter status line.
Ludovic Chabant <ludovic@chabant.com>
parents:
291
diff
changeset
|
613 |
206 | 614 " Jump to tags by keeping things better in view. Option for jumping to a tag |
615 " in a split window where everything is folded except what you need to see. | |
303
01ec865443b6
Update NERDTree macros and tweak more Vim stuff.
Ludovic Chabant <ludovic@chabant.com>
parents:
294
diff
changeset
|
616 " Note that if a tag search yield multiple possible results, we will still run |
01ec865443b6
Update NERDTree macros and tweak more Vim stuff.
Ludovic Chabant <ludovic@chabant.com>
parents:
294
diff
changeset
|
617 " some of that `zvzz` stuff, but that's OK, the main point is to not mess up |
01ec865443b6
Update NERDTree macros and tweak more Vim stuff.
Ludovic Chabant <ludovic@chabant.com>
parents:
294
diff
changeset
|
618 " the result selection window either. |
308 | 619 nnoremap <F9> :pop<cr> |
373 | 620 nnoremap <F10> g<C-]>zvzz |
621 nnoremap <s-F10> <c-w>vg<C-]>zMzvzz | |
308 | 622 nnoremap <c-F9> :tprevious |
623 nnoremap <c-F10> :tnext | |
206 | 624 |
625 " Keep search matches in the middle of the window. | |
289
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
626 nnoremap n nzvzz |
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
627 nnoremap N Nzvzz |
206 | 628 |
379
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
629 " YCM mappings. |
397
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
630 augroup VimRC_YouCompleteMe |
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
631 autocmd! |
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
632 autocmd FileType cpp nnoremap <Leader>jj :YcmCompleter GoToImprecise<cr>zv |
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
633 autocmd FileType cpp nnoremap <Leader>jd :YcmCompleter GoToDefinition<cr>zv |
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
634 autocmd FileType cpp nnoremap <Leader>jh :YcmCompleter GoToDeclaration<cr>zv |
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
635 autocmd FileType cpp nnoremap <Leader>ji :YcmCompleter GoToInclude<cr> |
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
636 autocmd FileType cpp nnoremap <Leader>jc :YcmCompleter GetDoc<cr> |
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
637 augroup END |
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
638 |
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
639 " OmniSharp mappings |
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
640 augroup VimRC_OmniSharp |
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
641 autocmd! |
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
642 autocmd FileType cs setlocal omnifunc=OmniSharp#Complete |
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
643 autocmd BufEnter,TextChanged,InsertLeave *.cs SyntasticCheck |
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
644 autocmd CursorHold *.cs call OmniSharp#TypeLookupWithoutDocumentation() |
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
645 autocmd FileType cs nnoremap <Leader>jj :OmniSharpGotoDefinition<cr> |
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
646 autocmd FileType cs nnoremap <Leader>x :OmniSharpFixIssue<cr> |
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
647 autocmd FileType cs nnoremap <Leader>fx :OmniSharpFixUsings<cr> |
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
648 autocmd FileType cs nnoremap <Leader>tt :OmniSharpTypeLookup<cr> |
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
649 autocmd FileType cs nnoremap <Leader>dc :OmniSharpDocumentation<cr> |
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
650 augroup END |
379
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
651 |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
652 " ProjectRoot mappings |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
653 let s:no_auto_projectroot_buftypes = [ |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
654 \'help', 'nofile', 'quickfix'] |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
655 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
656 function! s:AutoProjectRootCD() abort |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
657 try |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
658 if index(s:no_auto_projectroot_buftypes, &buftype) == -1 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
659 ProjectRootCD |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
660 endif |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
661 catch |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
662 " Silently ignore invalid buffers |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
663 endtry |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
664 endfunction |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
665 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
666 augroup VimRC_ProjectRoot |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
667 autocmd! |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
668 autocmd BufEnter * call <SID>AutoProjectRootCD() |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
669 augroup END |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
670 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
671 nnoremap <leader>cd :ProjectRootCD<cr> |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
672 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
673 " Ctrl-P mappings. |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
674 if index(g:pathogen_disabled, 'ctrlp') < 0 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
675 nnoremap <silent> <C-p> :CtrlP<cr> |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
676 nnoremap <silent> <C-o> :CtrlPBuffer<cr> |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
677 nnoremap <silent> <C-u> :CtrlPTag<cr> |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
678 nnoremap <silent> <C-y> :CtrlPBufTag<cr> |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
679 nnoremap <silent> <Tab> :CtrlPMRUFiles<cr> |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
680 nnoremap <silent> <F8> :CtrlPBookmarkDir<cr> |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
681 endif |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
682 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
683 " FZF mappings. |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
684 if index(g:pathogen_disabled, 'fzf') < 0 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
685 nnoremap <silent> <C-p> :Files |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
686 nnoremap <silent> <C-o> :Buffers |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
687 endif |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
688 |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
689 " }}} |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
690 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
691 " Folding {{{ |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
692 |
367 | 693 " Start with one level of open. |
694 set foldlevel=1 | |
695 | |
385 | 696 " Don't fold too much. |
697 set foldnestmax=2 | |
698 | |
287
44c9d65cfa74
Readjust some Vim config stuff around folding.
Ludovic Chabant <ludovic@chabant.com>
parents:
286
diff
changeset
|
699 " Folds are defined by markers in the text. |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
700 set foldmethod=marker"{{{"}}} |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
701 |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
702 " Toggle folds with <space>. |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
703 nnoremap <space> za |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
704 |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
705 " Create folds with <space> (in visual mode). |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
706 vnoremap <space> zf |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
707 |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
708 " }}} |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
709 |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
710 " Abbreviations {{{ |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
711 |
43
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
712 iabbrev @@ ludovic@chabant.com |
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
713 iabbrev ccopy Copyright ©2011 Ludovic Chabant, all rights reserved. |
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
714 iabbrev ssig --<cr>l u d o .<cr>. 8 0 17 80 |
0 | 715 |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
716 " }}} |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
717 |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
718 " Functions {{{ |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
719 |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
720 function! s:ToggleSpellCheck() abort |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
721 if &spell ==? 'nospell' |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
722 if &keymap ==? 'french' |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
723 setlocal spell spelllang=fr_fr |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
724 else |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
725 setlocal spell spelllang=en_us,en_ca |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
726 endif |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
727 else |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
728 setlocal spell nospell |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
729 endif |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
730 endfunction |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
731 |
160 | 732 function! s:StripTrailingWhitespaces() abort |
733 let l = line(".") | |
734 let c = col(".") | |
735 %s/\s\+$//e | |
736 call cursor(l, c) | |
737 endfunction | |
738 | |
176 | 739 function! s:ToggleNERDTree() abort |
740 NERDTreeToggle | |
741 endfunction | |
742 | |
743 function! s:FindInNERDTree() abort | |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
744 ProjectRootExe NERDTreeFind |
332 | 745 normal zz |
176 | 746 endfunction |
747 | |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
748 " }}} |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
749 |
171
7559d8bc39bb
Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
169
diff
changeset
|
750 " Local override {{{ |
7559d8bc39bb
Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
169
diff
changeset
|
751 |
191
896acf280e7a
Make local Vim config consistent with Mercurial local config.
Ludovic Chabant <ludovic@chabant.com>
parents:
186
diff
changeset
|
752 let s:local_vimrc = s:vim_home.'/vimrc-local' |
171
7559d8bc39bb
Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
169
diff
changeset
|
753 if filereadable(s:local_vimrc) |
7559d8bc39bb
Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
169
diff
changeset
|
754 execute 'source' s:local_vimrc |
7559d8bc39bb
Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
169
diff
changeset
|
755 endif |
7559d8bc39bb
Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
169
diff
changeset
|
756 |
7559d8bc39bb
Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
169
diff
changeset
|
757 " }}} |
7559d8bc39bb
Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
169
diff
changeset
|
758 |