aboutsummaryrefslogtreecommitdiffstats
path: root/nvim
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2023-04-10 17:39:49 +0100
committerMatthew Lemon <y@yulqen.org>2023-04-10 17:39:49 +0100
commit0649a7f18f4241570183c9dcf473fed04c66977f (patch)
treeca1820b6f5b942ac3ce19f00e7d867505a7bf284 /nvim
parentc5a173d97e4892bf90a867d5c4bfca1d95ab3d12 (diff)
Adds back ale config for Python
Diffstat (limited to 'nvim')
-rw-r--r--nvim/after/plugin/ale.lua41
-rw-r--r--nvim/after/plugin/lsp.lua7
-rw-r--r--nvim/lua/lemon/packer.lua1
-rw-r--r--nvim/lua/lemon/set.lua1
4 files changed, 49 insertions, 1 deletions
diff --git a/nvim/after/plugin/ale.lua b/nvim/after/plugin/ale.lua
new file mode 100644
index 0000000..da1415c
--- /dev/null
+++ b/nvim/after/plugin/ale.lua
@@ -0,0 +1,41 @@
+-- Set the configuration options for the plugin
+local linters = {
+ python = {'ruff'},
+ ocaml = {'merlin'},
+ cpp = {'clang'},
+ yaml = {'yamllint'},
+ c = {'clang'},
+ go = {'gopls', 'golint', 'gofmt'},
+}
+
+local fixers = {
+ python = {'ruff', 'isort', 'yapf', 'black'},
+ go = {'gofmt'},
+ rust = {'rustfmt'},
+}
+
+local pyright_config = {
+ useLibraryCodeForTypes = 1,
+ disableLanguageServices = 1,
+ autoImportCompletions = 1,
+}
+
+vim.api.nvim_set_var('ale_linters', linters)
+vim.api.nvim_set_var('ale_python_pyright_config', pyright_config)
+vim.api.nvim_set_var('ale_fix_on_save', 1)
+vim.api.nvim_set_var('ale_warn_about_trailing_whitespace', 1)
+vim.api.nvim_set_var('ale_disable_lsp', 1)
+vim.api.nvim_set_var('ale_use_neovim_diagnostics_api', 1)
+vim.api.nvim_set_var('ale_set_quickfix', 1)
+vim.api.nvim_set_var('ale_echo_cursor', 1)
+vim.api.nvim_set_var('ale_echo_msg_error_str', 'Error')
+vim.api.nvim_set_var('ale_echo_msg_form', '%linter% - %code: %%s')
+vim.api.nvim_set_var('ale_loclist_msg_format', '%linter% - %code: %%s')
+vim.api.nvim_set_var('ale_echo_msg_warning_s', 'Warning')
+vim.api.nvim_set_var('ale_fixers', fixers)
+vim.api.nvim_set_var('ale_python_mypy_ignore_invalid_syntax', 1)
+vim.api.nvim_set_var('ale_python_mypy_executable', 'mypy')
+vim.api.nvim_set_var('ale_python_mypy_options', '--config-file mypy.ini')
+vim.api.nvim_set_var('g:ale_sign_error', '>>')
+vim.api.nvim_set_var('ale_fix_on_save', 1)
+vim.api.nvim_set_var('ale_linters_explicit', 0)
diff --git a/nvim/after/plugin/lsp.lua b/nvim/after/plugin/lsp.lua
index 2ef1bfa..5ab64d1 100644
--- a/nvim/after/plugin/lsp.lua
+++ b/nvim/after/plugin/lsp.lua
@@ -34,8 +34,9 @@ lsp.setup_nvim_cmp({
mapping = cmp_mappings
})
+
lsp.set_preferences({
- suggest_lsp_servers = true,
+ suggest_lsp_servers = false,
sign_icons = {
error = 'E',
warn = 'W',
@@ -59,6 +60,10 @@ lsp.on_attach(function(client, bufnr)
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
end)
+lsp.skip_server_setup({
+ 'pylsp',
+})
+
lsp.setup()
vim.diagnostic.config({
diff --git a/nvim/lua/lemon/packer.lua b/nvim/lua/lemon/packer.lua
index 8869f70..b9d8782 100644
--- a/nvim/lua/lemon/packer.lua
+++ b/nvim/lua/lemon/packer.lua
@@ -19,6 +19,7 @@ local packer_bootstrap = ensure_packer()
return require('packer').startup(function(use)
-- Packer can manage itself
use 'wbthomason/packer.nvim'
+ use 'dense-analysis/ale'
use {
'arnarg/todotxt.nvim',
requires = {'MunifTanjim/nui.nvim'},
diff --git a/nvim/lua/lemon/set.lua b/nvim/lua/lemon/set.lua
index 4347474..3c662a9 100644
--- a/nvim/lua/lemon/set.lua
+++ b/nvim/lua/lemon/set.lua
@@ -7,6 +7,7 @@ vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
+vim.opt.autoindent = true
vim.opt.smartindent = true