Skip to content

Commit efb65e2

Browse files
author
xvim64
committed
1.0.13
minor update
1 parent f583aa3 commit efb65e2

File tree

7 files changed

+173
-133
lines changed

7 files changed

+173
-133
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,8 @@ Vim 텍스트 뷰어에 포함된 폰트는 Open Font License, Ubuntu Font Licen
494494
- [고운 바탕 + 라이선스](https://fonts.google.com/specimen/Gowun+Batang?subset=korean)
495495
- [고운 돋움 + 라이선스](https://fonts.google.com/specimen/Gowun+Dodum?subset=korean)
496496

497+
- [닉스곤 폰트 + 라이선스](http://www.nixgon.com/nixgon-fonts)
498+
497499
- [B사감과 러브레터](https://gongu.copyright.or.kr/gongu/wrt/wrt/view.do?wrtSn=9002100&menuNo=200019)
498500
- [내마음 고요히 흐른 봄길 우에](https://gongu.copyright.or.kr/gongu/wrt/wrt/view.do?wrtSn=9000343&menuNo=200019)
499501
- [동백꽃](https://gongu.copyright.or.kr/gongu/wrt/wrt/view.do?wrtSn=9000397&menuNo=200026)

config/_vimrc.txt

Lines changed: 93 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ set belloff=all
5151
" 외부에서 파일 변경시 자동으로 다시 읽어들임
5252
set autoread
5353

54+
" bufdo
55+
set hidden
56+
5457
" 내부 파일탐색기(netrw)의 에러(BalloonHelp) 메시지 무시
5558
set noballooneval
5659
let g:netrw_nobeval = 1
@@ -451,6 +454,9 @@ if s:bFontListAuto
451454
if len(glob('C:\Windows\Fonts\PoorStory-Regular.ttf'))
452455
call add(s:KoFonts,[1,["Poor_Story",["h",16,19,25,30,35,40]]],)
453456
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
454460
if len(glob('C:\Windows\Fonts\Gugi-Regular.ttf'))
455461
call add(s:KoFonts,[1,["Gugi",["h",14,17,21,26,30,35]]],)
456462
endif
@@ -474,6 +480,7 @@ else
474480
let s:KoFonts = [
475481
\[0,"------------------------------------------------------------"],
476482
\[1,["Poor_Story",["h",16,18,25,30,35,40]]],
483+
\[1,["NIXGONFONTS-M_V2.0"]],
477484
\[0,"------------------------------------------------------------"],
478485
\[1,["Gowun_Dodum"]],
479486
\[0,"------------------------------------------------------------"],
@@ -719,7 +726,7 @@ let s:nStartupScreen = 0
719726
" --------------------------------------------------------------------------------
720727

721728
" 화면 왼쪽에 여백 추가, (0 이면 왼편 여백 없음)
722-
let s:foldcolumn_0 = 1
729+
let s:foldcolumn_0 = s:bGVim ? 1 : 0
723730

724731
" 단어가 화면 경계에 걸리면 단어 전체를 다음 라인에 표시(1), 단어를 잘라서 표시함(0)
725732
let s:bLineBreak = 0
@@ -737,7 +744,7 @@ let s:bEditorModeOn = 0
737744
" 뷰어모드로 시작시 강제로 편집모드로 전환하는 파일 크기 (N 바이트 미만)
738745
let s:nEditFileSize = 5
739746

740-
" 뷰어모드에서 편집 모드로 전환시 화면 분할을 유지(1), 해제(0)
747+
" 뷰어모드에서 편집 모드로 전환시 화면 분할을 해제(1), 유지(0)
741748
let s:bClearNSplit = 0
742749

743750
" 외부 편집기 실행 경로
@@ -1107,6 +1114,7 @@ let s:bFullScreen = 0
11071114
let s:bMaxmizedScreen = 0
11081115

11091116
" 전체화면 상단 여백
1117+
let s:bYpadding = 1
11101118
let s:ypd = 0
11111119

11121120
" 전체화면 영역 기본값
@@ -1141,7 +1149,7 @@ endfun
11411149

11421150
" 전체화면 toggle
11431151
fun GVimFullToggle()
1144-
if &ypadding != s:ypd
1152+
if s:bYpadding && &ypadding != s:ypd
11451153
execute "set ypadding=" . s:ypd
11461154
endif
11471155
if s:bFullScreen
@@ -1161,7 +1169,7 @@ endfun
11611169

11621170
" 전체화면 on or refresh
11631171
fun GVimFullOn(sFull=s:sFull)
1164-
if &ypadding != s:ypd
1172+
if s:bYpadding && &ypadding != s:ypd
11651173
execute "set ypadding=" . s:ypd
11661174
endif
11671175
if !s:bFullScreen && (s:bMenubarOn || s:bToolbarOn || s:bVertScrollbarOn)
@@ -1189,7 +1197,7 @@ endfun
11891197

11901198
" 전체화면일 경우에만 Refresh
11911199
fun GVimFullRefresh()
1192-
if &ypadding != s:ypd
1200+
if s:bYpadding && &ypadding != s:ypd
11931201
execute "set ypadding=" . s:ypd
11941202
endif
11951203
if !s:bFullScreen
@@ -1467,7 +1475,6 @@ fun EasyVimModeOn()
14671475
inoremap <C-A> <C-HOME><C-S-END>
14681476

14691477
set insertmode
1470-
set hidden
14711478

14721479
inoremap <silent> <Down> <C-R>=pumvisible() ? "\<lt>Down>" : "\<lt>C-O>gj"<CR>
14731480
inoremap <silent> <Up> <C-R>=pumvisible() ? "\<lt>Up>" : "\<lt>C-O>gk"<CR>
@@ -1490,7 +1497,6 @@ fun EasyVimModeOff()
14901497
let s:bEasyVimModeOn = 0
14911498

14921499
set noinsertmode
1493-
set nohidden
14941500
behave xterm
14951501

14961502
silent! cunmap <C-A>
@@ -1768,11 +1774,11 @@ endfun
17681774

17691775
fun KeymapEditNewLine()
17701776
" 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
17731779
" 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
17761782
endfun
17771783

17781784
" Viewer, Editor, Netrw 모드 구분
@@ -1942,11 +1948,9 @@ fun Cwho()
19421948
let ns = NBuffers()
19431949
let msg = ""
19441950
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
19501954
let msg .= "\<C-w>o"
19511955
endif
19521956
return msg
@@ -1981,13 +1985,13 @@ fun NSplitOnly(n=s:nSplit)
19811985
else
19821986
if &number
19831987
if &foldcolumn
1984-
let msg .= ":set foldcolumn=0\<CR>"
1988+
let msg .= ":windo set foldcolumn=0\<CR>:wincmd w\<CR>"
19851989
endif
19861990
if &cursorline
1987-
let msg .= ":set nocursorline\<CR>"
1991+
let msg .= ":windo set nocursorline\<CR>:wincmd w\<CR>"
19881992
endif
19891993
if &relativenumber
1990-
let msg .= ":set norelativenumber\<CR>"
1994+
let msg .= ":windo set norelativenumber\<CR>:wincmd w\<CR>"
19911995
endif
19921996
endif
19931997
endif
@@ -2016,12 +2020,14 @@ fun NSplitOnly(n=s:nSplit)
20162020
let msg .= "L$"
20172021
endif
20182022
silent! execute msg
2019-
if s:nMode == 1 && a:n < 2
2023+
if s:nMode == 1
20202024
if s:bCursorLine && !&cursorline
2021-
set cursorline
2025+
windo set cursorline
2026+
wincmd w
20222027
endif
20232028
if s:bCursorColumn && !&cursorcolumn
2024-
set cursorcolumn
2029+
windo set cursorcolumn
2030+
wincmd w
20252031
endif
20262032
endif
20272033
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
22862292
let s:msg_fonts[3] = a:ypd
22872293
endif
22882294

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
22942302
endif
22952303

22962304
if l:bGfn
@@ -2460,13 +2468,13 @@ fun SetCursorOn()
24602468
else
24612469
call SetCursorStatic()
24622470
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
24702478
endif
24712479
endfun
24722480

@@ -2475,13 +2483,13 @@ fun SetCursorOff()
24752483
if IsCursorOn()
24762484
execute "set guicursor=" . s:sCursorOff
24772485
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
24852493
endif
24862494
endfun
24872495

@@ -2554,24 +2562,6 @@ fun SetEditorModeOn(bEasy=0)
25542562
endif
25552563
endfun
25562564

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-
25752565
" 뷰어 모드 on (편집 모드 off)
25762566
fun SetViewerModeOn()
25772567
if s:nMode == 0
@@ -2619,13 +2609,19 @@ fun ToggleEditorViewer(bEasy=0)
26192609
else
26202610
if a:bEasy
26212611
if s:bEasyVimModeOn
2622-
if s:bClearNSplit && s:nSplitPrev != s:nSplit
2612+
if s:nSplit > 1 && (&cursorline || &cursorcolumn)
2613+
call NSplitOnly(1)
26232614
if &cursorline
2624-
set nocursorline
2615+
windo set nocursorline
2616+
wincmd w
26252617
endif
26262618
if &cursorcolumn
2627-
set nocursorcolumn
2619+
windo set nocursorcolumn
2620+
wincmd w
26282621
endif
2622+
call NSplitOnly(s:nSplit)
2623+
endif
2624+
if s:bClearNSplit && s:nSplitPrev != s:nSplit
26292625
" call NSplit() 사용시 KeymapNsplit() 을 2 번 호출하므로 NSplit() 에서 KeymapNsplit() 을 제외한 부분만 사용함
26302626
call NSplitOnly(s:nSplitPrev)
26312627
let s:nSplit = s:nSplitPrev
@@ -2641,13 +2637,19 @@ fun ToggleEditorViewer(bEasy=0)
26412637
if s:bEasyVimModeOn
26422638
call EasyVimModeOff()
26432639
else
2644-
if s:bClearNSplit && s:nSplitPrev != s:nSplit
2640+
if s:nSplit > 1 && (&cursorline || &cursorcolumn)
2641+
call NSplitOnly(1)
26452642
if &cursorline
2646-
set nocursorline
2643+
windo set nocursorline
2644+
wincmd w
26472645
endif
26482646
if &cursorcolumn
2649-
set nocursorcolumn
2647+
windo set nocursorcolumn
2648+
wincmd w
26502649
endif
2650+
call NSplitOnly(s:nSplit)
2651+
endif
2652+
if s:bClearNSplit && s:nSplitPrev != s:nSplit
26512653
" call NSplit() 사용시 KeymapNsplit() 을 2 번 호출하므로 NSplit() 에서 KeymapNsplit() 을 제외한 부분만 사용함
26522654
call NSplitOnly(s:nSplitPrev)
26532655
let s:nSplit = s:nSplitPrev
@@ -2663,6 +2665,24 @@ fun ToggleEditorViewer(bEasy=0)
26632665
endif
26642666
endfun
26652667

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+
26662686
" --------------------------------------------------------------------------------
26672687

26682688
fun WinSizePreset()
@@ -2675,7 +2695,7 @@ fun WinSizePreset()
26752695
endif
26762696
endfun
26772697

2678-
" 전체 <--> 전체, 일반 <--> 일반
2698+
" 폰트 크기 설정
26792699
fun F101112(n=0)
26802700
let nState = GVimState()
26812701
let s:nFontSize = s:FontSize[a:n]
@@ -3250,14 +3270,14 @@ fun KeymapCommon()
32503270
inoremap <silent> <M-F8> <ESC>:call ToggleFoldColumn()<CR>a
32513271

32523272
" 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
32563276

32573277
" 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
32613281

32623282
" 북마크 저장
32633283
nnoremap <silent> <S-C-F8> <ESC>:call BookmarkSave()<CR>
@@ -3523,7 +3543,7 @@ if 1
35233543
autocmd BufNewFile * call AuBufNewFile()
35243544

35253545
" 텍스트 파일 autocmd
3526-
autocmd BufReadPost * call SetBufAuto()
3546+
autocmd BufEnter * call SetBufAuto()
35273547
autocmd BufWinLeave * if &ft == "text" && s:nMode == 0 | execute "normal! H" | endif
35283548
autocmd FileType netrw call SetNetrwModeOn()
35293549

0 commit comments

Comments
 (0)