vim-settings/neovim/lua/plugins/copilot.lua
ViViDboarder 4a042358f6 Use ctrl+f for copilot complete
Similar to fish
2024-06-12 12:37:14 -07:00

23 lines
616 B
Lua

local utils = require("utils")
local M = {}
function M.copilot_accept()
local suggest = vim.fn["copilot#GetDisplayedSuggestion"]()
if next(suggest.item) ~= nil then
print("accept cp")
return vim.fn["copilot#Accept"]("\\<CR>")
else
return utils.t("<Right>")
end
end
M.setup = function()
vim.g.copilot_no_tab_map = false
utils.keymap_set("i", "<C-F>", M.copilot_accept, { expr = true, replace_keycodes = false, noremap = true })
utils.keymap_set("i", "<Right>", M.copilot_accept, { expr = true, replace_keycodes = false, noremap = true })
end
M.setup()
return M