0

I find possibility to jump over words using ctrl-arrow very convenient. But, for some reason, the special characters after the space make jumping omit the space. For example (ctrl+left pressed between arrows and | denotes position of the coursor)

command -flag /home/path| -> command -flag /home/|path -> command -flag /|home/path -> command -|flag /home/path -> |command -flag /home/path

This behavior annoys me much - do you know of the way to set it up to make cursor stop at the beginning of each word including special characters?

Expected behavior example:

command -flag /home/path| -> command -flag /home|/path -> command -flag |/home/path -> command |-flag /home/path -> |command -flag /home/path

I personally use zsh + linux, but would expect an OS/shell-independent solution to exist.

sygi
  • 4,557
  • 2
  • 32
  • 54
  • 1
    Cursor movement is decidedly shell-dependent; it's the shell that handles input at the prompt. `bash` uses the GNU `readline` library; `zsh` uses its own line editor `zle`. Further, your terminal emulator is going to decide what keys are even available; control-arrow needs to be configured at that level to send an appropriate character sequence the shell can interpret. – chepner Oct 23 '15 at 12:11
  • Probably - but it behaves in the same way in bash/zsh/chrome/firefox now. I am interested in a solution for zsh. – sygi Oct 23 '15 at 12:32
  • @chepner left out one caveat: the *shell* determines what characters comprise a *word*. It is nice if bash and zsh agree on that from the example given, it sounds as if OP is asking about vi-mode), but one cannot count on this coincidence. – Thomas Dickey Oct 23 '15 at 20:55
  • See https://stackoverflow.com/questions/10847255/how-to-make-zsh-forward-word-behaviour-same-as-in-bash-emacs. – 4ae1e1 Oct 24 '15 at 10:46

0 Answers0