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'
79 'gi': 'focus_text_input'
80 '<force><tab>': 'focus_next'
81 '<force><s-tab>': 'focus_previous'
85 'a/': 'find_highlight_all'
90 'i': 'enter_mode_ignore'
94 '<force><escape>': 'esc'
99 '<space>': 'rotate_markers_forward'
100 '<s-space>': 'rotate_markers_backward'
101 '<backspace>': 'delete_hint_char'
102 '<enter>': 'increase_count'
111 '<escape> <enter>': 'exit'
114 'hint_chars': 'fjdkslaghrueiwovncm'
115 'prev_patterns': 'prev previous ‹ « ◀ ← << < back newer'
116 'next_patterns': 'next › » ▶ → >> > more older'
118 'prevent_autofocus': true
119 'ignore_keyboard_layout': false
123 'prevent_target_blank': true
124 'autofocus_limit': 100
125 'prevent_autofocus_modes': 'normal'
127 'smoothScroll.lines.spring-constant': '1000'
128 'smoothScroll.pages.spring-constant': '2500'
129 'smoothScroll.other.spring-constant': '2500'
130 'pattern_selector': 'a, button'
131 'pattern_attrs': 'rel role data-tooltip aria-label'
132 'hints_toggle_in_tab': '<c-'
133 'hints_toggle_in_background': '<a-'
134 'activatable_element_keys': '<enter>'
135 'adjustable_element_keys': '<arrowup> <arrowdown> <arrowleft>
136 <arrowright> <space> <enter>'
137 'options.key.quote': '<c-q>'
138 'options.key.insert_default': '<c-d>'
139 'options.key.reset_default': '<c-r>'
143 'categories': {} # Will be filled in below.
147 translate = require('./l10n')
148 utils = require('./utils')
150 addCategory = (category, order) ->
151 uncategorized = (category == '')
156 translate.bind(null, "category.#{ category }")
157 parsed_options.categories[category] = {
159 order: if uncategorized then 0 else order
167 createCounter = -> new utils.Counter({step: 100})
168 modeCounter = createCounter()
169 categoryCounter = createCounter()
171 for modeName, modeCategories of shortcuts
172 mode_order[modeName] = modeCounter.tick()
173 for categoryName, modeShortcuts of modeCategories
174 addCategory(categoryName, categoryCounter.tick())
175 commandIndex = createCounter()
176 for shortcut, commandName of modeShortcuts
177 pref = "mode.#{ modeName }.#{ commandName }"
178 shortcut_prefs[pref] = shortcut
179 command_order[pref] = commandIndex.tick()
180 categoryMap[pref] = categoryName
182 # All options, excluding shortcut customizations.
183 all_options = Object.assign({}, options, advanced_options, parsed_options)
184 # All things that are saved in Firefox’s prefs system.
185 all_prefs = Object.assign({}, options, advanced_options, shortcut_prefs)
197 BRANCH: 'extensions.VimFx.'