-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvimrc.html
631 lines (508 loc) · 71.6 KB
/
vimrc.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>The ultimate Vim configuration - vimrc</title>
<meta name="Generator" content="Vim/7.3">
<meta name="plugin-version" content="vim7.3_v6">
<meta name="syntax" content="vim">
<meta name="settings" content="use_css">
<style type="text/css">
<!--
pre { font-family: monospace; color: #d0d0d0; background-color: #202020; }
body { font-family: monospace; color: #d0d0d0; background-color: #202020; }
.Number { color: #e0c060; }
.LineNr { color: #b0b0b0; }
.Identifier { color: #f0c0f0; }
.Normal { color: #d0d0d0; background-color: #202020; }
.Special { color: #e0c060; }
.Constant { color: #80c0e0; }
.Type { color: #b0d0f0; }
.Statement { color: #c0d8f8; }
.PreProc { color: #60f080; }
.Comment { color: #d0d090; }
-->
</style>
</head>
<body>
<pre>
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Comment">"</span> <span class="PreProc">Maintainer:</span><span class="Comment"> amix the lucky stiff</span>
<span class="Comment">" <a href="http://amix.dk">http://amix.dk</a> - [email protected]</span>
<span class="Comment">"</span>
<span class="Comment">"</span> <span class="PreProc">Version:</span><span class="Comment"> 3.6 - 25/08/10 14:40:30</span>
<span class="Comment">"</span>
<span class="Comment">"</span> <span class="PreProc">Blog_post:</span><span class="Comment"> </span>
<span class="Comment">" <a href="http://amix.dk/blog/post/19486#The-ultimate-vim-configuration-vimrc">http://amix.dk/blog/post/19486#The-ultimate-vim-configuration-vimrc</a></span>
<span class="Comment">"</span> <span class="PreProc">Syntax_highlighted:</span>
<span class="Comment">" <a href="http://amix.dk/vim/vimrc.html">http://amix.dk/vim/vimrc.html</a></span>
<span class="Comment">"</span> <span class="PreProc">Raw_version:</span><span class="Comment"> </span>
<span class="Comment">" <a href="http://amix.dk/vim/vimrc.txt">http://amix.dk/vim/vimrc.txt</a></span>
<span class="Comment">"</span>
<span class="Comment">"</span> <span class="PreProc">How_to_Install_on_Unix:</span>
<span class="Comment">" $ mkdir ~/.vim_runtime</span>
<span class="Comment">" $ svn co svn://orangoo.com/vim ~/.vim_runtime</span>
<span class="Comment">" $ cat ~/.vim_runtime/install.sh</span>
<span class="Comment">" $ sh ~/.vim_runtime/install.sh <system></span>
<span class="Comment">" <sytem> can be `mac`, `linux` or `windows`</span>
<span class="Comment">"</span>
<span class="Comment">"</span> <span class="PreProc">How_to_Upgrade:</span>
<span class="Comment">" $ svn update ~/.vim_runtime</span>
<span class="Comment">"</span>
<span class="Comment">"</span> <span class="PreProc">Sections:</span>
<span class="Comment">" -> General</span>
<span class="Comment">" -> VIM user interface</span>
<span class="Comment">" -> Colors and Fonts</span>
<span class="Comment">" -> Files and backups</span>
<span class="Comment">" -> Text, tab and indent related</span>
<span class="Comment">" -> Visual mode related</span>
<span class="Comment">" -> Command mode related</span>
<span class="Comment">" -> Moving around, tabs and buffers</span>
<span class="Comment">" -> Statusline</span>
<span class="Comment">" -> Parenthesis/bracket expanding</span>
<span class="Comment">" -> General Abbrevs</span>
<span class="Comment">" -> Editing mappings</span>
<span class="Comment">"</span>
<span class="Comment">" -> Cope</span>
<span class="Comment">" -> Minibuffer plugin</span>
<span class="Comment">" -> Omni complete functions</span>
<span class="Comment">" -> Python section</span>
<span class="Comment">" -> JavaScript section</span>
<span class="Comment">"</span>
<span class="Comment">"</span>
<span class="Comment">"</span> <span class="PreProc">Plugins_Included:</span>
<span class="Comment">" > minibufexpl.vim - <a href="http://www.vim.org/scripts/script.php?script_id=159">http://www.vim.org/scripts/script.php?script_id=159</a></span>
<span class="Comment">" Makes it easy to get an overview of buffers:</span>
<span class="Comment">" info -> :e ~/.vim_runtime/plugin/minibufexpl.vim</span>
<span class="Comment">"</span>
<span class="Comment">" > bufexplorer - <a href="http://www.vim.org/scripts/script.php?script_id=42">http://www.vim.org/scripts/script.php?script_id=42</a></span>
<span class="Comment">" Makes it easy to switch between buffers:</span>
<span class="Comment">" info -> :help bufExplorer</span>
<span class="Comment">"</span>
<span class="Comment">" > yankring.vim - <a href="http://www.vim.org/scripts/script.php?script_id=1234">http://www.vim.org/scripts/script.php?script_id=1234</a></span>
<span class="Comment">" Emacs's killring, useful when using the clipboard:</span>
<span class="Comment">" info -> :help yankring</span>
<span class="Comment">"</span>
<span class="Comment">" > surround.vim - <a href="http://www.vim.org/scripts/script.php?script_id=1697">http://www.vim.org/scripts/script.php?script_id=1697</a></span>
<span class="Comment">" Makes it easy to work with surrounding text:</span>
<span class="Comment">" info -> :help surround</span>
<span class="Comment">"</span>
<span class="Comment">" > snipMate.vim - <a href="http://www.vim.org/scripts/script.php?script_id=2540">http://www.vim.org/scripts/script.php?script_id=2540</a></span>
<span class="Comment">" Snippets for many languages (similar to TextMate's):</span>
<span class="Comment">" info -> :help snipMate</span>
<span class="Comment">"</span>
<span class="Comment">" > mru.vim - <a href="http://www.vim.org/scripts/script.php?script_id=521">http://www.vim.org/scripts/script.php?script_id=521</a></span>
<span class="Comment">" Plugin to manage Most Recently Used (MRU) files:</span>
<span class="Comment">" info -> :e ~/.vim_runtime/plugin/mru.vim</span>
<span class="Comment">"</span>
<span class="Comment">" > Command-T - <a href="http://www.vim.org/scripts/script.php?script_id=3025">http://www.vim.org/scripts/script.php?script_id=3025</a></span>
<span class="Comment">" Command-T plug-in provides an extremely fast, intuitive mechanism for opening filesa:</span>
<span class="Comment">" info -> :help CommandT</span>
<span class="Comment">" screencast and web-help -> <a href="http://amix.dk/blog/post/19501">http://amix.dk/blog/post/19501</a></span>
<span class="Comment">"</span>
<span class="Comment">"</span>
<span class="Comment">"</span> <span class="PreProc">Revisions:</span>
<span class="Comment">" > 3.6: Added lots of stuff (colors, Command-T, Vim 7.3 persistent undo etc.)</span>
<span class="Comment">" > 3.5: Paste mode is now shown in status line if you are in paste mode</span>
<span class="Comment">" > 3.4: Added mru.vim</span>
<span class="Comment">" > 3.3: Added syntax highlighting for Mako mako.vim </span>
<span class="Comment">" > 3.2: Turned on python_highlight_all for better syntax</span>
<span class="Comment">" highlighting for Python</span>
<span class="Comment">" > 3.1: Added revisions ;) and bufexplorer.vim</span>
<span class="Comment">"</span>
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Comment">" => General</span>
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Comment">" Sets how many lines of history VIM has to remember</span>
<span class="Statement">set</span> <span class="PreProc">history</span>=700
<span class="Comment">" Enable filetype plugin</span>
<span class="Statement">filetype</span> <span class="Type">plugin</span> <span class="Type">on</span>
<span class="Statement">filetype</span> <span class="Type">indent</span> <span class="Type">on</span>
<span class="Comment">" Set to auto read when a file is changed from the outside</span>
<span class="Statement">set</span> <span class="PreProc">autoread</span>
<span class="Comment">" With a map leader it's possible to do extra key combinations</span>
<span class="Comment">" like <leader>w saves the current file</span>
<span class="Statement">let</span> mapleader <span class="Statement">=</span> <span class="Constant">","</span>
<span class="Statement">let</span> g:mapleader <span class="Statement">=</span> <span class="Constant">","</span>
<span class="Comment">" Fast saving</span>
<span class="Statement">nmap</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>w :w!<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>
<span class="Comment">" Fast editing of the .vimrc</span>
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>e :e! ~/.vim_runtime/vimrc<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>
<span class="Comment">" When vimrc is edited, reload it</span>
<span class="Statement">autocmd</span>! <span class="Type">bufwritepost</span> vimrc <span class="Statement">source</span> ~/<span class="Statement">.</span>vim_runtime/vimrc
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Comment">" => VIM user interface</span>
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Comment">" Set 7 lines to the curors - when moving vertical..</span>
<span class="Statement">set</span> <span class="PreProc">so</span>=7
<span class="Statement">set</span> <span class="PreProc">wildmenu</span> <span class="Comment">"Turn on WiLd menu</span>
<span class="Statement">set</span> <span class="PreProc">ruler</span> <span class="Comment">"Always show current position</span>
<span class="Statement">set</span> <span class="PreProc">cmdheight</span>=2 <span class="Comment">"The commandbar height</span>
<span class="Statement">set</span> <span class="PreProc">hid</span> <span class="Comment">"Change buffer - without saving</span>
<span class="Comment">" Set backspace config</span>
<span class="Statement">set</span> <span class="PreProc">backspace</span>=eol<span class="Statement">,</span>start<span class="Statement">,</span>indent
<span class="Statement">set</span> <span class="PreProc">whichwrap</span>+=<span class="Special"><</span><span class="Special">,</span><span class="Special">></span><span class="Statement">,</span>h<span class="Statement">,</span>l
<span class="Statement">set</span> <span class="PreProc">ignorecase</span> <span class="Comment">"Ignore case when searching</span>
<span class="Statement">set</span> <span class="PreProc">smartcase</span>
<span class="Statement">set</span> <span class="PreProc">hlsearch</span> <span class="Comment">"Highlight search things</span>
<span class="Statement">set</span> <span class="PreProc">incsearch</span> <span class="Comment">"Make search act like search in modern browsers</span>
<span class="Statement">set</span> <span class="PreProc">nolazyredraw</span> <span class="Comment">"Don't redraw while executing macros </span>
<span class="Statement">set</span> <span class="PreProc">magic</span> <span class="Comment">"Set magic on, for regular expressions</span>
<span class="Statement">set</span> <span class="PreProc">showmatch</span> <span class="Comment">"Show matching bracets when text indicator is over them</span>
<span class="Statement">set</span> <span class="PreProc">mat</span>=2 <span class="Comment">"How many tenths of a second to blink</span>
<span class="Comment">" No sound on errors</span>
<span class="Statement">set</span> <span class="PreProc">noerrorbells</span>
<span class="Statement">set</span> <span class="PreProc">novisualbell</span>
<span class="Statement">set</span> <span class="PreProc">t_vb</span>=
<span class="Statement">set</span> <span class="PreProc">tm</span>=500
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Comment">" => Colors and Fonts</span>
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Statement">syntax</span> <span class="Type">enable</span> <span class="Comment">"Enable syntax hl</span>
<span class="Comment">" Set font according to system</span>
<span class="Statement">if</span> <span class="Normal">MySys</span><span class="Special">()</span> <span class="Statement">==</span> <span class="Constant">"mac"</span>
<span class="Statement">set</span> <span class="PreProc">gfn</span>=Menlo<span class="Statement">:</span>h14
<span class="Statement">set</span> <span class="PreProc">shell</span>=/bin/bash
<span class="Statement">elseif</span> <span class="Normal">MySys</span><span class="Special">()</span> <span class="Statement">==</span> <span class="Constant">"windows"</span>
<span class="Statement">set</span> <span class="PreProc">gfn</span>=Bitstream\ Vera\ Sans\ Mono<span class="Statement">:</span>h10
<span class="Statement">elseif</span> <span class="Normal">MySys</span><span class="Special">()</span> <span class="Statement">==</span> <span class="Constant">"linux"</span>
<span class="Statement">set</span> <span class="PreProc">gfn</span>=Monospace\ 10
<span class="Statement">set</span> <span class="PreProc">shell</span>=/bin/bash
<span class="Statement">endif</span>
<span class="Statement">if</span> <span class="Identifier">has</span><span class="Special">(</span><span class="Constant">"gui_running"</span><span class="Special">)</span>
<span class="Statement">set</span> <span class="PreProc">guioptions</span>-=T
<span class="Statement">set</span> <span class="PreProc">t_Co</span>=256
<span class="Statement">set</span> <span class="PreProc">background</span>=dark
<span class="Statement">colorscheme</span> peaksea
<span class="Statement">set</span> <span class="PreProc">nonu</span>
<span class="Statement">else</span>
<span class="Statement">colorscheme</span> zellner
<span class="Statement">set</span> <span class="PreProc">background</span>=dark
<span class="Statement">set</span> <span class="PreProc">nonu</span>
<span class="Statement">endif</span>
<span class="Statement">set</span> <span class="PreProc">encoding</span>=utf8
<span class="Statement">try</span>
<span class="Statement">lang</span> en_US
<span class="Statement">catch</span>
<span class="Statement">endtry</span>
<span class="Statement">set</span> <span class="PreProc">ffs</span>=unix<span class="Statement">,</span>dos<span class="Statement">,</span>mac <span class="Comment">"Default file types</span>
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Comment">" => Files, backups and undo</span>
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Comment">" Turn backup off, since most stuff is in SVN, git anyway...</span>
<span class="Statement">set</span> <span class="PreProc">nobackup</span>
<span class="Statement">set</span> <span class="PreProc">nowb</span>
<span class="Statement">set</span> <span class="PreProc">noswapfile</span>
<span class="Comment">"Persistent undo</span>
<span class="Statement">try</span>
<span class="Statement">if</span> <span class="Normal">MySys</span><span class="Special">()</span> <span class="Statement">==</span> <span class="Constant">"windows"</span>
<span class="Statement">set</span> <span class="PreProc">undodir</span>=C<span class="Statement">:</span>\Windows\Temp
<span class="Statement">else</span>
<span class="Statement">set</span> <span class="PreProc">undodir</span>=~/.vim_runtime/undodir
<span class="Statement">endif</span>
<span class="Statement">set</span> <span class="PreProc">undofile</span>
<span class="Statement">catch</span>
<span class="Statement">endtry</span>
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Comment">" => Text, tab and indent related</span>
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Statement">set</span> <span class="PreProc">expandtab</span>
<span class="Statement">set</span> <span class="PreProc">shiftwidth</span>=4
<span class="Statement">set</span> <span class="PreProc">tabstop</span>=4
<span class="Statement">set</span> <span class="PreProc">smarttab</span>
<span class="Statement">set</span> <span class="PreProc">lbr</span>
<span class="Statement">set</span> <span class="PreProc">tw</span>=500
<span class="Statement">set</span> <span class="PreProc">ai</span> <span class="Comment">"Auto indent</span>
<span class="Statement">set</span> <span class="PreProc">si</span> <span class="Comment">"Smart indet</span>
<span class="Statement">set</span> <span class="PreProc">wrap</span> <span class="Comment">"Wrap lines</span>
<span class="Comment">""""""""""""""""""""""""""""""</span>
<span class="Comment">" => Visual mode related</span>
<span class="Comment">""""""""""""""""""""""""""""""</span>
<span class="Comment">" Really useful!</span>
<span class="Comment">" In visual mode when you press * or # to search for the current selection</span>
<span class="Statement">vnoremap</span> <span class="Special"><</span><span class="Special">silent</span><span class="Special">></span> * :call VisualSearch('f')<span class="Special"><</span><span class="Special">CR</span><span class="Special">></span>
<span class="Statement">vnoremap</span> <span class="Special"><</span><span class="Special">silent</span><span class="Special">></span> # :call VisualSearch('b')<span class="Special"><</span><span class="Special">CR</span><span class="Special">></span>
<span class="Comment">" When you press gv you vimgrep after the selected text</span>
<span class="Statement">vnoremap</span> <span class="Special"><</span><span class="Special">silent</span><span class="Special">></span> gv :call VisualSearch('gv')<span class="Special"><</span><span class="Special">CR</span><span class="Special">></span>
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>g :vimgrep // **/*.<span class="Special"><</span><span class="Special">left</span><span class="Special">><</span><span class="Special">left</span><span class="Special">><</span><span class="Special">left</span><span class="Special">><</span><span class="Special">left</span><span class="Special">><</span><span class="Special">left</span><span class="Special">><</span><span class="Special">left</span><span class="Special">><</span><span class="Special">left</span><span class="Special">></span>
<span class="Statement">function</span>! CmdLine<span class="Special">(</span>str<span class="Special">)</span>
<span class="Statement">exe</span> <span class="Constant">"menu Foo.Bar :"</span> <span class="Statement">.</span> <span class="Identifier">a:str</span>
<span class="Statement">emenu</span> Foo<span class="Statement">.</span>Bar
<span class="Statement">unmenu</span> Foo
<span class="Statement">endfunction</span>
<span class="Comment">" From an idea by Michael Naumann</span>
<span class="Statement">function</span>! VisualSearch<span class="Special">(</span>direction<span class="Special">)</span> range
<span class="Statement">let</span> l:saved_reg <span class="Statement">=</span> <span class="LineNr">@"</span>
<span class="Statement">execute</span> <span class="Constant">"normal! vgvy"</span>
<span class="Statement">let</span> l:pattern <span class="Statement">=</span> <span class="Identifier">escape</span><span class="Special">(</span><span class="LineNr">@"</span>, <span class="Constant">'\\/.*$^~[]'</span><span class="Special">)</span>
<span class="Statement">let</span> l:pattern <span class="Statement">=</span> <span class="Identifier">substitute</span><span class="Special">(</span>l:pattern, <span class="Constant">"\n$"</span>, <span class="Constant">""</span>, <span class="Constant">""</span><span class="Special">)</span>
<span class="Statement">if</span> <span class="Identifier">a:direction</span> <span class="Statement">==</span> <span class="Constant">'b'</span>
<span class="Statement">execute</span> <span class="Constant">"normal ?"</span> <span class="Statement">.</span> l:pattern <span class="Statement">.</span> <span class="Constant">"^M"</span>
<span class="Statement">elseif</span> <span class="Identifier">a:direction</span> <span class="Statement">==</span> <span class="Constant">'gv'</span>
<span class="Statement">call</span> <span class="Normal">CmdLine</span><span class="Special">(</span><span class="Constant">"vimgrep "</span> <span class="Statement">.</span> <span class="Constant">'/'</span><span class="Statement">.</span> l:pattern <span class="Statement">.</span> <span class="Constant">'/'</span> <span class="Statement">.</span> <span class="Constant">' **/*.'</span><span class="Special">)</span>
<span class="Statement">elseif</span> <span class="Identifier">a:direction</span> <span class="Statement">==</span> <span class="Constant">'f'</span>
<span class="Statement">execute</span> <span class="Constant">"normal /"</span> <span class="Statement">.</span> l:pattern <span class="Statement">.</span> <span class="Constant">"^M"</span>
<span class="Statement">endif</span>
<span class="Statement">let</span> @/ <span class="Statement">=</span> l:pattern
<span class="Statement">let</span> <span class="LineNr">@"</span> <span class="Statement">=</span> l:saved_reg
<span class="Statement">endfunction</span>
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Comment">" => Command mode related</span>
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Comment">" Smart mappings on the command line</span>
<span class="Statement">cno</span> $h e ~/
<span class="Statement">cno</span> $d e ~/Desktop/
<span class="Statement">cno</span> $j e ./
<span class="Statement">cno</span> $c e <span class="Special"><</span><span class="Special">C-</span><span class="Special">\></span>eCurrentFileDir("e")<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>
<span class="Comment">" $q is super useful when browsing on the command line</span>
<span class="Statement">cno</span> $q <span class="Special"><</span><span class="Special">C-</span><span class="Special">\></span>eDeleteTillSlash()<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>
<span class="Comment">" Bash like keys for the command line</span>
<span class="Statement">cnoremap</span> <span class="Special"><</span><span class="Special">C-A</span><span class="Special">></span> <span class="Special"><</span><span class="Special">Home</span><span class="Special">></span>
<span class="Statement">cnoremap</span> <span class="Special"><</span><span class="Special">C-E</span><span class="Special">></span> <span class="Special"><</span><span class="Special">End</span><span class="Special">></span>
<span class="Statement">cnoremap</span> <span class="Special"><</span><span class="Special">C-K</span><span class="Special">></span> <span class="Special"><</span><span class="Special">C-U</span><span class="Special">></span>
<span class="Statement">cnoremap</span> <span class="Special"><</span><span class="Special">C-P</span><span class="Special">></span> <span class="Special"><</span><span class="Special">Up</span><span class="Special">></span>
<span class="Statement">cnoremap</span> <span class="Special"><</span><span class="Special">C-N</span><span class="Special">></span> <span class="Special"><</span><span class="Special">Down</span><span class="Special">></span>
<span class="Comment">" Useful on some European keyboards</span>
<span class="Statement">map</span> ½ $
<span class="Statement">imap</span> ½ $
<span class="Statement">vmap</span> ½ $
<span class="Statement">cmap</span> ½ $
<span class="Statement">func</span>! Cwd<span class="Special">()</span>
<span class="Statement">let</span> cwd <span class="Statement">=</span> <span class="Identifier">getcwd</span><span class="Special">()</span>
<span class="Statement">return</span> <span class="LineNr">"e</span> <span class="Comment">" . cwd </span>
<span class="Statement">endfunc</span>
<span class="Statement">func</span>! DeleteTillSlash<span class="Special">()</span>
<span class="Statement">let</span> g:cmd <span class="Statement">=</span> <span class="Identifier">getcmdline</span><span class="Special">()</span>
<span class="Statement">if</span> <span class="Normal">MySys</span><span class="Special">()</span> <span class="Statement">==</span> <span class="Constant">"linux"</span> <span class="Statement">||</span> <span class="Normal">MySys</span><span class="Special">()</span> <span class="Statement">==</span> <span class="Constant">"mac"</span>
<span class="Statement">let</span> g:cmd_edited <span class="Statement">=</span> <span class="Identifier">substitute</span><span class="Special">(</span>g:cmd, <span class="Constant">"</span><span class="Constant">\\</span><span class="Constant">(.*\[/\]</span><span class="Constant">\\</span><span class="Constant">).*"</span>, <span class="Constant">"</span><span class="Constant">\\</span><span class="Constant">1"</span>, <span class="Constant">""</span><span class="Special">)</span>
<span class="Statement">else</span>
<span class="Statement">let</span> g:cmd_edited <span class="Statement">=</span> <span class="Identifier">substitute</span><span class="Special">(</span>g:cmd, <span class="Constant">"</span><span class="Constant">\\</span><span class="Constant">(.*\[</span><span class="Constant">\\\\</span><span class="Constant">]</span><span class="Constant">\\</span><span class="Constant">).*"</span>, <span class="Constant">"</span><span class="Constant">\\</span><span class="Constant">1"</span>, <span class="Constant">""</span><span class="Special">)</span>
<span class="Statement">endif</span>
<span class="Statement">if</span> g:cmd <span class="Statement">==</span> g:cmd_edited
<span class="Statement">if</span> <span class="Normal">MySys</span><span class="Special">()</span> <span class="Statement">==</span> <span class="Constant">"linux"</span> <span class="Statement">||</span> <span class="Normal">MySys</span><span class="Special">()</span> <span class="Statement">==</span> <span class="Constant">"mac"</span>
<span class="Statement">let</span> g:cmd_edited <span class="Statement">=</span> <span class="Identifier">substitute</span><span class="Special">(</span>g:cmd, <span class="Constant">"</span><span class="Constant">\\</span><span class="Constant">(.*\[/\]</span><span class="Constant">\\</span><span class="Constant">).*/"</span>, <span class="Constant">"</span><span class="Constant">\\</span><span class="Constant">1"</span>, <span class="Constant">""</span><span class="Special">)</span>
<span class="Statement">else</span>
<span class="Statement">let</span> g:cmd_edited <span class="Statement">=</span> <span class="Identifier">substitute</span><span class="Special">(</span>g:cmd, <span class="Constant">"</span><span class="Constant">\\</span><span class="Constant">(.*\[</span><span class="Constant">\\\\</span><span class="Constant">\]</span><span class="Constant">\\</span><span class="Constant">).*\[</span><span class="Constant">\\\\</span><span class="Constant">\]"</span>, <span class="Constant">"</span><span class="Constant">\\</span><span class="Constant">1"</span>, <span class="Constant">""</span><span class="Special">)</span>
<span class="Statement">endif</span>
<span class="Statement">endif</span>
<span class="Statement">return</span> g:cmd_edited
<span class="Statement">endfunc</span>
<span class="Statement">func</span>! CurrentFileDir<span class="Special">(</span>cmd<span class="Special">)</span>
<span class="Statement">return</span> <span class="Identifier">a:cmd</span> <span class="Statement">.</span> <span class="Constant">" "</span> <span class="Statement">.</span> <span class="Identifier">expand</span><span class="Special">(</span><span class="Constant">"%:p:h"</span><span class="Special">)</span> <span class="Statement">.</span> <span class="Constant">"/"</span>
<span class="Statement">endfunc</span>
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Comment">" => Moving around, tabs and buffers</span>
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Comment">" Map space to / (search) and c-space to ? (backgwards search)</span>
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">space</span><span class="Special">></span> /
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">c-space</span><span class="Special">></span> ?
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">silent</span><span class="Special">></span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span><span class="Special"><</span><span class="Special">cr</span><span class="Special">></span> :noh<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>
<span class="Comment">" Smart way to move btw. windows</span>
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">C-j</span><span class="Special">></span> <span class="Special"><</span><span class="Special">C-W</span><span class="Special">></span>j
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">C-k</span><span class="Special">></span> <span class="Special"><</span><span class="Special">C-W</span><span class="Special">></span>k
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">C-h</span><span class="Special">></span> <span class="Special"><</span><span class="Special">C-W</span><span class="Special">></span>h
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">C-l</span><span class="Special">></span> <span class="Special"><</span><span class="Special">C-W</span><span class="Special">></span>l
<span class="Comment">" Close the current buffer</span>
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>bd :Bclose<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>
<span class="Comment">" Close all the buffers</span>
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>ba :1,300 bd!<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>
<span class="Comment">" Use the arrows to something usefull</span>
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">right</span><span class="Special">></span> :bn<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">left</span><span class="Special">></span> :bp<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>
<span class="Comment">" Tab configuration</span>
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>tn :tabnew<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>te :tabedit
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>tc :tabclose<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>tm :tabmove
<span class="Comment">" When pressing <leader>cd switch to the directory of the open buffer</span>
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>cd :cd %:p:h<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>
<span class="Statement">command</span>! Bclose <span class="Identifier">call</span> <span class="Special"><</span><span class="Special">SID</span><span class="Special">></span><span class="Normal">BufcloseCloseIt</span>()
<span class="Statement">function</span>! <span class="Special"><SID></span>BufcloseCloseIt<span class="Special">()</span>
<span class="Statement">let</span> l:currentBufNum <span class="Statement">=</span> <span class="Identifier">bufnr</span><span class="Special">(</span><span class="Constant">"%"</span><span class="Special">)</span>
<span class="Statement">let</span> l:alternateBufNum <span class="Statement">=</span> <span class="Identifier">bufnr</span><span class="Special">(</span><span class="Constant">"#"</span><span class="Special">)</span>
<span class="Statement">if</span> <span class="Identifier">buflisted</span><span class="Special">(</span>l:alternateBufNum<span class="Special">)</span>
<span class="Statement">buffer</span> #
<span class="Statement">else</span>
<span class="Statement">bnext</span>
<span class="Statement">endif</span>
<span class="Statement">if</span> <span class="Identifier">bufnr</span><span class="Special">(</span><span class="Constant">"%"</span><span class="Special">)</span> <span class="Statement">==</span> l:currentBufNum
<span class="Statement">new</span>
<span class="Statement">endif</span>
<span class="Statement">if</span> <span class="Identifier">buflisted</span><span class="Special">(</span>l:currentBufNum<span class="Special">)</span>
<span class="Normal">execute</span><span class="Special">(</span><span class="Constant">"bdelete! "</span><span class="Statement">.</span>l:currentBufNum<span class="Special">)</span>
<span class="Statement">endif</span>
<span class="Statement">endfunction</span>
<span class="Comment">" Specify the behavior when switching between buffers </span>
<span class="Statement">try</span>
<span class="Statement">set</span> <span class="PreProc">switchbuf</span>=usetab
<span class="Statement">set</span> <span class="PreProc">stal</span>=2
<span class="Statement">catch</span>
<span class="Statement">endtry</span>
<span class="Comment">""""""""""""""""""""""""""""""</span>
<span class="Comment">" => Statusline</span>
<span class="Comment">""""""""""""""""""""""""""""""</span>
<span class="Comment">" Always hide the statusline</span>
<span class="Statement">set</span> <span class="PreProc">laststatus</span>=2
<span class="Comment">" Format the statusline</span>
<span class="Statement">set</span> <span class="PreProc">statusline</span>=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD<span class="Statement">:</span>\ %r%{CurDir()}%h\ \ \ Line<span class="Statement">:</span>\ %l/%L<span class="Statement">:</span>%c
<span class="Statement">function</span>! CurDir<span class="Special">()</span>
<span class="Statement">let</span> curdir <span class="Statement">=</span> <span class="Identifier">substitute</span><span class="Special">(</span><span class="Identifier">getcwd</span><span class="Special">()</span>, <span class="Constant">'/Users/amir/'</span>, <span class="Constant">"~/"</span>, <span class="Constant">"g"</span><span class="Special">)</span>
<span class="Statement">return</span> curdir
<span class="Statement">endfunction</span>
<span class="Statement">function</span>! HasPaste<span class="Special">()</span>
<span class="Statement">if</span> &paste
<span class="Statement">return</span> <span class="Constant">'PASTE MODE '</span>
<span class="Statement">else</span>
<span class="Statement">return</span> <span class="Constant">''</span>
<span class="Statement">endif</span>
<span class="Statement">endfunction</span>
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Comment">" => Parenthesis/bracket expanding</span>
<span class="Comment">""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Statement">vnoremap</span> $1 <span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>`>a)<span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>`<i(<span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>
<span class="Statement">vnoremap</span> $2 <span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>`>a]<span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>`<i[<span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>
<span class="Statement">vnoremap</span> $3 <span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>`>a}<span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>`<i{<span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>
<span class="Statement">vnoremap</span> $$ <span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>`>a"<span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>`<i"<span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>
<span class="Statement">vnoremap</span> $q <span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>`>a'<span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>`<i'<span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>
<span class="Statement">vnoremap</span> $e <span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>`>a"<span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>`<i"<span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>
<span class="Comment">" Map auto complete of (, ", ', [</span>
<span class="Statement">inoremap</span> $1 ()<span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>i
<span class="Statement">inoremap</span> $2 []<span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>i
<span class="Statement">inoremap</span> $3 {}<span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>i
<span class="Statement">inoremap</span> $4 {<span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>o}<span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>O
<span class="Statement">inoremap</span> $q ''<span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>i
<span class="Statement">inoremap</span> $e ""<span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>i
<span class="Statement">inoremap</span> $t <span class="Special"><><</span><span class="Special">esc</span><span class="Special">></span>i
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Comment">" => General Abbrevs</span>
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Statement">iab</span> xdate <span class="Special"><</span><span class="Special">c-r</span><span class="Special">></span>=strftime("%d/%m/%y %H:%M:%S")<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Comment">" => Editing mappings</span>
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Comment">"Remap VIM 0</span>
<span class="Statement">map</span> 0 ^
<span class="Comment">"Move a line of text using ALT+[jk] or Comamnd+[jk] on mac</span>
<span class="Statement">nmap</span> <span class="Special"><</span><span class="Special">M-j</span><span class="Special">></span> mz:m+<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>`z
<span class="Statement">nmap</span> <span class="Special"><</span><span class="Special">M-k</span><span class="Special">></span> mz:m-2<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>`z
<span class="Statement">vmap</span> <span class="Special"><</span><span class="Special">M-j</span><span class="Special">></span> :m'>+<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>`<my`>mzgv`yo`z
<span class="Statement">vmap</span> <span class="Special"><</span><span class="Special">M-k</span><span class="Special">></span> :m'<-2<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>`>my`<mzgv`yo`z
<span class="Statement">if</span> <span class="Normal">MySys</span><span class="Special">()</span> <span class="Statement">==</span> <span class="Constant">"mac"</span>
<span class="Statement">nmap</span> <span class="Special"><</span><span class="Special">D-j</span><span class="Special">></span> <span class="Special"><</span><span class="Special">M-j</span><span class="Special">></span>
<span class="Statement">nmap</span> <span class="Special"><</span><span class="Special">D-k</span><span class="Special">></span> <span class="Special"><</span><span class="Special">M-k</span><span class="Special">></span>
<span class="Statement">vmap</span> <span class="Special"><</span><span class="Special">D-j</span><span class="Special">></span> <span class="Special"><</span><span class="Special">M-j</span><span class="Special">></span>
<span class="Statement">vmap</span> <span class="Special"><</span><span class="Special">D-k</span><span class="Special">></span> <span class="Special"><</span><span class="Special">M-k</span><span class="Special">></span>
<span class="Statement">endif</span>
<span class="Comment">"Delete trailing white space, useful for Python ;)</span>
<span class="Statement">func</span>! DeleteTrailingWS<span class="Special">()</span>
<span class="Statement">exe</span> <span class="Constant">"normal mz"</span>
<span class="Number">%</span><span class="Statement">s</span><span class="Special">/</span>\s\+$<span class="Special">//</span><span class="Special">ge</span>
<span class="Statement">exe</span> <span class="Constant">"normal `z"</span>
<span class="Statement">endfunc</span>
<span class="Statement">autocmd</span> <span class="Type">BufWrite</span> *.py :<span class="Statement">call</span> <span class="Normal">DeleteTrailingWS</span><span class="Special">()</span>
<span class="Statement">set</span> <span class="PreProc">guitablabel</span>=%t
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Comment">" => Cope</span>
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Comment">" Do :help cope if you are unsure what cope is. It's super useful!</span>
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>cc :botright cope<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>n :cn<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>p :cp<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>
<span class="Comment">""""""""""""""""""""""""""""""</span>
<span class="Comment">" => bufExplorer plugin</span>
<span class="Comment">""""""""""""""""""""""""""""""</span>
<span class="Statement">let</span> g:bufExplorerDefaultHelp<span class="Statement">=</span><span class="Number">0</span>
<span class="Statement">let</span> g:bufExplorerShowRelativePath<span class="Statement">=</span><span class="Number">1</span>
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>o :BufExplorer<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>
<span class="Comment">""""""""""""""""""""""""""""""</span>
<span class="Comment">" => Minibuffer plugin</span>
<span class="Comment">""""""""""""""""""""""""""""""</span>
<span class="Statement">let</span> g:miniBufExplModSelTarget <span class="Statement">=</span> <span class="Number">1</span>
<span class="Statement">let</span> g:miniBufExplorerMoreThanOne <span class="Statement">=</span> <span class="Number">2</span>
<span class="Statement">let</span> g:miniBufExplModSelTarget <span class="Statement">=</span> <span class="Number">0</span>
<span class="Statement">let</span> g:miniBufExplUseSingleClick <span class="Statement">=</span> <span class="Number">1</span>
<span class="Statement">let</span> g:miniBufExplMapWindowNavVim <span class="Statement">=</span> <span class="Number">1</span>
<span class="Statement">let</span> g:miniBufExplVSplit <span class="Statement">=</span> <span class="Number">25</span>
<span class="Statement">let</span> g:miniBufExplSplitBelow<span class="Statement">=</span><span class="Number">1</span>
<span class="Statement">let</span> g:bufExplorerSortBy <span class="Statement">=</span> <span class="Constant">"name"</span>
<span class="Statement">autocmd</span> <span class="Type">BufRead</span>,<span class="Type">BufNew</span> :call UMiniBufExplorer
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>u :TMiniBufExplorer<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Comment">" => Omni complete functions</span>
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Statement">autocmd</span> <span class="Type">FileType</span> css <span class="Statement">set</span> <span class="PreProc">omnifunc</span>=csscomplete#CompleteCSS
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Comment">" => Spell checking</span>
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Comment">"Pressing ,ss will toggle and untoggle spell checking</span>
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>ss :setlocal spell!<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>
<span class="Comment">"Shortcuts using <leader></span>
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>sn ]s
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>sp [s
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>sa zg
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>s? z=
<span class="Comment">""""""""""""""""""""""""""""""</span>
<span class="Comment">" => Python section</span>
<span class="Comment">""""""""""""""""""""""""""""""</span>
<span class="Statement">let</span> python_highlight_all <span class="Statement">=</span> <span class="Number">1</span>
<span class="Statement">au</span> <span class="Type">FileType</span> python <span class="Statement">syn</span> <span class="Type">keyword</span> pythonDecorator True None False self
<span class="Statement">au</span> <span class="Type">BufNewFile</span>,<span class="Type">BufRead</span> *.jinja <span class="Statement">set</span> <span class="PreProc">syntax</span>=htmljinja
<span class="Statement">au</span> <span class="Type">BufNewFile</span>,<span class="Type">BufRead</span> *.mako <span class="Statement">set</span> <span class="PreProc">ft</span>=mako
<span class="Statement">au</span> <span class="Type">FileType</span> python <span class="Statement">inoremap</span> <span class="Special"><</span><span class="Special">buffer</span><span class="Special">></span> $r return
<span class="Statement">au</span> <span class="Type">FileType</span> python <span class="Statement">inoremap</span> <span class="Special"><</span><span class="Special">buffer</span><span class="Special">></span> $i import
<span class="Statement">au</span> <span class="Type">FileType</span> python <span class="Statement">inoremap</span> <span class="Special"><</span><span class="Special">buffer</span><span class="Special">></span> $p print
<span class="Statement">au</span> <span class="Type">FileType</span> python <span class="Statement">inoremap</span> <span class="Special"><</span><span class="Special">buffer</span><span class="Special">></span> $f #--- PH ----------------------------------------------<span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>FP2xi
<span class="Statement">au</span> <span class="Type">FileType</span> python <span class="Statement">map</span> <span class="Special"><</span><span class="Special">buffer</span><span class="Special">></span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>1 /class
<span class="Statement">au</span> <span class="Type">FileType</span> python <span class="Statement">map</span> <span class="Special"><</span><span class="Special">buffer</span><span class="Special">></span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>2 /def
<span class="Statement">au</span> <span class="Type">FileType</span> python <span class="Statement">map</span> <span class="Special"><</span><span class="Special">buffer</span><span class="Special">></span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>C ?class
<span class="Statement">au</span> <span class="Type">FileType</span> python <span class="Statement">map</span> <span class="Special"><</span><span class="Special">buffer</span><span class="Special">></span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>D ?def
<span class="Comment">""""""""""""""""""""""""""""""</span>
<span class="Comment">" => JavaScript section</span>
<span class="Comment">"""""""""""""""""""""""""""""""</span>
<span class="Statement">au</span> <span class="Type">FileType</span> javascript <span class="Statement">call</span> <span class="Normal">JavaScriptFold</span><span class="Special">()</span>
<span class="Statement">au</span> <span class="Type">FileType</span> javascript <span class="Statement">setl</span> <span class="PreProc">fen</span>
<span class="Statement">au</span> <span class="Type">FileType</span> javascript <span class="Statement">setl</span> <span class="PreProc">nocindent</span>
<span class="Statement">au</span> <span class="Type">FileType</span> javascript <span class="Statement">imap</span> <span class="Special"><</span><span class="Special">c-t</span><span class="Special">></span> AJS.log();<span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>hi
<span class="Statement">au</span> <span class="Type">FileType</span> javascript <span class="Statement">imap</span> <span class="Special"><</span><span class="Special">c-a</span><span class="Special">></span> alert();<span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>hi
<span class="Statement">au</span> <span class="Type">FileType</span> javascript <span class="Statement">inoremap</span> <span class="Special"><</span><span class="Special">buffer</span><span class="Special">></span> $r return
<span class="Statement">au</span> <span class="Type">FileType</span> javascript <span class="Statement">inoremap</span> <span class="Special"><</span><span class="Special">buffer</span><span class="Special">></span> $f //--- PH ----------------------------------------------<span class="Special"><</span><span class="Special">esc</span><span class="Special">></span>FP2xi
<span class="Statement">function</span>! JavaScriptFold<span class="Special">()</span>
<span class="Statement">setl</span> <span class="PreProc">foldmethod</span>=syntax
<span class="Statement">setl</span> <span class="PreProc">foldlevelstart</span>=1
syn region foldBraces <span class="Statement">start</span><span class="Statement">=</span>/<span class="Special">{</span>/ end<span class="Statement">=</span>/<span class="Special">}</span>/ transparent <span class="Statement">fold</span> keepend extend
<span class="Statement">function</span>! FoldText<span class="Special">()</span>
<span class="Statement">return</span> <span class="Identifier">substitute</span><span class="Special">(</span><span class="Identifier">getline</span><span class="Special">(</span>v:foldstart<span class="Special">)</span>, <span class="Constant">'{.*'</span>, <span class="Constant">'{...}'</span>, <span class="Constant">''</span><span class="Special">)</span>
<span class="Statement">endfunction</span>
<span class="Statement">setl</span> <span class="PreProc">foldtext</span>=FoldText()
<span class="Statement">endfunction</span>
<span class="Comment">""""""""""""""""""""""""""""""</span>
<span class="Comment">" => MRU plugin</span>
<span class="Comment">""""""""""""""""""""""""""""""</span>
<span class="Statement">let</span> MRU_Max_Entries <span class="Statement">=</span> <span class="Number">400</span>
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>f :MRU<span class="Special"><</span><span class="Special">CR</span><span class="Special">></span>
<span class="Comment">""""""""""""""""""""""""""""""</span>
<span class="Comment">" => Command-T</span>
<span class="Comment">""""""""""""""""""""""""""""""</span>
<span class="Statement">let</span> g:CommandTMaxHeight <span class="Statement">=</span> <span class="Number">15</span>
<span class="Statement">set</span> <span class="PreProc">wildignore</span>+=*.o<span class="Statement">,</span>*.obj<span class="Statement">,</span>.git<span class="Statement">,</span>*.pyc
<span class="Statement">noremap</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>j :CommandT<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>
<span class="Statement">noremap</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>y :CommandTFlush<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>
<span class="Comment">""""""""""""""""""""""""""""""</span>
<span class="Comment">" => Vim grep</span>
<span class="Comment">""""""""""""""""""""""""""""""</span>
<span class="Statement">let</span> Grep_Skip_Dirs <span class="Statement">=</span> <span class="Constant">'RCS CVS SCCS .svn generated'</span>
<span class="Statement">set</span> <span class="PreProc">grepprg</span>=/bin/grep\ -nH
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Comment">" => MISC</span>
<span class="Comment">"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""</span>
<span class="Comment">" Remove the Windows ^M - when the encodings gets messed up</span>
<span class="Statement">noremap</span> <span class="Special"><</span><span class="Special">Leader</span><span class="Special">></span>m mmHmt:%s/<span class="Special"><</span><span class="Special">C-V</span><span class="Special">><</span><span class="Special">cr</span><span class="Special">></span>//ge<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>'tzt'm
<span class="Comment">"Quickly open a buffer for scripbble</span>
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>q :e ~/buffer<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>
<span class="Statement">au</span> <span class="Type">BufRead</span>,<span class="Type">BufNewFile</span> ~/buffer <span class="Statement">iab</span> <span class="Special"><</span><span class="Special">buffer</span><span class="Special">></span> xh1 ===========================================
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>pp :setlocal paste!<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>
<span class="Statement">map</span> <span class="Special"><</span><span class="Special">leader</span><span class="Special">></span>bb :cd ..<span class="Special"><</span><span class="Special">cr</span><span class="Special">></span>
</pre>
</body>
</html>