]> git.gir.st - VimFx.git/blob - extension/lib/defaults.coffee
Improve command order and categories
[VimFx.git] / extension / lib / defaults.coffee
1 ###
2 # Copyright Simon Lydell 2015.
3 #
4 # This file is part of VimFx.
5 #
6 # VimFx is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # VimFx is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with VimFx. If not, see <http://www.gnu.org/licenses/>.
18 ###
19
20 notation = require('vim-like-key-notation')
21
22
23
24 shortcuts =
25 'normal':
26 # Location
27 'o': 'focus_location_bar'
28 'O': 'focus_search_bar'
29 'p': 'paste_and_go'
30 'P': 'paste_and_go_in_tab'
31 'yy': 'copy_current_url'
32 'gu': 'go_up_path'
33 'gU': 'go_to_root'
34 'gh': 'go_home'
35 'H': 'history_back'
36 'L': 'history_forward'
37 'r': 'reload'
38 'R': 'reload_force'
39 'ar': 'reload_all'
40 'aR': 'reload_all_force'
41 's': 'stop'
42 'as': 'stop_all'
43
44 # Scrolling
45 'h': 'scroll_left'
46 'l': 'scroll_right'
47 'j': 'scroll_down'
48 'k': 'scroll_up'
49 '<space>': 'scroll_page_down'
50 '<s-space>': 'scroll_page_up'
51 'd': 'scroll_half_page_down'
52 'u': 'scroll_half_page_up'
53 'gg': 'scroll_to_top'
54 'G': 'scroll_to_bottom'
55 '0 ^': 'scroll_to_left'
56 '$': 'scroll_to_right'
57
58 # Tabs
59 't': 'tab_new'
60 'yt': 'tab_duplicate'
61 'J gT': 'tab_select_previous'
62 'K gt': 'tab_select_next'
63 'gJ': 'tab_move_backward'
64 'gK': 'tab_move_forward'
65 'gH g0': 'tab_select_first'
66 'g^': 'tab_select_first_non_pinned'
67 'gL g$': 'tab_select_last'
68 'gp': 'tab_toggle_pinned'
69 'x': 'tab_close'
70 'X': 'tab_restore'
71 'gx$': 'tab_close_to_end'
72 'gxa': 'tab_close_other'
73
74 # Browsing
75 'f': 'follow'
76 'F': 'follow_in_tab'
77 'gf': 'follow_in_focused_tab'
78 'af': 'follow_multiple'
79 'yf': 'follow_copy'
80 'vf': 'follow_focus'
81 '[': 'follow_previous'
82 ']': 'follow_next'
83 'gi': 'text_input'
84
85 # Find
86 '/': 'find'
87 'a/': 'find_highlight_all'
88 'n': 'find_next'
89 'N': 'find_previous'
90
91 # Misc
92 'i': 'enter_mode_insert'
93 'I': 'quote'
94 '?': 'help'
95 ':': 'dev'
96 '<escape>': 'esc'
97
98 'insert':
99 '<s-escape>': 'exit'
100
101 'hints':
102 '<escape>': 'exit'
103 '<space>': 'rotate_markers_forward'
104 '<s-space>': 'rotate_markers_backward'
105 '<backspace>': 'delete_hint_char'
106
107 'find':
108 '<escape> <enter>': 'exit'
109
110 options =
111 'hint_chars': 'fjdkslaghrueiwovncm'
112 'prev_patterns': 'prev,previous,‹,«,◀,←,<<,<,back,newer'
113 'next_patterns': 'next,›,»,▶,→,>>,>,more,older'
114 'black_list': ''
115 'prevent_autofocus': true
116 'ignore_keyboard_layout': false
117
118 advanced_options =
119 'autofocus_limit': 100
120 'smoothScroll.lines.spring-constant': '1000'
121 'smoothScroll.pages.spring-constant': '2500'
122 'smoothScroll.other.spring-constant': '2500'
123 'translations': '{}'
124
125
126
127 key_options = {}
128 for modeName, modeShortcuts of shortcuts
129 for keys, name of modeShortcuts
130 key_options["mode.#{ modeName }.#{ name }"] = keys
131
132 all = Object.assign({}, options, advanced_options, key_options)
133
134 exports.options = options
135 exports.advanced_options = advanced_options
136 exports.key_options = key_options
137 exports.all = all
138 exports.BRANCH = 'extensions.VimFx.'
Imprint / Impressum