barbar keymaps

This commit is contained in:
2026-05-07 09:04:11 +02:00
parent 44a4e7102e
commit 9946b25f5e
2 changed files with 23 additions and 22 deletions
+10 -16
View File
@@ -46,24 +46,18 @@ map("n", "<leader>dbp", function() require("dap").toggle_breakpoint() end)
map("n", "<leader>drc", function() require("dap").run_to_cursor() end) map("n", "<leader>drc", function() require("dap").run_to_cursor() end)
-- Barbar -- Barbar
local bk = vim.fn.has("macunix") == 1 and "M" or "A" map("n", "H", "<cmd>BufferPrevious<cr>", silent)
local bar = { map("n", "L", "<cmd>BufferNext<cr>", silent)
[","] = "BufferPrevious", map("n", "<", "<cmd>BufferMovePrevious<cr>", silent)
["."] = "BufferNext", map("n", ">", "<cmd>BufferMoveNext<cr>", silent)
["<"] = "BufferMovePrevious", map("n", "<leader>bp", "<cmd>BufferPin<cr>", silent)
[">"] = "BufferMoveNext", map("n", "<leader>bw", "<cmd>BufferClose<cr>", silent)
["p"] = "BufferPin", map("n", "<leader>b$", "<cmd>BufferLast<cr>", silent)
["w"] = "BufferClose", map("n", "<leader>bb", "<cmd>BufferPick<cr>", silent)
["0"] = "BufferLast", map("n", "<leader>bd", "<cmd>BufferPickDelete<cr>", silent)
}
for k, cmd in pairs(bar) do
map("n", ("<%s-%s>"):format(bk, k), ("<cmd>%s<cr>"):format(cmd), silent)
end
for i = 1, 9 do for i = 1, 9 do
map("n", ("<%s-%d>"):format(bk, i), ("<cmd>BufferGoto %d<cr>"):format(i), silent) map("n", ("<leader>%d"):format(i), ("<cmd>BufferGoto %d<cr>"):format(i), silent)
end end
map("n", "<C-p>", "<cmd>BufferPick<cr>", silent)
map("n", "<C-s-p>", "<cmd>BufferPickDelete<cr>", silent)
-- Flash -- Flash
map({ "n", "x", "o" }, "s", function() require("flash").jump() end, { desc = "Flash" }) map({ "n", "x", "o" }, "s", function() require("flash").jump() end, { desc = "Flash" })
+13 -6
View File
@@ -3,9 +3,9 @@ vim.pack.add({
{ src = "https://github.com/stevearc/oil.nvim" }, { src = "https://github.com/stevearc/oil.nvim" },
{ src = "https://github.com/echasnovski/mini.pick" }, { src = "https://github.com/echasnovski/mini.pick" },
{ src = "https://github.com/neovim/nvim-lspconfig" }, { src = "https://github.com/neovim/nvim-lspconfig" },
{ src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "main" }, { src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "main" },
{ src = "https://github.com/nvim-treesitter/nvim-treesitter-textobjects", version = "main" }, { src = "https://github.com/nvim-treesitter/nvim-treesitter-textobjects", version = "main" },
{ src = "https://github.com/Saghen/blink.cmp", version = "v1.7.0" }, { src = "https://github.com/Saghen/blink.cmp", version = "v1.7.0" },
{ src = "https://github.com/mason-org/mason.nvim" }, { src = "https://github.com/mason-org/mason.nvim" },
{ src = "https://github.com/nvim-lualine/lualine.nvim.git" }, { src = "https://github.com/nvim-lualine/lualine.nvim.git" },
{ src = "https://github.com/chomosuke/typst-preview.nvim" }, { src = "https://github.com/chomosuke/typst-preview.nvim" },
@@ -25,6 +25,7 @@ vim.pack.add({
{ src = "https://github.com/nvim-neotest/nvim-nio" }, { src = "https://github.com/nvim-neotest/nvim-nio" },
{ src = "https://github.com/rcarriga/nvim-dap-ui" }, { src = "https://github.com/rcarriga/nvim-dap-ui" },
{ src = "https://github.com/michaelrommel/nvim-silicon" }, { src = "https://github.com/michaelrommel/nvim-silicon" },
{ src = "https://github.com/hat0uma/csvview.nvim.git" },
}) })
pcall(vim.cmd.colorscheme, "gruvbox") pcall(vim.cmd.colorscheme, "gruvbox")
@@ -34,7 +35,7 @@ vim.api.nvim_set_hl(0, "FlashLabel", { fg = "#1d2021", bg = "#fe8019", bold = tr
for _, name in ipairs({ for _, name in ipairs({
"oil", "mini.pick", "mason", "typst-preview", "nvim-autopairs", "oil", "mini.pick", "mason", "typst-preview", "nvim-autopairs",
"trouble", "gitsigns", "nvim-web-devicons", "barbar", "trouble", "gitsigns", "nvim-web-devicons", "barbar",
"mini.ai", "nvim-ts-autotag", "todo-comments", "flash", "mini.ai", "nvim-ts-autotag", "todo-comments", "flash", "cssview",
}) do }) do
pcall(function() require(name).setup() end) pcall(function() require(name).setup() end)
end end
@@ -53,6 +54,7 @@ require("conform").setup({
json = prettier, json = prettier,
markdown = prettier, markdown = prettier,
yaml = prettier, yaml = prettier,
haskell = { "fourmolu" },
}, },
formatters = { formatters = {
prettier = { prepend_args = { "--tab-width", "4", "--use-tabs", "false" } }, prettier = { prepend_args = { "--tab-width", "4", "--use-tabs", "false" } },
@@ -140,9 +142,14 @@ vim.api.nvim_create_autocmd("FileType", {
-- TS textobjects -- TS textobjects
local tso = require("nvim-treesitter-textobjects.select") local tso = require("nvim-treesitter-textobjects.select")
local textobj = { af = "@function.outer", ["if"] = "@function.inner", local textobj = {
ac = "@class.outer", ic = "@class.inner", af = "@function.outer",
al = "@loop.outer", il = "@loop.inner" } ["if"] = "@function.inner",
ac = "@class.outer",
ic = "@class.inner",
al = "@loop.outer",
il = "@loop.inner"
}
for lhs, query in pairs(textobj) do for lhs, query in pairs(textobj) do
vim.keymap.set({ "x", "o" }, lhs, vim.keymap.set({ "x", "o" }, lhs,
function() tso.select_textobject(query, "textobjects") end) function() tso.select_textobject(query, "textobjects") end)