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

Re: code completition / cannot delete characters



On Mar 9, 11:45pm, Michael Worobcuk wrote:
}
} > Instead it appears that the six keys ESC x r e d i are being swallowed

Aha, yes, as Micah suggested you do appear to be using the vi bindings.
(bindkey -v)  That would explain much.  ESC goes to vi command mode, 
and then (because the command line is empty) nothing happens until you
get to "i" which puts you back in insert mode where you type "splay".

} > bindkey -m
} >
} > do you get a warning about multibyte support being disabled?
} Yes, here it is:
} 
} [hanno: /home/hanno]>bindkey -m
} bindkey: warning: `bindkey -m' disables multibyte support

After you've done that, does anything change about the way completion
behaves?

I think you're probably just running into one of the cases where
multibyte support was not quite finished in the completion system.
If you're able to compile your own copy of the shell, try getting
the latest development snapshot from sourceforge.net.

} > Have you tried using the insert-composed-char or insert-unicode-char
} > functions?  You'll need to install them:
} >
} > autoload -U insert-composed-char
} > zle -N insert-composed-char
} >
} > and then bind them to a convenient key sequence with bindkey.
} 
} Could you explain me, how to do that ?

Since you're using vi mode, the binding for the ESC key is to change
to command mode, and most other keys bindings just insert themselves.
You need to choose some keys that aren't already being used for another
purpose.  To see what's already in use, use

	bindkey -M viins

A good choice for an unbound key is often control-X (^X) but you may
find that some completion functions have already been attached to key
sequences beginning with that.

Assuming for example that ^Xc is available for insert-composed-char
and ^Xu is available for insert-unicode-char, you just do

autoload -U insert-composed-char insert-unicode-char
zle -N insert-composed-char
zle -N insert-unicode-char
bindkey -v ^Xc insert-composed-char
bindkey -v ^Xu insert-unicode-char

Then when you're ready to insert a multibyte character, you type
control-x and then c and then the two characters that represent the
multibyte character, e.g. ^X c a : for ä.

See the manual for the various things you can insert this way.



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