vimscript 45

Learn vimscript the hard way: 18장 - Responsible Coding

Responsible Coding 지금까지는 vimscript 자체보다는 vim과 vimrc에 넣을 설정들 위주로 설명되어 있었는데, 이 챕터부터는 본격적으로 vimscript에 대한 설명이 시작된다. 이번 챕터는 "어떻게 vimscript를 작성하면서 제정신을 유지하는지" (...)에 관한 챕터이다. (악명높은 vimscrip..) Commenting vimscript의 옵션과 코멘드들은 읽기 힘들기 때문에 주석을 많이많이 달아주자! Grouping ~/.vimrc에 추가한 매핑들은 사용하기 편하지만 점점 많아지면서 관리가 힘들어 질 수 있다. 이를 해결하기 위해 코드 라인과 섹션을 그룹화하고 folding해주자 vimscript 파일에서 fold를 사용하려면 다음 명령어를 추가해주자 augroup f..

tools/vim 2020.03.20

learn vimscript the hard way - 17장. status line

Status Lines vim에서는 각 window 아래에 있는 status line의 텍스트를 customize 할 수 있다. 보통 vim을 주 에디터로 사용한다면 vim-airline 등 플러그인을 사용중이라 이미 화려한(?) status line을 가지고 있을 것이다. 해당 챕터를 따라하기 위해서는 default vim으로 해 보거나 다른 vim config file (~/essential.vim)를 만들어서 해당 설정 파일로 vim을 구동시키는게 좋다. # 설정 없이 vim open vim -u NONE # 원하는 설정을 essential.vim에 넣어준다. number, relativenumber 등... vim ~/essential.vim vim -u ~/essential.vim이제 statu..

tools/vim 2020.03.18

learn vimscript the hard way 16: More Operator-Pending Mappings

More Operator-Pending Mappings Topic One ========= This is some text about topic one. It has multiple paragraphs. Topic Two ========= This is some text about topic two. It has only one paragraph.:onoremap ih :execute "normal! ?^==\\+$\r:nohlsearch\rkvg_"위 명령어는 ======== 헤더 아래의 모든 문단에 대한 mapping이다. onoremap ih 에 대해서는 저번 챕터에서 설명하였으니 나머지 명령어를 아래에서 설명할 예정 Normal normal command는 이후에 친 모든 command를 norm..

tools/vim 2020.03.15