2 # Copyright Simon Lydell 2015, 2016.
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 'gl': 'tab_select_most_recent'
65 'gJ': 'tab_move_backward'
66 'gK': 'tab_move_forward'
67 'gw': 'tab_move_to_window'
68 'g0': 'tab_select_first'
69 'g^': 'tab_select_first_non_pinned'
70 'g$': 'tab_select_last'
71 'gp': 'tab_toggle_pinned'
74 'gX': 'tab_restore_list'
75 'gx$': 'tab_close_to_end'
76 'gxa': 'tab_close_other'
81 'gf': 'follow_in_focused_tab'
82 'gF': 'follow_in_window'
83 'af': 'follow_multiple'
86 'zF': 'click_browser_element'
87 '[': 'follow_previous'
89 'gi': 'focus_text_input'
93 'a/': 'find_highlight_all'
94 'g/': 'find_links_only'
100 'W': 'window_new_private'
101 'i': 'enter_mode_ignore'
103 'gr': 'enter_reader_view'
104 'zr': 'reload_config_file'
107 '<force><escape>': 'esc'
112 '<space>': 'rotate_markers_forward'
113 '<s-space>': 'rotate_markers_backward'
114 '<backspace>': 'delete_hint_char'
115 '<enter>': 'increase_count'
124 '<escape> <enter>': 'exit'
127 'hint_chars': 'fjdkslaghrueiwovncm'
128 'prev_patterns': 'prev previous ‹ « ◀ ← << < back newer'
129 'next_patterns': 'next › » ▶ → >> > more older'
131 'prevent_autofocus': false
132 'ignore_keyboard_layout': false
136 'notifications_enabled': true
137 'notify_entered_keys': true
138 'prevent_target_blank': true
139 'counts_enabled': true
140 'ignore_ctrl_alt': (Services.appinfo.OS == 'WINNT')
141 'prevent_autofocus_modes': 'normal'
142 'config_file_directory': ''
145 'smoothScroll.lines.spring-constant': '1000'
146 'smoothScroll.pages.spring-constant': '2500'
147 'smoothScroll.other.spring-constant': '2500'
148 'scroll.full_page_adjustment': 40
149 'scroll.half_page_adjustment': 20
150 'scroll.last_position_mark': '`'
151 'pattern_selector': ':-moz-any(
152 a, button, input[type="button"]
153 ):not([role="menu"]):not([role="tab"])'
154 'pattern_attrs': 'rel role data-tooltip aria-label'
155 'hints_toggle_in_tab': '<c-'
156 'hints_toggle_in_background': '<a-'
157 'activatable_element_keys': '<enter>'
158 'adjustable_element_keys': '<arrowup> <arrowdown> <arrowleft>
159 <arrowright> <space> <enter>'
160 'focus_previous_key': '<s-tab>'
161 'focus_next_key': '<tab>'
162 'options.key.quote': '<c-q>'
163 'options.key.insert_default': '<c-d>'
164 'options.key.reset_default': '<c-r>'
168 'categories': {} # Will be filled in below.
172 # The above easy-to-read data is transformed in to easy-to-consume (for
173 # computers) formats below.
175 translate = require('./l10n')
176 utils = require('./utils')
178 addCategory = (category, order) ->
179 uncategorized = (category == '')
180 categoryName = if uncategorized then '' else translate("category.#{category}")
181 parsed_options.categories[category] = {
183 order: if uncategorized then 0 else order
191 createCounter = -> new utils.Counter({step: 100})
192 modeCounter = createCounter()
193 categoryCounter = createCounter()
195 for modeName, modeCategories of shortcuts
196 mode_order[modeName] = modeCounter.tick()
197 for categoryName, modeShortcuts of modeCategories
198 addCategory(categoryName, categoryCounter.tick())
199 commandIndex = createCounter()
200 for shortcut, commandName of modeShortcuts
201 pref = "mode.#{modeName}.#{commandName}"
202 shortcut_prefs[pref] = shortcut
203 command_order[pref] = commandIndex.tick()
204 categoryMap[pref] = categoryName
206 # All options, excluding shortcut customizations.
207 all_options = Object.assign({}, options, advanced_options, parsed_options)
208 # All things that are saved in Firefox’s prefs system.
209 all_prefs = Object.assign({}, options, advanced_options, shortcut_prefs)
221 BRANCH: 'extensions.VimFx.'