@@ -51,6 +51,9 @@ set belloff=all
51
51
" 외부에서 파일 변경시 자동으로 다시 읽어들임
52
52
set autoread
53
53
54
+ " bufdo
55
+ set hidden
56
+
54
57
" 내부 파일탐색기(netrw)의 에러(BalloonHelp) 메시지 무시
55
58
set noballooneval
56
59
let g:netrw_nobeval = 1
@@ -451,6 +454,9 @@ if s:bFontListAuto
451
454
if len(glob('C:\Windows\Fonts\PoorStory-Regular.ttf'))
452
455
call add(s:KoFonts,[1,["Poor_Story",["h",16,19,25,30,35,40]]],)
453
456
endif
457
+ if len(glob('C:\Windows\Fonts\NIXGONFONTS-M-2.0.ttf'))
458
+ call add(s:KoFonts,[1,["NIXGONFONTS-M_V2.0",["h",16,19,25,30,35,40]]],)
459
+ endif
454
460
if len(glob('C:\Windows\Fonts\Gugi-Regular.ttf'))
455
461
call add(s:KoFonts,[1,["Gugi",["h",14,17,21,26,30,35]]],)
456
462
endif
474
480
let s:KoFonts = [
475
481
\[0,"------------------------------------------------------------"],
476
482
\[1,["Poor_Story",["h",16,18,25,30,35,40]]],
483
+ \[1,["NIXGONFONTS-M_V2.0"]],
477
484
\[0,"------------------------------------------------------------"],
478
485
\[1,["Gowun_Dodum"]],
479
486
\[0,"------------------------------------------------------------"],
@@ -719,7 +726,7 @@ let s:nStartupScreen = 0
719
726
" --------------------------------------------------------------------------------
720
727
721
728
" 화면 왼쪽에 여백 추가, (0 이면 왼편 여백 없음)
722
- let s:foldcolumn_0 = 1
729
+ let s:foldcolumn_0 = s:bGVim ? 1 : 0
723
730
724
731
" 단어가 화면 경계에 걸리면 단어 전체를 다음 라인에 표시(1), 단어를 잘라서 표시함(0)
725
732
let s:bLineBreak = 0
@@ -737,7 +744,7 @@ let s:bEditorModeOn = 0
737
744
" 뷰어모드로 시작시 강제로 편집모드로 전환하는 파일 크기 (N 바이트 미만)
738
745
let s:nEditFileSize = 5
739
746
740
- " 뷰어모드에서 편집 모드로 전환시 화면 분할을 유지 (1), 해제 (0)
747
+ " 뷰어모드에서 편집 모드로 전환시 화면 분할을 해제 (1), 유지 (0)
741
748
let s:bClearNSplit = 0
742
749
743
750
" 외부 편집기 실행 경로
@@ -1107,6 +1114,7 @@ let s:bFullScreen = 0
1107
1114
let s:bMaxmizedScreen = 0
1108
1115
1109
1116
" 전체화면 상단 여백
1117
+ let s:bYpadding = 1
1110
1118
let s:ypd = 0
1111
1119
1112
1120
" 전체화면 영역 기본값
@@ -1141,7 +1149,7 @@ endfun
1141
1149
1142
1150
" 전체화면 toggle
1143
1151
fun GVimFullToggle()
1144
- if &ypadding != s:ypd
1152
+ if s:bYpadding && &ypadding != s:ypd
1145
1153
execute "set ypadding=" . s:ypd
1146
1154
endif
1147
1155
if s:bFullScreen
@@ -1161,7 +1169,7 @@ endfun
1161
1169
1162
1170
" 전체화면 on or refresh
1163
1171
fun GVimFullOn(sFull=s:sFull)
1164
- if &ypadding != s:ypd
1172
+ if s:bYpadding && &ypadding != s:ypd
1165
1173
execute "set ypadding=" . s:ypd
1166
1174
endif
1167
1175
if !s:bFullScreen && (s:bMenubarOn || s:bToolbarOn || s:bVertScrollbarOn)
@@ -1189,7 +1197,7 @@ endfun
1189
1197
1190
1198
" 전체화면일 경우에만 Refresh
1191
1199
fun GVimFullRefresh()
1192
- if &ypadding != s:ypd
1200
+ if s:bYpadding && &ypadding != s:ypd
1193
1201
execute "set ypadding=" . s:ypd
1194
1202
endif
1195
1203
if !s:bFullScreen
@@ -1467,7 +1475,6 @@ fun EasyVimModeOn()
1467
1475
inoremap <C-A> <C-HOME><C-S-END>
1468
1476
1469
1477
set insertmode
1470
- set hidden
1471
1478
1472
1479
inoremap <silent> <Down> <C-R>=pumvisible() ? "\<lt>Down>" : "\<lt>C-O>gj"<CR>
1473
1480
inoremap <silent> <Up> <C-R>=pumvisible() ? "\<lt>Up>" : "\<lt>C-O>gk"<CR>
@@ -1490,7 +1497,6 @@ fun EasyVimModeOff()
1490
1497
let s:bEasyVimModeOn = 0
1491
1498
1492
1499
set noinsertmode
1493
- set nohidden
1494
1500
behave xterm
1495
1501
1496
1502
silent! cunmap <C-A>
@@ -1768,11 +1774,11 @@ endfun
1768
1774
1769
1775
fun KeymapEditNewLine()
1770
1776
" Shift+Enter로 현재줄을 밑으로
1771
- nnoremap <silent> <S-CR> O
1772
- inoremap <silent> <S-CR> O
1777
+ nnoremap <silent> <S-CR> O<ESC>
1778
+ inoremap <silent> <S-CR> <ESC> O
1773
1779
" Ctrl+Enter로 현재줄을 위로
1774
- nnoremap <silent> <C-CR> o
1775
- inoremap <silent> <C-CR> o
1780
+ nnoremap <silent> <C-CR> o<ESC>
1781
+ inoremap <silent> <C-CR> <ESC> o
1776
1782
endfun
1777
1783
1778
1784
" Viewer, Editor, Netrw 모드 구분
@@ -1942,11 +1948,9 @@ fun Cwho()
1942
1948
let ns = NBuffers()
1943
1949
let msg = ""
1944
1950
if ns > 1
1945
- if s:nMode == 0
1946
- for i in range(1,ns-1)
1947
- let msg .= "\<C-w>h"
1948
- endfor
1949
- endif
1951
+ for i in range(1,ns-1)
1952
+ let msg .= "\<C-w>h"
1953
+ endfor
1950
1954
let msg .= "\<C-w>o"
1951
1955
endif
1952
1956
return msg
@@ -1981,13 +1985,13 @@ fun NSplitOnly(n=s:nSplit)
1981
1985
else
1982
1986
if &number
1983
1987
if &foldcolumn
1984
- let msg .= ":set foldcolumn=0\<CR>"
1988
+ let msg .= ":windo set foldcolumn=0\<CR>:wincmd w \<CR>"
1985
1989
endif
1986
1990
if &cursorline
1987
- let msg .= ":set nocursorline\<CR>"
1991
+ let msg .= ":windo set nocursorline\<CR>:wincmd w \<CR>"
1988
1992
endif
1989
1993
if &relativenumber
1990
- let msg .= ":set norelativenumber\<CR>"
1994
+ let msg .= ":windo set norelativenumber\<CR>:wincmd w \<CR>"
1991
1995
endif
1992
1996
endif
1993
1997
endif
@@ -2016,12 +2020,14 @@ fun NSplitOnly(n=s:nSplit)
2016
2020
let msg .= "L$"
2017
2021
endif
2018
2022
silent! execute msg
2019
- if s:nMode == 1 && a:n < 2
2023
+ if s:nMode == 1
2020
2024
if s:bCursorLine && !&cursorline
2021
- set cursorline
2025
+ windo set cursorline
2026
+ wincmd w
2022
2027
endif
2023
2028
if s:bCursorColumn && !&cursorcolumn
2024
- set cursorcolumn
2029
+ windo set cursorcolumn
2030
+ wincmd w
2025
2031
endif
2026
2032
endif
2027
2033
redraw!
@@ -2286,11 +2292,13 @@ fun SetFont(h1=14,h2=11,ln=3,ypd=0,weight1=0,weight2=0,w1=0,w2=0,f1=s:default_ko
2286
2292
let s:msg_fonts[3] = a:ypd
2287
2293
endif
2288
2294
2289
- if &ypadding != a:ypd
2290
- execute "set ypadding=" . a:ypd
2291
- endif
2292
- if l:bDy
2293
- let s:ypd = a:ypd
2295
+ if s:bYpadding
2296
+ if &ypadding != a:ypd
2297
+ execute "set ypadding=" . a:ypd
2298
+ endif
2299
+ if l:bDy
2300
+ let s:ypd = a:ypd
2301
+ endif
2294
2302
endif
2295
2303
2296
2304
if l:bGfn
@@ -2460,13 +2468,13 @@ fun SetCursorOn()
2460
2468
else
2461
2469
call SetCursorStatic()
2462
2470
endif
2463
- if NBuffers() == 1
2464
- if s:bCursorLine
2465
- set cursorline
2466
- endif
2467
- if s:bCursorColumn
2468
- set cursorcolumn
2469
- endif
2471
+ if s:bCursorLine
2472
+ windo set cursorline
2473
+ wincmd w
2474
+ endif
2475
+ if s:bCursorColumn
2476
+ windo set cursorcolumn
2477
+ wincmd w
2470
2478
endif
2471
2479
endfun
2472
2480
@@ -2475,13 +2483,13 @@ fun SetCursorOff()
2475
2483
if IsCursorOn()
2476
2484
execute "set guicursor=" . s:sCursorOff
2477
2485
endif
2478
- if NBuffers() == 1
2479
- if s:bCursorLine
2480
- set nocursorline
2481
- endif
2482
- if s:bCursorColumn
2483
- set nocursorcolumn
2484
- endif
2486
+ if s:bCursorLine
2487
+ windo set nocursorline
2488
+ wincmd w
2489
+ endif
2490
+ if s:bCursorColumn
2491
+ windo set nocursorcolumn
2492
+ wincmd w
2485
2493
endif
2486
2494
endfun
2487
2495
@@ -2554,24 +2562,6 @@ fun SetEditorModeOn(bEasy=0)
2554
2562
endif
2555
2563
endfun
2556
2564
2557
- fun AuBufNewFile()
2558
- if s:nMode == -1
2559
- if s:bEditorModeOn || (s:bEditFileSizeOn && getfsize(expand("%")) < s:nEditFileSize)
2560
- call SetEditorModeOn(s:bStartupEasyVimModeOn)
2561
- else
2562
- call SetViewerModeOn()
2563
- endif
2564
- elseif s:nMode == 0
2565
- if (s:bEditFileSizeOn && getfsize(expand("%")) < s:nEditFileSize)
2566
- call SetEditorModeOn(s:bEasyVimModeOn)
2567
- else
2568
- call SetViewerModeOn()
2569
- endif
2570
- else
2571
- call SetEditorModeOn()
2572
- endif
2573
- endfun
2574
-
2575
2565
" 뷰어 모드 on (편집 모드 off)
2576
2566
fun SetViewerModeOn()
2577
2567
if s:nMode == 0
@@ -2619,13 +2609,19 @@ fun ToggleEditorViewer(bEasy=0)
2619
2609
else
2620
2610
if a:bEasy
2621
2611
if s:bEasyVimModeOn
2622
- if s:bClearNSplit && s:nSplitPrev != s:nSplit
2612
+ if s:nSplit > 1 && (&cursorline || &cursorcolumn)
2613
+ call NSplitOnly(1)
2623
2614
if &cursorline
2624
- set nocursorline
2615
+ windo set nocursorline
2616
+ wincmd w
2625
2617
endif
2626
2618
if &cursorcolumn
2627
- set nocursorcolumn
2619
+ windo set nocursorcolumn
2620
+ wincmd w
2628
2621
endif
2622
+ call NSplitOnly(s:nSplit)
2623
+ endif
2624
+ if s:bClearNSplit && s:nSplitPrev != s:nSplit
2629
2625
" call NSplit() 사용시 KeymapNsplit() 을 2 번 호출하므로 NSplit() 에서 KeymapNsplit() 을 제외한 부분만 사용함
2630
2626
call NSplitOnly(s:nSplitPrev)
2631
2627
let s:nSplit = s:nSplitPrev
@@ -2641,13 +2637,19 @@ fun ToggleEditorViewer(bEasy=0)
2641
2637
if s:bEasyVimModeOn
2642
2638
call EasyVimModeOff()
2643
2639
else
2644
- if s:bClearNSplit && s:nSplitPrev != s:nSplit
2640
+ if s:nSplit > 1 && (&cursorline || &cursorcolumn)
2641
+ call NSplitOnly(1)
2645
2642
if &cursorline
2646
- set nocursorline
2643
+ windo set nocursorline
2644
+ wincmd w
2647
2645
endif
2648
2646
if &cursorcolumn
2649
- set nocursorcolumn
2647
+ windo set nocursorcolumn
2648
+ wincmd w
2650
2649
endif
2650
+ call NSplitOnly(s:nSplit)
2651
+ endif
2652
+ if s:bClearNSplit && s:nSplitPrev != s:nSplit
2651
2653
" call NSplit() 사용시 KeymapNsplit() 을 2 번 호출하므로 NSplit() 에서 KeymapNsplit() 을 제외한 부분만 사용함
2652
2654
call NSplitOnly(s:nSplitPrev)
2653
2655
let s:nSplit = s:nSplitPrev
@@ -2663,6 +2665,24 @@ fun ToggleEditorViewer(bEasy=0)
2663
2665
endif
2664
2666
endfun
2665
2667
2668
+ fun AuBufNewFile()
2669
+ if s:nMode == -1
2670
+ if s:bEditorModeOn || (s:bEditFileSizeOn && getfsize(expand("%")) < s:nEditFileSize)
2671
+ call SetEditorModeOn(s:bStartupEasyVimModeOn)
2672
+ else
2673
+ call SetViewerModeOn()
2674
+ endif
2675
+ elseif s:nMode == 0
2676
+ if (s:bEditFileSizeOn && getfsize(expand("%")) < s:nEditFileSize)
2677
+ call SetEditorModeOn(s:bEasyVimModeOn)
2678
+ else
2679
+ call SetViewerModeOn()
2680
+ endif
2681
+ else
2682
+ call SetEditorModeOn()
2683
+ endif
2684
+ endfun
2685
+
2666
2686
" --------------------------------------------------------------------------------
2667
2687
2668
2688
fun WinSizePreset()
@@ -2675,7 +2695,7 @@ fun WinSizePreset()
2675
2695
endif
2676
2696
endfun
2677
2697
2678
- " 전체 <--> 전체, 일반 <--> 일반
2698
+ " 폰트 크기 설정
2679
2699
fun F101112(n=0)
2680
2700
let nState = GVimState()
2681
2701
let s:nFontSize = s:FontSize[a:n]
@@ -3250,14 +3270,14 @@ fun KeymapCommon()
3250
3270
inoremap <silent> <M-F8> <ESC>:call ToggleFoldColumn()<CR>a
3251
3271
3252
3272
" cursorline on/off
3253
- nnoremap <silent> <S-F8> <ESC>:set cursorline!<CR>
3254
- vnoremap <silent> <S-F8> <ESC>:set cursorline!<CR>
3255
- inoremap <silent> <S-F8> <ESC>:set cursorline!<CR>a
3273
+ nnoremap <silent> <S-F8> <ESC>:windo set cursorline!<CR>:wincmd w <CR>
3274
+ vnoremap <silent> <S-F8> <ESC>:windo set cursorline!<CR>:wincmd w <CR>
3275
+ inoremap <silent> <S-F8> <ESC>:windo set cursorline!<CR>:wincmd w <CR>a
3256
3276
3257
3277
" cursorcolumn on/off
3258
- nnoremap <silent> <C-F8> <ESC>:set cursorcolumn!<CR>
3259
- vnoremap <silent> <C-F8> <ESC>:set cursorcolumn!<CR>
3260
- inoremap <silent> <C-F8> <ESC>:set cursorcolumn!<CR>a
3278
+ nnoremap <silent> <C-F8> <ESC>:windo set cursorcolumn!<CR>:wincmd w <CR>
3279
+ vnoremap <silent> <C-F8> <ESC>:windo set cursorcolumn!<CR>:wincmd w <CR>
3280
+ inoremap <silent> <C-F8> <ESC>:windo set cursorcolumn!<CR>:wincmd w <CR>a
3261
3281
3262
3282
" 북마크 저장
3263
3283
nnoremap <silent> <S-C-F8> <ESC>:call BookmarkSave()<CR>
@@ -3523,7 +3543,7 @@ if 1
3523
3543
autocmd BufNewFile * call AuBufNewFile()
3524
3544
3525
3545
" 텍스트 파일 autocmd
3526
- autocmd BufReadPost * call SetBufAuto()
3546
+ autocmd BufEnter * call SetBufAuto()
3527
3547
autocmd BufWinLeave * if &ft == "text" && s:nMode == 0 | execute "normal! H" | endif
3528
3548
autocmd FileType netrw call SetNetrwModeOn()
3529
3549
0 commit comments