Mercurial > dotfiles
annotate vim/vimrc @ 453:97a94dacfd54
Some vim tweaks.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 30 Aug 2018 10:05:43 -0700 |
parents | d048318ba839 |
children | 3efc67540556 |
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 |
386
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
22 " Local pre-override. |
435
b7682004288d
Move Vim stuff to autoload, add FZF tags lister.
Ludovic Chabant <ludovic@chabant.com>
parents:
430
diff
changeset
|
23 let s:local_vimrc_pre = ludo#localpath('vimrc-local-pre') |
386
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
24 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
|
25 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
|
26 endif |
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
27 |
127
1f709d7e03c6
Better Python dev in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
118
diff
changeset
|
28 " 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
|
29 syntax off |
1f709d7e03c6
Better Python dev in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
118
diff
changeset
|
30 filetype off |
1f709d7e03c6
Better Python dev in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
118
diff
changeset
|
31 |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
32 " 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
|
33 let g:pathogen_disabled = get(g:, 'pathogen_disabled', []) |
435
b7682004288d
Move Vim stuff to autoload, add FZF tags lister.
Ludovic Chabant <ludovic@chabant.com>
parents:
430
diff
changeset
|
34 call ludo#setup_pathogen([ludo#localpath('bundle'), ludo#localpath('local')]) |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
35 |
347
4d73159f56ca
Use pathogen as a sub-repo, plus a few Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
332
diff
changeset
|
36 " Load pathogen. |
349
8d68547c3660
Fix pathogen initialization.
Ludovic Chabant <ludovic@chabant.com>
parents:
347
diff
changeset
|
37 runtime bundle/pathogen/autoload/pathogen.vim |
352
9580765366a4
Fix some python indenting stuff in vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
349
diff
changeset
|
38 " 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
|
39 " 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
|
40 " system files otherwise stuff like indent plugins don't work. |
435
b7682004288d
Move Vim stuff to autoload, add FZF tags lister.
Ludovic Chabant <ludovic@chabant.com>
parents:
430
diff
changeset
|
41 let s:pathogen_bundles = [ludo#localpath('bundle', '{}')] |
b7682004288d
Move Vim stuff to autoload, add FZF tags lister.
Ludovic Chabant <ludovic@chabant.com>
parents:
430
diff
changeset
|
42 if isdirectory(ludo#localpath('local')) |
b7682004288d
Move Vim stuff to autoload, add FZF tags lister.
Ludovic Chabant <ludovic@chabant.com>
parents:
430
diff
changeset
|
43 call add(s:pathogen_bundles, ludo#localpath('local', '{}')) |
286
a29080fb35d9
Add support for local Vim bundle.
Ludovic Chabant <ludovic@chabant.com>
parents:
284
diff
changeset
|
44 endif |
347
4d73159f56ca
Use pathogen as a sub-repo, plus a few Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
332
diff
changeset
|
45 call call('pathogen#infect', s:pathogen_bundles) |
0 | 46 |
10
00cac5ebf546
Added default window size. Added buffer keyboard shortcuts.
ludovicchabant
parents:
6
diff
changeset
|
47 " 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
|
48 if has("gui_running") && !exists('g:resourcing_vimrc') |
0 | 49 set guioptions=-t |
235
ceb3f44fa2fc
Update sub-repos, make Vim maximized by default.
Ludovic Chabant <ludovic@chabant.com>
parents:
233
diff
changeset
|
50 set lines=999 |
ceb3f44fa2fc
Update sub-repos, make Vim maximized by default.
Ludovic Chabant <ludovic@chabant.com>
parents:
233
diff
changeset
|
51 set columns=999 |
323
e2d944ecda66
Maximize on startup on Windows.
Ludovic Chabant <ludovic@chabant.com>
parents:
320
diff
changeset
|
52 if has("win32") |
e2d944ecda66
Maximize on startup on Windows.
Ludovic Chabant <ludovic@chabant.com>
parents:
320
diff
changeset
|
53 au GUIEnter * simalt ~x |
e2d944ecda66
Maximize on startup on Windows.
Ludovic Chabant <ludovic@chabant.com>
parents:
320
diff
changeset
|
54 endif |
0 | 55 endif |
56 | |
445
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
57 function! s:HasPlugin(plugname, ...) abort |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
58 let l:dirname = 'plugin/' |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
59 if a:0 && a:1 |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
60 let l:dirname = 'autoload/' |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
61 endif |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
62 return globpath(&runtimepath, l:dirname.a:plugname.'.vim') !=# '' |
420 | 63 endfunction |
64 | |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
65 " }}} |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
66 |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
67 " General Settings {{{ |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
68 |
135 | 69 " Restrict modelines. |
70 set modelines=1 | |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
71 |
6 | 72 " Don't unload abandoned buffers. |
73 set hidden | |
0 | 74 |
6 | 75 " Show line numbers. |
76 set number | |
77 | |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
78 " 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
|
79 set showmode |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
80 set showcmd |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
81 |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
82 " Keep the cursor off the top/bottom edges. |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
83 set scrolloff=3 |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
84 |
6 | 85 " Smart auto-indenting. |
0 | 86 set autoindent |
87 set smartindent | |
6 | 88 |
89 " Use confirmation dialog. | |
0 | 90 set confirm |
6 | 91 |
76
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
92 " Don't use annoying sounds. |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
93 set visualbell |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
94 |
6 | 95 " Remember lots of commands. |
0 | 96 set history=1000 |
6 | 97 |
76
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
98 " Try to reduce flickering. |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
99 set lazyredraw |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
100 |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
101 " Show matching braces but not for too long. |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
102 set showmatch |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
103 set matchtime=2 |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
104 |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
105 " Show soft-broken/wrapped lines with a prefix. |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
106 set showbreak=→ |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
107 |
6 | 108 " Use incremental search, with highlighting, |
109 " case-insensitive unless we actually type some | |
110 " mixed-case stuff. | |
0 | 111 set incsearch |
112 set hlsearch | |
113 set ignorecase | |
114 set smartcase | |
6 | 115 |
116 " Always show window status lines. | |
0 | 117 set laststatus=2 |
6 | 118 |
119 " Enable using the mouse like some everyday guy. | |
0 | 120 set mouse=a |
6 | 121 |
122 " Show interesting stuff at the bottom of the window. | |
0 | 123 set showcmd |
124 set ruler | |
6 | 125 |
76
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
126 " 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
|
127 set splitbelow |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
128 set splitright |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
129 |
6 | 130 " Don't pollute the hard-drive with *~ files. Only |
131 " create them in hidden backup/temp directories while | |
132 " we edit the file, and then get rid of it. | |
0 | 133 set nobackup |
134 set writebackup | |
435
b7682004288d
Move Vim stuff to autoload, add FZF tags lister.
Ludovic Chabant <ludovic@chabant.com>
parents:
430
diff
changeset
|
135 execute('set backupdir='.ludo#localpath('backup')) |
b7682004288d
Move Vim stuff to autoload, add FZF tags lister.
Ludovic Chabant <ludovic@chabant.com>
parents:
430
diff
changeset
|
136 execute('set directory='.ludo#localpath('temp')) |
6 | 137 |
138 " Better command-line completion, but don't show some | |
139 " stuff we don't care about. | |
0 | 140 set wildmenu |
317 | 141 set wildmode=list:longest |
142 set wildignore+=.DS_Store,Thumbs.db | |
143 set wildignore+=*.so,*.dll,*.exe,*.lib,*.pdb | |
144 set wildignore+=*.pyc,*.pyo | |
145 set wildignore+=*.swp | |
146 | |
443
4ca0b1413199
Some new cool Vim things.
Ludovic Chabant <ludovic@chabant.com>
parents:
442
diff
changeset
|
147 set formatoptions=croqn1j |
6 | 148 |
149 " Always display the tab-page line. | |
0 | 150 set showtabline=2 |
6 | 151 |
152 " Set the file-formats. | |
0 | 153 set ffs=unix,mac,dos |
6 | 154 |
155 " Tabs and indenting are 4 characters, and tabs behave like | |
156 " spaces during editing. They're smart, too, and when you | |
157 " press <TAB> it actually inserts a soft-tab so everything's | |
158 " indented the same. | |
0 | 159 set tabstop=4 |
160 set shiftwidth=4 | |
161 set softtabstop=4 | |
162 set smarttab | |
163 set expandtab | |
6 | 164 |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
165 " Default encoding |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
166 set encoding=utf-8 |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
167 |
6 | 168 " Clipboard buffer. |
0 | 169 set clipboard=unnamed |
6 | 170 |
352
9580765366a4
Fix some python indenting stuff in vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
349
diff
changeset
|
171 " Smooth terminal experience. |
0 | 172 set ttyfast |
6 | 173 |
174 " Allow backspacing over anything. | |
0 | 175 set backspace=indent,eol,start |
176 | |
6 | 177 " Going left and right let you go to other lines. |
178 set whichwrap+=<,>,h,l | |
179 | |
93
822fc8b4405f
Invisible characters in vimrc.
Ludovic Chabant <ludovic@chabant.com>
parents:
92
diff
changeset
|
180 " How to show invisible characters |
822fc8b4405f
Invisible characters in vimrc.
Ludovic Chabant <ludovic@chabant.com>
parents:
92
diff
changeset
|
181 set listchars=eol:$,tab:>-,trail:-,extends:>,precedes:<,nbsp:%,conceal:. |
822fc8b4405f
Invisible characters in vimrc.
Ludovic Chabant <ludovic@chabant.com>
parents:
92
diff
changeset
|
182 |
80
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
183 " Nice auto-complete menu. |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
184 set complete=.,w,b |
80
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
185 set completeopt=longest,menuone,preview |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
186 |
121
c6f0172aac8d
Add nice column indicators in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
119
diff
changeset
|
187 " Column indicators. |
c6f0172aac8d
Add nice column indicators in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
119
diff
changeset
|
188 set colorcolumn=72,79 |
c6f0172aac8d
Add nice column indicators in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
119
diff
changeset
|
189 |
6 | 190 " And now, for some system-dependent settings: |
191 " - font to use | |
442
decee05a5595
Weird, Neovim doesn't have `guifont`?
Ludovic Chabant <ludovic@chabant.com>
parents:
441
diff
changeset
|
192 if !has('nvim') |
decee05a5595
Weird, Neovim doesn't have `guifont`?
Ludovic Chabant <ludovic@chabant.com>
parents:
441
diff
changeset
|
193 if ludo#platform() == "windows" |
decee05a5595
Weird, Neovim doesn't have `guifont`?
Ludovic Chabant <ludovic@chabant.com>
parents:
441
diff
changeset
|
194 set guifont=InputMono:h11,Hack:h12,Consolas:h12 |
decee05a5595
Weird, Neovim doesn't have `guifont`?
Ludovic Chabant <ludovic@chabant.com>
parents:
441
diff
changeset
|
195 else |
decee05a5595
Weird, Neovim doesn't have `guifont`?
Ludovic Chabant <ludovic@chabant.com>
parents:
441
diff
changeset
|
196 set guifont=InputMono:h11,Hack:h12,Monaco:h12 |
decee05a5595
Weird, Neovim doesn't have `guifont`?
Ludovic Chabant <ludovic@chabant.com>
parents:
441
diff
changeset
|
197 endif |
6 | 198 endif |
199 | |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
200 " Syntax highlighting. |
0 | 201 syntax on |
202 | |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
203 " 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
|
204 if !exists('g:resourcing_vimrc') |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
205 cd ~/ |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
206 endif |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
207 |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
208 " Default color scheme. |
47 | 209 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
|
210 set background=dark |
47 | 211 else |
212 set background=dark | |
314 | 213 let g:solarized_termcolors = 256 |
214 let g:solarized_termtrans = 1 | |
47 | 215 endif |
217
6ee245fa8a3d
Proper colors in iTerm2, and now using solarized for a change.
Ludovic Chabant <ludovic@chabant.com>
parents:
213
diff
changeset
|
216 colorscheme solarized |
6 | 217 |
218 " Enable file type detection. | |
0 | 219 filetype indent plugin on |
220 | |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
221 " }}} |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
222 |
76
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
223 " Auto-Commands {{{ |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
224 |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
225 " 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
|
226 augroup CursorLine |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
227 au! |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
228 au WinLeave * set nocursorline |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
229 au WinEnter * set cursorline |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
230 augroup END |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
231 |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
232 " }}} |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
233 |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
234 " Plugin Settings {{{ |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
235 |
309
5b7acab16766
Make NERDTree ignore stuff, and other Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
303
diff
changeset
|
236 " NERDTree {{{ |
5b7acab16766
Make NERDTree ignore stuff, and other Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
303
diff
changeset
|
237 |
320 | 238 let NERDTreeRespectWildIgnore = 1 |
309
5b7acab16766
Make NERDTree ignore stuff, and other Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
303
diff
changeset
|
239 |
5b7acab16766
Make NERDTree ignore stuff, and other Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
303
diff
changeset
|
240 " }}} |
5b7acab16766
Make NERDTree ignore stuff, and other Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
303
diff
changeset
|
241 |
430
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
242 " Ack {{{ |
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
243 |
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
244 if executable('ag') |
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
245 let g:ackprg = 'ag --vimgrep' |
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
246 endif |
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
247 |
440
4b816faa06e2
Remove CtrlP, add statusline refresh.
Ludovic Chabant <ludovic@chabant.com>
parents:
439
diff
changeset
|
248 nnoremap <leader>a :Ack!<Space> |
435
b7682004288d
Move Vim stuff to autoload, add FZF tags lister.
Ludovic Chabant <ludovic@chabant.com>
parents:
430
diff
changeset
|
249 nnoremap <leader>f :Ack! /<C-R><C-W>/ |
b7682004288d
Move Vim stuff to autoload, add FZF tags lister.
Ludovic Chabant <ludovic@chabant.com>
parents:
430
diff
changeset
|
250 vnoremap <leader>f "zy:Ack! /<C-R>z/ |
430
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
251 |
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
252 " }}} |
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
253 |
178 | 254 " Ctrl-P {{{ |
255 | |
80
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
256 " We'll set our own mappings. |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
257 let g:ctrlp_map = '' |
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 " 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
|
260 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
|
261 |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
262 " Ctrl-P should however ignore some stuff. |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
263 let g:ctrlp_custom_ignore = { |
426
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
264 \ 'dir': '\v[\/](\.git|\.hg|\.svn|venv|static|node_modules|_cache|_counter)$' |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
265 \ } |
80
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
266 |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
267 " Make Ctrl-P cache stuff in our temp directory. |
435
b7682004288d
Move Vim stuff to autoload, add FZF tags lister.
Ludovic Chabant <ludovic@chabant.com>
parents:
430
diff
changeset
|
268 let g:ctrlp_cache_dir = ludo#localpath('cache') |
10
00cac5ebf546
Added default window size. Added buffer keyboard shortcuts.
ludovicchabant
parents:
6
diff
changeset
|
269 |
197
4d34bf15a478
Don't clear CtrlP cache on exit, fix Windows issues.
Ludovic Chabant <ludovic@chabant.com>
parents:
193
diff
changeset
|
270 " Remember things. |
386
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
271 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
|
272 |
317 | 273 " Don't include some stuff in the most recently used list. |
274 let g:ctrlp_mruf_exclude = 'hg\-editor\-\d+\.txt' | |
275 | |
193
ae53d68033d9
Enable fugitive and some CtrlP extensions, include a new one of my own.
Ludovic Chabant <ludovic@chabant.com>
parents:
191
diff
changeset
|
276 " Enable some cool extensions. |
240
3a6b11d16a2a
Simpler registration for CtrlP extensions.
Ludovic Chabant <ludovic@chabant.com>
parents:
235
diff
changeset
|
277 let g:ctrlp_extensions = [ |
266
de3ef7fbcfc1
Add CtrlP's bookmarkdir extension.
Ludovic Chabant <ludovic@chabant.com>
parents:
252
diff
changeset
|
278 \'tag', 'buffertag', 'quickfix', 'mixed', 'bookmarkdir', |
288
25b672f0f6bd
Remove `projectjump` CtrlP plugin, just use the bookmarks.
Ludovic Chabant <ludovic@chabant.com>
parents:
287
diff
changeset
|
279 \'autoignore' |
240
3a6b11d16a2a
Simpler registration for CtrlP extensions.
Ludovic Chabant <ludovic@chabant.com>
parents:
235
diff
changeset
|
280 \] |
193
ae53d68033d9
Enable fugitive and some CtrlP extensions, include a new one of my own.
Ludovic Chabant <ludovic@chabant.com>
parents:
191
diff
changeset
|
281 |
367 | 282 " Use PyMatch to go faster. |
445
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
283 if (has('python3') || has('python')) |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
284 if s:HasPlugin('ctrlp-py-matcher') |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
285 let g:ctrlp_match_func = {'match': 'pymatcher#PyMatch'} |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
286 let g:ctrlp_max_files = 0 |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
287 let g:ctrlp_lazy_update = 350 |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
288 elseif s:HasPlugin('cpsm', 1) |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
289 let g:ctrlp_match_func = {'match': 'cpsm#CtrlPMatch'} |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
290 let g:ctrlp_max_files = 0 |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
291 let g:ctrlp_lazy_update = 350 |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
292 endif |
367 | 293 endif |
294 | |
178 | 295 " }}} |
296 | |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
297 " FZF {{{ |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
298 |
435
b7682004288d
Move Vim stuff to autoload, add FZF tags lister.
Ludovic Chabant <ludovic@chabant.com>
parents:
430
diff
changeset
|
299 if ludo#platform() == 'mac' |
426
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
300 if filereadable('/usr/local/opt/fzf/plugin/fzf.vim') |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
301 " FZF installed via Homebrew. |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
302 source /usr/local/opt/fzf/plugin/fzf.vim |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
303 endif |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
304 endif |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
305 |
426
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
306 let g:fzf_action = { |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
307 \'ctrl-t': 'tab split', |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
308 \'ctrl-v': 'vsplit', |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
309 \'ctrl-x': 'split', |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
310 \} |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
311 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
312 " }}} |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
313 |
213
769869e61101
Renamed autotags to gutentags.
Ludovic Chabant <ludovic@chabant.com>
parents:
212
diff
changeset
|
314 " Gutentags {{{ |
206 | 315 |
435
b7682004288d
Move Vim stuff to autoload, add FZF tags lister.
Ludovic Chabant <ludovic@chabant.com>
parents:
430
diff
changeset
|
316 let g:gutentags_cache_dir = ludo#localpath('tags') |
373 | 317 let g:gutentags_ctags_exclude = ['venv', 'build', 'static', 'node_modules'] |
435
b7682004288d
Move Vim stuff to autoload, add FZF tags lister.
Ludovic Chabant <ludovic@chabant.com>
parents:
430
diff
changeset
|
318 let g:gutentags_ctags_extra_args = ['--options='.ludo#localpath('ctagsrc')] |
420 | 319 let g:gutentags_ctags_exclude_wildignore = 0 |
206 | 320 |
440
4b816faa06e2
Remove CtrlP, add statusline refresh.
Ludovic Chabant <ludovic@chabant.com>
parents:
439
diff
changeset
|
321 augroup GutentagsStatusLineRefresher |
4b816faa06e2
Remove CtrlP, add statusline refresh.
Ludovic Chabant <ludovic@chabant.com>
parents:
439
diff
changeset
|
322 autocmd! |
4b816faa06e2
Remove CtrlP, add statusline refresh.
Ludovic Chabant <ludovic@chabant.com>
parents:
439
diff
changeset
|
323 autocmd User GutentagsUpdating call lightline#update() |
4b816faa06e2
Remove CtrlP, add statusline refresh.
Ludovic Chabant <ludovic@chabant.com>
parents:
439
diff
changeset
|
324 autocmd User GutentagsUpdated call lightline#update() |
4b816faa06e2
Remove CtrlP, add statusline refresh.
Ludovic Chabant <ludovic@chabant.com>
parents:
439
diff
changeset
|
325 augroup END |
4b816faa06e2
Remove CtrlP, add statusline refresh.
Ludovic Chabant <ludovic@chabant.com>
parents:
439
diff
changeset
|
326 |
206 | 327 " }}} |
328 | |
178 | 329 " Syntastic {{{ |
330 | |
314 | 331 let g:syntastic_auto_loc_list = 2 |
305
a333541a5c74
Syntastic config changes.
Ludovic Chabant <ludovic@chabant.com>
parents:
304
diff
changeset
|
332 let g:syntastic_check_on_open = 1 |
a333541a5c74
Syntastic config changes.
Ludovic Chabant <ludovic@chabant.com>
parents:
304
diff
changeset
|
333 let g:syntastic_check_on_wq = 0 |
a333541a5c74
Syntastic config changes.
Ludovic Chabant <ludovic@chabant.com>
parents:
304
diff
changeset
|
334 |
219
738c1a3ad786
Update Python settings for Syntastic, new settings for Supertab.
Ludovic Chabant <ludovic@chabant.com>
parents:
218
diff
changeset
|
335 " 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
|
336 " 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
|
337 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
|
338 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
|
339 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
|
340 |
738c1a3ad786
Update Python settings for Syntastic, new settings for Supertab.
Ludovic Chabant <ludovic@chabant.com>
parents:
218
diff
changeset
|
341 " }}} |
738c1a3ad786
Update Python settings for Syntastic, new settings for Supertab.
Ludovic Chabant <ludovic@chabant.com>
parents:
218
diff
changeset
|
342 |
444 | 343 " ALE {{{ |
344 | |
345 let g:ale_sign_error = '✗' | |
346 let g:ale_sign_warning = 'âš ' | |
347 | |
348 " }}} | |
349 | |
219
738c1a3ad786
Update Python settings for Syntastic, new settings for Supertab.
Ludovic Chabant <ludovic@chabant.com>
parents:
218
diff
changeset
|
350 " Supertab {{{ |
738c1a3ad786
Update Python settings for Syntastic, new settings for Supertab.
Ludovic Chabant <ludovic@chabant.com>
parents:
218
diff
changeset
|
351 |
308 | 352 let g:SuperTabDefaultCompletionType = "context" |
353 let g:SuperTabLongestEnhanced = 1 | |
354 let g:SuperTabLongestHighlight = 0 | |
219
738c1a3ad786
Update Python settings for Syntastic, new settings for Supertab.
Ludovic Chabant <ludovic@chabant.com>
parents:
218
diff
changeset
|
355 let g:SuperTabCrMapping = 1 |
178 | 356 |
357 " }}} | |
358 | |
359 " Lawrencium {{{ | |
118
c1ff96232138
New settings for Lawrencium.
Ludovic Chabant <ludovic@chabant.com>
parents:
114
diff
changeset
|
360 |
127
1f709d7e03c6
Better Python dev in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
118
diff
changeset
|
361 " Custom Mercurial commands highlighting in Lawrencium. |
118
c1ff96232138
New settings for Lawrencium.
Ludovic Chabant <ludovic@chabant.com>
parents:
114
diff
changeset
|
362 let g:lawrencium_hg_commands_file_types = { |
c1ff96232138
New settings for Lawrencium.
Ludovic Chabant <ludovic@chabant.com>
parents:
114
diff
changeset
|
363 \'clog': 'hggraphlog' |
c1ff96232138
New settings for Lawrencium.
Ludovic Chabant <ludovic@chabant.com>
parents:
114
diff
changeset
|
364 \} |
c1ff96232138
New settings for Lawrencium.
Ludovic Chabant <ludovic@chabant.com>
parents:
114
diff
changeset
|
365 |
127
1f709d7e03c6
Better Python dev in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
118
diff
changeset
|
366 " Make the annotate window better in Lawrencium. |
206 | 367 let g:lawrencium_annotate_width_offset = 1 |
127
1f709d7e03c6
Better Python dev in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
118
diff
changeset
|
368 |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
369 " }}} |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
370 |
178 | 371 " Gundo {{{ |
372 | |
373 let g:gundo_map_move_older = '<Down>' | |
374 let g:gundo_map_move_newer = '<Up>' | |
375 | |
376 " }}} | |
377 | |
378 " YankRing {{{ | |
379 | |
380 let g:yankring_replace_n_pkey = '<C-K>' | |
381 let g:yankring_replace_p_pkey = '<C-J>' | |
382 | |
383 " }}} | |
384 | |
385 " Python-Mode {{{ | |
386 | |
419
c4077384f55f
Use `InputMono` or `Hack` if they're installed.
Ludovic Chabant <ludovic@chabant.com>
parents:
414
diff
changeset
|
387 let g:pymode = 0 |
352
9580765366a4
Fix some python indenting stuff in vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
349
diff
changeset
|
388 let g:pymode_python = 'python3' |
307
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
389 |
314 | 390 let g:pymode_syntax = 0 |
307
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
391 let g:pymode_syntax_all = 0 |
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
392 let g:pymode_syntax_builtin_objs = 1 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
393 let g:pymode_syntax_print_as_function = 1 |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
394 let g:pymode_syntax_space_errors = 1 |
307
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
395 |
352
9580765366a4
Fix some python indenting stuff in vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
349
diff
changeset
|
396 let g:pymode_indent = 0 |
9580765366a4
Fix some python indenting stuff in vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
349
diff
changeset
|
397 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
398 let g:pymode_run = 0 |
307
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
399 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
400 let g:pymode_lint = 0 |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
401 let g:pymode_trim_whitespaces = 0 |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
402 let g:pymode_folding = 1 |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
403 |
307
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
404 let g:pymode_doc = 1 |
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
405 let g:pymode_doc_bind = 'K' |
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
406 |
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
407 let g:pymode_virtualenv = 0 |
178 | 408 |
314 | 409 let g:pymode_rope = 0 |
410 | |
178 | 411 " }}} |
412 | |
379
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
413 " Lightline {{{ |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
414 let g:lightline = { |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
415 \'colorscheme': 'solarized', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
416 \'active': { |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
417 \ '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
|
418 \ ['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
|
419 \ ['ctrlpmark'] ], |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
420 \ 'right': [ ['lineinfo'], |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
421 \ ['percent'], |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
422 \ ['fileformat', 'fileencoding', 'filetype'], |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
423 \ ['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
|
424 \ }, |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
425 \'component_function': { |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
426 \ 'fugitive': '_LightlineFugitive', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
427 \ 'lawrencium': '_LightlineLawrencium', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
428 \ 'ctrlpmark': '_LightlineCtrlPMark', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
429 \ }, |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
430 \'component_expand': { |
444 | 431 \ 'syntastic': '_LightlineLinter', |
379
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
432 \ 'ycm_errs': '_LightlineYcmErrors', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
433 \ 'ycm_warns': '_LightlineYcmWarnings', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
434 \ 'gutentags': '_LightlineGutentags', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
435 \ }, |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
436 \'component_type': { |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
437 \ 'syntastic': 'error', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
438 \ 'ycm_errs': 'error', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
439 \ 'ycm_warns': 'warning', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
440 \ 'gutentags': 'warning', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
441 \ }, |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
442 \} |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
443 |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
444 function! _LightlineFugitive() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
445 return fugitive#head() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
446 endfunction |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
447 |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
448 function! _LightlineLawrencium() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
449 return lawrencium#statusline() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
450 endfunction |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
451 |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
452 function! _LightlineCtrlPMark() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
453 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
|
454 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
|
455 return lightline#concatenate( |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
456 \['WAT?', g:lightline.ctrlp_prev, |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
457 \ g:lightline.ctrlp_item, |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
458 \ g:lightline.ctrlp_next], |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
459 \0) |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
460 else |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
461 return '' |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
462 endif |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
463 endfunction |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
464 |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
465 function! _LightlineGutentags() |
430
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
466 return gutentags#statusline('', '', '♨') |
379
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
467 endfunction |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
468 |
444 | 469 if s:HasPlugin('syntastic') |
470 function! _LightlineLinter() | |
471 return SyntasticStatuslineFlag() | |
472 endfunction | |
473 else | |
474 function! _LightlineLinter() abort | |
475 let l:counts = ale#statusline#Count(bufnr('')) | |
476 | |
477 let l:all_errors = l:counts.error + l:counts.style_error | |
478 let l:all_non_errors = l:counts.total - l:all_errors | |
479 | |
480 return l:counts.total == 0 ? 'OK' : printf( | |
481 \ '%dW %dE', | |
482 \ all_non_errors, | |
483 \ all_errors | |
484 \) | |
485 endfunction | |
486 endif | |
379
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
487 |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
488 function! _LightlineYcmErrors() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
489 let l:cnt = youcompleteme#GetErrorCount() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
490 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
|
491 endfunction |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
492 |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
493 function! _LightlineYcmWarnings() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
494 let l:cnt = youcompleteme#GetWarningCount() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
495 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
|
496 endfunction |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
497 " }}} |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
498 |
386
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
499 " YouCompleteMe {{{ |
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
500 |
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
501 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
|
502 |
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
503 " }}} |
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
504 |
178 | 505 " }}} |
506 | |
73
39a7e05637d8
Added 80 chars limit to text/markdown files.
Ludovic Chabant <ludovic@chabant.com>
parents:
67
diff
changeset
|
507 " File-Specific Settings {{{ |
39a7e05637d8
Added 80 chars limit to text/markdown files.
Ludovic Chabant <ludovic@chabant.com>
parents:
67
diff
changeset
|
508 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
509 augroup VimRCFileType_markdown |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
510 au! |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
511 autocmd FileType text,markdown setlocal textwidth=80 |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
512 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
|
513 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
|
514 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
|
515 autocmd FileType markdown nnoremap <buffer> <localleader>4 mzI####<space><esc>`z5l |
176 | 516 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
517 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
|
518 autocmd BufRead,BufNewFile */_content/**/*.html set ft=piecrustmarkdown |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
519 augroup END |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
520 |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
521 augroup VimRCFileType_php |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
522 au! |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
523 " Who the hell changes my matchpairs? |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
524 autocmd FileType php setlocal matchpairs-=<:> |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
525 augroup END |
83 | 526 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
527 augroup VimRCFileType_c |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
528 au! |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
529 autocmd FileType c,c++,cpp setlocal foldmethod=syntax |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
530 autocmd FileType c,c++,cpp setlocal colorcolumn=120 |
413
4a2468f72e44
Optimize C++ file editing with some folding tricks.
Ludovic Chabant <ludovic@chabant.com>
parents:
410
diff
changeset
|
531 autocmd FileType c,c++,cpp setlocal synmaxcol=200 |
4a2468f72e44
Optimize C++ file editing with some folding tricks.
Ludovic Chabant <ludovic@chabant.com>
parents:
410
diff
changeset
|
532 autocmd FileType c,c++,cpp nnoremap <buffer> <localleader>z :call <SID>ToggleCppFolding()<CR> |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
533 augroup END |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
534 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
535 augroup VimRCFileType_csharp |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
536 au! |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
537 autocmd BufNewFile,BufRead *.xaml setlocal filetype=xml |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
538 autocmd FileType cs setlocal foldmethod=syntax |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
539 autocmd FileType cs setlocal colorcolumn=120 |
413
4a2468f72e44
Optimize C++ file editing with some folding tricks.
Ludovic Chabant <ludovic@chabant.com>
parents:
410
diff
changeset
|
540 autocmd FileType cs setlocal synmaxcol=200 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
541 augroup END |
83 | 542 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
543 augroup VimRCFileType_css |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
544 au! |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
545 autocmd BufNewFile,BufRead *.less setlocal filetype=less |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
546 autocmd Filetype less,css setlocal foldmethod=marker |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
547 autocmd Filetype less,css setlocal foldmarker={,} |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
548 autocmd Filetype less,css setlocal iskeyword+=- |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
549 autocmd Filetype less,css setlocal omnifunc=csscomplete#CompleteCSS |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
550 augroup END |
160 | 551 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
552 augroup VimRCTrailingWhitespaces |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
553 au! |
287
44c9d65cfa74
Readjust some Vim config stuff around folding.
Ludovic Chabant <ludovic@chabant.com>
parents:
286
diff
changeset
|
554 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
|
555 augroup END |
73
39a7e05637d8
Added 80 chars limit to text/markdown files.
Ludovic Chabant <ludovic@chabant.com>
parents:
67
diff
changeset
|
556 |
39a7e05637d8
Added 80 chars limit to text/markdown files.
Ludovic Chabant <ludovic@chabant.com>
parents:
67
diff
changeset
|
557 " }}} |
39a7e05637d8
Added 80 chars limit to text/markdown files.
Ludovic Chabant <ludovic@chabant.com>
parents:
67
diff
changeset
|
558 |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
559 " Mappings {{{ |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
560 |
42
6b831735c092
Added french keymap support.
Ludovic Chabant <ludovic@chabant.com>
parents:
18
diff
changeset
|
561 let mapleader="," |
43
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
562 |
76
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
563 " Visual line navigation |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
564 noremap <up> g<up> |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
565 noremap <down> g<down> |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
566 noremap <home> g<home> |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
567 noremap <end> g<end> |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
568 |
367 | 569 noremap <S-up> 20<up> |
570 noremap <S-down> 20<down> | |
571 | |
169
4947d1f99b72
Better tab/buffer navigation.
Ludovic Chabant <ludovic@chabant.com>
parents:
163
diff
changeset
|
572 " Tab navigation |
178 | 573 noremap <C-Tab> :tabnext<cr> |
574 noremap <C-S-Tab> :tabprevious<cr> | |
304
50fbd059a6a1
More Vim customizations.
Ludovic Chabant <ludovic@chabant.com>
parents:
303
diff
changeset
|
575 nnoremap <leader>t :tabnew<cr> |
169
4947d1f99b72
Better tab/buffer navigation.
Ludovic Chabant <ludovic@chabant.com>
parents:
163
diff
changeset
|
576 |
80
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
577 " Window navigation |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
578 nnoremap <C-up> :wincmd k<cr> |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
579 nnoremap <C-down> :wincmd j<cr> |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
580 nnoremap <C-left> :wincmd h<cr> |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
581 nnoremap <C-right> :wincmd l<cr> |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
582 |
176 | 583 " Switch buffers. |
420 | 584 nnoremap <F1> :execute ("buffer " . bufname("#"))<cr> |
83 | 585 |
176 | 586 " NERDTree. |
420 | 587 nnoremap <F2> :call <SID>ToggleNERDTree()<cr> |
588 nnoremap <C-F2> :call <SID>FindInNERDTree()<cr> | |
443
4ca0b1413199
Some new cool Vim things.
Ludovic Chabant <ludovic@chabant.com>
parents:
442
diff
changeset
|
589 nnoremap <leader>e :e %:h<cr> |
83 | 590 |
157
7fd22eb11789
Added `tagbar` for Vim, with keyboard shortcut.
Ludovic Chabant <ludovic@chabant.com>
parents:
155
diff
changeset
|
591 " Tagbar. |
420 | 592 nnoremap <F3> :TagbarToggle<cr> |
593 nnoremap <C-F3> :TagbarOpenAutoClose<cr> | |
157
7fd22eb11789
Added `tagbar` for Vim, with keyboard shortcut.
Ludovic Chabant <ludovic@chabant.com>
parents:
155
diff
changeset
|
594 |
186
01304e9b4c19
Re-add Gundo mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
185
diff
changeset
|
595 " Gundo. |
420 | 596 nnoremap <F4> :GundoToggle<cr> |
597 | |
598 " F5 to F8 are available for context-dependent mappings. | |
599 | |
600 " Jump to tags by keeping things better in view. Option for jumping to a tag | |
601 " in a split window where everything is folded except what you need to see. | |
602 " Note that if a tag search yield multiple possible results, we will still run | |
603 " some of that `zvzz` stuff, but that's OK, the main point is to not mess up | |
604 " the result selection window either. | |
605 " | |
606 " Go back after checking out a tag. | |
607 nnoremap <F9> :pop<CR> | |
608 " Go check out a tag. | |
609 nnoremap <F10> g<C-]>zvzz | |
610 " Go check out a tag in a split window. | |
611 nnoremap <S-F10> <C-W>vg<C-]>zMzvzz | |
612 " Move to previous matching tag. | |
613 nnoremap <C-F9> :tprevious<CR> | |
614 " Move to next matching tag. | |
615 nnoremap <C-F10> :tnext<CR> | |
186
01304e9b4c19
Re-add Gundo mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
185
diff
changeset
|
616 |
83 | 617 " Common typos. |
618 nnoremap ; : | |
619 | |
80
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
620 " Split windows |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
621 nnoremap <leader>s :split<cr> |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
622 nnoremap <leader>v :vsplit<cr> |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
623 |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
624 " Easier things to type |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
625 nnoremap <leader>w :w<cr> |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
626 nnoremap <leader>q :q<cr> |
119 | 627 nnoremap <leader>hh :Hg |
628 nnoremap <leader>hg :Hg! | |
112 | 629 nnoremap <leader>hs :Hgstatus<cr> |
630 nnoremap <leader>hv :Hgvdiff<cr> | |
80
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
631 |
114
ccc3902408d2
Fix the hash key in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
113
diff
changeset
|
632 " Make the hash-key not suck. |
ccc3902408d2
Fix the hash key in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
113
diff
changeset
|
633 inoremap # X<BS># |
ccc3902408d2
Fix the hash key in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
113
diff
changeset
|
634 |
80
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
635 " Toggle invisible characters |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
636 nnoremap <leader>i :set list!<cr> |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
637 |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
638 " Clear search matches |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
639 nnoremap <leader><space> :noh<cr>:call clearmatches()<cr> |
43
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
640 |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
641 " Switch between FR and US keyboard layouts. |
119 | 642 nnoremap <C-l>f :setlocal keymap=french<cr> |
643 nnoremap <C-l>u :setlocal keymap=<cr> | |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
644 |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
645 " Toggle spell check according to current keyboard layout. |
119 | 646 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
|
647 |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
648 " 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
|
649 nnoremap <leader>d :bprevious<cr>:bdelete #<cr> |
43
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
650 |
119 | 651 " Use sane regexes. |
652 nnoremap / /\v | |
653 vnoremap / /\v | |
654 | |
452
d048318ba839
Better indenting in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
445
diff
changeset
|
655 " Don't lose visual selection when you indent/unindent. |
d048318ba839
Better indenting in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
445
diff
changeset
|
656 vnoremap > >gv |
d048318ba839
Better indenting in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
445
diff
changeset
|
657 vnoremap < <gv |
d048318ba839
Better indenting in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
445
diff
changeset
|
658 |
289
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
659 " 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
|
660 " 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
|
661 nnoremap ]q :cnext<cr>zvzz |
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
662 nnoremap [q :cprevious<cr>zvzz |
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
663 nnoremap ]l :lnext<cr>zvzz |
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
664 nnoremap [l :lprevious<cr>zvzz |
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
665 |
304
50fbd059a6a1
More Vim customizations.
Ludovic Chabant <ludovic@chabant.com>
parents:
303
diff
changeset
|
666 " Same with change and jump lists. |
367 | 667 nnoremap ]e g,zz |
668 nnoremap [e g;zz | |
304
50fbd059a6a1
More Vim customizations.
Ludovic Chabant <ludovic@chabant.com>
parents:
303
diff
changeset
|
669 nnoremap ]j <C-I> |
50fbd059a6a1
More Vim customizations.
Ludovic Chabant <ludovic@chabant.com>
parents:
303
diff
changeset
|
670 nnoremap [j <C-O> |
289
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
671 |
367 | 672 " 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
|
673 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
|
674 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
|
675 nnoremap <leader>cw :let @+ = getcwd()<cr>:echo @+<cr> |
367 | 676 |
303
01ec865443b6
Update NERDTree macros and tweak more Vim stuff.
Ludovic Chabant <ludovic@chabant.com>
parents:
294
diff
changeset
|
677 " Make the diff navigation also center things. |
289
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
678 nnoremap ]c ]czvzz |
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
679 nnoremap [c [czvzz |
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
680 |
103
a755319f124e
Added mappings for substitutions.
Ludovic Chabant <ludovic@chabant.com>
parents:
101
diff
changeset
|
681 " Quick search and replace. |
119 | 682 function! s:VSetSearch() |
294
8bc056d80c39
Remove unused stuff, add grepping, shorter status line.
Ludovic Chabant <ludovic@chabant.com>
parents:
291
diff
changeset
|
683 let temp = @@ |
8bc056d80c39
Remove unused stuff, add grepping, shorter status line.
Ludovic Chabant <ludovic@chabant.com>
parents:
291
diff
changeset
|
684 norm! gvy |
8bc056d80c39
Remove unused stuff, add grepping, shorter status line.
Ludovic Chabant <ludovic@chabant.com>
parents:
291
diff
changeset
|
685 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
|
686 let @@ = temp |
119 | 687 endfunction |
688 vnoremap * :<C-u>call <SID>VSetSearch()<CR>//<CR><c-o> | |
689 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
|
690 |
206 | 691 " 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
|
692 nnoremap n nzvzz |
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
693 nnoremap N Nzvzz |
206 | 694 |
430
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
695 " Writing mode. |
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
696 autocmd! User GoyoEnter nested call ludo#on_goyo_enter() |
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
697 autocmd! User GoyoLeave nested call ludo#on_goyo_leave() |
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
698 nmap <leader>p :call ludo#writingmode()<CR> |
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
699 |
379
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
700 " YCM mappings. |
420 | 701 if s:HasPlugin('youcompleteme') |
426
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
702 augroup VimRC_YouCompleteMe |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
703 autocmd! |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
704 autocmd FileType cpp nnoremap <Leader>jj :YcmCompleter GoToImprecise<cr>zv |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
705 autocmd FileType cpp nnoremap <Leader>jd :YcmCompleter GoToDefinition<cr>zv |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
706 autocmd FileType cpp nnoremap <Leader>jh :YcmCompleter GoToDeclaration<cr>zv |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
707 autocmd FileType cpp nnoremap <Leader>ji :YcmCompleter GoToInclude<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
708 autocmd FileType cpp nnoremap <Leader>jc :YcmCompleter GetDoc<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
709 autocmd FileType cpp nnoremap <Leader>je :YcmShowDetailedDiagnostic<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
710 augroup END |
420 | 711 endif |
397
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
712 |
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
713 " OmniSharp mappings |
420 | 714 if s:HasPlugin('OmniSharp') |
426
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
715 augroup VimRC_OmniSharp |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
716 autocmd! |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
717 autocmd FileType cs setlocal omnifunc=OmniSharp#Complete |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
718 autocmd BufEnter,TextChanged,InsertLeave *.cs SyntasticCheck |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
719 autocmd CursorHold *.cs call OmniSharp#TypeLookupWithoutDocumentation() |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
720 autocmd FileType cs nnoremap <Leader>jj :OmniSharpGotoDefinition<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
721 autocmd FileType cs nnoremap <Leader>x :OmniSharpFixIssue<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
722 autocmd FileType cs nnoremap <Leader>fx :OmniSharpFixUsings<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
723 autocmd FileType cs nnoremap <Leader>tt :OmniSharpTypeLookup<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
724 autocmd FileType cs nnoremap <Leader>dc :OmniSharpDocumentation<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
725 augroup END |
420 | 726 endif |
379
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
727 |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
728 " ProjectRoot mappings |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
729 let s:no_auto_projectroot_buftypes = [ |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
730 \'help', 'nofile', 'quickfix'] |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
731 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
732 function! s:AutoProjectRootCD() abort |
426
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
733 try |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
734 if index(s:no_auto_projectroot_buftypes, &buftype) == -1 |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
735 ProjectRootCD |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
736 endif |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
737 catch |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
738 " Silently ignore invalid buffers |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
739 endtry |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
740 endfunction |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
741 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
742 augroup VimRC_ProjectRoot |
426
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
743 autocmd! |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
744 autocmd BufEnter * call <SID>AutoProjectRootCD() |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
745 augroup END |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
746 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
747 nnoremap <leader>cd :ProjectRootCD<cr> |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
748 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
749 " Ctrl-P mappings. |
420 | 750 if s:HasPlugin('ctrlp') |
426
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
751 nnoremap <silent> <C-p> :CtrlP<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
752 nnoremap <silent> <C-o> :CtrlPBuffer<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
753 nnoremap <silent> <C-u> :CtrlPTag<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
754 nnoremap <silent> <C-y> :CtrlPBufTag<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
755 nnoremap <silent> <Tab> :CtrlPMRUFiles<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
756 nnoremap <silent> <F8> :CtrlPBookmarkDir<cr> |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
757 endif |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
758 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
759 " FZF mappings. |
420 | 760 if s:HasPlugin('fzf') |
426
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
761 if exists('*fzf#run') |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
762 nnoremap <silent> <C-p> :Files<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
763 nnoremap <silent> <C-o> :Buffers<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
764 nnoremap <Tab> :History<cr> |
435
b7682004288d
Move Vim stuff to autoload, add FZF tags lister.
Ludovic Chabant <ludovic@chabant.com>
parents:
430
diff
changeset
|
765 |
b7682004288d
Move Vim stuff to autoload, add FZF tags lister.
Ludovic Chabant <ludovic@chabant.com>
parents:
430
diff
changeset
|
766 " Replace the default `Tags` command, which requires Perl, with |
b7682004288d
Move Vim stuff to autoload, add FZF tags lister.
Ludovic Chabant <ludovic@chabant.com>
parents:
430
diff
changeset
|
767 " something I can use, based on Python. |
b7682004288d
Move Vim stuff to autoload, add FZF tags lister.
Ludovic Chabant <ludovic@chabant.com>
parents:
430
diff
changeset
|
768 command! -bang -nargs=* Tags call ludo#run_fzf_tags(<q-args>, <bang>0) |
441
a3c6869085c1
Add shortcut for tags.
Ludovic Chabant <ludovic@chabant.com>
parents:
440
diff
changeset
|
769 nnoremap <silent> <C-u> :Tags<cr> |
426
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
770 else |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
771 call ludo#error( |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
772 \"FZF is installed and enabled, but the Vim plugin ". |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
773 \"isn't loaded... add it to your `vimrc-local-pre`.") |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
774 endif |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
775 endif |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
776 |
445
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
777 " LeaderF mappings. |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
778 if s:HasPlugin('leaderf') |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
779 let g:Lf_ShortcutF = '<C-p>' |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
780 let g:Lf_ShortcutB = '<C-o>' |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
781 nnoremap <silent> <C-p> :LeaderfFile<cr> |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
782 nnoremap <silent> <C-o> :LeaderfBuffer<cr> |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
783 nnoremap <silent> <C-u> :LeaderfTag<cr> |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
784 nnoremap <silent> <C-y> :LeaderfBufTagAll<cr> |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
785 nnoremap <silent> <Tab> :LeaderfMru<cr> |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
786 |
453 | 787 nnoremap <silent> <Leader>fl :LeaderfLine<cr> |
788 nnoremap <silent> <Leader>fc :LeaderfColorscheme<cr> | |
789 nnoremap <silent> <Leader>fh :LeaderfHelp<cr> | |
790 | |
445
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
791 let g:Lf_StlSeparator = { 'left': '', 'right': '' } |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
792 endif |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
793 |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
794 " }}} |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
795 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
796 " Folding {{{ |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
797 |
367 | 798 " Start with one level of open. |
799 set foldlevel=1 | |
800 | |
385 | 801 " Don't fold too much. |
802 set foldnestmax=2 | |
803 | |
287
44c9d65cfa74
Readjust some Vim config stuff around folding.
Ludovic Chabant <ludovic@chabant.com>
parents:
286
diff
changeset
|
804 " Folds are defined by markers in the text. |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
805 set foldmethod=marker"{{{"}}} |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
806 |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
807 " Toggle folds with <space>. |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
808 nnoremap <space> za |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
809 |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
810 " Create folds with <space> (in visual mode). |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
811 vnoremap <space> zf |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
812 |
413
4a2468f72e44
Optimize C++ file editing with some folding tricks.
Ludovic Chabant <ludovic@chabant.com>
parents:
410
diff
changeset
|
813 " See http://vim.wikia.com/wiki/Keep_folds_closed_while_inserting_text |
4a2468f72e44
Optimize C++ file editing with some folding tricks.
Ludovic Chabant <ludovic@chabant.com>
parents:
410
diff
changeset
|
814 " Don't screw up folds when inserting text that might affect them, until |
4a2468f72e44
Optimize C++ file editing with some folding tricks.
Ludovic Chabant <ludovic@chabant.com>
parents:
410
diff
changeset
|
815 " leaving insert mode. Foldmethod is local to the window. Protect against |
4a2468f72e44
Optimize C++ file editing with some folding tricks.
Ludovic Chabant <ludovic@chabant.com>
parents:
410
diff
changeset
|
816 " screwing up folding when switching between windows. |
4a2468f72e44
Optimize C++ file editing with some folding tricks.
Ludovic Chabant <ludovic@chabant.com>
parents:
410
diff
changeset
|
817 autocmd InsertEnter * if !exists('w:last_fdm') | let w:last_fdm=&foldmethod | setlocal foldmethod=manual | endif |
4a2468f72e44
Optimize C++ file editing with some folding tricks.
Ludovic Chabant <ludovic@chabant.com>
parents:
410
diff
changeset
|
818 autocmd InsertLeave,WinLeave * if exists('w:last_fdm') | let &l:foldmethod=w:last_fdm | unlet w:last_fdm | endif |
4a2468f72e44
Optimize C++ file editing with some folding tricks.
Ludovic Chabant <ludovic@chabant.com>
parents:
410
diff
changeset
|
819 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
820 " }}} |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
821 |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
822 " Abbreviations {{{ |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
823 |
43
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
824 iabbrev @@ ludovic@chabant.com |
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
825 iabbrev ccopy Copyright ©2011 Ludovic Chabant, all rights reserved. |
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
826 iabbrev ssig --<cr>l u d o .<cr>. 8 0 17 80 |
0 | 827 |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
828 " }}} |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
829 |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
830 " Functions {{{ |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
831 |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
832 function! s:ToggleSpellCheck() abort |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
833 if &spell ==? 'nospell' |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
834 if &keymap ==? 'french' |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
835 setlocal spell spelllang=fr_fr |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
836 else |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
837 setlocal spell spelllang=en_us,en_ca |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
838 endif |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
839 else |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
840 setlocal spell nospell |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
841 endif |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
842 endfunction |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
843 |
160 | 844 function! s:StripTrailingWhitespaces() abort |
845 let l = line(".") | |
846 let c = col(".") | |
847 %s/\s\+$//e | |
848 call cursor(l, c) | |
849 endfunction | |
850 | |
176 | 851 function! s:ToggleNERDTree() abort |
852 NERDTreeToggle | |
853 endfunction | |
854 | |
855 function! s:FindInNERDTree() abort | |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
856 ProjectRootExe NERDTreeFind |
332 | 857 normal zz |
176 | 858 endfunction |
859 | |
413
4a2468f72e44
Optimize C++ file editing with some folding tricks.
Ludovic Chabant <ludovic@chabant.com>
parents:
410
diff
changeset
|
860 function! s:ToggleCppFolding() abort |
426
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
861 if (&foldmethod == "syntax") |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
862 setlocal foldmethod=manual |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
863 setlocal nofoldenable |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
864 else |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
865 setlocal foldmethod=syntax |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
866 setlocal foldenable |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
867 endif |
413
4a2468f72e44
Optimize C++ file editing with some folding tricks.
Ludovic Chabant <ludovic@chabant.com>
parents:
410
diff
changeset
|
868 endfunction |
4a2468f72e44
Optimize C++ file editing with some folding tricks.
Ludovic Chabant <ludovic@chabant.com>
parents:
410
diff
changeset
|
869 |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
870 " }}} |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
871 |
171
7559d8bc39bb
Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
169
diff
changeset
|
872 " Local override {{{ |
7559d8bc39bb
Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
169
diff
changeset
|
873 |
435
b7682004288d
Move Vim stuff to autoload, add FZF tags lister.
Ludovic Chabant <ludovic@chabant.com>
parents:
430
diff
changeset
|
874 let s:local_vimrc = ludo#localpath('vimrc-local') |
430
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
875 if filereadable(s:local_vimrc) |
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
876 execute 'source' s:local_vimrc |
171
7559d8bc39bb
Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
169
diff
changeset
|
877 endif |
7559d8bc39bb
Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
169
diff
changeset
|
878 |
7559d8bc39bb
Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
169
diff
changeset
|
879 " }}} |
7559d8bc39bb
Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
169
diff
changeset
|
880 |