moar plugins

This commit is contained in:
Christoph J. Scherr 2024-01-20 03:03:39 +01:00
parent 84509df6a0
commit 9281537c59
Signed by: PlexSheep
GPG Key ID: 7CDD0B14851A08EF
5 changed files with 316 additions and 161 deletions

View File

@ -10,7 +10,7 @@ opt.spelllang = "en,de"
opt.clipboard = "" -- don't just use the system clipboard
opt.wrap = false
opt.breakindent = false
opt.spell = true
opt.spell = false
opt.list = true
opt.conceallevel = 2
opt.undofile = true
@ -33,9 +33,9 @@ opt.shiftround = true -- Round indent to multiple of 'shiftwidth'
-- Timing
-- ===
opt.ttimeout = true
opt.timeoutlen = 500 -- Time out on mappings
opt.ttimeoutlen = 10 -- Time out on key codes
opt.updatetime = 500 -- Idle time to write swap and trigger CursorHold
opt.timeoutlen = 500 -- Time out on mappings
opt.ttimeoutlen = 10 -- Time out on key codes
opt.updatetime = 500 -- Idle time to write swap and trigger CursorHold
-- Searching
-- ===
@ -47,14 +47,14 @@ opt.incsearch = true -- Incremental search
-- Formatting
-- ===
opt.wrap = false -- No wrap by default
opt.linebreak = true -- Break long lines at 'breakat'
opt.breakat = '\\ \\ ;:,!?' -- Long lines break chars
opt.startofline = false -- Cursor in same column for few commands
opt.splitbelow = true -- Splits open bottom right
opt.wrap = false -- No wrap by default
opt.linebreak = true -- Break long lines at 'breakat'
opt.breakat = '\\ \\ ;:,!?' -- Long lines break chars
opt.startofline = false -- Cursor in same column for few commands
opt.splitbelow = true -- Splits open bottom right
opt.splitright = true
opt.breakindentopt = { shift = 2, min = 20 }
opt.formatoptions = "cqanlmBjp" -- see :h fo-table & :h formatoptions
opt.formatoptions = "qnlmBjp" -- see :h fo-table & :h formatoptions
-- Diff
-- ===
@ -67,69 +67,78 @@ opt.wildmode = 'longest:full,full' -- Command-line completion mode
opt.termguicolors = true
opt.shortmess = "xsTOInfFitloCaAs"
opt.showmode = true -- Show mode in cmd window
opt.scrolloff = 2 -- Keep at least n lines above/below
opt.sidescrolloff = 0 -- Keep at least n lines left/right
opt.numberwidth = 2 -- Minimum number of columns to use for the line number
opt.number = true -- Show line numbers
opt.ruler = false -- Default status ruler
opt.list = true -- Show hidden characters
opt.showmode = true -- Show mode in cmd window
opt.scrolloff = 2 -- Keep at least n lines above/below
opt.sidescrolloff = 0 -- Keep at least n lines left/right
opt.numberwidth = 2 -- Minimum number of columns to use for the line number
opt.number = true -- Show line numbers
opt.ruler = false -- Default status ruler
opt.list = true -- Show hidden characters
if vim.g.started_by_firenvim == false then
opt.showtabline = 3 -- Always show the tabs line
opt.laststatus = 3 -- Always show laststatus
opt.showtabline = 3 -- Always show the tabs line
opt.laststatus = 3 -- Always show laststatus
else
opt.showtabline = 1 -- Don't show tabline in firenvim, unless multitab
opt.laststatus = 3 -- Don't show laststatus in firenvim
opt.showtabline = 1 -- Don't show tabline in firenvim, unless multitab
opt.laststatus = 3 -- Don't show laststatus in firenvim
end
opt.helpheight = 0 -- Disable help window resizing
opt.winwidth = 30 -- Minimum width for active window
opt.winminwidth = 1 -- Minimum width for inactive windows
opt.winheight = 1 -- Minimum height for active window
opt.winminheight = 1 -- Minimum height for inactive window
opt.helpheight = 0 -- Disable help window resizing
opt.winwidth = 30 -- Minimum width for active window
opt.winminwidth = 1 -- Minimum width for inactive windows
opt.winheight = 1 -- Minimum height for active window
opt.winminheight = 1 -- Minimum height for inactive window
opt.showcmd = false -- show command in status line
opt.showcmd = false -- show command in status line
opt.cmdheight = 0
opt.cmdwinheight = 5 -- Command-line lines
opt.equalalways = true -- Resize windows on split or close
opt.colorcolumn = '+0' -- Column highlight at textwidth's max character-limit
opt.cmdwinheight = 5 -- Command-line lines
opt.equalalways = true -- Resize windows on split or close
opt.colorcolumn = '+0' -- Column highlight at textwidth's max character-limit
opt.cursorline = true
opt.cursorlineopt = { 'number', 'screenline' }
opt.pumheight = 10 -- Maximum number of items to show in the popup menu
opt.pumwidth = 10 -- Minimum width for the popup menu
opt.pumblend = 10 -- Popup blend
opt.pumheight = 10 -- Maximum number of items to show in the popup menu
opt.pumwidth = 10 -- Minimum width for the popup menu
opt.pumblend = 10 -- Popup blend
-- autocommands
-- ===
local function augroup(name)
return vim.api.nvim_create_augroup("plex_" .. name, {})
return vim.api.nvim_create_augroup("plex_" .. name, {})
end
-- highlight on yank
vim.api.nvim_create_autocmd("TextYankPost", {
group = augroup "highlight_yank",
callback = function()
vim.highlight.on_yank()
end,
group = augroup "highlight_yank",
callback = function()
vim.highlight.on_yank()
end,
})
-- Disable conceallevel for specific file-types.
vim.api.nvim_create_autocmd('FileType', {
group = augroup('fix_conceallevel'),
pattern = { 'latex', 'tex' },
callback = function()
vim.opt_local.conceallevel = 0
end,
group = augroup('fix_conceallevel'),
pattern = { 'latex', 'tex' },
callback = function()
vim.opt_local.conceallevel = 0
end,
})
-- Resize splits if window got resized
vim.api.nvim_create_autocmd('VimResized', {
group = augroup('resize_splits'),
callback = function()
vim.cmd('wincmd =')
end,
group = augroup('resize_splits'),
callback = function()
vim.cmd('wincmd =')
end,
})
-- Wrap and enable spell-checker in text filetypes
vim.api.nvim_create_autocmd('FileType', {
group = augroup('spell_conceal'),
pattern = { 'gitcommit', 'markdown', 'tex', 'latex', 'norg' },
callback = function()
vim.opt_local.spell = true
vim.opt_local.conceallevel = 0
end,
})

View File

@ -1,41 +1,44 @@
---@type MappingsTable
local M = {}
-- NOTE: The mappings here are case sensitive!!! Removing a specific default
-- mapping requires the same case here!
M.disabled = {
n = {
["<C-a>"] = "",
["<C-s>"] = "",
["<C-c>"] = "",
["<LEADER>n"] = "",
["<LEADER>rn"] = "",
["<UP>"] = "",
["<DOWN>"] = "",
["<LEADER>x"] = "",
["<LEADER>/"] = "",
["<LEADER>ra"] = "",
["<leader>n"] = "",
["<leader>rn"] = "",
["<Up>"] = "",
["<Down>"] = "",
["<leader>x"] = "",
["<leader>/"] = "",
["<leader>ra"] = "",
["[d"] = "",
["]d"] = "",
["[c"] = "",
["]c"] = "",
["<LEADER>h"] = "",
["<LEADER>ff"] = "",
["<LEADER>fm"] = "",
["<LEADER>fa"] = "",
["<LEADER>fw"] = "",
["<LEADER>fb"] = "",
["<LEADER>fh"] = "",
["<LEADER>fo"] = "",
["<LEADER>fz"] = "",
["<LEADER>cm"] = "",
["<LEADER>gt"] = "",
["<LEADER>pt"] = "",
["<LEADER>th"] = "",
["<LEADER>ma"] = "",
["<LEADER>v"] = "",
["<LEADER>rh"] = "",
["<LEADER>ph"] = "",
["<LEADER>gb"] = "",
["<LEADER>td"] = "",
["<leader>h"] = "",
["<leader>ff"] = "",
["<leader>fm"] = "",
["<leader>fa"] = "",
["<leader>fw"] = "",
["<leader>fb"] = "",
["<leader>fh"] = "",
["<leader>fo"] = "",
["<leader>fz"] = "",
["<leader>cm"] = "",
["<leader>gt"] = "",
["<leader>pt"] = "",
["<leader>th"] = "",
["<leader>ma"] = "",
["<leader>v"] = "",
["<leader>rh"] = "",
["<leader>ph"] = "",
["<leader>gb"] = "",
["<leader>td"] = "",
["<leader>wk"] = "",
["#"] = "",
["?"] = "",
},
@ -45,7 +48,7 @@ M.disabled = {
v = {
["#"] = "",
["?"] = "",
["<LEADER>/"] = "",
["<leader>/"] = "",
},
}
@ -54,7 +57,7 @@ M.tabufline = {
n = {
-- cycle through buffers
["<TAB>"] = {
["<Tab>"] = {
function()
require("nvchad.tabufline").tabuflineNext()
end,
@ -83,7 +86,7 @@ M.comment = {
-- toggle comment in both modes
n = {
["<LEADER>v"] = {
["<leader>v"] = {
function()
require("Comment.api").toggle.linewise.current()
end,
@ -92,8 +95,8 @@ M.comment = {
},
v = {
["<LEADER>v"] = {
"<ESC><CMD>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<CR>",
["<leader>v"] = {
"<esc><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>",
"Toggle comment",
},
},
@ -102,44 +105,44 @@ M.comment = {
M.leap = {
plugin = true,
n = {
["<LEADER>s"] = {
"<PLUG>(leap-forward)",
["<leader>s"] = {
"<plug>(leap-forward)",
"leap forward",
},
["<LEADER>S"] = {
"<PLUG>(leap-backward)",
["<leader>S"] = {
"<plug>(leap-backward)",
"leap backward",
},
["<LEADER>gs"] = {
"<PLUG>(leap-from-window)",
["<leader>gs"] = {
"<plug>(leap-from-window)",
"leap from window",
},
},
x = {
["<LEADER>s"] = {
"<PLUG>(leap-forward)",
["<leader>s"] = {
"<plug>(leap-forward)",
"leap forward",
},
["<LEADER>S"] = {
"<PLUG>(leap-backward)",
["<leader>S"] = {
"<plug>(leap-backward)",
"leap forward",
},
["<LEADER>gs"] = {
"<PLUG>(leap-from-window)",
["<leader>gs"] = {
"<plug>(leap-from-window)",
"leap from window",
},
},
o = {
["<LEADER>s"] = {
"<PLUG>(leap-forward)",
["<leader>s"] = {
"<plug>(leap-forward)",
"leap forward",
},
["<LEADER>S"] = {
"<PLUG>(leap-backward)",
["<leader>S"] = {
"<plug>(leap-backward)",
"leap forward",
},
["<LEADER>gs"] = {
"<PLUG>(leap-from-window)",
["<leader>gs"] = {
"<plug>(leap-from-window)",
"leap from window",
},
},
@ -148,21 +151,21 @@ M.leap = {
M.lazygit = {
plugin = true,
n = {
["<LEADER>gg"] = { "<CMD> LazyGit <CR>", "Open LazyGit" },
["<leader>gg"] = { "<cmd> LazyGit <cr>", "Open LazyGit" },
},
}
M.lspconfig = {
plugin = true,
n = {
["<LEADER>ck"] = {
["[d"] = {
function()
vim.diagnostic.goto_prev { float = { border = "rounded" } }
end,
"Goto prev",
},
["<LEADER>cj"] = {
["]d"] = {
function()
vim.diagnostic.goto_next { float = { border = "rounded" } }
end,
@ -174,14 +177,14 @@ M.lspconfig = {
M.clipboard = {
plugin = false,
n = {
["<LEADER>y"] = { '"+y', "yank to system" },
["<LEADER>Y"] = { '"+Y', "yank to system" },
["<LEADER>yy"] = { '"+y', "yank to system" },
["<leader>y"] = { '"+y', "yank to system" },
["<leader>Y"] = { '"+Y', "yank to system" },
["<leader>yy"] = { '"+y', "yank to system" },
},
v = {
["<LEADER>y"] = { '"+y', "yank to system" },
["<LEADER>Y"] = { '"+Y', "yank to system" },
["<LEADER>yy"] = { '"+y', "yank to system" },
["<leader>y"] = { '"+y', "yank to system" },
["<leader>Y"] = { '"+Y', "yank to system" },
["<leader>yy"] = { '"+y', "yank to system" },
},
}
@ -189,25 +192,25 @@ M.telescope = {
plugin = true,
n = {
-- find
["<LOCALLEADER>ff"] = { "<CMD> Telescope find_files <CR>", "Find files" },
["<LOCALLEADER>fa"] = { "<CMD> Telescope find_files follow=true no_ignore=true hidden=true <CR>", "Find all" },
["<LOCALLEADER>fw"] = { "<CMD> Telescope live_grep <CR>", "Live grep" },
["<LOCALLEADER>fb"] = { "<CMD> Telescope buffers <CR>", "Find buffers" },
["<LOCALLEADER>fh"] = { "<CMD> Telescope help_tags <CR>", "Help page" },
["<LOCALLEADER>fo"] = { "<CMD> Telescope oldfiles <CR>", "Find oldfiles" },
["<LOCALLEADER>fz"] = { "<CMD> Telescope current_buffer_fuzzy_find <CR>", "Find in current buffer" },
["<localleader>ff"] = { "<cmd> Telescope find_files <cr>", "Find files" },
["<localleader>fa"] = { "<cmd> Telescope find_files follow=true no_ignore=true hidden=true <cr>", "Find all" },
["<localleader>fw"] = { "<cmd> Telescope live_grep <cr>", "Live grep" },
["<localleader>fb"] = { "<cmd> Telescope buffers <cr>", "Find buffers" },
["<localleader>fh"] = { "<cmd> Telescope help_tags <cr>", "Help page" },
["<localleader>fo"] = { "<cmd> Telescope oldfiles <cr>", "Find oldfiles" },
["<localleader>fz"] = { "<cmd> Telescope current_buffer_fuzzy_find <cr>", "Find in current buffer" },
-- git
["<LOCALLEADER>cm"] = { "<CMD> Telescope git_commits <CR>", "Git commits" },
["<LOCALLEADER>gt"] = { "<CMD> Telescope git_status <CR>", "Git status" },
["<localleader>cm"] = { "<cmd> Telescope git_commits <cr>", "Git commits" },
["<localleader>gt"] = { "<cmd> Telescope git_status <cr>", "Git status" },
-- pick a hidden term
["<LOCALLEADER>pt"] = { "<CMD> Telescope terms <CR>", "Pick hidden term" },
["<localleader>pt"] = { "<cmd> Telescope terms <cr>", "Pick hidden term" },
-- theme switcher
["<LOCALLEADER>th"] = { "<CMD> Telescope themes <CR>", "Nvchad themes" },
["<localleader>th"] = { "<cmd> Telescope themes <cr>", "Nvchad themes" },
["<LOCALLEADER>ma"] = { "<CMD> Telescope marks <CR>", "telescope bookmarks" },
["<localleader>ma"] = { "<cmd> Telescope marks <cr>", "telescope bookmarks" },
},
}
@ -239,11 +242,11 @@ M.nvimtree = {
plugin = true,
n = {
-- toggle
["<C-n>"] = { "<CMD> NvimTreeToggle <CR>", "Toggle nvimtree" },
["<F5>"] = { "<CMD> NvimTreeToggle <CR>", "Toggle nvimtree" },
["<C-n>"] = { "<cmd> NvimTreeToggle <cr>", "Toggle nvimtree" },
["<F5>"] = { "<cmd> NvimTreeToggle <cr>", "Toggle nvimtree" },
-- focus
["<LOCALLEADER>e"] = { "<CMD> NvimTreeFocus <CR>", "Focus nvimtree" },
["<localleader>e"] = { "<cmd> NvimTreeFocus <cr>", "Focus nvimtree" },
},
}
@ -255,14 +258,14 @@ M.movements = {
["<A-j>"] = { "<C-d>", "big step down" },
-- go to beginning and end
["<C-b>"] = { "<HOME>", "Beginning of line" },
["<C-e>"] = { "<END>", "End of line" },
["<C-b>"] = { "<home>", "Beginning of line" },
["<C-e>"] = { "<end>", "End of line" },
-- navigate within insert mode
["<C-h>"] = { "<LEFT>", "Move left" },
["<C-l>"] = { "<RIGHT>", "Move right" },
["<C-j>"] = { "<DOWN>", "Move down" },
["<C-k>"] = { "<UP>", "Move up" },
["<C-h>"] = { "<left>", "Move left" },
["<C-l>"] = { "<right>", "Move right" },
["<C-j>"] = { "<down>", "Move down" },
["<C-k>"] = { "<up>", "Move up" },
},
n = {
--big move
@ -270,15 +273,15 @@ M.movements = {
["<A-j>"] = { "<C-d>", "big step down" },
-- go to beginning and end
["H"] = { "<HOME>", "Beginning of line" },
["L"] = { "<END>", "End of line" },
["H"] = { "<home>", "Beginning of line" },
["L"] = { "<end>", "End of line" },
-- go to mark with "#"
["#"] = { "'", "go to mark" },
-- spell
["zn"] = { "]s", "go to next spelling mark"},
["zN"] = { "[s", "go to last spelling mark"},
["]s"] = { "]s", "go to next spelling mark"},
["[s"] = { "[s", "go to last spelling mark"},
},
v = {
--big move
@ -286,8 +289,8 @@ M.movements = {
["<A-j>"] = { "<C-d>", "big step down" },
-- go to beginning and end
["H"] = { "<HOME>", "Beginning of line" },
["L"] = { "<END>", "End of line" },
["H"] = { "<home>", "Beginning of line" },
["L"] = { "<end>", "End of line" },
},
t = {
["<C-w>"] = {
@ -301,24 +304,24 @@ M.edit = {
plugin = false,
n = {
-- easy newline
["OO"] = { "O<ESC>", "insert a line above", opts = { nowait = false } },
["oo"] = { "o<ESC>", "insert a line below", opts = { nowait = false } },
["OO"] = { "O<esc>", "insert a line above", opts = { nowait = false } },
["oo"] = { "o<esc>", "insert a line below", opts = { nowait = false } },
-- split and join lines
-- "J" for join is defaul
["S"] = {
"i<CR><ESC>l",
"i<cr><esc>l",
"split line",
},
-- do something useful with the arrows
["<UP>"] = { "<CMD> move-2<CR>", "Move line up", opts = { expr = true } },
["<DOWN>"] = { "<CMD> move+<CR>", "Move line down", opts = { expr = true } },
["<LEFT>"] = { "<CMD> << <CR>", "Less indentation", opts = { expr = true } },
["<RIGHT>"] = { "<CMD> >> <CR>", "More indentation", opts = { expr = true } },
["<Up>"] = { "<cmd> move-2<cr>", "Move line up", opts = { expr = true } },
["<Down>"] = { "<cmd> move+<cr>", "Move line down", opts = { expr = true } },
["<Left>"] = { "<cmd> << <cr>", "Less indentation", opts = { expr = true } },
["<Right>"] = { "<cmd> >> <cr>", "More indentation", opts = { expr = true } },
-- format with conform
["<LEADER>ff"] = {
["<leader>ff"] = {
function()
require("conform").format()
end,
@ -326,7 +329,7 @@ M.edit = {
},
--
-- remove trailing whitespace
["<LEADER>fw"] = {
["<leader>fw"] = {
function()
require("mini.trailspace").trim()
end,
@ -334,12 +337,12 @@ M.edit = {
},
},
v = {
["<LEFT>"] = { "<gv", "Less indentation" },
["<RIGHT>"] = { ">gv", "More indentation" },
["<Left>"] = { "<gv", "Less indentation" },
["<Right>"] = { ">gv", "More indentation" },
},
x = {
["<UP>"] = { "move'<-2<CR>gv=gv", "Move line up", opts = { expr = true } },
["<DOWN>"] = { "move'<-2<CR>gv=gv", "Move line down", opts = { expr = true } },
["<Up>"] = { "move'<-2<cr>gv=gv", "Move line up", opts = { expr = true } },
["<Down>"] = { "move'<-2<cr>gv=gv", "Move line down", opts = { expr = true } },
},
t = {
--big move
@ -352,7 +355,7 @@ M.ui = {
plugin = false,
n = {
-- toggle wrap
["<LEADER>tw"] = {
["<leader>tw"] = {
function()
vim.opt_local.wrap = not vim.wo.wrap
vim.opt_local.breakindent = not vim.wo.breakindent
@ -367,28 +370,28 @@ M.ui = {
},
-- toggle some features
["<LEADER>tn"] = { "<CMD>setlocal nonumber!<CR>", "toggle line numbers" },
["<LEADER>trn"] = { "<CMD>setlocal nornu!<CR>", "toggle relative line numbers" },
["<LEADER>ts"] = { "<CMD>setlocal spell!<CR>", "toggle spell check" },
["<leader>tn"] = { "<cmd>setlocal nonumber!<cr>", "toggle line numbers" },
["<leader>trn"] = { "<cmd>setlocal nornu!<cr>", "toggle relative line numbers" },
["<leader>ts"] = { "<cmd>setlocal spell!<cr>", "toggle spell check" },
-- open windows
['<LEADER>"'] = { "<CMD>vsplit<CR>", "open a new window to the side" },
["<LEADER>%"] = { "<CMD>split<CR>", "open a new window on the totop" },
['<leader>"'] = { "<cmd>vsplit<cr>", "open a new window to the side" },
["<leader>%"] = { "<cmd>split<cr>", "open a new window on the totop" },
-- resize windows
["<C-Up>"] = { "<CMD>resize +1<CR>", "resize window" },
["<C-Down>"] = { "<CMD>resize -1<CR>", "resize window" },
["<C-Left>"] = { "<CMD>vertical resize +1<CR>", "resize window" },
["<C-Right>"] = { "<CMD>vertical resize -1<CR>", "resize window" },
["<C-Up>"] = { "<cmd>resize +1<cr>", "resize window" },
["<C-Down>"] = { "<cmd>resize -1<cr>", "resize window" },
["<C-Left>"] = { "<cmd>vertical resize +1<cr>", "resize window" },
["<C-Right>"] = { "<cmd>vertical resize -1<cr>", "resize window" },
-- tabs
["<LEADER>wtn"] = { "<CMD>tabnew<CR>", "open a new tab" },
["<LEADER>wtc"] = { "<CMD>tabclose<CR>", "close current tab" },
["<LEADER>wtj"] = { "<CMD>tabnext<CR>", "open a new tab" },
["<LEADER>wtk"] = { "<CMD>tabprevious<CR>", "open a new tab" },
["<leader>wn"] = { "<cmd>tabnew<cr>", "open a new tab" },
["<leader>wc"] = { "<cmd>tabclose<cr>", "close current tab" },
["<leader>wk"] = { "<cmd>tabnext<cr>", "go to next tab" },
["<leader>wj"] = { "<cmd>tabprevious<cr>", "go to prev tab" },
-- folds
["<S-RETURN>"] = { "zMzv", "focus on this fold" },
["<S-Return>"] = { "zMzv", "focus on this fold" },
},
}

View File

@ -84,8 +84,150 @@ local plugins = {
{
"folke/which-key.nvim",
keys = { "<leader>", "<localleader>", "<c-r>", "<c-w>", '"', "'", "`", "c", "v", "g" },
defaults = {
mode = { "n", "v" },
[";"] = { name = "+telescope" },
[";f"] = { name = "+find" },
[";d"] = { name = "+lsp/todo" },
["g"] = { name = "+goto" },
["]"] = { name = "+next" },
["["] = { name = "+prev" },
["<leader>x"] = { name = "+diagnostics/quickfix" },
["<leader>c"] = { name = "+code" },
["<leader>g"] = { name = "+git" },
["<leader>t"] = { name = "+toggle/tools" },
["<leader>w"] = { name = "+window/which" },
["<leader>f"] = { name = "+formatting" },
},
},
{ "echasnovski/mini.trailspace", lazy = false, event = { "BufReadPost", "BufNewFile" }, opts = {} },
{
"RRethy/vim-illuminate",
lazy = false,
event = { "BufReadPost", "BufNewFile" },
opts = {
delay = 200,
under_cursor = false,
modes_allowlist = { "n", "no", "nt" },
filetypes_denylist = {
"DiffviewFileHistory",
"DiffviewFiles",
"SidebarNvim",
"fugitive",
"git",
"minifiles",
"neo-tree",
},
},
keys = {
{ "]]", desc = "Next Reference" },
{ "[[", desc = "Prev Reference" },
},
config = function(_, opts)
require("illuminate").configure(opts)
local function map(key, dir, buffer)
vim.keymap.set("n", key, function()
require("illuminate")["goto_" .. dir .. "_reference"](false)
end, {
desc = dir:sub(1, 1):upper() .. dir:sub(2) .. " Reference",
buffer = buffer,
})
end
map("]]", "next")
map("[[", "prev")
-- also set it after loading ftplugins, since a lot overwrite [[ and ]]
vim.api.nvim_create_autocmd("FileType", {
group = vim.api.nvim_create_augroup("plex_illuminate", {}),
callback = function()
local buffer = vim.api.nvim_get_current_buf()
map("]]", "next", buffer)
map("[[", "prev", buffer)
end,
})
end,
},
{
"folke/todo-comments.nvim",
lazy = false,
dependencies = "nvim-telescope/telescope.nvim",
-- stylua: ignore
keys = {
{ ']t', function() require('todo-comments').jump_next() end, desc = 'Next todo comment' },
{ '[t', function() require('todo-comments').jump_prev() end, desc = 'Previous todo comment' },
{ '<LocalLeader>dt', '<cmd>TodoTelescope<CR>', desc = 'todo' },
{ '<leader>xt', '<cmd>TodoTrouble<CR>', desc = 'Todo (Trouble)' },
{ '<leader>xT', '<cmd>TodoTrouble keywords=TODO,FIX,FIXME<cr>', desc = 'Todo/Fix/Fixme (Trouble)' },
},
opts = {
signs = true,
keywords = {
FIX = {
icon = "", -- icon used for the sign, and in search results
color = "error", -- can be a hex color, or a named color (see below)
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
-- signs = false, -- configure signs for some keywords individually
},
TODO = { icon = "", color = "info" },
HACK = { icon = "", color = "warning" },
SECURITY = { icon = "󰒃 ", color = "warning" },
WARN = { icon = "", color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = "", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
NOTE = { icon = "", color = "hint", alt = { "INFO" } },
TEST = { icon = "", color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
},
},
},
{
"folke/trouble.nvim",
cmd = { "Trouble", "TroubleToggle" },
opts = { use_diagnostic_signs = true },
-- stylua: ignore
keys = {
{
'<leader>e',
'<cmd>TroubleToggle document_diagnostics<CR>',
noremap = true,
desc =
'Document Diagnostics'
},
{
'<leader>r',
'<cmd>TroubleToggle workspace_diagnostics<CR>',
noremap = true,
desc =
'Workspace Diagnostics'
},
{ '<leader>xx', '<cmd>TroubleToggle document_diagnostics<cr>', desc = 'Document Diagnostics (Trouble)' },
{ '<leader>xX', '<cmd>TroubleToggle workspace_diagnostics<cr>', desc = 'Workspace Diagnostics (Trouble)' },
{ '<leader>xQ', '<cmd>TroubleToggle quickfix<cr>', desc = 'Quickfix List (Trouble)' },
{ '<leader>xL', '<cmd>TroubleToggle loclist<cr>', desc = 'Location List (Trouble)' },
{
'[q',
function()
if require('trouble').is_open() then
require('trouble').previous({ skip_groups = true, jump = true })
else
vim.cmd.cprev()
end
end,
desc = 'Previous trouble/quickfix item',
},
{
']q',
function()
if require('trouble').is_open() then
require('trouble').next({ skip_groups = true, jump = true })
else
vim.cmd.cnext()
end
end,
desc = 'Next trouble/quickfix item',
},
},
},
}
return plugins

View File

@ -235,3 +235,4 @@ IDEs
hypervisors
QEMU
virt
filetypes

Binary file not shown.