Mercurial > dotfiles
annotate vim/vimrc @ 457:3efc67540556
Use ripgrep first if possible, then ag.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 03 Apr 2019 15:59:22 -0700 |
parents | 97a94dacfd54 |
children | eb8891b1a6f5 |
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 |
457
3efc67540556
Use ripgrep first if possible, then ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
453
diff
changeset
|
244 if executable('rg') |
3efc67540556
Use ripgrep first if possible, then ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
453
diff
changeset
|
245 let g:ackprg = 'rg --vimgrep' |
3efc67540556
Use ripgrep first if possible, then ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
453
diff
changeset
|
246 elseif executable('ag') |
430
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
247 let g:ackprg = 'ag --vimgrep' |
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
248 endif |
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
249 |
440
4b816faa06e2
Remove CtrlP, add statusline refresh.
Ludovic Chabant <ludovic@chabant.com>
parents:
439
diff
changeset
|
250 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
|
251 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
|
252 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
|
253 |
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
254 " }}} |
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
255 |
178 | 256 " Ctrl-P {{{ |
257 | |
80
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
258 " We'll set our own mappings. |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
259 let g:ctrlp_map = '' |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
260 |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
261 " 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
|
262 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
|
263 |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
264 " Ctrl-P should however ignore some stuff. |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
265 let g:ctrlp_custom_ignore = { |
426
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
266 \ 'dir': '\v[\/](\.git|\.hg|\.svn|venv|static|node_modules|_cache|_counter)$' |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
267 \ } |
80
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
268 |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
269 " 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
|
270 let g:ctrlp_cache_dir = ludo#localpath('cache') |
10
00cac5ebf546
Added default window size. Added buffer keyboard shortcuts.
ludovicchabant
parents:
6
diff
changeset
|
271 |
197
4d34bf15a478
Don't clear CtrlP cache on exit, fix Windows issues.
Ludovic Chabant <ludovic@chabant.com>
parents:
193
diff
changeset
|
272 " Remember things. |
386
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
273 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
|
274 |
317 | 275 " Don't include some stuff in the most recently used list. |
276 let g:ctrlp_mruf_exclude = 'hg\-editor\-\d+\.txt' | |
277 | |
193
ae53d68033d9
Enable fugitive and some CtrlP extensions, include a new one of my own.
Ludovic Chabant <ludovic@chabant.com>
parents:
191
diff
changeset
|
278 " Enable some cool extensions. |
240
3a6b11d16a2a
Simpler registration for CtrlP extensions.
Ludovic Chabant <ludovic@chabant.com>
parents:
235
diff
changeset
|
279 let g:ctrlp_extensions = [ |
266
de3ef7fbcfc1
Add CtrlP's bookmarkdir extension.
Ludovic Chabant <ludovic@chabant.com>
parents:
252
diff
changeset
|
280 \'tag', 'buffertag', 'quickfix', 'mixed', 'bookmarkdir', |
288
25b672f0f6bd
Remove `projectjump` CtrlP plugin, just use the bookmarks.
Ludovic Chabant <ludovic@chabant.com>
parents:
287
diff
changeset
|
281 \'autoignore' |
240
3a6b11d16a2a
Simpler registration for CtrlP extensions.
Ludovic Chabant <ludovic@chabant.com>
parents:
235
diff
changeset
|
282 \] |
193
ae53d68033d9
Enable fugitive and some CtrlP extensions, include a new one of my own.
Ludovic Chabant <ludovic@chabant.com>
parents:
191
diff
changeset
|
283 |
367 | 284 " Use PyMatch to go faster. |
445
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
285 if (has('python3') || has('python')) |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
286 if s:HasPlugin('ctrlp-py-matcher') |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
287 let g:ctrlp_match_func = {'match': 'pymatcher#PyMatch'} |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
288 let g:ctrlp_max_files = 0 |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
289 let g:ctrlp_lazy_update = 350 |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
290 elseif s:HasPlugin('cpsm', 1) |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
291 let g:ctrlp_match_func = {'match': 'cpsm#CtrlPMatch'} |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
292 let g:ctrlp_max_files = 0 |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
293 let g:ctrlp_lazy_update = 350 |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
294 endif |
367 | 295 endif |
296 | |
178 | 297 " }}} |
298 | |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
299 " FZF {{{ |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
300 |
435
b7682004288d
Move Vim stuff to autoload, add FZF tags lister.
Ludovic Chabant <ludovic@chabant.com>
parents:
430
diff
changeset
|
301 if ludo#platform() == 'mac' |
426
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
302 if filereadable('/usr/local/opt/fzf/plugin/fzf.vim') |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
303 " FZF installed via Homebrew. |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
304 source /usr/local/opt/fzf/plugin/fzf.vim |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
305 endif |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
306 endif |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
307 |
426
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
308 let g:fzf_action = { |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
309 \'ctrl-t': 'tab split', |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
310 \'ctrl-v': 'vsplit', |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
311 \'ctrl-x': 'split', |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
312 \} |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
313 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
314 " }}} |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
315 |
213
769869e61101
Renamed autotags to gutentags.
Ludovic Chabant <ludovic@chabant.com>
parents:
212
diff
changeset
|
316 " Gutentags {{{ |
206 | 317 |
435
b7682004288d
Move Vim stuff to autoload, add FZF tags lister.
Ludovic Chabant <ludovic@chabant.com>
parents:
430
diff
changeset
|
318 let g:gutentags_cache_dir = ludo#localpath('tags') |
373 | 319 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
|
320 let g:gutentags_ctags_extra_args = ['--options='.ludo#localpath('ctagsrc')] |
420 | 321 let g:gutentags_ctags_exclude_wildignore = 0 |
206 | 322 |
440
4b816faa06e2
Remove CtrlP, add statusline refresh.
Ludovic Chabant <ludovic@chabant.com>
parents:
439
diff
changeset
|
323 augroup GutentagsStatusLineRefresher |
4b816faa06e2
Remove CtrlP, add statusline refresh.
Ludovic Chabant <ludovic@chabant.com>
parents:
439
diff
changeset
|
324 autocmd! |
4b816faa06e2
Remove CtrlP, add statusline refresh.
Ludovic Chabant <ludovic@chabant.com>
parents:
439
diff
changeset
|
325 autocmd User GutentagsUpdating call lightline#update() |
4b816faa06e2
Remove CtrlP, add statusline refresh.
Ludovic Chabant <ludovic@chabant.com>
parents:
439
diff
changeset
|
326 autocmd User GutentagsUpdated call lightline#update() |
4b816faa06e2
Remove CtrlP, add statusline refresh.
Ludovic Chabant <ludovic@chabant.com>
parents:
439
diff
changeset
|
327 augroup END |
4b816faa06e2
Remove CtrlP, add statusline refresh.
Ludovic Chabant <ludovic@chabant.com>
parents:
439
diff
changeset
|
328 |
206 | 329 " }}} |
330 | |
178 | 331 " Syntastic {{{ |
332 | |
314 | 333 let g:syntastic_auto_loc_list = 2 |
305
a333541a5c74
Syntastic config changes.
Ludovic Chabant <ludovic@chabant.com>
parents:
304
diff
changeset
|
334 let g:syntastic_check_on_open = 1 |
a333541a5c74
Syntastic config changes.
Ludovic Chabant <ludovic@chabant.com>
parents:
304
diff
changeset
|
335 let g:syntastic_check_on_wq = 0 |
a333541a5c74
Syntastic config changes.
Ludovic Chabant <ludovic@chabant.com>
parents:
304
diff
changeset
|
336 |
219
738c1a3ad786
Update Python settings for Syntastic, new settings for Supertab.
Ludovic Chabant <ludovic@chabant.com>
parents:
218
diff
changeset
|
337 " 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
|
338 " 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
|
339 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
|
340 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
|
341 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
|
342 |
738c1a3ad786
Update Python settings for Syntastic, new settings for Supertab.
Ludovic Chabant <ludovic@chabant.com>
parents:
218
diff
changeset
|
343 " }}} |
738c1a3ad786
Update Python settings for Syntastic, new settings for Supertab.
Ludovic Chabant <ludovic@chabant.com>
parents:
218
diff
changeset
|
344 |
444 | 345 " ALE {{{ |
346 | |
347 let g:ale_sign_error = '✗' | |
348 let g:ale_sign_warning = 'âš ' | |
349 | |
350 " }}} | |
351 | |
219
738c1a3ad786
Update Python settings for Syntastic, new settings for Supertab.
Ludovic Chabant <ludovic@chabant.com>
parents:
218
diff
changeset
|
352 " Supertab {{{ |
738c1a3ad786
Update Python settings for Syntastic, new settings for Supertab.
Ludovic Chabant <ludovic@chabant.com>
parents:
218
diff
changeset
|
353 |
308 | 354 let g:SuperTabDefaultCompletionType = "context" |
355 let g:SuperTabLongestEnhanced = 1 | |
356 let g:SuperTabLongestHighlight = 0 | |
219
738c1a3ad786
Update Python settings for Syntastic, new settings for Supertab.
Ludovic Chabant <ludovic@chabant.com>
parents:
218
diff
changeset
|
357 let g:SuperTabCrMapping = 1 |
178 | 358 |
359 " }}} | |
360 | |
361 " Lawrencium {{{ | |
118
c1ff96232138
New settings for Lawrencium.
Ludovic Chabant <ludovic@chabant.com>
parents:
114
diff
changeset
|
362 |
127
1f709d7e03c6
Better Python dev in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
118
diff
changeset
|
363 " Custom Mercurial commands highlighting in Lawrencium. |
118
c1ff96232138
New settings for Lawrencium.
Ludovic Chabant <ludovic@chabant.com>
parents:
114
diff
changeset
|
364 let g:lawrencium_hg_commands_file_types = { |
c1ff96232138
New settings for Lawrencium.
Ludovic Chabant <ludovic@chabant.com>
parents:
114
diff
changeset
|
365 \'clog': 'hggraphlog' |
c1ff96232138
New settings for Lawrencium.
Ludovic Chabant <ludovic@chabant.com>
parents:
114
diff
changeset
|
366 \} |
c1ff96232138
New settings for Lawrencium.
Ludovic Chabant <ludovic@chabant.com>
parents:
114
diff
changeset
|
367 |
127
1f709d7e03c6
Better Python dev in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
118
diff
changeset
|
368 " Make the annotate window better in Lawrencium. |
206 | 369 let g:lawrencium_annotate_width_offset = 1 |
127
1f709d7e03c6
Better Python dev in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
118
diff
changeset
|
370 |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
371 " }}} |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
372 |
178 | 373 " Gundo {{{ |
374 | |
375 let g:gundo_map_move_older = '<Down>' | |
376 let g:gundo_map_move_newer = '<Up>' | |
377 | |
378 " }}} | |
379 | |
380 " YankRing {{{ | |
381 | |
382 let g:yankring_replace_n_pkey = '<C-K>' | |
383 let g:yankring_replace_p_pkey = '<C-J>' | |
384 | |
385 " }}} | |
386 | |
387 " Python-Mode {{{ | |
388 | |
419
c4077384f55f
Use `InputMono` or `Hack` if they're installed.
Ludovic Chabant <ludovic@chabant.com>
parents:
414
diff
changeset
|
389 let g:pymode = 0 |
352
9580765366a4
Fix some python indenting stuff in vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
349
diff
changeset
|
390 let g:pymode_python = 'python3' |
307
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
391 |
314 | 392 let g:pymode_syntax = 0 |
307
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
393 let g:pymode_syntax_all = 0 |
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
394 let g:pymode_syntax_builtin_objs = 1 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
395 let g:pymode_syntax_print_as_function = 1 |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
396 let g:pymode_syntax_space_errors = 1 |
307
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
397 |
352
9580765366a4
Fix some python indenting stuff in vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
349
diff
changeset
|
398 let g:pymode_indent = 0 |
9580765366a4
Fix some python indenting stuff in vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
349
diff
changeset
|
399 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
400 let g:pymode_run = 0 |
307
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
401 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
402 let g:pymode_lint = 0 |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
403 let g:pymode_trim_whitespaces = 0 |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
404 let g:pymode_folding = 1 |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
405 |
307
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
406 let g:pymode_doc = 1 |
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
407 let g:pymode_doc_bind = 'K' |
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
408 |
b09d451f3516
Okay let's try PythonMode again.
Ludovic Chabant <ludovic@chabant.com>
parents:
306
diff
changeset
|
409 let g:pymode_virtualenv = 0 |
178 | 410 |
314 | 411 let g:pymode_rope = 0 |
412 | |
178 | 413 " }}} |
414 | |
379
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
415 " Lightline {{{ |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
416 let g:lightline = { |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
417 \'colorscheme': 'solarized', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
418 \'active': { |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
419 \ '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
|
420 \ ['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
|
421 \ ['ctrlpmark'] ], |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
422 \ 'right': [ ['lineinfo'], |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
423 \ ['percent'], |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
424 \ ['fileformat', 'fileencoding', 'filetype'], |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
425 \ ['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
|
426 \ }, |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
427 \'component_function': { |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
428 \ 'fugitive': '_LightlineFugitive', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
429 \ 'lawrencium': '_LightlineLawrencium', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
430 \ 'ctrlpmark': '_LightlineCtrlPMark', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
431 \ }, |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
432 \'component_expand': { |
444 | 433 \ 'syntastic': '_LightlineLinter', |
379
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
434 \ 'ycm_errs': '_LightlineYcmErrors', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
435 \ 'ycm_warns': '_LightlineYcmWarnings', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
436 \ 'gutentags': '_LightlineGutentags', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
437 \ }, |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
438 \'component_type': { |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
439 \ 'syntastic': 'error', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
440 \ 'ycm_errs': 'error', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
441 \ 'ycm_warns': 'warning', |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
442 \ 'gutentags': 'warning', |
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 \} |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
445 |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
446 function! _LightlineFugitive() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
447 return fugitive#head() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
448 endfunction |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
449 |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
450 function! _LightlineLawrencium() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
451 return lawrencium#statusline() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
452 endfunction |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
453 |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
454 function! _LightlineCtrlPMark() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
455 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
|
456 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
|
457 return lightline#concatenate( |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
458 \['WAT?', g:lightline.ctrlp_prev, |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
459 \ g:lightline.ctrlp_item, |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
460 \ g:lightline.ctrlp_next], |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
461 \0) |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
462 else |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
463 return '' |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
464 endif |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
465 endfunction |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
466 |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
467 function! _LightlineGutentags() |
430
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
468 return gutentags#statusline('', '', '♨') |
379
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
469 endfunction |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
470 |
444 | 471 if s:HasPlugin('syntastic') |
472 function! _LightlineLinter() | |
473 return SyntasticStatuslineFlag() | |
474 endfunction | |
475 else | |
476 function! _LightlineLinter() abort | |
477 let l:counts = ale#statusline#Count(bufnr('')) | |
478 | |
479 let l:all_errors = l:counts.error + l:counts.style_error | |
480 let l:all_non_errors = l:counts.total - l:all_errors | |
481 | |
482 return l:counts.total == 0 ? 'OK' : printf( | |
483 \ '%dW %dE', | |
484 \ all_non_errors, | |
485 \ all_errors | |
486 \) | |
487 endfunction | |
488 endif | |
379
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
489 |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
490 function! _LightlineYcmErrors() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
491 let l:cnt = youcompleteme#GetErrorCount() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
492 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
|
493 endfunction |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
494 |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
495 function! _LightlineYcmWarnings() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
496 let l:cnt = youcompleteme#GetWarningCount() |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
497 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
|
498 endfunction |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
499 " }}} |
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
500 |
386
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
501 " YouCompleteMe {{{ |
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 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
|
504 |
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
505 " }}} |
b570ad9917c0
Add local pre-override for vimrc. Bunch of other vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
381
diff
changeset
|
506 |
178 | 507 " }}} |
508 | |
73
39a7e05637d8
Added 80 chars limit to text/markdown files.
Ludovic Chabant <ludovic@chabant.com>
parents:
67
diff
changeset
|
509 " File-Specific Settings {{{ |
39a7e05637d8
Added 80 chars limit to text/markdown files.
Ludovic Chabant <ludovic@chabant.com>
parents:
67
diff
changeset
|
510 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
511 augroup VimRCFileType_markdown |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
512 au! |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
513 autocmd FileType text,markdown setlocal textwidth=80 |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
514 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
|
515 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
|
516 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
|
517 autocmd FileType markdown nnoremap <buffer> <localleader>4 mzI####<space><esc>`z5l |
176 | 518 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
519 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
|
520 autocmd BufRead,BufNewFile */_content/**/*.html set ft=piecrustmarkdown |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
521 augroup END |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
522 |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
523 augroup VimRCFileType_php |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
524 au! |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
525 " Who the hell changes my matchpairs? |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
526 autocmd FileType php setlocal matchpairs-=<:> |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
527 augroup END |
83 | 528 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
529 augroup VimRCFileType_c |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
530 au! |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
531 autocmd FileType c,c++,cpp setlocal foldmethod=syntax |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
532 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
|
533 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
|
534 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
|
535 augroup END |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
536 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
537 augroup VimRCFileType_csharp |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
538 au! |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
539 autocmd BufNewFile,BufRead *.xaml setlocal filetype=xml |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
540 autocmd FileType cs setlocal foldmethod=syntax |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
541 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
|
542 autocmd FileType cs setlocal synmaxcol=200 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
543 augroup END |
83 | 544 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
545 augroup VimRCFileType_css |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
546 au! |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
547 autocmd BufNewFile,BufRead *.less setlocal filetype=less |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
548 autocmd Filetype less,css setlocal foldmethod=marker |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
549 autocmd Filetype less,css setlocal foldmarker={,} |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
550 autocmd Filetype less,css setlocal iskeyword+=- |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
551 autocmd Filetype less,css setlocal omnifunc=csscomplete#CompleteCSS |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
552 augroup END |
160 | 553 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
554 augroup VimRCTrailingWhitespaces |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
555 au! |
287
44c9d65cfa74
Readjust some Vim config stuff around folding.
Ludovic Chabant <ludovic@chabant.com>
parents:
286
diff
changeset
|
556 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
|
557 augroup END |
73
39a7e05637d8
Added 80 chars limit to text/markdown files.
Ludovic Chabant <ludovic@chabant.com>
parents:
67
diff
changeset
|
558 |
39a7e05637d8
Added 80 chars limit to text/markdown files.
Ludovic Chabant <ludovic@chabant.com>
parents:
67
diff
changeset
|
559 " }}} |
39a7e05637d8
Added 80 chars limit to text/markdown files.
Ludovic Chabant <ludovic@chabant.com>
parents:
67
diff
changeset
|
560 |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
561 " Mappings {{{ |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
562 |
42
6b831735c092
Added french keymap support.
Ludovic Chabant <ludovic@chabant.com>
parents:
18
diff
changeset
|
563 let mapleader="," |
43
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
564 |
76
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
565 " Visual line navigation |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
566 noremap <up> g<up> |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
567 noremap <down> g<down> |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
568 noremap <home> g<home> |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
569 noremap <end> g<end> |
990968329a9b
Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents:
73
diff
changeset
|
570 |
367 | 571 noremap <S-up> 20<up> |
572 noremap <S-down> 20<down> | |
573 | |
169
4947d1f99b72
Better tab/buffer navigation.
Ludovic Chabant <ludovic@chabant.com>
parents:
163
diff
changeset
|
574 " Tab navigation |
178 | 575 noremap <C-Tab> :tabnext<cr> |
576 noremap <C-S-Tab> :tabprevious<cr> | |
304
50fbd059a6a1
More Vim customizations.
Ludovic Chabant <ludovic@chabant.com>
parents:
303
diff
changeset
|
577 nnoremap <leader>t :tabnew<cr> |
169
4947d1f99b72
Better tab/buffer navigation.
Ludovic Chabant <ludovic@chabant.com>
parents:
163
diff
changeset
|
578 |
80
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
579 " Window navigation |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
580 nnoremap <C-up> :wincmd k<cr> |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
581 nnoremap <C-down> :wincmd j<cr> |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
582 nnoremap <C-left> :wincmd h<cr> |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
583 nnoremap <C-right> :wincmd l<cr> |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
584 |
176 | 585 " Switch buffers. |
420 | 586 nnoremap <F1> :execute ("buffer " . bufname("#"))<cr> |
83 | 587 |
176 | 588 " NERDTree. |
420 | 589 nnoremap <F2> :call <SID>ToggleNERDTree()<cr> |
590 nnoremap <C-F2> :call <SID>FindInNERDTree()<cr> | |
443
4ca0b1413199
Some new cool Vim things.
Ludovic Chabant <ludovic@chabant.com>
parents:
442
diff
changeset
|
591 nnoremap <leader>e :e %:h<cr> |
83 | 592 |
157
7fd22eb11789
Added `tagbar` for Vim, with keyboard shortcut.
Ludovic Chabant <ludovic@chabant.com>
parents:
155
diff
changeset
|
593 " Tagbar. |
420 | 594 nnoremap <F3> :TagbarToggle<cr> |
595 nnoremap <C-F3> :TagbarOpenAutoClose<cr> | |
157
7fd22eb11789
Added `tagbar` for Vim, with keyboard shortcut.
Ludovic Chabant <ludovic@chabant.com>
parents:
155
diff
changeset
|
596 |
186
01304e9b4c19
Re-add Gundo mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
185
diff
changeset
|
597 " Gundo. |
420 | 598 nnoremap <F4> :GundoToggle<cr> |
599 | |
600 " F5 to F8 are available for context-dependent mappings. | |
601 | |
602 " Jump to tags by keeping things better in view. Option for jumping to a tag | |
603 " in a split window where everything is folded except what you need to see. | |
604 " Note that if a tag search yield multiple possible results, we will still run | |
605 " some of that `zvzz` stuff, but that's OK, the main point is to not mess up | |
606 " the result selection window either. | |
607 " | |
608 " Go back after checking out a tag. | |
609 nnoremap <F9> :pop<CR> | |
610 " Go check out a tag. | |
611 nnoremap <F10> g<C-]>zvzz | |
612 " Go check out a tag in a split window. | |
613 nnoremap <S-F10> <C-W>vg<C-]>zMzvzz | |
614 " Move to previous matching tag. | |
615 nnoremap <C-F9> :tprevious<CR> | |
616 " Move to next matching tag. | |
617 nnoremap <C-F10> :tnext<CR> | |
186
01304e9b4c19
Re-add Gundo mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
185
diff
changeset
|
618 |
83 | 619 " Common typos. |
620 nnoremap ; : | |
621 | |
80
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
622 " Split windows |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
623 nnoremap <leader>s :split<cr> |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
624 nnoremap <leader>v :vsplit<cr> |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
625 |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
626 " Easier things to type |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
627 nnoremap <leader>w :w<cr> |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
628 nnoremap <leader>q :q<cr> |
119 | 629 nnoremap <leader>hh :Hg |
630 nnoremap <leader>hg :Hg! | |
112 | 631 nnoremap <leader>hs :Hgstatus<cr> |
632 nnoremap <leader>hv :Hgvdiff<cr> | |
80
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
633 |
114
ccc3902408d2
Fix the hash key in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
113
diff
changeset
|
634 " Make the hash-key not suck. |
ccc3902408d2
Fix the hash key in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
113
diff
changeset
|
635 inoremap # X<BS># |
ccc3902408d2
Fix the hash key in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
113
diff
changeset
|
636 |
80
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
637 " Toggle invisible characters |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
638 nnoremap <leader>i :set list!<cr> |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
639 |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
640 " Clear search matches |
121bef55252f
Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
641 nnoremap <leader><space> :noh<cr>:call clearmatches()<cr> |
43
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
642 |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
643 " Switch between FR and US keyboard layouts. |
119 | 644 nnoremap <C-l>f :setlocal keymap=french<cr> |
645 nnoremap <C-l>u :setlocal keymap=<cr> | |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
646 |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
647 " Toggle spell check according to current keyboard layout. |
119 | 648 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
|
649 |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
650 " 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
|
651 nnoremap <leader>d :bprevious<cr>:bdelete #<cr> |
43
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
652 |
119 | 653 " Use sane regexes. |
654 nnoremap / /\v | |
655 vnoremap / /\v | |
656 | |
452
d048318ba839
Better indenting in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
445
diff
changeset
|
657 " Don't lose visual selection when you indent/unindent. |
d048318ba839
Better indenting in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
445
diff
changeset
|
658 vnoremap > >gv |
d048318ba839
Better indenting in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
445
diff
changeset
|
659 vnoremap < <gv |
d048318ba839
Better indenting in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents:
445
diff
changeset
|
660 |
289
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
661 " 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
|
662 " 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
|
663 nnoremap ]q :cnext<cr>zvzz |
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
664 nnoremap [q :cprevious<cr>zvzz |
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
665 nnoremap ]l :lnext<cr>zvzz |
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
666 nnoremap [l :lprevious<cr>zvzz |
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
667 |
304
50fbd059a6a1
More Vim customizations.
Ludovic Chabant <ludovic@chabant.com>
parents:
303
diff
changeset
|
668 " Same with change and jump lists. |
367 | 669 nnoremap ]e g,zz |
670 nnoremap [e g;zz | |
304
50fbd059a6a1
More Vim customizations.
Ludovic Chabant <ludovic@chabant.com>
parents:
303
diff
changeset
|
671 nnoremap ]j <C-I> |
50fbd059a6a1
More Vim customizations.
Ludovic Chabant <ludovic@chabant.com>
parents:
303
diff
changeset
|
672 nnoremap [j <C-O> |
289
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
673 |
367 | 674 " 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
|
675 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
|
676 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
|
677 nnoremap <leader>cw :let @+ = getcwd()<cr>:echo @+<cr> |
367 | 678 |
303
01ec865443b6
Update NERDTree macros and tweak more Vim stuff.
Ludovic Chabant <ludovic@chabant.com>
parents:
294
diff
changeset
|
679 " Make the diff navigation also center things. |
289
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
680 nnoremap ]c ]czvzz |
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
681 nnoremap [c [czvzz |
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
682 |
103
a755319f124e
Added mappings for substitutions.
Ludovic Chabant <ludovic@chabant.com>
parents:
101
diff
changeset
|
683 " Quick search and replace. |
119 | 684 function! s:VSetSearch() |
294
8bc056d80c39
Remove unused stuff, add grepping, shorter status line.
Ludovic Chabant <ludovic@chabant.com>
parents:
291
diff
changeset
|
685 let temp = @@ |
8bc056d80c39
Remove unused stuff, add grepping, shorter status line.
Ludovic Chabant <ludovic@chabant.com>
parents:
291
diff
changeset
|
686 norm! gvy |
8bc056d80c39
Remove unused stuff, add grepping, shorter status line.
Ludovic Chabant <ludovic@chabant.com>
parents:
291
diff
changeset
|
687 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
|
688 let @@ = temp |
119 | 689 endfunction |
690 vnoremap * :<C-u>call <SID>VSetSearch()<CR>//<CR><c-o> | |
691 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
|
692 |
206 | 693 " 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
|
694 nnoremap n nzvzz |
8b6ca7e40f37
Making jumping around in Vim nicer.
Ludovic Chabant <ludovic@chabant.com>
parents:
288
diff
changeset
|
695 nnoremap N Nzvzz |
206 | 696 |
430
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
697 " Writing mode. |
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
698 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
|
699 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
|
700 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
|
701 |
379
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
702 " YCM mappings. |
420 | 703 if s:HasPlugin('youcompleteme') |
426
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
704 augroup VimRC_YouCompleteMe |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
705 autocmd! |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
706 autocmd FileType cpp nnoremap <Leader>jj :YcmCompleter GoToImprecise<cr>zv |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
707 autocmd FileType cpp nnoremap <Leader>jd :YcmCompleter GoToDefinition<cr>zv |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
708 autocmd FileType cpp nnoremap <Leader>jh :YcmCompleter GoToDeclaration<cr>zv |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
709 autocmd FileType cpp nnoremap <Leader>ji :YcmCompleter GoToInclude<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
710 autocmd FileType cpp nnoremap <Leader>jc :YcmCompleter GetDoc<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
711 autocmd FileType cpp nnoremap <Leader>je :YcmShowDetailedDiagnostic<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
712 augroup END |
420 | 713 endif |
397
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
714 |
c32b9b172314
Specify YCM/OmniSharp mappings only for specific file types.
Ludovic Chabant <ludovic@chabant.com>
parents:
392
diff
changeset
|
715 " OmniSharp mappings |
420 | 716 if s:HasPlugin('OmniSharp') |
426
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
717 augroup VimRC_OmniSharp |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
718 autocmd! |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
719 autocmd FileType cs setlocal omnifunc=OmniSharp#Complete |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
720 autocmd BufEnter,TextChanged,InsertLeave *.cs SyntasticCheck |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
721 autocmd CursorHold *.cs call OmniSharp#TypeLookupWithoutDocumentation() |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
722 autocmd FileType cs nnoremap <Leader>jj :OmniSharpGotoDefinition<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
723 autocmd FileType cs nnoremap <Leader>x :OmniSharpFixIssue<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
724 autocmd FileType cs nnoremap <Leader>fx :OmniSharpFixUsings<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
725 autocmd FileType cs nnoremap <Leader>tt :OmniSharpTypeLookup<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
726 autocmd FileType cs nnoremap <Leader>dc :OmniSharpDocumentation<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
727 augroup END |
420 | 728 endif |
379
58410650ce36
Add lightline and remove old scratch. Customize Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
373
diff
changeset
|
729 |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
730 " ProjectRoot mappings |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
731 let s:no_auto_projectroot_buftypes = [ |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
732 \'help', 'nofile', 'quickfix'] |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
733 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
734 function! s:AutoProjectRootCD() abort |
426
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
735 try |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
736 if index(s:no_auto_projectroot_buftypes, &buftype) == -1 |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
737 ProjectRootCD |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
738 endif |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
739 catch |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
740 " Silently ignore invalid buffers |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
741 endtry |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
742 endfunction |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
743 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
744 augroup VimRC_ProjectRoot |
426
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
745 autocmd! |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
746 autocmd BufEnter * call <SID>AutoProjectRootCD() |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
747 augroup END |
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 nnoremap <leader>cd :ProjectRootCD<cr> |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
750 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
751 " Ctrl-P mappings. |
420 | 752 if s:HasPlugin('ctrlp') |
426
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
753 nnoremap <silent> <C-p> :CtrlP<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
754 nnoremap <silent> <C-o> :CtrlPBuffer<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
755 nnoremap <silent> <C-u> :CtrlPTag<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
756 nnoremap <silent> <C-y> :CtrlPBufTag<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
757 nnoremap <silent> <Tab> :CtrlPMRUFiles<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
758 nnoremap <silent> <F8> :CtrlPBookmarkDir<cr> |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
759 endif |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
760 |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
761 " FZF mappings. |
420 | 762 if s:HasPlugin('fzf') |
426
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
763 if exists('*fzf#run') |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
764 nnoremap <silent> <C-p> :Files<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
765 nnoremap <silent> <C-o> :Buffers<cr> |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
766 nnoremap <Tab> :History<cr> |
435
b7682004288d
Move Vim stuff to autoload, add FZF tags lister.
Ludovic Chabant <ludovic@chabant.com>
parents:
430
diff
changeset
|
767 |
b7682004288d
Move Vim stuff to autoload, add FZF tags lister.
Ludovic Chabant <ludovic@chabant.com>
parents:
430
diff
changeset
|
768 " 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
|
769 " 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
|
770 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
|
771 nnoremap <silent> <C-u> :Tags<cr> |
426
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
772 else |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
773 call ludo#error( |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
774 \"FZF is installed and enabled, but the Vim plugin ". |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
775 \"isn't loaded... add it to your `vimrc-local-pre`.") |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
776 endif |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
777 endif |
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
778 |
445
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
779 " LeaderF mappings. |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
780 if s:HasPlugin('leaderf') |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
781 let g:Lf_ShortcutF = '<C-p>' |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
782 let g:Lf_ShortcutB = '<C-o>' |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
783 nnoremap <silent> <C-p> :LeaderfFile<cr> |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
784 nnoremap <silent> <C-o> :LeaderfBuffer<cr> |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
785 nnoremap <silent> <C-u> :LeaderfTag<cr> |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
786 nnoremap <silent> <C-y> :LeaderfBufTagAll<cr> |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
787 nnoremap <silent> <Tab> :LeaderfMru<cr> |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
788 |
453 | 789 nnoremap <silent> <Leader>fl :LeaderfLine<cr> |
790 nnoremap <silent> <Leader>fc :LeaderfColorscheme<cr> | |
791 nnoremap <silent> <Leader>fh :LeaderfHelp<cr> | |
792 | |
445
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
793 let g:Lf_StlSeparator = { 'left': '', 'right': '' } |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
794 endif |
05ab0353cd6e
Add config for `cpsm` and `Leaderf`.
Ludovic Chabant <ludovic@chabant.com>
parents:
444
diff
changeset
|
795 |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
796 " }}} |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
797 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
798 " Folding {{{ |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
799 |
367 | 800 " Start with one level of open. |
801 set foldlevel=1 | |
802 | |
385 | 803 " Don't fold too much. |
804 set foldnestmax=2 | |
805 | |
287
44c9d65cfa74
Readjust some Vim config stuff around folding.
Ludovic Chabant <ludovic@chabant.com>
parents:
286
diff
changeset
|
806 " Folds are defined by markers in the text. |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
807 set foldmethod=marker"{{{"}}} |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
808 |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
809 " Toggle folds with <space>. |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
810 nnoremap <space> za |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
811 |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
812 " Create folds with <space> (in visual mode). |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
813 vnoremap <space> zf |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
814 |
413
4a2468f72e44
Optimize C++ file editing with some folding tricks.
Ludovic Chabant <ludovic@chabant.com>
parents:
410
diff
changeset
|
815 " 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
|
816 " 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
|
817 " 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
|
818 " 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
|
819 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
|
820 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
|
821 |
204
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
822 " }}} |
4bd15b5afcfc
Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents:
201
diff
changeset
|
823 |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
824 " Abbreviations {{{ |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
825 |
43
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
826 iabbrev @@ ludovic@chabant.com |
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
827 iabbrev ccopy Copyright ©2011 Ludovic Chabant, all rights reserved. |
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
828 iabbrev ssig --<cr>l u d o .<cr>. 8 0 17 80 |
0 | 829 |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
830 " }}} |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
831 |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
832 " Functions {{{ |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
833 |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
834 function! s:ToggleSpellCheck() abort |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
835 if &spell ==? 'nospell' |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
836 if &keymap ==? 'french' |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
837 setlocal spell spelllang=fr_fr |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
838 else |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
839 setlocal spell spelllang=en_us,en_ca |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
840 endif |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
841 else |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
842 setlocal spell nospell |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
843 endif |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
844 endfunction |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
845 |
160 | 846 function! s:StripTrailingWhitespaces() abort |
847 let l = line(".") | |
848 let c = col(".") | |
849 %s/\s\+$//e | |
850 call cursor(l, c) | |
851 endfunction | |
852 | |
176 | 853 function! s:ToggleNERDTree() abort |
854 NERDTreeToggle | |
855 endfunction | |
856 | |
857 function! s:FindInNERDTree() abort | |
410
5bbd5963591c
Some Vim config tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents:
397
diff
changeset
|
858 ProjectRootExe NERDTreeFind |
332 | 859 normal zz |
176 | 860 endfunction |
861 | |
413
4a2468f72e44
Optimize C++ file editing with some folding tricks.
Ludovic Chabant <ludovic@chabant.com>
parents:
410
diff
changeset
|
862 function! s:ToggleCppFolding() abort |
426
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
863 if (&foldmethod == "syntax") |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
864 setlocal foldmethod=manual |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
865 setlocal nofoldenable |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
866 else |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
867 setlocal foldmethod=syntax |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
868 setlocal foldenable |
67f14a8c2304
Improve Vim configuration.
Ludovic Chabant <ludovic@chabant.com>
parents:
424
diff
changeset
|
869 endif |
413
4a2468f72e44
Optimize C++ file editing with some folding tricks.
Ludovic Chabant <ludovic@chabant.com>
parents:
410
diff
changeset
|
870 endfunction |
4a2468f72e44
Optimize C++ file editing with some folding tricks.
Ludovic Chabant <ludovic@chabant.com>
parents:
410
diff
changeset
|
871 |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
872 " }}} |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
873 |
171
7559d8bc39bb
Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
169
diff
changeset
|
874 " Local override {{{ |
7559d8bc39bb
Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
169
diff
changeset
|
875 |
435
b7682004288d
Move Vim stuff to autoload, add FZF tags lister.
Ludovic Chabant <ludovic@chabant.com>
parents:
430
diff
changeset
|
876 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
|
877 if filereadable(s:local_vimrc) |
71a080d4d83c
Vim stuff: Goyo writing mode, Ack with Ag.
Ludovic Chabant <ludovic@chabant.com>
parents:
426
diff
changeset
|
878 execute 'source' s:local_vimrc |
171
7559d8bc39bb
Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
169
diff
changeset
|
879 endif |
7559d8bc39bb
Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
169
diff
changeset
|
880 |
7559d8bc39bb
Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
169
diff
changeset
|
881 " }}} |
7559d8bc39bb
Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents:
169
diff
changeset
|
882 |