nvim: formatting and minor fixes

This commit is contained in:
TheGeneralist 2025-08-08 13:08:25 +02:00
parent b048858c40
commit 7282fcd409
Signed by: thegeneralist01
SSH key fingerprint: SHA256:pp9qddbCNmVNoSjevdvQvM5z0DHN7LTa8qBMbcMq/R4
5 changed files with 225 additions and 217 deletions

View file

@ -16,7 +16,11 @@ return {
-- C-k: Toggle signature help (if signature.enabled = true) -- C-k: Toggle signature help (if signature.enabled = true)
-- --
-- See :h blink-cmp-config-keymap for defining your own keymap -- See :h blink-cmp-config-keymap for defining your own keymap
keymap = { preset = "default" }, keymap = {
preset = "default",
["<Tab>"] = { "select_and_accept" },
["<S-Tab>"] = { "select_next", "fallback_to_mappings" },
},
appearance = { appearance = {
nerd_font_variant = "mono", nerd_font_variant = "mono",

View file

@ -62,6 +62,11 @@ return {
-- set <leader>cpd and <leader>cpe to disable/enable copilot -- set <leader>cpd and <leader>cpe to disable/enable copilot
vim.keymap.set("n", "<leader>cpe", "<cmd>Copilot enable<CR>") vim.keymap.set("n", "<leader>cpe", "<cmd>Copilot enable<CR>")
vim.keymap.set("n", "<leader>cpd", "<cmd>Copilot disable<CR>") vim.keymap.set("n", "<leader>cpd", "<cmd>Copilot disable<CR>")
vim.keymap.set("i", "<C-J>", 'copilot#Accept("\\<CR>")', {
expr = true,
replace_keycodes = false,
})
vim.g.copilot_no_tab_map = true
end, end,
}, },
-- { -- {

View file

@ -43,7 +43,6 @@ return {
"ts_ls", "ts_ls",
"cssls", "cssls",
"tailwindcss", "tailwindcss",
"pyright",
}, },
handlers = { handlers = {
function(server_name) -- default handler (optional) function(server_name) -- default handler (optional)

View file

@ -18,27 +18,26 @@ return {
ensure_installed = { ensure_installed = {
"stylua", "stylua",
"jq", "jq",
"mypy", "basedpyright",
"ruff",
"black", "black",
}, },
handlers = { handlers = {
["mypy"] = function(source_name, methods) -- ["mypy"] = function(source_name, methods)
local options = { -- local options = {
extra_args = function() -- extra_args = function()
local command = "which python" -- local command = "which python"
local handle = io.popen(command) -- local handle = io.popen(command)
local python_path = "" -- local python_path = ""
if handle then -- if handle then
python_path = handle:read("*a") -- python_path = handle:read("*a")
python_path = string.gsub(python_path, "\n", "") -- python_path = string.gsub(python_path, "\n", "")
handle:close() -- handle:close()
end -- end
return { "--python-executable", python_path } -- return { "--python-executable", python_path }
end, -- end,
} -- }
null_ls.register(null_ls.builtins.diagnostics.mypy.with(options)) -- null_ls.register(null_ls.builtins.diagnostics.mypy.with(options))
end, -- end,
--[[ ["ruff"] = function(source_name, methods) --[[ ["ruff"] = function(source_name, methods)
null_ls.register(null_ls.builtins.diagnostics.ruff) null_ls.register(null_ls.builtins.diagnostics.ruff)
--require('mason-null-ls').default_setup(source_name, methods) -- to maintain default behavior --require('mason-null-ls').default_setup(source_name, methods) -- to maintain default behavior

View file

@ -77,6 +77,7 @@ vim.keymap.set("v", "<", "<gv")
vim.keymap.set("v", ">", ">gv") vim.keymap.set("v", ">", ">gv")
-- Indent with tab -- Indent with tab
vim.keymap.set("i", "<Tab>", "<Tab>")
vim.keymap.set("v", "<Tab>", ">gv") vim.keymap.set("v", "<Tab>", ">gv")
vim.keymap.set("v", "<S-Tab>", "<gv") vim.keymap.set("v", "<S-Tab>", "<gv")