diff options
| -rw-r--r-- | ale.lua | 34 | ||||
| -rw-r--r-- | conform.lua | 8 | ||||
| -rw-r--r-- | lspconfig.lua | 37 | ||||
| -rw-r--r-- | lualine.lua | 45 |
4 files changed, 79 insertions, 45 deletions
diff --git a/ale.lua b/ale.lua deleted file mode 100644 index fc6b54e..0000000 --- a/ale.lua +++ /dev/null @@ -1,34 +0,0 @@ -return { - { - "dense-analysis/ale", - ft = { "*" }, -- load for all filetypes - config = function() - -- Enable ALE linting - vim.g.ale_enabled = 1 - vim.g.ale_lint_on_text_changed = "always" - vim.g.ale_lint_on_insert_leave = 1 - vim.g.ale_sign_error = "✗" - vim.g.ale_sign_warning = "⚠" - vim.g.ale_sign_info = "ℹ" - - -- Fixers - vim.g.ale_fixers = { - python = { "black", "isort" }, - r = { "styler" }, - lua = { "stylua" }, - tex = { "latexindent" }, - } - - -- Automatically fix files on save - vim.g.ale_fix_on_save = 1 - - -- Optional: choose linters per language - vim.g.ale_linters = { - python = { "flake8", "mypy" }, - r = { "lintr" }, - lua = { "luacheck" }, - tex = { "chktex" }, - } - end, - }, -} diff --git a/conform.lua b/conform.lua index fbefafc..65a50e9 100644 --- a/conform.lua +++ b/conform.lua @@ -14,6 +14,14 @@ return { json = { "json_repair" }, }, + -- Override the default isort configuration + formatters = { + isort = { + -- Remove the --filename argument and just use the file path + args = { "--stdout", "-" }, + }, + }, + format_on_save = { lsp_fallback = true, -- Use LSP if no dedicated formatter is found async = false, -- Formatting must be synchronous to save correctly diff --git a/lspconfig.lua b/lspconfig.lua index 1184af8..9827b2d 100644 --- a/lspconfig.lua +++ b/lspconfig.lua @@ -1,12 +1,19 @@ return { "neovim/nvim-lspconfig", - dependencies = { "williamboman/mason.nvim" }, + dependencies = { + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + }, config = function() - -- Define the configuration for pyright using the native API + -- Mason + require("mason").setup() + + require("mason-lspconfig").setup({ + ensure_installed = { "pyright", "clangd" }, + }) + + -- Pyright vim.lsp.config("pyright", { - cmd = { "pyright-langserver", "--stdio" }, - filetypes = { "python" }, - root_markers = { "pyproject.toml", "setup.py", "requirements.txt", ".git" }, settings = { python = { analysis = { @@ -17,12 +24,20 @@ return { }, }) - -- Trigger the server start for python files - vim.api.nvim_create_autocmd("FileType", { - pattern = "python", - callback = function(args) - vim.lsp.start("pyright") - end, + -- Clangd + vim.lsp.config("clangd", { + cmd = { + "clangd", + "--background-index", + "--clang-tidy", + "--header-insertion=never", + "--completion-style=detailed", + "--function-arg-placeholders", + }, }) + + -- Enable servers + vim.lsp.enable("pyright") + vim.lsp.enable("clangd") end, } diff --git a/lualine.lua b/lualine.lua index c6ea8ad..0794ecf 100644 --- a/lualine.lua +++ b/lualine.lua @@ -1,4 +1,49 @@ return { "nvim-lualine/lualine.nvim", dependencies = { "nvim-tree/nvim-web-devicons" }, + + config = function() + -- Function to show macro recording status + local function recording() + local reg = vim.fn.reg_recording() + if reg ~= "" then + return "REC @" .. reg + end + return "" + end + + require("lualine").setup({ + options = { + theme = "auto", + component_separators = "", + section_separators = "", + globalstatus = true, + }, + + sections = { + lualine_a = { "mode" }, + lualine_b = {}, + lualine_c = { + { "filename", path = 1 }, + }, + + lualine_x = { + recording, + "diagnostics", + }, + + lualine_y = { "filetype" }, + lualine_z = { "location" }, + }, + + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { "filename" }, + lualine_x = {}, + lualine_y = {}, + lualine_z = {}, + }, + }) + end, } |
