config/keymap/vim.rb in ver-2009.12.14 vs config/keymap/vim.rb in ver-2010.02
- old
+ new
@@ -1,384 +1,462 @@
module VER
- class Keymap
- def self.vim(options)
- vim = new(options)
- vim.mode = options.fetch(:mode, :control)
+ minor_mode :help do
+ handler Methods::Help
- vim.add_mode :basic do |mode|
- mode.map :file_open_popup, %w[Control-o]
- mode.map :file_open_fuzzy, %w[Alt-o], %w[Control-m o]
- mode.map :status_evaluate, %w[Alt-x], %w[Control-m x]
- mode.map :file_save, %w[Control-s]
- mode.map :file_save_popup, %w[Control-Alt-s]
- mode.map :quit, %w[Control-q]
- mode.map :start_control_mode, %w[Escape], %w[Control-c]
- mode.map :open_method_list, %w[F10]
- mode.map :open_terminal, %w[F9]
- mode.map :describe_key, %w[Control-h k]
- mode.map :help_for_help, %w[Control-h question], %w[F1], %w[Help]
- mode.map :tags_at, %w[Control-g t]
+ map :describe_key, %w[Control-h k]
+ end
- mode.map :open_grep_list, %w[Control-Alt-g], %w[Control-m Control-g]
- mode.map :grep_buffer, %w[Alt-g], %w[Control-m g]
- mode.map :grep_buffers, %w[Alt-G], %w[Control-m G]
+ minor_mode :open do
+ handler Methods::Open
- mode.map :buffer_switch, %w[Alt-b], %w[Control-m b]
- mode.map :window_switch, %w[Alt-B], %w[Control-m B]
- mode.map :open_console, %w[Control-exclam]
- end
+ map :file_open_popup, %w[Control-o]
+ map :file_open_fuzzy, %w[Alt-o], %w[Control-m o]
+ map :file_open_ask, %w[colon o space]
+ end
- vim.add_mode :views do |mode|
- mode.map :view_one, %w[Control-w KeyPress-1]
- mode.map :view_two, %w[Control-w KeyPress-2]
+ minor_mode :save do
+ handler Methods::Save
+ map :save, %w[Control-s], %w[colon w Return]
+ map :save_as, %w[Control-S], %w[colon w space]
+ map :save_all, %w[colon w a]
+ map :quit, %w[colon q a], %w[Z Z]
+ end
- mode.map :view_slave_inc, %w[Control-w plus]
- mode.map :view_slave_dec, %w[Control-w minus]
+ minor_mode :preview do
+ handler Methods::Preview
- mode.map :view_master_inc, %w[Control-w H]
- mode.map :view_master_dec, %w[Control-w L]
+ map :preview, %w[F5]
+ end
- mode.map :view_create, %w[Control-w c]
- mode.map :view_focus_next, %w[Control-w j]
- mode.map :view_focus_prev, %w[Control-w k]
- mode.map :view_push_down, %w[Control-w J]
- mode.map :view_push_up, %w[Control-w K]
- mode.map :view_close, %w[Control-w w]
- mode.map :view_push_top, %w[Control-w Return]
- mode.map :view_push_bottom, %w[Control-w BackSpace]
- end
+ minor_mode :basic do
+ inherits :help, :preview, :save, :open
- vim.add_mode :move do |mode|
- mode.map :beginning_of_line, %w[KeyPress-0], %w[Home]
- mode.map :backward_char, %w[h], %w[Left]
- mode.map :forward_char, %w[l], %w[Right]
- mode.map :end_of_file, %w[G]
- mode.map :end_of_line, %w[dollar], %w[End]
- mode.map :go_line, %w[g g]
- mode.map :next_line, %w[j], %w[Down], %w[Control-n]
- mode.map :previous_line, %w[k], %w[Up], %w[Control-p]
- mode.map :next_newline_block, %w[braceleft]
- mode.map :page_down, %w[Control-f], %w[Next]
- mode.map :page_up, %w[Control-b], %w[Prior]
- mode.map :prev_newline_block, %w[braceright]
- mode.map :backward_word, %w[b], %w[Shift-Left]
- mode.map :backward_chunk, %w[B]
- mode.map :forward_word, %w[w], %w[Shift-Right]
- mode.map :forward_chunk, %w[W]
- mode.map :word_right_end, %w[e]
- mode.map :matching_brace, %w[percent]
- end
+ handler Methods::Basic
+ map :source_buffer, %w[Control-R]
+ map :status_evaluate, %w[Alt-x], %w[Control-m x]
+ map :tags_at, %w[Control-g t]
- vim.add_mode :search do |mode|
- mode.map :search_next, %w[n]
- mode.map :search_next_word_under_cursor, %w[asterisk]
- mode.map :search_prev, %w[N]
- mode.map :search_prev_word_under_cursor, %w[numbersign]
- mode.map :status_search_next, %w[slash]
- mode.map :status_search_prev, %w[question]
- mode.map :search_char_right, %w[f]
- mode.map :search_char_left, %w[F]
- end
+ map :open_terminal, %w[F9]
+ map :open_console, %w[Control-exclam] if defined?(::EM)
+ end
- vim.add_mode :ctags do |mode|
- mode.map :ctags_find_current, %w[Control-bracketright] # C-]
- mode.map :ctags_prev, %w[Control-bracketleft] # C-[
- end
+ minor_mode :layout do
+ inherits :basic
+ handler Methods::Layout
- vim.add_mode :bookmark do |mode|
- mode.arguments = false
+ map :one, %w[1]
+ map :two, %w[2]
- mode.map :char_bookmark_add, %w[m]
- mode.map :char_bookmark_visit, %w[quoteleft]
- # vim also has quoteright to jump to the start of the line, but who
- # needs that *_*
- end
+ map :slave_inc, %w[plus]
+ map :slave_dec, %w[minus]
- vim.add_mode :complete do |mode|
- mode.arguments = false
+ map :master_inc, %w[H]
+ map :master_dec, %w[L]
- mode.map :complete_file, %w[Control-x Control-f]
- mode.map :complete_line, %w[Control-x Control-l]
- mode.map :complete_word, %w[Control-x Control-w]
- mode.map :complete_aspell, %w[Control-x Control-a]
- mode.map :complete_tm, %w[Control-x Control-x]
- mode.map :smart_tab, %w[Tab]
- end
+ map :create, %w[c]
+ map :focus_next, %w[j], %w[Right]
+ map :focus_prev, %w[k], %w[Left]
+ map :push_down, %w[J], %w[Down]
+ map :push_up, %w[K], %w[Up]
+ map :close, %w[w]
+ map :push_top, %w[Return]
+ map :push_bottom, %w[BackSpace]
- vim.add_mode :control do |mode|
- mode.inherits :basic, :move, :views, :search, :ctags, :bookmark
+ map :master_shrink, %w[h]
+ map :master_grow, %w[l]
+ map :master_equal, %w[equal]
- mode.map :copy_left_word, %w[y b]
- mode.map :copy_line, %w[y y], %w[Y]
- mode.map :copy_right_word, %w[y w]
- mode.map :kill_line, %w[d d]
- mode.map :change_line, %w[c c]
- mode.map [:kill_motion, :backward_char], %w[X]
- mode.map [:kill_motion, :forward_char], %w[x]
- mode.map [:kill_motion, :end_of_line], %w[D]
- mode.map [:change_motion, :end_of_line], %w[C]
+ map :peer, %w[p]
+ end
- mode.map :change_motion, ['c', :move]
- mode.map :kill_motion, ['d', :move]
+ minor_mode :layout_control do
+ become :layout, %w[Control-w r]
- mode.map :eol_then_insert_mode, %w[A]
- mode.map :forward_char_then_insert_mode, %w[a]
+ handler Methods::Layout
+ map :change, ['Control-w', :layout]
+ map :focus_next, %w[Control-Tab]
+ map :focus_prev, %w[Control-Shift-Tab], %w[Control-ISO_Left_Tab]
+ map :cycle_next, %w[Alt-Tab], %w[colon b n]
+ map :cycle_prev, %w[Alt-Shift-Tab], %w[Alt-ISO_Left_Tab], %w[colon b p]
+ map :close, %w[colon q Return], %w[colon x]
+ end
- mode.map :indent_line, %w[greater]
- mode.map :insert_indented_newline_above, %w[O]
- mode.map :insert_indented_newline_below, %w[o]
- mode.map :join_lines, %w[J]
- mode.map :paste, %w[p]
- mode.map :replace_char, %w[r]
- mode.map :smart_evaluate, %w[Alt-e], %w[Control-m e]
- mode.map :sol_then_insert_mode, %w[I]
- mode.map :start_insert_mode, %w[i]
- mode.map :start_replace_mode, %w[R]
- mode.map :start_select_block_mode, %w[Control-v]
- mode.map :start_select_char_mode, %w[v]
- mode.map :start_select_line_mode, %w[V]
- mode.map :status_theme_select, %w[Alt-t], %w[Control-m t]
- mode.map :syntax_switch, %w[Control-y]
- mode.map :theme_switch, %w[Control-t]
- mode.map :unindent_line, %w[less]
- mode.map :wrap_line, %w[g w]
- mode.map :preview, %w[F5]
- mode.map :status_ex, %w[colon]
- mode.map :syntax_indent_file, %w[equal]
- mode.map :repeat_command, %w[period]
+ minor_mode :move do
+ inherits :prefix
- mode.map :undo, %w[u]
- mode.map :redo, %w[Control-r]
- end
+ handler Methods::Move
+ (0..9).each{|n| map :ask_go_line, ['colon', n.to_s] }
+ map :prev_char, %w[h], %w[Left]
+ map :prev_chunk, %w[B]
+ map :prev_word, %w[b], %w[Shift-Left]
+ map :start_of_line, %w[Home]
+ map :prefix_arg_sol, %w[0]
+ map :end_of_text, %w[G]
+ map :end_of_line, %w[dollar], %w[End]
+ map :next_char, %w[l], %w[Right]
+ map :next_chunk, %w[W]
+ map :next_word, %w[w], %w[Shift-Right]
+ map :go_line, %w[g g]
+ map :matching_brace, %w[percent]
+ map :next_line, %w[j], %w[Down], %w[Control-n]
+ map :next_page, %w[Control-f], %w[Next]
+ map :prev_page, %w[Control-b], %w[Prior]
+ map :prev_line, %w[k], %w[Up], %w[Control-p]
+ map :next_word_end, %w[e]
+ end
- vim.add_mode :readline do |mode|
- mode.arguments = false
+ minor_mode :prefix do
+ map(:update_prefix_arg, *('0'..'9'))
+ end
- mode.map [:kill_motion, :backward_char], %w[BackSpace]
- mode.map [:kill_motion, :forward_char], %w[Delete], %w[Control-d]
- mode.map [:kill_motion, :backward_word], %w[Control-w]
- mode.map :backward_char, %w[Left], %w[Control-b]
- mode.map :forward_char, %w[Right], %w[Control-f]
- mode.map :backward_word, %w[Shift-Left], %w[Alt-b]
- mode.map :forward_word, %w[Shift-Right], %w[Alt-f]
- mode.map :beginning_of_line, %w[Home], %w[Control-a]
- mode.map :end_of_line, %w[End], %w[Control-e]
- mode.map :insert_selection, %w[Shift-Insert]
- mode.map :accept_line, %w[Return]
- mode.map :previous_history, %w[Up], %w[Control-p]
- mode.map :next_history, %w[Down], %w[Control-n]
- mode.map :beginning_of_history, %w[Control-less]
- mode.map :end_of_history, %w[Control-greater]
- mode.map :transpose_chars, %w[Control-t]
- mode.map :insert_tab, %w[Control-v Tab]
+ minor_mode :search do
+ handler Methods::Search
- KEYSYMS.each do |sym, name|
- mode.map [:insert_string, sym], [name]
- end
- end
+ map :char_left, %w[F]
+ map :char_right, %w[f]
+ map :next, %w[n]
+ map :next_word_under_cursor, %w[asterisk]
+ map :prev, %w[N]
+ map :prev_word_under_cursor, %w[numbersign]
+ map :remove, %w[g slash]
+ map :status_next, %w[slash]
+ map :status_prev, %w[question]
+ end
- vim.add_mode :insert do |mode|
- mode.inherits :basic, :views, :complete, :readline
- mode.arguments = false
+ minor_mode :ctags do
+ handler Methods::CTags
- mode.map :next_line, %w[Down], %w[Control-n]
- mode.map :previous_line, %w[Up], %w[Control-p]
- mode.map :page_down, %w[Control-f], %w[Next], %w[Shift-Down]
- mode.map :page_up, %w[Control-b], %w[Prior], %w[Shift-Up]
- mode.map :insert_indented_newline, %w[Return]
- mode.map :smart_evaluate, %w[Alt-e], %w[Control-e]
+ map :find_current, %w[Control-bracketright] # C-]
+ map :prev, %w[Control-bracketleft] # C-[
+ end
- mode.missing :insert_string
- end
+ minor_mode :bookmark do
+ handler Methods::Bookmark
- vim.add_mode :replace do |mode|
- mode.inherits :insert
- mode.arguments = false
+ map :add_char, %w[m]
+ map :visit_char, %w[quoteleft]
+ # vim also has quoteright to jump to the start of the line, but who
+ # needs that *_*
+ end
- mode.missing :replace_string
- end
+ minor_mode :complete do
+ handler Methods::Completion
- vim.add_mode :select do |mode|
- mode.inherits :basic, :move, :search
+ map :aspell, %w[Control-x Control-a]
+ map :contextual, %w[Control-x Control-x]
+ map :file, %w[Control-x Control-f]
+ map :line, %w[Control-x Control-l]
+ map :snippet, %w[Control-x Control-s]
+ map :word, %w[Control-x Control-w]
+ map :smart_tab, %w[Tab]
+ end
- mode.map :copy_selection, %w[y], %w[Y]
- mode.map :kill_selection, %w[d], %w[D], %w[x], %w[BackSpace], %w[Delete]
- mode.map :indent_selection, %w[greater]
- mode.map :pipe_selection, %w[exclam]
- mode.map :smart_evaluate, %w[Alt-e], %w[Control-e]
- mode.map :switch_select_block_mode, %w[Control-v]
- mode.map :switch_select_char_mode, %w[v]
- mode.map :switch_select_line_mode, %w[V]
- mode.map :unindent_selection, %w[less]
- mode.map :comment_selection, %w[comma c]
- mode.map :uncomment_selection, %w[comma u]
- mode.map :wrap_selection, %w[g w]
- mode.map :selection_replace_char, %w[r]
- mode.map :selection_replace_string, %w[c]
- mode.map [:finish_selection, :control], %w[Escape], %w[Control-c]
- end
+ minor_mode :delete do
+ handler Methods::Delete
- vim.add_mode :select_char do |mode|
- mode.inherits :select
- end
+ map :change_line, %w[c c]
+ map :kill_line, %w[d d]
+ map :kill_motion, ['d', :move]
+ map :change_motion, ['c', :move]
+ map [:change_motion, :end_of_line], %w[C]
+ map [:change_word_right_end], %w[c w]
+ map [:kill_motion, :prev_char], %w[X]
+ map [:kill_motion, :end_of_line], %w[D]
+ map [:kill_motion, :next_char], %w[x]
+ end
- vim.add_mode :select_line do |mode|
- mode.inherits :select
- end
+ minor_mode :clipboard do
+ handler Methods::Clipboard
- vim.add_mode :select_block do |mode|
- mode.inherits :select
- end
+ map :copy_line, %w[y y], %w[Y]
+ map :copy_motion, ['y', :move]
+ map :paste, %w[p]
+ map :paste_above, %w[P]
+ end
- vim.add_mode :status_query do |mode|
- mode.inherits :basic, :readline
- mode.arguments = false
+ minor_mode :undo do
+ handler Methods::Undo
- mode.map :ask_abort, %w[Escape], %w[Control-c]
- mode.map :history_prev, %w[Up], %w[Control-p]
- mode.map :history_next, %w[Down], %w[Control-n]
- mode.map :history_complete, %w[Tab]
- mode.map :ask_submit, %w[Return]
+ map :redo, %w[Control-r]
+ map :undo, %w[u]
+ end
- mode.missing :insert_string
- end
+ minor_mode :control do
+ inherits :basic, :move, :delete, :undo, :layout_control, :search, :ctags,
+ :bookmark, :clipboard
- vim.add_mode :list_view_entry do |mode|
- mode.inherits :basic, :readline
- mode.arguments = false
+ become :select_block, %w[Control-v]
+ become :select_char, %w[v]
+ become :select_line, %w[V]
+ become :insert, %w[i]
+ become :replace, %w[R]
+ become :replace_char, %w[r]
- # mode.map :update, %w[Key]
- mode.map :pick_selection, %w[Return]
- mode.map :cancel, %w[Escape], %w[Control-c]
- mode.map :line_up, %w[Up]
- mode.map :line_down, %w[Down]
- mode.map :completion, %w[Tab]
+ handler Methods::Control
+ enter :enter
+ leave :leave
+ map :chdir, %w[g c]
- mode.missing :insert_string
- end
+ map :cursor_vertical_bottom, %w[z b]
+ map :cursor_vertical_bottom_sol, %w[z minus]
+ map :cursor_vertical_center, %w[z z]
+ map :cursor_vertical_center_sol, %w[z period]
+ map :cursor_vertical_top, %w[z t]
+ map :cursor_vertical_top_sol, %w[z Return]
- vim.add_mode :list_view_list do |mode|
- mode.inherits :basic
+ map [:insert_at, :end_of_line], %w[A]
+ map [:insert_at, :next_char], %w[a]
- mode.map :pick_selection, %w[Return], %w[Double-Button-1]
- mode.map :line_up, %w[Up]
- mode.map :line_down, %w[Down]
- end
+ map :indent_line, %w[greater]
+ map :unindent_line, %w[less]
- vim.add_mode :hover_completion do |mode|
- mode.inherits :basic
+ map :join_line_forward, %w[J]
- mode.map :go_up, %w[Up], %w[k]
- mode.map :go_down, %w[Down], %w[j]
- mode.map :continue_completion, %w[Right], %w[l]
- mode.map :submit, %w[Return]
- mode.map :cancel, %w[Escape], %w[BackSpace]
- end
+ map :open_file_under_cursor, %w[g f]
- vim.ignore_sends = [
- :repeat_command,
- :start_control_mode,
- :start_insert_mode,
- :start_replace_mode,
- :start_select_block_mode,
- :start_select_char_mode,
- :start_select_line_mode,
- ]
+ map :repeat_command, %w[period]
+ map :smart_evaluate, %w[Alt-e], %w[Control-m e]
- vim.accumulate_sends = [
- :insert_string
- ]
+ map [:insert_at, :home_of_line], %w[I]
- vim
- end
+ map :executor, %w[colon colon]
+ map [:ex, :buffer], %w[colon b u], %w[Alt-b], %w[Control-m b]
+ map [:ex, :edit], %w[colon e space]
+ map [:ex, :fuzzy], %w[colon f]
+ map [:ex, :grep], %w[colon g]
+ map [:ex, :grep_buffers], %w[colon G]
+ map [:ex, :locate], %w[colon l]
+ map [:ex, :method], %w[colon m]
+ map [:ex, :open], %w[colon o Return]
+ map [:ex, :syntax], %w[colon s]
+ map [:ex, :theme], %w[colon t]
+ # map [:ex, :write], %w[colon w]
+
+ map :toggle_case, %w[asciitilde]
+ map :wrap_line, %w[g w]
+
+ handler Methods::Insert
+ map :newline_above, %w[O]
+ map :newline_below, %w[o]
+
+ handler Methods::SearchAndReplace
+ map :query, %w[Alt-percent]
end
-end
-__END__
- vim.add_mode :console_entry do |mode|
- mode.inherits :basic, :readline
- mode.arguments = false
+ minor_mode :readline do
+ map :accept_line, %w[Return]
-# mode.map :execute, %w[Return]
-# mode.map :cancel, %w[Escape], %w[Control-c]
-# mode.map :history_up, %w[Up]
-# mode.map :history_down, %w[Down]
+ map :end_of_line, %w[End], %w[Control-e]
+ map :insert_selection, %w[Shift-Insert]
+ map :insert_tab, %w[Control-v Tab], %w[Control-i]
+ map :kill_end_of_line, %w[Control-k]
+ map :kill_next_char, %w[Control-d], %w[Delete]
+ map :kill_next_word, %w[Alt-d]
+ map :kill_prev_char, %w[BackSpace]
+ map :kill_prev_word, %w[Control-w]
+ map :next_char, %w[Right], %w[Control-f]
+ map :next_word, %w[Shift-Right], %w[Alt-f]
+ map :prev_char, %w[Left], %w[Control-b]
+ map :prev_word, %w[Shift-Left], %w[Alt-b]
+ map :start_of_line, %w[Home], %w[Control-a]
+ map :transpose_chars, %w[Control-t]
- mode.map :vi_eof_maybe, %w[Control-d]
- mode.map :emacs_editing_mode, %w[Control-e]
- mode.map :abort, %w[Control-g]
- mode.map :backward_char, %w[Control-h]
- mode.map :accept_line, %w[Control-j], %w[Control-m]
- mode.map :kill_line, %w[Control-k]
- mode.map :clear_screen, %w[Control-l]
- mode.map :next_history, %w[Control-n]
- mode.map :previous_history, %w[Control-p], %w[minus]
- mode.map :quoted_insert, %w[Control-o], %w[Control-V]
- mode.map :reverse_search_history, %w[Control-r]
- mode.map :forward_search_history, %w[Control-s]
- mode.map :transpose_chars, %w[Control-t]
- mode.map :unix_line_discard, %w[Control-u]
- mode.map :unix_word_rubout, %w[Control-w]
- mode.map :yank, %w[Control-y]
- mode.map :vi_undo, %w[Control-underscore]
- mode.map :forwad_char, %w[space]
- mode.map :insert_comment, %w[numbersign]
- mode.map :end_of_line, %w[dollar]
- mode.map :vi_match, %w[percent]
- mode.map :vi_tilde_expand, %w[ampersand]
- mode.map :vi_complete, %w[asterisk]
- mode.map :next_history, %w[plus]
- mode.map :vi_char_search, %w[comma]
- mode.map :vi_redo, %w[period]
- mode.map :vi_search, %w[numbersign]
- mode.map :beginning_of_line, %w[KeyPress-0]
- mode.map :vi_char_search, %w[semicolon]
- mode.map :vi_complete, %w[equal]
- mode.map :vi_search, %w[question]
- mode.map :vi_append_eol, %w[A]
- mode.map :vi_prev_word, %w[B]
- mode.map :vi_change_to, %w[C]
- mode.map :vi_delete_to, %w[D]
- mode.map :vi_end_word, %w[E]
- mode.map :vi_char_search, %w[F]
- mode.map :vi_fetch_history, %w[G]
- mode.map :vi_insert_beg, %w[I]
- mode.map :vi_search_again, %w[N]
- mode.map :vi_put, %w[P]
- mode.map :vi_replace, %w[R]
- mode.map :vi_subst, %w[S]
- mode.map :vi_char_search, %w[T]
- mode.map :revert_line, %w[U]
- mode.map :vi_next_word, %w[W]
- mode.map :backward_delete_char, %w[X]
- mode.map :vi_yank_to, %w[Y]
- mode.map :vi_complete, %w[backslash]
- mode.map :vi_first_print, %w[asciicircum]
- mode.map :vi_yank_arg, %w[underscore]
- mode.map :vi_goto_mark, %w[quoteleft]
- mode.map :vi_append_mode, %w[a]
- mode.map :vi_prev_word, %w[b]
- mode.map :vi_change_to, %w[c]
- mode.map :vi_delete_to, %w[d]
- mode.map :vi_end_word, %w[e]
- mode.map :vi_char_search, %w[f]
- mode.map :backward_char, %w[h]
- mode.map :vi_insertion_mode, %w[i]
- mode.map :next_history, %w[j]
- mode.map :prev_history, %w[k]
- mode.map :forward_char, %w[l]
- mode.map :forward_char, %w[l]
- mode.map :vi_set_mark, %w[m]
- mode.map :vi_search_again, %w[n]
- mode.map :vi_put, %w[p]
- mode.map :vi_change_char, %w[r]
- mode.map :vi_subst, %w[s]
- mode.map :vi_char_search, %w[t]
- mode.map :vi_undo, %w[u]
- mode.map :vi_next_word, %w[w]
- mode.map :vi_delete, %w[x]
- mode.map :vi_yank_to, %w[y]
- mode.map :vi_column, %w[bar]
- mode.map :vi_change_case, %w[asciitilde]
+ map :sel_prev_char, %w[Shift-Left]
+ map :sel_next_char, %w[Shift-Right]
+ map :sel_prev_word, %w[Shift-Control-Left]
+ map :sel_next_word, %w[Shift-Control-Right]
+ map :sel_start_of_line, %w[Shift-Home]
+ map :sel_end_of_line, %w[Shift-End]
- mode.missing :insert_string
- end
+ missing :insert_string
+ end
+
+ minor_mode :insert do
+ inherits :basic, :layout_control, :complete
+ become :control, %w[Escape], %w[Control-c]
+
+ handler Methods::AutoFill
+ map :auto_fill_space, %w[space]
+
+ handler Methods::Delete
+ map [:kill_motion, :next_char], %w[Delete], %w[Control-d]
+ map [:kill_motion, :prev_char], %w[BackSpace]
+ map [:kill_motion, :prev_word], %w[Control-w]
+
+ handler Methods::Move
+ map :next_line, %w[Down], %w[Control-n]
+ map :next_page, %w[Control-f], %w[Next], %w[Shift-Down]
+ map :prev_page, %w[Control-b], %w[Prior], %w[Shift-Up]
+ map :prev_line, %w[Up], %w[Control-p]
+ map :end_of_line, %w[End], %w[Control-e]
+ map :next_char, %w[Right], %w[Control-f]
+ map :next_word, %w[Shift-Right], %w[Alt-f]
+ map :prev_char, %w[Left], %w[Control-b]
+ map :prev_word, %w[Shift-Left], %w[Alt-b]
+ map :start_of_line, %w[Home], %w[Control-a]
+
+ handler Methods::Control
+ map :smart_evaluate, %w[Alt-e], %w[Control-e]
+
+ handler Methods::Insert
+ map :newline, %w[Return]
+ map :selection, %w[Shift-Insert]
+ map :tab, %w[Control-v Tab], %w[Control-i]
+ missing :string
+ end
+
+ minor_mode :replace do
+ become :control, %w[Escape], %w[Control-c]
+
+ handler Methods::Insert
+ map [:replace_string, "\n"], %w[Return]
+ missing :replace_string
+ end
+
+ minor_mode :replace_char do
+ become :control, %w[Escape], %w[Control-c]
+
+ handler Methods::Insert
+ map [:replace_char, "\n"], %w[Return]
+ missing :replace_char
+ end
+
+ minor_mode :search_and_replace do
+ become :control, %w[Escape], %w[Control-c], %w[q]
+
+ handler Methods::SearchAndReplace
+ enter :enter
+ leave :leave
+
+ map :replace_all, %w[a], %w[exclam]
+ map :replace_once, %w[y]
+ map :next, %w[n], %w[s], %w[j], %w[Control-n]
+ map :prev, %w[k], %w[Control-p]
+ end
+
+ minor_mode :select do
+ inherits :basic, :move, :search
+
+ handler Methods::Selection
+ map :comment, %w[comma c]
+ map :copy, %w[y], %w[Y]
+ map :indent, %w[greater]
+ map :kill, %w[d], %w[D], %w[x], %w[BackSpace], %w[Delete]
+ map :pipe, %w[exclam]
+ map :lower_case, %w[u]
+ map :replace_string, %w[c]
+ map :toggle_case, %w[asciitilde]
+ map :upper_case, %w[U]
+ map :uncomment, %w[comma u]
+ map :unindent, %w[less]
+ map :wrap, %w[g w]
+
+ handler Methods::Control
+ map :smart_evaluate, %w[Alt-e], %w[Control-e]
+ end
+
+ minor_mode :select_char do
+ inherits :select
+
+ become :control, %w[Escape], %w[Control-c]
+ become :select_line, %w[V]
+ become :select_block, %w[Control-v]
+ become :select_replace_char, %w[r]
+
+ handler Methods::Selection
+ enter :enter
+ leave :leave
+ end
+
+ minor_mode :select_line do
+ inherits :select
+
+ become :control, %w[Escape], %w[Control-c]
+ become :select_char, %w[v]
+ become :select_block, %w[Control-v]
+ become :select_replace_char, %w[r]
+
+ handler Methods::Selection
+ enter :enter
+ leave :leave
+ end
+
+ minor_mode :select_block do
+ inherits :select
+
+ become :control, %w[Escape], %w[Control-c]
+ become :select_char, %w[v]
+ become :select_line, %w[V]
+ become :select_replace_char, %w[r]
+
+ handler Methods::Selection
+ enter :enter
+ leave :leave
+ end
+
+ minor_mode :select_replace_char do
+ become :control, %w[Escape], %w[Control-c]
+
+ handler Methods::Selection
+ map [:replace_char, "\n"], %w[Return]
+ missing :replace_char
+ end
+
+ major_mode :HoverCompletion do
+ inherits :basic
+
+ map :cancel, %w[Escape], %w[BackSpace]
+ map :continue_completion, %w[Right], %w[l]
+ map :go_down, %w[Down], %w[j]
+ map :go_up, %w[Up], %w[k]
+ map :submit, %w[Return]
+ end
+
+ minor_mode :snippet do
+ inherits :readline
+
+ handler Methods::Snippet
+ map :cancel, %w[Escape], %w[Control-c]
+ map :jump, %w[Tab]
+
+ missing :insert_string
+ end
+
+ major_mode :Fundamental do
+ use :control
+ end
+
+ major_mode :MiniBuffer do
+ use :readline
+
+ map :abort, %w[Escape], %w[Control-c]
+ map :attempt, %w[Return]
+ map :complete_large, %w[Double-Tab]
+ map :complete_small, %w[Tab]
+ end
+
+ major_mode :Completions do
+ handler MiniBuffer
+ map :answer_from, %w[Button-1]
+ end
+
+ major_mode :Executor do
+ use :executor_label
+ end
+
+ minor_mode :executor_entry do
+ inherits :readline
+
+ map :completion, %w[Tab]
+ map :cancel, %w[Escape]
+ map :next_line, %w[Down], %w[Control-j], %w[Control-n]
+ map :prev_line, %w[Up], %w[Control-k], %w[Control-p]
+ end
+
+ minor_mode :executor_label do
+ inherits :executor_entry
+
+ map :speed_selection, %w[space]
+
+ missing :insert_string
+ end
+end