Mercurial > dotfiles
annotate vim/vimrc @ 59:6df571869f4a
Added statusline and fold-related mappings.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 08 Dec 2011 17:16:47 -0800 |
parents | a7932e0fa961 |
children | 8c80aa9bd387 |
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 |
6 | 22 " Set some important system-dependent variables. |
23 if has("win32") || has("win64") || has("dos32") | |
24 let $HOMEVIM = "vimfiles" | |
25 let $PLATFORM = "windows" | |
26 else | |
27 let $HOMEVIM = ".vim" | |
28 let $PLATFORM = "unix" | |
29 endif | |
30 | |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
31 " Disable some plugins. |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
32 let g:pathogen_disabled = [] |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
33 call add(g:pathogen_disabled, 'vimroom') |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
34 |
0 | 35 " Load pathogen. |
36 call pathogen#infect() | |
37 | |
10
00cac5ebf546
Added default window size. Added buffer keyboard shortcuts.
ludovicchabant
parents:
6
diff
changeset
|
38 " 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
|
39 if has("gui_running") && !exists('g:resourcing_vimrc') |
0 | 40 set guioptions=-t |
10
00cac5ebf546
Added default window size. Added buffer keyboard shortcuts.
ludovicchabant
parents:
6
diff
changeset
|
41 set lines=50 |
00cac5ebf546
Added default window size. Added buffer keyboard shortcuts.
ludovicchabant
parents:
6
diff
changeset
|
42 set columns=135 |
0 | 43 endif |
44 | |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
45 " }}} |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
46 |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
47 " General Settings {{{ |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
48 |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
49 " Disable modelines. |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
50 set modelines=0 |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
51 |
6 | 52 " Don't unload abandoned buffers. |
53 set hidden | |
0 | 54 |
6 | 55 " Show line numbers. |
56 set number | |
57 | |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
58 " 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
|
59 set showmode |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
60 set showcmd |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
61 |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
62 " Keep the cursor off the top/bottom edges. |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
63 set scrolloff=3 |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
64 |
6 | 65 " Smart auto-indenting. |
0 | 66 set autoindent |
67 set smartindent | |
6 | 68 |
69 " Use confirmation dialog. | |
0 | 70 set confirm |
6 | 71 |
72 " Remember lots of commands. | |
0 | 73 set history=1000 |
6 | 74 |
75 " Use incremental search, with highlighting, | |
76 " case-insensitive unless we actually type some | |
77 " mixed-case stuff. | |
0 | 78 set incsearch |
79 set hlsearch | |
80 set ignorecase | |
81 set smartcase | |
6 | 82 |
83 " Always show window status lines. | |
0 | 84 set laststatus=2 |
6 | 85 |
86 " Enable using the mouse like some everyday guy. | |
0 | 87 set mouse=a |
6 | 88 |
89 " Show interesting stuff at the bottom of the window. | |
0 | 90 set showcmd |
91 set ruler | |
6 | 92 |
93 " Don't pollute the hard-drive with *~ files. Only | |
94 " create them in hidden backup/temp directories while | |
95 " we edit the file, and then get rid of it. | |
0 | 96 set nobackup |
97 set writebackup | |
6 | 98 set backupdir=~/$HOMEVIM/backup |
99 set directory=~/$HOMEVIM/temp | |
100 | |
101 " Better command-line completion, but don't show some | |
102 " stuff we don't care about. | |
0 | 103 set wildmenu |
104 set wildignore+=.DS_Store,Thumbs.db | |
6 | 105 |
106 " Always display the tab-page line. | |
0 | 107 set showtabline=2 |
6 | 108 |
109 " Show matching braces. | |
110 set showmatch | |
111 | |
112 " Set the file-formats. | |
0 | 113 set ffs=unix,mac,dos |
6 | 114 |
115 " Tabs and indenting are 4 characters, and tabs behave like | |
116 " spaces during editing. They're smart, too, and when you | |
117 " press <TAB> it actually inserts a soft-tab so everything's | |
118 " indented the same. | |
0 | 119 set tabstop=4 |
120 set shiftwidth=4 | |
121 set softtabstop=4 | |
122 set smarttab | |
123 set expandtab | |
6 | 124 |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
125 " Default encoding |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
126 set encoding=utf-8 |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
127 |
6 | 128 " Clipboard buffer. |
0 | 129 set clipboard=unnamed |
6 | 130 |
131 " Smoot terminal experience. | |
0 | 132 set ttyfast |
6 | 133 |
134 " Allow backspacing over anything. | |
0 | 135 set backspace=indent,eol,start |
136 | |
6 | 137 " Going left and right let you go to other lines. |
138 set whichwrap+=<,>,h,l | |
139 | |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
140 " Folds are defined by markers in the text. |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
141 set foldmethod=marker |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
142 |
6 | 143 " And now, for some system-dependent settings: |
144 " - font to use | |
145 if $PLATFORM == "windows" | |
146 set guifont=Consolas:h12 | |
147 else | |
148 set guifont=Monaco:h12 | |
149 endif | |
150 | |
151 | |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
152 " Syntax highlighting. |
0 | 153 syntax on |
154 | |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
155 " 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
|
156 if !exists('g:resourcing_vimrc') |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
157 cd ~/ |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
158 endif |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
159 |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
160 " Default color scheme. |
47 | 161 if has('gui_running') |
162 set background=light | |
163 else | |
164 set background=dark | |
165 endif | |
166 colorscheme solarized | |
6 | 167 |
168 " Enable file type detection. | |
0 | 169 filetype indent plugin on |
170 | |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
171 " }}} |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
172 |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
173 " Plugin Settings {{{ |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
174 |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
175 " Navigate MiniBufExplorer with CTRL+Tab/CTRL+Shift+Tab. |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
176 let g:miniBufExplMapCTabSwitchBufs = 1 |
10
00cac5ebf546
Added default window size. Added buffer keyboard shortcuts.
ludovicchabant
parents:
6
diff
changeset
|
177 |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
178 " }}} |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
179 |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
180 " Mappings {{{ |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
181 |
42
6b831735c092
Added french keymap support.
Ludovic Chabant <ludovic@chabant.com>
parents:
18
diff
changeset
|
182 let mapleader="," |
43
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
183 |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
184 " Edit & source the VIMRC. |
43
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
185 nnoremap <leader>ev :vsplit $MYVIMRC<cr> |
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
186 nnoremap <leader>sv :source $MYVIMRC<cr> |
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
187 |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
188 " MiniBufExplorer mappings. |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
189 nnoremap <F2> :TMiniBufExplorer<cr> |
43
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
190 |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
191 " Open NERDtree. |
43
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
192 nnoremap <F3> :NERDTreeToggle<cr> |
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
193 |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
194 " Switch between FR and US keyboard layouts. |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
195 nnoremap <leader>fr :setlocal keymap=french<cr> |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
196 nnoremap <leader>us :setlocal keymap=<cr> |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
197 |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
198 " Toggle spell check according to current keyboard layout. |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
199 nnoremap <leader>sp :call <SID>ToggleSpellCheck()<cr> |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
200 |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
201 " 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
|
202 nnoremap <leader>bd :bprevious<cr>:bdelete #<cr> |
43
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
203 |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
204 " Toggle folds with <space> |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
205 nnoremap <space> za |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
206 |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
207 " Create folds with <space> (in visual mode) |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
208 vnoremap <space> zf |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
209 |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
210 " }}} |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
211 |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
212 " Abbreviations {{{ |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
213 |
43
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
214 iabbrev @@ ludovic@chabant.com |
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
215 iabbrev ccopy Copyright ©2011 Ludovic Chabant, all rights reserved. |
25e8b2fffd50
Changed some mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
42
diff
changeset
|
216 iabbrev ssig --<cr>l u d o .<cr>. 8 0 17 80 |
0 | 217 |
59
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
218 " }}} |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
219 |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
220 " Status Line {{{ |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
221 |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
222 set statusline=%f " Path. |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
223 set statusline+=%m " Modified flag. |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
224 set statusline+=%r " Readonly flag. |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
225 set statusline+=%w " Preview window flag. |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
226 |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
227 set statusline+=\ " Space. |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
228 |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
229 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
|
230 set statusline+=%{SyntasticStatuslineFlag()} " Syntastic errors. |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
231 set statusline+=%* " Reset highlighting. |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
232 |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
233 set statusline+=%= " Right align. |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
234 |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
235 " 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
|
236 set statusline+=( |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
237 set statusline+=%{&ff} " Format (unix/DOS). |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
238 set statusline+=/ |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
239 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
|
240 set statusline+=/ |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
241 set statusline+=%{&ft} " Type (python). |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
242 set statusline+=) |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
243 |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
244 " Line and column position and counts. |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
245 set statusline+=\ (line\ %l\/%L,\ col\ %03c) |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
246 |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
247 " }}} |
6df571869f4a
Added statusline and fold-related mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
55
diff
changeset
|
248 |
45
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
249 " Functions {{{ |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
250 |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
251 function! s:ToggleSpellCheck() abort |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
252 if &spell ==? 'nospell' |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
253 if &keymap ==? 'french' |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
254 setlocal spell spelllang=fr_fr |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
255 else |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
256 setlocal spell spelllang=en_us,en_ca |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
257 endif |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
258 else |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
259 setlocal spell nospell |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
260 endif |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
261 endfunction |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
262 |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
263 " }}} |
aac6188ab4d6
Added vimroom plugin (disabled by default).
Ludovic Chabant <ludovic@chabant.com>
parents:
43
diff
changeset
|
264 |
55
a7932e0fa961
Enable lawrencium debugging.
Ludovic Chabant <ludovic@chabant.com>
parents:
53
diff
changeset
|
265 " Temporary stuff {{{ |
a7932e0fa961
Enable lawrencium debugging.
Ludovic Chabant <ludovic@chabant.com>
parents:
53
diff
changeset
|
266 |
a7932e0fa961
Enable lawrencium debugging.
Ludovic Chabant <ludovic@chabant.com>
parents:
53
diff
changeset
|
267 " Enable debugging Lawrencium |
a7932e0fa961
Enable lawrencium debugging.
Ludovic Chabant <ludovic@chabant.com>
parents:
53
diff
changeset
|
268 let g:lawrencium_debug = 1 |
a7932e0fa961
Enable lawrencium debugging.
Ludovic Chabant <ludovic@chabant.com>
parents:
53
diff
changeset
|
269 let g:lawrencium_trace = 1 |
a7932e0fa961
Enable lawrencium debugging.
Ludovic Chabant <ludovic@chabant.com>
parents:
53
diff
changeset
|
270 |
a7932e0fa961
Enable lawrencium debugging.
Ludovic Chabant <ludovic@chabant.com>
parents:
53
diff
changeset
|
271 " }}} |
a7932e0fa961
Enable lawrencium debugging.
Ludovic Chabant <ludovic@chabant.com>
parents:
53
diff
changeset
|
272 |
0 | 273 "let mapleader="," " Use , as Leader |
274 "let gmapleader="," | |
275 "map Y y$ " Yank to the end of the line w/ Y | |
276 "map <leader>nt :tabnew<CR> " New tab w/ ,nt | |
277 "map <leader>f :FufFile<CR> " Find files with ,f | |
278 "nmap <leader>w :w!<cr> | |
279 "map <F3> :r !pbpaste<CR> | |
280 "map <F4> :setlocal spell spelllang=en_gb<CR> " Turn on spellcheck with <F4> | |
281 "map <F5> :set nospell<CR> | |
282 "set pastetoggle=<F6> | |
283 "map <F7> :set complete+=k<CR> | |
284 "map <S-F7> :set complete=-k<CR> | |
285 "map <F8> :YRShow<CR> " Show the YankRing w/ <F8> | |
286 "nnoremap <F3> :GundoToggle<CR> " Show the undo tree w/ <F3> | |
287 "nnoremap ; : | |
288 "autocmd BufRead,BufNewfile ~/notes/* set filetype=markdown " All files in ~/notes are Markdown | |
289 "au BufWinLeave *.html,*.css mkview | |
290 "au BufWinEnter *.html,*.css silent loadview | |
291 "au FileType mail set tw=65 " Thin width when writing mail in mutt | |
292 "au FocusLost * :wa " Saves file when vim loses focus | |
293 "if has('statusline') " Status line with git repo info | |
294 " set statusline=%<%f\ | |
295 " set statusline+=%w%h%m%r | |
296 " set statusline+=%{fugitive#statusline()} | |
297 " set statusline+=\ [%{&ff}/%Y] | |
298 " set statusline+=\ [%{getcwd()}] | |
299 " set statusline+=%=%-14.(Line:\ %l\ of\ %L\ [%p%%]\ -\ Col:\ %c%V%) | |
300 "endif | |
301 | |
302 " For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries | |
303 " let &guioptions = substitute(&guioptions, "t", "", "g") | |
304 | |
305 " Don't use Ex mode, use Q for formatting | |
306 "map Q gq | |
307 | |
308 " This is an alternative that also works in block mode, but the deleted | |
309 " text is lost and it only works for putting the current register. | |
310 "vnoremap p "_dp | |
311 | |
312 " Switch syntax highlighting on, when the terminal has colors | |
313 " Also switch on highlighting the last used search pattern. | |
314 "if &t_Co > 2 || has("gui_running") | |
315 " syntax on | |
316 " set hlsearch | |
317 "endif | |
318 | |
319 " Only do this part when compiled with support for autocommands. | |
320 "if has("autocmd") | |
321 | |
322 " Enable file type detection. | |
323 " Use the default filetype settings, so that mail gets 'tw' set to 72, | |
324 " 'cindent' is on in C files, etc. | |
325 " Also load indent files, to automatically do language-dependent indenting. | |
326 " filetype plugin indent on | |
327 | |
328 " Put these in an autocmd group, so that we can delete them easily. | |
329 " augroup vimrcEx | |
330 " au! | |
331 | |
332 " For all text files set 'textwidth' to 78 characters. | |
333 " autocmd FileType text setlocal textwidth=78 | |
334 | |
335 " When editing a file, always jump to the last known cursor position. | |
336 " Don't do it when the position is invalid or when inside an event handler | |
337 " (happens when dropping a file on gvim). | |
338 " autocmd BufReadPost * | |
339 " \ if line("'\"") > 0 && line("'\"") <= line("$") | | |
340 " \ exe "normal g`\"" | | |
341 " \ endif | |
342 | |
343 " augroup END | |
344 | |
345 "else | |
346 | |
347 " set autoindent " always set autoindenting on | |
348 | |
349 "endif " has("autocmd") | |
350 | |
351 "set fileformats=dos,unix " set fileformat to DOS by default | |
352 |