22
Vim 을 을을을을을 을을을 [email protected]

Vim 을 홍보합니다

  • Upload
    ace

  • View
    123

  • Download
    0

Embed Size (px)

DESCRIPTION

Vim 을 홍보합니다. 서재백 [email protected]. E ditor. E ditor war. Vim. Emacs. larger set of features than vi Elips plugin Special editing modes Ability to emulate Vi. Small size Faster than Emacs Runs on all systems that has standard C library More users than Emacs. What is Vim?. - PowerPoint PPT Presentation

Citation preview

Page 1: Vim 을 홍보합니다

Vim 을 홍보합니다서재백

[email protected]

Page 2: Vim 을 홍보합니다

Editor

Page 3: Vim 을 홍보합니다

Editor warVim• Small size• Faster than Emacs• Runs on all systems

that has standard C li-brary

• More users than Emacs

Emacs• larger set of features

than vi• Elips plugin• Special editing modes• Ability to emulate Vi

Page 4: Vim 을 홍보합니다

What is Vim?• Vim

Stands for Vi iMprovedreleased by Bram Moolenaar in 1991from Vi written by Bill Joy in 1976

Page 5: Vim 을 홍보합니다

Simple Vim$ vi helloworld.c

i#include<stdio.h><ESC>oint main(){<ESC>oprintf(“hellowolrd\n”);<ESC>oreturn 0; <ESC>o}<ESC><Ctl+z>

$ gcc helloworld.c$ ./a.out

Page 6: Vim 을 홍보합니다

h j k l 0 ^ $ // 이동a i o A I // 편집u Ctl+r // Do & Undo* # /asdf n N // SearchingAlt+v Ctl+v Shift+v // Select:<,>s/asdf/hello/g // 치환Ctl+p // 자동완성Ctl+s Ctl+q // Lock & Unlock

$ vimtutor

Page 7: Vim 을 홍보합니다

Advanced VimWe can combine two or more commands

w dw cw yw e de ce yefX dfX cfX yfX // X 가 나올 때까지tX dtX ctX ytX // X 가 나오기 직전까지$ d$ c$ y$ // 줄 끝까지j dj cj yj // 현재 & 다음 줄까지10i<ESC>hello<CR><ESC>

Page 8: Vim 을 홍보합니다

Advaned Vim( 세미나 후 보충 )d // delete c // deletef // find // andy // copy // insertp // paste o // newlinew // word // ande // word(end) // insertb // word(before)

Page 9: Vim 을 홍보합니다

Advanced Vimdab cab yab커서가 포함된 괄호 시작부터 괄호 끝까지dib cib yib현재 커서가 포함된 괄호 시작 다음부터 괄호 끝 직전까지 . 괄호는 포함하지 않음dd cc yy // 현재 줄만

Page 10: Vim 을 홍보합니다

Replacement:(range)s/(regular expression)/(something)/g

:<,>s/^.*int/char/g

:5,10s/<br>$/;/g

:%s/<div\(.\{-}\)class=\(.\{-}\)>/<div\1class=“\2”>/g

Page 11: Vim 을 홍보합니다

Regular Expression^ 문장의 맨 앞$ 문장의 맨 뒤. 임의의 한 character[0-9] 0~9 또는 a~z 또는 A~Z 한 개[A-Z][a-z]

Page 12: Vim 을 홍보합니다

Regular Expression( 세미나 후 보충 )

* // 문자 반복Ex. 1* 11..1 2* 22..2 a* aa..a

.* // 임의의 문자 반복\{-} // 문자 최소 반복\{+} // 문자 최대 반복Ex. 1\{-} a\{+} .\{-}

Page 13: Vim 을 홍보합니다

Regular Expression.* character 반복\(<RE>\)grouping

:<,>s/<div\(.\{-}\)class=\(.\{-}\)>/<div\1class=“\2”>/g

Page 14: Vim 을 홍보합니다

Macro$ vi macro_samplei1.<ESC>qayyp<Ctl+a>q98@a

q<reg>(some macro)q //macro 저장@<reg> @@ q: q/ //macro 실행:reg “kp //register 보기“5p //5 번 register paste

Page 15: Vim 을 홍보합니다

Split:sp // 수평 자르기:vsp or :vs // 수직 자르기Ctl+wh Ctl+wj Ctl+wk Ctl+wl // 이동Ctl+w- Ctl+w+ // 창 크기 늘리기Ctl+w_ // 현재창 세로로 최대화Ctl+= // window size 동일하게Ctl+r Ctl+R //window rotate

Page 16: Vim 을 홍보합니다

Tab$ vim -p a.txt b.txt c.txt$ vim -p3

:tabnew d.txt:tabp :tabn:tabfirst or :tabfir :tablast or :tabla

Set vimrc !!map sn :tabn<CR>map sp :tabp<CR>

Page 17: Vim 을 홍보합니다

Vim ShellThere is :!(command) .. but

Page 18: Vim 을 홍보합니다

Vim Shell

Shell on Vimhttp://code.google.com/p/conque/

Setting Vimrc such asmap sh :vs<CR>:ConqueTerm bash<CR>

Page 19: Vim 을 홍보합니다

Folding

Page 20: Vim 을 홍보합니다

FoldingSelect range by Shift+v and type zfzf // 지정된 영역 foldingzo or zO //folding openzc or zC //folding closezr or zR //folding all openzm or zM //folding all closezd //folding delete

Page 21: Vim 을 홍보합니다

Folding( 세미나 후 보충 )zj zk // 이전 , 다음 folding 으로 이동:set method=indent// indentation ( 들여쓰기 ) 단위로 자동 folding

:mkview :loadview //Save and Load

Page 22: Vim 을 홍보합니다

Epilogue더 알고 싶었던 것Vimscript

도와주신 분들강성훈 회원님조동현 회원님다른 여러 선배님들