zwyyy456 / nvim_config

config of nvim, to sync
Apache License 2.0
1 stars 0 forks source link

How to remap the insert mode 'jk' to '<ESC>' #1

Open Robinsssson opened 2 months ago

Robinsssson commented 2 months ago

Thanks your blog, but there is a question that you do not mention the insert mode how to remap in keymaps.lua. In your blog tag the 'disuse' but not talk about it, if you give me the solution about it, I would be grateful.

zwyyy456 commented 2 months ago

Thanks your blog, but there is a question that you do not mention the insert mode how to remap in keymaps.lua. In your blog tag the 'disuse' but not talk about it, if you give me the solution about it, I would be grateful.

Do you mean map jk to <ESC> in insert mode?

Just like follow:

local keymap = vim.keymap

keymap.set("i", "jk", "<ESC>")
Robinsssson commented 2 months ago

Thanks your blog, but there is a question that you do not mention the insert mode how to remap in keymaps.lua. In your blog tag the 'disuse' but not talk about it, if you give me the solution about it, I would be grateful.

Do you mean map jk to <ESC> in insert mode?

Just like follow:

local keymap = vim.keymap

keymap.set("i", "jk", "<ESC>")

thanks your reply! But it did not worked in my vscode😨

zwyyy456 commented 2 months ago

Thanks your blog, but there is a question that you do not mention the insert mode how to remap in keymaps.lua. In your blog tag the 'disuse' but not talk about it, if you give me the solution about it, I would be grateful.

Do you mean map jk to <ESC> in insert mode? Just like follow:

local keymap = vim.keymap

keymap.set("i", "jk", "<ESC>")

thanks your reply! But it did not worked in my vscode😨

It depends on the vscode plugin, I use vscode.neovim. The method is as follow:

image

I don't know how vim plugin works.