본문 바로가기
Programming

VIM 에 이런 기능이 - 소스코드를 html 문서로 변환하기

by leanu 2008. 9. 26.
소스를 붙여넣기 하면 영 보기가 껄끄럽고 그렇다고 수정하자니 손이 많이간다.

이럴때 이 명령어를 쓰면 유용할 듯 하다.

소스를 연 상태에서
:TOhtml 

를 입력하면 창이 나뉘면서 상단에 html 변환 문서가 생성된다. (오오오~~~~~)

p.s) vim 이 없는가? 그럼 이곳을 참조하라. (http://www.vim.org/download.php)


Before
--------------------------------------------------------------------------------------------
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>

template<class T>
class template_test
{
public:
    T data_;

    void display() { std::cout << data_ << std::endl; };
};
int main()
{
    template_test<int> intClass;
    template_test<std::string> stringClass;

    intClass.data_ = 13;
    stringClass.data_ = "Hello";

    intClass.display();
    stringClass.display();

    return 0;

} // end - main

After
--------------------------------------------------------------------------------------------

 1 #include <iostream>
 2 #include <algorithm>
 3 #include <vector> 
 4 #include <string>
 5
 6 template<class T>
 7 class template_test
 8 {
 9 public:
10     T data_;
11
12     void display() { std::cout << data_ << std::endl; };
13 };
14 int main()
15 {
16     template_test<int> intClass;
17     template_test<std::string> stringClass;
18
19     intClass.data_ = 13;
20     stringClass.data_ = "Hello";
21
22     intClass.display();
23     stringClass.display();
24
25     return 0;
26     
27 } // end - main

댓글