insert a symbol

Vegard Øye vegard_oye at hotmail.com
Mon May 28 15:57:47 CEST 2012


On 2012-05-28 15:22 +0200, Petro wrote:

> Is there a way to insert one symbol without entering into insert mode?
> I find it unconvenient to push "i <symbol> C-[" to insert one letter.

As Michael pointed out, you can use "\" to escape to Emacs state for
the duration of one command. Thus, "\e" inserts the letter "e" and
then returns to Normal state.

The following Vim tip suggests to bind a character-insertion command
to "SPC":

    http://vim.wikia.com/wiki/Insert_a_single_character

If you would rather type "SPC <symbol>" instead of "\ <symbol>", then
you can rebind "SPC". By typing "C-h k \", we see that "\" is bound to
the command `evil-execute-in-emacs-state'. Thus, the following binds
it to "SPC":

    (define-key evil-normal-state-map " " 'evil-execute-in-emacs-state)

Then you can follow the Vim tip to set up similar behavior in Vim,
if you use both editors.

-- 
Vegard



More information about the implementations-list mailing list