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