fix nvim-lint, other fixes

This commit is contained in:
Maciej Lebiest 2023-02-23 21:49:48 +01:00
parent c84e455173
commit 81c6df2323
6 changed files with 23 additions and 24 deletions

View file

@ -1,7 +1,6 @@
local function open_nvim_tree() local function open_nvim_tree()
-- open the tree
-- open the tree require("nvim-tree.api").tree.open()
require("nvim-tree.api").tree.open()
end end
-- Functional wrapper for mapping custom keybindings -- Functional wrapper for mapping custom keybindings
@ -36,9 +35,11 @@ vim.opt.number = true
vim.opt.clipboard = "unnamedplus" -- synchronize with system clipboard vim.opt.clipboard = "unnamedplus" -- synchronize with system clipboard
vim.opt.swapfile = false vim.opt.swapfile = false
vim.opt.cursorline = true 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 <BS> does the right thing
vim.opt.expandtab = true -- converts tabs to white space
vim.opt.shiftwidth = 4 -- width for autoindents
vim.cmd [[ vim.cmd [[
highlight clear highlight clear
colorscheme dracula colorscheme dracula
TSEnable highlight
]] ]]

View file

@ -28,11 +28,10 @@ require("lazy").setup({
dependencies = { 'williamboman/mason.nvim' }, dependencies = { 'williamboman/mason.nvim' },
priority = 150 }, priority = 150 },
{ 'neovim/nvim-lspconfig', { 'neovim/nvim-lspconfig',
config = require('plugins.nvim-lspconfig').init, init = require('plugins.nvim-lspconfig').init,
priority = 100 }, priority = 100 },
{ 'mfussenegger/nvim-lint', { 'mfussenegger/nvim-lint',
conifg = require('plugins.nvim-lint').init }, init = require('plugins.nvim-lint').init },
{},
{ 'folke/trouble.nvim', { 'folke/trouble.nvim',
opts = require('plugins.trouble').config, opts = require('plugins.trouble').config,
keys = require("plugins.trouble").keys keys = require("plugins.trouble").keys

View file

@ -13,13 +13,13 @@ return {
"tsserver", "tsserver",
"cssls", "cssls",
"cssmodules_ls", "cssmodules_ls",
"diagnosticls",
"jsonls", "jsonls",
"lua_ls", "lua_ls",
"sqlls", "sqlls",
"yamlls", "yamlls",
"lemminx", "lemminx",
"marksman" "marksman",
"html",
}, },
-- Whether servers that are set up (via lspconfig) should be automatically installed if they're not already installed. -- 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. -- 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. -- - 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. -- - { 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" } } -- Example: automatic_installation = { exclude = { "rust_analyzer", "solargraph" } }
automatic_installation = false, automatic_installation = true,
} }
} }

View file

@ -2,13 +2,13 @@ return {
init = function() init = function()
require('lint').linters_by_ft = { require('lint').linters_by_ft = {
--python = { --python = {
--'ruff' --'ruff',
--'flake8', --'flake8',
--'pylint', --'pylint',
--'pycodestyle', --'pycodestyle',
--'pydocstyle' --'pydocstyle'
--}, --},
php = { 'phpcs' }, php = { 'phpcs', },
markdown = { 'markdownlint' } markdown = { 'markdownlint' }
} }
@ -26,11 +26,11 @@ return {
--'--disable=C0114', -- disable missing module docstring info --'--disable=C0114', -- disable missing module docstring info
--} --}
--vim.api.nvim_create_autocmd({ "BufWritePost" }, { vim.api.nvim_create_autocmd({ "BufWritePost" }, {
--callback = function() callback = function()
--require("lint").try_lint() require("lint").try_lint()
--end, end,
--}) })
vim.api.nvim_create_autocmd({ "BufEnter" }, { vim.api.nvim_create_autocmd({ "BufEnter" }, {
callback = function() callback = function()

View file

@ -151,11 +151,6 @@ return {
capabilities = capabilities, capabilities = capabilities,
} }
require 'lspconfig'.diagnosticls.setup {
on_attach = on_attach,
capabilities = capabilities,
}
require 'lspconfig'.jsonls.setup { require 'lspconfig'.jsonls.setup {
on_attach = on_attach, on_attach = on_attach,
capabilities = capabilities, capabilities = capabilities,
@ -193,5 +188,9 @@ return {
on_attach = on_attach, on_attach = on_attach,
capabilities = capabilities, capabilities = capabilities,
} }
require 'lspconfig'.html.setup {
on_attach = on_attach,
capabilities = capabilities,
}
end end
} }

View file

@ -38,7 +38,7 @@ return function()
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). -- 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. -- 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 -- 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 end