From ccab9d5e09e2d0042fbbe5b6bd05e82426247067 Mon Sep 17 00:00:00 2001 From: staticssleever668 Date: Fri, 4 Oct 2024 06:51:55 +0300 Subject: [PATCH] fix: only map ~ for normal mode (#484) Allows to switch character case with ~ (tilde) in visual mode while preserving existing ~ :tcd functionality. Related to [1]. [1]: https://github.com/stevearc/oil.nvim/issues/397 "bug: ~ not respected" --- README.md | 2 +- doc/oil.txt | 2 +- lua/oil/config.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 606cbb21..fd153601 100644 --- a/README.md +++ b/README.md @@ -201,7 +201,7 @@ require("oil").setup({ ["-"] = "actions.parent", ["_"] = "actions.open_cwd", ["`"] = "actions.cd", - ["~"] = { "actions.cd", opts = { scope = "tab" }, desc = ":tcd to the current oil directory" }, + ["~"] = { "actions.cd", opts = { scope = "tab" }, desc = ":tcd to the current oil directory", mode = "n" }, ["gs"] = "actions.change_sort", ["gx"] = "actions.open_external", ["g."] = "actions.toggle_hidden", diff --git a/doc/oil.txt b/doc/oil.txt index 4364ebb8..2c1a1073 100644 --- a/doc/oil.txt +++ b/doc/oil.txt @@ -86,7 +86,7 @@ CONFIG *oil-confi ["-"] = "actions.parent", ["_"] = "actions.open_cwd", ["`"] = "actions.cd", - ["~"] = { "actions.cd", opts = { scope = "tab" }, desc = ":tcd to the current oil directory" }, + ["~"] = { "actions.cd", opts = { scope = "tab" }, desc = ":tcd to the current oil directory", mode = "n" }, ["gs"] = "actions.change_sort", ["gx"] = "actions.open_external", ["g."] = "actions.toggle_hidden", diff --git a/lua/oil/config.lua b/lua/oil/config.lua index e3fcc10c..065dbbf6 100644 --- a/lua/oil/config.lua +++ b/lua/oil/config.lua @@ -71,7 +71,7 @@ local default_config = { ["-"] = "actions.parent", ["_"] = "actions.open_cwd", ["`"] = "actions.cd", - ["~"] = { "actions.cd", opts = { scope = "tab" }, desc = ":tcd to the current oil directory" }, + ["~"] = { "actions.cd", opts = { scope = "tab" }, desc = ":tcd to the current oil directory", mode = "n" }, ["gs"] = "actions.change_sort", ["gx"] = "actions.open_external", ["g."] = "actions.toggle_hidden",