q/ - Search string history
q: - Ex cmdline history
q? - Search string history
Also note that if you normally use Ctrl-C to exit Insert mode, that fails here as Ctrl-C will close the history buffer. You need to use Escape or Ctrl-[.:%s/
and when you realise it's not as simple as you first thought.. doing ^f will take you "command line" buffer where you can do all the normal vim commands..
as for copy/paste .. if your vim is compiled with the option "+clipboard" then you can use the "+" register to interact with all your system copy/pasting..
however, what I most frequently end up doing is entering paste mode (:set paste) and just using my terminal emulator's paste buffer.. you can also sync these using tmux's buffers etc if you want, but it's a little less elegant imo..
once you have set/unset paste mode aliased to something sensible it makes the whole process as simple as it gets imo
for your vimrc
nmap <silent> <leader>p :set invpaste<CR>:set paste?<CR>
Do you have any idea how many tutorials there are out there that involve some kind of obscure plugin or xclip incantation for something as simple as pasting text over ssh with formatting?
To think all I needed to do was :set paste... Extraordinary.
You can leave command history just by typing <enter>, not :q<enter>.
While the top voted answer is very complete, I prefer editing the command history.
In normal mode, type:
This will give you a list of recent commands, editable and searchable with normal vim commands. You'll start on a blank command line at the bottom.For the exact thing that the article asks, pasting a yanked line (or yanked anything) into a command line, yank your text and then:
(get into command history edit mode, and then (p)ut your yanked text into a new command line. Edit at will, enter to execute.To get out of command history mode, it's the opposite. In normal mode in command history, type: