diff --git a/lua/configs/keymaps.lua b/lua/configs/keymaps.lua index ea84f27..4f4f8c5 100644 --- a/lua/configs/keymaps.lua +++ b/lua/configs/keymaps.lua @@ -11,6 +11,10 @@ vim.g.maplocalleader = " " -- Use ESC to turn off search highlighting map({ "i", "n" }, "", "noh", { desc = "Escape and clear hlsearch" }) +-- better up/down +map("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) +map("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) + -- Move in insert mode map("i", "", "") map("i", "", "") @@ -38,10 +42,11 @@ map("i", ",", ",u") map("i", ".", ".u") map("i", ";", ";u") --- save file +-- Save file map({ "i", "v", "n", "s" }, "", "w", { desc = "Save file" }) map({ "v", "n", "s" }, "fs", "w", { desc = "Save file" }) - +-- New file +map("n", "fn", "enew", { desc = "New File" }) -- Move to window using the hjkl keys map("n", "", "h", { desc = "Go to left window" }) map("n", "", "j", { desc = "Go to lower window" }) @@ -65,10 +70,5 @@ map("n", "-", "v", { desc = "Split window right" }) -- quit map("n", "qq", "qa", { desc = "Quit all" }) --- Keymaps for LSP --- Mappings. --- See `:help vim.diagnostic.*` for documentation on any of the below functions -map("n", "e", "lua vim.diagnostic.open_float()") -map("n", "[d", "lua vim.diagnostic.goto_prev()") -map("n", "]d", "lua vim.diagnostic.goto_next()") -map("n", "q", "lua vim.diagnostic.setloclist()") +-- Lazy +map("n", "l", ":Lazy", { desc = "Lazy" })