【问题标题】:Unix , vim ,wrapping function ,Unix,vim,包装函数,
【发布时间】:2014-07-17 19:22:32
【问题描述】:

我想在 Vim 编辑器。类似于包装功能 Netbeans 和其他软件中是否有。

Sub sample {
_----------------
-------------------
}

输出:

+sub sample { 

点击上面的东西后,它应该会显示完整的数据。 我们可以通过在.vimrc 文件中使用 JavaScript 来做到这一点吗?请 有建设性的想法。

【问题讨论】:

  • 打开 vim。输入 :help folding 并阅读有关 vim 已内置功能的文档。

标签: unix vim wrapper


【解决方案1】:
Vim folding commands
---------------------------------
zf#j creates a fold from the cursor down # lines.
zf/ string creates a fold from the cursor to string .
zj moves the cursor to the next fold.
zk moves the cursor to the previous fold.
za toggle a fold at the cursor.
zo opens a fold at the cursor.
zO opens all folds at the cursor.
zc closes a fold under cursor. 
zm increases the foldlevel by one.
zM closes all open folds.
zr decreases the foldlevel by one.
zR decreases the foldlevel to zero -- all folds will be open.
zd deletes the fold at the cursor.
zE deletes all folds.
[z move to start of open fold.
]z move to end of open fold.

所以如果你想折叠一个方法,你可以将光标放在方法声明上并输入zf}。这将折叠光标和方法的右大括号之间的每一行。要展开,您可以键入 zo,并将光标放在折叠处。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-03
    • 2017-11-30
    • 1970-01-01
    • 1970-01-01
    • 2021-04-06
    相关资源
    最近更新 更多