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