Hacker News new | past | comments | ask | show | jobs | submit login

For the record, you can do this with C-x C-e without vi keybindings



The more I read these comments/suggestions, the more I realize I'm bash'ing like a child. I seriously need to embrace my shell a little more.


Same for me. I knew the bash has emacs bindings and I know just enough to go to beginning, end, delete a word, etc. but I never knew you can start emacs with a shortcut like this. How do you even exit emacs properly?


C-x C-s to save, C-x C-c to quit.

But you can also control which editor is going to be used to edit your command line by setting the EDITOR environment variable.

It also works for git, and other commands that need to spawn editors.


I never knew that existed.

My first thought was "emacs editing characters already work on the command line."

Then I thought, maybe there are commands you want to be really really sure of before submitting them?

Then I realized I very frequently use very long commands with loops and pipes that might benefit, like:

  for i in *.py; do mv $i AA_$i; done
or a little of both:

  find . -type f |while read f; do if cmp -s "$f" ../new/"$f"; then rm -f "$f"; fi ;done
(thanks!)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: