1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

Compare commits

..

No commits in common. "fc8175d32d0261393b184001b04109c8257609d1" and "bb27d93433339727016880b3275992217afcfdaa" have entirely different histories.

2 changed files with 4 additions and 28 deletions

View File

@ -6,18 +6,6 @@ local diagnostic = vim.diagnostic
local utils = require("utils") local utils = require("utils")
-- set quickfix list from diagnostics in a certain buffer, not the whole workspace
local set_qflist = function(buf_num, severity)
local diagnostics = nil
diagnostics = diagnostic.get(buf_num, { severity = severity })
local qf_items = diagnostic.toqflist(diagnostics)
vim.fn.setqflist({}, ' ', { title = 'Diagnostics', items = qf_items })
-- open quickfix by default
vim.cmd[[copen]]
end
local custom_attach = function(client, bufnr) local custom_attach = function(client, bufnr)
-- Mappings. -- Mappings.
local map = function(mode, l, r, opts) local map = function(mode, l, r, opts)
@ -35,10 +23,7 @@ local custom_attach = function(client, bufnr)
map("n", "gr", vim.lsp.buf.references, { desc = "show references" }) map("n", "gr", vim.lsp.buf.references, { desc = "show references" })
map("n", "[d", diagnostic.goto_prev, { desc = "previous diagnostic" }) map("n", "[d", diagnostic.goto_prev, { desc = "previous diagnostic" })
map("n", "]d", diagnostic.goto_next, { desc = "next diagnostic" }) map("n", "]d", diagnostic.goto_next, { desc = "next diagnostic" })
-- this puts diagnostics from opened files to quickfix map("n", "<space>q", diagnostic.setqflist, { desc = "put diagnostic to qf" })
map("n", "<space>qw", diagnostic.setqflist, { desc = "put window diagnostics to qf" })
-- this puts diagnostics from current buffer to quickfix
map("n", "<space>qb", function() set_qflist(bufnr) end, { desc = "put buffer diagnostics to qf" })
map("n", "<space>ca", vim.lsp.buf.code_action, { desc = "LSP code action" }) map("n", "<space>ca", vim.lsp.buf.code_action, { desc = "LSP code action" })
map("n", "<space>wa", vim.lsp.buf.add_workspace_folder, { desc = "add workspace folder" }) map("n", "<space>wa", vim.lsp.buf.add_workspace_folder, { desc = "add workspace folder" })
map("n", "<space>wr", vim.lsp.buf.remove_workspace_folder, { desc = "remove workspace folder" }) map("n", "<space>wr", vim.lsp.buf.remove_workspace_folder, { desc = "remove workspace folder" })
@ -119,21 +104,12 @@ if utils.executable("pylsp") then
settings = { settings = {
pylsp = { pylsp = {
plugins = { plugins = {
-- formatter options
black = { enabled = true },
autopep8 = { enabled = false },
yapf = { enabled = false },
-- linter options
pylint = { enabled = true, executable = "pylint" }, pylint = { enabled = true, executable = "pylint" },
ruff = { enabled = false },
pyflakes = { enabled = false }, pyflakes = { enabled = false },
pycodestyle = { enabled = false }, pycodestyle = { enabled = false },
-- type checker
pylsp_mypy = { enabled = true, report_progress = true, live_mode = false },
-- auto-completion options
jedi_completion = { fuzzy = true }, jedi_completion = { fuzzy = true },
-- import sorting pyls_isort = { enabled = true },
isort = { enabled = true }, pylsp_mypy = { enabled = true },
}, },
}, },
}, },

View File

@ -1,5 +1,5 @@
require("nvim-treesitter.configs").setup { require("nvim-treesitter.configs").setup {
ensure_installed = { "python", "cpp", "lua", "vim", "json", "toml" }, ensure_installed = { "python", "cpp", "lua", "vim", "json" },
ignore_install = {}, -- List of parsers to ignore installing ignore_install = {}, -- List of parsers to ignore installing
highlight = { highlight = {
enable = true, -- false will disable the whole extension enable = true, -- false will disable the whole extension