diff --git a/.config/nvim/README.md b/.config/nvim/README.md index e992141..f965c61 100644 --- a/.config/nvim/README.md +++ b/.config/nvim/README.md @@ -8,7 +8,7 @@ I'll put commands and things here so I don't forget ## netrw -This is the vim file explorer. `\ee` enters it. +I didn't use this at all before. It's just the vim file explorer. `\e` enters it. From within, `%` creates a new file, or `d` creates a new directory diff --git a/.config/nvim/after/plugin/lsp.lua b/.config/nvim/after/plugin/lsp.lua index 4bc4974..a926f81 100644 --- a/.config/nvim/after/plugin/lsp.lua +++ b/.config/nvim/after/plugin/lsp.lua @@ -66,3 +66,46 @@ require "lspconfig".pyright.setup { } } } + + +-- disable pyright complaints about '*args" and '**kwargs' not being accessed in a function +-- https://github.com/MaskRay/ccls/issues/869#issuecomment-1793044831 + +function filter_diagnostics_pyright(diagnostic) + -- Allow kwargs to be unused, sometimes you want many functions to take the + -- same arguments but you don't use all the arguments in all the functions, + -- so kwargs is used to suck up all the extras + if diagnostic.message == '"args" is not accessed' or + diagnostic.message == '"kwargs" is not accessed' then + return false + end + +-- -- Allow variables starting with an underscore +-- if string.match(diagnostic.message, '"_.+" is not accessed') then +-- return false +-- end + + return true +end + +function filter_diagnostics(diagnostic) + if diagnostic.source == "Pyright" then + return filter_diagnostics_pyright(diagnostic) + end + + return true +end + +function custom_on_publish_diagnostics(a, params, client_id, c, config) + params.diagnostics = vim.tbl_filter(filter_diagnostics, params.diagnostics) + vim.lsp.diagnostic.on_publish_diagnostics(a, params, client_id, c, config) +end + +vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( + custom_on_publish_diagnostics, {}) + + + + + + diff --git a/.config/nvim/lua/erik/remap.lua b/.config/nvim/lua/erik/remap.lua index 906ddb2..cb4bb9e 100644 --- a/.config/nvim/lua/erik/remap.lua +++ b/.config/nvim/lua/erik/remap.lua @@ -1,5 +1,6 @@ vim.g.mapleader = "\\" -vim.keymap.set("n", "ee", vim.cmd.Ex) +--vim.keymap.set("n", "ee", vim.cmd.Ex) +vim.keymap.set("n", "e", vim.cmd.Ex) -- other stuff from https://github.com/ThePrimeagen/init.lua/blob/master/lua/theprimeagen/remap.lua vim.keymap.set("n", "x", "!chmod +x %", { silent = true }) -- x to make executable