less of a rewrite, more of a restructure
This commit is contained in:
29
lua/config/binds.lua
Normal file
29
lua/config/binds.lua
Normal file
@@ -0,0 +1,29 @@
|
||||
-- Keymap function
|
||||
function Keymap(mode, key, binding)
|
||||
vim.keymap.set(mode, key, binding, { noremap = true, silent = true })
|
||||
end
|
||||
|
||||
Keymap("n", "q:", ":") -- remove nonsense command
|
||||
Keymap("n", "<leader>bd", function() -- delete buffer
|
||||
vim.cmd("bd")
|
||||
vim.cmd("echo 'Buffer deleted'")
|
||||
end)
|
||||
|
||||
for bind = "i", "a", "A" do -- proper indenting function
|
||||
Keymap("n", bind, function()
|
||||
if vim.fn.getline("."):match("^%s*$") then
|
||||
return [["_cc]]
|
||||
else
|
||||
return bind
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
Keymap("i", "<C-BS>", "<C-W>") -- C-Backscpace for whole words
|
||||
|
||||
-- Open Lazygit
|
||||
Keymap("n", "<leader>l", function()
|
||||
Snacks.lazygit.open()
|
||||
end)
|
||||
|
||||
Keymap("n", "<leader>d", "<cmd>lua vim.diagnostic.open_float()<CR>") -- Diagnostics for Linter
|
||||
Reference in New Issue
Block a user