diff options
Diffstat (limited to 'lib/reline/config.rb')
-rw-r--r-- | lib/reline/config.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/reline/config.rb b/lib/reline/config.rb index 206be5be0e..9b8ddc0536 100644 --- a/lib/reline/config.rb +++ b/lib/reline/config.rb @@ -35,6 +35,10 @@ class Reline::Config show-all-if-ambiguous show-all-if-unmodified visible-stats + show-mode-in-prompt + vi-cmd-mode-icon + vi-ins-mode-icon + emacs-mode-string } VARIABLE_NAME_SYMBOLS = VARIABLE_NAMES.map { |v| :"#{v.tr(?-, ?_)}" } VARIABLE_NAME_SYMBOLS.each do |v| @@ -52,6 +56,9 @@ class Reline::Config @key_actors[:emacs] = Reline::KeyActor::Emacs.new @key_actors[:vi_insert] = Reline::KeyActor::ViInsert.new @key_actors[:vi_command] = Reline::KeyActor::ViCommand.new + @vi_cmd_mode_icon = '(cmd)' + @vi_ins_mode_icon = '(ins)' + @emacs_mode_string = '@' # https://tiswww.case.edu/php/chet/readline/readline.html#IDX25 @history_size = -1 # unlimited @keyseq_timeout = 500 @@ -253,6 +260,21 @@ class Reline::Config end when 'keyseq-timeout' @keyseq_timeout = value.to_i + when 'show-mode-in-prompt' + case value + when 'off' + @show_mode_in_prompt = false + when 'on' + @show_mode_in_prompt = true + else + @show_mode_in_prompt = false + end + when 'vi-cmd-mode-string' + @vi_cmd_mode_icon = value + when 'vi-ins-mode-string' + @vi_ins_mode_icon = value + when 'emacs-mode-string' + @emacs_mode_string = value when *VARIABLE_NAMES then variable_name = :"@#{name.tr(?-, ?_)}" instance_variable_set(variable_name, value.nil? || value == '1' || value == 'on') |