annotate vim/vimrc @ 218:b87391429145

Use the `ctagsrc` file with Gutentags.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 11 Sep 2014 23:14:29 -0700
parents 6ee245fa8a3d
children 738c1a3ad786
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
1 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
2 "
0
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
3 " Ludovic Chabant's ~/.vimrc
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
4 "
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
5 " http://ludovic.chabant.com
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
6 "
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
7 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
0
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
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
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
11 " Use Vim settings, rather then Vi settings (much better!).
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
12 " This must be first, because it changes other options as a side effect.
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
13 set nocompatible
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
14
45
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
15 " Set a variable that says we already sourced this file, for those few
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
16 " settings we don't want to re-apply.
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
17 if exists('g:sourced_vimrc')
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
18 let g:resourcing_vimrc = 1
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
19 endif
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
20 let g:sourced_vimrc = 1
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
21
83
a54180045075 Vimrc changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 80
diff changeset
22 " Get the platform we're running on.
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
23 if has("win32") || has("win64") || has("dos32")
83
a54180045075 Vimrc changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 80
diff changeset
24 let s:vim_platform = "windows"
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
25 else
83
a54180045075 Vimrc changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 80
diff changeset
26 let s:vim_platform = "unix"
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
27 endif
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
28
83
a54180045075 Vimrc changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 80
diff changeset
29 " Get our vim directory.
95
b96ff0dd0137 Fixed the generated vimrc's runtimepath.
Ludovic Chabant <ludovic@chabant.com>
parents: 83
diff changeset
30 let s:vim_home = expand("<sfile>:h")
83
a54180045075 Vimrc changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 80
diff changeset
31
127
1f709d7e03c6 Better Python dev in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents: 118
diff changeset
32 " 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
33 syntax off
1f709d7e03c6 Better Python dev in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents: 118
diff changeset
34 filetype off
1f709d7e03c6 Better Python dev in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents: 118
diff changeset
35
18
cec2213f938c Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 13
diff changeset
36 " Disable some plugins.
cec2213f938c Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 13
diff changeset
37 let g:pathogen_disabled = []
45
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
38 call add(g:pathogen_disabled, 'vimroom')
76
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
39 call add(g:pathogen_disabled, 'minibufexpl')
127
1f709d7e03c6 Better Python dev in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents: 118
diff changeset
40 call add(g:pathogen_disabled, 'ragtag')
18
cec2213f938c Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 13
diff changeset
41
0
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
42 " Load pathogen.
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
43 call pathogen#infect()
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
44
10
00cac5ebf546 Added default window size. Added buffer keyboard shortcuts.
ludovicchabant
parents: 6
diff changeset
45 " 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
46 if has("gui_running") && !exists('g:resourcing_vimrc')
0
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
47 set guioptions=-t
10
00cac5ebf546 Added default window size. Added buffer keyboard shortcuts.
ludovicchabant
parents: 6
diff changeset
48 set lines=50
00cac5ebf546 Added default window size. Added buffer keyboard shortcuts.
ludovicchabant
parents: 6
diff changeset
49 set columns=135
0
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
50 endif
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
51
59
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
52 " }}}
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
53
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
54 " General Settings {{{
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
55
135
db9d5fe86723 Enable modelines.
Ludovic Chabant <ludovic@chabant.com>
parents: 131
diff changeset
56 " Restrict modelines.
db9d5fe86723 Enable modelines.
Ludovic Chabant <ludovic@chabant.com>
parents: 131
diff changeset
57 set modelines=1
18
cec2213f938c Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 13
diff changeset
58
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
59 " Don't unload abandoned buffers.
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
60 set hidden
0
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
61
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
62 " Show line numbers.
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
63 set number
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
64
18
cec2213f938c Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 13
diff changeset
65 " 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
66 set showmode
cec2213f938c Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 13
diff changeset
67 set showcmd
cec2213f938c Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 13
diff changeset
68
cec2213f938c Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 13
diff changeset
69 " Keep the cursor off the top/bottom edges.
cec2213f938c Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 13
diff changeset
70 set scrolloff=3
cec2213f938c Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 13
diff changeset
71
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
72 " Smart auto-indenting.
0
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
73 set autoindent
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
74 set smartindent
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
75
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
76 " Use confirmation dialog.
0
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
77 set confirm
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
78
76
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
79 " Don't use annoying sounds.
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
80 set visualbell
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
81
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
82 " Remember lots of commands.
0
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
83 set history=1000
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
84
76
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
85 " Try to reduce flickering.
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
86 set lazyredraw
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
87
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
88 " Show matching braces but not for too long.
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
89 set showmatch
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
90 set matchtime=2
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
91
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
92 " Show soft-broken/wrapped lines with a prefix.
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
93 set showbreak=→
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
94
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
95 " Use incremental search, with highlighting,
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
96 " case-insensitive unless we actually type some
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
97 " mixed-case stuff.
0
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
98 set incsearch
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
99 set hlsearch
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
100 set ignorecase
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
101 set smartcase
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
102
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
103 " Always show window status lines.
0
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
104 set laststatus=2
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
105
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
106 " Enable using the mouse like some everyday guy.
0
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
107 set mouse=a
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
108
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
109 " Show interesting stuff at the bottom of the window.
0
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
110 set showcmd
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
111 set ruler
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
112
76
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
113 " 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
114 set splitbelow
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
115 set splitright
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
116
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
117 " Don't pollute the hard-drive with *~ files. Only
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
118 " create them in hidden backup/temp directories while
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
119 " we edit the file, and then get rid of it.
0
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
120 set nobackup
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
121 set writebackup
83
a54180045075 Vimrc changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 80
diff changeset
122 execute('set backupdir='.s:vim_home.'/backup')
a54180045075 Vimrc changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 80
diff changeset
123 execute('set directory='.s:vim_home.'/temp')
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
124
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
125 " Better command-line completion, but don't show some
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
126 " stuff we don't care about.
0
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
127 set wildmenu
193
ae53d68033d9 Enable fugitive and some CtrlP extensions, include a new one of my own.
Ludovic Chabant <ludovic@chabant.com>
parents: 191
diff changeset
128 set wildignore+=.DS_Store,Thumbs.db,*.so,*.dll,*.exe,*.lib,*.pdb,*.pyc,*.pyo
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
129
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
130 " Always display the tab-page line.
0
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
131 set showtabline=2
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
132
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
133 " Set the file-formats.
0
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
134 set ffs=unix,mac,dos
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
135
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
136 " Tabs and indenting are 4 characters, and tabs behave like
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
137 " spaces during editing. They're smart, too, and when you
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
138 " press <TAB> it actually inserts a soft-tab so everything's
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
139 " indented the same.
0
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
140 set tabstop=4
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
141 set shiftwidth=4
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
142 set softtabstop=4
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
143 set smarttab
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
144 set expandtab
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
145
18
cec2213f938c Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 13
diff changeset
146 " Default encoding
cec2213f938c Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 13
diff changeset
147 set encoding=utf-8
cec2213f938c Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 13
diff changeset
148
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
149 " Clipboard buffer.
0
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
150 set clipboard=unnamed
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
151
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
152 " Smoot terminal experience.
0
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
153 set ttyfast
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
154
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
155 " Allow backspacing over anything.
0
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
156 set backspace=indent,eol,start
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
157
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
158 " Going left and right let you go to other lines.
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
159 set whichwrap+=<,>,h,l
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
160
93
822fc8b4405f Invisible characters in vimrc.
Ludovic Chabant <ludovic@chabant.com>
parents: 92
diff changeset
161 " How to show invisible characters
822fc8b4405f Invisible characters in vimrc.
Ludovic Chabant <ludovic@chabant.com>
parents: 92
diff changeset
162 set listchars=eol:$,tab:>-,trail:-,extends:>,precedes:<,nbsp:%,conceal:.
822fc8b4405f Invisible characters in vimrc.
Ludovic Chabant <ludovic@chabant.com>
parents: 92
diff changeset
163
59
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
164 " Folds are defined by markers in the text.
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
165 set foldmethod=marker
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
166
80
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
167 " Nice auto-complete menu.
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
168 set completeopt=longest,menuone,preview
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
169
121
c6f0172aac8d Add nice column indicators in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents: 119
diff changeset
170 " Column indicators.
c6f0172aac8d Add nice column indicators in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents: 119
diff changeset
171 set colorcolumn=72,79
c6f0172aac8d Add nice column indicators in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents: 119
diff changeset
172
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
173 " And now, for some system-dependent settings:
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
174 " - font to use
83
a54180045075 Vimrc changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 80
diff changeset
175 if s:vim_platform == "windows"
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
176 set guifont=Consolas:h12
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
177 else
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
178 set guifont=Monaco:h12
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
179 endif
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
180
45
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
181 " Syntax highlighting.
0
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
182 syntax on
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
183
18
cec2213f938c Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 13
diff changeset
184 " Change the current directory to the home directory.
45
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
185 if !exists('g:resourcing_vimrc')
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
186 cd ~/
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
187 endif
18
cec2213f938c Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 13
diff changeset
188
45
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
189 " Default color scheme.
47
ee3d235ca3fb Added solarized.
Ludovic Chabant <ludovic@chabant.com>
parents: 45
diff changeset
190 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
191 set background=dark
47
ee3d235ca3fb Added solarized.
Ludovic Chabant <ludovic@chabant.com>
parents: 45
diff changeset
192 else
ee3d235ca3fb Added solarized.
Ludovic Chabant <ludovic@chabant.com>
parents: 45
diff changeset
193 set background=dark
217
6ee245fa8a3d Proper colors in iTerm2, and now using solarized for a change.
Ludovic Chabant <ludovic@chabant.com>
parents: 213
diff changeset
194 let g:solarized_termcolors = 256
6ee245fa8a3d Proper colors in iTerm2, and now using solarized for a change.
Ludovic Chabant <ludovic@chabant.com>
parents: 213
diff changeset
195 "let g:solarized_termtrans = 1
47
ee3d235ca3fb Added solarized.
Ludovic Chabant <ludovic@chabant.com>
parents: 45
diff changeset
196 endif
217
6ee245fa8a3d Proper colors in iTerm2, and now using solarized for a change.
Ludovic Chabant <ludovic@chabant.com>
parents: 213
diff changeset
197 colorscheme solarized
6
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
198
f8792d288397 Big vimrc update.
ludovicchabant
parents: 0
diff changeset
199 " Enable file type detection.
0
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
200 filetype indent plugin on
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
201
59
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
202 " }}}
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
203
76
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
204 " Auto-Commands {{{
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
205
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
206 " 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
207 augroup CursorLine
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
208 au!
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
209 au WinLeave * set nocursorline
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
210 au WinEnter * set cursorline
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
211 augroup END
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
212
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
213 " }}}
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
214
59
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
215 " Plugin Settings {{{
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
216
178
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
217 " Ctrl-P {{{
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
218
80
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
219 " We'll set our own mappings.
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
220 let g:ctrlp_map = ''
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
221
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
222 " 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
223 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
224
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
225 " Ctrl-P should however ignore some stuff.
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
226 let g:ctrlp_custom_ignore = {
163
925df140ae95 Commands to toggle Lawrencium logging.
Ludovic Chabant <ludovic@chabant.com>
parents: 162
diff changeset
227 \ 'dir': '\v[\/](\.git|\.hg|\.svn|venv|build|static|node_modules)$'
80
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
228 \ }
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
229
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
230 " Make Ctrl-P cache stuff in our temp directory.
83
a54180045075 Vimrc changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 80
diff changeset
231 let g:ctrlp_cache_dir = s:vim_home.'/cache'
10
00cac5ebf546 Added default window size. Added buffer keyboard shortcuts.
ludovicchabant
parents: 6
diff changeset
232
197
4d34bf15a478 Don't clear CtrlP cache on exit, fix Windows issues.
Ludovic Chabant <ludovic@chabant.com>
parents: 193
diff changeset
233 " Remember things.
4d34bf15a478 Don't clear CtrlP cache on exit, fix Windows issues.
Ludovic Chabant <ludovic@chabant.com>
parents: 193
diff changeset
234 let g:ctrlp_clear_cache_on_ext = 0
4d34bf15a478 Don't clear CtrlP cache on exit, fix Windows issues.
Ludovic Chabant <ludovic@chabant.com>
parents: 193
diff changeset
235
193
ae53d68033d9 Enable fugitive and some CtrlP extensions, include a new one of my own.
Ludovic Chabant <ludovic@chabant.com>
parents: 191
diff changeset
236 " Enable some cool extensions.
ae53d68033d9 Enable fugitive and some CtrlP extensions, include a new one of my own.
Ludovic Chabant <ludovic@chabant.com>
parents: 191
diff changeset
237 let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'mixed']
ae53d68033d9 Enable fugitive and some CtrlP extensions, include a new one of my own.
Ludovic Chabant <ludovic@chabant.com>
parents: 191
diff changeset
238
ae53d68033d9 Enable fugitive and some CtrlP extensions, include a new one of my own.
Ludovic Chabant <ludovic@chabant.com>
parents: 191
diff changeset
239 " Initialize other custom extensions.
ae53d68033d9 Enable fugitive and some CtrlP extensions, include a new one of my own.
Ludovic Chabant <ludovic@chabant.com>
parents: 191
diff changeset
240 call ctrlpext#autoignore#init()
ae53d68033d9 Enable fugitive and some CtrlP extensions, include a new one of my own.
Ludovic Chabant <ludovic@chabant.com>
parents: 191
diff changeset
241
178
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
242 " }}}
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
243
213
769869e61101 Renamed autotags to gutentags.
Ludovic Chabant <ludovic@chabant.com>
parents: 212
diff changeset
244 " Gutentags {{{
206
dae926f52b9a Some Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
245
213
769869e61101 Renamed autotags to gutentags.
Ludovic Chabant <ludovic@chabant.com>
parents: 212
diff changeset
246 let g:gutentags_exclude = ['venv', 'build', 'static', 'node_modules']
769869e61101 Renamed autotags to gutentags.
Ludovic Chabant <ludovic@chabant.com>
parents: 212
diff changeset
247 let g:gutentags_cache_dir = s:vim_home.'/tags'
218
b87391429145 Use the `ctagsrc` file with Gutentags.
Ludovic Chabant <ludovic@chabant.com>
parents: 217
diff changeset
248 let g:gutentags_options_file = s:vim_home.'/ctagsrc'
206
dae926f52b9a Some Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
249
dae926f52b9a Some Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
250 " }}}
dae926f52b9a Some Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
251
178
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
252 " Syntastic {{{
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
253
127
1f709d7e03c6 Better Python dev in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents: 118
diff changeset
254 " Use `pyflakes` with `syntastic`.
206
dae926f52b9a Some Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
255 "let g:syntastic_python_checkers = ['pyflakes']
178
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
256
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
257 " }}}
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
258
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
259 " Lawrencium {{{
118
c1ff96232138 New settings for Lawrencium.
Ludovic Chabant <ludovic@chabant.com>
parents: 114
diff changeset
260
127
1f709d7e03c6 Better Python dev in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents: 118
diff changeset
261 " Custom Mercurial commands highlighting in Lawrencium.
118
c1ff96232138 New settings for Lawrencium.
Ludovic Chabant <ludovic@chabant.com>
parents: 114
diff changeset
262 let g:lawrencium_hg_commands_file_types = {
c1ff96232138 New settings for Lawrencium.
Ludovic Chabant <ludovic@chabant.com>
parents: 114
diff changeset
263 \'clog': 'hggraphlog'
c1ff96232138 New settings for Lawrencium.
Ludovic Chabant <ludovic@chabant.com>
parents: 114
diff changeset
264 \}
c1ff96232138 New settings for Lawrencium.
Ludovic Chabant <ludovic@chabant.com>
parents: 114
diff changeset
265
127
1f709d7e03c6 Better Python dev in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents: 118
diff changeset
266 " Make the annotate window better in Lawrencium.
206
dae926f52b9a Some Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
267 let g:lawrencium_annotate_width_offset = 1
127
1f709d7e03c6 Better Python dev in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents: 118
diff changeset
268
59
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
269 " }}}
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
270
178
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
271 " Gundo {{{
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
272
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
273 let g:gundo_map_move_older = '<Down>'
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
274 let g:gundo_map_move_newer = '<Up>'
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
275
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
276 " }}}
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
277
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
278 " YankRing {{{
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
279
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
280 let g:yankring_replace_n_pkey = '<C-K>'
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
281 let g:yankring_replace_p_pkey = '<C-J>'
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
282
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
283 " }}}
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
284
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
285 " Python-Mode {{{
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
286
204
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
287 let g:pymode = 1
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
288 let g:pymode_python = 'disable'
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
289 let g:pymode_syntax_all = 1
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
290 let g:pymode_syntax_print_as_function = 1
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
291 let g:pymode_syntax_space_errors = 1
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
292 let g:pymode_run = 0
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
293 let g:pymode_lint = 0
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
294 let g:pymode_trim_whitespaces = 0
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
295 let g:pymode_virtualenv = 0
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
296 let g:pymode_folding = 1
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
297
212
da7af1f2823c Property detect Python support in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents: 210
diff changeset
298 if !has('+python')
204
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
299 let g:pymode = 0
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
300 endif
178
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
301
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
302 " }}}
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
303
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
304 " }}}
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
305
73
39a7e05637d8 Added 80 chars limit to text/markdown files.
Ludovic Chabant <ludovic@chabant.com>
parents: 67
diff changeset
306 " File-Specific Settings {{{
39a7e05637d8 Added 80 chars limit to text/markdown files.
Ludovic Chabant <ludovic@chabant.com>
parents: 67
diff changeset
307
204
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
308 " Automatically change the current working directory based on a project
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
309 " I'm in.
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
310 augroup VimRCAutoCWD
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
311 au!
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
312 autocmd BufEnter * call s:SetProjectRootCwd()
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
313 augroup END
176
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
314
204
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
315 augroup VimRCFileType_markdown
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
316 au!
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
317 autocmd FileType text,markdown setlocal textwidth=80
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
318 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
319 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
320 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
321 autocmd FileType markdown nnoremap <buffer> <localleader>4 mzI####<space><esc>`z5l
176
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
322
204
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
323 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
324 autocmd BufRead,BufNewFile */_content/**/*.html set ft=piecrustmarkdown
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
325 augroup END
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
326
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
327 augroup VimRCFileType_php
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
328 au!
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
329 " Who the hell changes my matchpairs?
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
330 autocmd FileType php setlocal matchpairs-=<:>
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
331 augroup END
83
a54180045075 Vimrc changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 80
diff changeset
332
204
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
333 augroup VimRCFileType_c
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
334 au!
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
335 autocmd FileType c,c++ setlocal foldmethod=marker foldmarker={,}
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
336 augroup END
83
a54180045075 Vimrc changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 80
diff changeset
337
204
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
338 augroup VimRCFileType_css
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
339 au!
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
340 autocmd BufNewFile,BufRead *.less setlocal filetype=less
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
341 autocmd Filetype less,css setlocal foldmethod=marker
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
342 autocmd Filetype less,css setlocal foldmarker={,}
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
343 autocmd Filetype less,css setlocal iskeyword+=-
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
344 autocmd Filetype less,css setlocal omnifunc=csscomplete#CompleteCSS
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
345 augroup END
160
5997455e475b Whitespace cleaning.
Ludovic Chabant <ludovic@chabant.com>
parents: 157
diff changeset
346
204
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
347 augroup VimRCFileType_python
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
348 au!
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
349 autocmd FileType python setlocal define=\\v^\\s*(def\|class)\\s+
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
350 "autocmd FileType python if exists('python_space_error_highlight')|unlet python_space_error_highlight|endif
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
351 augroup END
160
5997455e475b Whitespace cleaning.
Ludovic Chabant <ludovic@chabant.com>
parents: 157
diff changeset
352
204
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
353 augroup VimRCTrailingWhitespaces
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
354 au!
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
355 autocmd FileType c,cpp,java,php,ruby,python,js,css,less autocmd BufWritePre <buffer> :call <SID>StripTrailingWhitespaces()
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
356 augroup END
73
39a7e05637d8 Added 80 chars limit to text/markdown files.
Ludovic Chabant <ludovic@chabant.com>
parents: 67
diff changeset
357
39a7e05637d8 Added 80 chars limit to text/markdown files.
Ludovic Chabant <ludovic@chabant.com>
parents: 67
diff changeset
358 " }}}
39a7e05637d8 Added 80 chars limit to text/markdown files.
Ludovic Chabant <ludovic@chabant.com>
parents: 67
diff changeset
359
59
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
360 " Mappings {{{
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
361
42
6b831735c092 Added french keymap support.
Ludovic Chabant <ludovic@chabant.com>
parents: 18
diff changeset
362 let mapleader=","
43
25e8b2fffd50 Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 42
diff changeset
363
76
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
364 " Visual line navigation
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
365 noremap <up> g<up>
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
366 noremap <down> g<down>
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
367 noremap <home> g<home>
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
368 noremap <end> g<end>
990968329a9b Disabled minibufexpl for a while.
Ludovic Chabant <ludovic@chabant.com>
parents: 73
diff changeset
369
169
4947d1f99b72 Better tab/buffer navigation.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
370 " Tab navigation
178
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
371 noremap <C-Tab> :tabnext<cr>
94bf0bd0a788 Updated sub-repos.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
372 noremap <C-S-Tab> :tabprevious<cr>
169
4947d1f99b72 Better tab/buffer navigation.
Ludovic Chabant <ludovic@chabant.com>
parents: 163
diff changeset
373
80
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
374 " Window navigation
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
375 nnoremap <C-up> :wincmd k<cr>
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
376 nnoremap <C-down> :wincmd j<cr>
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
377 nnoremap <C-left> :wincmd h<cr>
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
378 nnoremap <C-right> :wincmd l<cr>
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
379
176
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
380 " Switch buffers.
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
381 nnoremap <F2> :execute ("buffer " . bufname("#"))<cr>
83
a54180045075 Vimrc changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 80
diff changeset
382
176
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
383 " NERDTree.
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
384 nnoremap <F3> :call <SID>ToggleNERDTree()<cr>
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
385 nnoremap <F4> :call <SID>FindInNERDTree()<cr>
83
a54180045075 Vimrc changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 80
diff changeset
386
157
7fd22eb11789 Added `tagbar` for Vim, with keyboard shortcut.
Ludovic Chabant <ludovic@chabant.com>
parents: 155
diff changeset
387 " Tagbar.
176
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
388 nnoremap <F5> :TagbarToggle<cr>
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
389 nnoremap <F6> :TagbarOpenAutoClose<cr>
157
7fd22eb11789 Added `tagbar` for Vim, with keyboard shortcut.
Ludovic Chabant <ludovic@chabant.com>
parents: 155
diff changeset
390
186
01304e9b4c19 Re-add Gundo mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 185
diff changeset
391 " Gundo.
01304e9b4c19 Re-add Gundo mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 185
diff changeset
392 nnoremap <F7> :GundoToggle<cr>
01304e9b4c19 Re-add Gundo mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 185
diff changeset
393
83
a54180045075 Vimrc changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 80
diff changeset
394 " Common typos.
a54180045075 Vimrc changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 80
diff changeset
395 nnoremap ; :
a54180045075 Vimrc changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 80
diff changeset
396
80
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
397 " Split windows
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
398 nnoremap <leader>s :split<cr>
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
399 nnoremap <leader>v :vsplit<cr>
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
400
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
401 " Easier things to type
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
402 nnoremap <leader>w :w<cr>
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
403 nnoremap <leader>q :q<cr>
119
6dbbf36a523d VIM changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 118
diff changeset
404 nnoremap <leader>hh :Hg
6dbbf36a523d VIM changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 118
diff changeset
405 nnoremap <leader>hg :Hg!
112
9495034e7dc4 New mappings in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents: 103
diff changeset
406 nnoremap <leader>hs :Hgstatus<cr>
9495034e7dc4 New mappings in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents: 103
diff changeset
407 nnoremap <leader>hv :Hgvdiff<cr>
80
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
408
114
ccc3902408d2 Fix the hash key in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents: 113
diff changeset
409 " Make the hash-key not suck.
ccc3902408d2 Fix the hash key in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents: 113
diff changeset
410 inoremap # X<BS>#
ccc3902408d2 Fix the hash key in Vim.
Ludovic Chabant <ludovic@chabant.com>
parents: 113
diff changeset
411
80
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
412 " Toggle invisible characters
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
413 nnoremap <leader>i :set list!<cr>
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
414
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
415 " Clear search matches
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
416 nnoremap <leader><space> :noh<cr>:call clearmatches()<cr>
43
25e8b2fffd50 Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 42
diff changeset
417
80
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
418 " Ctrl-P mappings.
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
419 nnoremap <silent> <C-p> :CtrlP<cr>
83
a54180045075 Vimrc changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 80
diff changeset
420 nnoremap <silent> <C-o> :CtrlPBuffer<cr>
193
ae53d68033d9 Enable fugitive and some CtrlP extensions, include a new one of my own.
Ludovic Chabant <ludovic@chabant.com>
parents: 191
diff changeset
421 nnoremap <silent> <C-u> :CtrlPTag<cr>
ae53d68033d9 Enable fugitive and some CtrlP extensions, include a new one of my own.
Ludovic Chabant <ludovic@chabant.com>
parents: 191
diff changeset
422 nnoremap <silent> <C-y> :CtrlPQuickfix<cr>
176
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
423 nnoremap <silent> <Tab> :CtrlPMRUFiles<cr>
73
39a7e05637d8 Added 80 chars limit to text/markdown files.
Ludovic Chabant <ludovic@chabant.com>
parents: 67
diff changeset
424
45
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
425 " Switch between FR and US keyboard layouts.
119
6dbbf36a523d VIM changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 118
diff changeset
426 nnoremap <C-l>f :setlocal keymap=french<cr>
6dbbf36a523d VIM changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 118
diff changeset
427 nnoremap <C-l>u :setlocal keymap=<cr>
45
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
428
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
429 " Toggle spell check according to current keyboard layout.
119
6dbbf36a523d VIM changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 118
diff changeset
430 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
431
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
432 " Simple way to close a buffer without closing the window.
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
433 nnoremap <leader>bd :bprevious<cr>:bdelete #<cr>
43
25e8b2fffd50 Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 42
diff changeset
434
103
a755319f124e Added mappings for substitutions.
Ludovic Chabant <ludovic@chabant.com>
parents: 101
diff changeset
435 " File-type switching.
83
a54180045075 Vimrc changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 80
diff changeset
436 nnoremap <leader>ftmd :set ft=markdown<cr>
80
121bef55252f Added more VIM plugins (ctrlp, easymotion, powerline).
Ludovic Chabant <ludovic@chabant.com>
parents: 76
diff changeset
437
119
6dbbf36a523d VIM changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 118
diff changeset
438 " Use sane regexes.
6dbbf36a523d VIM changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 118
diff changeset
439 nnoremap / /\v
6dbbf36a523d VIM changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 118
diff changeset
440 vnoremap / /\v
6dbbf36a523d VIM changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 118
diff changeset
441
103
a755319f124e Added mappings for substitutions.
Ludovic Chabant <ludovic@chabant.com>
parents: 101
diff changeset
442 " Quick search and replace.
119
6dbbf36a523d VIM changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 118
diff changeset
443 function! s:VSetSearch()
6dbbf36a523d VIM changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 118
diff changeset
444 let temp = @@
6dbbf36a523d VIM changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 118
diff changeset
445 norm! gvy
6dbbf36a523d VIM changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 118
diff changeset
446 let @/ = '\V' . substitute(escape(@@, '\'), '\n', '\\n', 'g')
6dbbf36a523d VIM changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 118
diff changeset
447 let @@ = temp
6dbbf36a523d VIM changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 118
diff changeset
448 endfunction
6dbbf36a523d VIM changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 118
diff changeset
449 vnoremap * :<C-u>call <SID>VSetSearch()<CR>//<CR><c-o>
6dbbf36a523d VIM changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 118
diff changeset
450 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
451
206
dae926f52b9a Some Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
452 " Jump to tags by keeping things better in view. Option for jumping to a tag
dae926f52b9a Some Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
453 " in a split window where everything is folded except what you need to see.
dae926f52b9a Some Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
454 function! JumpToTag()
dae926f52b9a Some Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
455 execute "normal! \<c-]>zz"
dae926f52b9a Some Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
456 endfunction
dae926f52b9a Some Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
457 function! JumpToTagInSplit()
dae926f52b9a Some Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
458 execute "normal! \<c-w>v\<c-]>zMzvzz"
dae926f52b9a Some Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
459 endfunction
dae926f52b9a Some Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
460 nnoremap <c-]> :silent! call JumpToTag()<cr>
dae926f52b9a Some Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
461 nnoremap <c-\> :silent! call JumpToTagInSplit()<cr>
dae926f52b9a Some Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
462
dae926f52b9a Some Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
463 " Keep search matches in the middle of the window.
dae926f52b9a Some Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
464 nnoremap n nzzzv
dae926f52b9a Some Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
465 nnoremap N Nzzzv
dae926f52b9a Some Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
466
dae926f52b9a Some Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
467 " Same when jumping around
dae926f52b9a Some Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
468 nnoremap g; g;zz
dae926f52b9a Some Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
469 nnoremap g, g,zz
dae926f52b9a Some Vim tweaks.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
470
59
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
471 " }}}
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
472
204
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
473 " Folding {{{
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
474
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
475 " Always start with all folds closed.
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
476 set foldlevelstart=0
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
477
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
478 " Toggle folds with <space>.
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
479 nnoremap <space> za
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
480
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
481 " Create folds with <space> (in visual mode).
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
482 vnoremap <space> zf
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
483
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
484 " }}}
4bd15b5afcfc Some cleanup and improvements to `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 201
diff changeset
485
59
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
486 " Abbreviations {{{
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
487
43
25e8b2fffd50 Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 42
diff changeset
488 iabbrev @@ ludovic@chabant.com
25e8b2fffd50 Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 42
diff changeset
489 iabbrev ccopy Copyright &copy;2011 Ludovic Chabant, all rights reserved.
25e8b2fffd50 Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 42
diff changeset
490 iabbrev ssig --<cr>l u d o .<cr>. 8 0 17 80
0
9dbf340c7956 Initial commit
Ludovic Chabant <ludovic@chabant.com>
parents:
diff changeset
491
59
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
492 " }}}
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
493
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
494 " Status Line {{{
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
495
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
496 set statusline=%f " Path.
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
497 set statusline+=%m " Modified flag.
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
498 set statusline+=%r " Readonly flag.
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
499 set statusline+=%w " Preview window flag.
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
500
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
501 set statusline+=\ " Space.
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
502
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
503 set statusline+=%#redbar# " Highlight the following as a warning.
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
504 set statusline+=%{SyntasticStatuslineFlag()} " Syntastic errors.
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
505 set statusline+=%* " Reset highlighting.
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
506
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
507 set statusline+=%= " Right align.
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
508
201
0db3b41793ee Add AutoTags indicator to the statusline.
Ludovic Chabant <ludovic@chabant.com>
parents: 197
diff changeset
509 " Tag file generation indicator.
213
769869e61101 Renamed autotags to gutentags.
Ludovic Chabant <ludovic@chabant.com>
parents: 212
diff changeset
510 set statusline+=%{gutentags#statusline('[TAGS]')}
201
0db3b41793ee Add AutoTags indicator to the statusline.
Ludovic Chabant <ludovic@chabant.com>
parents: 197
diff changeset
511 set statusline+=\ " Space.
0db3b41793ee Add AutoTags indicator to the statusline.
Ludovic Chabant <ludovic@chabant.com>
parents: 197
diff changeset
512
61
8c80aa9bd387 Re-enabled lawrencium status-line.
Ludovic Chabant <ludovic@chabant.com>
parents: 59
diff changeset
513 " Mercurial information.
8c80aa9bd387 Re-enabled lawrencium status-line.
Ludovic Chabant <ludovic@chabant.com>
parents: 59
diff changeset
514 set statusline+=%{lawrencium#statusline('[',']')}
8c80aa9bd387 Re-enabled lawrencium status-line.
Ludovic Chabant <ludovic@chabant.com>
parents: 59
diff changeset
515 set statusline+=\ " Space.
8c80aa9bd387 Re-enabled lawrencium status-line.
Ludovic Chabant <ludovic@chabant.com>
parents: 59
diff changeset
516
59
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
517 " File format, encoding and type. Ex: "(unix/utf-8/python)"
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
518 set statusline+=(
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
519 set statusline+=%{&ff} " Format (unix/DOS).
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
520 set statusline+=/
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
521 set statusline+=%{strlen(&fenc)?&fenc:&enc} " Encoding (utf-8).
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
522 set statusline+=/
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
523 set statusline+=%{&ft} " Type (python).
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
524 set statusline+=)
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
525
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
526 " Line and column position and counts.
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
527 set statusline+=\ (line\ %l\/%L,\ col\ %03c)
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
528
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
529 " }}}
6df571869f4a Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents: 55
diff changeset
530
45
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
531 " Functions {{{
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
532
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
533 function! s:ToggleSpellCheck() abort
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
534 if &spell ==? 'nospell'
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
535 if &keymap ==? 'french'
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
536 setlocal spell spelllang=fr_fr
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
537 else
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
538 setlocal spell spelllang=en_us,en_ca
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
539 endif
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
540 else
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
541 setlocal spell nospell
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
542 endif
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
543 endfunction
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
544
160
5997455e475b Whitespace cleaning.
Ludovic Chabant <ludovic@chabant.com>
parents: 157
diff changeset
545 function! s:StripTrailingWhitespaces() abort
5997455e475b Whitespace cleaning.
Ludovic Chabant <ludovic@chabant.com>
parents: 157
diff changeset
546 let l = line(".")
5997455e475b Whitespace cleaning.
Ludovic Chabant <ludovic@chabant.com>
parents: 157
diff changeset
547 let c = col(".")
5997455e475b Whitespace cleaning.
Ludovic Chabant <ludovic@chabant.com>
parents: 157
diff changeset
548 %s/\s\+$//e
5997455e475b Whitespace cleaning.
Ludovic Chabant <ludovic@chabant.com>
parents: 157
diff changeset
549 let @/=''
5997455e475b Whitespace cleaning.
Ludovic Chabant <ludovic@chabant.com>
parents: 157
diff changeset
550 call cursor(l, c)
5997455e475b Whitespace cleaning.
Ludovic Chabant <ludovic@chabant.com>
parents: 157
diff changeset
551 endfunction
5997455e475b Whitespace cleaning.
Ludovic Chabant <ludovic@chabant.com>
parents: 157
diff changeset
552
176
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
553 function! s:FindProjectRoot(cur, marker) abort
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
554 let l:cur = a:cur
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
555 let l:previous_cur = ''
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
556 let l:slash = '/'
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
557 if has('win32')
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
558 let l:slash = '\\'
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
559 endif
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
560 while l:cur != l:previous_cur
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
561 let l:marker_path = l:cur . l:slash . a:marker
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
562 if glob(l:marker_path) != ''
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
563 return fnamemodify(l:cur, ':p')
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
564 endif
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
565 let l:previous_cur = l:cur
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
566 let l:cur = fnamemodify(l:cur, ':h')
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
567 endwhile
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
568 return ''
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
569 endfunction
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
570
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
571 function! s:SetProjectRootCwd() abort
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
572 let l:cur_file_dir = expand('%:p:h', 1)
197
4d34bf15a478 Don't clear CtrlP cache on exit, fix Windows issues.
Ludovic Chabant <ludovic@chabant.com>
parents: 193
diff changeset
573 if l:cur_file_dir =~ '\v^.+:(//|\\\\)'
176
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
574 return
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
575 endif
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
576 let l:root = l:cur_file_dir
185
0ed6642b8db8 Fixed a bug in `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 183
diff changeset
577 let l:markers = []
0ed6642b8db8 Fixed a bug in `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 183
diff changeset
578 if exists('g:ctrlp_root_markers')
0ed6642b8db8 Fixed a bug in `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 183
diff changeset
579 let l:markers += g:ctrlp_root_markers
0ed6642b8db8 Fixed a bug in `vimrc`.
Ludovic Chabant <ludovic@chabant.com>
parents: 183
diff changeset
580 endif
176
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
581 let l:markers += ['.git', '.hg', '.svn', '.bzr', '_darcs']
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
582 for marker in l:markers
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
583 let l:proj_root = s:FindProjectRoot(l:cur_file_dir, marker)
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
584 if l:proj_root != ''
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
585 let l:root = l:proj_root
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
586 break
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
587 endif
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
588 endfor
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
589 execute 'lcd!' fnameescape(l:root)
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
590 endfunction
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
591
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
592 function! s:ToggleNERDTree() abort
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
593 let l:was_open = nerdtree#isTreeOpen()
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
594 NERDTreeToggle
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
595 if !l:was_open
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
596 wincmd p
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
597 NERDTreeCWD
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
598 wincmd p
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
599 NERDTreeFind
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
600 endif
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
601 endfunction
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
602
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
603 function! s:FindInNERDTree() abort
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
604 if !nerdtree#isTreeOpen()
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
605 call s:ToggleNERDTree()
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
606 else
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
607 if getbufvar('%', 'NERDTreeType') != ''
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
608 wincmd p
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
609 else
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
610 NERDTreeFind
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
611 endif
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
612 endif
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
613 endfunction
c6a072353606 Vim config changes:
Ludovic Chabant <ludovic@chabant.com>
parents: 173
diff changeset
614
45
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
615 " }}}
aac6188ab4d6 Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents: 43
diff changeset
616
171
7559d8bc39bb Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents: 169
diff changeset
617 " Local override {{{
7559d8bc39bb Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents: 169
diff changeset
618
191
896acf280e7a Make local Vim config consistent with Mercurial local config.
Ludovic Chabant <ludovic@chabant.com>
parents: 186
diff changeset
619 let s:local_vimrc = s:vim_home.'/vimrc-local'
171
7559d8bc39bb Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents: 169
diff changeset
620 if filereadable(s:local_vimrc)
7559d8bc39bb Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents: 169
diff changeset
621 execute 'source' s:local_vimrc
7559d8bc39bb Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents: 169
diff changeset
622 endif
7559d8bc39bb Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents: 169
diff changeset
623
7559d8bc39bb Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents: 169
diff changeset
624 " }}}
7559d8bc39bb Added local override of Vim settings.
Ludovic Chabant <ludovic@chabant.com>
parents: 169
diff changeset
625