master - refix disable tab when using copilot

This commit is contained in:
huyjaky
2025-07-27 23:58:09 +07:00
parent 827a408378
commit f0c5a8f756
9 changed files with 147 additions and 140 deletions

View File

@@ -18,7 +18,6 @@ return function()
mappings.n["<C-Right>"] = false
mappings.n["<C-Up>"] = false
mappings.n["<C-Down>"] = false
mappings.n["K"] = false
-------------------------------------------
----------- Utility functions -------------

View File

@@ -27,7 +27,7 @@ return {
jedi_language_server = {
init_options = {
completion = {
disableSnippets = false,
disableSnippets = true,
},
diagnostics = {
enable = true,
@@ -40,6 +40,9 @@ return {
"sklearn",
},
},
workspace = {
environmentPath = "/home/duckq1u/miniconda3/envs/OCR3/bin/python"
}
},
},

View File

@@ -97,8 +97,6 @@ return {
-- Tab to select completion
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() and has_words_before() then
vim.g.copilot_no_tab_map = true -- NOTE: disable copilot's tab mapping PART1
fallback()
else
fallback()
@@ -123,7 +121,6 @@ return {
-- NOTE: disable tabl when using copilot PART2
vim.api.nvim_set_keymap("i", "<C-f>", 'copilot#Accept("\\<CR>")', { expr = true, silent = true }),
vim.keymap.del("i", "<Tab>"),
-- ["<C-f>"] = cmp.mapping(function(fallback)
-- -- Check if Copilot is suggesting something
-- if vim.fn["copilot#Accept"]() ~= "" then

View File

@@ -19,13 +19,11 @@ return {
-- 'thumbs.db',
},
never_show = {},
never_show_by_pattern = { -- uses glob style patterns
'*.zip',
'*.rar',
'*.pdf',
"*.zip",
"*.rar",
"*.pdf",
},
},
},
enable_git_status = false,

View File

@@ -1,120 +1,124 @@
return {
"folke/noice.nvim",
event = "VeryLazy",
dependencies = { "MunifTanjim/nui.nvim" },
config = function()
require("noice").setup {
-- Configuration here, or leave empty to use defaults
views = {},
messages = {
enabled = false, -- disables the Noice messages UI
},
notify = {
enabled = false, -- disables Noice notifications
},
lsp = {
progress = {
enabled = false,
},
hover = {
enabled = true,
silent = true,
view = "hover",
opts = {
border = {
style = "rounded",
text = { top = " Documents ", top_align = "center" },
},
win_options = {
wrap = true,
linebreak = true,
},
},
},
signature = {
enabled = false, -- disables Noice LSP signature help
},
message = {
enabled = false,
},
},
presets = {
bottom_search = false, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = false, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
},
"folke/noice.nvim",
event = "VeryLazy",
dependencies = { "MunifTanjim/nui.nvim" },
config = function()
require("noice").setup({
-- Configuration here, or leave empty to use defaults
views = {},
messages = {
enabled = false, -- disables the Noice messages UI
},
notify = {
enabled = false, -- disables Noice notifications
},
lsp = {
progress = {
enabled = false,
},
hover = {
enabled = true,
silent = true,
view = "hover",
opts = {
border = {
style = "rounded",
text = { top = " Documents ", top_align = "center" },
},
win_options = {
wrap = true,
linebreak = true,
},
},
},
signature = {
enabled = false, -- disables Noice LSP signature help
},
message = {
enabled = false,
},
},
presets = {
bottom_search = false, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = false, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
},
routes = {
-- disable "written" notification
{
filter = { event = "msg_show", kind = "", find = "written" },
opts = { skip = true },
},
-- disable paste/undo notification
{
filter = { event = "msg_show", find = "^%d+ more lines" },
opts = { skip = true },
},
-- disable delete/undo notification
{
filter = { event = "msg_show", find = "^%d+ fewer lines" },
opts = { skip = true },
},
-- disable yank notification
{
filter = { event = "msg_show", find = "^%d+ lines yanked$" },
opts = { skip = true },
},
-- disable move notification
{
filter = { event = "msg_show", find = "^%d+ lines moved$" },
},
},
}
end,
specs = {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
if opts.ensure_installed ~= "all" then
opts.ensure_installed = require("astrocore").list_insert_unique(
opts.ensure_installed,
{ "bash", "markdown", "markdown_inline", "regex", "vim" }
)
end
end,
},
{
"AstroNvim/astrolsp",
optional = true,
---@param opts AstroLSPOpts
opts = function(_, opts)
-- No need to manage lsp_handlers as noice is not handling them now
end,
},
{
"heirline.nvim",
optional = true,
opts = function(_, opts)
local noice_opts = require("astrocore").plugin_opts "noice.nvim"
if vim.tbl_get(noice_opts, "lsp", "progress", "enabled") ~= false then -- check if lsp progress is enabled
opts.statusline[9] = require("astroui.status").component.lsp { lsp_progress = false }
end
end,
},
{
"folke/edgy.nvim",
optional = true,
opts = function(_, opts)
if not opts.bottom then opts.bottom = {} end
table.insert(opts.bottom, {
ft = "noice",
size = { height = 0.4 },
filter = function(_, win) return vim.api.nvim_win_get_config(win).relative == "" end,
})
end,
},
},
routes = {
-- disable "written" notification
{
filter = { event = "msg_show", kind = "", find = "written" },
opts = { skip = true },
},
-- disable paste/undo notification
{
filter = { event = "msg_show", find = "^%d+ more lines" },
opts = { skip = true },
},
-- disable delete/undo notification
{
filter = { event = "msg_show", find = "^%d+ fewer lines" },
opts = { skip = true },
},
-- disable yank notification
{
filter = { event = "msg_show", find = "^%d+ lines yanked$" },
opts = { skip = true },
},
-- disable move notification
{
filter = { event = "msg_show", find = "^%d+ lines moved$" },
},
},
})
end,
specs = {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
if opts.ensure_installed ~= "all" then
opts.ensure_installed = require("astrocore").list_insert_unique(
opts.ensure_installed,
{ "bash", "markdown", "markdown_inline", "regex", "vim" }
)
end
end,
},
{
"AstroNvim/astrolsp",
optional = true,
---@param opts AstroLSPOpts
opts = function(_, opts)
-- No need to manage lsp_handlers as noice is not handling them now
end,
},
{
"heirline.nvim",
optional = true,
opts = function(_, opts)
local noice_opts = require("astrocore").plugin_opts("noice.nvim")
if vim.tbl_get(noice_opts, "lsp", "progress", "enabled") ~= false then -- check if lsp progress is enabled
opts.statusline[9] = require("astroui.status").component.lsp({ lsp_progress = false })
end
end,
},
{
"folke/edgy.nvim",
optional = true,
opts = function(_, opts)
if not opts.bottom then
opts.bottom = {}
end
table.insert(opts.bottom, {
ft = "noice",
size = { height = 0.4 },
filter = function(_, win)
return vim.api.nvim_win_get_config(win).relative == ""
end,
})
end,
},
},
}

View File

@@ -9,14 +9,14 @@ return {
},
opts = function(_, opts)
-- config variable is the default configuration table for the setup function call
local null_ls = require "null-ls"
local null_ls = require("null-ls")
-- Check supported formatters and linters
-- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/formatting
-- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
opts.sources = {
require('none-ls.formatting.ruff').with { extra_args = { '--extend-select', 'F' } },
require 'none-ls.formatting.ruff_format', -- Set a formatter
require("none-ls.formatting.ruff").with({ extra_args = { "--extend-select", "F" } }),
require("none-ls.formatting.ruff_format"), -- Set a formatter
}
return opts
end,

View File

@@ -50,8 +50,8 @@ return {
},
},
config = function(_, opts)
local dap = require "dap"
local dapui = require "dapui"
local dap = require("dap")
local dapui = require("dapui")
-- Initialize dap-ui
dapui.setup(opts)
@@ -65,7 +65,9 @@ return {
end
-- Optionally, open dap-ui when session starts
dap.listeners.after.event_initialized["dapui"] = function() dapui.open() end
dap.listeners.after.event_initialized["dapui"] = function()
dapui.open()
end
end,
},
{