diff --git a/flake.lock b/flake.lock index c9762ef..a5ced47 100644 --- a/flake.lock +++ b/flake.lock @@ -59,11 +59,11 @@ ] }, "locked": { - "lastModified": 1778905220, - "narHash": "sha256-ox/5IHc8uwy6UTw6N7Shp6uCHIgu/S2PsWeuXsOHSo8=", + "lastModified": 1779506708, + "narHash": "sha256-QOD/CNm196nCJRheux/URi4/HE66fthdOMqCJoPP1Y0=", "owner": "nix-community", "repo": "home-manager", - "rev": "d1686dc7d36cbd1234cb226ad6ef97e882716acb", + "rev": "3ee51fbdac8c8bdfe1e7e1fcaba6520a563f394f", "type": "github" }, "original": { @@ -80,11 +80,11 @@ ] }, "locked": { - "lastModified": 1778905220, - "narHash": "sha256-ox/5IHc8uwy6UTw6N7Shp6uCHIgu/S2PsWeuXsOHSo8=", + "lastModified": 1779506708, + "narHash": "sha256-QOD/CNm196nCJRheux/URi4/HE66fthdOMqCJoPP1Y0=", "owner": "nix-community", "repo": "home-manager", - "rev": "d1686dc7d36cbd1234cb226ad6ef97e882716acb", + "rev": "3ee51fbdac8c8bdfe1e7e1fcaba6520a563f394f", "type": "github" }, "original": { @@ -101,11 +101,11 @@ ] }, "locked": { - "lastModified": 1779036909, - "narHash": "sha256-zXcwYQGCT6pzinK+1dBB2ekTVtfxGZAapb3Evdcu4fY=", + "lastModified": 1780795403, + "narHash": "sha256-AkWx4Zt9pQbD/f82Z8N57+d0HGLN/rV3gdMKJTpBPKs=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "56c666e108467d87d13508936aade6d567f2a501", + "rev": "6a771120d607dcccb279a27d227650e324815c35", "type": "github" }, "original": { @@ -143,11 +143,11 @@ ] }, "locked": { - "lastModified": 1773876229, - "narHash": "sha256-ncup+eYqHABZzBgwfQzxOXWHIcjN4kkZl9QTb4cgNm8=", + "lastModified": 1780448639, + "narHash": "sha256-1s29/xP6iXwaEkTBxwbIQDnQzrLShlBcbnbTu0qJA0c=", "owner": "nix-community", "repo": "nixos-wsl", - "rev": "381bc12a25d49c6b798f98ab33a8d951ec54659b", + "rev": "364422fc0bad4fd3be804c00cadcbd6fa3f305d8", "type": "github" }, "original": { @@ -159,11 +159,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1778869304, - "narHash": "sha256-30sZNZoA1cqF5JNO9fVX+wgiQYjB7HJqqJ4ztCDeBZE=", + "lastModified": 1780749050, + "narHash": "sha256-3av0pIjlOWQ6rDbNOmpUSvbNnJkGORQKKjb4LtCZsIY=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d233902339c02a9c334e7e593de68855ad26c4cb", + "rev": "a799d3e3886da994fa307f817a6bc705ae538eeb", "type": "github" }, "original": { @@ -206,11 +206,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1778737229, - "narHash": "sha256-6xWoytx8jFW4PF1GjRm/i/53trbpKGfz6zjzQGBr4cI=", + "lastModified": 1780511130, + "narHash": "sha256-2v9lT4ya59Lh1FqPeLnz1MoX9y/wz2huqfe9RtQZITk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d7a713c0b7e47c908258e71cba7a2d77cc8d71d5", + "rev": "535f3e6942cb1cead3929c604320d3db54b542b9", "type": "github" }, "original": { @@ -222,11 +222,11 @@ }, "nixpkgs-wsl-stable": { "locked": { - "lastModified": 1778737229, - "narHash": "sha256-6xWoytx8jFW4PF1GjRm/i/53trbpKGfz6zjzQGBr4cI=", + "lastModified": 1780511130, + "narHash": "sha256-2v9lT4ya59Lh1FqPeLnz1MoX9y/wz2huqfe9RtQZITk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d7a713c0b7e47c908258e71cba7a2d77cc8d71d5", + "rev": "535f3e6942cb1cead3929c604320d3db54b542b9", "type": "github" }, "original": { @@ -274,11 +274,11 @@ ] }, "locked": { - "lastModified": 1777944972, - "narHash": "sha256-VfGRo1qTBKOe3s2gOv8LSoA6Fk19PvBlwQ1ECN0Evn8=", + "lastModified": 1780547341, + "narHash": "sha256-Gq8KNx5A7hBB3uGJaj6eQfLDIz5YdLu92gqBcvHvoUo=", "owner": "Mic92", "repo": "sops-nix", - "rev": "c591bf665727040c6cc5cb409079acb22dcce33c", + "rev": "9ed65852b6257fbeae4355bc24ecfea307ca759a", "type": "github" }, "original": { diff --git a/hosts/work/common.nix b/hosts/work/common.nix index a79dff4..3e8ffcd 100644 --- a/hosts/work/common.nix +++ b/hosts/work/common.nix @@ -17,7 +17,6 @@ dot.llm = { enable = true; - claude-code.enable = false; opencode.enable = true; opencode.enableConfig = true; opencode.workMode = true; diff --git a/modules/home/nvim.nix b/modules/home/nvim.nix index aa8afd8..621c44e 100644 --- a/modules/home/nvim.nix +++ b/modules/home/nvim.nix @@ -16,7 +16,7 @@ in vimAlias = true; plugins = with pkgs.vimPlugins; [ - catppuccin-nvim + vscode-nvim vim-repeat vim-surround ts-comments-nvim @@ -61,7 +61,6 @@ in bullets-vim nvim-dap nvim-nio - # nvim-dap-ui nvim-dap-view nvim-dap-virtual-text nvim-dap-go diff --git a/modules/nvim/lua/base.lua b/modules/nvim/lua/base.lua index 8c6df21..b59df6d 100644 --- a/modules/nvim/lua/base.lua +++ b/modules/nvim/lua/base.lua @@ -102,7 +102,6 @@ vim.opt.clipboard = 'unnamedplus' ---------------------------- vim.cmd('filetype plugin indent on') -vim.cmd.colorscheme "catppuccin-latte" ---------------------------- @@ -191,6 +190,7 @@ vim.diagnostic.config({ }, }, virtual_lines = false, + -- float = false, float = { prefix = '', scope = 'line', @@ -206,3 +206,11 @@ vim.cmd([[highlight DiagnosticUnderlineWarn gui=undercurl guifg=Yellow]]) vim.cmd([[highlight DiagnosticUnderlineInfo gui=undercurl guifg=Blue]]) vim.cmd([[highlight DiagnosticUnderlineHint gui=undercurl guifg=Cyan]]) + +local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview + +function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...) + opts = opts or {} + opts.border = opts.border or "rounded" + return orig_util_open_floating_preview(contents, syntax, opts, ...) +end diff --git a/modules/nvim/lua/filetype.lua b/modules/nvim/lua/filetype.lua index cbb35f4..9c25ac6 100644 --- a/modules/nvim/lua/filetype.lua +++ b/modules/nvim/lua/filetype.lua @@ -1,13 +1,12 @@ local capabilities = require('cmp_nvim_lsp').default_capabilities() - vim.lsp.config('gopls', { cmd = { 'gopls' }, filetypes = { 'go', 'gomod', 'gowork', 'gotmpl' }, root_markers = { 'go.work', 'go.mod', '.git' }, settings = { gopls = { - semanticTokens = true, -- Still the most important for color! + semanticTokens = true, hints = { assignVariableTypes = true, compositeLiteralFields = true, @@ -20,56 +19,65 @@ vim.lsp.config('gopls', { }, }, }) -vim.lsp.enable('gopls') --- local lspconfig = require('lspconfig') --- lspconfig.gopls.setup({ --- -- These settings solve your "lacking highlighting" issue --- settings = { --- gopls = { --- semanticTokens = true, --- hints = { --- assignVariableTypes = true, --- compositeLiteralFields = true, --- parameterNames = true, --- }, --- analyses = { --- unusedparams = true, --- }, --- staticcheck = true, --- }, --- }, --- -- If you want to keep your DAP or other logic tied to the start: --- on_attach = function(client, bufnr) --- -- This runs only when gopls attaches to a buffer --- require('dap-go').setup() --- end, --- }) +vim.lsp.config('clangd', { + cmd = { 'clangd', + '--compile-commands-dir=build', + '--background-index', + '--clang-tidy', + }, +}) + +vim.lsp.config('basedpyright', { + settings = { + basedpyright = { + analysis = { + indexing = true, + typeCheckingMode = "standard", + autoImportCompletions = true + } + } + } +}) + +vim.lsp.config('buf_ls', { + cmd = { 'buf', 'lsp', 'serve' }, + filetypes = { 'proto' }, + root_markers = { 'buf.yaml', '.git' }, +}) + +vim.lsp.enable('gopls') +vim.lsp.enable('clangd') +vim.lsp.enable('basedpyright') +-- vim.lsp.enable('ty') +vim.lsp.enable('buf_ls') +vim.lsp.enable('marksman') +vim.lsp.enable('sqls') +vim.lsp.enable('dockerls') +vim.lsp.enable('docker_compose_language_service') +vim.lsp.enable('rust_analyzer') +vim.lsp.enable('zls') +vim.lsp.enable('yamlls') +vim.lsp.enable('omnisharp') +vim.lsp.enable('bashls') vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }) vim.api.nvim_create_autocmd('FileType', { group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }), pattern = 'python', - once = true, callback = function() - vim.lsp.enable('ty') - require('dap-python').setup() + local status, dappython = pcall(require, "dap-python") + if status then + dappython.setup() + end end, }) vim.api.nvim_create_autocmd('FileType', { group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }), pattern = { 'go', 'gomod', 'gowork', 'gotmpl' }, - -- pattern = 'go', - -- once = true, callback = function(args) - -- vim.lsp.enable('gopls') - -- vim.lsp.start('gopls', { - -- bufnr = args.buf, - -- }) - - -- Setup your DAP here if needed local status, dapgo = pcall(require, "dap-go") if status then dapgo.setup() @@ -77,194 +85,82 @@ vim.api.nvim_create_autocmd('FileType', { end, }) -vim.api.nvim_create_autocmd('FileType', { - group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }), - pattern = 'proto', - once = true, - callback = function() - vim.lsp.config('buf_ls', { - cmd = { 'buf', 'lsp', 'serve' }, - filetypes = { 'proto' }, - root_markers = { 'buf.yaml', '.git' }, - }) - - vim.lsp.enable('buf_ls') - end, -}) - -vim.api.nvim_create_autocmd('FileType', { - group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }), - pattern = 'markdown', - once = true, - callback = function() - vim.lsp.enable('marksman') - end, -}) - -vim.api.nvim_create_autocmd('FileType', { - group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }), - pattern = 'sql', - once = true, - callback = function() - vim.lsp.enable('sqls') - end, -}) - -vim.api.nvim_create_autocmd('FileType', { - group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }), - pattern = { 'dockerfile', 'yaml.docker-compose' }, - once = true, - callback = function() - vim.lsp.enable('dockerls') - vim.lsp.enable('docker_compose_language_service') - end, -}) - -vim.api.nvim_create_autocmd('FileType', { - group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }), - pattern = 'rust', - once = true, - callback = function() - vim.lsp.enable('rust_analyzer') - end, -}) - -vim.api.nvim_create_autocmd('FileType', { - group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }), - pattern = { 'c', 'cpp' }, - once = true, - callback = function() - vim.lsp.enable('clangd') - end, -}) - -vim.api.nvim_create_autocmd('FileType', { - group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }), - pattern = { 'zig' }, - pattern = 'sql', - once = true, - callback = function() - vim.lsp.enable('zls') - end, -}) - -vim.api.nvim_create_autocmd('FileType', { - group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }), - pattern = { 'yaml' }, - pattern = 'sql', - once = true, - callback = function() - vim.lsp.enable('yamlls') - end, -}) - -vim.api.nvim_create_autocmd('FileType', { - group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }), - pattern = { 'cs' }, - pattern = 'sql', - once = true, - callback = function() - vim.lsp.enable('omnisharp') - end, -}) - - - - -require("conform").setup({ - go = {"gofmt"}, - python = {"ruff"}, - rust = {"rustfmt"}, - - format_on_save = { - timeout_ms = 500, - lsp_fallback = true, - }, -}) --- end, --- }) - -- vim.api.nvim_create_autocmd('FileType', { --- group = 'FileTypeConfigs', --- pattern = 'rust', +-- group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }), +-- pattern = 'proto', +-- once = true, -- callback = function() --- require('dap-python').setup() --- --- lspconfig.rust_analyzer.setup({ --- capabilities = capabilities, --- settings = { --- ["rust-analyzer"] = { --- checkOnSave = { --- command = "clippy", --- }, --- }, --- }, --- }) --- --- require("conform").setup({ --- rust = {"rustfmt"}, --- }) -- end, -- }) - +-- -- vim.api.nvim_create_autocmd('FileType', { --- group = 'FileTypeConfigs', +-- group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }), -- pattern = 'markdown', +-- once = true, -- callback = function() --- lspconfig.marksman.setup({ capabilities = capabilities }) -- end, -- }) -- -- vim.api.nvim_create_autocmd('FileType', { --- group = 'FileTypeConfigs', --- pattern = 'dockerfile', +-- group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }), +-- pattern = 'sql', +-- once = true, -- callback = function() --- lspconfig.dockerls.setup({ capabilities = capabilities }) --- lspconfig.docker_compose_language_service.setup({ capabilities = capabilities }) --- end, --- }) --- --- vim.api.nvim_create_autocmd('FileType', { --- group = 'FileTypeConfigs', --- pattern = 'cs', --- callback = function() --- lspconfig.omnisharp.setup({ capabilities = capabilities }) --- end, --- }) --- --- vim.api.nvim_create_autocmd('FileType', { --- group = 'FileTypeConfigs', --- pattern = 'yaml', --- callback = function() --- lspconfig.yamlls.setup({ capabilities = capabilities }) --- lspconfig.docker_compose_language_service.setup({ capabilities = capabilities }) -- end, -- }) -- vim.api.nvim_create_autocmd('FileType', { --- group = 'FileTypeConfigs', --- pattern = {'c', 'cpp', 'objc', 'objcpp'}, +-- group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }), +-- pattern = { 'dockerfile', 'yaml.docker-compose' }, +-- once = true, -- callback = function() --- lspconfig.clangd.setup({ capabilities = capabilities }) -- end, -- }) -- -- vim.api.nvim_create_autocmd('FileType', { --- group = 'FileTypeConfigs', +-- group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }), +-- pattern = 'rust', +-- once = true, +-- callback = function() +-- end, +-- }) +-- +-- vim.lsp.enable('clangd') +-- vim.api.nvim_create_autocmd('FileType', { +-- group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }), +-- pattern = { 'c', 'cpp' }, +-- once = true, +-- callback = function() +-- end, +-- }) +-- +-- vim.api.nvim_create_autocmd('FileType', { +-- group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }), +-- pattern = { 'zig' }, -- pattern = 'sql', +-- once = true, +-- callback = function() +-- end, +-- }) + +-- vim.api.nvim_create_autocmd('FileType', { +-- group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }), +-- pattern = { 'yaml' }, +-- pattern = 'sql', +-- once = true, -- callback = function() --- lspconfig.sqls.setup({ capabilities = capabilities }) -- end, -- }) -- -- vim.api.nvim_create_autocmd('FileType', { --- group = 'FileTypeConfigs', --- pattern = 'zig', +-- group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }), +-- pattern = { 'cs' }, +-- pattern = 'sql', +-- once = true, -- callback = function() --- lspconfig.zls.setup({ capabilities = capabilities }) -- end, -- }) --- + local get_datetime = function() return os.date("%Y-%m-%d %H:%M") end diff --git a/modules/nvim/lua/keymaps.lua b/modules/nvim/lua/keymaps.lua index 4498b74..fc91c04 100644 --- a/modules/nvim/lua/keymaps.lua +++ b/modules/nvim/lua/keymaps.lua @@ -45,11 +45,11 @@ local function tmux_navigate(direction) end end -vim.api.nvim_create_autocmd("CursorHold", { - callback = function() - vim.diagnostic.open_float(nil, { focusable = false }) - end, -}) +-- vim.api.nvim_create_autocmd("CursorHold", { +-- callback = function() +-- vim.diagnostic.open_float(nil, { focusable = false }) +-- end, +-- }) vim.keymap.set('n', '', function() tmux_navigate('h') end) vim.keymap.set('n', '', function() tmux_navigate('j') end) @@ -77,6 +77,7 @@ vim.keymap.set('n', 'cr', vim.lsp.buf.rename, { desc = 'LSP Rename' }) vim.keymap.set('n', 'ct', vim.lsp.buf.type_definition, { desc = 'LSP Type Definition' }) vim.keymap.set('n', 'cF', require("conform").format, { desc = 'LSP Format' }) vim.keymap.set('n', 'cgi', vim.lsp.buf.implementation, { desc = 'LSP Implementation' }) +vim.keymap.set('n', 'cgr', telebuiltin.lsp_references, { desc = 'LSP References' }) vim.keymap.set('n', 'cgd', vim.lsp.buf.definition, { desc = 'LSP Definition' }) vim.keymap.set('n', 'cgD', vim.lsp.buf.declaration, { desc = 'LSP Declaration' }) vim.keymap.set('n', 'cwa', vim.lsp.buf.add_workspace_folder, { desc = 'LSP Add Workspace Folder' }) @@ -87,6 +88,7 @@ vim.keymap.set('n', 'ch', vim.lsp.buf.hover, { desc = 'LSP Hover' }) vim.keymap.set('n', 'cH', vim.lsp.buf.signature_help, { desc = 'LSP Signature Help' }) vim.keymap.set({ 'n', 'v' }, 'ca', vim.lsp.buf.code_action, { desc = 'LSP Code Action' }) vim.keymap.set('n', 'cde', ToggleDiagnostics, { desc = 'Toggle Diagnostics' }) +vim.keymap.set('n', 'cdh', vim.diagnostic.open_float, { desc = 'Toggle Diagnostics float' }) vim.keymap.set('n', 'cf', function() local word = vim.fn.expand("") diff --git a/modules/nvim/lua/plugins.lua b/modules/nvim/lua/plugins.lua index 4e7be6c..2614c57 100644 --- a/modules/nvim/lua/plugins.lua +++ b/modules/nvim/lua/plugins.lua @@ -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", diff --git a/secrets/secrets.yaml b/secrets/secrets.yaml index f73a01d..efe26bc 100644 --- a/secrets/secrets.yaml +++ b/secrets/secrets.yaml @@ -1,4 +1,5 @@ langdock_api_key: ENC[AES256_GCM,data:9CTt73dQowcjIdjQoPMjsmGeIgV0nyHZxePOwak/m09ePfu4Gb3gDC17wq9Hde5J9IqpEID73Kdo/DsGm9m765rPGQFxGwTo3MO5eZgXAQjFXQNNhYm+sug=,iv:TVuiMG/7HYjncK3oC8r5xYrnNGXFcrBrpq9OO+7plNY=,tag:EZqUOGYwTHcukDop8p/JBw==,type:str] +openrouter_api_key: ENC[AES256_GCM,data:TqzRCeWH6Ibn/0dAf3YVnXUnBS766S+fZOHG5S49wYtoLcfhmHXFMHeDBZAWFdkU2E7X4Hhyv5l+hDlH+bJH0NQNL3rHvqVlbA==,iv:VF8RfLls3vYcOPqKPPax60kh7ILM/Y5mABf/UAzTBgo=,tag:lRY8skfDT3F9u5a+I0JJ6Q==,type:str] sops: age: - recipient: age1hmgy68ukugduef75ev72jnpu77ff3lajadpf7u0zv3ex4nt7f5qs5nxx2l @@ -28,7 +29,7 @@ sops: YjBrekY4Y2JSczBEQ3BObjhKZkhYc3MKMrGlO/w7Hvp23rpL71/XDsJDcbc3t73C iXdD2Oc9V5g5Jz3H7mkaAlNRg8u+LwGXYdwZiG7NWSyQnARPgeMBwQ== -----END AGE ENCRYPTED FILE----- - lastmodified: "2026-02-10T21:55:05Z" - mac: ENC[AES256_GCM,data:Qmwba0kQ8uzz72UbkVx+41i+iFtjI07nRLkYI9+G3TNCDVcWSFdPXCjWxdozU1jTOYyt9EZpP5x+5DLRCbNIlsKpClMvVGwAbu8XKvqQoF5Ao4PXOFNg6hyWTPjoVDLHkEaykpgpg1fr29CHUDkyyFGniQ+Slv5LAndAx+ncTAA=,iv:ehZZi7DUlYlGcBMgV25h+cew/amgbH2tKFMr7jaNw/U=,tag:ag2vcgc29Dlx+QI8qju/LQ==,type:str] + lastmodified: "2026-06-09T14:03:10Z" + mac: ENC[AES256_GCM,data:H87P4qqRKayz/x9MKK0a8IqL48UFFMVJHQ1tiuGAcUjDDQVmU3BJof6jM38Sixbe+wiCrNuIdYwFoSIvJKwUZ+Yk6vQqwmxPqfTwEiPArmXdAkbggRlncuyJF0aQ/Jkr0ntrH+Bbc+QSwRYdRmGVZP62gZae1DaOi3chvMLSrCg=,iv:kw67WeIAhsBlJaJhPc77xgX9yadMzu9022olqe4JtNA=,tag:1C523XJecI1DkywQlZHFgg==,type:str] unencrypted_suffix: _unencrypted - version: 3.11.0 + version: 3.12.1