-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSvim.vim
1331 lines (905 loc) · 29.3 KB
/
Svim.vim
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
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Base
""
set nocompatible
scriptencoding utf-8
""
""" Tail: Base
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Color
""
set t_Co=256
set background=dark
"set background=light
""
""" Tail: Color
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Syntax
""
syntax on
""
""" Tail: Syntax
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: ColorTheme
""
" :!ls /usr/share/vim/vim80/colors/ -1
" $ ls /usr/share/vim/vim80/colors/ -1 | grep '\.vim' | awk -F '.' '{print $1}'
" $ ls /usr/share/vim/vim80/colors/ -1 | grep '\.vim' | awk -F '.' '{print "\"colorscheme", $1}'
"colorscheme blue
"colorscheme darkblue
"colorscheme default
"colorscheme delek
"colorscheme desert
"colorscheme elflord
"colorscheme evening
"colorscheme industry
"colorscheme koehler
"colorscheme morning
"colorscheme murphy
"colorscheme pablo " *
"colorscheme peachpuff " *
"colorscheme ron
"colorscheme shine
"colorscheme slate " *
"colorscheme torte
"colorscheme zellner
""
""" Tail: ColorTheme
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: VertSplit
""
" ## overwrite vert
set fillchars=vert:│,fold:·
"set fillchars=vert:\ ,fold:-
" ## Info
":verbose hi
":verbose hi VertSplit
"hi VertSplit term=reverse ctermfg=236 ctermbg=237
"hi VertSplit term=reverse ctermfg=238 ctermbg=238
"hi VertSplit term=reverse ctermfg=236 ctermbg=236
""
""" Tail: VertSplit
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: StatusLine
""
" ## always show status line
set laststatus=2
" ## show the line and column number of the cursor position
set ruler
" ## status line color
"hi StatusLine ctermfg=254 ctermbg=238 cterm=bold
"hi StatusLineNC ctermfg=250 ctermbg=238 cterm=NONE
"hi StatusLine ctermfg=254 ctermbg=236 cterm=bold
"hi StatusLineNC ctermfg=250 ctermbg=236 cterm=NONE
""
""" Tail: StatusLine
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Docs
""
" https://vimhelp.org/
"
" :help 'fillchars'
" https://vimhelp.org/options.txt.html#%27fillchars%27
"
" :help hi
" https://vimhelp.org/options.txt.html#%27fillchars%27
" :help statusline
" :help status-line
" :help laststatus
""
""" Tail: Docs
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: TabLine
""
"hi TabLine term=underline cterm=underline ctermfg=15 ctermbg=242
"hi TabLineSel term=bold ctermfg=142 ctermbg=237
"hi TabLineFill term=reverse ctermfg=243 ctermbg=237
"hi TabLine term=underline cterm=NONE ctermfg=15 ctermbg=236
"hi TabLineSel term=bold ctermfg=34 ctermbg=232
"hi TabLineFill term=reverse ctermfg=236 ctermbg=232
"hi TabLine term=underline cterm=NONE ctermfg=15 ctermbg=236
"hi TabLineSel term=bold ctermfg=32 ctermbg=232
"hi TabLineFill term=reverse ctermfg=236 ctermbg=232
""
""" Tail: TabLine
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: LineNr
""
" LineNr : for line number
" NonText : for [~]
" ## Suite 1
"hi LineNr ctermfg=102 ctermbg=237 cterm=NONE
"hi CursorLineNr ctermfg=11 ctermbg=NONE cterm=NONE
"hi NonText ctermfg=59 ctermbg=236 cterm=NONE
" ## Suite 2
"hi LineNr ctermfg=34 ctermbg=NONE cterm=NONE
"hi CursorLineNr ctermfg=11 ctermbg=NONE cterm=NONE
"hi NonText ctermfg=232 ctermbg=NONE cterm=NONE " Notice: ctermfg=232 will affect cursor on eol(on a append last).
" ## Suite 3
"hi LineNr ctermfg=32 ctermbg=NONE cterm=NONE
"hi CursorLineNr ctermfg=11 ctermbg=NONE cterm=NONE
"hi NonText ctermfg=232 ctermbg=NONE cterm=NONE " Notice: ctermfg=232 will affect cursor on eol(on a append last).
" " Suite 4
"hi LineNr ctermfg=32 ctermbg=NONE cterm=NONE
"hi CursorLineNr ctermfg=11 ctermbg=NONE cterm=NONE
"hi NonText ctermfg=244 ctermbg=NONE cterm=NONE " for [set listchars=eol:↵]
""
""" Tail: LineNr
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Option - Line Number
""
" ## show line number
set number
"set nonumber
" ## relative number
set relativenumber
"set norelativenumber
" ## switch line number shortcut key
nnoremap <Bslash>l :set number!<CR>
nnoremap <Bslash>n :set relativenumber!<CR>
nnoremap ,n :set nonumber<CR>:set norelativenumber<CR>
nnoremap ,l :set number<CR>:set relativenumber<CR>
""
""" Tail: Option - Line Number
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Option - Tab
""
" ## tab
set tabstop=4
set shiftwidth=4
set noexpandtab
"set softtabstop=0
""
""" Tail: Option - Tab
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Indent
""
set autoindent
filetype indent on
"set smartindent
"set cindent
""
""" Tail: Indent
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Wrap
""
"set columns=80
set wrap
"set textwidth=80
"set linebreak
"set wrapmargin=2
""
""" Tail: Wrap
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Cursor Line
""
""hi CursorLine ctermfg=254 ctermbg=237 cterm=NONE
"hi CursorLine ctermfg=NONE ctermbg=237 cterm=NONE
"set cursorline
"set nocursorcolumn
"" :help augroup
"augroup CurrentCursorLine
" au!
" au WinLeave * set nocursorline nocursorcolumn
" au WinEnter * set cursorline nocursorcolumn
" au InsertEnter * set nocursorline nocursorcolumn
" au InsertLeave * set cursorline nocursorcolumn
"augroup END
"augroup CurrentCursorLine
" au!
" au InsertEnter,WinLeave * set nocursorline nocursorcolumn
" au InsertLeave,WinEnter * set cursorline nocursorcolumn
"augroup END
""
""" Tail: Cursor Line
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Cursor Line and Column
""
""hi CursorLine ctermfg=254 ctermbg=237 cterm=NONE
"hi CursorLine ctermfg=NONE ctermbg=237 cterm=NONE
""hi CursorColumn ctermfg=254 ctermbg=237 cterm=NONE
"hi CursorColumn ctermfg=NONE ctermbg=237 cterm=NONE
"set cursorline
"set cursorcolumn
"" :help augroup
"augroup CurrentCursorLine
" au!
" au WinLeave * set nocursorline nocursorcolumn
" au WinEnter * set cursorline cursorcolumn
" au InsertEnter * set nocursorline nocursorcolumn
" au InsertLeave * set cursorline cursorcolumn
"augroup END
""
""" Tail: Cursor Line and Column
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Option - Show Invisibles
""
" :help 'listchars'
" :help 'list'
" http://vimcasts.org/episodes/show-invisibles/
" ## replace invisible chars
"set listchars=tab:▸\ ,eol:¬
"set listchars=tab:▸\ ,
"set listchars=tab:→\ ,eol:↵,trail:·,extends:↷,precedes:↶
" Notice: if set [eol:↵], then must adjust [hi NonText ctermfg=244]
set listchars=tab:→\ ,trail:·,extends:↷,precedes:↶
" ## show invisible chars
set list
" ## switch invisible chars
nnoremap <Bslash>a :set list!<CR>
""
""" Tail: Option - Show Invisibles
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Folding Display
""
"hi Folded term=standout ctermfg=245 ctermbg=237
"hi FoldColumn term=standout ctermfg=245 ctermbg=237
""
""" Tail: Folding Display
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Folding Option
""
set foldenable
"set foldmethod=manual
"set foldmethod=syntax
set foldmethod=indent
"set foldmethod=marker
"set foldmarker={{{,}}}
set foldmarker=Head:,Tail:
set foldnestmax=3
"set foldlevel=0 " close all on start
set foldlevel=4 " over 3, so open all on start
set foldcolumn=0 " not dispaly foldcolumn
"set foldcolumn=1
""
""" Tail: Folding Option
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Scroll
""
set scrolloff=5
set sidescrolloff=15
""
""" Tail: Scroll
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Background
""
" ## Refer
" https://github.com/vim-scripts/fu/blob/master/colors/fu.vim#L39
"hi Normal ctermfg=252 ctermbg=234 guifg=#d0d0d0 guibg=#1c1c1c
" https://github.com/sickill/vim-monokai/blob/master/colors/monokai.vim#L31
"hi Normal ctermfg=231 ctermbg=235 cterm=NONE guifg=#f8f8f2 guibg=#272822 gui=NONE
" ## suite 1
"hi Normal ctermfg=252 ctermbg=234 " let background not transparent
"hi NonText ctermfg=234 ctermbg=NONE cterm=NONE " adjust for [~] (not yet line)
" ## suite 2
"hi Normal ctermfg=231 ctermbg=235 " let background not transparent
"hi NonText ctermfg=235 ctermbg=NONE cterm=NONE " adjust for [~] (not yet line)
" ## suite 3
"hi Normal ctermfg=252 ctermbg=234 " let background not transparent
"hi NonText ctermfg=244 ctermbg=NONE cterm=NONE " adjust for [~] (not yet line)
""
""" Tail: ColorFit - Background
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Mark
""
" ## switch buffer
nnoremap ,m :marks<CR>
""
""" Tail: Mark
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Register
""
" :help registers
nnoremap ,r :registers<CR>
""
""" Tail: Register
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Option
""
" ## for close
set confirm
"set autowrite
" ##
set autoread
" ## encoding
set fileencodings=utf-8,utf-16,big5,gb2312,gbk,gb18030,euc-jp,euc-kr,latin1
"set fileencoding=utf-8
"set termencoding=utf-8
"scriptencoding utf-8
" ## hidden
set hidden
""
""" Tail: Option
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Buffer
""
" ## switch buffer
nnoremap ,` :bprevious<CR>
nnoremap ,<Tab> :bnext<CR>
nnoremap <C-Up> :bprevious<CR>
nnoremap <C-Down> :bnext<CR>
nnoremap <C-k> :bprevious<CR>
nnoremap <C-j> :bnext<CR>
" Note: collision <CTRL+\>
" :help index
" :help index.txt
" :help mode-switching
"nnoremap <C-Bslash> :bnext<CR>
" ## list buffer
nnoremap ,b :ls<CR>
"nnoremap ,b :buffers<CR>
"nnoremap ,b :files<CR>
" ## save
"nnoremap ,s :w<CR>
nnoremap <S-Tab> :w<CR>
inoremap <S-Tab> <Esc>:w<CR>a
""
""" Tail: Buffer
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Quit - Case 1
""
" ## delete buffer
"nnoremap <Bslash>q :bdelete<CR>
"nnoremap <Bslash>z :bdelete!<CR>
"nnoremap <Bslash>x :%bdelete<CR>
"nnoremap <Bslash>c :%bdelete!<CR>
" ## quit
"nnoremap ,q :q<CR>
"nnoremap ,z :q!<CR>
"nnoremap ,x :qa<CR>
"nnoremap ,c :qa!<CR>
""
""" Tail: Quit - Case 1
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Quit - Case 2
""
" ## delete buffer
nnoremap <Bslash>q :q<CR>
nnoremap <Bslash>z :q!<CR>
nnoremap <Bslash>x :qa<CR>
nnoremap <Bslash>c :qa!<CR>
" ## quit
nnoremap ,q :bdelete<CR>
nnoremap ,z :bdelete!<CR>
nnoremap ,x :%bdelete<CR>
nnoremap ,c :%bdelete!<CR>
""
""" Tail: Quit - Case 2
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Change Dir_Path
""
" ## change the current working directory whenever you open a file
"set autochdir
set noautochdir
" ## print current_work_dir_path
nnoremap ,o :pwd<CR>
" ## change current_work_dir_path to current_file_dir_path
nnoremap ,p :set autochdir<CR>:set autochdir!<CR>:pwd<CR>
""
""" Tail: Change Dir_Path
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Docs
""
" http://learnvimscriptthehardway.stevelosh.com/chapters/03.html
" http://learnvimscriptthehardway.stevelosh.com/chapters/04.html
" http://learnvimscriptthehardway.stevelosh.com/chapters/05.html
" https://vim.fandom.com/wiki/Mappinttnng_keys_in_Vim_-_Tutorial_(Part_1)
" https://vim.fandom.com/wiki/Mapping_keys_in_Vim_-_Tutorial_(Part_2)
" https://vim.fandom.com/wiki/Mapping_keys_in_Vim_-_Tutorial_(Part_3)
" https://vim.fandom.com/wiki/Using_tab_pages
" https://vim.fandom.com/wiki/Alternative_tab_navigation
" http://vimdoc.sourceforge.net/
"
" :help keycodes
" http://vimdoc.sourceforge.net/htmldoc/intro.html#keycodes
"
" :help nnoremap
" http://vimdoc.sourceforge.net/htmldoc/map.html#:nnoremap
"
" :help mapmode-n
" http://vimdoc.sourceforge.net/htmldoc/map.html#mapmode-n
"
" :help map-modes
" http://vimdoc.sourceforge.net/htmldoc/map.html#map-modes
" :help normal-index
"
" :help usr_07.txt
" http://vimdoc.sourceforge.net/htmldoc/usr_07.html#usr_07.txt
"
" :help :ls
" http://vimdoc.sourceforge.net/htmldoc/windows.html#:ls
"
" :help :buffers
" http://vimdoc.sourceforge.net/htmldoc/windows.html#:buffers
"
" :help :files
" http://vimdoc.sourceforge.net/htmldoc/windows.html#:files
"
" :help :bnext
" http://vimdoc.sourceforge.net/htmldoc/windows.html#:bnext
"
" :help :bprevious
" http://vimdoc.sourceforge.net/htmldoc/windows.html#:bprevious
"
" ## :help :bdelete
" http://vimdoc.sourceforge.net/htmldoc/windows.html#:bdelete
"
" ## :help 'confirm'
" http://vimdoc.sourceforge.net/htmldoc/options.html#'confirm'
"
" ## :help 'autowrite'
" http://vimdoc.sourceforge.net/htmldoc/options.html#'autowrite'
""
""" Tail: Docs
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Window
" ## switch window
" ## use <Tab> or <C-i>
nnoremap <Tab> <C-w>w
nnoremap <BS> <C-w>W
" ## current window only
"nnoremap ,wa <C-w>o
nnoremap ,wa :only<CR>
" ## close window
nnoremap ,wc :close<CR>
" ## new horizontal window
nnoremap ,wn :new<CR>
" ## new vertical window
nnoremap ,wv :vnew<CR>
" ## hide
nnoremap ,h :hide<CR>
" ## resize window
" :help window-resize
nnoremap <S-Down> <C-w>-
nnoremap <S-Up> <C-w>+
nnoremap <S-Left> <C-w><
nnoremap <S-Right> <C-w>>
""" Tail: Window
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Docs
" http://learnvimscriptthehardway.stevelosh.com/chapters/03.html
" http://learnvimscriptthehardway.stevelosh.com/chapters/04.html
" http://learnvimscriptthehardway.stevelosh.com/chapters/05.html
" https://vim.fandom.com/wiki/Mappinttnng_keys_in_Vim_-_Tutorial_(Part_1)
" https://vim.fandom.com/wiki/Mapping_keys_in_Vim_-_Tutorial_(Part_2)
" https://vim.fandom.com/wiki/Mapping_keys_in_Vim_-_Tutorial_(Part_3)
" https://vim.fandom.com/wiki/Using_tab_pages
" https://vim.fandom.com/wiki/Alternative_tab_navigation
" http://vimdoc.sourceforge.net/
" :help keycodes
" http://vimdoc.sourceforge.net/htmldoc/intro.html#keycodes
"
" :help nnoremap
" http://vimdoc.sourceforge.net/htmldoc/map.html#:nnoremap
"
" :help mapmode-n
" http://vimdoc.sourceforge.net/htmldoc/map.html#mapmode-n
"
" :help map-modes
" http://vimdoc.sourceforge.net/htmldoc/map.html#map-modes
"
" :help usr_08.txt
" http://vimdoc.sourceforge.net/htmldoc/usr_08.html#usr_08.txt
"
" :help window
" http://vimdoc.sourceforge.net/htmldoc/windows.html#window
"
" :help windows.txt
" http://vimdoc.sourceforge.net/htmldoc/windows.html#windows.txt
""" Tail: Docs
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: TabPage
""
" Note:
" Use t for leader
" overwrite exist t
" please read
" :help t
" :help normal-index
" ## switch next or previous
" default gT for tabprevious
" default gt for tabnext
" default <C-PageUp> for tabprevious. but terminal switch tab
" default <C-PageDown> for tabnext. but terminal switch tab
nnoremap tp :tabprevious<CR>
nnoremap tn :tabnext<CR>
nnoremap th :tabprevious<CR>
nnoremap tl :tabnext<CR>
nnoremap t` :tabprevious<CR>
nnoremap t<Tab> :tabnext<CR>
"nnoremap tq :tabnext<CR>
"nnoremap t<Tab> :tabprevious<CR>
nnoremap <C-Left> :tabprevious<CR>
nnoremap <C-Right> :tabnext<CR>
nnoremap <C-h> :tabprevious<CR>
nnoremap <C-l> :tabnext<CR>
nnoremap ,u :redraw<CR> " for orignal <C-l>
" ## switch to first or last
nnoremap tj :tabfirst<CR>
nnoremap tk :tablast<CR>
" ## switch to 1~10
nnoremap t1 1gt
nnoremap t2 2gt
nnoremap t3 3gt
nnoremap t4 4gt
nnoremap t5 5gt
nnoremap t6 6gt
nnoremap t7 7gt
nnoremap t8 8gt
nnoremap t9 9gt
nnoremap t0 10gt
" ## move left or right
nnoremap tu :-tabmove<CR>
nnoremap ti :+tabmove<CR>
nnoremap tmh :-tabmove<CR>
nnoremap tml :+tabmove<CR>
" ## move to first or last
nnoremap tmj :0tabmove<CR>
nnoremap tmk :$tabmove<CR>
" ## tab move
" :help tabmove
" Move the current tab page to after tab page N.
" Use zero to make the current tab page the first one
nnoremap tm0 :0tabmove<CR>
nnoremap tm1 :1tabmove<CR>
nnoremap tm2 :2tabmove<CR>
nnoremap tm3 :3tabmove<CR>
nnoremap tm4 :4tabmove<CR>
nnoremap tm5 :5tabmove<CR>
nnoremap tm6 :6tabmove<CR>
nnoremap tm7 :7tabmove<CR>
nnoremap tm8 :8tabmove<CR>
nnoremap tm9 :9tabmove<CR>
" ## open current window to new tabpage
nnoremap ts :tab split<CR>
" ## new tabpage or close
"nnoremap ,t :tabnew<CR>
"nnoremap tt :tabnew<CR>
nnoremap tg :tabnew<CR>
nnoremap tc :tabclose<CR>
nnoremap te :tabedit<Space>
nnoremap tf :tabnew<CR>:edit<Space>
" ## quit all
nnoremap tqa :qa!<CR>
" ## close other tabpage
" use twa to close other tabpage, then all buffer will hide, if set hidden.
nnoremap twa :tabonly<CR>
" Note:
" use ,c to delete all buffer, then all tapage will close.
" use ,wa to close other window, then all buffer will hide, if set hidden.
" use ,h to hide current buffer, then current tapage will close.
" ## show help page
"nnoremap tb :tabnew<CR>:help<CR><C-w>w:quit!<CR><Esc>
nnoremap tb :tab help<CR>
""
""" Tail: TabPage
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Docs
" http://learnvimscriptthehardway.stevelosh.com/chapters/03.html
" http://learnvimscriptthehardway.stevelosh.com/chapters/04.html
" http://learnvimscriptthehardway.stevelosh.com/chapters/05.html
" https://vim.fandom.com/wiki/Mappinttnng_keys_in_Vim_-_Tutorial_(Part_1)
" https://vim.fandom.com/wiki/Mapping_keys_in_Vim_-_Tutorial_(Part_2)
" https://vim.fandom.com/wiki/Mapping_keys_in_Vim_-_Tutorial_(Part_3)
" https://vim.fandom.com/wiki/Using_tab_pages
" https://vim.fandom.com/wiki/Alternative_tab_navigation
" http://vimdoc.sourceforge.net/
"
" :help tabpage
" http://vimdoc.sourceforge.net/htmldoc/tabpage.html#tabpage
"
" :help tabpage.txt
" http://vimdoc.sourceforge.net/htmldoc/tabpage.html#tabpage.txt
"
" :help t
" http://vimdoc.sourceforge.net/htmldoc/motion.html#t
"
" :help normal-index
"
" :help keycodes
" http://vimdoc.sourceforge.net/htmldoc/intro.html#keycodes
"
" :help nnoremap
" http://vimdoc.sourceforge.net/htmldoc/map.html#:nnoremap
"
" :help mapmode-n
" http://vimdoc.sourceforge.net/htmldoc/map.html#mapmode-n
"
" :help map-modes
" http://vimdoc.sourceforge.net/htmldoc/map.html#map-modes
""" Tail: Docs
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Explore
""
nnoremap ,e :Lexplore<CR>
nnoremap <Space>ef :Lexplore<CR>
"nnoremap ,e :Explore<CR>
"nnoremap ,g :Rexplore<CR>
"nnoremap ,g :Explore<Space>
""
""" Tail: Explore
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Docs
" http://learnvimscriptthehardway.stevelosh.com/chapters/03.html
" http://learnvimscriptthehardway.stevelosh.com/chapters/04.html
" http://learnvimscriptthehardway.stevelosh.com/chapters/05.html
" https://vim.fandom.com/wiki/Mappinttnng_keys_in_Vim_-_Tutorial_(Part_1)
" https://vim.fandom.com/wiki/Mapping_keys_in_Vim_-_Tutorial_(Part_2)
" https://vim.fandom.com/wiki/Mapping_keys_in_Vim_-_Tutorial_(Part_3)
" https://vim.fandom.com/wiki/Using_tab_pages
" https://vim.fandom.com/wiki/Alternative_tab_navigation
" http://vimdoc.sourceforge.net/
" :help keycodes
" http://vimdoc.sourceforge.net/htmldoc/intro.html#keycodes
"
" :help nnoremap
" http://vimdoc.sourceforge.net/htmldoc/map.html#:nnoremap
"
" :help mapmode-n
" http://vimdoc.sourceforge.net/htmldoc/map.html#mapmode-n
"
" :help map-modes
" http://vimdoc.sourceforge.net/htmldoc/map.html#map-modes
"
" :help :Explore
" http://vimdoc.sourceforge.net/htmldoc/pi_netrw.html#:Explore
""" Tail: Docs
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Mode Switch
""
"from insert mode to normal mode
" default use <C-[> or <Esc> or <C-c>
"inoremap jj <Esc>
"inoremap jk <Esc>
"inoremap hl <Esc>
""
""" Tail: Mode Switch
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Head: Info
""
" ## show mode
set showmode
" ## show cmd