From f53c254f88bcb0bf85d89ee5f0ee154411f92832 Mon Sep 17 00:00:00 2001 From: Dominic DiTaranto Date: Sat, 7 Mar 2026 16:11:49 -0500 Subject: [PATCH] fix nvim --- .bashrc | 1 + .config/nvim/init.lua | 31 +++++ .config/nvim/lsp/basedpyright.lua | 41 ++++++ .config/nvim/lsp/clangd.lua | 11 ++ .config/nvim/lsp/pylsp.lua | 62 ++------- .config/nvim/lua/config/plugins/autopairs.lua | 10 ++ .config/nvim/lua/config/plugins/mason.lua | 1 + .../nvim/lua/config/plugins/treesitter.lua | 3 +- .config/nvim/nvim-pack-lock.json | 120 ++++++++++++++++++ 9 files changed, 229 insertions(+), 51 deletions(-) create mode 100644 .config/nvim/lsp/basedpyright.lua create mode 100644 .config/nvim/lsp/clangd.lua create mode 100644 .config/nvim/lua/config/plugins/autopairs.lua create mode 100644 .config/nvim/nvim-pack-lock.json diff --git a/.bashrc b/.bashrc index 7ce9c0a..c0fa35b 100644 --- a/.bashrc +++ b/.bashrc @@ -85,3 +85,4 @@ if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then fi export TERM="xterm-kitty" +export PICO_SDK_PATH=/usr/share/pico-sdk diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 7f7bc5b..8c74f39 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -9,6 +9,8 @@ vim.o.linebreak = true vim.o.ignorecase = true vim.o.smartcase = true +vim.o.smartindent = true +vim.o.indentexpr = "" vim.o.inccommand = 'split' vim.o.cursorline = true @@ -34,6 +36,7 @@ vim.diagnostic.config({ require("config.keymaps") require("config.autocmds") require("config.plugins.autosave") +require("config.plugins.autopairs") require("config.plugins.barbar") require("config.plugins.blink") require("config.plugins.dashboard") @@ -83,3 +86,31 @@ vim.lsp.config("lua_ls", { }, }, }) + + +vim.api.nvim_create_autocmd('FileType', { + pattern = { 'c', 'cpp', 'objc', 'objcpp', 'cuda', 'proto' }, + callback = function() + vim.lsp.start({ + name = 'clangd', + cmd = { + 'clangd', + '--background-index', + '--clang-tidy', + '--header-insertion=never', + -- Mandatory for Arch Linux to find ARM headers + '--query-driver=/usr/bin/arm-none-eabi*', + }, + root_dir = vim.fs.dirname(vim.fs.find({ 'compile_commands.json', '.git' }, { upward = true })[1]), + init_options = { + fallbackFlags = { + -- Arch-specific paths (verify 14.2.0 matches your 'ls' output) + '-isystem', '/usr/arm-none-eabi/include', + '-isystem', '/usr/arm-none-eabi/include/c++/14.2.0', + '-isystem', '/usr/arm-none-eabi/include/c++/14.2.0/arm-none-eabi', + '--target=arm-none-eabi', + }, + }, + }) + end, +}) diff --git a/.config/nvim/lsp/basedpyright.lua b/.config/nvim/lsp/basedpyright.lua new file mode 100644 index 0000000..5800040 --- /dev/null +++ b/.config/nvim/lsp/basedpyright.lua @@ -0,0 +1,41 @@ +return { + cmd = { "basedpyright-langserver", "--stdio" }, + filetypes = { "python" }, + root_markers = { + "pyproject.toml", + "setup.py", + "setup.cfg", + "requirements.txt", + "Pipfile", + "pyrightconfig.json", + ".git", + }, + on_attach = function(client, bufnr) + -- This specifically prevents BasedPyright from inserting a second bracket + client.server_capabilities.documentOnTypeFormattingProvider = false + end, + settings = { + basedpyright = { + analysis = { + diagnosticSeverityOverrides = { + reportAny = false, + reportOptionalOperand = "warning", + reportOptionalMemberAccess = false, + reportOptionalSubscript = false, + reportAttributeAccessIssue = false, + reportMissingTypeArgument = false, + reportMissingTypeStubs = false, + reportUnknownArgumentType = false, + reportUnknownMemberType = false, + reportUnknownParameterType = false, + reportUnknownVariableType = false, + reportUnusedCallResult = false, + }, + autoSearchPaths = true, + useLibraryCodeForTypes = true, + diagnosticMode = "openFilesOnly", + typeCheckingMode = "basic", + }, + }, + }, +} diff --git a/.config/nvim/lsp/clangd.lua b/.config/nvim/lsp/clangd.lua new file mode 100644 index 0000000..885ee55 --- /dev/null +++ b/.config/nvim/lsp/clangd.lua @@ -0,0 +1,11 @@ + +return { + cmd = { + "clangd", + "--background-index", + "--clang-tidy", + "--header-insertion=never", + -- Mandatory for Arch Linux ARM toolchain + "--query-driver=/usr/bin/arm-none-eabi-*" + } +} diff --git a/.config/nvim/lsp/pylsp.lua b/.config/nvim/lsp/pylsp.lua index 8baa505..6083a7d 100644 --- a/.config/nvim/lsp/pylsp.lua +++ b/.config/nvim/lsp/pylsp.lua @@ -1,51 +1,13 @@ -vim.lsp.config("pylsp", { - settings = { - pylsp = { - plugins = { - pycodestyle = { - ignore = { "W391", "E501" }, - maxLineLength = 100, - }, - }, - }, - }, -}) +return { + settings = { + pylsp = { + plugins = { + pycodestyle = { + ignore = { "W391", "E501" }, + maxLineLength = 100, + }, + }, + }, + }, +} -vim.lsp.config('basedpyright', { - cmd = { 'basedpyright-langserver', '--stdio' }, - filetypes = { 'python' }, - root_markers = { - 'pyproject.toml', - 'setup.py', - 'setup.cfg', - 'requirements.txt', - 'Pipfile', - 'pyrightconfig.json', - '.git', - }, - settings = { - basedpyright = { - analysis = { - - diagnosticSeverityOverrides = { - reportAny = false, - reportOptionalOperand = "warning", - reportOptionalMemberAccess = false, - reportOptionalSubscript = false, - reportAttributeAccessIssue = false, - reportMissingTypeArgument = false, - reportMissingTypeStubs = false, - reportUnknownArgumentType = false, - reportUnknownMemberType = false, - reportUnknownParameterType = false, - reportUnknownVariableType = false, - reportUnusedCallResult = false, - }, - autoSearchPaths = true, - useLibraryCodeForTypes = true, - diagnosticMode = 'openFilesOnly', - typeCheckingMode = 'basic', - }, - }, - }, -}) diff --git a/.config/nvim/lua/config/plugins/autopairs.lua b/.config/nvim/lua/config/plugins/autopairs.lua new file mode 100644 index 0000000..92b09ef --- /dev/null +++ b/.config/nvim/lua/config/plugins/autopairs.lua @@ -0,0 +1,10 @@ +vim.pack.add({ "https://github.com/windwp/nvim-autopairs" }) + +require("nvim-autopairs").setup({ + check_ts = true, -- Use treesitter to help with indentation + ts_config = { + python = { "string" }, -- Don't add pairs in python string nodes + }, + map_cr = true, + enable_check_bracket_line = true, +}) diff --git a/.config/nvim/lua/config/plugins/mason.lua b/.config/nvim/lua/config/plugins/mason.lua index 739b286..82f2225 100644 --- a/.config/nvim/lua/config/plugins/mason.lua +++ b/.config/nvim/lua/config/plugins/mason.lua @@ -20,5 +20,6 @@ require("mason-tool-installer").setup({ "ruff", "selene", "stylua", + "clangd", }, }) diff --git a/.config/nvim/lua/config/plugins/treesitter.lua b/.config/nvim/lua/config/plugins/treesitter.lua index 18520fc..f9b05e6 100644 --- a/.config/nvim/lua/config/plugins/treesitter.lua +++ b/.config/nvim/lua/config/plugins/treesitter.lua @@ -11,7 +11,8 @@ vim.pack.add({ }) require("nvim-treesitter.configs").setup({ - ensure_installed = {}, + ensure_installed = {"python"}, + indent = { enable = true }, modules = {}, sync_install = false, auto_install = true, diff --git a/.config/nvim/nvim-pack-lock.json b/.config/nvim/nvim-pack-lock.json new file mode 100644 index 0000000..a11fe6c --- /dev/null +++ b/.config/nvim/nvim-pack-lock.json @@ -0,0 +1,120 @@ +{ + "plugins": { + "asyncomplete-lsp.vim": { + "rev": "d5d91e1ad70edb00368c11d3e81008835ac14dd1", + "src": "https://github.com/prabirshrestha/asyncomplete-lsp.vim" + }, + "asyncomplete.vim": { + "rev": "17b654a87a834d4e835fb7467e562b4421ad9310", + "src": "https://github.com/prabirshrestha/asyncomplete.vim" + }, + "auto-save.nvim": { + "rev": "979b6c82f60cfa80f4cf437d77446d0ded0addf0", + "src": "https://github.com/Pocco81/auto-save.nvim" + }, + "barbar.nvim": { + "rev": "fb4369940a07dda35fa4d7f54cf4a36aa00440e6", + "src": "https://github.com/romgrk/barbar.nvim" + }, + "basedpyright": { + "rev": "513aa518c60e4fe8e9b3cb87c115dc75427013f4", + "src": "https://github.com/DetachHead/basedpyright" + }, + "blink.cmp": { + "rev": "b19413d214068f316c78978b08264ed1c41830ec", + "src": "https://github.com/saghen/blink.cmp" + }, + "conform.nvim": { + "rev": "1bf8b5b9caee51507aa51eaed3da5b0f2595c6b9", + "src": "https://github.com/stevearc/conform.nvim" + }, + "dashboard-nvim": { + "rev": "0775e567b6c0be96d01a61795f7b64c1758262f6", + "src": "https://github.com/nvimdev/dashboard-nvim" + }, + "everforest-nvim": { + "rev": "557bce922401e247a596583679bc181d4d688554", + "src": "https://github.com/neanias/everforest-nvim.git" + }, + "lualine.nvim": { + "rev": "3946f0122255bc377d14a59b27b609fb3ab25768", + "src": "https://github.com/nvim-lualine/lualine.nvim" + }, + "mason-lspconfig.nvim": { + "rev": "b1d9a914b02ba5660f1e272a03314b31d4576fe2", + "src": "https://github.com/mason-org/mason-lspconfig.nvim" + }, + "mason-tool-installer.nvim": { + "rev": "517ef5994ef9d6b738322664d5fdd948f0fdeb46", + "src": "https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim" + }, + "mason.nvim": { + "rev": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800", + "src": "https://github.com/mason-org/mason.nvim" + }, + "mini.nvim": { + "rev": "6e885e4c27743ae6bf5957ea78ce86c032835f09", + "src": "https://github.com/echasnovski/mini.nvim" + }, + "nvim-autopairs": { + "rev": "59bce2eef357189c3305e25bc6dd2d138c1683f5", + "src": "https://github.com/windwp/nvim-autopairs" + }, + "nvim-dap": { + "rev": "5860c7c501eb428d3137ee22c522828d20cca0b3", + "src": "https://github.com/mfussenegger/nvim-dap" + }, + "nvim-dap-python": { + "rev": "64652d1ae1db80870d9aac7132d76e37acd86a26", + "src": "https://github.com/mfussenegger/nvim-dap-python" + }, + "nvim-lspconfig": { + "rev": "abf6d190f2c06818489c0bd4b926e7e3a06c5e51", + "src": "https://github.com/neovim/nvim-lspconfig" + }, + "nvim-surround": { + "rev": "fcfa7e02323d57bfacc3a141f8a74498e1522064", + "src": "https://github.com/kylechui/nvim-surround" + }, + "nvim-tree.lua": { + "rev": "1eda2569394f866360e61f590f1796877388cb8a", + "src": "https://github.com/nvim-tree/nvim-tree.lua" + }, + "nvim-treesitter": { + "rev": "42fc28ba918343ebfd5565147a42a26580579482", + "src": "https://github.com/nvim-treesitter/nvim-treesitter" + }, + "nvim-treesitter-textobjects": { + "rev": "5ca4aaa6efdcc59be46b95a3e876300cfead05ef", + "src": "https://github.com/nvim-treesitter/nvim-treesitter-textobjects" + }, + "nvim-web-devicons": { + "rev": "8dcb311b0c92d460fac00eac706abd43d94d68af", + "src": "https://github.com/nvim-tree/nvim-web-devicons" + }, + "plenary.nvim": { + "rev": "b9fd5226c2f76c951fc8ed5923d85e4de065e509", + "src": "https://github.com/nvim-lua/plenary.nvim" + }, + "prettier.nvim": { + "rev": "ca6452de1accc68a1062e72f58679caa488b501a", + "src": "https://github.com/MunifTanjim/prettier.nvim" + }, + "render-markdown.nvim": { + "rev": "6e0e8902dac70fecbdd8ce557d142062a621ec38", + "src": "https://github.com/MeanderingProgrammer/render-markdown.nvim" + }, + "telescope.nvim": { + "rev": "83a3a713d6b2d2a408491a1b959e55a7fa8678e8", + "src": "https://github.com/nvim-telescope/telescope.nvim" + }, + "venv-selector.nvim": { + "rev": "58bae72c84b9f7f864c879ec1896e384296f9ffb", + "src": "https://github.com/linux-cultist/venv-selector.nvim" + }, + "vim-lsp-settings": { + "rev": "139d4adf61f0699cc97744d4e6dfb8a6317397f5", + "src": "https://github.com/mattn/vim-lsp-settings" + } + } +} \ No newline at end of file