阅读 vim 插件 - 奇怪的符号和导航
我正在阅读很棒的 tpoperails.vim ,它是什么意思:
" }}}1
" Abbreviations {{{1
就在这里: https://github.com/tpope/vim-rails/blob/master/autoload/rails.vim#L3921
是为了更好的导航吗? 这个文件非常大,如何正确导航它 - 使用 ctags?
Im reading great tpope rails.vim and what does it mean:
" }}}1
" Abbreviations {{{1
exactly here: https://github.com/tpope/vim-rails/blob/master/autoload/rails.vim#L3921
Is it for better navigation?
This file is quite huge, how to navigate on it properly - using ctags?
这些就是所谓的折叠标记。 Vim 6 引入了代码折叠,三大括号是标记折叠开始和结束的默认字符串。此外,如果您在开始标记
{{{
前添加文本,它将在折叠行中显示为标题。这只是折叠代码的一种方法。作为一种手动方法,它易于控制,因此受到许多人的青睐。请参阅
:h 折叠
和:h 折叠标记
。These are so called foldmarkers. Vim 6 introduced code folding and the triple braces are the default string to mark the beginning and the end of a fold. In addition, if you prepend the opening mark
{{{
with text, it'll show in the collapsed line as a header. This is only one way to fold code. Being a manual method, it is easily controlled and thus preferred by many.See
:h folding
and:h fold-marker
.