4 ms·
My favorite tip in this vein is "fc" => Fix Command, along with "#my_command --here". If you're unsure of a command, press insert a leading "#" to make it a co
by ramses0 10y ago
My favorite tip in this vein is "fc" => Fix Command, along with "#my_command --here".
If you're unsure of a command, press insert a leading "#" to make it a comment (Up-Arrow, Ctrl-A, #, Enter). Then "fc" will load that command into $EDITOR where you can have full text edit capabilities before writing and exiting the file to execute the command.
I know there's some magic keystrokes to get into vi-mode from the command line but I can never remember them, whereas "fc" is pretty easy to remember for the rare occasion when I need it.
- dllthomas 10y agoThe magic keystrokes are whatever fires the "edit-and-execute-command" command. If you're in emacs mode, it's C-x C-e. Mnemonic: e for editor, x because it's emacs and lots of stuff starts with C-x If you're in vi mode, it's v from normal mode, so if you're in insert mode it's escape, then v. Mnemonic: v for vi