Compare commits

..

No commits in common. "main" and "feat/0.12-vimpack" have entirely different histories.

23 changed files with 286 additions and 353 deletions

154
README.md
View file

@ -5,35 +5,22 @@
After doing my first steps with <https://github.com/nvim-lua/kickstart.nvim>, After doing my first steps with <https://github.com/nvim-lua/kickstart.nvim>,
I decided to roll my own, custom, "lightweight" Neovim configuration in order to I decided to roll my own, custom, "lightweight" Neovim configuration in order to
better understand Neovim and its configuration/customization, package managers, better understand Neovim and its configuration/customization, package managers,
plugins etc. and have my own config that only includes parts I need. plugins etc. and have "my own" config that only includes things I really need.
More on the "why's" are explained [in my blog post](https://lugh.ch/neovim-lessons-learned.html). More on the "why's" are explained [in my blog post](https://lugh.ch/neovim-lessons-learned.html).
## Installation ## Installation
1. Install Neovim 0.12 or newer 1. Install Neovim 0.10. or newer
1. Install the dependencies documented in `init.lua` 1. Install the dependencies documented in `init.lua`
1. Clone this Git repository to 1. Clone this Git repository to
1. `~/.config/nvim` on macOS or Linux 1. `~/.config/nvim` on macOS or Linux
1. `c:\Users\foobar\AppData\Local\nvim` on Windows 1. `c:\Users\foobar\AppData\Local\nvim` when on Windows
### Finishing touches ### Finishing touches
- Create a `$HOME/.ignore` file and add big, useless directories to it, so - Create a `$HOME/.ignore` file and add big, useless directories to it, so
ripgrep, fd can ignore those. Ideas: Telescope/ripgrep/fd can ignore those. My current list of files/directories is
``` available in `lua/weeheavy/plugins/telescope-fzf-native.lua`
Pictures/
Music/
Applications/
dotnet/
opt/miniconda3/
Library/
.cache/
.vscode/
.git/
.local/
.m2/
.npm/
```
- Install Mason LSP/linter/formatters from the table down below - Install Mason LSP/linter/formatters from the table down below
## Speed ## Speed
@ -42,55 +29,52 @@ It's not too important. Still, I try to balance increasing startup time with
the usefullness of a plugin. the usefullness of a plugin.
Output from lazy.nvim profiling (`:Lazy profile`) on a MacBook Pro M2 Max, Output from lazy.nvim profiling (`:Lazy profile`) on a MacBook Pro M2 Max,
macOS 15 on Neovim 0.12.0. macOS 15 on Neovim 0.11.0.
### Start and open init.lua ### Start and open init.lua
Around 15% of the plugins are lazy-loaded. Around 15% of the plugins are lazy-loaded.
```bash ```bash
LazyStart 12.28ms LazyStart 18.67ms
LazyDone 61.96ms (+49.68ms) LazyDone 43.52ms (+24.85ms)
UIEnter 122.07ms (+60.11ms) UIEnter 110.71ms (+67.19ms)
``` ```
### Starting without a file ### Starting with an empty file
Around 45% of the plugins are lazy-loaded. Around 50% of the plugins are lazy-loaded.
```bash ```bash
LazyStart 13.51ms LazyStart 18.15ms
LazyDone 64.8ms (+51.29ms) LazyDone 46.91ms (+28.76ms)
UIEnter 84.97ms (+20.17ms) UIEnter 59.08ms (+12.17ms)
``` ```
## Plugins ## Plugins
| Name | Purpose | URL | | Name | Purpose | URL |
| ------------------------------- | ----------------------------------------------------------------- | ---------------------------------------------------------------- | | ------------------------------- | ----------------------------------------------------------------------- | ---------------------------------------------------------------- |
| **SchemaStore.nvim** | JSON schemas | <https://github.com/b0o/SchemaStore.nvim> | | **lazy.nvim** | Package manager | <https://github.com/folke/lazy.nvim> |
| **aerial.nvim** | Code outline | <https://github.com/stevearc/aerial.nvim> | | **telescope.nvim** | Find, Filter, Preview, Pick | <https://github.com/nvim-telescope/telescope.nvim> |
| **blink.cmp** | Fuzzy code completion | <https://github.com/Saghen/blink.cmp> | | **telescope-fzf-native.nvim** | Fuzzy finder for Telescope | <https://github.com/nvim-telescope/telescope-fzf-native.nvim> |
| **ccc.nvim** | Color picker/color highlight | <https://github.com/uga-rosa/ccc.nvim> | | **nvim-treesitter** | Parser/syntax highlighting | <https://github.com/nvim-treesitter/nvim-treesitter> |
| **conform.nvim** | Formatter configuration, replacement for `null-ls` | <https://github.com/stevearc/conform.nvim> | | **nvim-treesitter-context** | Shows current line context | <https://github.com/nvim-treesitter/nvim-treesitter-context> |
| **diffview.nvim** | Git diff viewer/stager | <https://github.com/sindrets/diffview.nvim> | | **nvim-treesitter-textobjects** | ? | <https://github.com/nvim-treesitter/nvim-treesitter-textobjects> |
| **flash.nvim** | Navigation and Treesitter selection w/ search labels | <https://github.com/folke/flash.nvim> | | **oil.nvim** | file explorer, (bulk file creation/rename) | <https://github.com/stevearc/oil.nvim> |
| **gitsigns.nvim** | Git change indicator | <https://github.com/lewis6991/gitsigns.nvim> | | **rose-pine** | Theme | <https://github.com/rose-pine/neovim> |
| **kanso** | Theme | <https://github.com/webhooked/kanso.nvim> | | **lualine.nvim** | Status line | <https://github.com/nvim-lualine/lualine.nvim> |
| **lazy.nvim** | Package manager | <https://github.com/folke/lazy.nvim> | | **gitsigns.nvim** | Git change indicator | <https://github.com/lewis6991/gitsigns.nvim> |
| **lualine.nvim** | Status line | <https://github.com/nvim-lualine/lualine.nvim> | | **which-key.nvim** | Shows contextual key bindings | <https://github.com/folke/which-key.nvim> |
| **mason.nvim** | Install/manage LSP/DAP servers, linters and formatters | <https://github.com/williamboman/mason.nvim> | | **conform.nvim** | Formatter configuration, replacement for `null-ls` | <https://github.com/stevearc/conform.nvim> |
| **mini.nvim** | Picker, icons, show trailing whitespace, textobject nav | <https://github.com/echasnovski/mini.nvim> | | **mason.nvim** | Install/manage LSP/DAP servers, linters and formatters | <https://github.com/williamboman/mason.nvim> |
| **nvim-lint** | Narrow-scope linter plugin to use via Neovim diagnostic framework | <https://github.com/mfussenegger/nvim-lint> | | **todo-comments.nvim** | Highlights `NOTE:`, `FIXME:` etc. and makes them findable via Telescope | <https://github.com/folke/todo-comments.nvim> |
| **nvim-treesitter** | Parser/syntax highlighting | <https://github.com/nvim-treesitter/nvim-treesitter> | | **mini.nvim** | I use the icons | <https://github.com/echasnovski/mini.nvim> |
| **nvim-treesitter-context** | Shows current line context | <https://github.com/nvim-treesitter/nvim-treesitter-context> | | **flash.nvim** | Navigation and Treesitter selection w/ search labels | <https://github.com/folke/flash.nvim> |
| **nvim-treesitter-textobjects** | ? | <https://github.com/nvim-treesitter/nvim-treesitter-textobjects> | | **nvim-lint** | Narrow-scope linter plugin to use via Neovim diagnostic framework | <https://github.com/mfussenegger/nvim-lint> |
| **oil.nvim** | file explorer, (bulk file creation/rename) | <https://github.com/stevearc/oil.nvim> | | **snipe.nvim** | Buffer navigation | <https://github.com/leath-dub/snipe.nvim> |
| **rose-pine** | Theme | <https://github.com/rose-pine/neovim> | | **blink.cmp** | Fuzzy code completion | <https://github.com/Saghen/blink.cmp> |
| **snipe.nvim** | Buffer navigation | <https://github.com/leath-dub/snipe.nvim> | | **diffview.nvim** | Git diff viewer/stager | <https://github.com/sindrets/diffview.nvim> |
| **todo-comments.nvim** | Highlight `NOTE:`, `FIXME:` inline and via `trouble.nvim` | <https://github.com/folke/todo-comments.nvim> |
| **trouble.nvim** | pretty diagnostics, references, quickfix and location list | <https://github.com/folke/trouble.nvim> |
| **which-key.nvim** | Shows contextual key bindings | <https://github.com/folke/which-key.nvim> |
## Looks ## Looks
@ -101,47 +85,32 @@ This is how it looks like:
## Mason essentials ## Mason essentials
This lists the LSPs/linter/formatters I consider ok for my use cases. Tools may This lists the LSPs/linter/formatters I consider ok for my use cases. Tools may
support more languages than I document in the "Language" column. The formatters support many more languages than I document in the "Language" column. The
installed through Mason are then configured in `conform.nvim`. formatters installed here are used via `conform.nvim`.
| Type | Language | Name | Benefits | Issues | | Type | Language | Name | Benefits | Issues |
| --------- | ------------------ | ----------------------------------- | ----------------------- | --------------------------------- | | --------- | ------------------ | --------------------------- | ------------------------------------------------ | ----------------------------------------------------- |
| Formatter | Bash | **shfmt** | | | | LSP | Markdown | **marksman** | Autocompletes links | <https://github.com/artempyanykh/marksman/issues/327> |
| Formatter | HCL | **hclfmt** | | | | LSP | Go | **gopls** | | n/a |
| Formatter | Lua | **stylua** | | | | LSP | Terraform/OpenTofu | **terraform-ls** | | n/a |
| Formatter | Python | **isort** | Sorts imports | | | LSP | Terraform/OpenTofu | **tflint** | | n/a |
| Formatter | Python | **ruff** | | | | LSP | Ansible | **ansible-language-server** | Ansible knowhow | Search _yaml.ansible_ in `prefs.lua` |
| Formatter | TOML | **taplo** | | | | LSP | Bash | **bash-language-server** | Incorporates ShellCheck | n/a |
| Formatter | YAML | **yamlfmt** | | | | LSP | YAML | **yaml-language-server** | | n/a |
| Formatter | many | **prettier** | See [docs][prettier] | | | Linter | Ansible | **ansible-lint** | | yamllint vs. ansible-lint |
| LSP | Ansible | **ansible-language-server** | Ansible knowhow | See _yaml.ansible_ in `prefs.lua` | | Linter | YAML | **yamllint** | | yamllint vs. ansible-lint |
| LSP | Bash | **bash-language-server** | Incorporates ShellCheck | | | Linter | Terraform/OpenTofu | **tflint** | | |
| LSP | CSS | **tailwindcss-language-server** | | | | Linter | any | **woke** | Makes you aware of woke language | |
| LSP | Docker | **dockerfile-language-server** | | | | Linter | Git commits | **commitlint** | Ensure to adhere to _Conventional Commit_ format | |
| LSP | Docker Compose | **docker-compose-language-service** | | | | Linter | JSON | **jsonlint** | | |
| LSP | Go | **gopls** | | | | Linter | Text | **proselint** | See [source][prose] | |
| LSP | HTML | **html-lsp** | | | | Linter | Text | **write-good** | See [source][writegood] | |
| LSP | JS | **eslint-lsp** | | | | Formatter | Markdown, YAML | **prettier** | Markdown table formatting | n/a |
| LSP | JSON | **json-lsp** | | | | Formatter | Lua | **stylua** | Formats Lua | n/a |
| LSP | Lua | **stylua** | | | | Formatter | Bash | **shfmt** | Formats Bash scripts | n/a |
| LSP | Markdown | **marksman** | Autocompletes links | [issues/327][marksmanbug] | | Formatter | HCL | **hclfmt** | For HashiCorp configuration language | |
| LSP | Python | **ruff** | | | | Formatter | many | **prettier** | See [docs][prettier] | |
| LSP | TOML | **taplo** | | | | Formatter | YAML | **yamlfmt** | | |
| LSP | Terraform/OpenTofu | **terraform-ls** | HashiCorp | |
| LSP | Terraform/OpenTofu | **tflint** | | |
| LSP | YAML | **yaml-language-server** | | |
| Linter | Ansible | **ansible-lint** | | yamllint vs. ansible-lint |
| Linter | Bash | **shellcheck** | | |
| Linter | Git commits | **commitlint** | _Conventional Commits_ | |
| Linter | JS | **eslint_d** | | |
| Linter | JSON | **jsonlint** | | |
| Linter | Makefile | **checkmake** | | |
| Linter | Python | **ruff** | | |
| Linter | Terraform/OpenTofu | **tflint** | | |
| Linter | Text | **proselint** | See [source][prose] | |
| Linter | Text | **write-good** | See [source][writegood] | |
| Linter | YAML | **yamllint** | | yamllint vs. ansible-lint |
| Linter | many | **gitleaks** | | |
## Key bindings ## Key bindings
@ -158,4 +127,3 @@ See [CHEATSHEET](CHEATSHEET.md)
[prettier]: https://prettier.io/docs/ [prettier]: https://prettier.io/docs/
[prose]: https://github.com/amperser/proselint [prose]: https://github.com/amperser/proselint
[writegood]: https://github.com/btford/write-good?tab=readme-ov-file#checks [writegood]: https://github.com/btford/write-good?tab=readme-ov-file#checks
[marksmanbug]: https://github.com/artempyanykh/marksman/issues/327

View file

@ -1,2 +1,3 @@
-- Disable colorcolumn in help windows -- Disable column width indicators in quickfix/Trouble windows
vim.opt.colorcolumn = ""
vim.wo.colorcolumn = "" vim.wo.colorcolumn = ""

View file

@ -1,4 +1,4 @@
-- Disable numbers and colorcolumn in Oil windows -- Disable numbers in Oil windows
vim.wo.relativenumber = false vim.opt.relativenumber = false
vim.wo.number = false vim.opt.number = false
vim.wo.colorcolumn = "" vim.opt.colorcolumn = ""

View file

@ -5,21 +5,31 @@ Later on, switched to native LSP setup with the help of
https://gpanders.com/blog/whats-new-in-neovim-0-11/ https://gpanders.com/blog/whats-new-in-neovim-0-11/
NOTE: EXTERNAL DEPENDENCIES MACOS NOTE: EXTERNAL DEPENDENCIES MACOS
- ripgrep (https://github.com/BurntSushi/ripgrep, used by telescope)
- fd (https://github.com/sharkdp/fd, used by telescope)
- A Nerd font (https://www.nerdfonts.com/, used by various plugins) - A Nerd font (https://www.nerdfonts.com/, used by various plugins)
- tree-sitter-cli (brew install <pkgname>)
NOTE: EXTERNAL DEPENDENCIES FREEBSD NOTE: EXTERNAL DEPENDENCIES FREEBSD
- cmake, tree-sitter-cli, ripgrep (pkg install <pkgname>) - cmake, ripgrep (pkg install <pkgname>)
NOTE: EXTERNAL DEPENDENCIES LINUX (Arch) NOTE: EXTERNAL DEPENDENCIES LINUX (Arch)
- cmake, tree-sitter-cli, nodejs (pacman -S <pkgname>) - cmake, tree-sitter-cli, nodejs (pacman -S <pkgname>)
Make fzf work:
1. Go to ~/.local/share/nvim/lazy/telescope-fzf-native.nvim
2. Run `make`
NOTE: EXTERNAL DEPENDENCIES WINDOWS NOTE: EXTERNAL DEPENDENCIES WINDOWS
See https://blog.nikfp.com/how-to-install-and-set-up-neovim-on-windows See https://blog.nikfp.com/how-to-install-and-set-up-neovim-on-windows
- ripgrep (https://github.com/BurntSushi/ripgrep, used by telescope)
- fd (https://github.com/sharkdp/fd, used by telescope)
- A Nerd font (https://www.nerdfonts.com/, used by various plugins) - A Nerd font (https://www.nerdfonts.com/, used by various plugins)
- nodejs-lts (used for npm to install prettier) - nodejs-lts (used for npm to install prettier)
- then run "npm i -g npm" - then run "npm i -g npm"
- zig, wget, unzip, git, fzf - zig, wget, unzip, git, fzf
- make, mingw (MartinStorsjo.LLVM-MinGW.MSVCRT), cmake (https://github.com/nvim-telescope/telescope-fzf-native.nvim#installation)
Then run "mingw32-make.exe" in your users telescope-fzf-native plugin directory:
C:\Users\foobar\AppData\Local\nvim-data\lazy\telescope-fzf-native.nvim
--]] --]]
-- Include my custom configuration -- Include my custom configuration

View file

@ -1,32 +1,36 @@
{ {
"SchemaStore.nvim": { "branch": "main", "commit": "72d144a9e014646963b8a5c67a4fde19b9772528" }, "SchemaStore.nvim": { "branch": "main", "commit": "25a82a141dc0caf3b9b82002a35caf3c9feab741" },
"aerial.nvim": { "branch": "master", "commit": "28fe6e822ae344544c379d60fcb13c9519a1f08a" }, "aerial.nvim": { "branch": "master", "commit": "645d108a5242ec7b378cbe643eb6d04d4223f034" },
"blink-cmp-git": { "branch": "master", "commit": "d3f2a9067ab028e779d08e61bf0b054939011316" }, "blink-cmp-git": { "branch": "master", "commit": "10783593af764424018a95e75df6ad5a8b66fe07" },
"blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" }, "blink.cmp": { "branch": "main", "commit": "451168851e8e2466bc97ee3e026c3dcb9141ce07" },
"catppuccin": { "branch": "main", "commit": "cb5665990a797b102715188e73c44c3931b3b42e" }, "catppuccin": { "branch": "main", "commit": "cb5665990a797b102715188e73c44c3931b3b42e" },
"ccc.nvim": { "branch": "main", "commit": "9d1a256e006decc574789dfc7d628ca11644d4c2" }, "ccc.nvim": { "branch": "main", "commit": "9d1a256e006decc574789dfc7d628ca11644d4c2" },
"conform.nvim": { "branch": "master", "commit": "3543d000dafbc41cc7761d860cfdb24e82154f75" }, "conform.nvim": { "branch": "master", "commit": "3543d000dafbc41cc7761d860cfdb24e82154f75" },
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"flash.nvim": { "branch": "main", "commit": "5f0f270fdc7c5b0c21d903ee85b9cb06f2ac636a" }, "flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" },
"friendly-snippets": { "branch": "main", "commit": "b4d01b0fdf3c9a549961c2f9ffe8dc09be166219" }, "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
"fzf-lua": { "branch": "main", "commit": "05e44d38de0a79c11fba5f7bf8138791b1dbdd1e" }, "fzf-lua": { "branch": "main", "commit": "bde73a6886b607246095aa59f396de5e0d036890" },
"gitsigns.nvim": { "branch": "main", "commit": "fd36f038e52ad8409fbf9926ae4a0a514cca04d8" }, "gitsigns.nvim": { "branch": "main", "commit": "a462f416e2ce4744531c6256252dee99a7d34a83" },
"kanso.nvim": { "branch": "main", "commit": "1afbbb449aa0254823dbe1932e3cbb51886ff9fe" }, "kanso.nvim": { "branch": "main", "commit": "1afbbb449aa0254823dbe1932e3cbb51886ff9fe" },
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
"lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" }, "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
"mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" }, "lush.nvim": { "branch": "main", "commit": "9c60ec2279d62487d942ce095e49006af28eed6e" },
"mini.nvim": { "branch": "main", "commit": "ac5dffcc52b8378fbb15efeb0497a83e57a0b01c" }, "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" },
"nvim-lint": { "branch": "master", "commit": "3d55c8f67c6ae5c15e1042571e107c7a3d5c5f4e" }, "mini.nvim": { "branch": "main", "commit": "439cdcd6992bc9012efd7d8ed7a7b7a0f1fac32a" },
"nvim-treesitter": { "branch": "main", "commit": "9a168f6357ed21c3a636e1727bc7d382abc451b8" }, "nvim-lint": { "branch": "master", "commit": "4b03656c09c1561f89b6aa0665c15d292ba9499d" },
"nvim-treesitter-context": { "branch": "master", "commit": "f3061339b8eaf9fda873600bc425b8d2d8502533" }, "nvim-treesitter": { "branch": "master", "commit": "cf12346a3414fa1b06af75c79faebe7f76df080a" },
"nvim-web-devicons": { "branch": "master", "commit": "5f032a85be210cd1c6ac98861eb3b187ff3bd5eb" }, "nvim-treesitter-context": { "branch": "master", "commit": "adf4b6b0420b7be6c717ef0ac7993183d6c201b1" },
"oil.nvim": { "branch": "master", "commit": "b73018b75affd13fa38e2fc94ef753b465f770d7" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "5ca4aaa6efdcc59be46b95a3e876300cfead05ef" },
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, "nvim-web-devicons": { "branch": "master", "commit": "d7462543c9e366c0d196c7f67a945eaaf5d99414" },
"oil.nvim": { "branch": "master", "commit": "0fcc83805ad11cf714a949c98c605ed717e0b83e" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"pomo.nvim": { "branch": "main", "commit": "7e06e5221d8d1e596a0ab29dd4d7fcee5f3cd05a" }, "pomo.nvim": { "branch": "main", "commit": "7e06e5221d8d1e596a0ab29dd4d7fcee5f3cd05a" },
"rose-pine": { "branch": "main", "commit": "ff483051a47e27d84bdef47703538df1ed9f4a47" }, "rose-pine": { "branch": "main", "commit": "cf2a288696b03d0934da713d66c6d71557b5c997" },
"snipe.nvim": { "branch": "main", "commit": "d2d196c335919767803f905d573ce66340e33ee6" }, "snipe.nvim": { "branch": "main", "commit": "d2d196c335919767803f905d573ce66340e33ee6" },
"soviet.nvim": { "branch": "main", "commit": "bc0c2782699ec900ca6e15eff83a48bca0d7f99e" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" },
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" },
"zenbones.nvim": { "branch": "main", "commit": "22b7fb75593412e0dc81b4bdefae718e9e84aa82" }
} }

View file

@ -1,5 +1,5 @@
---@type vim.lsp.Config ---@type vim.lsp.Config
return { return {
cmd = { "proselint", "check", "--output-format=json" }, cmd = { "proselint" },
filetypes = { "markdown", "text", "gitcommit", "plaintext" }, filetypes = { "markdown", "text", "gitcommit", "plaintext" },
} }

5
lsp/woke.lua Normal file
View file

@ -0,0 +1,5 @@
---@type vim.lsp.Config
return {
cmd = { "woke", "--stdin" },
filetypes = { "markdown", "text", "gitcommit", "plaintext" },
}

View file

@ -14,8 +14,8 @@ require("weeheavy.prefs")
require("weeheavy.autocmd") require("weeheavy.autocmd")
-- Run floating Oil window when Neovim was started without a file name -- Run floating Oil window when Neovim was started without a file name
-- if vim.fn.argc() == 0 then if vim.fn.argc() == 0 then
-- vim.defer_fn(function() vim.defer_fn(function()
-- vim.cmd("Oil --float") vim.cmd("Oil --float")
-- end, 0) end, 0)
-- end end

View file

@ -1,10 +1,9 @@
return { return {
"sindrets/diffview.nvim", "sindrets/diffview.nvim",
branch = "main", branch = "main",
lazy = true, --event = "VeryLazy",
--event = "VeryLazy", opts = {},
opts = {}, dependencies = {
dependencies = { "nvim-tree/nvim-web-devicons",
"nvim-tree/nvim-web-devicons", },
},
} }

View file

@ -66,8 +66,7 @@ return {
-- Default list of enabled providers defined so that you can extend it -- Default list of enabled providers defined so that you can extend it
-- elsewhere in your config, without redefining it, due to `opts_extend` -- elsewhere in your config, without redefining it, due to `opts_extend`
sources = { sources = {
-- default = { "lsp", "path", "snippets" }, default = { "lsp", "path", "snippets" },
default = { "lsp", "path", "snippets", "buffer" },
providers = { providers = {
git = { git = {
module = "blink-cmp-git", module = "blink-cmp-git",
@ -83,7 +82,7 @@ return {
}, },
per_filetype = { per_filetype = {
lua = { "lsp", "buffer", "path", "snippets" }, lua = { "lsp", "buffer", "path", "snippets" },
markdown = { "lsp", "path", "snippets", "buffer" }, -- do not add 'buffer' here, it's slow AF markdown = { "lsp", "path", "snippets" }, -- do not add 'buffer' here, it's slow AF
text = { "buffer", "path" }, text = { "buffer", "path" },
ps1 = { "lsp", "buffer", "path", "snippets" }, ps1 = { "lsp", "buffer", "path", "snippets" },
}, },

View file

@ -1,64 +1,6 @@
return { return {
"mason-org/mason.nvim", "williamboman/mason.nvim",
tag = "stable", tag = "stable",
-- cmd = "Mason", lazy = false,
config = function() config = true,
require("mason").setup() }
local registry = require("mason-registry")
local packages = {
-- LSP
"ansible-language-server",
"azure-pipelines-language-server",
"bash-language-server",
"bicep-lsp",
"docker-compose-language-service",
"eslint-lsp",
"gopls",
"html-lsp",
"json-lsp",
"lua-language-server",
"marksman",
"ruff",
"stylua",
"tailwindcss-language-server",
"taplo",
"terraform-ls",
"tflint",
"vim-language-server",
"yaml-language-server",
-- DAP
"go-debug-adapter",
-- Linter (those not yet in LSP)
"alex",
"ansible-lint",
"cfn-lint",
"checkmake",
"commitlint",
"eslint_d",
"gitleaks",
"golangci-lint",
"jsonlint",
"proselint",
"shellcheck",
"tfsec",
"write-good",
"yamllint",
-- Formatter
"hclfmt",
"isort",
"prettier",
"shfmt",
"yamlfmt",
}
registry.refresh(function()
for _, pkg_name in ipairs(packages) do
local pkg = registry.get_package(pkg_name)
if not pkg:is_installed() then
pkg:install()
end
end
end)
end,
}

View file

@ -29,7 +29,6 @@ return {
}, },
config = function() config = function()
local lint = require("lint") local lint = require("lint")
lint.linters.write_good.args = { "--parse", "--no-weasel" }
lint.linters_by_ft = { lint.linters_by_ft = {
javascript = { "eslint_d" }, javascript = { "eslint_d" },
@ -38,14 +37,13 @@ return {
typescriptreact = { "eslint_d" }, typescriptreact = { "eslint_d" },
svelte = { "eslint_d" }, svelte = { "eslint_d" },
python = { "ruff" }, python = { "ruff" },
markdown = { "proselint", "write_good", "alex" }, lua = { "woke" },
text = { "gitleaks", "proselint", "write_good", "alex" }, ansible = { "woke" },
sh = { "gitleaks" }, markdown = { "woke", "proselint", "write_good" },
text = { "gitleaks", "proselint", "write_good" },
sh = { "gitleaks", "woke" },
bash = { "gitleaks" }, bash = { "gitleaks" },
go = { "golangcilint" }, go = { "golangcilint" },
git = { "gitleaks", "commitlint" },
gitcommit = { "gitleaks", "commitlint" },
make = { "checkmake" },
} }
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })

View file

@ -7,16 +7,7 @@ return {
-- require("mini.ai").setup({ n_lines = 500 }) -- require("mini.ai").setup({ n_lines = 500 })
require("mini.trailspace").setup() -- highlight trailing space require("mini.trailspace").setup() -- highlight trailing space
require("mini.cursorword").setup() -- highlight word below cursor require("mini.cursorword").setup() -- highlight word below cursor
require("mini.ai").setup({ -- replace within/outside quotes require("mini.ai").setup() -- replace within/outside quotes
mappings = {
-- Disable next/last variants to avoid conflict with
-- Neovim 0.12 built-in `an`/`in` node selection (see :help v_an)
around_next = "",
inside_next = "",
around_last = "",
inside_last = "",
},
})
require("mini.pick").setup({ require("mini.pick").setup({
mappings = { mappings = {
move_down = "<C-j>", move_down = "<C-j>",

View file

@ -5,7 +5,6 @@ return {
lazy = true, lazy = true,
cmd = "Oil", cmd = "Oil",
config = function() config = function()
local detail = false
require("oil").setup({ require("oil").setup({
default_file_explorer = true, default_file_explorer = true,
columns = { columns = {
@ -24,17 +23,6 @@ return {
["<C-c>"] = "actions.close", ["<C-c>"] = "actions.close",
["q"] = "actions.close", ["q"] = "actions.close",
["<Esc>"] = "actions.close", ["<Esc>"] = "actions.close",
["gd"] = {
desc = "Toggle file detail view",
callback = function()
detail = not detail
if detail then
require("oil").set_columns({ "icon", "permissions", "size", "mtime" })
else
require("oil").set_columns({ "icon" })
end
end,
},
}, },
float = { float = {

View file

@ -14,7 +14,6 @@ return {
}, },
config = function() config = function()
local snipe = require("snipe") local snipe = require("snipe")
snipe.setup({ snipe.setup({
hints = { hints = {
-- Charaters to use for hints -- Charaters to use for hints
@ -29,17 +28,6 @@ return {
border = "rounded", border = "rounded",
}, },
preselect_current = true, preselect_current = true,
-- Show a marker next to buffers that have unsaved changes
-- (no icons: filename/directory only)
buffer_format = {
"filename",
function(item)
if item.classifiers:sub(5, 5) == "+" then
return " [+]", "DiagnosticWarn"
end
return ""
end,
},
}, },
navigate = { navigate = {
cancel_snipe = "q", cancel_snipe = "q",

View file

@ -0,0 +1,19 @@
--[[
Fuzzy finder
Docs: https://github.com/nvim-telescope/telescope-fzf-native.nvim
Performance depends on installation of ripgrep and fd (both available in Homebrew)
If you have huge amounts of files, consider adding some to `$HOME/.ignore`:
Pictures/
Music/
Applications/
dotnet/
opt/miniconda3/
Library/
.cache/
.git/
]]--
return {
"nvim-telescope/telescope-fzf-native.nvim",
build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build'
}

View file

@ -0,0 +1,56 @@
return {
"nvim-telescope/telescope.nvim",
lazy = true,
--event = "VeryLazy",
cmd = "Telescope",
tag = "0.1.8",
dependencies = {
"nvim-lua/plenary.nvim",
},
--config = function(lazy, opts)
config = function()
local telescope = require("telescope")
telescope.load_extension("fzf")
--telescope.load_extension("file_browser")
telescope.setup({
defaults = {
border = false,
sorting_strategy = "ascending",
wrap_result = true,
layout_strategy = "horizontal",
layout_config = {
horizontal = {
prompt_position = "top",
preview_width = 0.45,
width = 0.90,
height = 0.75,
preview_cutoff = 90,
},
},
},
pickers = {
colorscheme = {
enable_preview = true,
},
find_files = {
hidden = true,
wrap_results = false, -- this is not about the preview
},
live_grep = {
additional_args = function()
return { "--hidden", "--glob", "!**/.git/*" }
end,
},
grep_string = {
additional_args = function()
return { "--hidden", "--glob", "!**/.git/*" }
end,
},
["lsp_references"] = { wrap_results = true },
["lsp_definitions"] = { wrap_results = true },
["diagnostics"] = { wrap_results = true },
["buffers"] = { sort_mru = true, sort_lastused = true, ignore_current_buffer = false },
},
})
end,
}

View file

@ -3,18 +3,4 @@ return {
"webhooked/kanso.nvim", "webhooked/kanso.nvim",
lazy = false, lazy = false,
priority = 1000, priority = 1000,
config = function()
local k = require("kanso")
k.setup({
transparent = false,
background = {
dark = "ink", -- zen, mist, ink
light = "pearl",
},
foreground = {
dark = "default", -- Use default colors in dark mode
light = "saturated", -- Use higher saturation in light mode
},
})
end,
} }

View file

@ -1,13 +0,0 @@
return {
"rezniqov/soviet.nvim",
branch = "main",
lazy = false,
enabled = true,
priority = 1000,
opts = {}, -- Add your soviet.nvim settings here.
config = function(_, opts)
require("soviet").setup(opts)
vim.cmd.colorscheme("soviet-dark")
-- vim.cmd.colorscheme("soviet-light")
end,
}

View file

@ -1,77 +1,74 @@
-- Treesitter -- Treesitter
-- NOTE: After updating, wipe old plugin cache then reinstall:
-- rm -rf ~/.local/share/nvim/lazy/nvim-treesitter
-- rm -rf ~/.local/share/nvim/lazy/nvim-treesitter-textobjects
-- Then open Neovim and run :Lazy restore
return { return {
{ "nvim-treesitter/nvim-treesitter",
"nvim-treesitter/nvim-treesitter", branch = "master", -- FIXME: switch to main sometime
branch = "main", lazy = false,
lazy = false, build = ":TSUpdate",
build = ":TSUpdate", event = { "BufReadPre", "BufNewFile" },
enabled = true, enabled = true,
config = function() dependencies = {
require("nvim-treesitter") "nvim-treesitter/nvim-treesitter-textobjects",
.install({
"lua",
"comment", -- used for TODO:, FIXME:, XXX: and NOTE:
"vim",
"vimdoc",
"bash",
"diff",
"make",
"gitignore",
"gitcommit",
"markdown",
"markdown_inline",
"rst",
"latex",
"elixir",
"eex",
"heex",
"yaml",
"html",
"css",
"javascript",
"dockerfile",
"query",
"hcl",
"terraform",
"bicep",
"csv",
"properties",
"ini",
"python",
"regex",
"json",
"go",
"gomod",
"gosum",
"editorconfig",
"http",
"toml",
"sql",
"promql",
"nginx",
"powershell",
})
:wait(300000) -- wait max. 5 min
-- Highlight & indent are built into Neovim 0.11+
vim.api.nvim_create_autocmd("FileType", {
callback = function()
if pcall(vim.treesitter.start) then
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
end
end,
})
-- Incremental node selection (Neovim 0.12+, see :help v_an v_in)
-- Built-in: an = expand to parent, in = shrink to child
-- mini.ai's `an`/`in` next/last mappings must be disabled (see mini.lua)
vim.keymap.set("n", "<C-s>", "van", { desc = "Treesitter: init selection", remap = true })
vim.keymap.set("v", "<C-s>", "an", { desc = "Treesitter: expand selection", remap = true })
vim.keymap.set("v", "<bs>", "in", { desc = "Treesitter: shrink selection", remap = true })
end,
}, },
config = function()
local treesitter = require("nvim-treesitter.configs")
treesitter.setup({
highlight = { enable = true },
indent = { enable = true },
auto_install = false,
-- language list: https://github.com/nvim-treesitter/nvim-treesitter#supported-languages
ensure_installed = {
"lua",
"comment", -- used for TODO:, FIXME:, XXX: and NOTE:
"vim",
"vimdoc",
"bash",
"diff",
"make",
"gitignore",
"gitcommit",
"markdown",
"markdown_inline",
"rst",
"latex",
"elixir",
"eex",
"heex",
"yaml",
"html",
"css",
"javascript",
"dockerfile",
"query",
"hcl",
"terraform",
"bicep",
"csv",
"properties",
"ini",
"python",
"regex",
"json",
"go",
"gomod",
"gosum",
"editorconfig",
"http",
"toml",
"sql",
"promql",
"nginx",
"powershell",
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<C-s>",
node_incremental = "<C-s>",
scope_incremental = false,
node_decremental = "<bs>",
},
},
})
end,
} }

View file

@ -8,11 +8,6 @@ return {
open_no_results = true, open_no_results = true,
auto_close = true, auto_close = true,
indent_guides = false, indent_guides = false,
win = {
wo = {
colorcolumn = "",
},
},
}, },
keys = { keys = {
-- TODO: add more keymaps -- TODO: add more keymaps

View file

@ -6,6 +6,8 @@ vim.lsp.enable({
"yaml", "yaml",
"ansible", "ansible",
"marksman", "marksman",
"write-good",
-- "woke", -- permission issues with macOS .Trash
"tailwind", "tailwind",
"docker-compose", "docker-compose",
"bicep", "bicep",
@ -58,8 +60,7 @@ vim.opt.colorcolumn = "80,120"
vim.opt.scrolloff = 5 vim.opt.scrolloff = 5
-- Highlight current line -- Highlight current line
vim.opt.cursorline = false vim.opt.cursorline = true
-- vim.opt.cursorlineopt = "number"
-- Blink cursor in normal mode -- Blink cursor in normal mode
--vim.opt.guicursor = 'n:blinkon300-blinkwait200-blinkoff300' --vim.opt.guicursor = 'n:blinkon300-blinkwait200-blinkoff300'
@ -70,8 +71,7 @@ vim.opt.wrap = false
vim.opt.termguicolors = true vim.opt.termguicolors = true
-- Themes: -- Themes:
-- vim.cmd.colorscheme("rose-pine") -- vim.cmd.colorscheme("rose-pine")
-- vim.cmd.colorscheme("kanso") vim.cmd.colorscheme("kanso")
vim.cmd.colorscheme("soviet-dark")
-- vim.opt.background = "light" -- light, dark -- vim.opt.background = "light" -- light, dark
-- Decrease update time -- Decrease update time

View file

@ -32,7 +32,8 @@ vim.keymap.set(
) )
-- todo-comments.nvim -- todo-comments.nvim
vim.keymap.set("n", "<leader>ft", ":Trouble todo<CR>", { noremap = true, desc = "Find TODOs" }) -- NOTE: this one is a bit hard to migrate away from Telescope to mini.nvim
vim.keymap.set("n", "<leader>ft", ":TodoTelescope<CR>", { noremap = true, desc = "Find TODOs" })
-- Git things -- Git things
vim.keymap.set("n", "<leader>gla", ":Pick git_commits<CR>", { noremap = true, desc = "Git log (all files)" }) vim.keymap.set("n", "<leader>gla", ":Pick git_commits<CR>", { noremap = true, desc = "Git log (all files)" })
@ -47,7 +48,6 @@ end, { noremap = true, desc = "Git diff/stage" })
vim.keymap.set("n", "<leader>gb", ":Gitsigns toggle_current_line_blame<CR>", { noremap = true, desc = "Git blame" }) vim.keymap.set("n", "<leader>gb", ":Gitsigns toggle_current_line_blame<CR>", { noremap = true, desc = "Git blame" })
vim.keymap.set("n", "<leader>gg", ":Gitsigns preview_hunk<CR>", { noremap = true, desc = "Preview git hunk" }) vim.keymap.set("n", "<leader>gg", ":Gitsigns preview_hunk<CR>", { noremap = true, desc = "Preview git hunk" })
vim.keymap.set("n", "<leader>gs", ":Gitsigns stage_hunk<CR>", { noremap = true, desc = "Stage hunk" }) vim.keymap.set("n", "<leader>gs", ":Gitsigns stage_hunk<CR>", { noremap = true, desc = "Stage hunk" })
vim.keymap.set("n", "<leader>gS", ":Gitsigns stage_buffer<CR>", { noremap = true, desc = "Stage buffer" })
vim.keymap.set("n", "<leader>gb", ":Gitsigns blame<CR>", { noremap = true, desc = "Blame" }) vim.keymap.set("n", "<leader>gb", ":Gitsigns blame<CR>", { noremap = true, desc = "Blame" })
vim.keymap.set("n", "<leader>gp", ":Gitsigns prev_hunk<CR>", { noremap = true, desc = "Previous hunk" }) vim.keymap.set("n", "<leader>gp", ":Gitsigns prev_hunk<CR>", { noremap = true, desc = "Previous hunk" })
vim.keymap.set("n", "<leader>gn", ":Gitsigns next_hunk<CR>", { noremap = true, desc = "Next hunk" }) vim.keymap.set("n", "<leader>gn", ":Gitsigns next_hunk<CR>", { noremap = true, desc = "Next hunk" })