nushell/docs/sample_config/keybindings.yml

441 lines
9.1 KiB
YAML
Raw Normal View History

2020-07-21 02:15:58 +00:00
# These are the common keys acrosso modes taken directly from Rustyline. If
# you want to change the keybinding you should change the letter after
# "key:". If you want to change the modifier you should change or add the
# modifier after "key:", such as:
# key:
# Char: A
# modifiers:
# CTRL:
# binding:
# blah:
# Available modifiers are CTRL, ALT, SHIFT, NONE, CTRL_SHIFT,
# ALT_SHIFT, CTRL_ALT, CTRL_ALT_SHIFT
2020-07-21 02:15:58 +00:00
##########################################################
# Common From https://github.com/kkawakam/rustyline#actions
##########################################################
# Control Backspace, delete 1 word at a time
- key:
Backspace:
modifiers:
CTRL:
binding:
Kill:
BackwardWord:
repeat: 1
word: Big
# Alt Backspace, delete 1 word at a time
- key:
Backspace:
modifiers:
ALT:
binding:
Kill:
BackwardWord:
repeat: 1
word: Big
# Move cursor to the beginning of line
2020-07-21 02:15:58 +00:00
- key:
Home:
binding:
Move: BeginningOfLine
# Move cursor to end of line
2020-07-21 02:15:58 +00:00
- key:
End:
binding:
Move: EndOfLine
# Move cursor one character left
2020-07-21 02:15:58 +00:00
- key:
Left: #Left Arrow Key
binding:
Move:
BackwardChar: 1
# Move cursor one character right
2020-07-21 02:15:58 +00:00
- key:
Right: #Right Arrow Key
binding:
Move:
ForwardChar: 1
# Complete Hint
- key:
Right:
modifiers:
SHIFT:
binding:
CompleteHint:
- key:
Char: F
modifiers:
CTRL:
binding:
CompleteHint:
# Interrupt/Cancel edition
2020-07-21 02:15:58 +00:00
- key:
Char: C
modifiers:
CTRL:
2020-07-21 02:15:58 +00:00
binding:
Interrupt:
# (if line is not empty) Delete character under cursor
2020-07-21 02:15:58 +00:00
- key:
Char: D
modifiers:
CTRL:
2020-07-21 02:15:58 +00:00
binding:
EndOfFile:
# Delete character under cursor
2020-07-21 02:15:58 +00:00
- key:
Delete:
binding:
Kill:
ForwardChar: 1
# Finish the line entry
2020-07-21 02:15:58 +00:00
- key:
Char: J
modifiers:
CTRL:
2020-07-21 02:15:58 +00:00
binding:
AcceptLine:
- key:
Char: M
modifiers:
CTRL:
2020-07-21 02:15:58 +00:00
binding:
AcceptLine:
# This makes multiline editing stop working since Enter accepts a line
# - key:
# Enter:
# binding:
# AcceptLine:
# Next match from history
2020-07-21 02:15:58 +00:00
- key:
Down: #Down Arrow Key
binding:
LineDownOrNextHistory: 1
# Previous match from history
2020-07-21 02:15:58 +00:00
- key:
Up: #Up Arrow Key
binding:
LineUpOrPreviousHistory: 1
# Reverse Search history (Ctrl-S forward, Ctrl-G cancel)
2020-07-21 02:15:58 +00:00
- key:
Char: R
modifiers:
CTRL:
2020-07-21 02:15:58 +00:00
binding:
ReverseSearchHistory:
# Forward Search history (Ctrl-R backward, Ctrl-G cancel)
2020-07-21 02:15:58 +00:00
- key:
Char: S
modifiers:
CTRL:
2020-07-21 02:15:58 +00:00
binding:
ForwardSearchHistory:
# Transpose previous character with current character
2020-07-21 02:15:58 +00:00
- key:
Char: T
modifiers:
CTRL:
2020-07-21 02:15:58 +00:00
binding:
TransposeChars:
# Delete from start of line to cursor
2020-07-21 02:15:58 +00:00
- key:
Char: U
modifiers:
CTRL:
2020-07-21 02:15:58 +00:00
binding:
Kill: BeginningOfLine
# Insert any special character without performing its associated action (#65)
2020-07-21 02:15:58 +00:00
- key:
Char: Q
modifiers:
CTRL:
2020-07-21 02:15:58 +00:00
binding:
QuotedInsert:
- key:
Char: V
modifiers:
CTRL:
2020-07-21 02:15:58 +00:00
binding:
QuotedInsert:
# Delete word leading up to cursor (using white space as a word boundary)
2020-07-21 02:15:58 +00:00
- key:
Char: W
modifiers:
CTRL:
2020-07-21 02:15:58 +00:00
binding:
Kill:
BackwardWord:
repeat: 1
word: Big
# Paste from Yank buffer
2020-07-21 02:15:58 +00:00
- key:
Char: Y
modifiers:
CTRL:
2020-07-21 02:15:58 +00:00
binding:
Yank:
repeat: 1
anchor: Before
# Suspend (Unix only)
2020-07-21 02:15:58 +00:00
- key:
Char: Z
modifiers:
CTRL:
2020-07-21 02:15:58 +00:00
binding:
Suspend:
# Undo
2020-07-21 02:15:58 +00:00
- key:
Char: "_"
modifiers:
CTRL:
2020-07-21 02:15:58 +00:00
binding:
Undo: 1
# KeyPress::UnknownEscSeq => Cmd::Noop,
2020-07-21 02:15:58 +00:00
- key:
UnknownEscSeq:
binding:
Noop:
##########################################################
# Possible options for key:
##########################################################
# /// Unsupported escape sequence (on unix platform)
# UnknownEscSeq,
# /// ⌫ or `KeyEvent::Ctrl('H')`
# Backspace,
# /// ⇤ (usually Shift-Tab)
# BackTab,
# /// Paste (on unix platform)
# BracketedPasteStart,
# /// Paste (on unix platform)
# BracketedPasteEnd,
# /// Single char
# Char(char),
# /// ⌦
# Delete,
# /// ↓ arrow key
# Down,
# /// ⇲
# End,
# /// ↵ or `KeyEvent::Ctrl('M')`
# Enter,
# /// Escape or `KeyEvent::Ctrl('[')`
# Esc,
# /// Function key
# F(u8),
# /// ⇱
# Home,
# /// Insert key
# Insert,
# /// ← arrow key
# Left,
# // /// `KeyEvent::Char('\0')`
# Null,
# /// ⇟
# PageDown,
# /// ⇞
# PageUp,
# /// → arrow key
# Right,
# /// ⇥ or `KeyEvent::Ctrl('I')`
# Tab,
# /// ↑ arrow key
# Up,
##########################################################
# Possible options for command binding
##########################################################
# /// abort
# Abort, // Miscellaneous Command
# /// accept-line
# AcceptLine,
# /// beginning-of-history
# BeginningOfHistory,
# /// capitalize-word
# CapitalizeWord,
# /// clear-screen
# ClearScreen,
# /// complete
# Complete,
# /// complete-backward
# CompleteBackward,
# /// complete-hint
# CompleteHint,
# /// Dedent current line
# Dedent(Movement),
# /// downcase-word
# DowncaseWord,
# /// vi-eof-maybe
# EndOfFile,
# /// end-of-history
# EndOfHistory,
# /// forward-search-history
# ForwardSearchHistory,
# /// history-search-backward
# HistorySearchBackward,
# /// history-search-forward
# HistorySearchForward,
# /// Indent current line
# Indent(Movement),
# /// Insert text
# Insert { repeat: RepeatCount, string: String },
# /// Interrupt signal (Ctrl-C)
# Interrupt,
# /// backward-delete-char, backward-kill-line, backward-kill-word
# /// delete-char, kill-line, kill-word, unix-line-discard, unix-word-rubout,
# /// vi-delete, vi-delete-to, vi-rubout
# Kill(Movement),
# /// backward-char, backward-word, beginning-of-line, end-of-line,
# /// forward-char, forward-word, vi-char-search, vi-end-word, vi-next-word,
# /// vi-prev-word
# Move(Movement),
# /// Inserts a newline
# Newline,
# /// next-history
# NextHistory,
# /// No action
# Noop,
# /// vi-replace
# Overwrite(char),
# /// Paste from the clipboard
# #[cfg(windows)]
# PasteFromClipboard,
# /// previous-history
# PreviousHistory,
# /// quoted-insert
# QuotedInsert,
# /// vi-change-char
# ReplaceChar { repeat: RepeatCount, ch: char },
# /// vi-change-to, vi-substitute
# Replace {
# movement: Movement,
# replacement: Option<String>,
# },
# /// reverse-search-history
# ReverseSearchHistory,
# /// self-insert
# SelfInsert { repeat: RepeatCount, ch: char },
# /// Suspend signal (Ctrl-Z on unix platform)
# Suspend,
# /// transpose-chars
# TransposeChars,
# /// transpose-words
# TransposeWords(RepeatCount),
# /// undo
# Undo(RepeatCount),
# /// Unsupported / unexpected
# Unknown,
# /// upcase-word
# UpcaseWord,
# /// vi-yank-to
# ViYankTo(Movement),
# /// yank, vi-put
# Yank { repeat: RepeatCount, anchor: Anchor },
# /// yank-pop
# YankPop,
# /// moves cursor to the line above or switches to prev history entry if
# /// the cursor is already on the first line
# LineUpOrPreviousHistory(RepeatCount),
# /// moves cursor to the line below or switches to next history entry if
# /// the cursor is already on the last line
# LineDownOrNextHistory(RepeatCount),
# /// accepts the line when cursor is at the end of the text (non including
# /// trailing whitespace), inserts newline character otherwise
# AcceptOrInsertLine,
##########################################################
# Possible options for Word
##########################################################
# /// non-blanks characters
# Big,
# /// alphanumeric characters
# Emacs,
# /// alphanumeric (and '_') characters
# Vi,
##########################################################
# Possible options for At
##########################################################
# /// Start of word.
# Start,
# /// Before end of word.
# BeforeEnd,
# /// After end of word.
# AfterEnd,
##########################################################
# Possible options for Anchor
##########################################################
# /// After cursor
# After,
# /// Before cursor
# Before,
##########################################################
# Possible options for CharSearch
##########################################################
# /// Forward search
# Forward(char),
# /// Forward search until
# ForwardBefore(char),
# /// Backward search
# Backward(char),
# /// Backward search until
# BackwardAfter(char),
##########################################################
# Possible options for Movement
##########################################################
# /// Whole current line (not really a movement but a range)
# WholeLine,
# /// beginning-of-line
# BeginningOfLine,
# /// end-of-line
# EndOfLine,
# /// backward-word, vi-prev-word
# BackwardWord(RepeatCount, Word), // Backward until start of word
# /// forward-word, vi-end-word, vi-next-word
# ForwardWord(RepeatCount, At, Word), // Forward until start/end of word
# /// vi-char-search
# ViCharSearch(RepeatCount, CharSearch),
# /// vi-first-print
# ViFirstPrint,
# /// backward-char
# BackwardChar(RepeatCount),
# /// forward-char
# ForwardChar(RepeatCount),
# /// move to the same column on the previous line
# LineUp(RepeatCount),
# /// move to the same column on the next line
# LineDown(RepeatCount),
# /// Whole user input (not really a movement but a range)
# WholeBuffer,
# /// beginning-of-buffer
# BeginningOfBuffer,
# /// end-of-buffer
# EndOfBuffer,