我正在浏览一个 .vimrc 文件,那里的所有内容都是这样写的:-
" Better copy & paste
" When you want to paste large blocks of code into vim, press F2 before you
" paste. At the bottom you should see ``-- INSERT (paste) --``.
"" set pastetoggle=<F2>
"" set clipboard=unnamed
" Mouse and backspace
"" set mouse=a " on OSX press ALT and click
"" set bs=2 " make backspace behave like normal again
" Rebind <Leader> key
" I like to have it here becuase it is easier to reach than the default and
" it is next to ``m`` and ``n`` which I use for navigating between tabs.
"" let mapleader = ","
" Bind nohl
" Removes highlight of your last search
" ``<C>`` stands for ``CTRL`` and therefore ``<C-n>`` stands for ``CTRL+n``
"" noremap <C-n> :nohl<CR>
"" vnoremap <C-n> :nohl<CR>
"" inoremap <C-n> :nohl<CR>
" Quicksave command
"" noremap <C-Z> :update<CR>
"" vnoremap <C-Z> <C-C>:update<CR>
"" inoremap <C-Z> <C-O>:update<CR>
Run Code Online (Sandbox Code Playgroud)
有人能告诉我后面写的那些行" ....
和后面写的行有什么区别"".....吗?
小智 32
这是主要区别:
" Comments to describe what the line of code below does
"" Actual working code for the .vimrc file but still commented.
Run Code Online (Sandbox Code Playgroud)
因此,当您看到双“双引号”是注释代码时,您可以通过删除双“双引号”来取消注释,单个“双引号”表示“我只是一个注释”而不是“未注释” , 说得通?。希望这可以帮助。不要犹豫,问是否有其他疑问!
UPDATE 0 : 在.vimrc文件中,行注释是通过"在文本左侧添加双引号来进行的,这意味着右侧的所有内容"都是注释;多行注释不能在作出.vimrc文件除了添加"到每个行的开头,从而导致不同的多个单行注释C或者PHP,你可以使用这些开放多注释/*和关闭,多行注释*/。我不知道它是否还在那里,但是在vim. 希望这可以帮助!
更新 1:关于双“双引号”和单“双引号”,例如.vimrc文件中的第一行:
“更好的复制和粘贴
”当你想将大块代码粘贴到 vim 中时,在你
“粘贴”之前按 F2 。在底部你应该看到-- INSERT (paste) --." " set pastetoggle=
" " set clipboard=unnamed
请注意,在每一行的开头都有一个像这样的粗体双引号“这意味着该行中紧接其右侧开始的每个文本字符都是注释。
现在,注意最后两行,在这些行的开头有双“双引号”。在该行的第一个字符是一个加粗双引号像这样“和在该行第二个字符是斜体双引号这样”。同样,如上所述,这意味着该行中紧邻其右侧开始的每个文本字符都是注释。现在第二个“双引号”是注释的一部分,您甚至可以添加 3 个或更多双引号,因为当一行包含双引号字符时,右边的所有内容都将被解释为注释. 这只是为了让程序员或用户更快地检测工作代码在哪里,普通注释在哪里,视觉参考。希望这可以帮助。再次,不要犹豫,问是否有任何疑问,干杯!