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'
39 'aR': 'reload_all_force'
48 '<space>': 'scroll_page_down'
49 '<s-space>': 'scroll_page_up'
50 'd': 'scroll_half_page_down'
51 'u': 'scroll_half_page_up'
53 'G': 'scroll_to_bottom'
54 '0 ^': 'scroll_to_left'
55 '$': 'scroll_to_right'
56 'm': 'mark_scroll_position'
62 'J gT': 'tab_select_previous'
63 'K gt': 'tab_select_next'
64 'gJ': 'tab_move_backward'
65 'gK': 'tab_move_forward'
66 'gw': 'tab_move_to_window'
67 'g0': 'tab_select_first'
68 'g^': 'tab_select_first_non_pinned'
69 'g$': 'tab_select_last'
70 'gp': 'tab_toggle_pinned'
73 'gX': 'tab_restore_list'
74 'gx$': 'tab_close_to_end'
75 'gxa': 'tab_close_other'
80 'gf': 'follow_in_focused_tab'
81 'gF': 'follow_in_window'
82 'af': 'follow_multiple'
85 'zF': 'click_browser_element'
86 '[': 'follow_previous'
88 'gi': 'focus_text_input'
92 'a/': 'find_highlight_all'
93 'g/': 'find_links_only'
99 'W': 'window_new_private'
100 'i': 'enter_mode_ignore'
102 'gr': 'enter_reader_view'
105 '<force><escape>': 'esc'
110 '<space>': 'rotate_markers_forward'
111 '<s-space>': 'rotate_markers_backward'
112 '<backspace>': 'delete_hint_char'
113 '<enter>': 'increase_count'
122 '<escape> <enter>': 'exit'
125 'hint_chars': 'fjdkslaghrueiwovncm'
126 'prev_patterns': 'prev previous ‹ « ◀ ← << < back newer'
127 'next_patterns': 'next › » ▶ → >> > more older'
129 'prevent_autofocus': false
130 'ignore_keyboard_layout': false
134 'notifications_enabled': true
135 'notify_entered_keys': true
136 'prevent_target_blank': true
137 'counts_enabled': true
138 'ignore_ctrl_alt': (Services.appinfo.OS == 'WINNT')
139 'prevent_autofocus_modes': 'normal'
141 'smoothScroll.lines.spring-constant': '1000'
142 'smoothScroll.pages.spring-constant': '2500'
143 'smoothScroll.other.spring-constant': '2500'
144 'scroll.full_page_adjustment': 40
145 'scroll.half_page_adjustment': 20
146 'scroll.last_position_mark': '`'
147 'pattern_selector': 'a, button'
148 'pattern_attrs': 'rel role data-tooltip aria-label'
149 'hints_toggle_in_tab': '<c-'
150 'hints_toggle_in_background': '<a-'
151 'activatable_element_keys': '<enter>'
152 'adjustable_element_keys': '<arrowup> <arrowdown> <arrowleft>
153 <arrowright> <space> <enter>'
154 'focus_previous_key': '<s-tab>'
155 'focus_next_key': '<tab>'
156 'options.key.quote': '<c-q>'
157 'options.key.insert_default': '<c-d>'
158 'options.key.reset_default': '<c-r>'
162 'categories': {} # Will be filled in below.
166 # The above easy-to-read data is transformed in to easy-to-consume (for
167 # computers) formats below.
169 translate = require('./l10n')
170 utils = require('./utils')
172 addCategory = (category, order) ->
173 uncategorized = (category == '')
178 translate.bind(null, "category.#{category}")
179 parsed_options.categories[category] = {
181 order: if uncategorized then 0 else order
189 createCounter = -> new utils.Counter({step: 100})
190 modeCounter = createCounter()
191 categoryCounter = createCounter()
193 for modeName, modeCategories of shortcuts
194 mode_order[modeName] = modeCounter.tick()
195 for categoryName, modeShortcuts of modeCategories
196 addCategory(categoryName, categoryCounter.tick())
197 commandIndex = createCounter()
198 for shortcut, commandName of modeShortcuts
199 pref = "mode.#{modeName}.#{commandName}"
200 shortcut_prefs[pref] = shortcut
201 command_order[pref] = commandIndex.tick()
202 categoryMap[pref] = categoryName
204 # All options, excluding shortcut customizations.
205 all_options = Object.assign({}, options, advanced_options, parsed_options)
206 # All things that are saved in Firefox’s prefs system.
207 all_prefs = Object.assign({}, options, advanced_options, shortcut_prefs)
219 BRANCH: 'extensions.VimFx.'