I think what you want is an abbreviation when you are in insert mode. Try adding the following to your .vim/ftplugin/cpp.vim file:
iabbr <buffer> include() /home/yapjiahong/projects/cpp/add-libraries/plog/include
Now, whenever you are in insert mode and type include() followed by a space or return, the text on the right hand side will automatically ...
Suppose Vim is running, you can use Vim remote to send commands. I suggest to keep it running (i.e. bg after ctrl z) and then use vim --remote to send an edit command to it.
If you don't want to do this, a possible solution is to use a file that will contain a file list. Vim will check it when running and load buffers from this file.
Use au GuiEnter maybe.
To follow up on @Christian Brabandt's answer, you can use the O key (see :help O) and do:
norm allows to run a key command (O, dd, .....) in a command.
:g can take a range also, so if you don't want to do it on the first question, you could do:
Assuming that your file contains only that text, otherwise, the range needs to be ...
You can make use of the :g command. There are probably already answers here on how to use :g and there is also this famous wiki article on the same topic
In short, you simply run:
which basically means, for each line starting with Q put an empty line above it. Alternatively you could use:
which would add an empty line below ...
This seems to work:
au CmdLineEnter * set norelativenumber | redraw
au CmdlineLeave * set relativenumber
Edit: apparently the window does not redraw while you are in the command mode, so you need to force the redraw explicitly to get the effect of the command to be shown. And apparently you also do not need | redraw for CmdlineLeave case, because when you ...
It's somewhat easy to get a function definition and open it in Vim for editing:
declare -f e l vim -
But there are many shortcomings with that approach. For instance, exiting Vim after editing the file won't really reload the function with the new definition. In fact, the buffer you get by reading it from standard input is an unnamed buffer, so Vim won't ...
You want the :redir family of commands. See :h :redir. For example...
:redir > /path/to/file
Then run :au. Then
And the file will contain the same things you saw on the screen. This should work for any command that emits "messages" (echoes to the screen).
You can also append. And you can redirect to registers and variables. Again, ...