2 # Copyright Simon Lydell 2015.
4 # This file is part of VimFx.
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.
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.
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/>.
23 'o': 'focus_location_bar'
24 'O': 'focus_search_bar'
26 'P': 'paste_and_go_in_tab'
27 'yy': 'copy_current_url'
32 'L': 'history_forward'
36 'aR': 'reload_all_force'
45 '<space>': 'scroll_page_down'
46 '<s-space>': 'scroll_page_up'
47 'd': 'scroll_half_page_down'
48 'u': 'scroll_half_page_up'
50 'G': 'scroll_to_bottom'
51 '0 ^': 'scroll_to_left'
52 '$': 'scroll_to_right'
57 'J gT': 'tab_select_previous'
58 'K gt': 'tab_select_next'
59 'gJ': 'tab_move_backward'
60 'gK': 'tab_move_forward'
61 'g0': 'tab_select_first'
62 'g^': 'tab_select_first_non_pinned'
63 'g$': 'tab_select_last'
64 'gp': 'tab_toggle_pinned'
67 'gx$': 'tab_close_to_end'
68 'gxa': 'tab_close_other'
73 'gf': 'follow_in_focused_tab'
74 'af': 'follow_multiple'
77 '[': 'follow_previous'
83 'a/': 'find_highlight_all'
88 'i': 'enter_mode_insert'
92 '<force><escape>': 'esc'
97 '<space>': 'rotate_markers_forward'
98 '<s-space>': 'rotate_markers_backward'
99 '<backspace>': 'delete_hint_char'
108 '<s-tab>': 'input_previous'
109 '<tab>': 'input_next'
113 '<escape> <enter>': 'exit'
116 'hint_chars': 'fjdkslaghrueiwovncm'
117 'prev_patterns': 'prev previous ‹ « ◀ ← << < back newer'
118 'next_patterns': 'next › » ▶ → >> > more older'
120 'prevent_autofocus': true
121 'ignore_keyboard_layout': false
125 'prevent_target_blank': true
126 'autofocus_limit': 100
128 'smoothScroll.lines.spring-constant': '1000'
129 'smoothScroll.pages.spring-constant': '2500'
130 'smoothScroll.other.spring-constant': '2500'
131 'pattern_selector': 'a, button'
132 'pattern_attrs': 'rel role data-tooltip aria-label'
133 'activatable_element_keys': '<enter>'
134 'adjustable_element_keys': '<arrowup> <arrowdown> <arrowleft>
135 <arrowright> <space> <enter>'
136 'options.key.quote': '<c-q>'
137 'options.key.insert_default': '<c-d>'
138 'options.key.reset_default': '<c-r>'
142 'categories': {} # Will be filled in below.
146 translate = require('./l10n')
147 utils = require('./utils')
149 addCategory = (category, order) ->
150 uncategorized = (category == '')
155 translate.bind(null, "category.#{ category }")
156 parsed_options.categories[category] = {
158 order: if uncategorized then 0 else order
166 createCounter = -> new utils.Counter({step: 100})
167 modeCounter = createCounter()
168 categoryCounter = createCounter()
170 for modeName, modeCategories of shortcuts
171 mode_order[modeName] = modeCounter.tick()
172 for categoryName, modeShortcuts of modeCategories
173 addCategory(categoryName, categoryCounter.tick())
174 commandIndex = createCounter()
175 for shortcut, commandName of modeShortcuts
176 pref = "mode.#{ modeName }.#{ commandName }"
177 shortcut_prefs[pref] = shortcut
178 command_order[pref] = commandIndex.tick()
179 categoryMap[pref] = categoryName
181 # All options, excluding shortcut customizations.
182 all_options = Object.assign({}, options, advanced_options, parsed_options)
183 # All things that are saved in Firefox’s prefs system.
184 all_prefs = Object.assign({}, options, advanced_options, shortcut_prefs)
196 BRANCH: 'extensions.VimFx.'