Skip to content

Commit

Permalink
feat: use Ctrl-c instead of Ctrl-q as the universal close key for…
Browse files Browse the repository at this point in the history
… all components (#1047)
  • Loading branch information
sxyazi authored May 16, 2024
1 parent 2683b1d commit 50ae6eb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions yazi-config/preset/keymap.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ keymap = [
{ 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" },
{ on = [ "<C-c>" ], run = "close", desc = "Close the current tab, or quit if it is last tab" },
{ on = [ "<C-z>" ], run = "suspend", desc = "Suspend the process" },

# Navigation
Expand Down Expand Up @@ -157,7 +157,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 = [ "<C-c>" ], run = "close", desc = "Hide the task manager" },
{ on = [ "w" ], run = "close", desc = "Hide the task manager" },

{ on = [ "k" ], run = "arrow -1", desc = "Move cursor up" },
Expand All @@ -177,7 +177,7 @@ keymap = [
keymap = [
{ on = [ "<Esc>" ], run = "close", desc = "Cancel selection" },
{ on = [ "<C-[>" ], run = "close", desc = "Cancel selection" },
{ on = [ "<C-q>" ], run = "close", desc = "Cancel selection" },
{ on = [ "<C-c>" ], 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 @@ -198,7 +198,7 @@ keymap = [
[input]

keymap = [
{ on = [ "<C-q>" ], run = "close", desc = "Cancel input" },
{ on = [ "<C-c>" ], 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" },
Expand Down Expand Up @@ -267,7 +267,7 @@ keymap = [
[completion]

keymap = [
{ on = [ "<C-q>" ], run = "close", desc = "Cancel completion" },
{ on = [ "<C-c>" ], run = "close", desc = "Cancel completion" },
{ on = [ "<Tab>" ], run = "close --submit", desc = "Submit the completion" },
{ on = [ "<Enter>" ], run = [ "close --submit", "close_input --submit" ], desc = "Submit the completion and input" },

Expand All @@ -289,7 +289,7 @@ 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" },
{ on = [ "<C-c>" ], run = "close", desc = "Hide the help" },

# Navigation
{ on = [ "k" ], run = "arrow -1", desc = "Move cursor up" },
Expand Down

0 comments on commit 50ae6eb

Please sign in to comment.