update
This commit is contained in:
parent
86aa580d9b
commit
885799dcd7
16
init.lua
16
init.lua
|
@ -243,6 +243,13 @@ vim.keymap.set({ 'n' }, '[b', '<cmd>bprev<CR>', { silent = true })
|
||||||
-- Close all buffers and keep the open one only
|
-- Close all buffers and keep the open one only
|
||||||
vim.keymap.set('n', '<leader>b', '<cmd>:%bd|e#|bd#<CR>', { desc = 'Close all buffers and keep the open one only' })
|
vim.keymap.set('n', '<leader>b', '<cmd>:%bd|e#|bd#<CR>', { desc = 'Close all buffers and keep the open one only' })
|
||||||
|
|
||||||
|
-- signature help
|
||||||
|
vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers['signature_help'], {
|
||||||
|
border = 'single',
|
||||||
|
close_events = { 'CursorMoved', 'BufHidden' },
|
||||||
|
})
|
||||||
|
vim.keymap.set('i', '<C-k>', vim.lsp.buf.signature_help)
|
||||||
|
|
||||||
-- Enable number in netrw
|
-- Enable number in netrw
|
||||||
vim.g.netrw_bufsettings = 'noma nomod nu rnu nobl nowrap ro'
|
vim.g.netrw_bufsettings = 'noma nomod nu rnu nobl nowrap ro'
|
||||||
|
|
||||||
|
@ -902,7 +909,7 @@ require('lazy').setup({
|
||||||
-- into multiple repos for maintenance purposes.
|
-- into multiple repos for maintenance purposes.
|
||||||
'hrsh7th/cmp-nvim-lsp',
|
'hrsh7th/cmp-nvim-lsp',
|
||||||
'hrsh7th/cmp-path',
|
'hrsh7th/cmp-path',
|
||||||
'hrsh7th/cmp-nvim-lsp-signature-help',
|
-- 'hrsh7th/cmp-nvim-lsp-signature-help',
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
-- See `:help cmp`
|
-- See `:help cmp`
|
||||||
|
@ -911,6 +918,8 @@ require('lazy').setup({
|
||||||
luasnip.config.setup {}
|
luasnip.config.setup {}
|
||||||
|
|
||||||
cmp.setup {
|
cmp.setup {
|
||||||
|
-- https://github.com/hrsh7th/cmp-nvim-lsp-signature-help/issues/17
|
||||||
|
-- preselect = cmp.PreselectMode.None,
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
luasnip.lsp_expand(args.body)
|
luasnip.lsp_expand(args.body)
|
||||||
|
@ -971,8 +980,7 @@ require('lazy').setup({
|
||||||
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
|
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
|
||||||
},
|
},
|
||||||
sources = {
|
sources = {
|
||||||
{ name = 'copilot', group_index = 2 },
|
-- { name = 'copilot', group_index = 2 },
|
||||||
-- { name = 'copilot' },
|
|
||||||
{
|
{
|
||||||
name = 'lazydev',
|
name = 'lazydev',
|
||||||
-- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
|
-- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
|
||||||
|
@ -981,7 +989,7 @@ require('lazy').setup({
|
||||||
{ name = 'nvim_lsp' },
|
{ name = 'nvim_lsp' },
|
||||||
{ name = 'luasnip' },
|
{ name = 'luasnip' },
|
||||||
{ name = 'path' },
|
{ name = 'path' },
|
||||||
{ name = 'nvim_lsp_signature_help' },
|
-- { name = 'nvim_lsp_signature_help' },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -1,38 +1,38 @@
|
||||||
return {
|
return {
|
||||||
-- {
|
|
||||||
-- 'github/copilot.vim',
|
|
||||||
-- init = function()
|
|
||||||
-- -- vim.g.copilot_enabled = false
|
|
||||||
-- vim.keymap.set('i', '<M-;>', '<Plug>(copilot-accept-word)')
|
|
||||||
-- vim.keymap.set('i', '<M-/>', '<Plug>(copilot-dismiss)')
|
|
||||||
-- end,
|
|
||||||
-- --
|
|
||||||
-- },
|
|
||||||
{
|
{
|
||||||
'zbirenbaum/copilot.lua',
|
'github/copilot.vim',
|
||||||
cmd = 'Copilot',
|
init = function()
|
||||||
build = ':Copilot auth',
|
-- vim.g.copilot_enabled = false
|
||||||
opts = {
|
vim.keymap.set('i', '<M-;>', '<Plug>(copilot-accept-word)')
|
||||||
suggestion = { enabled = false },
|
vim.keymap.set('i', '<M-/>', '<Plug>(copilot-dismiss)')
|
||||||
panel = { enabled = false },
|
|
||||||
-- filetypes = {
|
|
||||||
-- markdown = true,
|
|
||||||
-- help = true,
|
|
||||||
-- },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'zbirenbaum/copilot-cmp',
|
|
||||||
config = function()
|
|
||||||
require('copilot_cmp').setup()
|
|
||||||
end,
|
end,
|
||||||
|
--
|
||||||
},
|
},
|
||||||
|
-- {
|
||||||
|
-- 'zbirenbaum/copilot.lua',
|
||||||
|
-- cmd = 'Copilot',
|
||||||
|
-- build = ':Copilot auth',
|
||||||
|
-- opts = {
|
||||||
|
-- suggestion = { enabled = false },
|
||||||
|
-- panel = { enabled = false },
|
||||||
|
-- -- filetypes = {
|
||||||
|
-- -- markdown = true,
|
||||||
|
-- -- help = true,
|
||||||
|
-- -- },
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- {
|
||||||
|
-- 'zbirenbaum/copilot-cmp',
|
||||||
|
-- config = function()
|
||||||
|
-- require('copilot_cmp').setup()
|
||||||
|
-- end,
|
||||||
|
-- },
|
||||||
{
|
{
|
||||||
'CopilotC-Nvim/CopilotChat.nvim',
|
'CopilotC-Nvim/CopilotChat.nvim',
|
||||||
branch = 'canary',
|
branch = 'canary',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
-- { 'github/copilot.vim' }, -- or github/copilot.vim
|
{ 'github/copilot.vim' }, -- or github/copilot.vim
|
||||||
{ 'zbirenbaum/copilot.lua' }, -- or github/copilot.vim
|
-- { 'zbirenbaum/copilot.lua' }, -- or github/copilot.vim
|
||||||
{ 'nvim-lua/plenary.nvim' }, -- for curl, log wrapper
|
{ 'nvim-lua/plenary.nvim' }, -- for curl, log wrapper
|
||||||
},
|
},
|
||||||
build = 'make tiktoken', -- Only on MacOS or Linux
|
build = 'make tiktoken', -- Only on MacOS or Linux
|
||||||
|
|
Loading…
Reference in New Issue