update sample configs (#2242)

* update sample configs

* change rustyline to line_editor
This commit is contained in:
Darren Schroeder 2020-07-23 06:49:25 -05:00 committed by GitHub
parent 7e9f87c57f
commit 9b35aae5e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 69 deletions

View File

@ -1,8 +1,3 @@
completion_mode = "circular"
edit_mode = "vi"
history_size = 100000
key_timeout = 500
disable_table_indexes = false disable_table_indexes = false
header_align = "l" header_align = "l"
header_color = "c" header_color = "c"
@ -18,6 +13,19 @@ rm_always_trash = true
use_starship = false use_starship = false
prompt = "echo [ $(ansi gb) $(pwd) $(ansi reset) \"(\" $(ansi cb) $(do -i { git rev-parse --abbrev-ref HEAD | trim }) $(ansi reset) \")\" $(char newline) $(ansi yb) $(date --format \"%m/%d/%Y %I:%M:%S%.3f %p\" --raw) $(ansi reset) \"> \" ] | str collect" prompt = "echo [ $(ansi gb) $(pwd) $(ansi reset) \"(\" $(ansi cb) $(do -i { git rev-parse --abbrev-ref HEAD | trim }) $(ansi reset) \")\" $(char newline) $(ansi yb) $(date --format \"%m/%d/%Y %I:%M:%S%.3f %p\" --raw) $(ansi reset) \"> \" ] | str collect"
[line_editor]
max_history_size = 100000
history_duplicates = "alwaysadd" # alwaysadd,ignoreconsecutive
history_ignore_space = true
completion_type = "circular" # circular, list, fuzzy
completion_prompt_limit = 1
keyseq_timeout_ms = 500 # ms
edit_mode = "vi" # vi, emacs
auto_add_history = true
bell_style = "audible" # audible, none, visible
color_mode = "enabled" # enabled, forced, disabled
tab_stop = 4
[textview] [textview]
term_width = "default" term_width = "default"
tab_width = 4 tab_width = 4
@ -33,3 +41,7 @@ use_italics = true
paging_mode = "QuitIfOneScreen" paging_mode = "QuitIfOneScreen"
pager = "less" pager = "less"
theme = "TwoDark" theme = "TwoDark"
# To add path and env do this
# > config set path $nu.path
# > config set env $nu.env

View File

@ -6,125 +6,104 @@
# Ctrl: A # Ctrl: A
# Available modifiers are Ctrl, F (for function), Meta (escape-char, alt-char) # Available modifiers are Ctrl, F (for function), Meta (escape-char, alt-char)
# Common # Common From https://github.com/kkawakam/rustyline#actions
# KeyPress::Home => Cmd::Move(Movement::BeginningOfLine),
# Move cursor to the beginning of line
- key: - key:
Home: Home:
binding: binding:
Move: BeginningOfLine Move: BeginningOfLine
# KeyPress::End => Cmd::Move(Movement::EndOfLine), # Move cursor to end of line
- key: - key:
End: End:
binding: binding:
Move: EndOfLine Move: EndOfLine
# KeyPress::Left => { # Move cursor one character left
# if positive {
# Cmd::Move(Movement::BackwardChar(n))
# } else {
# Cmd::Move(Movement::ForwardChar(n))
# }
# }
- key: - key:
Left: #Left Arrow Key Left: #Left Arrow Key
binding: binding:
Move: Move:
BackwardChar: 1 BackwardChar: 1
# KeyPress::Right => { # Move cursor one character right
# if positive {
# Cmd::Move(Movement::ForwardChar(n))
# } else {
# Cmd::Move(Movement::BackwardChar(n))
# }
# }
- key: - key:
Right: #Right Arrow Key Right: #Right Arrow Key
binding: binding:
Move: Move:
ForwardChar: 1 ForwardChar: 1
# KeyPress::Ctrl('C') => Cmd::Interrupt, # Interrupt/Cancel edition
- key: - key:
Ctrl: C Ctrl: C
binding: binding:
Interrupt: Interrupt:
# KeyPress::Ctrl('D') => Cmd::EndOfFile, # (if line is not empty) Delete character under cursor
- key: - key:
Ctrl: D Ctrl: D
binding: binding:
EndOfFile: EndOfFile:
# KeyPress::Delete => { # Delete character under cursor
# if positive {
# Cmd::Kill(Movement::ForwardChar(n))
# } else {
# Cmd::Kill(Movement::BackwardChar(n))
# }
# }
- key: - key:
Delete: Delete:
binding: binding:
Kill: Kill:
ForwardChar: 1 ForwardChar: 1
# KeyPress::Ctrl('J') | # Finish the line entry
# KeyPress::Enter => Cmd::AcceptLine,
- key: - key:
Ctrl: J Ctrl: J
binding: binding:
AcceptLine: AcceptLine:
- key:
Ctrl: M
binding:
AcceptLine:
- key: - key:
Enter: Enter:
binding: binding:
AcceptLine: AcceptLine:
# KeyPress::Down => Cmd::LineDownOrNextHistory(1), # Next match from history
- key: - key:
Down: #Down Arrow Key Down: #Down Arrow Key
binding: binding:
LineDownOrNextHistory: 1 LineDownOrNextHistory: 1
# KeyPress::Up => Cmd::LineUpOrPreviousHistory(1), # Previous match from history
- key: - key:
Up: #Up Arrow Key Up: #Up Arrow Key
binding: binding:
LineUpOrPreviousHistory: 1 LineUpOrPreviousHistory: 1
# KeyPress::Ctrl('R') => Cmd::ReverseSearchHistory, # Reverse Search history (Ctrl-S forward, Ctrl-G cancel)
- key: - key:
Ctrl: R Ctrl: R
binding: binding:
ReverseSearchHistory: ReverseSearchHistory:
# KeyPress::Ctrl('S') => Cmd::ForwardSearchHistory, // most terminals override Ctrl+S to suspend execution # Forward Search history (Ctrl-R backward, Ctrl-G cancel)
- key: - key:
Ctrl: S Ctrl: S
binding: binding:
ForwardSearchHistory: ForwardSearchHistory:
# KeyPress::Ctrl('T') => Cmd::TransposeChars, # Transpose previous character with current character
- key: - key:
Ctrl: T Ctrl: T
binding: binding:
TransposeChars: TransposeChars:
# KeyPress::Ctrl('U') => { # Delete from start of line to cursor
# if positive {
# Cmd::Kill(Movement::BeginningOfLine)
# } else {
# Cmd::Kill(Movement::EndOfLine)
# }
# },
- key: - key:
Ctrl: U Ctrl: U
binding: binding:
Kill: BeginningOfLine Kill: BeginningOfLine
# KeyPress::Ctrl('Q') | // most terminals override Ctrl+Q to resume execution # Insert any special character without performing its associated action (#65)
# KeyPress::Ctrl('V') => Cmd::QuotedInsert,
- key: - key:
Ctrl: Q Ctrl: Q
binding: binding:
@ -134,13 +113,7 @@
binding: binding:
QuotedInsert: QuotedInsert:
# KeyPress::Ctrl('W') => { # Delete word leading up to cursor (using white space as a word boundary)
# if positive {
# Cmd::Kill(Movement::BackwardWord(n, Word::Big))
# } else {
# Cmd::Kill(Movement::ForwardWord(n, At::AfterEnd, Word::Big))
# }
# }
- key: - key:
Ctrl: W Ctrl: W
binding: binding:
@ -149,13 +122,7 @@
repeat: 1 repeat: 1
word: Big word: Big
# KeyPress::Ctrl('Y') => { # Paste from Yank buffer
# if positive {
# Cmd::Yank(n, Anchor::Before)
# } else {
# Cmd::Unknown // TODO Validate
# }
# }
- key: - key:
Ctrl: Y Ctrl: Y
binding: binding:
@ -163,13 +130,13 @@
repeat: 1 repeat: 1
anchor: Before anchor: Before
# KeyPress::Ctrl('Z') => Cmd::Suspend, # Suspend (Unix only)
- key: - key:
Ctrl: Z Ctrl: Z
binding: binding:
Suspend: Suspend:
# KeyPress::Ctrl('_') => Cmd::Undo(n), # Undo
- key: - key:
Ctrl: '_' Ctrl: '_'
binding: binding:
@ -181,9 +148,3 @@
binding: binding:
Noop: Noop:
# KeyPress::BracketedPasteStart => {
# let paste = rdr.read_pasted_text()?;
# Cmd::Insert(1, paste)
# },
# _ => Cmd::Unknown,
# })