How can I execute the current line as Vim EX commands?

后端 未结 8 1567
渐次进展
渐次进展 2021-02-02 11:17

Say I\'m editing my _vimrc file and I\'ve just added a couple of lines, for instance a new key mapping. I don\'t want to reload the whole file (:so %

8条回答
  •  后悔当初
    2021-02-02 11:22

    I don't want to reload the whole file (:so %) since that will reset a lot of temporary stuff I'm experimenting. I just want to run the two lines that I'm currently working on.

    If you want to execute a command because you want to refine it before committing it to _.vimrc, then you should launch a Command Line Window for Ex-mode commands with q:.

    At launch the Command Line Window is buffered with the contents of the command line history. It is a normal Vim window the contents of which can be edited as any text buffer with the exception of pressing on any line which executes the command on that line. It is very useful when you want to slightly change a long, complex command you wrote earlier and re-run it.

    To launch a 'Command Line Window' for search strings press q/.

提交回复
热议问题