From 81c6df2323899f599e364ce5f8b76ce495a1bf65 Mon Sep 17 00:00:00 2001 From: Maciej Lebiest Date: Thu, 23 Feb 2023 21:49:48 +0100 Subject: [PATCH] fix nvim-lint, other fixes --- lua/general.lua | 11 ++++++----- lua/lazy-load.lua | 5 ++--- lua/plugins/mason-lspconfig.lua | 6 +++--- lua/plugins/nvim-lint.lua | 14 +++++++------- lua/plugins/nvim-lspconfig.lua | 9 ++++----- lua/plugins/treesitter.lua | 2 +- 6 files changed, 23 insertions(+), 24 deletions(-) diff --git a/lua/general.lua b/lua/general.lua index b4a1775..92c3d2e 100644 --- a/lua/general.lua +++ b/lua/general.lua @@ -1,7 +1,6 @@ local function open_nvim_tree() - - -- open the tree - require("nvim-tree.api").tree.open() + -- open the tree + require("nvim-tree.api").tree.open() end -- Functional wrapper for mapping custom keybindings @@ -36,9 +35,11 @@ vim.opt.number = true vim.opt.clipboard = "unnamedplus" -- synchronize with system clipboard vim.opt.swapfile = false vim.opt.cursorline = true +vim.opt.tabstop = 4 -- number of columns occupied by a tab +vim.opt.softtabstop = 4 -- see multiple spaces as tabstops so does the right thing +vim.opt.expandtab = true -- converts tabs to white space +vim.opt.shiftwidth = 4 -- width for autoindents vim.cmd [[ highlight clear colorscheme dracula - TSEnable highlight ]] - diff --git a/lua/lazy-load.lua b/lua/lazy-load.lua index 17fed92..b113ebe 100644 --- a/lua/lazy-load.lua +++ b/lua/lazy-load.lua @@ -28,11 +28,10 @@ require("lazy").setup({ dependencies = { 'williamboman/mason.nvim' }, priority = 150 }, { 'neovim/nvim-lspconfig', - config = require('plugins.nvim-lspconfig').init, + init = require('plugins.nvim-lspconfig').init, priority = 100 }, { 'mfussenegger/nvim-lint', - conifg = require('plugins.nvim-lint').init }, - {}, + init = require('plugins.nvim-lint').init }, { 'folke/trouble.nvim', opts = require('plugins.trouble').config, keys = require("plugins.trouble").keys diff --git a/lua/plugins/mason-lspconfig.lua b/lua/plugins/mason-lspconfig.lua index c7244e5..931c99d 100644 --- a/lua/plugins/mason-lspconfig.lua +++ b/lua/plugins/mason-lspconfig.lua @@ -13,13 +13,13 @@ return { "tsserver", "cssls", "cssmodules_ls", - "diagnosticls", "jsonls", "lua_ls", "sqlls", "yamlls", "lemminx", - "marksman" + "marksman", + "html", }, -- Whether servers that are set up (via lspconfig) should be automatically installed if they're not already installed. -- This setting has no relation with the `ensure_installed` setting. @@ -28,6 +28,6 @@ return { -- - true: All servers set up via lspconfig are automatically installed. -- - { exclude: string[] }: All servers set up via lspconfig, except the ones provided in the list, are automatically installed. -- Example: automatic_installation = { exclude = { "rust_analyzer", "solargraph" } } - automatic_installation = false, + automatic_installation = true, } } diff --git a/lua/plugins/nvim-lint.lua b/lua/plugins/nvim-lint.lua index 3449a46..f611fec 100644 --- a/lua/plugins/nvim-lint.lua +++ b/lua/plugins/nvim-lint.lua @@ -2,13 +2,13 @@ return { init = function() require('lint').linters_by_ft = { --python = { - --'ruff' + --'ruff', --'flake8', --'pylint', --'pycodestyle', --'pydocstyle' --}, - php = { 'phpcs' }, + php = { 'phpcs', }, markdown = { 'markdownlint' } } @@ -26,11 +26,11 @@ return { --'--disable=C0114', -- disable missing module docstring info --} - --vim.api.nvim_create_autocmd({ "BufWritePost" }, { - --callback = function() - --require("lint").try_lint() - --end, - --}) + vim.api.nvim_create_autocmd({ "BufWritePost" }, { + callback = function() + require("lint").try_lint() + end, + }) vim.api.nvim_create_autocmd({ "BufEnter" }, { callback = function() diff --git a/lua/plugins/nvim-lspconfig.lua b/lua/plugins/nvim-lspconfig.lua index a1adc79..f9084c7 100644 --- a/lua/plugins/nvim-lspconfig.lua +++ b/lua/plugins/nvim-lspconfig.lua @@ -151,11 +151,6 @@ return { capabilities = capabilities, } - require 'lspconfig'.diagnosticls.setup { - on_attach = on_attach, - capabilities = capabilities, - } - require 'lspconfig'.jsonls.setup { on_attach = on_attach, capabilities = capabilities, @@ -193,5 +188,9 @@ return { on_attach = on_attach, capabilities = capabilities, } + require 'lspconfig'.html.setup { + on_attach = on_attach, + capabilities = capabilities, + } end } diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 8ea4ac1..023e20e 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -38,7 +38,7 @@ return function() -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). -- Using this option may slow down your editor, and you may see some duplicate highlights. -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = false, -- default=false + additional_vim_regex_highlighting = true, -- default=false }, } end