Merge branch 'master' of gitea.suda.codes:sudacode/nvim
This commit is contained in:
commit
77272b9419
@ -29,13 +29,18 @@ require('packer').startup(function(use)
|
|||||||
refresh = "gr",
|
refresh = "gr",
|
||||||
open = "<C-CR>"
|
open = "<C-CR>"
|
||||||
},
|
},
|
||||||
|
layout = {
|
||||||
|
position = "right", -- | top | left | right
|
||||||
|
ratio = 0.4
|
||||||
|
},
|
||||||
},
|
},
|
||||||
suggestion = {
|
suggestion = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
auto_trigger = true,
|
auto_trigger = true,
|
||||||
debounce = 75,
|
debounce = 75,
|
||||||
keymap = {
|
keymap = {
|
||||||
accept = "<Tab>",
|
-- accept = "<Tab>",
|
||||||
|
accept = "<Right>",
|
||||||
next = "<M-]>",
|
next = "<M-]>",
|
||||||
prev = "<M-[>",
|
prev = "<M-[>",
|
||||||
dismiss = "<C-]>",
|
dismiss = "<C-]>",
|
||||||
@ -54,7 +59,15 @@ require('packer').startup(function(use)
|
|||||||
-- },
|
-- },
|
||||||
copilot_node_command = 'node', -- Node version must be < 18
|
copilot_node_command = 'node', -- Node version must be < 18
|
||||||
plugin_manager_path = vim.fn.stdpath("data") .. "/site/pack/packer",
|
plugin_manager_path = vim.fn.stdpath("data") .. "/site/pack/packer",
|
||||||
server_opts_overrides = {},
|
server_opts_overrides = {
|
||||||
|
trace = "verbose",
|
||||||
|
settings = {
|
||||||
|
advanced = {
|
||||||
|
listCount = 10, -- #completions for panel
|
||||||
|
inlineSuggestCount = 4, -- #completions for getCompletions
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
})
|
})
|
||||||
require("copilot.suggestion").toggle_auto_trigger()
|
require("copilot.suggestion").toggle_auto_trigger()
|
||||||
end, 100)
|
end, 100)
|
||||||
@ -172,6 +185,9 @@ require('packer').startup(function(use)
|
|||||||
use {
|
use {
|
||||||
'hrsh7th/cmp-path'
|
'hrsh7th/cmp-path'
|
||||||
}
|
}
|
||||||
|
use {
|
||||||
|
'hrsh7th/cmp-cmdline'
|
||||||
|
}
|
||||||
use {
|
use {
|
||||||
'hrsh7th/cmp-buffer'
|
'hrsh7th/cmp-buffer'
|
||||||
}
|
}
|
||||||
@ -269,6 +285,14 @@ require('packer').startup(function(use)
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
settings_window = {
|
||||||
|
border = {
|
||||||
|
style = "rounded",
|
||||||
|
text = {
|
||||||
|
top = " Settings ",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
chat_input = {
|
chat_input = {
|
||||||
prompt = " ",
|
prompt = " ",
|
||||||
border = {
|
border = {
|
||||||
@ -292,11 +316,21 @@ require('packer').startup(function(use)
|
|||||||
top_p = 1,
|
top_p = 1,
|
||||||
n = 1,
|
n = 1,
|
||||||
},
|
},
|
||||||
|
openai_edit_params = {
|
||||||
|
-- model = "code-davinci-edit-001",
|
||||||
|
model = "gpt-3.5-turbo",
|
||||||
|
temperature = 0,
|
||||||
|
top_p = 1,
|
||||||
|
n = 1,
|
||||||
|
},
|
||||||
keymaps = {
|
keymaps = {
|
||||||
close = "<C-c>",
|
close = { "<C-c>", "<Esc>" },
|
||||||
yank_last = "<C-y>",
|
yank_last = "<C-y>",
|
||||||
scroll_up = "<C-u>",
|
scroll_up = "<C-u>",
|
||||||
scroll_down = "<C-d>",
|
scroll_down = "<C-d>",
|
||||||
|
toggle_settings = "<C-o>",
|
||||||
|
new_session = "<C-n>",
|
||||||
|
cycle_windows = "<Right>",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)end,
|
)end,
|
||||||
|
@ -6,7 +6,7 @@ cfg = {
|
|||||||
|
|
||||||
bind = true, -- This is mandatory, otherwise border config won't get registered.
|
bind = true, -- This is mandatory, otherwise border config won't get registered.
|
||||||
-- If you want to hook lspsaga or other signature handler, pls set to false
|
-- If you want to hook lspsaga or other signature handler, pls set to false
|
||||||
doc_lines = 12, -- will show two lines of comment/doc(if there are more than two lines in doc, will be truncated);
|
doc_lines = 15, -- will show two lines of comment/doc(if there are more than two lines in doc, will be truncated);
|
||||||
-- set to 0 if you DO NOT want any API comments be shown
|
-- set to 0 if you DO NOT want any API comments be shown
|
||||||
-- This setting only take effect in insert mode, it does not affect signature help in normal
|
-- This setting only take effect in insert mode, it does not affect signature help in normal
|
||||||
-- mode, 10 by default
|
-- mode, 10 by default
|
||||||
@ -15,30 +15,23 @@ cfg = {
|
|||||||
floating_window_above_cur_line = true, -- try to place the floating above the current line when possible Note:
|
floating_window_above_cur_line = true, -- try to place the floating above the current line when possible Note:
|
||||||
-- will set to true when fully tested, set to false will use whichever side has more space
|
-- will set to true when fully tested, set to false will use whichever side has more space
|
||||||
-- this setting will be helpful if you do not want the PUM and floating win overlap
|
-- this setting will be helpful if you do not want the PUM and floating win overlap
|
||||||
|
floating_window_off_x = 0, -- adjust float windows x position.
|
||||||
floating_window_off_x = 1, -- adjust float windows x position.
|
|
||||||
floating_window_off_y = -1, -- adjust float windows y position.
|
floating_window_off_y = -1, -- adjust float windows y position.
|
||||||
|
fix_pos = true, -- trueset to true, the floating window will not auto-close until finish all parameters
|
||||||
fix_pos = false, -- set to true, the floating window will not auto-close until finish all parameters
|
hint_enable = false, -- virtual hint enable
|
||||||
hint_enable = true, -- virtual hint enable
|
|
||||||
hint_prefix = " ", -- Panda for parameter
|
hint_prefix = " ", -- Panda for parameter
|
||||||
hint_scheme = "String",
|
hint_scheme = "String",
|
||||||
hi_parameter = "LspSignatureActiveParameter", -- how your parameter will be highlight
|
hi_parameter = "LspSignatureActiveParameter", -- how your parameter will be highlight
|
||||||
max_height = 15, -- max height of signature floating_window, if content is more than max_height, you can scroll down
|
max_height = 15, -- max height of signature floating_window, if content is more than max_height, you can scroll down
|
||||||
-- to view the hiding contents
|
|
||||||
max_width = 85, -- max_width of signature floating_window, line will be wrapped if exceed max_width
|
max_width = 85, -- max_width of signature floating_window, line will be wrapped if exceed max_width
|
||||||
handler_opts = {
|
handler_opts = {
|
||||||
border = "rounded" -- double, rounded, single, shadow, none
|
border = "rounded" -- double, rounded, single, shadow, none
|
||||||
},
|
},
|
||||||
|
|
||||||
always_trigger = false, -- sometime show signature on new line or in middle of parameter can be confusing, set it to false for #58
|
always_trigger = false, -- sometime show signature on new line or in middle of parameter can be confusing, set it to false for #58
|
||||||
|
|
||||||
auto_close_after = nil, -- autoclose signature float win after x sec, disabled if nil.
|
auto_close_after = nil, -- autoclose signature float win after x sec, disabled if nil.
|
||||||
extra_trigger_chars = {}, -- Array of extra characters that will trigger signature completion, e.g., {"(", ","}
|
extra_trigger_chars = {}, -- Array of extra characters that will trigger signature completion, e.g., {"(", ","}
|
||||||
zindex = 200, -- by default it will be on top of all floating windows, set to <= 50 send it to bottom
|
zindex = 200, -- by default it will be on top of all floating windows, set to <= 50 send it to bottom
|
||||||
|
|
||||||
padding = '', -- character to pad on left and right of signature can be ' ', or '|' etc
|
padding = '', -- character to pad on left and right of signature can be ' ', or '|' etc
|
||||||
|
|
||||||
transparency = nil, -- disabled by default, allow floating win transparent value 1~100
|
transparency = nil, -- disabled by default, allow floating win transparent value 1~100
|
||||||
shadow_blend = 36, -- if you using shadow as border use this set the opacity
|
shadow_blend = 36, -- if you using shadow as border use this set the opacity
|
||||||
shadow_guibg = 'Black', -- if you using shadow as border use this set the color e.g. 'Green' or '#121315'
|
shadow_guibg = 'Black', -- if you using shadow as border use this set the color e.g. 'Green' or '#121315'
|
||||||
|
@ -13,7 +13,7 @@ require("null-ls").setup({
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
sources = {
|
sources = {
|
||||||
null_ls.builtins.completion.spell,
|
-- null_ls.builtins.completion.spell,
|
||||||
null_ls.builtins.completion.luasnip,
|
null_ls.builtins.completion.luasnip,
|
||||||
null_ls.builtins.code_actions.gitsigns,
|
null_ls.builtins.code_actions.gitsigns,
|
||||||
null_ls.builtins.code_actions.shellcheck,
|
null_ls.builtins.code_actions.shellcheck,
|
||||||
@ -49,6 +49,8 @@ require("null-ls").setup({
|
|||||||
}),
|
}),
|
||||||
null_ls.builtins.formatting.black,
|
null_ls.builtins.formatting.black,
|
||||||
null_ls.builtins.formatting.isort,
|
null_ls.builtins.formatting.isort,
|
||||||
|
null_ls.builtins.formatting.djlint,
|
||||||
|
null_ls.builtins.hover.printenv
|
||||||
-- null_ls.builtins.formatting.tidy
|
-- null_ls.builtins.formatting.tidy
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
-- Setup nvim-cmp.
|
-- Setup nvim-cmp.
|
||||||
local cmp = require 'cmp'
|
local cmp = require 'cmp'
|
||||||
local lspkind = require('lspkind')
|
local lspkind = require('lspkind')
|
||||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
|
||||||
local lspconfig = require('lspconfig')
|
local lspconfig = require('lspconfig')
|
||||||
-- luasnip setup
|
-- luasnip setup
|
||||||
local luasnip = require 'luasnip'
|
local luasnip = require 'luasnip'
|
||||||
@ -74,6 +73,8 @@ cmp.setup({
|
|||||||
["<Tab>"] = vim.schedule_wrap(function(fallback)
|
["<Tab>"] = vim.schedule_wrap(function(fallback)
|
||||||
if cmp.visible() and has_words_before() then
|
if cmp.visible() and has_words_before() then
|
||||||
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
|
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
|
||||||
|
elseif luasnip.expand_or_jumpable() then
|
||||||
|
luasnip.expand_or_jump()
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
@ -174,8 +175,9 @@ cmp.setup({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
|
|
||||||
local servers = { 'bashls', 'jedi_language_server', 'sqlls', 'jsonls', 'yamlls', 'vimls', 'dotls', 'dockerls', 'lua_ls' }
|
local servers = { 'bashls', 'jedi_language_server', 'sqlls', 'jsonls', 'yamlls', 'vimls', 'dotls', 'dockerls', 'html', 'cssls', 'lua_ls' }
|
||||||
for _, lsp in ipairs(servers) do
|
for _, lsp in ipairs(servers) do
|
||||||
lspconfig[lsp].setup {
|
lspconfig[lsp].setup {
|
||||||
-- on_attach = my_custom_on_attach,
|
-- on_attach = my_custom_on_attach,
|
||||||
@ -183,9 +185,9 @@ for _, lsp in ipairs(servers) do
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
-- cmp.event:on("menu_opened", function()
|
cmp.event:on("menu_opened", function()
|
||||||
-- vim.b.copilot_suggestion_hidden = true
|
vim.b.copilot_suggestion_hidden = true
|
||||||
-- end)
|
end)
|
||||||
-- cmp.event:on("menu_closed", function()
|
cmp.event:on("menu_closed", function()
|
||||||
-- vim.b.copilot_suggestion_hidden = false
|
vim.b.copilot_suggestion_hidden = false
|
||||||
-- end)
|
end)
|
||||||
|
@ -19,7 +19,8 @@ require('telescope').setup{
|
|||||||
-- e.g. git_{create, delete, ...}_branch for the git_branches picker
|
-- e.g. git_{create, delete, ...}_branch for the git_branches picker
|
||||||
["<C-h>"] = "which_key"
|
["<C-h>"] = "which_key"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
file_ignore_patterns = { "node_modules", "env", "__pycache__" }
|
||||||
},
|
},
|
||||||
pickers = {
|
pickers = {
|
||||||
-- Default configuration for builtin pickers goes here:
|
-- Default configuration for builtin pickers goes here:
|
||||||
|
Loading…
Reference in New Issue
Block a user