A collection of plugins that were at some point sitting in my dotfiles.
require('myplugins').setup {
bigfile = {},
bufcomplete = {},
signature = {},
zoom = {}
-- Etc etc, format is <plugin_name> = { <plugin_configuration> }
}
Automatically disable stuff for large files
{
max_size = 1024 * 1024,
}
Bookmark files and lines using quickfix list.
{
name = 'Bookmarks', -- Name of the quickfix list
}
Best used with session
plugin with extra.quickfix = true
to automatically save and load quickfix lists (including bookmarks).
local bookmarks = require('myplugins.bookmarks')
vim.keymap.set('n', '<leader>jj', bookmarks.toggle_file)
vim.keymap.set('n', '<leader>jl', bookmarks.toggle_line)
vim.keymap.set('n', '<leader>jk', bookmarks.load)
vim.keymap.set('n', '<leader>jx', bookmarks.clear)
vim.keymap.set('n', ']j', function()
bookmarks.load()
vim.cmd('silent! cnext')
end)
vim.keymap.set('n', '[j', function()
bookmarks.load()
vim.cmd('silent! cprevious')
end)
LSP + treesitter autocompletion
Warning
Requires neovim 0.11.0+
{
entry_mapper = nil, -- Custom completion entry mapper
debounce_delay = 100,
}
For best completion experience:
vim.o.completeopt = 'menuone,noselect,noinsert,popup'
And you also ideally want to set the capabilities so Neovim will fetch documentation when resolving completion items:
-- Here we grab default Neovim capabilities and extend them with ones we want on top
local capabilities = vim.tbl_deep_extend('force',
vim.lsp.protocol.make_client_capabilities(),
require('autocomplete.capabilities')
)
-- Now set capabilities on your LSP servers
require('lspconfig')['<YOUR_LSP_SERVER>'].setup {
capabilities = capabilities
}
Command-line autocompletion
Warning
Requires neovim 0.11.0+
Automatically disable DiagnosticUnnecessary
highlighting for code under cursor.
DiffTool <left> <right>
command for integration with git difftool
and git difftool --dir-diff
.
{
rename = {
detect = true, -- whether to detect renames, can be slow on large directories so disable if needed
similarity = 0.5, -- minimum similarity for rename detection
max_size = 1024 * 1024, -- maximum file size for rename detection
},
highlight = {
A = 'DiffAdd', -- Added
D = 'DiffDelete', -- Deleted
M = 'DiffText', -- Modified
R = 'DiffChange', -- Renamed
},
}
Add this to your gitconfig
:
[diff]
tool = nvim_difftool
[difftool "nvim_difftool"]
cmd = nvim -c \"DiffTool $LOCAL $REMOTE\"
Simple plugin for running http files using httpyac
local http = require('myplugins.httpyac')
vim.keymap.set('n', '<leader>ho', http.toggle)
vim.keymap.set('n', '<leader>hh', http.run)
vim.keymap.set('n', '<leader>hH', http.run_all)
vim.keymap.set('n', '<leader>he', http.select_env)
Echo LSP progress to cmdline
{
echo = true, -- Echo progress messages, if set to false you can use .message() to get the current message
decay = 3000, -- Message decay time in milliseconds
interval = 100, -- Minimum time between echo updates in milliseconds
attach_log = false, -- Attach to logMessage and showMessage
}
Automatically changes working directory to project root.
{
dirs = {
'.git/',
'_darcs/',
'.hg/',
'.bzr/',
'.svn/',
'.editorconfig',
'.venv/',
'node_modules/',
'Makefile',
'CMakeLists.txt',
'.pylintrc',
'requirements.txt',
'setup.py',
'pyproject.toml',
'package.json',
'Cargo.toml',
'go.mod',
'mvnw',
'gradlew',
},
}
Automatically saves and restores session in predefined folders (default ~/git)
{
session_dir = vim.fn.stdpath('data') .. '/sessions/',
-- Directories where sessions are automatically saved
dirs = {
vim.fn.expand('~/git'),
},
-- Extra data to manage that is not normally saved in sessions
extra = {
quickfix = true, -- Save/load also quickfix lists
}
}
Automatically show function signature on cursor hover in insert mode.
{
debounce_delay = 100,
}
Undo tree visualization for fzf-lua
.
vim.keymap.set('n', '<leader>fu', require('myplugins.undotree').show)
Simple wiki/note-taking functionality using fzf-lua
.
{
dir = vim.fn.expand('~/vimwiki'),
}
local wiki = require('myplugins.wiki')
vim.keymap.set('n', '<leader>wt', wiki.today)
vim.keymap.set('n', '<leader>wd', wiki.list_diary)
vim.keymap.set('n', '<leader>ww', wiki.list_wiki)
vim.keymap.set('n', '<leader>wn', wiki.new)
Zoom in/out on the current window.
local zoom = require('myplugins.zoom')
vim.keymap.set('n', '<leader>z', zoom.toggle)