Haha, get it ... get it?
Welcome to my neovim setup. This isn't really intended for other people to use, it's more something that you can look through and take ideas from. This is what it generally looks like ^
├── after
│ ├── ftplugin
│ └── queries
├── ftplugin
├── lua
│ ├── benlubas
│ │ ├── telescope # custom telescope layouts
│ │ ├── hydra # hydras that are loaded with other plugins
│ │ ├── set.lua # setting vim options
│ │ ├── remap.lua # keymaps
│ │ └── ... others # other various code
│ ├── plugins # lazy plugin specs
│ └── snippets # luasnip snippets
├── data # I keep telescope sources here
├── templates # neorg templates
└── init.lua # entry point
Categorized somewhat arbitrarily:
Theme and Visual Elements
No borders (or invisible looking borders) on floating windows unless they need a title, Molten floats are the exception.
- bluz71/vim-moonfly-colors
- I've customized a lot of plugin highlights myself
- I also use this theme in my terminal, and tmux bar
- MunifTanjim/nougat.nvim
- status line (fixed to the bottom) I don't use a window or tab line
- luukvbaal/statuscol.nvim
- easy status column customization
- kevinhwang91/nvim-ufo
- lukas-reineke/headlines.nvim
- lukas-reineke/indent-blankline.nvim
- benlubas/neoscroll.nvim
- my own fork that merged the time scaling PR and adds an on/off switch that I use in bigfile
- folke/which-key.nvim
- folke/todo-comments.nvim
I have a noice config in here too, but I don't currently use it. It's caused too many problems and I'm not able to configure it quite the way that I want to, but I'm definitely keeping my eye on it.
Base - simple but powerful plugins
- kylechui/nvim-surround
- Custom surround for markdown links
- numToStr/Comment.nvim
- benlubas/auto-save.nvim
- mbbill/undotree
- LunarVim/bigfile.nvim
- with custom config to disable neoscroll
- max397574/better-escape.nvim
- benlubas/wrapping-paper.nvim
- ruifm/gitlinker.nvim
- lewis6991/gitsigns.nvim
- stevearc/oil.nvim "simple plugins"
Auto Completion and Snippets
- benlubas/nvim-cmp
- I use my own fork of nvim-cmp that adds two features:
- Select-nth item; used for mapping
<A-n>
to select thenth
item in the completion menu. - Numbering the options; aid for the
<A-n>
keybinds
- Select-nth item; used for mapping
- There's a branch called
up_to_date
that I sync with upstream every few months if you'd like to use this feature as well, and here's the PR to add this functionality to cmp.
- I use my own fork of nvim-cmp that adds two features:
- L3MON4D3/LuaSnip
- custom snippets in lua/snippets/, there are a lot of react test library snippets and some other random ones
- windwp/nvim-autopairs
Completion sources:
Jupyter Notebook Workflow
- GCBallesteros/jupytext.nvim
- benlubas/molten-nvim
- this plugin is amazing btw. go check it out
- 3rd/image.nvim
- quarto-dev/quarto-nvim
- jmbuhr/otter.nvim
This setup is documented in the molten-nvim docs and lets me:
- open
.ipynb
files like normal, they're displayed as plaintext, outputs are loaded automatically and shown, including images - run code cell by cell, and view and interact with output in editor (again including images)
- easily add new cells, delete them, move them around
:w
to save to.ipynb
format with output chunks saved as well
Telescope
All of my telescope pickers make use of telescope.nvim#2572, opting for custom layouts using MunifTanjim/nui.nvim instead of using builtin telescope themes. Layouts are located at /lua/benlubas/telescope/layouts.
-
default: the default layout that's used for all of my file pickers
-
ivy: a custom ivy-like layout that sits at the bottom of the screen. Used for tmux-sessionizer
-
spelling: a tiny little window used for spelling suggestions, positioned to match the start of the word so that spelling suggestions line up as if you were seeing completion menu suggestions
I have mappings for all the normal ones, like project files, current buf fuzzy find, etc. I have custom pickers (located here /lua/benlubas/telescope/) for:
- Importing Harpoon marks that were used on other branches
- Switching between workspaces with tmux and tmux-sessionizer (a bash script that's also in these dotfiles)
I also have a custom action that lets me harpoon a file from the telescope results page with <c-s>
Harpoon
I use a fork that enables some better highlights, and git branch caching, as I use git branch specific keys, and fetching them on an M2 Mac is slow enough to be noticeable.
Integrations:
- custom picker in telescope for importing marks from other branches
- custom telescope action to mark files
- custom keybind in oil to mark files
I'll switch to harpoon 2 when it's more feature complete
Treesitter and related
- nvim-treesitter/nvim-treesitter-textobjects
- I make heavy use of these in my notebook workflow, and just in general this plugin is awesome
- JoosepAlviste/nvim-ts-context-commentstring
- Wansmer/treesj
- windwp/nvim-ts-autotag
- benlubas/nvim-treesitter-context
- Fork that hackily adds back the collapsing context nodes into one line. It doesn't have syntax highlighting b/c that is a lot of work, and I want to keep this as compatible as possible with upstream (even though it would not get accepted in its current state)
- chrisgrieser/nvim-various-textobjs
- The
subword
text object is a must have
- The
Hydras
I have a few hydras:
- Telescope
<leader>f
just a fancy way to see my telescope binds - Options
<leader><leader>o
easily change common options - Windows
<C-w>
easily repeat window navigation, movement, resize actions - Quarto Navigator
<localleader>j
quickly move around markdown notebooks and run code
Firenvim
I have configuration for firenvim, which makes it easier to
edit markdown for web fields. TL;DR: textwidth off, wrap on. These slightly altered settings are
also used for editing prs and issues with gh
IDE type stuff
This stuff is great when I need to use it. But it mostly just sits there.
Best dap configuration option:
vim.fn.sign_define("DapBreakpoint", { text = "ඞ", texthl = "DapBreakpoint", numhl = "DapBreakpoint" })
View `:messages` in a buffer
You can view the output of :messages
in a floating buffer with M
or :M
. The function that does this
is exposed as :lua B()
and you can use it like :lua B("highlight")
to see the output of the
highlight command in a buffer (doesn't support highlighting though, ironically)
Search count
I have an in house solution for the search count problem. By default, /
to search will only show
[n/99]
items. This is a royal pain for when I just want to count the number of times something
shows up in a file, so I have written this. I put the search
count in my status line when there's an active search.
Yank to clipboard cleans leading whitespace
I can't think of the last time I've wanted to copy code to my clipboard and preserve the leading whitespace. So I wrote a function that removes it. code and usage
Remove duplicates from lsp go to definition
I use a custom go to definition handler from @ seblj which removes results that are on the same line as each other (luals does this a lot).