From 32b875ada98d8e7e8d50db6966b3a198bedc38fa Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Mon, 20 Jul 2020 21:15:58 -0500 Subject: [PATCH] sample config settigns (#2233) --- docs/sample_config/config.toml | 35 ++++++ docs/sample_config/keybindings.yml | 189 +++++++++++++++++++++++++++++ 2 files changed, 224 insertions(+) create mode 100644 docs/sample_config/config.toml create mode 100644 docs/sample_config/keybindings.yml diff --git a/docs/sample_config/config.toml b/docs/sample_config/config.toml new file mode 100644 index 0000000000..7e9a2a8bd8 --- /dev/null +++ b/docs/sample_config/config.toml @@ -0,0 +1,35 @@ +completion_mode = "circular" +edit_mode = "vi" +history_size = 100000 +key_timeout = 500 + +disable_table_indexes = false +header_align = "l" +header_color = "c" +header_bold = true +nonzero_exit_errors = true +startup = ["alias la [path] {ls --full $path}", "alias nudown [] {fetch https://api.github.com/repos/nushell/nushell/releases | get assets | select name download_count}"] +table_mode = "other" +plugin_dirs = ["D:\\Src\\GitHub\\nu-plugin-lib\\samples\\Nu.Plugin.Len\\bin\\Debug\\netcoreapp3.1"] +pivot_mode = "auto" +ctrlc_exit = false +complete_from_path = true +rm_always_trash = true +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" + +[textview] +term_width = "default" +tab_width = 4 +colored_output = true +true_color = true +header = true +line_numbers = true +grid = false +vcs_modification_markers = true +snip = true +wrapping_mode = "NoWrapping" +use_italics = true +paging_mode = "QuitIfOneScreen" +pager = "less" +theme = "TwoDark" diff --git a/docs/sample_config/keybindings.yml b/docs/sample_config/keybindings.yml new file mode 100644 index 0000000000..0f24cb75d4 --- /dev/null +++ b/docs/sample_config/keybindings.yml @@ -0,0 +1,189 @@ +# 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: +# Ctrl: A +# Available modifiers are Ctrl, F (for function), Meta (escape-char, alt-char) + +# Common +# KeyPress::Home => Cmd::Move(Movement::BeginningOfLine), +- key: + Home: + binding: + Move: BeginningOfLine + +# KeyPress::End => Cmd::Move(Movement::EndOfLine), +- key: + End: + binding: + Move: EndOfLine + +# KeyPress::Left => { +# if positive { +# Cmd::Move(Movement::BackwardChar(n)) +# } else { +# Cmd::Move(Movement::ForwardChar(n)) +# } +# } +- key: + Left: #Left Arrow Key + binding: + Move: + BackwardChar: 1 + +# KeyPress::Right => { +# if positive { +# Cmd::Move(Movement::ForwardChar(n)) +# } else { +# Cmd::Move(Movement::BackwardChar(n)) +# } +# } +- key: + Right: #Right Arrow Key + binding: + Move: + ForwardChar: 1 + +# KeyPress::Ctrl('C') => Cmd::Interrupt, +- key: + Ctrl: C + binding: + Interrupt: + +# KeyPress::Ctrl('D') => Cmd::EndOfFile, +- key: + Ctrl: D + binding: + EndOfFile: + +# KeyPress::Delete => { +# if positive { +# Cmd::Kill(Movement::ForwardChar(n)) +# } else { +# Cmd::Kill(Movement::BackwardChar(n)) +# } +# } +- key: + Delete: + binding: + Kill: + ForwardChar: 1 + +# KeyPress::Ctrl('J') | +# KeyPress::Enter => Cmd::AcceptLine, +- key: + Ctrl: J + binding: + AcceptLine: +- key: + Enter: + binding: + AcceptLine: + +# KeyPress::Down => Cmd::LineDownOrNextHistory(1), +- key: + Down: #Down Arrow Key + binding: + LineDownOrNextHistory: 1 + +# KeyPress::Up => Cmd::LineUpOrPreviousHistory(1), +- key: + Up: #Up Arrow Key + binding: + LineUpOrPreviousHistory: 1 + +# KeyPress::Ctrl('R') => Cmd::ReverseSearchHistory, +- key: + Ctrl: R + binding: + ReverseSearchHistory: + +# KeyPress::Ctrl('S') => Cmd::ForwardSearchHistory, // most terminals override Ctrl+S to suspend execution +- key: + Ctrl: S + binding: + ForwardSearchHistory: + +# KeyPress::Ctrl('T') => Cmd::TransposeChars, +- key: + Ctrl: T + binding: + TransposeChars: + +# KeyPress::Ctrl('U') => { +# if positive { +# Cmd::Kill(Movement::BeginningOfLine) +# } else { +# Cmd::Kill(Movement::EndOfLine) +# } +# }, +- key: + Ctrl: U + binding: + Kill: BeginningOfLine + +# KeyPress::Ctrl('Q') | // most terminals override Ctrl+Q to resume execution +# KeyPress::Ctrl('V') => Cmd::QuotedInsert, +- key: + Ctrl: Q + binding: + QuotedInsert: +- key: + Ctrl: V + binding: + QuotedInsert: + +# KeyPress::Ctrl('W') => { +# if positive { +# Cmd::Kill(Movement::BackwardWord(n, Word::Big)) +# } else { +# Cmd::Kill(Movement::ForwardWord(n, At::AfterEnd, Word::Big)) +# } +# } +- key: + Ctrl: W + binding: + Kill: + BackwardWord: + repeat: 1 + word: Big + +# KeyPress::Ctrl('Y') => { +# if positive { +# Cmd::Yank(n, Anchor::Before) +# } else { +# Cmd::Unknown // TODO Validate +# } +# } +- key: + Ctrl: Y + binding: + Yank: + repeat: 1 + anchor: Before + +# KeyPress::Ctrl('Z') => Cmd::Suspend, +- key: + Ctrl: Z + binding: + Suspend: + +# KeyPress::Ctrl('_') => Cmd::Undo(n), +- key: + Ctrl: '_' + binding: + Undo: 1 + +# KeyPress::UnknownEscSeq => Cmd::Noop, +- key: + UnknownEscSeq: + binding: + Noop: + +# KeyPress::BracketedPasteStart => { +# let paste = rdr.read_pasted_text()?; +# Cmd::Insert(1, paste) +# }, +# _ => Cmd::Unknown, +# })