Update; nvim config

This commit is contained in:
Martin Pander
2026-06-09 16:07:30 +02:00
parent 186752a734
commit 4343c4b7ee
8 changed files with 229 additions and 289 deletions

View File

@@ -6,7 +6,6 @@ require('mini.align').setup()
require('mini.bracketed').setup()
require('mini.splitjoin').setup()
require('mini.move').setup()
require('mini.move').setup()
require('flash').setup()
require('ts-comments').setup()
@@ -16,6 +15,40 @@ vim.g.tagbar_autofocus=1
vim.g.windowswap_map_keys=0
local c = require('vscode.colors').get_colors()
require('vscode').setup({
style = 'light',
-- Enable transparent background
transparent = true,
-- Enable italic comment
-- italic_comments = true,
-- Enable italic inlay type hints
-- italic_inlayhints = true,
-- Underline `@markup.link.*` variants
underline_links = true,
-- Disable nvim-tree background color
disable_nvimtree_bg = true,
-- Apply theme colors to terminal
terminal_colors = true,
-- Override colors (see ./lua/vscode/colors.lua)
color_overrides = {
vscLineNumber = '#AAAAAA',
},
-- Override highlight groups (see ./lua/vscode/theme.lua)
-- group_overrides = {
-- -- this supports the same val table as vim.api.nvim_set_hl
-- -- use colors from this colorscheme by requiring vscode.colors!
-- Cursor = { fg=c.vscDarkBlue, bg=c.vscLightGreen, bold=true },
-- }
group_overrides = {
NormalFloat = { fg = c.vscFront, bg = "NONE" },
FloatBorder = { fg = c.vscFront, bg = "NONE" },
HoverTarget = { bg = "NONE" },
}
})
vim.cmd.colorscheme "vscode"
local cmp = require('cmp')
local lspkind = require('lspkind')
local ls = require('luasnip')
@@ -80,7 +113,6 @@ cmp.setup({
sources = cmp.config.sources({
{ name = 'nvim_lsp', priority = 1000 },
{ name = 'buffer', priority = 800, keyword_length = 2 },
-- { name = 'copilot', priority = 700 },
{ name = 'path', priority = 600 },
{ name = 'cmp_yanky', priority = 500 },
{ name = 'git', priority = 400 },
@@ -90,7 +122,6 @@ cmp.setup({
formatting = {
format = lspkind.cmp_format({
-- mode = "symbol_text",
mode = "symbol",
menu = ({
buffer = "[buf]",
@@ -100,22 +131,11 @@ cmp.setup({
latex_symbols = "[tex]",
path = "[path]",
cmp_yanky = "[yank]",
-- copilot = "[copilot]",
}),
-- symbol_map = { Copilot = "" }
}),
},
})
-- -- Set configuration for specific filetype.
-- cmp.setup.filetype('gitcommit', {
-- sources = cmp.config.sources({
-- { name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
-- }, {
-- { name = 'buffer' },
-- })
-- })
cmp.setup.cmdline({ '/', '?' }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
@@ -149,6 +169,7 @@ for _, ls in ipairs(language_servers) do
})
end
end
require('ufo').setup()
require("yanky").setup({
@@ -177,27 +198,6 @@ require("telescope").setup {
require("telescope").load_extension("ui-select")
require("telescope").load_extension("yank_history")
-- require'nvim-treesitter.configs'.setup {
-- -- ensure_installed = { "lua", "vim", "help" },
-- ensure_installed = {},
-- sync_install = false,
-- auto_install = false,
--
--
-- highlight = {
-- enable = true,
--
-- disable = function(lang, buf)
-- local max_filesize = 100 * 1024 -- 100 KB
-- local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
-- if ok and stats and stats.size > max_filesize then
-- return true
-- end
-- end,
--
-- additional_vim_regex_highlighting = false,
-- },
-- }
require('lualine').setup({
options = {
@@ -240,16 +240,6 @@ require('lualine').setup({
extensions = {}
})
-- require("copilot").setup({
-- suggestion = { enabled = false },
-- panel = { enabled = false },
-- })
-- require("copilot_cmp").setup()
-- require("CopilotChat").setup {
-- model = 'claude-3.7-sonnet',
-- }
vim.g.bullets_enabled_file_types = {
'markdown',
'text',
@@ -273,6 +263,7 @@ require("nvim-tree").setup({
-- },
})
require('gitsigns').setup {
signs = {
add = { text = '' },
@@ -329,30 +320,46 @@ require("conform").setup({
rust = {"rustfmt", lsp_format = "fallback"},
go = {"gofmt", "goimports", lsp_format = "fallback"},
lua = { "stylua", lsp_format = "fallback"},
sh = {"shfmt"},
bash = {"shfmt"},
zsh = {"shfmt"},
},
format_on_save = {
timeout_ms = 500,
lsp_fallback = true,
},
})
require('lint').linters_by_ft = {
markdown = {'vale'},
}
require("trouble").setup()
require("todo-comments").setup()
require("dap-view").setup()
require("dap-view").setup({
winbar = {
-- sections = { "console", "scopes", "watches", "repl", "threads", "exceptions", "breakpoints" },
-- default_section = "console",
sections = { "scopes", "watches", "repl", "threads", "exceptions", "breakpoints" },
default_section = "scopes",
},
auto_toggle = "keep_terminal",
})
require("nvim-dap-virtual-text").setup()
local dap, dapui = require("dap"), require("dap-view")
dap.listeners.before.attach.dapui_config = function()
dapui.open()
end
dap.listeners.before.launch.dapui_config = function()
dapui.open()
end
dap.listeners.before.event_terminated.dapui_config = function()
dapui.close()
end
dap.listeners.before.event_exited.dapui_config = function()
dapui.close()
end
-- dap.listeners.before.attach.dapui_config = function()
-- dapui.open()
-- end
-- dap.listeners.before.launch.dapui_config = function()
-- dapui.open()
-- end
-- dap.listeners.before.event_terminated.dapui_config = function()
-- dapui.close()
-- end
-- dap.listeners.before.event_exited.dapui_config = function()
-- dapui.close()
-- end
dap.adapters.codelldb = {
type = 'server',
@@ -363,6 +370,34 @@ dap.adapters.codelldb = {
}
}
dap.adapters.cppdbg = {
type = "executable",
command = "gdb",
args = { "--interpreter=dap", -- Tells GDB to speak the DAP protocol
"--eval-command", "set print pretty on" }
}
dap.adapters.debugpy = function(cb, config)
if config.request == 'attach' then
local port = (config.connect or config).port
local host = (config.connect or config).host or '127.0.0.1'
cb({
type = 'server',
port = assert(port, '`connect.port` is required for a python `attach` configuration'),
host = host,
options = { source_filetype = 'python' },
})
else
-- local system_python = vim.fn.exepath('python3') or vim.fn.exepath('python')
cb({
type = 'executable',
command = 'python',
args = { '-m', 'debugpy.adapter' },
options = { source_filetype = 'python' },
})
end
end
-- dap.configurations.zig = {
-- {
-- name = "Launch Zig Program",