chore: Prepare for multi configuration and cleanup
This commit is contained in:
parent
81134126a9
commit
4986770f16
40 changed files with 77 additions and 76 deletions
201
nix/programs/nvim/lua/config/keymaps.lua
Normal file
201
nix/programs/nvim/lua/config/keymaps.lua
Normal file
|
|
@ -0,0 +1,201 @@
|
|||
local Util = require("lazyvim.util")
|
||||
|
||||
local function map(mode, lhs, rhs, opts)
|
||||
local keys = require("lazy.core.handler").handlers.keys
|
||||
---@cast keys LazyKeysHandler
|
||||
-- do not create the map if a lazy keys handler exists
|
||||
if not keys.active[keys.parse({ lhs, mode = mode }).id] then
|
||||
opts = opts or {}
|
||||
opts.silent = opts.silent ~= false
|
||||
vim.keymap.set(mode, lhs, rhs, opts)
|
||||
end
|
||||
end
|
||||
local opts = { noremap = true, silent = true }
|
||||
local term_opts = { silent = true }
|
||||
|
||||
-- crimes against humanity, but I don't care
|
||||
map("n", "j", "h", opts)
|
||||
map("n", "l", "k", opts)
|
||||
map("n", "k", "j", opts)
|
||||
map("n", ";", "l", opts)
|
||||
map("v", "j", "h", opts)
|
||||
map("v", "k", "j", opts)
|
||||
map("v", "l", "k", opts)
|
||||
map("v", ";", "l", opts)
|
||||
|
||||
-- test plugin
|
||||
map("n", "<leader>OO", ':lua require("test_plugin").test()<CR>', { desc = "Toggle breakpoint" })
|
||||
|
||||
-- debug
|
||||
map("n", "<leader>db", ':lua require("dap").toggle_breakpoint()<CR>', { desc = "Toggle breakpoint" })
|
||||
map("n", "<leader>do", ':lua require("dap").step_over()<CR>', { desc = "Step over" })
|
||||
map("n", "<leader>di", ':lua require("dap").step_into()<CR>', { desc = "Step into" })
|
||||
map("n", "<leader>dc", ':lua require("dap").continue()<CR>', { desc = "Continue" })
|
||||
map("n", "<leader>du", function()
|
||||
require("dapui").toggle()
|
||||
end, { desc = "Toggle DAP UI" })
|
||||
map("n", "<leader>de", function()
|
||||
require("dapui").eval()
|
||||
end, { desc = "DAP Eval" })
|
||||
|
||||
-- window movement
|
||||
map("n", "<A-j>", [[<Cmd>wincmd h<CR>]], opts)
|
||||
map("n", "<A-;>", [[<Cmd>wincmd l<CR>]], opts)
|
||||
map("n", "<A-t>", [[<Cmd>wincmd j<CR>]], opts)
|
||||
map("i", "<A-j>", [[<Cmd>wincmd h<CR>]], opts)
|
||||
map("i", "<A-;>", [[<Cmd>wincmd l<CR>]], opts)
|
||||
map("i", "<A-k>", [[<Cmd>wincmd j<CR>]], opts)
|
||||
|
||||
-- toggle terminal
|
||||
local lazyterm = function()
|
||||
Util.terminal(nil, { cwd = Util.root(), esc_esc = false, ctrl_hjkl = false })
|
||||
end
|
||||
map("n", "<c-t>", lazyterm, { desc = "Terminal (root dir)" })
|
||||
map("t", "<c-t>", "<cmd>close<cr>", { desc = "Hide Terminal" })
|
||||
|
||||
-- semicolon thing
|
||||
-- map("i","<C-m>" ,"<C-o>A;<CR>", {desc = "add semi and newline"})
|
||||
-- map("i","<C-n>" ,"<C-o>A;<ESC>", {desc = "add semi"})
|
||||
map("n", "<leader>m", "$a;<CR>", { desc = "add semi and newline" })
|
||||
map("n", "<leader>n", "$a;<ESC>", { desc = "add semi" })
|
||||
|
||||
-- tab switching
|
||||
map("n", "<F1>", ":BufferLineCyclePrev<CR>", opts)
|
||||
map("n", "<F2>", ":BufferLineCycleNext<CR>", opts)
|
||||
|
||||
-- git
|
||||
map("n", "<leader>gq", function()
|
||||
require("telescope.builtin").git_commits()
|
||||
end, { desc = "Commits" })
|
||||
map("n", "<leader>gw", function()
|
||||
require("telescope.builtin").git_bcommits()
|
||||
end, { desc = "Commits in branch" })
|
||||
map("n", "<leader>gb", function()
|
||||
require("telescope.builtin").git_branches()
|
||||
end, { desc = "Branches" })
|
||||
map("n", "<leader>gr", function()
|
||||
require("telescope.builtin").git_status()
|
||||
end, { desc = "Git status" })
|
||||
map("n", "<leader>ga", function()
|
||||
require("telescope.builtin").git_stash()
|
||||
end, { desc = "Git stash" })
|
||||
map("n", "<leader>gg", function()
|
||||
Util.terminal({ "gitui" }, { cwd = Util.root() })
|
||||
end, { desc = "gitui (root dir)" })
|
||||
map("n", "<leader>gG", function()
|
||||
Util.terminal({ "gitui" })
|
||||
end, { desc = "gitui (cwd)" })
|
||||
map("n", "<leader>gB", function()
|
||||
require("gitblame")
|
||||
vim.cmd(":GitBlameToggle")
|
||||
end, { desc = "git blame" })
|
||||
|
||||
-- harpoon man
|
||||
map("n", "<leader>h1", function()
|
||||
require("harpoon.ui").nav_file(1)
|
||||
end, { desc = "First Harpoon File" })
|
||||
map("n", "<leader>h2", function()
|
||||
require("harpoon.ui").nav_file(2)
|
||||
end, { desc = "Second Harpoon File" })
|
||||
map("n", "<leader>h3", function()
|
||||
require("harpoon.ui").nav_file(3)
|
||||
end, { desc = "First Harpoon File" })
|
||||
map("n", "<leader>ha", function()
|
||||
require("harpoon.mark").add_file()
|
||||
end, { desc = "First Harpoon File" })
|
||||
map("n", "<leader>hd", function()
|
||||
require("harpoon.mark").remove_file()
|
||||
end, { desc = "First Harpoon File" })
|
||||
map("n", "<leader>hm", ":Telescope harpoon marks<CR>", { noremap = true, silent = true, desc = "Show harpoon marks" })
|
||||
|
||||
-- telescope
|
||||
map("n", "<leader>fb", function()
|
||||
require("telescope").extensions.file_browser.file_browser({})
|
||||
end, { desc = "File Browser" })
|
||||
map("n", "<leader>ff", function()
|
||||
require("telescope.builtin").find_files()
|
||||
end, { desc = "Find Files" })
|
||||
map("n", "<leader>fg", function()
|
||||
Live_grep_from_project_git_root()
|
||||
end, { desc = "Live Grep (root)" })
|
||||
map("n", "<leader>fG", function()
|
||||
require("telescope.builtin").live_grep()
|
||||
end, { desc = "Live Grep (cwd)" })
|
||||
map("n", "<leader>fh", function()
|
||||
require("telescope.builtin").help_tags()
|
||||
end, { desc = "Help" })
|
||||
map("n", "<leader>fp", function()
|
||||
require("telescope").extensions.project.project({})
|
||||
end, { noremap = true, silent = true, desc = "Projects" })
|
||||
map("n", "<leader>z", function()
|
||||
require("telescope").extensions.zoxide.list({})
|
||||
end, { desc = "Zoxide" })
|
||||
|
||||
-- neoscroll
|
||||
local t = {}
|
||||
t["<A-l>"] = { "scroll", { "-vim.wo.scroll", "true", "250" } }
|
||||
t["<A-k>"] = { "scroll", { "vim.wo.scroll", "true", "250" } }
|
||||
require("neoscroll.config").set_mappings(t)
|
||||
|
||||
-- trouble
|
||||
map("n", "<leader>t", "<cmd>TroubleToggle<CR>", term_opts)
|
||||
|
||||
-- format
|
||||
map({ "n", "v" }, "<F4>", function()
|
||||
Util.format({ force = true })
|
||||
end, { desc = "Format" })
|
||||
|
||||
-- better yank
|
||||
function Better_yank(opts)
|
||||
local current_line = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
vim.api.nvim_command(current_line .. "," .. (opts.count - (current_line - 1)) .. "y")
|
||||
end
|
||||
|
||||
vim.api.nvim_create_user_command("BetterYank", Better_yank, { count = 1 })
|
||||
map("n", "by", ":BetterYank<CR>", term_opts)
|
||||
|
||||
-- better delete
|
||||
function Better_delete(opts)
|
||||
local current_line = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
vim.api.nvim_command(current_line .. "," .. (opts.count - (current_line - 1)) .. "d")
|
||||
end
|
||||
|
||||
vim.api.nvim_create_user_command("BetterDelete", Better_delete, { count = 1 })
|
||||
map("n", "bd", ":BetterDelete<CR>", term_opts)
|
||||
|
||||
-- neovide zoom
|
||||
local change_scale_factor = function(delta)
|
||||
vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * delta
|
||||
end
|
||||
vim.keymap.set("n", "<C-=>", function()
|
||||
change_scale_factor(1.25)
|
||||
end)
|
||||
vim.keymap.set("n", "<C-->", function()
|
||||
change_scale_factor(1 / 1.25)
|
||||
end)
|
||||
|
||||
-- neovide paste
|
||||
vim.g.neovide_input_use_logo = 1
|
||||
vim.api.nvim_set_keymap("i", "<C-S-V>", "<ESC>p<CR>I", { noremap = true, silent = true })
|
||||
|
||||
function Get_git_root()
|
||||
local opts = {}
|
||||
local function is_git_repo()
|
||||
vim.fn.system("git rev-parse --is-inside-work-tree")
|
||||
|
||||
return vim.v.shell_error == 0
|
||||
end
|
||||
if is_git_repo() then
|
||||
local dot_git_path = vim.fn.finddir(".git", ".;")
|
||||
local root = vim.fn.fnamemodify(dot_git_path, ":h")
|
||||
opts = {
|
||||
cwd = root,
|
||||
}
|
||||
end
|
||||
return opts
|
||||
end
|
||||
|
||||
function Live_grep_from_project_git_root()
|
||||
local opts = Get_git_root()
|
||||
require("telescope.builtin").live_grep(opts)
|
||||
end
|
||||
56
nix/programs/nvim/lua/config/lazy.lua
Normal file
56
nix/programs/nvim/lua/config/lazy.lua
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable",
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
|
||||
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||
{ import = "lazyvim.plugins.extras.ui.alpha" },
|
||||
-- { import = "lazyvim.plugins.extras.ui.edgy" },
|
||||
{ import = "plugins" },
|
||||
{ import = "plugins.plugins" },
|
||||
{ import = "lazyvim.plugins.extras.lang.rust" },
|
||||
{ import = "lazyvim.plugins.extras.lang.tailwind" },
|
||||
{ import = "lazyvim.plugins.extras.lang.java" },
|
||||
{ import = "lazyvim.plugins.extras.lang.go" },
|
||||
{ import = "lazyvim.plugins.extras.lang.clangd" },
|
||||
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||
{ import = "lazyvim.plugins.extras.lang.python" },
|
||||
{ import = "lazyvim.plugins.extras.lang.markdown" },
|
||||
{ import = "lazyvim.plugins.extras.lang.cmake" },
|
||||
{ import = "lazyvim.plugins.extras.lang.omnisharp" },
|
||||
{ import = "lazyvim.plugins.extras.lang.json" },
|
||||
{ import = "lazyvim.plugins.extras.lang.tex" },
|
||||
{ import = "lazyvim.plugins.extras.util.dot" },
|
||||
{ import = "lazyvim.plugins.extras.dap.core" },
|
||||
{ import = "lazyvim.plugins.extras.test.core" },
|
||||
},
|
||||
defaults = {
|
||||
lazy = true,
|
||||
version = false,
|
||||
},
|
||||
install = { colorscheme = { "tokyonight", "catppuccin-mocha" } },
|
||||
checker = { enabled = true, notify = false },
|
||||
change_detection = { enabled = true, notify = false },
|
||||
performance = {
|
||||
rtp = {
|
||||
disabled_plugins = {
|
||||
"gzip",
|
||||
"netrw",
|
||||
"tarPlugin",
|
||||
"tohtml",
|
||||
"tutor",
|
||||
"zipPlugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
126
nix/programs/nvim/lua/config/lsp-keymap.lua
Normal file
126
nix/programs/nvim/lua/config/lsp-keymap.lua
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
local M = {}
|
||||
|
||||
---@type PluginLspKeys
|
||||
M._keys = nil
|
||||
|
||||
---@return (LazyKeys|{has?:string})[]
|
||||
function M.get()
|
||||
local format = function()
|
||||
require("lazyvim.util").format({ force = true })
|
||||
end
|
||||
if not M._keys then
|
||||
---@class PluginLspKeys
|
||||
M._keys = {
|
||||
{ "<leader>cld", vim.diagnostic.open_float, desc = "Line Diagnostics" },
|
||||
{ "<leader>cl", "<cmd>LspInfo<cr>", desc = "Lsp Info" },
|
||||
{ "<leader>ca", "<cmd>Telescope lsp_definitions<cr>", desc = "Goto Definition", has = "definition" },
|
||||
{ "<leader>cs", "<cmd>Telescope lsp_references<cr>", desc = "References" },
|
||||
{ "<leader>cA", vim.lsp.buf.declaration, desc = "Goto Declaration" },
|
||||
{ "<leader>cf", "<cmd>Telescope lsp_implementations<cr>", desc = "Goto Implementation" },
|
||||
{ "<leader>cd", "<cmd>Telescope lsp_type_definitions<cr>", desc = "Goto Type Definition" },
|
||||
{ "<leader>ce", vim.lsp.buf.hover, desc = "Hover" },
|
||||
{ "<leader>cw", vim.lsp.buf.signature_help, desc = "Signature Help", has = "signatureHelp" },
|
||||
{ "<c-k>", vim.lsp.buf.signature_help, mode = "i", desc = "Signature Help", has = "signatureHelp" },
|
||||
{ "]d", M.diagnostic_goto(true), desc = "Next Diagnostic" },
|
||||
{ "[d", M.diagnostic_goto(false), desc = "Prev Diagnostic" },
|
||||
{ "]e", M.diagnostic_goto(true, "ERROR"), desc = "Next Error" },
|
||||
{ "[e", M.diagnostic_goto(false, "ERROR"), desc = "Prev Error" },
|
||||
{ "]w", M.diagnostic_goto(true, "WARN"), desc = "Next Warning" },
|
||||
{ "[w", M.diagnostic_goto(false, "WARN"), desc = "Prev Warning" },
|
||||
{ "<F4>", format, desc = "Format Range", mode = "v", has = "documentRangeFormatting" },
|
||||
{ "<leader>cr", ":IncRename ", desc = "Rename", has = "rename" },
|
||||
{
|
||||
"<leader>cq",
|
||||
function()
|
||||
vim.lsp.buf.code_action({
|
||||
context = {
|
||||
only = {
|
||||
"quickfix",
|
||||
"quickfix.ltex",
|
||||
"source",
|
||||
"source.fixAll",
|
||||
"source.organizeImports",
|
||||
"",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
desc = "Fix",
|
||||
mode = { "n", "v" },
|
||||
has = "codeAction",
|
||||
},
|
||||
{
|
||||
"<leader>cQ",
|
||||
function()
|
||||
vim.lsp.buf.code_action({
|
||||
context = {
|
||||
only = {
|
||||
"refactor",
|
||||
"refactor.inline",
|
||||
"refactor.extract",
|
||||
"refactor.rewrite",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
desc = "Refactor",
|
||||
mode = { "n", "v" },
|
||||
has = "codeAction",
|
||||
},
|
||||
}
|
||||
end
|
||||
return M._keys
|
||||
end
|
||||
|
||||
---@param method string
|
||||
function M.has(buffer, method)
|
||||
method = method:find("/") and method or "textDocument/" .. method
|
||||
local clients = require("lazyvim.util").lsp.get_clients({ bufnr = buffer })
|
||||
for _, client in ipairs(clients) do
|
||||
if client.supports_method(method) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
---@return (LazyKeys|{has?:string})[]
|
||||
function M.resolve(buffer)
|
||||
local Keys = require("lazy.core.handler.keys")
|
||||
if not Keys.resolve then
|
||||
return {}
|
||||
end
|
||||
local spec = M.get()
|
||||
local opts = require("lazyvim.util").opts("nvim-lspconfig")
|
||||
local clients = require("lazyvim.util").lsp.get_clients({ bufnr = buffer })
|
||||
for _, client in ipairs(clients) do
|
||||
local maps = opts.servers[client.name] and opts.servers[client.name].keys or {}
|
||||
vim.list_extend(spec, maps)
|
||||
end
|
||||
return Keys.resolve(spec)
|
||||
end
|
||||
|
||||
function M.on_attach(_, buffer)
|
||||
local Keys = require("lazy.core.handler.keys")
|
||||
local keymaps = M.resolve(buffer)
|
||||
|
||||
for _, keys in pairs(keymaps) do
|
||||
if not keys.has or M.has(buffer, keys.has) then
|
||||
local opts = Keys.opts(keys)
|
||||
opts.has = nil
|
||||
opts.silent = opts.silent ~= false
|
||||
opts.buffer = buffer
|
||||
vim.keymap.set(keys.mode or "n", keys.lhs, keys.rhs, opts)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function M.diagnostic_goto(next, severity)
|
||||
local go = next and vim.diagnostic.goto_next or vim.diagnostic.goto_prev
|
||||
severity = severity and vim.diagnostic.severity[severity] or nil
|
||||
return function()
|
||||
go({ severity = severity })
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
25
nix/programs/nvim/lua/config/options.lua
Normal file
25
nix/programs/nvim/lua/config/options.lua
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
-- Options are automatically loaded before lazy.nvim startup
|
||||
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
|
||||
-- Add any additional options here
|
||||
local options = {
|
||||
fileencoding = "utf-8",
|
||||
number = true,
|
||||
showmode = true,
|
||||
termguicolors = true,
|
||||
spelllang = "en_us",
|
||||
shell = "fish",
|
||||
relativenumber = false,
|
||||
scrolloff = 5,
|
||||
scrolljump = 5,
|
||||
wrap = false,
|
||||
}
|
||||
vim.o.guifont = "JetBrainsMono Nerd Font:h14"
|
||||
vim.g.neovide_refresh_rate_idle = 180
|
||||
vim.g.neovide_refresh_rate_idle = 5
|
||||
vim.g.neovide_hide_mouse_when_typing = true
|
||||
vim.g.mkdp_browser = "/usr/bin/firefox"
|
||||
vim.g.mkdp_auto_start = 1
|
||||
vim.g.autoformat = false
|
||||
for k, v in pairs(options) do
|
||||
vim.opt[k] = v
|
||||
end
|
||||
302
nix/programs/nvim/lua/config/plugins.lua
Normal file
302
nix/programs/nvim/lua/config/plugins.lua
Normal file
|
|
@ -0,0 +1,302 @@
|
|||
local Util = require("lazyvim.util")
|
||||
|
||||
return {
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
opts = {
|
||||
colorscheme = "tokyonight-night",
|
||||
-- colorscheme = "catppuccin-mocha",
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
cmd = "Telescope",
|
||||
keys = function()
|
||||
return {}
|
||||
end,
|
||||
opts = {
|
||||
defaults = {
|
||||
layout_strategy = 'flex';
|
||||
layout_config = {
|
||||
flex = {
|
||||
height = 0.95,
|
||||
width = 0.95,
|
||||
flip_columns = 100,
|
||||
vertical = { preview_height = 0.5, preview_cutoff = 5 },
|
||||
horizontal = { preview_width = 0.7, preview_cutoff = 99 },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"ThePrimeagen/harpoon",
|
||||
lazy = true,
|
||||
config = function()
|
||||
require("telescope").load_extension("harpoon")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
lazy = true,
|
||||
event = "FileType markdown",
|
||||
build = "cd app && yarn install",
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope-project.nvim",
|
||||
lazy = true,
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope-file-browser.nvim",
|
||||
lazy = true,
|
||||
config = function()
|
||||
require("telescope").load_extension("file_browser")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"jvgrootveld/telescope-zoxide",
|
||||
lazy = true,
|
||||
config = function()
|
||||
local z_utils = require("telescope._extensions.zoxide.utils")
|
||||
local t = require("telescope")
|
||||
-- Configure the extension
|
||||
t.setup({
|
||||
extensions = {
|
||||
zoxide = {
|
||||
prompt_title = "[ Queries ]",
|
||||
mappings = {
|
||||
default = {
|
||||
after_action = function(selection)
|
||||
print("Update to (" .. selection.z_score .. ") " .. selection.path)
|
||||
end,
|
||||
},
|
||||
["<C-s>"] = {
|
||||
before_action = function(selection)
|
||||
print("before C-s")
|
||||
end,
|
||||
action = function(selection)
|
||||
vim.cmd("edit " .. selection.path)
|
||||
end,
|
||||
},
|
||||
["<C-q>"] = { action = z_utils.create_basic_command("split") },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Load the extension
|
||||
t.load_extension("zoxide")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"lervag/vimtex",
|
||||
config = function()
|
||||
vim.cmd("let g:vimtex_quickfix_mode=0")
|
||||
vim.cmd("let g:vimtex_view_general_viewer = 'evince'")
|
||||
vim.cmd("let g:vimtex_compiler_method = 'latexmk'")
|
||||
vim.cmd(
|
||||
"let g:vimtex_compiler_latexmk = {'options': ['-pdf', '-shell-escape', '-file-line-error', '--extra-mem-bot=10000000', '-synctex=1', '-interaction=nonstopmode',],}"
|
||||
)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"rcarriga/nvim-notify",
|
||||
opts = {
|
||||
top_down = false,
|
||||
},
|
||||
},
|
||||
{
|
||||
"jbyuki/instant.nvim",
|
||||
config = function()
|
||||
vim.cmd("let g:instant_username = 'dashie'")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"karb94/neoscroll.nvim",
|
||||
config = function()
|
||||
require("neoscroll").setup()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"kaarmu/typst.vim",
|
||||
lazy = true,
|
||||
event = "FileType typst",
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
plugins = { spelling = true },
|
||||
defaults = {
|
||||
mode = { "n", "v" },
|
||||
["g"] = { name = "+goto" },
|
||||
["gz"] = { name = "+surround" },
|
||||
["]"] = { name = "+next" },
|
||||
["["] = { name = "+prev" },
|
||||
["<leader><tab>"] = { name = "+tabs" },
|
||||
["<leader>b"] = { name = "+buffer" },
|
||||
["<leader>c"] = { name = "+code" },
|
||||
["<leader>f"] = { name = "+file/find" },
|
||||
["<leader>g"] = { name = "+git" },
|
||||
["<leader>gh"] = { name = "+hunks" },
|
||||
["<leader>q"] = { name = "+quit/session" },
|
||||
["<leader>s"] = { name = "+search" },
|
||||
["<leader>u"] = { name = "+ui" },
|
||||
["<leader>w"] = { name = "+windows" },
|
||||
["<leader>x"] = { name = "+diagnostics/quickfix" },
|
||||
["<leader>h"] = { name = "+harpoon" },
|
||||
["<leader>d"] = { name = "+DAP" },
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
local wk = require("which-key")
|
||||
wk.setup(opts)
|
||||
wk.register(opts.defaults)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"f-person/git-blame.nvim",
|
||||
lazy = true,
|
||||
},
|
||||
{
|
||||
"mg979/vim-visual-multi",
|
||||
},
|
||||
{
|
||||
"barreiroleo/ltex_extra.nvim",
|
||||
ft = { "markdown", "tex", "typst", "typ" },
|
||||
lazy = true,
|
||||
},
|
||||
{
|
||||
"smjonas/inc-rename.nvim",
|
||||
lazy = true,
|
||||
event = "BufEnter",
|
||||
config = function()
|
||||
require("inc_rename").setup({
|
||||
cmd_name = "IncRename", -- the name of the command
|
||||
hl_group = "Substitute", -- the highlight group used for highlighting the identifier's new name
|
||||
preview_empty_name = true, -- whether an empty new name should be previewed; if false the command preview will be cancelled instead
|
||||
show_message = true, -- whether to display a `Renamed m instances in n files` message after a rename operation
|
||||
input_buffer_type = nil, -- the type of the external input buffer to use (the only supported value is currently "dressing")
|
||||
post_hook = nil, -- callback to run after renaming, receives the result table (from LSP handler) as an argument
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
opts = {
|
||||
window = {
|
||||
position = "right",
|
||||
mappings = {
|
||||
["l"] = "none",
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>fe",
|
||||
function()
|
||||
require("neo-tree.command").execute({ position = "right", toggle = true, dir = Util.root() })
|
||||
end,
|
||||
desc = "Explorer NeoTree (root dir)",
|
||||
},
|
||||
{
|
||||
"<leader>fE",
|
||||
function()
|
||||
require("neo-tree.command").execute({ position = "right", toggle = true, dir = vim.loop.cwd() })
|
||||
end,
|
||||
desc = "Explorer NeoTree (cwd)",
|
||||
},
|
||||
{ "<A-f>", "<leader>fe", desc = "Explorer NeoTree (root dir)", remap = true },
|
||||
{ "<A-F>", "<leader>fE", desc = "Explorer NeoTree (cwd)", remap = true },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/edgy.nvim",
|
||||
opts = {
|
||||
animate = {
|
||||
enabled = false,
|
||||
},
|
||||
left = {},
|
||||
right = {
|
||||
-- Neo-tree filesystem always takes half the screen height
|
||||
{
|
||||
title = "Neo-Tree",
|
||||
ft = "neo-tree",
|
||||
filter = function(buf)
|
||||
return vim.b[buf].neo_tree_source == "filesystem"
|
||||
end,
|
||||
size = { height = 0.5 },
|
||||
},
|
||||
{
|
||||
title = "Neo-Tree Git",
|
||||
ft = "neo-tree",
|
||||
filter = function(buf)
|
||||
return vim.b[buf].neo_tree_source == "git_status"
|
||||
end,
|
||||
pinned = true,
|
||||
open = "Neotree position=right git_status",
|
||||
},
|
||||
{
|
||||
title = "Neo-Tree Buffers",
|
||||
ft = "neo-tree",
|
||||
filter = function(buf)
|
||||
return vim.b[buf].neo_tree_source == "buffers"
|
||||
end,
|
||||
pinned = true,
|
||||
open = "Neotree position=top buffers",
|
||||
},
|
||||
{
|
||||
ft = "Outline",
|
||||
pinned = true,
|
||||
open = "SymbolsOutlineOpen",
|
||||
},
|
||||
-- any other neo-tree windows
|
||||
"neo-tree",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
keys = {
|
||||
{
|
||||
"<leader>dk",
|
||||
function()
|
||||
require("dap").down()
|
||||
end,
|
||||
desc = "Down",
|
||||
},
|
||||
{
|
||||
"<leader>dl",
|
||||
function()
|
||||
require("dap").up()
|
||||
end,
|
||||
desc = "Up",
|
||||
},
|
||||
{
|
||||
"<leader>d;",
|
||||
function()
|
||||
require("dap").run_last()
|
||||
end,
|
||||
desc = "Run Last",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue