Skip to content

Commit

Permalink
feat: add Ctrl-[ as an escape key (#763)
Browse files Browse the repository at this point in the history
  • Loading branch information
hankertrix authored Mar 4, 2024
1 parent 5169bb9 commit b7d9a0a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion yazi-config/preset/keymap.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

keymap = [
{ on = [ "<Esc>" ], run = "escape", desc = "Exit visual mode, clear selected, or cancel search" },
{ on = [ "<C-[>" ], run = "escape", desc = "Exit visual mode, clear selected, or cancel search" },
{ on = [ "q" ], run = "quit", desc = "Exit the process" },
{ on = [ "Q" ], run = "quit --no-cwd-file", desc = "Exit the process without writing cwd-file" },
{ on = [ "<C-q>" ], run = "close", desc = "Close the current tab, or quit if it is last tab" },
Expand Down Expand Up @@ -154,6 +155,7 @@ keymap = [

keymap = [
{ on = [ "<Esc>" ], run = "close", desc = "Hide the task manager" },
{ on = [ "<C-[>" ], run = "close", desc = "Hide the task manager" },
{ on = [ "<C-q>" ], run = "close", desc = "Hide the task manager" },
{ on = [ "w" ], run = "close", desc = "Hide the task manager" },

Expand All @@ -172,8 +174,9 @@ keymap = [
[select]

keymap = [
{ on = [ "<C-q>" ], run = "close", desc = "Cancel selection" },
{ on = [ "<Esc>" ], run = "close", desc = "Cancel selection" },
{ on = [ "<C-[>" ], run = "close", desc = "Cancel selection" },
{ on = [ "<C-q>" ], run = "close", desc = "Cancel selection" },
{ on = [ "<Enter>" ], run = "close --submit", desc = "Submit the selection" },

{ on = [ "k" ], run = "arrow -1", desc = "Move cursor up" },
Expand All @@ -197,6 +200,7 @@ keymap = [
{ on = [ "<C-q>" ], run = "close", desc = "Cancel input" },
{ on = [ "<Enter>" ], run = "close --submit", desc = "Submit the input" },
{ on = [ "<Esc>" ], run = "escape", desc = "Go back the normal mode, or cancel input" },
{ on = [ "<C-[>" ], run = "escape", desc = "Go back the normal mode, or cancel input" },

# Mode
{ on = [ "i" ], run = "insert", desc = "Enter insert mode" },
Expand Down Expand Up @@ -279,6 +283,7 @@ keymap = [

keymap = [
{ on = [ "<Esc>" ], run = "escape", desc = "Clear the filter, or hide the help" },
{ on = [ "<C-[>" ], run = "escape", desc = "Clear the filter, or hide the help" },
{ on = [ "q" ], run = "close", desc = "Exit the process" },
{ on = [ "<C-q>" ], run = "close", desc = "Hide the help" },

Expand Down

0 comments on commit b7d9a0a

Please sign in to comment.