feat: remove Telescope, fzf etc.
This commit is contained in:
parent
43cc241969
commit
03f3fba798
6 changed files with 92 additions and 153 deletions
149
README.md
149
README.md
|
|
@ -5,22 +5,35 @@
|
|||
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
|
||||
better understand Neovim and its configuration/customization, package managers,
|
||||
plugins etc. and have "my own" config that only includes things I really need.
|
||||
plugins etc. and have my own config that only includes parts I need.
|
||||
More on the "why's" are explained [in my blog post](https://lugh.ch/neovim-lessons-learned.html).
|
||||
|
||||
## Installation
|
||||
|
||||
1. Install Neovim 0.10. or newer
|
||||
1. Install Neovim 0.12 or newer
|
||||
1. Install the dependencies documented in `init.lua`
|
||||
1. Clone this Git repository to
|
||||
1. `~/.config/nvim` on macOS or Linux
|
||||
1. `c:\Users\foobar\AppData\Local\nvim` when on Windows
|
||||
1. `c:\Users\foobar\AppData\Local\nvim` on Windows
|
||||
|
||||
### Finishing touches
|
||||
|
||||
- Create a `$HOME/.ignore` file and add big, useless directories to it, so
|
||||
Telescope/ripgrep/fd can ignore those. My current list of files/directories is
|
||||
available in `lua/weeheavy/plugins/telescope-fzf-native.lua`
|
||||
ripgrep, fd can ignore those. Ideas:
|
||||
```
|
||||
Pictures/
|
||||
Music/
|
||||
Applications/
|
||||
dotnet/
|
||||
opt/miniconda3/
|
||||
Library/
|
||||
.cache/
|
||||
.vscode/
|
||||
.git/
|
||||
.local/
|
||||
.m2/
|
||||
.npm/
|
||||
```
|
||||
- Install Mason LSP/linter/formatters from the table down below
|
||||
|
||||
## Speed
|
||||
|
|
@ -29,52 +42,55 @@ It's not too important. Still, I try to balance increasing startup time with
|
|||
the usefullness of a plugin.
|
||||
|
||||
Output from lazy.nvim profiling (`:Lazy profile`) on a MacBook Pro M2 Max,
|
||||
macOS 15 on Neovim 0.11.0.
|
||||
macOS 15 on Neovim 0.12.0.
|
||||
|
||||
### Start and open init.lua
|
||||
|
||||
Around 15% of the plugins are lazy-loaded.
|
||||
|
||||
```bash
|
||||
LazyStart 18.67ms
|
||||
LazyDone 43.52ms (+24.85ms)
|
||||
UIEnter 110.71ms (+67.19ms)
|
||||
LazyStart 12.28ms
|
||||
LazyDone 61.96ms (+49.68ms)
|
||||
UIEnter 122.07ms (+60.11ms)
|
||||
```
|
||||
|
||||
### Starting with an empty file
|
||||
### Starting without a file
|
||||
|
||||
Around 50% of the plugins are lazy-loaded.
|
||||
Around 45% of the plugins are lazy-loaded.
|
||||
|
||||
```bash
|
||||
LazyStart 18.15ms
|
||||
LazyDone 46.91ms (+28.76ms)
|
||||
UIEnter 59.08ms (+12.17ms)
|
||||
LazyStart 13.51ms
|
||||
LazyDone 64.8ms (+51.29ms)
|
||||
UIEnter 84.97ms (+20.17ms)
|
||||
```
|
||||
|
||||
## Plugins
|
||||
|
||||
| Name | Purpose | URL |
|
||||
| ------------------------------- | ----------------------------------------------------------------------- | ---------------------------------------------------------------- |
|
||||
| **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> |
|
||||
| **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> |
|
||||
| **rose-pine** | Theme | <https://github.com/rose-pine/neovim> |
|
||||
| **lualine.nvim** | Status line | <https://github.com/nvim-lualine/lualine.nvim> |
|
||||
| **gitsigns.nvim** | Git change indicator | <https://github.com/lewis6991/gitsigns.nvim> |
|
||||
| **which-key.nvim** | Shows contextual key bindings | <https://github.com/folke/which-key.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> |
|
||||
| **todo-comments.nvim** | Highlights `NOTE:`, `FIXME:` etc. and makes them findable via Telescope | <https://github.com/folke/todo-comments.nvim> |
|
||||
| **mini.nvim** | I use the icons | <https://github.com/echasnovski/mini.nvim> |
|
||||
| **flash.nvim** | Navigation and Treesitter selection w/ search labels | <https://github.com/folke/flash.nvim> |
|
||||
| **nvim-lint** | Narrow-scope linter plugin to use via Neovim diagnostic framework | <https://github.com/mfussenegger/nvim-lint> |
|
||||
| **snipe.nvim** | Buffer navigation | <https://github.com/leath-dub/snipe.nvim> |
|
||||
| **blink.cmp** | Fuzzy code completion | <https://github.com/Saghen/blink.cmp> |
|
||||
| **diffview.nvim** | Git diff viewer/stager | <https://github.com/sindrets/diffview.nvim> |
|
||||
| Name | Purpose | URL |
|
||||
| ------------------------------- | ----------------------------------------------------------------- | ---------------------------------------------------------------- |
|
||||
| **SchemaStore.nvim** | JSON schemas | <https://github.com/b0o/SchemaStore.nvim> |
|
||||
| **aerial.nvim** | Code outline | <https://github.com/stevearc/aerial.nvim> |
|
||||
| **blink.cmp** | Fuzzy code completion | <https://github.com/Saghen/blink.cmp> |
|
||||
| **ccc.nvim** | Color picker/color highlight | <https://github.com/uga-rosa/ccc.nvim> |
|
||||
| **conform.nvim** | Formatter configuration, replacement for `null-ls` | <https://github.com/stevearc/conform.nvim> |
|
||||
| **diffview.nvim** | Git diff viewer/stager | <https://github.com/sindrets/diffview.nvim> |
|
||||
| **flash.nvim** | Navigation and Treesitter selection w/ search labels | <https://github.com/folke/flash.nvim> |
|
||||
| **gitsigns.nvim** | Git change indicator | <https://github.com/lewis6991/gitsigns.nvim> |
|
||||
| **kanso** | Theme | <https://github.com/webhooked/kanso.nvim> |
|
||||
| **lazy.nvim** | Package manager | <https://github.com/folke/lazy.nvim> |
|
||||
| **lualine.nvim** | Status line | <https://github.com/nvim-lualine/lualine.nvim> |
|
||||
| **mason.nvim** | Install/manage LSP/DAP servers, linters and formatters | <https://github.com/williamboman/mason.nvim> |
|
||||
| **mini.nvim** | Picker, icons, show trailing whitespace, textobject nav | <https://github.com/echasnovski/mini.nvim> |
|
||||
| **nvim-lint** | Narrow-scope linter plugin to use via Neovim diagnostic framework | <https://github.com/mfussenegger/nvim-lint> |
|
||||
| **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> |
|
||||
| **rose-pine** | Theme | <https://github.com/rose-pine/neovim> |
|
||||
| **snipe.nvim** | Buffer navigation | <https://github.com/leath-dub/snipe.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
|
||||
|
||||
|
|
@ -85,32 +101,42 @@ This is how it looks like:
|
|||
## 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`.
|
||||
support more languages than I document in the "Language" column. The formatters
|
||||
installed through Mason are then configured in `conform.nvim`.
|
||||
|
||||
| Type | Language | Name | Benefits | Issues |
|
||||
| --------- | ------------------ | --------------------------- | ------------------------------------------------ | ----------------------------------------------------- |
|
||||
| LSP | Markdown | **marksman** | Autocompletes links | <https://github.com/artempyanykh/marksman/issues/327> |
|
||||
| LSP | Go | **gopls** | | n/a |
|
||||
| LSP | Terraform/OpenTofu | **terraform-ls** | | n/a |
|
||||
| LSP | Terraform/OpenTofu | **tflint** | | n/a |
|
||||
| LSP | Ansible | **ansible-language-server** | Ansible knowhow | Search _yaml.ansible_ in `prefs.lua` |
|
||||
| LSP | Bash | **bash-language-server** | Incorporates ShellCheck | n/a |
|
||||
| LSP | YAML | **yaml-language-server** | | n/a |
|
||||
| Linter | Ansible | **ansible-lint** | | yamllint vs. ansible-lint |
|
||||
| Linter | YAML | **yamllint** | | yamllint vs. ansible-lint |
|
||||
| Linter | Terraform/OpenTofu | **tflint** | | |
|
||||
| Linter | any | **woke** | Makes you aware of woke language | |
|
||||
| Linter | Git commits | **commitlint** | Ensure to adhere to _Conventional Commit_ format | |
|
||||
| Linter | JSON | **jsonlint** | | |
|
||||
| Linter | Text | **proselint** | See [source][prose] | |
|
||||
| Linter | Text | **write-good** | See [source][writegood] | |
|
||||
| Formatter | Markdown, YAML | **prettier** | Markdown table formatting | n/a |
|
||||
| Formatter | Lua | **stylua** | Formats Lua | n/a |
|
||||
| Formatter | Bash | **shfmt** | Formats Bash scripts | n/a |
|
||||
| Formatter | HCL | **hclfmt** | For HashiCorp configuration language | |
|
||||
| Formatter | many | **prettier** | See [docs][prettier] | |
|
||||
| Formatter | YAML | **yamlfmt** | | |
|
||||
| Type | Language | Name | Benefits | Issues |
|
||||
| --------- | ------------------ | ----------------------------------- | ----------------------- | --------------------------------- |
|
||||
| Formatter | YAML | **yamlfmt** | | |
|
||||
| Formatter | many | **prettier** | See [docs][prettier] | |
|
||||
| Formatter | Python | **isort** | Sorts imports | |
|
||||
| Formatter | Python | **ruff** | | |
|
||||
| Formatter | TOML | **taplo** | | |
|
||||
| Formatter | Lua | **stylua** | | |
|
||||
| LSP | Ansible | **ansible-language-server** | Ansible knowhow | See _yaml.ansible_ in `prefs.lua` |
|
||||
| LSP | Bash | **bash-language-server** | Incorporates ShellCheck | |
|
||||
| LSP | Go | **gopls** | | |
|
||||
| LSP | Markdown | **marksman** | Autocompletes links | [issues/327][marksmanbug] |
|
||||
| LSP | Docker Compose | **docker-compose-language-service** | | |
|
||||
| LSP | Docker | **dockerfile-language-server** | | |
|
||||
| LSP | HTML | **html-lsp** | | |
|
||||
| LSP | JSON | **json-lsp** | | |
|
||||
| LSP | Python | **ruff** | | |
|
||||
| LSP | Lua | **stylua** | | |
|
||||
| LSP | CSS | **tailwindcss-language-server** | | |
|
||||
| LSP | TOML | **taplo** | | |
|
||||
| LSP | Terraform/OpenTofu | **tflint** | | |
|
||||
| LSP | Terraform/OpenTofu | **terraform-ls** | HashiCorp | |
|
||||
| LSP | YAML | **yaml-language-server** | | |
|
||||
| Linter | Ansible | **ansible-lint** | | yamllint vs. ansible-lint |
|
||||
| Linter | Git commits | **commitlint** | _Conventional Commits_ | |
|
||||
| Linter | JSON | **jsonlint** | | |
|
||||
| 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** | | |
|
||||
| Linter | Python | **ruff** | | |
|
||||
| Linter | Bash | **shellcheck** | | |
|
||||
|
||||
## Key bindings
|
||||
|
||||
|
|
@ -127,3 +153,4 @@ See [CHEATSHEET](CHEATSHEET.md)
|
|||
[prettier]: https://prettier.io/docs/
|
||||
[prose]: https://github.com/amperser/proselint
|
||||
[writegood]: https://github.com/btford/write-good?tab=readme-ov-file#checks
|
||||
[marksmanbug]: https://github.com/artempyanykh/marksman/issues/327
|
||||
|
|
|
|||
14
init.lua
14
init.lua
|
|
@ -5,31 +5,21 @@ Later on, switched to native LSP setup with the help of
|
|||
https://gpanders.com/blog/whats-new-in-neovim-0-11/
|
||||
|
||||
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)
|
||||
- tree-sitter-cli (brew install <pkgname>)
|
||||
|
||||
NOTE: EXTERNAL DEPENDENCIES FREEBSD
|
||||
- cmake, ripgrep (pkg install <pkgname>)
|
||||
- cmake, tree-sitter-cli, ripgrep (pkg install <pkgname>)
|
||||
|
||||
NOTE: EXTERNAL DEPENDENCIES LINUX (Arch)
|
||||
- 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
|
||||
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)
|
||||
- nodejs-lts (used for npm to install prettier)
|
||||
- then run "npm i -g npm"
|
||||
- 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
|
||||
|
|
|
|||
|
|
@ -25,8 +25,6 @@
|
|||
"pomo.nvim": { "branch": "main", "commit": "7e06e5221d8d1e596a0ab29dd4d7fcee5f3cd05a" },
|
||||
"rose-pine": { "branch": "main", "commit": "9504524e5ed0e326534698f637f9d038ba4cd0ee" },
|
||||
"snipe.nvim": { "branch": "main", "commit": "d2d196c335919767803f905d573ce66340e33ee6" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
--[[
|
||||
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'
|
||||
}
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
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,
|
||||
}
|
||||
|
|
@ -32,8 +32,7 @@ vim.keymap.set(
|
|||
)
|
||||
|
||||
-- todo-comments.nvim
|
||||
-- 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" })
|
||||
vim.keymap.set("n", "<leader>ft", ":Trouble todo<CR>", { noremap = true, desc = "Find TODOs" })
|
||||
|
||||
-- Git things
|
||||
vim.keymap.set("n", "<leader>gla", ":Pick git_commits<CR>", { noremap = true, desc = "Git log (all files)" })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue