I have FCEDIT
set to vim
. If I call fc
command it will open vim
with temporary file and contents of that file will be the last executed command from history.
The problem is that even if I exit without saving, the command still gets executed. For instance:
$ printf "\nHelloAskubuntu\n\n"
HelloAskubuntu
$ fc # opens vim, I do :q!
printf "\nHelloAskubuntu\n\n"
HelloAskubuntu
How do I avoid that ?
dd:x
. That will delete the line and save an empty file. That way there is not command to execute.dG
. A one-line file is a special case.