master - refix disable tab when using copilot
This commit is contained in:
4
init.lua
4
init.lua
@@ -18,5 +18,9 @@ if not pcall(require, "lazy") then
|
|||||||
vim.cmd.quit()
|
vim.cmd.quit()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- NOTE: ENV
|
||||||
|
-- Disable Copilot tab mapping
|
||||||
|
vim.g.copilot_no_tab_map = true
|
||||||
|
|
||||||
require("lazy_setup")
|
require("lazy_setup")
|
||||||
require("polish")
|
require("polish")
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
|
"LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
|
||||||
"aerial.nvim": { "branch": "master", "commit": "3284a2cb858ba009c79da87d5e010ccee3c99c4d" },
|
"aerial.nvim": { "branch": "master", "commit": "3284a2cb858ba009c79da87d5e010ccee3c99c4d" },
|
||||||
"alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" },
|
"alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" },
|
||||||
"astrocommunity": { "branch": "main", "commit": "c44cdc008f6b2fb745a7c829100b87a1cfb21b82" },
|
"astrocommunity": { "branch": "main", "commit": "b3ed1de31b0109b28668385336f84dc60c792de3" },
|
||||||
"astrocore": { "branch": "main", "commit": "44a3dc0bf1591022b2a6bc89dccdfac1be17bec9" },
|
"astrocore": { "branch": "main", "commit": "44a3dc0bf1591022b2a6bc89dccdfac1be17bec9" },
|
||||||
"astrolsp": { "branch": "main", "commit": "909fbe64f3f87d089ff3777751261544557117cc" },
|
"astrolsp": { "branch": "main", "commit": "909fbe64f3f87d089ff3777751261544557117cc" },
|
||||||
"astrotheme": { "branch": "main", "commit": "41b7d8430a55fd771e41bd763af4c3fd1c2fc0b5" },
|
"astrotheme": { "branch": "main", "commit": "41b7d8430a55fd771e41bd763af4c3fd1c2fc0b5" },
|
||||||
@@ -42,9 +42,9 @@
|
|||||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" },
|
"mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
|
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
|
||||||
"mini.bufremove": { "branch": "main", "commit": "285bdac9596ee7375db50c0f76ed04336dcd2685" },
|
"mini.bufremove": { "branch": "main", "commit": "285bdac9596ee7375db50c0f76ed04336dcd2685" },
|
||||||
"mini.icons": { "branch": "main", "commit": "94848dad1589a199f876539bd79befb0c5e3abf0" },
|
"mini.icons": { "branch": "main", "commit": "b8f6fa6f5a3fd0c56936252edcd691184e5aac0c" },
|
||||||
"mini.indentscope": { "branch": "main", "commit": "5fdc3edf7bb1b6365980c2c47dac2f19ec93c97b" },
|
"mini.indentscope": { "branch": "main", "commit": "f1567c6f46c250b22f4ad1b847a042464742b11d" },
|
||||||
"mini.move": { "branch": "main", "commit": "f471ecb98395781827ef1dffee61afe1af0ace29" },
|
"mini.move": { "branch": "main", "commit": "819e90c3e113a3c826c3003ec07073f1e0677ea0" },
|
||||||
"monokai-pro.nvim": { "branch": "master", "commit": "4f4133601296881bb2197800bd68d2bba9eaadb9" },
|
"monokai-pro.nvim": { "branch": "master", "commit": "4f4133601296881bb2197800bd68d2bba9eaadb9" },
|
||||||
"multiple-cursors.nvim": { "branch": "main", "commit": "1ac15d047a4b265cc2389957bcc56ee561b29e02" },
|
"multiple-cursors.nvim": { "branch": "main", "commit": "1ac15d047a4b265cc2389957bcc56ee561b29e02" },
|
||||||
"neo-tree.nvim": { "branch": "main", "commit": "cea666ef965884414b1b71f6b39a537f9238bdb2" },
|
"neo-tree.nvim": { "branch": "main", "commit": "cea666ef965884414b1b71f6b39a537f9238bdb2" },
|
||||||
@@ -63,16 +63,16 @@
|
|||||||
"nvim-lspconfig": { "branch": "master", "commit": "185b2af444b27d6541c02d662b5b68190e5cf0c4" },
|
"nvim-lspconfig": { "branch": "master", "commit": "185b2af444b27d6541c02d662b5b68190e5cf0c4" },
|
||||||
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
||||||
"nvim-notify": { "branch": "master", "commit": "a3020c2cf4dfc4c4f390c4a21e84e35e46cf5d17" },
|
"nvim-notify": { "branch": "master", "commit": "a3020c2cf4dfc4c4f390c4a21e84e35e46cf5d17" },
|
||||||
"nvim-spider": { "branch": "main", "commit": "d4bdc45eac425e77108f068bd0706ff3ac20be7f" },
|
"nvim-spider": { "branch": "main", "commit": "6da0307421bc4be6fe02815faabde51007c4ea1a" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "f8aaf5ce4e27cd20de917946b2ae5c968a2c2858" },
|
"nvim-treesitter": { "branch": "master", "commit": "f8aaf5ce4e27cd20de917946b2ae5c968a2c2858" },
|
||||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "9937e5e356e5b227ec56d83d0a9d0a0f6bc9cad4" },
|
"nvim-treesitter-textobjects": { "branch": "master", "commit": "9937e5e356e5b227ec56d83d0a9d0a0f6bc9cad4" },
|
||||||
"nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" },
|
"nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" },
|
||||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" },
|
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" },
|
||||||
"nvim-ufo": { "branch": "main", "commit": "a5390706f510d39951dd581f6d2a972741b3fa26" },
|
"nvim-ufo": { "branch": "main", "commit": "a5390706f510d39951dd581f6d2a972741b3fa26" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||||
"rainbow-delimiters.nvim": { "branch": "master", "commit": "55ad4fb76ab68460f700599b7449385f0c4e858e" },
|
"rainbow-delimiters.nvim": { "branch": "master", "commit": "97bf4b8ef9298644a29fcd9dd41a0210cf08cac7" },
|
||||||
"resession.nvim": { "branch": "master", "commit": "cc819b0489938d03e4f3532a583354f0287c015b" },
|
"resession.nvim": { "branch": "master", "commit": "cc819b0489938d03e4f3532a583354f0287c015b" },
|
||||||
"schemastore.nvim": { "branch": "main", "commit": "36fb914c0defa2274207e670182253508e5569d5" },
|
"schemastore.nvim": { "branch": "main", "commit": "67d6c391e9a372d2d8701b5b8c9ae89455561fbf" },
|
||||||
"smart-splits.nvim": { "branch": "master", "commit": "ddb23c1a1cf1507bda487cda7f6e4690965ef9f5" },
|
"smart-splits.nvim": { "branch": "master", "commit": "ddb23c1a1cf1507bda487cda7f6e4690965ef9f5" },
|
||||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
|
||||||
"telescope.nvim": { "branch": "master", "commit": "a17d611a0e111836a1db5295f04945df407c5135" },
|
"telescope.nvim": { "branch": "master", "commit": "a17d611a0e111836a1db5295f04945df407c5135" },
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ return function()
|
|||||||
mappings.n["<C-Right>"] = false
|
mappings.n["<C-Right>"] = false
|
||||||
mappings.n["<C-Up>"] = false
|
mappings.n["<C-Up>"] = false
|
||||||
mappings.n["<C-Down>"] = false
|
mappings.n["<C-Down>"] = false
|
||||||
mappings.n["K"] = false
|
|
||||||
|
|
||||||
-------------------------------------------
|
-------------------------------------------
|
||||||
----------- Utility functions -------------
|
----------- Utility functions -------------
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ return {
|
|||||||
jedi_language_server = {
|
jedi_language_server = {
|
||||||
init_options = {
|
init_options = {
|
||||||
completion = {
|
completion = {
|
||||||
disableSnippets = false,
|
disableSnippets = true,
|
||||||
},
|
},
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
enable = true,
|
enable = true,
|
||||||
@@ -40,6 +40,9 @@ return {
|
|||||||
"sklearn",
|
"sklearn",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
workspace = {
|
||||||
|
environmentPath = "/home/duckq1u/miniconda3/envs/OCR3/bin/python"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -97,8 +97,6 @@ return {
|
|||||||
-- Tab to select completion
|
-- Tab to select completion
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() and has_words_before() then
|
if cmp.visible() and has_words_before() then
|
||||||
|
|
||||||
vim.g.copilot_no_tab_map = true -- NOTE: disable copilot's tab mapping PART1
|
|
||||||
fallback()
|
fallback()
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
@@ -123,7 +121,6 @@ return {
|
|||||||
|
|
||||||
-- NOTE: disable tabl when using copilot PART2
|
-- NOTE: disable tabl when using copilot PART2
|
||||||
vim.api.nvim_set_keymap("i", "<C-f>", 'copilot#Accept("\\<CR>")', { expr = true, silent = true }),
|
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)
|
-- ["<C-f>"] = cmp.mapping(function(fallback)
|
||||||
-- -- Check if Copilot is suggesting something
|
-- -- Check if Copilot is suggesting something
|
||||||
-- if vim.fn["copilot#Accept"]() ~= "" then
|
-- if vim.fn["copilot#Accept"]() ~= "" then
|
||||||
|
|||||||
@@ -19,13 +19,11 @@ return {
|
|||||||
-- 'thumbs.db',
|
-- 'thumbs.db',
|
||||||
},
|
},
|
||||||
never_show = {},
|
never_show = {},
|
||||||
|
|
||||||
never_show_by_pattern = { -- uses glob style patterns
|
never_show_by_pattern = { -- uses glob style patterns
|
||||||
'*.zip',
|
"*.zip",
|
||||||
'*.rar',
|
"*.rar",
|
||||||
'*.pdf',
|
"*.pdf",
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
enable_git_status = false,
|
enable_git_status = false,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ return {
|
|||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
dependencies = { "MunifTanjim/nui.nvim" },
|
dependencies = { "MunifTanjim/nui.nvim" },
|
||||||
config = function()
|
config = function()
|
||||||
require("noice").setup {
|
require("noice").setup({
|
||||||
-- Configuration here, or leave empty to use defaults
|
-- Configuration here, or leave empty to use defaults
|
||||||
views = {},
|
views = {},
|
||||||
messages = {
|
messages = {
|
||||||
@@ -72,7 +72,7 @@ return {
|
|||||||
filter = { event = "msg_show", find = "^%d+ lines moved$" },
|
filter = { event = "msg_show", find = "^%d+ lines moved$" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
})
|
||||||
end,
|
end,
|
||||||
specs = {
|
specs = {
|
||||||
{
|
{
|
||||||
@@ -98,9 +98,9 @@ return {
|
|||||||
"heirline.nvim",
|
"heirline.nvim",
|
||||||
optional = true,
|
optional = true,
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
local noice_opts = require("astrocore").plugin_opts "noice.nvim"
|
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
|
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 }
|
opts.statusline[9] = require("astroui.status").component.lsp({ lsp_progress = false })
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
@@ -108,11 +108,15 @@ return {
|
|||||||
"folke/edgy.nvim",
|
"folke/edgy.nvim",
|
||||||
optional = true,
|
optional = true,
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
if not opts.bottom then opts.bottom = {} end
|
if not opts.bottom then
|
||||||
|
opts.bottom = {}
|
||||||
|
end
|
||||||
table.insert(opts.bottom, {
|
table.insert(opts.bottom, {
|
||||||
ft = "noice",
|
ft = "noice",
|
||||||
size = { height = 0.4 },
|
size = { height = 0.4 },
|
||||||
filter = function(_, win) return vim.api.nvim_win_get_config(win).relative == "" end,
|
filter = function(_, win)
|
||||||
|
return vim.api.nvim_win_get_config(win).relative == ""
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -9,14 +9,14 @@ return {
|
|||||||
},
|
},
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
-- config variable is the default configuration table for the setup function call
|
-- 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
|
-- 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/formatting
|
||||||
-- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
|
-- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
|
||||||
opts.sources = {
|
opts.sources = {
|
||||||
require('none-ls.formatting.ruff').with { extra_args = { '--extend-select', 'F' } },
|
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_format"), -- Set a formatter
|
||||||
}
|
}
|
||||||
return opts
|
return opts
|
||||||
end,
|
end,
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
local dap = require "dap"
|
local dap = require("dap")
|
||||||
local dapui = require "dapui"
|
local dapui = require("dapui")
|
||||||
|
|
||||||
-- Initialize dap-ui
|
-- Initialize dap-ui
|
||||||
dapui.setup(opts)
|
dapui.setup(opts)
|
||||||
@@ -65,7 +65,9 @@ return {
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Optionally, open dap-ui when session starts
|
-- 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,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user