Place the following text in your vim.rc file:
function Myfunc <function name starting with a Capital letter>
<tab>:%s/://g
<tab>:%s/something/another/g
endfunction
Now in your vim file you can do
:call Myfunc()
Place the following text in your vim.rc file:
function Myfunc <function name starting with a Capital letter>
<tab>:%s/://g
<tab>:%s/something/another/g
endfunction
Now in your vim file you can do
:call Myfunc()
I got my answer from here: Using command line history in vim
Here is a summary to execute your command of choice from command history:
:n
where n is line number of the command to execute, will place you on the line.If you want to run the last n commands for example:
:@"
How to increase the history limit:
put this line in your vim.rc file: set history 100 (100 will be the history limit)
If this history limit is not taking effect, please read here: How to increase cmdline history size