VIM的小技巧一問 - Linux

Table of Contents


※ 引述《CrBoy (上大學好忙喔)》之銘言:
: ※ 引述《wulawu ( )》之銘言:
: : 問題1: google foldmethod
: : 問題2:
: : 用 [{ 去找到function一開始的{,游標在{上,按下v%
: : 即會選取一整個function
: : 接著輸入:s/abc/def/cg
: : 即可把function內的abc替換成def
: 也可以在function內任一處按下: vi{ (對 反正你就照順序按)
: 就可以選擇一個{}的部份 想要再往外一層就按 v2i{
: 依此類推~:P

check :h 'visual-operators' and 'foldmethod'

基本上你可以

set fdm=syntax
set fdl=0

不想 fold commment 可以加上:
let c_no_comment_fold = 1

或是不想 fold if statment

let c_no_if0_fold = 1


etc..


--

--

All Comments