Compare commits

..

3 commits

12 changed files with 387 additions and 378 deletions

View file

@ -78,9 +78,11 @@
python312Packages.pylatexenc python312Packages.pylatexenc
fd fd
# lsps / formatters # lsps (minimal because should be provided per-project by nix)
lua-language-server
nixd nixd
tinymist
# formatters
nixfmt-rfc-style nixfmt-rfc-style
nodePackages_latest.prettier nodePackages_latest.prettier
taplo taplo
@ -89,7 +91,6 @@
black black
stylua stylua
marksman marksman
tinymist
]; ];
}; };
@ -139,7 +140,6 @@
nvim-autopairs nvim-autopairs
nvim-lspconfig nvim-lspconfig
intellitab-nvim intellitab-nvim
sleuth
which-key-nvim which-key-nvim
telescope-nvim telescope-nvim
markdown-preview-nvim markdown-preview-nvim
@ -188,7 +188,6 @@
"vim" "vim"
"vi" "vi"
]; ];
neovim-unwrapped = pkgs.neovim-unwrapped;
}; };
categories = { categories = {
general = true; general = true;
@ -223,12 +222,7 @@
devShells = { devShells = {
default = pkgs.mkShell { default = pkgs.mkShell {
name = defaultPackageName; name = defaultPackageName;
packages = [ defaultPackage ]; packages = [ defaultPackage ] ++ (with pkgs; [ lua-language-server ]);
inputsFrom = with pkgs; [
lua-language-server
stylua
];
shellHook = '''';
}; };
}; };

View file

@ -21,11 +21,11 @@ vim.opt.foldenable = false
vim.cmd.colorscheme("rose-pine") vim.cmd.colorscheme("rose-pine")
require('nvim-treesitter.configs').setup({ require("nvim-treesitter.configs").setup({
ensure_installed = {}, ensure_installed = {},
sync_install = false, sync_install = false,
auto_install = false, auto_install = false,
modules = {"highlight", "incremental_selection", "indent"}, modules = { "highlight", "incremental_selection", "indent" },
ignore_install = {}, ignore_install = {},
highlight = { enable = true }, highlight = { enable = true },
disable = function(_, buf) disable = function(_, buf)
@ -35,7 +35,16 @@ require('nvim-treesitter.configs').setup({
return true return true
end end
end, end,
additional_vim_regex_highlighting = false additional_vim_regex_highlighting = false,
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<CR>",
node_incremental = "<C-k>",
scope_incremental = "<BS>",
node_decremental = "<C-j>",
},
},
}) })
vim.api.nvim_create_autocmd({ vim.api.nvim_create_autocmd({
@ -49,6 +58,6 @@ vim.api.nvim_create_autocmd({
vim.api.nvim_create_autocmd("TextYankPost", { vim.api.nvim_create_autocmd("TextYankPost", {
callback = function() callback = function()
vim.highlight.on_yank {higroup='Visual', timeout=300} vim.highlight.on_yank({ higroup = "Visual", timeout = 300 })
end, end,
}) })

View file

@ -9,13 +9,6 @@ vim.keymap.set("t", "<C-Esc>", "<C-\\><C-n>")
vim.keymap.set("n", "<C-d>", "<C-d>zz") vim.keymap.set("n", "<C-d>", "<C-d>zz")
vim.keymap.set("n", "<C-u>", "<C-u>zz") vim.keymap.set("n", "<C-u>", "<C-u>zz")
vim.keymap.set("n", "<leader>mr", function()
vim.cmd.CellularAutomaton("make_it_rain")
end)
vim.keymap.set("n", "<leader>bruh", function()
vim.cmd.CellularAutomaton("game_of_life")
end)
-- when searching, also center screen and reopen folds -- when searching, also center screen and reopen folds
vim.keymap.set("n", "n", "nzzzv") vim.keymap.set("n", "n", "nzzzv")
vim.keymap.set("n", "N", "Nzzzv") vim.keymap.set("n", "N", "Nzzzv")
@ -29,33 +22,10 @@ vim.keymap.set({ "n", "v" }, "<leader>Y", '"+Y', { desc = "yank rest of line to
vim.keymap.set({ "n", "v" }, "<leader>p", '"+p', { desc = "put after cursor from clipboard" }) vim.keymap.set({ "n", "v" }, "<leader>p", '"+p', { desc = "put after cursor from clipboard" })
vim.keymap.set({ "n", "v" }, "<leader>P", '"+P', { desc = "put before cursor from clipboard" }) vim.keymap.set({ "n", "v" }, "<leader>P", '"+P', { desc = "put before cursor from clipboard" })
vim.keymap.set("n", "<leader>gg", function()
vim.cmd.Neogit()
end, { desc = "Open neogit" })
vim.keymap.set("n", "<leader>gc", function()
vim.cmd.Neogit("kind=floating commit")
end, { desc = "Open neogit commit menu" })
vim.keymap.set("n", "<leader>u", function()
vim.cmd.UndotreeToggle()
end, { desc = "Toggle undotree" })
vim.keymap.set({ "n", "v" }, "<leader>cf", function()
require("conform").format({ async = true })
end)
vim.keymap.set({ "n", "v" }, "<leader>ctf", function()
if vim.g.disable_autoformat then
vim.g.disable_autoformat = false
else
vim.g.disable_autoformat = true
end
end, { desc = "Disable autoformat on save globally" })
vim.keymap.set({ "n", "v" }, "<leader>cbf", function()
if vim.b[0].disable_autoformat then
vim.b[0].disable_autoformat = false
else
vim.b[0].disable_autoformat = true
end
end, { desc = "Disable autoformat on save buffer" })
vim.keymap.set("i", "<Tab>", require("scripts.intellitab").indent) vim.keymap.set("i", "<Tab>", require("scripts.intellitab").indent)
-- Allow increment/decrement repeatedly in visual
vim.keymap.set("v", "<C-a>", "<C-a>gv")
vim.keymap.set("v", "<C-x>", "<C-x>gv")
vim.keymap.set("v", "g<C-a>", "g<C-a>gv")
vim.keymap.set("v", "g<C-x>", "g<C-x>gv")

View file

@ -20,179 +20,6 @@ return {
snippet_forward = "<Tab>", snippet_forward = "<Tab>",
snippet_backward = "<S-Tab>", snippet_backward = "<S-Tab>",
}, },
accept = {
create_undo_point = true,
auto_brackets = {
enabled = false,
default_brackets = { "(", ")" },
override_brackets_for_filetypes = {},
-- Overrides the default blocked filetypes
force_allow_filetypes = {},
blocked_filetypes = {},
-- Synchronously use the kind of the item to determine if brackets should be added
kind_resolution = {
enabled = true,
blocked_filetypes = { "typescript", "typescriptreact", "javascript", "javascriptreact", "vue" },
},
-- Asynchronously use semantic token to determine if brackets should be added
semantic_token_resolution = {
enabled = true,
blocked_filetypes = {},
},
},
},
trigger = {
completion = {
-- regex used to get the text when fuzzy matching
-- changing this may break some sources, so please report if you run into issues
-- todo: shouldnt this also affect the accept command? should this also be per language?
keyword_regex = "[%w_\\-]",
-- LSPs can indicate when to show the completion window via trigger characters
-- however, some LSPs (*cough* tsserver *cough*) return characters that would essentially
-- always show the window. We block these by default
blocked_trigger_characters = { " ", "\n", "\t" },
-- when true, will show the completion window when the cursor comes after a trigger character when entering insert mode
show_on_insert_on_trigger_character = true,
},
signature_help = {
enabled = false,
blocked_trigger_characters = {},
blocked_retrigger_characters = {},
-- when true, will show the signature help window when the cursor comes after a trigger character when entering insert mode
show_on_insert_on_trigger_character = true,
},
},
fuzzy = {
-- frencency tracks the most recently/frequently used items and boosts the score of the item
use_frecency = true,
-- proximity bonus boosts the score of items with a value in the buffer
use_proximity = true,
max_items = 200,
-- controls which sorts to use and in which order, these three are currently the only allowed options
sorts = { "label", "kind", "score" },
prebuiltBinaries = {
-- Whether or not to automatically download a prebuilt binary from github. If this is set to `false`
-- you will need to manually build the fuzzy binary dependencies by running `cargo build --release`
download = false,
-- When downloading a prebuilt binary force the downloader to resolve this version. If this is uset
-- then the downloader will attempt to infer the version from the checked out git tag (if any).
--
-- Beware that if the FFI ABI changes while tracking main then this may result in blink breaking.
forceVersion = nil,
},
},
sources = {
-- similar to nvim-cmp's sources, but we point directly to the source's lua module
-- multiple groups can be provided, where it'll fallback to the next group if the previous
-- returns no completion items
-- WARN: This API will have breaking changes during the beta
providers = {
{
{ "blink.cmp.sources.lsp" },
{ "blink.cmp.sources.path" },
{ "blink.cmp.sources.snippets", score_offset = -3 },
},
{ { "blink.cmp.sources.buffer" } },
},
-- FOR REF: full example
providers = {
{
-- all of these properties work on every source
{
"blink.cmp.sources.lsp",
keyword_length = 0,
score_offset = 0,
trigger_characters = { "f", "o", "o" },
opts = {},
},
-- the follow two sources have additional options
{
"blink.cmp.sources.path",
opts = {
trailing_slash = false,
label_trailing_slash = true,
get_cwd = function(context)
return vim.fn.expand(("#%d:p:h"):format(context.bufnr))
end,
show_hidden_files_by_default = true,
},
},
{
"blink.cmp.sources.snippets",
score_offset = -3,
-- similar to https://github.com/garymjr/nvim-snippets
opts = {
friendly_snippets = true,
search_paths = { vim.fn.stdpath("config") .. "/snippets" },
global_snippets = { "all" },
extended_filetypes = {},
ignored_filetypes = {},
},
},
},
{ { "blink.cmp.sources.buffer" } },
},
},
windows = {
autocomplete = {
min_width = 30,
max_width = 60,
max_height = 10,
border = "none",
winhighlight = "Normal:BlinkCmpMenu,FloatBorder:BlinkCmpMenuBorder,CursorLine:BlinkCmpMenuSelection,Search:None",
-- keep the cursor X lines away from the top/bottom of the window
scrolloff = 2,
-- which directions to show the window,
-- falling back to the next direction when there's not enough space
direction_priority = { "s", "n" },
-- whether to preselect the first item in the completion list
preselect = true,
-- Controls how the completion items are rendered on the popup window
-- 'simple' will render the item's kind icon the left alongside the label
-- 'reversed' will render the label on the left and the kind icon + name on the right
-- 'function(blink.cmp.CompletionRenderContext): blink.cmp.Component[]' for custom rendering
draw = "simple",
-- Controls the cycling behavior when reaching the beginning or end of the completion list.
cycle = {
-- When `true`, calling `select_next` at the *bottom* of the completion list will select the *first* completion item.
from_bottom = true,
-- When `true`, calling `select_prev` at the *top* of the completion list will select the *last* completion item.
from_top = true,
},
},
documentation = {
min_width = 10,
max_width = 60,
max_height = 20,
border = "padded",
winhighlight = "Normal:BlinkCmpDoc,FloatBorder:BlinkCmpDocBorder,CursorLine:BlinkCmpDocCursorLine,Search:None",
-- which directions to show the documentation window,
-- for each of the possible autocomplete window directions,
-- falling back to the next direction when there's not enough space
direction_priority = {
autocomplete_north = { "e", "w", "n", "s" },
autocomplete_south = { "e", "w", "s", "n" },
},
auto_show = true,
auto_show_delay_ms = 500,
update_delay_ms = 100,
},
signature_help = {
min_width = 1,
max_width = 100,
max_height = 10,
border = "padded",
winhighlight = "Normal:BlinkCmpSignatureHelp,FloatBorder:BlinkCmpSignatureHelpBorder",
},
},
highlight = { highlight = {
ns = vim.api.nvim_create_namespace("blink_cmp"), ns = vim.api.nvim_create_namespace("blink_cmp"),
-- sets the fallback highlight groups to nvim-cmp's highlight groups -- sets the fallback highlight groups to nvim-cmp's highlight groups
@ -201,10 +28,6 @@ return {
use_nvim_cmp_as_default = false, use_nvim_cmp_as_default = false,
}, },
-- set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
-- adjusts spacing to ensure icons are aligned
nerd_font_variant = "normal",
kind_icons = { kind_icons = {
Text = "󰉿", Text = "󰉿",
Method = "󰊕", Method = "󰊕",

View file

@ -2,6 +2,40 @@ return {
"conform.nvim", "conform.nvim",
event = "BufWritePre", event = "BufWritePre",
cmd = "ConformInfo", cmd = "ConformInfo",
keys = {
{
"<leader>cf",
function()
require("conform").format({ async = true })
end,
desc = "Format code",
mode = { "n", "v" },
},
{
"<leader>ctf",
function()
if vim.g.disable_autoformat then
vim.g.disable_autoformat = false
else
vim.g.disable_autoformat = true
end
end,
desc = "Disable autoformat on save globally",
mode = { "n", "v" },
},
{
"<leader>cbf",
function()
if vim.b[0].disable_autoformat then
vim.b[0].disable_autoformat = false
else
vim.b[0].disable_autoformat = true
end
end,
desc = "Disable autoformat on save buffer",
mode = { "n", "v" },
},
},
after = function() after = function()
require("conform").setup({ require("conform").setup({
format_on_save = function(bufnr) format_on_save = function(bufnr)

View file

@ -1,23 +1,53 @@
return { return {
"harpoon2", "harpoon2",
after = function() after = function()
local harpoon = require("harpoon") require("harpoon"):setup()
end,
vim.keymap.set("n", "<leader>a", function() keys = {
harpoon:list():add() {
end) "<leader>a",
vim.keymap.set("n", "<C-h><C-a>", function() function()
harpoon:list():select(1) require("harpoon"):list():add()
end) end,
vim.keymap.set("n", "<C-h><C-s>", function() desc = "Add to harpoon",
harpoon:list():select(2) mode = "n",
end) },
vim.keymap.set("n", "<C-h><C-d>", function() {
harpoon:list():select(3) "<C-h><C-a>",
end) function()
vim.keymap.set("n", "<C-h><C-f>", function() require("harpoon"):list():select(1)
harpoon:list():select(4) end,
end) desc = "Select harpoon 1",
mode = "n",
},
{
"<C-h><C-s>",
function()
require("harpoon"):list():select(2)
end,
desc = "Select harpoon 2",
mode = "n",
},
{
"<C-h><C-d>",
function()
require("harpoon"):list():select(3)
end,
desc = "Select harpoon 3",
mode = "n",
},
{
"<C-h><C-f>",
function()
require("harpoon"):list():select(4)
end,
desc = "Select harpoon 4",
mode = "n",
},
{
"<C-h><C-h>",
function()
require("lz.n").trigger_load("telescope.nvim")
local conf = require("telescope.config").values local conf = require("telescope.config").values
local function toggle_telescope(harpoon_files) local function toggle_telescope(harpoon_files)
@ -38,8 +68,10 @@ return {
:find() :find()
end end
vim.keymap.set("n", "<C-h><C-h>", function() toggle_telescope(require("harpoon"):list())
toggle_telescope(harpoon:list())
end, { desc = "Open harpoon window" })
end, end,
mode = "n",
desc = "toggle harpoon menu",
},
},
} }

View file

@ -1,5 +1,6 @@
return { return {
"lsp-progress", "lsp-progress",
event = "LspAttach",
after = function() after = function()
require("lsp-progress").setup({ require("lsp-progress").setup({
client_format = function(client_name, spinner, series_messages) client_format = function(client_name, spinner, series_messages)

View file

@ -1,6 +1,5 @@
return { return {
"lualine.nvim", "lualine.nvim",
event = "BufEnter",
after = function() after = function()
require("lualine").setup({ require("lualine").setup({
options = { options = {
@ -25,6 +24,7 @@ return {
lualine_a = { "branch" }, lualine_a = { "branch" },
lualine_b = { lualine_b = {
function() function()
require("lz.n").trigger_load("lsp-progress")
return require("lsp-progress").progress() return require("lsp-progress").progress()
end, end,
}, },

View file

@ -8,7 +8,9 @@ return {
require("plugins.lsp-progress"), require("plugins.lsp-progress"),
require("plugins.gitsigns"), require("plugins.gitsigns"),
require("plugins.autopairs"), require("plugins.autopairs"),
{ "telescope-ui-select.nvim", priority = 70 }, require("plugins.trouble"),
require("plugins.toggleterm"),
{ "telescope-ui-select.nvim" },
{ {
"nvim-lspconfig", "nvim-lspconfig",
event = "BufEnter", event = "BufEnter",
@ -16,10 +18,6 @@ return {
require("lsp") require("lsp")
end, end,
}, },
{
"sleuth",
event = "BufEnter",
},
{ {
"which-key.nvim", "which-key.nvim",
after = function() after = function()
@ -29,30 +27,10 @@ return {
end, end,
}, },
{ "nvim-web-devicons" }, { "nvim-web-devicons" },
{ "rose-pine" }, { "rose-pine", priority = 100 },
{ "render-markdown.nvim" },
{ "markdown-preview.nvim" },
{ {
"trouble.nvim", "markdown-preview.nvim",
event = "LspAttach", filetypes = { "markdown" },
after = function()
require("trouble").setup()
vim.keymap.set("n", "<leader>xx", function()
vim.cmd("Trouble diagnostics toggle")
end, { desc = "Diagnostics" })
vim.keymap.set("n", "<leader>xX", function()
vim.cmd("Trouble diagnostics toggle filter.buf=0")
end, { desc = "Buffer diagnostics" })
vim.keymap.set("n", "<leader>cs", function()
vim.cmd("Trouble symbols toggle")
end, { desc = "Symbols" })
vim.keymap.set("n", "<leader>cl", function()
vim.cmd("Trouble lsp toggle win.position=right")
end, { desc = "LSP definitions / references /..." })
vim.keymap.set("n", "<leader>ql", function()
vim.cmd("Trouble qflist toggle")
end, { desc = "Quickfix list (trouble)" })
end,
}, },
{ {
"typst-preview", "typst-preview",
@ -66,27 +44,6 @@ return {
}) })
end, end,
}, },
{
"toggleterm.nvim",
after = function()
require("toggleterm").setup({
shade_terminals = false,
})
vim.keymap.set({ "n", "t", "v" }, "<C-l>", function()
vim.cmd("ToggleTerm direction=float")
end)
vim.keymap.set("n", "<leader>tv", function()
vim.cmd("ToggleTerm direction=vertical")
end)
vim.keymap.set("n", "<leader>tt", function()
vim.cmd("ToggleTerm direction=horizontal")
end)
vim.keymap.set("n", "<leader>ts", function()
vim.cmd("TermSelect")
end)
end,
},
{ {
"mini.ai", "mini.ai",
event = "BufEnter", event = "BufEnter",
@ -109,9 +66,9 @@ return {
}, },
{ {
"mini.notify", "mini.notify",
event = "BufEnter",
after = function() after = function()
require("mini.notify").setup({ require("mini.notify").setup({
-- handled by statusline
lsp_progress = { enable = false }, lsp_progress = { enable = false },
}) })
end, end,
@ -126,6 +83,24 @@ return {
{ {
"cellular-automaton.nvim", "cellular-automaton.nvim",
cmd = "CellularAutomaton", cmd = "CellularAutomaton",
keys = {
{
"<leader>mr",
function()
vim.cmd.CellularAutomaton("make_it_rain")
end,
desc = "A surprise!",
mode = "n",
},
{
"<leader>bruh",
function()
vim.cmd.CellularAutomaton("game_of_life")
end,
desc = "A surprise!",
mode = "n",
},
},
}, },
{ {
"indent-blankline.nvim", "indent-blankline.nvim",
@ -150,13 +125,18 @@ return {
}, },
{ {
"mini.bufremove", "mini.bufremove",
event = "BufEnter", keys = {
{
"<leader>bd",
function()
MiniBufremove.delete()
end,
mode = { "n", "v" },
desc = "Close buffer",
},
},
after = function() after = function()
require("mini.bufremove").setup() require("mini.bufremove").setup()
vim.keymap.set({ "n", "v" }, "<leader>bd", function()
MiniBufremove.delete()
end)
end, end,
}, },
{ {
@ -169,6 +149,29 @@ return {
{ {
"neogit", "neogit",
cmd = "Neogit", cmd = "Neogit",
keys = {
{
"<leader>gg",
function()
vim.cmd.Neogit()
end,
desc = "Open neogit",
mode = "n",
},
{
"<leader>gc",
function()
vim.cmd.Neogit("kind=floating commit")
end,
desc = "Open neogit commit menu",
mode = "n",
},
},
before = function()
local lz = require("lz.n")
lz.trigger_load("diffview.nvim")
lz.trigger_load("telescope.nvim")
end,
after = function() after = function()
require("neogit").setup({ require("neogit").setup({
graph_style = "unicode", graph_style = "unicode",
@ -186,33 +189,31 @@ return {
{ {
"barbecue.nvim", "barbecue.nvim",
event = "BufEnter", event = "BufEnter",
keys = {
{
"<C-j>",
function()
require("barbecue.ui").navigate(-1)
end,
desc = "Go to last treesitter node",
},
},
after = function() after = function()
require("barbecue").setup() require("barbecue").setup()
-- triggers CursorHold event faster
vim.opt.updatetime = 200
require("barbecue").setup({
create_autocmd = false, -- prevent barbecue from updating itself automatically
})
vim.api.nvim_create_autocmd({
"WinResized",
"BufWinEnter",
"CursorHold",
"InsertLeave",
-- include this if you have set `show_modified` to `true`
"BufModifiedSet",
}, {
group = vim.api.nvim_create_augroup("barbecue.updater", {}),
callback = function()
require("barbecue.ui").update()
end,
})
end, end,
}, },
{ {
"undotree", "undotree",
cmd = "UndotreeToggle", cmd = "UndotreeToggle",
keys = {
{
"<leader>u",
function()
vim.cmd.UndotreeToggle()
end,
desc = "Toggle undotree",
mode = "n",
},
},
}, },
} }

View file

@ -10,32 +10,86 @@ return {
}) })
require("telescope").load_extension("ui-select") require("telescope").load_extension("ui-select")
end,
keys = {
{
"<leader> ",
function()
local builtin = require("telescope.builtin") local builtin = require("telescope.builtin")
vim.keymap.set("n", "<leader> ", function()
local is_git = vim.fn.finddir(".git", vim.fn.getcwd() .. ";") local is_git = vim.fn.finddir(".git", vim.fn.getcwd() .. ";")
if is_git then if is_git then
builtin.git_files() builtin.git_files()
else else
builtin.find_files() builtin.find_files()
end end
end, { desc = "Grep through all files tracked by git, or fall back to just cwd" })
vim.keymap.set("n", "<leader>ff", builtin.find_files, { desc = "Grep through all files in cwd" })
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action)
vim.keymap.set("n", "<leader>/", builtin.live_grep)
vim.keymap.set("n", "<leader>k", builtin.buffers)
vim.keymap.set("n", "<leader>gd", builtin.lsp_definitions, { desc = "Go to LSP definition" })
vim.keymap.set("n", "<leader>gi", builtin.lsp_implementations, { desc = "Go to implementations" })
vim.keymap.set("n", "<leader>j", builtin.lsp_document_symbols, { desc = "Search through document symbols" })
vim.keymap.set(
"n",
"<leader>fs",
builtin.lsp_workspace_symbols,
{ desc = "Search through entire workspace symbols" }
)
vim.keymap.set("n", "<leader>fd", builtin.diagnostics, { desc = "Search through LSP diagnostics" })
end, end,
priority = 60, desc = "Grep through all files tracked by git, or fall back to just cwd",
mode = "n",
},
{
"<leader>ff",
function()
require("telescope.builtin").find_files()
end,
desc = "Grep through all files in cwd",
mode = "n",
},
{ "<leader>ca", vim.lsp.buf.code_action, desc = "LSP Code Action", mode = "n" },
{
"<leader>/",
function()
require("telescope.builtin").live_grep()
end,
desc = "Live grep",
mode = "n",
},
{
"<leader>k",
function()
require("telescope.builtin").buffers()
end,
desc = "List buffers",
mode = "n",
},
{
"<leader>gd",
function()
require("telescope.builtin").lsp_definitions()
end,
desc = "Go to LSP definition",
mode = "n",
},
{
"<leader>gi",
function()
require("telescope.builtin").lsp_implementations()
end,
desc = "Go to implementations",
mode = "n",
},
{
"<leader>j",
function()
require("telescope.builtin").lsp_document_symbols()
end,
desc = "Search through document symbols",
mode = "n",
},
{
"<leader>fs",
function()
require("telescope.builtin").lsp_workspace_symbols()
end,
desc = "Search through entire workspace symbols",
mode = "n",
},
{
"<leader>fd",
function()
require("telescope.builtin").diagnostics()
end,
desc = "Search through LSP diagnostics",
mode = "n",
},
},
} }

View file

@ -0,0 +1,42 @@
return {
"toggleterm.nvim",
keys = {
{
"<C-l>",
function()
vim.cmd("ToggleTerm direction=float")
end,
mode = { "n", "t", "v" },
desc = "Toggle terminal"
},
{
"<leader>tv",
function()
vim.cmd("ToggleTerm direction=vertical")
end,
desc = "Vertical terminal",
mode = "n",
},
{
"<leader>tt",
function()
vim.cmd("ToggleTerm direction=horizontal")
end,
desc = "Horizontal terminal",
mode = "n",
},
{
"<leader>ts",
function()
vim.cmd("TermSelect")
end,
desc = "Terminal select",
mode = "n",
},
},
after = function()
require("toggleterm").setup({
shade_terminals = false,
})
end,
}

49
lua/plugins/trouble.lua Normal file
View file

@ -0,0 +1,49 @@
return {
"trouble.nvim",
cmd = "Trouble",
after = function()
require("trouble").setup()
end,
keys = {
{
"<leader>xx",
function()
vim.cmd("Trouble diagnostics toggle")
end,
desc = "Diagnostics",
mode = "n",
},
{
"<leader>xX",
function()
vim.cmd("Trouble diagnostics toggle filter.buf=0")
end,
desc = "Buffer diagnostics",
mode = "n",
},
{
"<leader>cs",
function()
vim.cmd("Trouble symbols toggle")
end,
desc = "Symbols",
mode = "n",
},
{
"<leader>cl",
function()
vim.cmd("Trouble lsp toggle win.position=right")
end,
desc = "LSP definitions / references /...",
mode = "n",
},
{
"<leader>ql",
function()
vim.cmd("Trouble qflist toggle")
end,
desc = "Quickfix list (trouble)",
mode = "n",
},
},
}