View difference between Paste ID: Aa4TD7CK and UYXq7rBP
SHOW: | | - or go back to the newest paste.
1
" Tim Holt's vimrc file
2
" Created probably in 2010, Idunno.
3
"   modified extensively continuously since then.
4
"
5
" This file is full of ‘*’ command ‘links’ __in_this_format.
6
"
7
" Free to use for anyone
8
9
"│-v-1 │ To-Do's
10
"└─────┴─────────
11
  " (not actually settings, just settings todo's)
12
  " TODO Look into the 'tabline' setting
13
  " TODO When numbers are off, change window width.
14
  "
15
  " TODO Use winnr("$"), winnr(), winfixwidth to create a better resize
16
    " This may be obsolete, but I don’t think it is—it’s still necessary when
17
    " not on a wide screen.
18
  " TODO Make “i_Ctrl-R ,” put the “+” yank buffer’s contents.
19
  "
20
  " TODO mappings that “Hesitate”:
21
    " <leader>i
22
    " <leader>w
23
  " TODO Look into the conceal setting and this reddit thread:
24
  "   http://redd.it/okzja
25
  " TODO Set up some cool Arpeggio mappings.
26
  " TODO Look into the 'comments' setting and gq (to add "/// " and stuff)
27
  " TODO Actually clone vim-origami plugin, rather than just download.
28
  " TODO Extract multi-compatible font changing shpiel to a function, instead
29
  "      of repetitive if, else block.
30
  " TODO Make special vim characters into unicode symbols (like the
31
  "      window-dividers into box characters, and 'no line' characters into
32
  "      null-set characters.
33
  " TODO Have timdisplaymode switch display mode switched into!
34
35
"│-v-1 │ “precedence” necessaries.
36
"└─────┴───────────────────────────
37
  "For virtually everything, and sanity in general:
38
  set nocp
39
  filetype plugin on
40
41
  "For that which __requires_utf_8:
42
  set encoding=utf8
43
44
  " Note: Make sure to link here from _every_ line that has a prerequisite,
45
  " and from every location in this file where the prerequisite would more
46
  " naturally be categorized.
47
48
49
"│-v-1 │ Plug-in Settings
50
"└─┬───┴─┬────────────────
51
  "│-v-2 │ plug-in manager
52
  "└─────┴─────────────────
53
    " pathogen startup stuff
54
      filetype off
55
      call pathogen#infect()
56
      call pathogen#helptags()
57
      filetype plugin on
58
59
60
  "│-v-2 │ Individual plug-ins
61
  "└─┬───┴─┬───────────────────
62
    "│-v-3 │ Gundo Settings
63
    "└─────┴────────────────
64
      nnoremap <silent> <leader>u :GundoToggle<cr>
65
      let g:gundo_help=1
66
      let g:gundo_right=0
67
      let g:gundo_preview_bottom=0
68
69
      " Mappings (@__gundo_mappings):
70
        " toggle Gundo
71
72
    "│-v-3 │ vimwiki Settings
73
    "└─────┴──────────────────
74
      let g:vimwiki_camel_case = 0
75
76
      let wiki_1 = {}
77
      let wiki_1.path = '~/Dropbox/Vim/vimwiki/'
78
      let wiki_1.nested_syntaxes = {'c++': 'cpp', 'asm': 'asm', 'sh': 'sh'}
79
80
      let wiki_2 = {}
81
      let wiki_2.path = '~/Dropbox/timwrite/vimfriendly/Inhuman_Universe/wiki/'
82
83
      let wiki_3 = {}
84
      let wiki_3.path = '~/Dropbox/code/ZigZagDungeon/productionwiki/'
85
86
      let g:vimwiki_list = [wiki_1, wiki_2, wiki_3]
87
88
    "│-v-3 │ Full-Screen Mode Settings
89
    "└─────┴───────────────────────────
90
      " Mappings (@__full_screen_mappings):
91
      function! ToggleFullScreen()
92
        if has('win32')
93
          :call libcallnr("gvimfullscreen.dll", "ToggleFullScreen", 0)
94
        endif
95
      endfunction
96
97
    "│-v-3 │ 'a' settings
98
    "└─────┴──────────────
99
      " Mappings (@__a_mappings):
100
101
      "Hopefully, changing the default when associated source doesn't yet exist.
102
      let g:alternateExtensions_h = "cpp,c,cxx,cc,CC"
103
104
    "│-v-3 │ OmniCppComplete Settings
105
    "└─────┴──────────────────────────
106
      au BufNewFile,BufRead,BufEnter *.cpp,*.h set omnifunc=omni#cpp#complete#Main
107
      let OmniCpp_ShowPrototypeInAbbr = 1
108
109
    "│-v-3 │ PowerShell syntaxy-stuff settings
110
    "└─────┴───────────────────────────────────
111
      au BufNewFile,BufRead,BufEnter *.ps1 set filetype=ps1
112
113
    "│-v-3 │ Rainbow Parentheses Settings
114
    "└─────┴──────────────────────────────
115
      " (Steve Losh’s modified version, cleaned up and jazz)
116
117
      " Mappings (@__rainbow_parentheses_mappings):
118
      autocmd BufEnter * RainbowParenthesesLoadRound
119
      autocmd BufEnter * RainbowParenthesesLoadBraces
120
      "autocmd BufEnter * RainbowParenthesesLoadChevrons
121
122
    "│-v-3 │ Powerline Settings
123
    "└─────┴────────────────────
124
      let Powerline_cache_file = ""
125
      let Powerline_symbols = "fancy"
126
127
    "│-v-3 │ UltiSnips Settings
128
    "└─────┴────────────────────
129-
      let g:UltiSnipsJumpForwardTrigger="<tab>"
129+
130-
      let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
130+
131
      let g:UltiSnipsEditSplit = "horizontal"
132
      let g:UltiSnipsUsePythonVersion = 2
133
134
      " Wasn't compatible with digraphs, so I thought I'd try a remap.
135
      " Also wasn't compatible with my custom use of <s-tab>, even though it
136
      " is after a reestablishment of said custom use, so there you go.
137
      let g:UltiSnipsExpandTrigger="<c-t>"
138
      let g:UltiSnipsJumpForwardTrigger="<c-n>"
139
      let g:UltiSnipsJumpBackwardTrigger="<c-h>"
140
141
      " Enable importing of custom modules for python interpolation.
142
      " TODO Universalize this.
143
      py import sys; sys.path.append("C:\\Users\\atimh_000\\Dropbox\\Vim\\GlobalRuntimePath\\UltiSnipsSnippets\\pymodules\\")
144
145
    "│-v-3 │ Arpeggio Settings
146
    "└─────┴───────────────────
147
      call arpeggio#load()
148
149
    "│-v-3 │ EasyMotion
150
    "└─────┴────────────
151
      let g:EasyMotion_leader_key = '('
152
153
    "│-v-3 │ Indent Guides
154
    "└─────┴───────────────
155
      let g:indent_guides_space_guides = 0
156
157
    "│-v-3 │ Showmarks
158
    "└─────┴───────────
159
      let showmarks_enable = 0
160
      "let showmarks_include = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.'`^<>[]{}()\""
161
      let showmarks_include = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.'`^"
162
      let g:showmarks_ignore_type = "q"
163
164
      let showmarks_textlower = "\t:"
165
      let showmarks_textupper = "\t:"
166
      let showmarks_textother = "\t:"
167
168
"│-v-1 │ Set-up
169
"└─┬───┴─┬──────
170
  "│-v-2 │ Behavior
171
  "└─┬───┴─┬────────
172
    "│-v-3 │ “meta” (settings settings)
173
    "└─────┴────────────────────────────
174
175
      " Quick settings access
176
        " TODO: Move the function to function area, remap to remap area?
177
        "         Honestly, I think not—an exception makes sense here, at least.
178
        function! MyQuickSettings()
179
          :tabedit $MYVIMRC
180
          :lcd $HOME
181
          :vs ~/Dropbox/Vim/vimrc.vim
182
          :vertical resize 101
183
        endfunction
184
185
        nnoremap <silent> <F2> :call MyQuickSettings()<cr>
186
187
188
      " Reload vimrc when saved
189
        au! BufWritePost $MYVIMRC source $MYVIMRC
190
191
        " Doesn’t work, because MyRefreshFullScreen doesn’t work.
192
        " TODO: evaluate this thing.
193
        function! MyRefreshVimrc()
194
          :source $MYVIMRC
195
          :call MyRefreshFullScreen()
196
        endfunction
197
198
    "│-v-3 │ Tweakings/Feature Settings
199
    "└─┬───┴─┬──────────────────────────
200
      "│-v-4 │ Intended/Built-In Settings
201
      "└─┬───┴─┬──────────────────────────
202
        "│-v-5 │ Editing Settings
203
        "└─────┴──────────────────
204
          set expandtab
205
          set shiftwidth=2
206
          set softtabstop=2
207
          set tabstop=2
208
          set backspace=indent,eol,start
209
          set ruler
210
          :syntax enable
211
          :set cindent
212
213
          " Stopped using this when I started using Powershell more.
214
          ":set shellslash
215
216
          :set switchbuf=useopen,usetab,newtab
217
218
          " Allows the closing of buffers without saving.
219
          set hidden
220
221
          " allows cursor position past true end of line
222
          set virtualedit=all
223
224
          " Whether jumping to another line (like with "G") goes to the start
225
          " of the line, or tries to stay in the same column.
226
          set nostartofline
227
228
        "│-v-5 │ vimdiff settings
229
        "└─────┴──────────────────
230
          set diffopt=filler,vertical,context:3
231
232
        "│-v-5 │ Spelling
233
        "└─────┴──────────
234
          set spelllang=en_us,es,eo
235
236
        "│-v-5 │ Status Line
237
        "└─────┴─────────────
238
          ":set statusline=%F%m%r%h%w\ (%{&ff})\ typ:%Y\ ASCII=\%04.8b\ HEX=\%04.4B\ %l,%v %p%%\ LEN=%L
239
          "set statusline=%<[%02n]\ %F%(\ %m%h%w%y%r%)\ %a%=\ %8l,%c%V/%L\ (%P)\ [%08O:%02B]
240
          set statusline=%<[%02n]\ %F%(\ %m%h%w%y%r%)\ %a%=\ %8l,%c%V/%L\ (%P)\ [%02B]
241
242
          set laststatus=2
243
            " “The value of this option influences when the
244
            " last window will have a status line…”
245
246
        "│-v-5 │ Folds
247
        "└─────┴──────────
248
          :set foldmethod=marker
249
          :set foldmarker=//v,//^
250
          :set commentstring=%s
251
252
        "│-v-5 │ WildMenu
253
        "└─────┴──────────
254
          set wildmode=longest,list,full
255
          :set wildmenu
256
257
        "│-v-5 │ persistent undo
258
        "└─────┴─────────────────
259
          set undofile
260
261
        "│-v-5 │ search settings
262
        "└─────┴─────────────────
263
          set ignorecase
264
          set smartcase
265
          set gdefault
266
          set incsearch
267
          set showmatch
268
          set hlsearch
269
          " Mappings (@__search_mappings):
270
          " - Switch off search highlighting.
271
272
        "│-v-5 │ netrw settings
273
        "└─────┴────────────────
274
          let g:netrw_liststyle=3
275
276
        "│-v-5 │ External Shell Settings
277
        "└─────┴─────────────────────────
278
          " __requires_utf_8:
279
280
          " The && !(&diff) is there because shell=powershell.exe breaks
281
          " vimdiff.
282
          if has('win32') && !(&diff) && 0
283
            set shell=powershell.exe
284
            set shellcmdflag=-c
285
            set shellpipe=|
286
            set shellredir=>
287
          endif
288
289
        "│-v-5 │ mkview settings
290
        "└─────┴─────────────────
291
          set viewdir=~/Dropbox/Vim/GlobalRuntimePath/view/
292
293
        "│-v-5 │ Custom Digraph Settings
294
        "└─────┴─────────────────────────
295
        " Esperanto:
296
          :digraph Cx 264
297
          :digraph cx 265
298
          :digraph Gx 284
299
          :digraph gx 285
300
          :digraph Hx 292
301
          :digraph hx 293
302
          :digraph Jx 308
303
          :digraph jx 309
304
          :digraph Sx 348
305
          :digraph sx 349
306
          :digraph Ux 364
307
          :digraph ux 365
308
309
        " Graphical, dark diamond suit and dark heart suit.
310
          :digraph cD 9830
311
          :digraph cH 9829
312
313
      "│-v-4 │ Customized behavior
314
      "└─┬───┴─┬───────────────────
315
        "│-v-5 │ (function) Toggle Spell Checking.
316
        "└─────┴───────────────────────────────────
317
          " (mapping @__spell_check_mapping)
318
          function! g:ToggleSpellMode()
319
            :set spell!
320
            if &l:spell
321
              echo "Spell check ON"
322
            else
323
              echo "Spell check OFF"
324
            endif
325
          endfunction
326
327
        "│-v-5 │ (function) Toggle Fixed Window Width.
328
        "└─────┴───────────────────────────────────────
329
          " (mapping @__fixed_window_width)
330
331
          function! g:TimToggleWindowFixedWidth()
332
            :set winfixwidth!
333
            if &l:winfixwidth
334
              echo "Fixed Window Width ON"
335
            else
336
              echo "Fixed Window Width OFF"
337
            endif
338
          endfunction
339
340
        "│-v-5 │ (function) Toggle Fixed Window Height.
341
        "└─────┴───────────────────────────────────────
342
          " (mapping @__fixed_window_height)
343
344
          function! g:TimToggleWindowFixedHeight()
345
            :set winfixheight!
346
            if &l:winfixheight
347
              echo "Fixed Window Height ON"
348
            else
349
              echo "Fixed Window Height OFF"
350
            endif
351
          endfunction
352
353
        "│-v-5 │ (function) Box character (turburul) hax
354
        "└─────┴─────────────────────────────────────────
355
          " This:
356
          " r---—v-,
357
          " |    | |
358
          " >----+-<
359
          " |    | |
360
          " >————+—<
361
          " |    | |
362
          " L----^—’
363
          "
364
          " Becomes This:
365
          " ┌────┬─┐
366
          " │    │ │
367
          " ├────┼─┤
368
          " │    │ │
369
          " ├────┼─┤
370
          " │    │ │
371
          " └────┴─┘
372
        " (mapping @__box_characters_mapping)
373
          function! g:BoxCharacters()
374
            :s'r'┌'e
375
            gv
376
            :s','┐'e
377
            gv
378
            :s'’'┘'e
379
            gv
380
            :s/'/┘/e
381
            gv
382
            :s'L'└'e
383
384
            gv
385
            :s'|'│'e
386
            gv
387
            :s'-'─'e
388
            gv
389
            :s'—'─'e
390
            gv
391
            :s'+'┼'e
392
393
            gv
394
            :s'\^'┴'e
395
            gv
396
            :s'>'├'e
397
            gv
398
            :s'v'┬'e
399
            gv
400
            :s'T'┬'e
401
            gv
402
            :s'<'┤'e
403
          endfunction
404
405
        "│-v-5 │ (functions) Multi-Window automatic stuff
406
        "└─────┴──────────────────────────────────────────
407
          " These settings rely heavily on the specific ways I personally use Vim.
408
          " (auto-commands @__multi_window_autocmds)
409
410
          function! TimWinLeaveWithGundo()
411
            if !GundoInTab() && g:timdisplaymode == 'code'
412
              ":vertical resize
413
              :set nowrap
414
              ":set norelativenumber
415
              ":set nonumber
416
            endif
417
          endfunction
418
419
          function! TimWinEnterWithGundo()
420
            if !GundoInTab() && g:timdisplaymode == 'code'
421
              if g:tim_number_mode == 0
422
                ":vertical resize 81
423
              else
424
                ":vertical resize 85
425
              endif
426
              :set wrap
427
              :call g:TimDisplayNumbers()
428
            endif
429
          endfunction
430
431
          function! GundoInTab()
432
            let s:current_tabpagebuflist = tabpagebuflist()
433
            for i in s:current_tabpagebuflist
434
              if bufname(i) == "__Gundo__"
435
                return 1
436
              endif
437
            endfor
438
            return 0
439
          endfunction
440
441
        "│-v-5 │ (functions) Line-number Mode switching
442
        "└─────┴────────────────────────────────────────
443
          " (mappings @__line_number_modes_mappings)
444
445
          let g:tim_number_mode = 1
446
447
          function! g:ToggleNuMode(...)
448
            if a:0
449
              if(a:1 != -1)
450
                let g:tim_number_mode = a:1
451
              else
452
                let g:tim_number_mode -= 1
453
              endif
454
            else
455
              let g:tim_number_mode += 1
456
            endif
457
458
            if g:tim_number_mode > 2
459
              let g:tim_number_mode = 0
460
            endif
461
            if g:tim_number_mode < 0
462
              let g:tim_number_mode = 2
463
            endif
464
465
            call g:TimDisplayNumbers()
466
          endfunc
467
468
          function! g:TimDisplayNumbers()
469
            if(g:tim_number_mode == 1)
470
              if g:timdisplaymode == 'code'
471
                ":vertical resize 85
472
              endif
473
              set number
474
            elseif(g:tim_number_mode == 2)
475
              if g:timdisplaymode == 'code'
476
                ":vertical resize 85
477
              endif
478
              set relativenumber
479
            else
480
              if g:timdisplaymode == 'code'
481
                ":vertical resize 81
482
              endif
483
              set nonumber
484
              set norelativenumber
485
            endif
486
          endfunc
487
488
        "│-v-5 │ (functions) View and Folds saving
489
        "└─────┴───────────────────────────────────
490
          " (mappings @__viewdir_mappings)
491
          " TODO: for realsy, this needs to be its own script in the
492
          " repository
493
          " TODO: echo the current mode on toggle
494
          " TODO: loadview automatically in zigzagproj mode on file loading
495
496
          function! g:toggleviewdir()
497
            if g:viewdirmode == "normal"
498
              let g:viewdirmode = "zigzagproj"
499
            else
500
              let g:viewdirmode = "normal"
501
            endif
502
503
            call g:applyviewdir()
504
          endfunction
505
506
          function! g:applyviewdir()
507
            if g:viewdirmode == "normal"
508
              set viewdir=~/Dropbox/Vim/GlobalRuntimePath/view/
509
            else
510
              set viewdir=~/Dropbox/code/ZigZagDungeon/vimview/
511
            endif
512
            "echo "
513
          endfunction
514
515
          let g:viewdirmode = "normal"
516
          call g:applyviewdir()
517
518
    "│-v-3 │ Mappings, Auto-Commands & Abbreviations.
519
    "└─┬───┴─┬────────────────────────────────────────
520
      "│-v-4 │ Mappings
521
      "└─┬───┴─┬────────
522
        "│-v-5 │ Leader Key Settings
523
        "└─────┴─────────────────────
524
          let mapleader = ","
525
                " doesn't work?:
526
          noremap <C-,> <leader>
527
528
          " Still want this functionality!
529
          map \u <Nop>
530
          nnoremap \ ,
531
532
        "│-v-5 │ navigation remaps
533
        "└─────┴─────────────────────
534
          "nnoremap <tab> %
535
          "vnoremap <tab> %
536
537
          nnoremap <silent> <leader>t :tabs<cr>
538
539
          nnoremap j gj
540
          nnoremap k gk
541
          nnoremap gj j
542
          nnoremap gk k
543
544
          nnoremap <leader>h <C-W>h
545
          nnoremap <leader>l <C-W>l
546
          nnoremap <leader>j <C-W>j
547
          nnoremap <leader>k <C-W>k
548
549
        "│-v-5 │ Normal-Mode alternative access.
550
        "└─────┴─────────────────────────────────
551
          " TODO: Change the windows mapping to changing caps lock to esc.
552
          "if has('win32')
553
          "  inoremap hh <esc>
554
          "  cnoremap hh <esc>
555
          "endif
556
          "Arpeggio inoremap tn <esc>
557
          "Arpeggio cnoremap tn <esc>
558
559
        "│-v-5 │ toggle showing of invisible characters
560
        "└─────┴────────────────────────────────────────
561
          nnoremap <silent> <leader>I :call g:ToggleList()<cr>
562
          " TODO finish this indicator and stick it in the right place.
563
          function! g:ToggleList()
564
            :set list!
565
            if &l:list
566
              echo "List Invisible Characters ON"
567
            else
568
              echo "List Invisible Characters OFF"
569
            endif
570
          endfunction
571
572
        "│-v-5 │ OS clip-board easy-integration.
573
        "└─────┴─────────────────────────────────
574
          nnoremap <leader>y "+y
575
          vnoremap <leader>y "+y
576
577
          nnoremap <leader>Y "+Y
578
          vnoremap <leader>Y "+Y
579
580
          nnoremap <leader>p "+p
581
          vnoremap <leader>p "+p
582
583
          nnoremap <leader>P "+P
584
          vnoremap <leader>P "+P
585
586
        "│-v-5 │ Jump to file shortcut
587
        "└─────┴───────────────────────
588
          nnoremap <silent> <leader>f <c-w>gf
589
590
        "│-v-5 │ File-name completion shortcut
591
        "└─────┴───────────────────────────────
592
          inoremap <c-f> <c-x><c-f>
593
594
        "│-v-5 │ __search_mappings:
595
        "└─────┴────────────────────
596
          " Switch off search highlighting.
597
          nnoremap <silent> <leader><space> :noh<cr>
598
599
        "│-v-5 │ Quick window-width reset
600
        "└─────┴──────────────────────────
601
          nnoremap <leader><Bar>    :vertical resize 85<cr>
602
          nnoremap <leader><Bslash> :vertical resize 85<cr>
603
604
        "│-v-5 │ Generate Tag files
605
        "└─────┴────────────────────
606
          "map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
607
          "map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q *.h *.cpp<CR>
608-
            nnoremap <silent> <leader>n :call g:ToggleNuMode()<cr>
608+
609
610
        "│-v-5 │ Arpeggio shortcuts experiment
611
        "└─────┴───────────────────────────────
612
          Arpeggio inoremap s, /
613-
            nnoremap <silent> <leader>N0 :call g:ToggleNuMode(0)<cr>
613+
614-
            nnoremap <silent> <leader>No :call g:ToggleNuMode(0)<cr>
614+
615-
            nnoremap <silent> <leader>NO :call g:ToggleNuMode(0)<cr>
615+
616
          Arpeggio cnoremap s. \
617-
            nnoremap <silent> <leader>Na :call g:ToggleNuMode(1)<cr>
617+
618-
            nnoremap <silent> <leader>NA :call g:ToggleNuMode(1)<cr>
618+
619
        "└─────┴─────────
620-
            nnoremap <silent> <leader>Nr :call g:ToggleNuMode(2)<cr>
620+
621-
            nnoremap <silent> <leader>NR :call g:ToggleNuMode(2)<cr>
621+
622
        "│-v-5 │ mappings to customized-behavior & functions.
623
        "└─┬───┴─┬────────────────────────────────────────────
624
          "│-v-6 │ __spell_check_mapping:
625
          "└─────┴────────────────────────
626
            nnoremap <F5> :call g:ToggleSpellMode()<cr>
627
628
          "│-v-6 │ __fixed_window_width:
629
          "└─────┴───────────────────────
630
            nnoremap <leader>W :call g:TimToggleWindowFixedWidth()<cr>
631
632
          "│-v-6 │ __fixed_window_height:
633
          "└─────┴───────────────────────
634
            nnoremap <leader>H :call g:TimToggleWindowFixedHeight()<cr>
635
636
          "│-v-6 │ __box_characters_mapping:
637
          "└─────┴───────────────────────────
638
            vnoremap <silent> <leader>x :call g:BoxCharacters()<cr>
639
640
          "│-v-6 │ __line_number_modes_mappings:
641
          "└─────┴───────────────────────────────
642
            "nnoremap <silent> <leader>n :call g:ToggleNuMode()<cr>
643
644
            nnoremap <silent> <leader>NN :call g:ToggleNuMode(-1)<cr>
645
646
647
            nnoremap <silent> <leader>n0 :call g:ToggleNuMode(0)<cr>
648
            nnoremap <silent> <leader>no :call g:ToggleNuMode(0)<cr>
649
            nnoremap <silent> <leader>nO :call g:ToggleNuMode(0)<cr>
650
651
            nnoremap <silent> <leader>na :call g:ToggleNuMode(1)<cr>
652
            nnoremap <silent> <leader>nA :call g:ToggleNuMode(1)<cr>
653
654
            nnoremap <silent> <leader>nr :call g:ToggleNuMode(2)<cr>
655
            nnoremap <silent> <leader>nR :call g:ToggleNuMode(2)<cr>
656
657
          "│-v-6 │ __display_mode_mappings:
658
          "└─────┴──────────────────────────
659
            nnoremap <silent> <leader>d :call ToggleDisplayMode()<cr>
660
661
          "│-v-6 │ __viewdir_mappings:
662
          "└─────┴─────────────────────
663
            nnoremap <silent> <f6> :call g:toggleviewdir()<cr>
664
665
          "│-v-6 │ Insert literal tab character
666
          "└─────┴──────────────────────────────
667
            inoremap <silent> <s-tab> <c-v><tab>
668
669
          "│-v-6 │ Insert date:
670
          "└─────┴──────────────
671
            nmap <F3> a<C-R>=strftime("%Y-%m-%d")<CR><Esc>
672
            imap <F3> <C-R>=strftime("%Y-%m-%d")<CR>
673
            vmap <F3> di<C-R>=strftime("%Y-%m-%d")<CR><Esc>
674
675
            nmap <S-F3> a<C-R>=strftime("%Y-%m-%d %a %I:%M %p")<CR><Esc>
676
            imap <S-F3> <C-R>=strftime("%Y-%m-%d %a %I:%M %p")<CR>
677
            vmap <S-F3> di<C-R>=strftime("%Y-%m-%d %a %I:%M %p")<CR><Esc>
678
679
680
        "│-v-5 │ mappings to Plug-ins
681
        "└─┬───┴─┬────────────────────
682
          "│-v-6 │ __gundo_mappings:
683
          "└─────┴───────────────────
684
            " toggle Gundo:
685
            nnoremap <silent> <leader>u :GundoToggle<cr>
686
687
          "│-v-6 │ __full_screen_mappings:
688
          "└─────┴─────────────────────────
689
            map <silent> <F11> <Esc>:call ToggleFullScreen()<CR>
690
691
          "│-v-6 │ __a_mappings:
692
          "└─────┴───────────────
693
            nnoremap <silent> <leader>a :AV<cr>
694
            nnoremap <silent> <leader>s :AV<cr>
695
696
            " TODO: move this somewhere more sensible:
697
            nnoremap <silent> <leader>v :vs<cr>
698
699
          "│-v-6 │ __rainbow_parentheses_mappings:
700
          "└─────┴─────────────────────────────────
701
            nnoremap <silent> <leader>, :RainbowParenthesesToggle<cr>
702
703
      "│-v-4 │ Auto-commands
704
      "└─┬───┴─┬─────────────
705
        "│-v-5 │ Independent auto-commands
706
        "└─────┴───────────────────────────
707
          autocmd BufRead,BufNewFile *.txtfmt setfiletype txtfmt
708
        "│-v-5 │ function auto-commands
709
        "└─┬───┴─┬──────────────────────
710
          "│-v-6 │ __multi_window_autocmds
711
          "└─────┴─────────────────────────
712
            autocmd WinLeave * :call TimWinLeaveWithGundo()
713
            autocmd WinEnter * :call TimWinEnterWithGundo()
714
715
716
      "│-v-4 │ Abbreviations
717
      "└─┬───┴─┬─────────────
718
        "│-v-5 │ Shortcuts
719
        "└─────┴───────────
720
          ab ?! ‽
721
          ab !? ‽
722
723
          :ab ,.0 ⁰
724
          :ab ,.1 ¹
725
          :ab ,.2 ²
726
          :ab ,.3 ³
727
          :ab ,.4 ⁴
728
          :ab ,.5 ⁵
729
          :ab ,.6 ⁶
730
          :ab ,.7 ⁷
731
          :ab ,.8 ⁸
732
          :ab ,.9 ⁹
733
734
        "│-v-5 │ Corrections
735
        "└─────┴─────────────
736
          :cab Wa wa
737
738
  "│-v-2 │ Appearance
739
  "└─┬───┴─┬──────────
740
    "│-v-3 │ Built-in Settings
741
    "└─┬───┴─┬─────────────────
742
      "│-v-4 │ GUI Options (default is "egmrLtT")
743
      "└─────┴────────────────────────────────────
744
        :set guioptions=c
745
        " Note that fullscreen plugin doesn't work well with anything but null
746
        " (or similar).
747
748
      "│-v-4 │ Color scheme
749
      "└─────┴──────────────
750
        set t_Co=256
751
752
        " Not sure if this one's actually necessary.
753
        :set background=dark
754
755
        if &t_Co > 2 || has("gui_running")
756
          ":colorscheme timbat
757
          :colorscheme badwolf
758
          ":colorscheme timatrix " I've put a lot of my own adjustments into this one.
759
          ":colorscheme pyte
760
        else
761
          :colorscheme morodark
762
        endif
763
764
      "│-v-4 │ Current-Row-Column highlighting
765
      "└─────┴─────────────────────────────────
766
        "autocmd WinLeave * set nocursorline nocursorcolumn
767
        "autocmd WinEnter * set cursorline cursorcolumn
768
        "set cursorline cursorcolumn
769
770
        autocmd WinLeave * set nocursorline
771
        autocmd WinEnter * set cursorline
772
        set cursorline
773
774
      "│-v-4 │ Window Width & Such
775
      "└─────┴─────────────────────
776
        set winminwidth=5
777
778
      "│-v-4 │ Invisible characters depiction.
779
      "└─────┴─────────────────────────────────
780
        " __requires_utf_8:
781
        set listchars=tab:│·,trail:·,extends:→
782-
              set guifont=Liberation\ Mono:h9
782+
783
        au BufNewFile,BufRead *.cpp,*.h,*.vim,*.rb,*.java,*.snippets,*.py set list
784-
              set guifont=Liberation\ Mono\ 9
784+
785
      "│-v-4 │ Miscellaneous
786
      "└─────┴───────────────
787
        set showcmd
788
        setglobal display=lastline,uhex
789
790
      "│-v-4 │ Color Column
791
      "└─────┴──────────────
792
        set colorcolumn=81,101,121
793
794
    "│-v-3 │ Custom Functions
795
    "└─┬───┴─┬────────────────
796
      "│-v-4 │ Display Mode Stuff
797
      "└─────┴────────────────────
798
        " Mappings (@__display_mode_mappings):
799
        function! g:ApplyDisplayMode(...)
800
          if a:0
801
            let g:timdisplaymode = a:1
802
          endif
803
804
          if g:timdisplaymode == 'code'
805
            "set cursorcolumn
806
            set nospell                                    " -v-
807
808
            if &filetype=='vimwiki'
809
              setlocal linebreak
810
            else
811
              set nolinebreak
812
            endif
813
814
            if has('win32')
815
              " :set guifont=consolas:h12
816
              " set guifont=Liberation\ Mono:h9
817
              set guifont=Liberation\ Mono:h12
818
            else
819
              set guifont=Liberation\ Mono\ 12
820
            endif
821
822
            colorscheme badwolf
823
            set display-=lastline
824
            let &showbreak = ''
825
            set foldmarker=-v-,-^-
826
            "au WinEnter * set cursorcolumn
827
                                                           " -^-
828
          elseif g:timdisplaymode == 'composition'
829
            set nocursorcolumn
830
            setlocal spell                                 " -v-
831
            inoremap <C-BS> <Esc>b1z=wi
832
833
            setlocal linebreak
834-
" vim: set fmr=-v-,-^- fdm=marker cms=//%s et ts=2 sw=2 :
834+
835
            if has('win32')
836
              set guifont=Liberation\ Mono:h13
837
            else
838
              set guifont=Liberation\ Mono\ 13
839
            endif
840
841
            "colorscheme timatrix
842
            setlocal display+=lastline
843
            let &showbreak = '  '
844
            " setlocal foldmarker={{{,}}}
845
            set foldmarker=-v-,-^-
846
            au BufEnter * set nocursorcolumn
847
          endif                                            " -^-
848
        endfunction
849
850
        let g:timdisplaymode = ''
851
        call g:ApplyDisplayMode('code')
852
853
        function! ToggleDisplayMode()
854
          if g:timdisplaymode == 'code'
855
            let g:timdisplaymode = 'composition'
856
          else
857
            let g:timdisplaymode = 'code'
858
          endif
859
860
          call g:ApplyDisplayMode()
861
        endfunction
862
863
"│-v-1 │ Transient settings
864
"└─────┴────────────────────
865
  " This is meant for sourcing in convenience settings that don't really
866
  " belong in this file.
867
  :source ~/Dropbox/code/ZigZagDungeon/vimsetup.vim
868
869
" vim: set fmr=-v-,-^- fdm=marker cms=//%s et ts=2 sw=2 sts=2 :