In example, I would like to paste the current time or date into editor by using external commands (such as date) without leaving vim.How this can be achieved?
How to dump output from external command into editor?
external command
Simply run:%!date(or whatever command you wish to dump into the current buffer).This will replace the entire buffer with the command's output. If you don't want this, use read instead::read !dateOr, you can replace a certain line with the output of an external command::2!date  replace line 2 with the current date:$!date  replace the last line with the current date:.!date  replace the current line with the current dateThis also works with read, but appends after that line instead (ex. use :$read !date to append the current date to the file).