KTUGFaq

KTUG FAQ

·Î±×ÀÎ:
ºñ¹Ð¹øÈ£:
°¡ÀÔ
He who has imagination without learning has wings but no feet.
FrontPage › VimEditor

¸ñÂ÷

1 vim À̶õ?
2 gvim
3 script
4 plugin
4.1 LaTeXSuite
4.2 À¯¿ëÇÑ Ç÷¯±×ÀÎ
5 À¯¿ëÇÑ ÆÁ
5.1 utf-8 ¹®¼­ ÆíÁý
5.2 "blabla" ¸¦ (grave grave)blabla(apostrophe apostrophe) ·Î ÀÏ°ýÀûÀ¸·Î ¹Ù²Ù·Á¸é
5.3 ¸®´ª½º¿¡¼­ CapslockÅ°¸¦ ESCÅ°·Î ¸ÊÇÎÇϱâ
5.4 Customize(ȯ°æ ¼³Á¤)
5.4.1 ³»°¡ »ç¿ëÇÏ°í ÀÖ´Â vim ȯ°æ ¼³Á¤ ÆÄÀÏ
6 Windows gvim & KC2008
7 Windows gvim & KC2006

1 vim À̶õ?

°ú°Å UNIX ½Ã½ºÅÛ¿¡¼­ºÎÅÍ »ç¿ëµÇ¾î ¿Â VI(Visual editor)¸¦ ´Ù¾çÇÑ ±â´ÉÀ» ³Ö¾î °³¼±½ÃŲ ÇÁ·Î±×·¥ÀÔ´Ï´Ù. ±×·¡¼­ À̸§ÀÌ VIM("Vi IMproved")ÀÔ´Ï´Ù. See also ViEditor.

¾Æ·¡ »çÀÌÆ®¸¦ Âü°íÇÏ¸é ´Ù¾çÇÑ ÀڷḦ ¾òÀ» ¼ö ÀÖ½À´Ï´Ù.

[http]VIM ÇöÀç ¹öÀüÀº 7.1ÀÔ´Ï´Ù. B)

2 gvim

X-Window³ª MS-Windows¿Í °°Àº GUI ȯ°æ¿¡¼­ ¾µ ¼ö ÀÖ´Â VimEditor.

ÇöÀç ¹öÁ¯Àº 6.4 ÀÔ´Ï´Ù.(20060211)

7.0ÀÌ µåµð¾î ³ª¿Ô±º¿ä.(20060508 ¾î¹öÀ̳¯¹öÀüÀ̱º¿ä) 7.0¿¡¼­ °³¼±µÈ Á¡Àº ÆÄÀÏÅDZâ´É, ½ºÆçüũ(¿µ¹®ÀÇ °æ¿ì Ʋ¸° ´Ü¾î¹Ø¿¡ ¹°°áÇ¥°¡...), À¯´ÏÄÚµå Áö¿ø°­È­, ³»ÀågrepµîÀ̶ø´Ï´Ù. ±×·±µ¥ ¼³Ä¡ÆÄÀÏ¿ë·®ÀÌ µÎ¹è³ª µÇ´Â ±º¿ä. ´ëºÎºÐÀº ¾ð¾îº° ½ºÅ©¸³Æ®¿Í ¹®¼­µéÀÌÁö¸¸ Á¡Á¡ ¹«°Å¿öÁö°í ÀÖ´Ù´Â »ý°¢À̵ì´Ï´Ù.

3 script

vim¾È¿¡¼­ È°¿ëÇÒ ¼ö ÀÖ´Â ³»Àå ½ºÅ©¸³Æ®·Î vimÀÇ È°¿ëµµ¸¦ È®Àå½ÃÄÑ ÁÝ´Ï´Ù.

4 plugin


4.2 À¯¿ëÇÑ Ç÷¯±×ÀÎ

  1. tex_autoclose.vim
    \begin{***}¿¡ ´ëÇØ `\end{***}À» ÀÚµ¿À¸·Î ½áÁÝ´Ï´Ù. http://www.vim.org/scripts/script.php?script_id=920

  2. tex_autoclose º¯ÇüÆÇ
    autoclose (°ýÈ£¸¦ ÀÚµ¿À¸·Î ´Ý¾ÆÁÝ´Ï´Ù) ÀÇ ±â´ÉÀ» ÇÔ²² ¾µ ¼ö ÀÖ½À´Ï´Ù. ´Ù¸¸ tex_autoclose, autoclose ÀúÀÚÀÇ Çã¶ô¾øÀÌ Äڵ带 ¸¶À½´ë·Î º¹»çÇؼ­ ºÙ¿© ¸¸µç Ç÷¯±×ÀÎÀÌ¸ç ¶ÇÇÑ kdvi ¿¡¼­ inversesearch ±â´ÉÀ» »ç¿ëÇÒ °æ¿ì¿¡´Â ¿¡·¯°¡ ¹ß»ýÇÕ´Ï´Ù. ´Ù¸¥ dvi viewer ¿¡¼­´Â »ç¿ëÇغ¸Áö ¾Ê¾Æ È®ÀÎÇÒ ¼ö ¾ø½À´Ï´Ù¸¸ ¾Æ¸¶ ºñ½ÁÇÑ ¹®Á¦°¡ ¹ß»ýÇÏÁö ¾ÊÀ»±î ÇÏ´Â »ý°¢ÀÌ µì´Ï´Ù. ¿øÀÎÀÌ ¹ºÁö ¸ð¸£°Ú½À´Ï´Ù.. ¤Ð.¤Ð http://vim.wikia.com/wiki/Tex_Autoclose_working_with_Autoclose

  3. bufexplorer.vim
    ÇöÀç ÆíÁýÁßÀÎ ÆÄÀÏÀÇ ¸ñ·ÏÀ» º¸¿©ÁÝ´Ï´Ù. ¸í·É¸ðµå¿¡¼­ \be \bs \bv http://www.vim.org/scripts/script.php?script_id=42

  4. minibufexpl.vim
    ultraedit °ú °°ÀÌ, »ó´Ü¿¡ ÇöÀç ÆíÁýÁßÀÎ ÆÄÀÏÀÇ ¸ñ·ÏÀ» º¸¿©ÁÝ´Ï´Ù. http://www.vim.org/scripts/script.php?script_id=159

  5. latex-mik.vim
    MiktexÀ» À§ÇÑ Ç÷¯±×ÀÎ. ¼±ÅÃÇÑ ¿µ¿ªÀ» ȯ°æÀ̳ª ¸í·É¾î·Î µÑ·¯½ÎÁÖ´Â ±â´É, ÇÁ·ÎÁ§Æ®°ü¸®±â´ÉµîÀÌ ÀÖÀ½. http://www.vim.org/scripts/script.php?script_id=849

  6. cream
    viÀÇ ¸í·É ¹× ÆíÁý¸ðµå¿¡ Àͼ÷ÇÏÁö ¾ÊÀº À©µµ »ç¿ëÀÚµéÀ» À§ÇÑ Ç÷¯±×ÀÎ pack. ÇöÀç VIM7.0¸¦ ÀνºÅçÆÄÀϾȿ¡ Æ÷ÇÔÇÏ°í ÀÖ±º¿ä.(Á¾ÇÕ¼±¹°¼¼Æ®°³³äÀÔ´Ï´Ù.) ÀϹÝÀûÀÎ À©µµÆíÁý±âµé°ú °°ÀÌ ¸¶¿ì½º·Î ¸ðµç ±â´ÉÀ» »ç¿ëÇÒ ¼ö ÀÖµµ·Ï ÇÏ°í ÀÖ½À´Ï´Ù. ¹°·Ð ´ÜÃàÅ°µµ ´Ù ÁöÁ¤Çسù±º¿ä. Á¦°¡ Áö±Ý(2006.9.30) ¹ÞÀº ÀνºÅçÆÄÀÏ¿¡¼­´Â Çѱ۸޴ºÆÄÀÏÀÇ ÄÚµùÀÌ À߸øµÇ¾î ¸Þ´º°¡ ÀüºÎ ±úÁ® º¸ÀÔ´Ï´Ù. ¸Þ´ºÀÇ ÀúÀÚÇÑÅ× ¿¬¶ôÇß´õ´Ï ÀúÀÚ°¡ »ç¿ëÇÏ°í ÀÖ´Â ¼öÁ¤ÆÄÀÏÀ» º¸³»Áּ̽À´Ï´Ù. ´Ù¸¸ ÀÌ°Ç VIM 6.x¿ëÀ̶ø´Ï´Ù. @cream-korean.zip (4.92 KB) ±×·¡µµ /vim70/cream/lang/µð·ºÅ丮¿¡ ¾ÐÃàÀ» Ç®°í º¹»ç¿¡ ³ÖÀ¸¸é Àß ÀÛµ¿ÇÕ´Ï´Ù. VIMÀ¸·Î ÀüȯÇؼ­µµ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. Àú´Â VIMÀÌ ÀÌ Á¤µµ±îÁö ¼³Á¤ÇÒ ¼ö ÀÖÀ» Á¤µµ·Î À¯¿¬ÇÏ´Ù´Â ¿¹·Î ÆľÇÇÏ°í ÀÖ½À´Ï´Ù¸¸ VIMÀÇ ¸í·É¾î¸ðµå¿Í ÆíÁý¸ðµå°¡ Àͼ÷ÇÏÁö ¾ÊÀ¸½Å ºÐ²²´Â ±×³É ÀϹÝÀûÀÎ À©µµ¿¡µðÅÍ¿Í µ¿ÀÏÇÏ°Ô »ç¿ëÇϼ­µµ ¼Õ»öÀÌ ¾ø½À´Ï´Ù. http://cream.sourceforge.net/

5 À¯¿ëÇÑ ÆÁ

5.1 utf-8 ¹®¼­ ÆíÁý

set enc=utf-8
set fenc=utf-8
"(windows vim ÀÏ °æ¿ì)
set fencs=utf-8,cp949,iso-8859-1
À§¿Í °°Àº ³»¿ëÀ» _vimrc ÆÄÀÏ¿¡ Ãß°¡Çϸé, »õ·Î ÀÛ¼ºÇÏ´Â ÆÄÀÏÀÇ ÀÎÄÚµùÀº utf-8 ÀÌ µÇ°í, ±âÁ¸ÀÇ ÆÄÀÏÀ» ¼öÁ¤ÇÏ´Â °æ¿ì fencs ¿¡ Á¤ÀÇµÈ ÀÎÄÚµùÀÇ ¼ø¼­´ë·Î ÀûÀýÇÑ ÀÎÄÚµùÀ» ã½À´Ï´Ù. vim ÀÌ ÆÄÀÏÀÇ ÀûÀýÇÑ ÀÎÄÚµùÀ» ã¾Æ³»Áö ¸øÇßÀ» ¶§, ´ÙÀ½°ú °°ÀÌ ÇØÁÙ ¼ö ÀÖ½À´Ï´Ù.
:e ++enc=cp949 (ÀÎÄÚµù)
±âº»°ªÀ¸·Î bomb Àº ºÙÀÌÁö ¾ÊÀ¸³ª ºÙÀ̱⸦ ¿øÇÑ´Ù¸é
:set bomb
ºÙÀÌÁö ¾Ê±â¸¦ ¿øÇÑ´Ù¸é :set nobomb ÇÕ´Ï´Ù.

ÆÁÀ¸·Î states line ¿¡ ÇöÀç ÆíÁýÇÏ°í ÀÖ´Â ÆÄÀÏÀÇ ÀÎÄÚµù°ú bomb À» Ç¥½ÃÇÒ ¼ö ÀÖ½À´Ï´Ù. ´ÙÀ½ ÆäÀÌÁö¸¦ Âü°íÇϼ¼¿ä. ¶ÇÇÑ
:set laststatus=2
¶ó°í Çϸé status line ÀÌ Ç×»ó º¸ÀÌ°Ô µË´Ï´Ù. ÇöÀç Àú´Â ´ÙÀ½°ú °°ÀÌ Çؼ­ ¾²°í ÀÖ½À´Ï´Ù.
:set statusline=%<%f\ %h%m%r%=%{\"[\".&ff.\"][\".(&fenc==\"\"?&enc:&fenc).((exists(\"+bomb\")\ &&\&bomb)?\",B\":\"\").\"]\ \"}%k\ %-14.(%l,%c%V%)\ %P

5.2 "blabla" ¸¦ (grave grave)blabla(apostrophe apostrophe) ·Î ÀÏ°ýÀûÀ¸·Î ¹Ù²Ù·Á¸é


vim ¿¡¼­ "blabla" ¸¦ ``blabla'' ·Î ÀÏ°ýÀûÀ¸·Î º¯È¯ÇÏ°í ½ÍÀ» °æ¿ì ´ÙÀ½°ú °°ÀÌ ÇØÁÖ¸é µË´Ï´Ù. (vi.kldp.org ÀÇ milko ´Ô²²¼­ ¾Ë·ÁÁּ̽À´Ï´Ù.)

:%s/\v"(\S|\S\_.{-}\S)"/``\1''/g

"\S" ȤÀº "\S\_.*\S" ÀÎ °æ¿ì¿¡ ´ëÇؼ­¸¸ º¯È¯ÇÕ´Ï´Ù. (\S : °ø¹é°ú EOL À» Á¦¿ÜÇÑ ¸ðµç ¹®ÀÚ, \_. : EOL À» Æ÷ÇÔÇÑ ¸ðµç ¹®ÀÚ) (Áï " ÀüÈÄ·Î °ø¹é ¹®ÀÚ°¡ ¾ø´Â °æ¿ì¸¸À» °ñ¶ó¼­ º¯È¯ÇÕ´Ï´Ù.)

5.3 ¸®´ª½º¿¡¼­ CapslockÅ°¸¦ ESCÅ°·Î ¸ÊÇÎÇϱâ

¿ø·¡ vi¿¡µðÅ͸¦ °³¹ßÇÏ´ø ÄÄÇ»ÅÍÀÇ ÀÚÆÇÀº ESCÅ°°¡ ¿ÞÂÊÀ§°¡ ¾Æ´Ï¶ó Áö±ÝÀÇ CapslockºÎ±Ù¿¡ ÀÖ¾ú´ÙÇÑ´Ù. ±×·¡¼­ ¸í·É¾î¸ðµå·ÎÀÇ ÀüȯÀ» ÆÈÀ» ¿òÁ÷ÀÌÁö ¾Ê°í °£´ÜÈ÷ ÇÒ ¼ö ÀÖ¾ú´Ù°í ÇÑ´Ù. Áö±ÝÀÇ ESC´Â ¿ÞÂÊÀ§ÀÇ ±¸¼®¿¡ ÀÖ¾î ±ÍÂúÀº ¸éÀÌ ÀÖ´Ù. ½ÇÁ¦·Î °ÅÀÇ »ç¿ëÇÏÁö ¾Ê´Â CapslockÅ°¸¦ ´ÙÀ½°ú °°Àº ¹æ¹ýÀ¸·Î ESCÅ°·Î »ç¿ëÇÒ ¼ö ÀÖ´Ù. ¹°·Ð ESCÅ°´Â ¿©ÀüÈ÷ ÀÛµ¿ÇÑ´Ù.

ÀÚ±âÀÇ È¨µð·ºÅ丮¿¡ .xmodmapÀ̶ó´Â ÆÄÀÏÀ» ¸¸µé°í ´ÙÀ½°ú °°Àº ³»¿ëÀ» ³Ö¾îµÐ´Ù.
remove lock = Caps_Lock
keysym Caps_Lock = Escape

¿ìºÐÅõ 9.04¿¡¼­´Â ½Ã½ºÅÛ-±âº»¼³Á¤-Å°º¸µå-Å°¹èÄ¡-Å°¹èÄ¡¿É¼Ç-CapLock Å°µ¿ÀÛ ¿¡¼­ ¼±ÅÃÇÒ ¼ö ÀÖ´Ù. ¾Æ¸¶µµ ÀÌÀü ½Ã½ºÅÛ¿¡¼­µµ µÉ µí...

Å°º¸µå ¹èÄ¡¸¦ ¹Ù²Ù±â´Â ½ÈÀºµ¥ esc´©¸£·Á°í ¼ÕÀ» ¿òÁ÷À̱⠽ÈÀº »ç¶÷Àº ±×³É ctrl-[À» ´­·¯µµ µÈ´Ù.

5.4 Customize(ȯ°æ ¼³Á¤)

set nocompatible             "vi ºñȣȯ ¸ðµå. Áï vim ¿¡¼­ È®ÀåµÈ ¸í·ÉÀ» »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.
set display+=lastline        "Çѹ®´Ü ³»¿¡¼­ ÁٹٲÞÇÏÁö ¾Ê°í ÇÑÁÙ·Î ¾²´Â °æ¿ì À¯¿ë (¹¹¶ó°í ¼³¸íÇØ¾ß Çϳª -_-;
set linebreak                "´Ü¾î ´ÜÀ§·Î ÁٹٲÞÇÕ´Ï´Ù.
nmap <up> gk                 "È­»ìÇ¥¸¦ ÀÌ¿ëÇØ À̵¿ÇÕ´Ï´Ù.
nmap <down> gj
imap <up> <c-o>gk
imap <down> <c-o>gj
set incsearch
set hls                      " °Ë»öÇÑ ´Ü¾î¸¦ highlight ½Ãŵ´Ï´Ù.
nnoremap <F7> :set nohls<CR> " F7 Å°¸¦ ´©¸£¸é °Ë»öÇÑ ´Ü¾î¿¡ ´ëÇÑ highlight ¸¦ disable ½ÃÅ´
nnoremap n :set hls<CR>n     " /, N, n µîÀÇ Å°·Î °Ë»öÀ» ½ÃÀÛÇϸé highlight enable ½ÃÅ´
nnoremap N :set hls<CR>N
nnoremap * :set hls<CR>*
nnoremap # :set hls<CR>#
nnoremap / :set hls<CR>/
nnoremap ? :set hls<CR>?
set fileformats+=dos,unix,unix  " ÁÙ¹Ù²Þ Çü½ÄÀ» ÀÚµ¿À¸·Î ã¾ÆÁÝ´Ï´Ù.
imap <m-c> <c-o>"+y             " alt-c, alt-v ·Î copy & paste ÇÕ´Ï´Ù.
vmap <m-c> "+y
imap <m-v> <c-o>"+gp
vmap <m-v> <c-o>"+gp
imap <m-a> <esc>ggVG
set enc=utf-8                   " »õ·Î ÀÛ¼ºÇÏ´Â ÆÄÀÏÀÇ ÀÎÄÚµùÀ» utf-8 ·Î ÇÕ´Ï´Ù.
set fenc=utf-8
set fencs=utf-8,cp949           " ±âÁ¸ÀÇ ÆÄÀÏÀ» ¿©´Â °æ¿ì fencs ¿¡ Á¤ÀÇµÈ ¼ø¼­·Î ÀûÀýÇÑ ÀÎÄÚµùÀ» ã½À´Ï´Ù.


customize part.


5.4.1 ³»°¡ »ç¿ëÇÏ°í ÀÖ´Â vim ȯ°æ ¼³Á¤ ÆÄÀÏ


$HOME/.vim/ftplugin/plaintex.vim
set breakat=\ ^I
set textwidth=72
set number

""" ÅÇÀ» ½ºÆäÀ̽º µÎ°³·Î ġȯ.
""" texÆÄÀÏ¿¡¼­´Â ÀÌ°ÍÀÌ ÀϹÝÀûÀÓ.
"set expandtab
set softtabstop=2
set shiftwidth=2

""" @À» Ư¼ö¹®ÀÚ ¾Æ´Ñ ÀϹݹ®ÀÚ·Î ÀνÄ. 
""" styÆÄÀÏ ÆíÁý½Ã ¸í·É ÀÚµ¿¿Ï¼º¿¡ À¯¿ë.
set iskeyword=@,@-@

set formatoptions+=ro

DeleteMe sts=2¿Í et¿¡ ¸ðµç magicÀÌ ÀÖÀ¸¹Ç·Î set ts=2´Â ³ÖÁö ¾Ê´Â °ÍÀÌ ³´½À´Ï´Ù. vim¸»°í ´Ù¸¥ tab size¸¦ Áö¿øÇÏÁö ¾Ê´Â ÇÁ·Î±×·¥¿¡¼­´Â tabÀÌ ¾ûŬ¾îÁú È®·üÀÌ ³ô¾ÆÁö±â ¶§¹®¿¡ ts´Â ¾ðÁ¦³ª 8(ÀÌ°ÍÀÌ ±âº»°ª) Çصδ °ÍÀÌ ³´½À´Ï´Ù. --WkPark

$HOME/.vim/ftplugin/tex.vim
source $HOME/.vim/ftplugin/plaintex.vim

compiler tex

""" »óÈ£ÂüÁ¶ Å°¸¦ ¿Ï¼ºÇÒ ¶§ À¯¿ë.
set iskeyword=@,@-@,:

""" :make ½ÇÇà½Ã xelatex ½ÇÇàµÇµµ·Ï ¼³Á¤
set makeprg=xelatex\ -synctex=1\ -interaction=nonstopmode\ %<.tex

""" forward search from tex to pdf
""" Å͹̳Πºö¿¡¼­´Â °¢ ´ÜÃàÅ° ³¡¿¡ <C-l>À» Ãß°¡ÇØ¾ß È­¸éÀÌ ¹Ù¸£°Ô µÈ´Ù.
""" for skim on mac
map <F5> :w<CR>:silent !/Applications/Skim.app/Contents/SharedSupport/displayline <C-r>=line('.')<CR> %<.pdf %<CR><CR>
""" for evince on linux
"map <F5> :w<CR>:silent !~/bin/evince_forward_search %<.pdf <C-r>=line('.')<CR> %<CR>

""" ¸î °¡Áö ´ÜÃàÅ°. 
""" ÀÔ·Â ¾ð¾î¸¦ ÀüȯÇÒ ÇÊ¿ä¾ø¾î ¼¼¹ú½Ä »ç¿ëÀÚ¿¡°Ô À¯¿ë.
inoremap <buffer> '' `'<left>
inoremap <buffer> "" ``''<left><left>
imap <C-t> <CR><Esc>i<Bslash>item<Space>
imap <C-t><C-t> <CR><Esc>i<Bslash>item[]<Left>
imap <C-t><C-b> <CR><Esc>i<Bslash>bibitem{}<Left>

""" section ¿¡¼­ ÆúµùÀ» °¡´ÉÇÏ°Ô ÇÑ´Ù.
""" cntl-s cntl-q µûÀ§´Â gvim¿¡¼­¸¸ µ¿ÀÛ. Å͹̳Πºö¿¡¼± ¾È µÊ.
""" ±»ÀÌ ÇÏÀÚ¸é ½©¿¡¼­ stty -ixon -ixoff ¸í·ÉÀ¸·Î µ¿ÀÛÇÏ°Ô ÇÑ´Ù.
""" *** ¾Æ·¡¿¡¼­ { { {, } } } »çÀÌÀÇ °ø¹éÀº Áö¿ö¾ß ÇÔ ***
""" *** ¾Æ·¡¿¡¼­ &#8226; Àº ºÒ¸´ ±âÈ£(U+2022)ÀÓ ***
imap <C-s> <Bslash>section{&#8226;} %{ { {<CR><CR>%} } }<Esc>?&#8226;<CR>xi
set foldmethod=marker

""" ¹®´Ü ÀçÁ¤·Ä ¸í·É
nmap <C-q> gqap

""" ÀÚÁÖ ¾²´Â ȯ°æÀ» ÆíÇÏ°Ô ÀÔ·ÂÇÑ´Ù.
""" ÀԷ¸ðµå¿¡¼­ Ctrl-E ¸¦ ´©¸£°í ȯ°æÀ̸§ ÇÑ µÎ ±ÛÀÚ Ä¡°í <Tab>  
""" ³ë¸Ö¸ðµå¿¡¼­´Â :E ÇÑ µÚ ȯ°æÀ̸§ ÇÑ µÎ ±ÛÀÚ ±×¸®°í <Tab>
command! -complete=custom,ListENV -nargs=1 E execute "normal i\\begin{<args>}<CR>\\end{<args>}<Esc>k$a<Space>" | startinsert
function! ListENV(A,L,P)
  return "itemize\nenumerate\ndescription\ntabular\nfigure\ntable\nquote\nquotation\ndocument\nthebibliography"
endfunction
imap <C-e> <Esc>:E<Space>

6 Windows gvim & KC2008


^
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2011-04-19 21:49:00
Processing time 0.0582 sec