feat: real improvements on remaps + organization
This commit is contained in:
@@ -1,6 +1,15 @@
|
||||
vim.g.mapleader = " "
|
||||
local map = vim.keymap.set
|
||||
|
||||
-- <leader> + :
|
||||
-- B{uffers}
|
||||
-- F{ind}
|
||||
-- T{toggle}
|
||||
-- G{it}
|
||||
-- E{xplorer}
|
||||
-- N{ew}
|
||||
-- W{indow}
|
||||
|
||||
---- Bufferline ----
|
||||
-- Not used but maybe in the future
|
||||
-- map("n", "bg", "<CMD>BufferLinePick<CR>")
|
||||
@@ -141,16 +150,25 @@ map("n", "<leader>fo", "<cmd> Telescope oldfiles <CR>", { desc = "Fild old files
|
||||
map("n", "<leader>fz", "<cmd> Telescope current_buffer_fuzzy_find <CR>", { desc = "Find in current buffer" })
|
||||
map("n", "<C-/>", "<cmd> Telescope current_buffer_fuzzy_find <CR>", { desc = "Find in current buffer" })
|
||||
|
||||
-- Flash search (better "f")
|
||||
map({ "n", "x", "o" }, "s", function()
|
||||
require("flash").jump()
|
||||
end, { desc = "Flash jump in file" })
|
||||
map({ "n", "x", "o" }, "S", function()
|
||||
require("flash").treesitter()
|
||||
end, { desc = "Flash jump in file" })
|
||||
|
||||
---- Replace ----
|
||||
map("n", "<leader>/", "<cmd> GrugFar <CR>", { desc = "Find in current buffer" })
|
||||
map("n", "<leader>/", "<cmd> GrugFar <CR>", { desc = "Find and replace" })
|
||||
map("n", "<leader>fr", "<cmd> GrugFar <CR>", { desc = "Find and replace" })
|
||||
|
||||
-----------------------------------------------------------
|
||||
|
||||
-- better up/down
|
||||
-- map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { desc = "Down", expr = true, silent = true })
|
||||
-- map({ "n", "x" }, "<Down>", "v:count == 0 ? 'gj' : 'j'", { desc = "Down", expr = true, silent = true })
|
||||
-- map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true })
|
||||
-- map({ "n", "x" }, "<Up>", "v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true })
|
||||
map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { desc = "Down", expr = true, silent = true })
|
||||
map({ "n", "x" }, "<Down>", "v:count == 0 ? 'gj' : 'j'", { desc = "Down", expr = true, silent = true })
|
||||
map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true })
|
||||
map({ "n", "x" }, "<Up>", "v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true })
|
||||
|
||||
---- Movement ----
|
||||
|
||||
@@ -222,6 +240,7 @@ map("n", "]w", diagnostic_goto(true, "WARN"), { desc = "Next Warning" })
|
||||
map("n", "[w", diagnostic_goto(false, "WARN"), { desc = "Prev Warning" })
|
||||
|
||||
---- Toggle options ----
|
||||
map("n", "<leader>ts", "<cmd>ScrollbarToggle<CR>", { desc = "Toggle scrollbar" })
|
||||
map("n", "<leader>um", function()
|
||||
require("monkey-alert").enable() -- does not toggle :O
|
||||
end, { desc = "Toggle monkey alert" })
|
||||
|
||||
Reference in New Issue
Block a user