add LSP documentation, ensure_installed for Mason

This commit is contained in:
Oliver Ladner 2024-01-22 22:16:50 +01:00
commit 60c2c4065b
2 changed files with 27 additions and 7 deletions

View file

@ -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 | <https://github.com/folke/lazy.nvim> |
| **telescope.nvim** | Find, Filter, Preview, Pick | <https://github.com/nvim-telescope/telescope.nvim> |
| **telescope-fzf-native.nvim** | Fuzzy finder for Telescope | <https://github.com/nvim-telescope/telescope-fzf-native.nvim> |
| **telescope-file-browser.nvim** | File browser | <https://github.com/nvim-telescope/telescope-file-browser.nvim> |
| **nvim-treesitter** | Parser/syntax highlighting | <https://github.com/nvim-treesitter/nvim-treesitter> |
| **nvim-treesitter-context** | Shows current line context | <https://github.com/nvim-treesitter/nvim-treesitter-context> |
| **nvim-treesitter-textobjects** | ? | <https://github.com/nvim-treesitter/nvim-treesitter-textobjects> |
| **oil.nvim** | file explorer, (bulk file creation/rename) | <https://github.com/stevearc/oil.nvim> |
| **nightfox.nvim** | Theme with treesitter/lsp support | <https://github.com/EdenEast/nightfox.nvim> |
| **tokyonight.nvim** | Theme with treesitter/lsp support | <https://github.com/folke/tokyonight.nvim> |
| **lualine.nvim** | Status line | <https://github.com/nvim-lualine/lualine.nvim> |
@ -73,7 +76,7 @@ This is more accurate than `nvim --startuptime`.
| **lsp-zero.nvim** | LSP for mere mortals | <https://github.com/VonHeikemen/lsp-zero.nvim> |
| **nvim-lspconfig** | Component of lsp-zero.nvim | <https://github.com/neovim/nvim-lspconfig> |
| **cmp-nvim-lsp** | Dependency of lsp-zero.nvim | <https://github.com/hrsh7th/cmp-nvim-lsp> |
| **conform.nvim** | Black magic wizardry, replacement for `null-ls` | <https://github.com/stevearc/conform.nvim> |
| **conform.nvim** | Formatter configuration, replacement for `null-ls` | <https://github.com/stevearc/conform.nvim> |
| **mason.nvim** | Install/manage LSP/DAP servers, linters and formatters | <https://github.com/williamboman/mason.nvim> |
| **mason-lspconfig.nvim** | Bridges mason.nvim with the lspconfig plugin | <https://github.com/williamboman/mason-lspconfig.nvim> |
| **zen-mode.nvim** | Distraction-free coding for Neovim | <https://github.com/folke/zen-mode.nvim> |
@ -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 <https://github.com/nomnivore/ollama.nvim>
- Solution to run file_browser when doing a vertical/horizontal split?
- <https://github.com/folke/trouble.nvim>
- Implement linting, see <https://www.josean.com/posts/neovim-linting-and-formatting>

View file

@ -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,