Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Ctrl-Space bindings (was: kills zsh)

On Nov 21, 10:29am, Philip Kizer wrote:
} Subject: Re: Ctrl-Space kills zsh
}   bindkey -s '\000' '\\ '
} so I don't have to go edit a whole line to surround it with quotes if I
} want a space without separating to a new argument.

Although the above binding is useful, don't forget that there are default
bindings for quote-line (ESC ') and quote-region (ESC ").

Other useful bindings, which work only if ctrl-space is still bound to

# Quote-arguments -- wraps everything from the cursor back to the start
# of the first argument in quotes, then inserts a space and sets mark
# so that a subsequent call to quote-region quotes the next part.
bindkey -s '^X"' '^@^A\ef\e" ^@'

# Quote-region-and-mark -- quote region, then insert space and mark for
# subsequent calls to quote-region-and-mark.
bindkey -s "^X'" '\e" ^@'

Bart Schaefer                             Brass Lantern Enterprises
http://www.well.com/user/barts            http://www.nbn.com/people/lantern

Messages sorted by: Reverse Date, Date, Thread, Author