简体   繁体   中英

Neovim Keybindings in Lua

I'm trying to create a keybinding for my Neovim config, but can't seem to get it to work. I don't know if the format is completely correct, cause I am very new to Lua, and Neovim in general.

What I want is to bind [ctrl-i ( left-bracket + ctrl + i ) to gd . I think that gd is used in LSP for going to a function definition, but I am currently using coc.nvim and gd does not seem to work in that manner.

I have tried this:

vim.api.nvim_set_keymap("n","gd", "[+<C-i>", { noremap = true, silent = true })

And also this:

vim.api.nvim_set_keymap("n","gd", "[<C-i>", { noremap = true, silent = true })

But neither seem to work. Can anyone point me in the right direction please? Thanks!

Sorry, had a typo in my code.

Mods, please close.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM