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/>.
20 # This file defines all VimFx’s options in an easy-to-read way.
25 'o': 'focus_location_bar'
26 'O': 'focus_search_bar'
28 'P': 'paste_and_go_in_tab'
29 'yy': 'copy_current_url'
34 'L': 'history_forward'
38 'aR': 'reload_all_force'
47 '<space>': 'scroll_page_down'
48 '<s-space>': 'scroll_page_up'
49 'd': 'scroll_half_page_down'
50 'u': 'scroll_half_page_up'
52 'G': 'scroll_to_bottom'
53 '0 ^': 'scroll_to_left'
54 '$': 'scroll_to_right'
55 'm': 'mark_scroll_position'
61 'J gT': 'tab_select_previous'
62 'K gt': 'tab_select_next'
63 'gJ': 'tab_move_backward'
64 'gK': 'tab_move_forward'
65 'g0': 'tab_select_first'
66 'g^': 'tab_select_first_non_pinned'
67 'g$': 'tab_select_last'
68 'gp': 'tab_toggle_pinned'
71 'gx$': 'tab_close_to_end'
72 'gxa': 'tab_close_other'
77 'gf': 'follow_in_focused_tab'
78 'af': 'follow_multiple'
81 '[': 'follow_previous'
83 'gi': 'focus_text_input'
87 'a/': 'find_highlight_all'
92 'i': 'enter_mode_ignore'
96 '<force><escape>': 'esc'
101 '<space>': 'rotate_markers_forward'
102 '<s-space>': 'rotate_markers_backward'
103 '<backspace>': 'delete_hint_char'
104 '<enter>': 'increase_count'
113 '<escape> <enter>': 'exit'
116 'hint_chars': 'fjdkslaghrueiwovncm'
117 'prev_patterns': 'prev previous ‹ « ◀ ← << < back newer'
118 'next_patterns': 'next › » ▶ → >> > more older'
120 'prevent_autofocus': false
121 'ignore_keyboard_layout': false
125 'notifications_enabled': true
126 'prevent_target_blank': true
127 'prevent_autofocus_modes': 'normal'
129 'smoothScroll.lines.spring-constant': '1000'
130 'smoothScroll.pages.spring-constant': '2500'
131 'smoothScroll.other.spring-constant': '2500'
132 'pattern_selector': 'a, button'
133 'pattern_attrs': 'rel role data-tooltip aria-label'
134 'last_scroll_position_mark': '`'
135 'hints_toggle_in_tab': '<c-'
136 'hints_toggle_in_background': '<a-'
137 'activatable_element_keys': '<enter>'
138 'adjustable_element_keys': '<arrowup> <arrowdown> <arrowleft>
139 <arrowright> <space> <enter>'
140 'focus_previous_key': '<s-tab>'
141 'focus_next_key': '<tab>'
142 'options.key.quote': '<c-q>'
143 'options.key.insert_default': '<c-d>'
144 'options.key.reset_default': '<c-r>'
148 'categories': {} # Will be filled in below.
152 # The above easy-to-read data is transformed in to easy-to-consume (for
153 # computers) formats below.
155 translate = require('./l10n')
156 utils = require('./utils')
158 addCategory = (category, order) ->
159 uncategorized = (category == '')
164 translate.bind(null, "category.#{category}")
165 parsed_options.categories[category] = {
167 order: if uncategorized then 0 else order
175 createCounter = -> new utils.Counter({step: 100})
176 modeCounter = createCounter()
177 categoryCounter = createCounter()
179 for modeName, modeCategories of shortcuts
180 mode_order[modeName] = modeCounter.tick()
181 for categoryName, modeShortcuts of modeCategories
182 addCategory(categoryName, categoryCounter.tick())
183 commandIndex = createCounter()
184 for shortcut, commandName of modeShortcuts
185 pref = "mode.#{modeName}.#{commandName}"
186 shortcut_prefs[pref] = shortcut
187 command_order[pref] = commandIndex.tick()
188 categoryMap[pref] = categoryName
190 # All options, excluding shortcut customizations.
191 all_options = Object.assign({}, options, advanced_options, parsed_options)
192 # All things that are saved in Firefox’s prefs system.
193 all_prefs = Object.assign({}, options, advanced_options, shortcut_prefs)
205 BRANCH: 'extensions.VimFx.'