From 3769e95cf0d4cb860df035aeef7a75cf0d479c6d Mon Sep 17 00:00:00 2001 From: Roman Date: Tue, 8 Sep 2026 03:13:05 +0200 Subject: [PATCH] refresh shortcuts --- nvim/.config/nvim/README.md | 10 ++++++---- nvim/.config/nvim/lua/romanzy/keymaps.lua | 8 +++----- nvim/.config/nvim/lua/romanzy/plugins/oil.lua | 1 + 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/nvim/.config/nvim/README.md b/nvim/.config/nvim/README.md index be72170..7830c72 100644 --- a/nvim/.config/nvim/README.md +++ b/nvim/.config/nvim/README.md @@ -23,10 +23,7 @@ Split shortcuts: Resize shortcuts: -- `rh` make the current window narrower -- `rl` make the current window wider -- `rj` make the current window shorter -- `rk` make the current window taller +- `r-hjkl` to resize - `re` equalize split sizes Buffer shortcuts: @@ -57,6 +54,11 @@ Toggle shortcuts: - `ti` toggle inline diagnostics - `tv` toggle virtual diagnostics +Refresh shortcuts (oil and buffers): + +- `gR` refresh the current buffer +- `` refresh the current buffer + Oil usage: - `dl` opens the file browser diff --git a/nvim/.config/nvim/lua/romanzy/keymaps.lua b/nvim/.config/nvim/lua/romanzy/keymaps.lua index 8030e95..377d3a9 100644 --- a/nvim/.config/nvim/lua/romanzy/keymaps.lua +++ b/nvim/.config/nvim/lua/romanzy/keymaps.lua @@ -59,9 +59,7 @@ map("n", "", "h", { desc = "window left" }) map("n", "", "j", { desc = "window down" }) map("n", "", "k", { desc = "window up" }) map("n", "", "l", { desc = "window right" }) -map("n", "gR", function() - vim.cmd.normal({ args = { vim.keycode("") }, bang = true }) -end, { desc = "refresh current view" }) +map("n", { "gR", "" }, "edit", { desc = "refresh current buffer" }) -- this is needed to disable refresh behavior for for navigation vim.api.nvim_create_autocmd("FileType", { @@ -104,8 +102,8 @@ vim.api.nvim_create_autocmd("LspAttach", { map("n", "gd", vim.lsp.buf.definition, { buffer = ev.buf, desc = "goto definition" }) map("n", "gD", vim.lsp.buf.declaration, { buffer = ev.buf, desc = "goto declaration" }) map("n", "gfr", vim.lsp.buf.references, { buffer = ev.buf, desc = "find references" }) - map("n", "grn", rename_without_default, { buffer = ev.buf, desc = "rename symbol completely" }) - map("n", "gRN", vim.lsp.buf.rename, { buffer = ev.buf, desc = "rename symbol starting with whatever is there" }) + map("n", "grn", rename_without_default, { buffer = ev.buf, desc = "rename symbol (from empty)" }) + map("n", "grN", vim.lsp.buf.rename, { buffer = ev.buf, desc = "rename symbol (from current)" }) map({ "n", "x" }, "ca", vim.lsp.buf.code_action, { buffer = ev.buf, desc = "code actions" }) map("n", "cf", function() diff --git a/nvim/.config/nvim/lua/romanzy/plugins/oil.lua b/nvim/.config/nvim/lua/romanzy/plugins/oil.lua index 6d955ef..83b9c64 100644 --- a/nvim/.config/nvim/lua/romanzy/plugins/oil.lua +++ b/nvim/.config/nvim/lua/romanzy/plugins/oil.lua @@ -27,6 +27,7 @@ require("oil").setup({ [""] = false, [""] = false, ["gR"] = "actions.refresh", -- replaces default behavior + [""] = "actions.refresh", [""] = false, [""] = { "actions.preview", opts = { vertical = true, split = "belowright" } }, [""] = { "actions.parent", mode = "n" },