Replies: 4 comments 5 replies
-
I don't have interest with configure nvim by lua, but PR welcome. |
Beta Was this translation helpful? Give feedback.
-
Someone seem to have ported the coc configuration to lua https://github.com/samhvw8/mvim/blob/master/lua/core/coc.lua I tried it and it seems to just work |
Beta Was this translation helpful? Give feedback.
-
if someone seach for "more lua" config about see https://github.com/findNextStep/mydot/blob/master/nvim/lua/plugin/coc.lua local function check_back_space()
local col = vim.fn.col('.') - 1
return col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') ~= nil
end
local opts = { silent = true, noremap = true, expr = true, replace_keycodes = false }
vim.keymap.set("i", "<Tab>",
function()
if vim.fn['coc#pum#visible']() == 1 then
return vim.fn['coc#pum#next'](1)
end
if check_back_space() then
return vim.fn['coc#refresh']()
end
return "<Tab>"
end
, opts)
vim.keymap.set("i", "<S-Tab>", function()
if vim.fn['coc#pum#visible']() == 1 then
return vim.fn['coc#pum#prev'](1)
end
return "<S-Tab>"
end, opts)
vim.keymap.set("i", "<CR>", function()
if vim.fn['coc#pum#visible']() == 1 then
return vim.fn['coc#pum#confirm']();
end
return "\r"
end, opts) and if you want add coc_status into stateline, check here. we need |
Beta Was this translation helpful? Give feedback.
-
For anyone in the future. This is my config for Enter select.
local coc_opts = {
silent = true,
noremap = true,
expr = true,
} The keybind -- COC keybinds
vim.keymap.set('i', '<Cr>',
function()
-- Returns 1 if visible, 0 if not
is_visible = vim.fn['coc#pum#visible']()
if is_visible == 1 then
return vim.fn['coc#pum#confirm']()
else
return '<Cr>'
end
end, coc_opts) |
Beta Was this translation helpful? Give feedback.
-
I am trying to start neovim with a setup totally in
.lua
and I have notice thatcoc.nvim
doesn't have a guide (forpacker.nvim
, at least) to install and configure coc withlua
, am I wrong? Iscoc.nvim
not interested in doing this? As a beginner, I do not have ability to make out how to set this up inlua
without a guide. Thank you in advance.Beta Was this translation helpful? Give feedback.
All reactions