2011년 4월 13일 수요일

[Vim] Plugin: surround.vim

Vim에서 HTML 등 XML 기반의 문서를 편집하기 편하게 해 주는 플러그인으로 surround.vim 이란게 있다.

http://www.vim.org/scripts/script.php?script_id=1697

기능은 많지만 가장 많이 사용할 만한 기능을 설명하자면, 태그 씌워주기이다.

샘플로 특정 C코드를 편집한다고 가정하자.
위 처럼 주석으로 메시지를 달았다. 그리고 이 주석안의 메시지에 li 태그를 씌워볼 예정이다. v키를 눌러서 비쥬얼 모드로 메시지를 선택한 상태다.

이 상태에서 (ESC를 누르지 말고) 다음 커맨드를 입력한다.
s<li>
마지막의 '>'를 입력하자 마자 다음처럼 바뀐다.
입력했던 태그와 이에 매칭되는 닫기태그도 함께 자동으로 입력된다. 비쥬얼 모드에서 s를 입력한 후 태그를 입력하면 해당 태그 블럭을 만들어 주는 기능이다.

이 외에도 태그 등의 삽입에 많은 기능이 있으므로 내부에 포함되어 있는 도움말과 위 스크립트 사이트의 내용을 참고할 것.

댓글 7개 :

익명 :

I drop a leave a response when I especially enjoy a article on a website or if I have something to add to the discussion.
Usually it's triggered by the sincerness communicated in the article I browsed. And after this post "[Vim] Plugin: surround.vim". I was actually excited enough to drop a thought ;) I do have a couple of questions for you if it's allright.

Could it be just me or does it look like some of the responses appear as if they are coming from
brain dead visitors? :-P And, if you are posting at additional places, I'd like to keep up with you. Would you list every one of your social pages like your twitter feed, Facebook page or linkedin profile?

Look into my website; In the event you build Flat Torso or Substantial Chest ?

익명 :

Touche. Outstanding arguments. Keep up the good effort.

Feel free to visit my web-site - How to get gone " moobs " throughout 1 month

익명 :

Hey there, You've done an incredible job. I'll certainly digg
it and personally recommend to my friends. I'm sure they'll be benefited
from this website.

Also visit my blog Chromium picolinate and its particular part for gynecomastia

익명 :

What's up, I would like to subscribe for this weblog to obtain newest updates, therefore where can i do it please help out.

Here is my homepage - chestfatburner.com

익명 :

Nice post. I was checking constantly this blog and I am impressed!
Very useful info specially the last part :) I care for such information a
lot. I was seeking this particular information for a very
long time. Thank you and good luck.

my homepage :: Developing Internal Upper body?

익명 :

Hi there, constantly i used to check blog posts here early in the daylight, because i like
to find out more and more.

Also visit my website Inexpensive treatment options of gynecomastia

익명 :

Great article, just what I wanted to find.

my homepage :: Organic treatments of person boobs