Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I use zsh's function copy-prev-shell-word. You can bind it to some key, e.g. alt-m with `bindkey "^[m" copy-prev-shell-word`. Use ctrl-v shortcut for another key.

For instance, adding a suffix to a file name: mv myfile alt-m.suffix



mv myfile{,.suffix} seems easier and more general, and doesn't need zsh.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: