Skip to content

Commit

Permalink
feat(keymaps): added keymaps for lazygit, new file and vim.show_pos
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jan 2, 2023
1 parent 63bea54 commit fd47b5d
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions lua/lazyvim/config/keymaps.lua
Expand Up @@ -52,15 +52,17 @@ vim.keymap.set("n", "<C-s>", "<cmd>:w<cr><esc>")
vim.keymap.set("v", "<", "<gv")
vim.keymap.set("v", ">", ">gv")

-- new file
vim.keymap.set("n", "<leader>fn", "<cmd>enew<cr>", { desc = "New File" })

-- lazygit
vim.keymap.set("n", "<leader>gg", function()
require("lazy.util").open_cmd({ "lazygit" }, {
terminal = true,
close_on_exit = true,
enter = true,
float = {
size = { width = 0.9, height = 0.9 },
margin = { top = 0, right = 0, bottom = 0, left = 0 },
},
})
end, { desc = "Lazygit" })
require("lazyvim.util").float_term({ "lazygit" })
end, { desc = "Lazygit for cwd" })
vim.keymap.set("n", "<leader>gG", function()
local util = require("lazyvim.util")
util.float_term({ "lazygit" }, { cwd = util.get_root() })
end, { desc = "Lazygit for root dir" })

-- highlights under cursor
vim.keymap.set("n", "<leader>hl", vim.show_pos, { desc = "Highlight Groups at cursor" })

0 comments on commit fd47b5d

Please sign in to comment.