++ in vim commands

独自空忆成欢 提交于 2019-12-08 02:47:07

问题


What does ++ mean in vim?

For example, :e ++ff=dos. I understand e and ff=dos, just not sure how ++ fits in there.


回答1:


:h ++opt for detail

The [++opt] argument can be used to force the value of 'fileformat',
'fileencoding' or 'binary' to a value for one command, and to specify the
behavior for bad characters.  The form is: >
    ++{optname}
Or: >
    ++{optname}={value}

Where {optname} is one of:      *++ff* *++enc* *++bin* *++nobin* *++edit*
    ff     or  fileformat   overrides 'fileformat'
    enc    or  encoding     overrides 'fileencoding'
    bin    or  binary       sets 'binary'
    nobin  or  nobinary     resets 'binary'
    bad             specifies behavior for bad characters
    edit            for |:read| only: keep option values as if editing
                a file

the cmd in your question:

:e ++ff=dos 

means editing the same file again with fileformat set to "dos"




回答2:


++ is used to FORCE values for commands like ff,enc and others.

Use :h ++ to look this up yourself in the vim help!



来源:https://stackoverflow.com/questions/15098084/in-vim-commands

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!