From 60c2c4065bf49f96398fc4a37b56dd43322e8eb0 Mon Sep 17 00:00:00 2001 From: Oliver Ladner Date: Mon, 22 Jan 2024 22:16:50 +0100 Subject: [PATCH] add LSP documentation, ensure_installed for Mason --- README.md | 27 +++++++++++++++++++++------ lua/weeheavy/plugins/lsp/lsp-zero.lua | 7 ++++++- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 47381ad..63bb728 100644 --- a/README.md +++ b/README.md @@ -23,10 +23,13 @@ plugins etc. and have "my own" config that only includes things I really need. ## Speed -Output from lazy.nvim profiling (`:Lazy`, then `P`): +Output from lazy.nvim profiling (`:Lazy profile`) on a MacBook Pro M2 Max, +macOS 14.0 (23A344). ### Start and open init.lua +Around 10% of the plugins are lazy-loaded. + ```bash Startuptime: 79.91ms @@ -37,7 +40,7 @@ This is more accurate than `nvim --startuptime`. UIEnter 79.91ms (+33.55ms) ``` -### Starting with empty file +### Starting with an empty file Around 50% of the plugins are lazy-loaded. @@ -58,10 +61,10 @@ This is more accurate than `nvim --startuptime`. | **lazy.nvim** | Package manager | | | **telescope.nvim** | Find, Filter, Preview, Pick | | | **telescope-fzf-native.nvim** | Fuzzy finder for Telescope | | -| **telescope-file-browser.nvim** | File browser | | | **nvim-treesitter** | Parser/syntax highlighting | | | **nvim-treesitter-context** | Shows current line context | | | **nvim-treesitter-textobjects** | ? | | +| **oil.nvim** | file explorer, (bulk file creation/rename) | | | **nightfox.nvim** | Theme with treesitter/lsp support | | | **tokyonight.nvim** | Theme with treesitter/lsp support | | | **lualine.nvim** | Status line | | @@ -73,7 +76,7 @@ This is more accurate than `nvim --startuptime`. | **lsp-zero.nvim** | LSP for mere mortals | | | **nvim-lspconfig** | Component of lsp-zero.nvim | | | **cmp-nvim-lsp** | Dependency of lsp-zero.nvim | | -| **conform.nvim** | Black magic wizardry, replacement for `null-ls` | | +| **conform.nvim** | Formatter configuration, replacement for `null-ls` | | | **mason.nvim** | Install/manage LSP/DAP servers, linters and formatters | | | **mason-lspconfig.nvim** | Bridges mason.nvim with the lspconfig plugin | | | **zen-mode.nvim** | Distraction-free coding for Neovim | | @@ -85,9 +88,21 @@ This is how it looks like: ![My Neovim setup](./sample.png) +## Mason essentials + +This lists the LSPs/linter/formatters I consider ok for my use cases. Tools may +support many more languages than I document in the "Language" column. The +formatters installed here are used via `conform.nvim`. + +| Type | Language | Name | Benefits | Issues | +| --------- | -------------- | ---------------- | ----------------------- | ------------------------- | +| LSP | Markdown | **marksman** | Autocompletes links | n/a | +| Linter | Ansible | **ansible-lint** | | yamllint vs. ansible-lint | +| Linter | YAML | **yamllint** | well, it's yamllint | yamllint vs. ansible-lint | +| Formatter | Markdown, YAML | **prettier** | Formats Markdown tables | n/a | +| Formatter | Lua | **stylua** | Formats Lua | n/a | + ## Open issues/TODOs - ollama integration -- Solution to run file_browser when doing a vertical/horizontal split? - -- Implement linting, see diff --git a/lua/weeheavy/plugins/lsp/lsp-zero.lua b/lua/weeheavy/plugins/lsp/lsp-zero.lua index 9ee5dd9..97b5311 100644 --- a/lua/weeheavy/plugins/lsp/lsp-zero.lua +++ b/lua/weeheavy/plugins/lsp/lsp-zero.lua @@ -79,7 +79,12 @@ return { }) require("mason-lspconfig").setup({ - ensure_installed = {}, + ensure_installed = { + "marksman", + "prettier", + "stylua", + "black", + }, handlers = { -- names must align with Mason names lsp_zero.default_setup,