]> git.gir.st - VimFx.git/blob - extension/lib/defaults.coffee
Refactor defaults
[VimFx.git] / extension / lib / defaults.coffee
1 ###
2 # Copyright Simon Lydell 2015.
3 #
4 # This file is part of VimFx.
5 #
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.
10 #
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.
15 #
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/>.
18 ###
19
20 notation = require('vim-like-key-notation')
21
22
23
24 shortcuts =
25 'normal':
26 'o': 'focus'
27 'O': 'focus_search'
28 'p': 'paste'
29 'P': 'paste_tab'
30 'yf': 'marker_yank'
31 'vf': 'marker_focus'
32 'yy': 'yank'
33 'r': 'reload'
34 'R': 'reload_force'
35 'ar': 'reload_all'
36 'aR': 'reload_all_force'
37 's': 'stop'
38 'as': 'stop_all'
39
40 'gg': 'scroll_to_top'
41 'G': 'scroll_to_bottom'
42 '0 ^': 'scroll_to_left'
43 '$': 'scroll_to_right'
44 'j': 'scroll_down'
45 'k': 'scroll_up'
46 'h': 'scroll_left'
47 'l': 'scroll_right'
48 'd': 'scroll_half_page_down'
49 'u': 'scroll_half_page_up'
50 '<space>': 'scroll_page_down'
51 '<s-space>': 'scroll_page_up'
52
53 't': 'open_tab'
54 'J gT': 'tab_prev'
55 'K gt': 'tab_next'
56 'gJ': 'tab_move_left'
57 'gK': 'tab_move_right'
58 'gh': 'home'
59 'gH g0': 'tab_first'
60 'g^': 'tab_first_non_pinned'
61 'gL g$': 'tab_last'
62 'gp': 'toggle_pin_tab'
63 'yt': 'duplicate_tab'
64 'gx$': 'close_tabs_to_end'
65 'gxa': 'close_other_tabs'
66 'x': 'close_tab'
67 'X': 'restore_tab'
68
69 'f': 'follow'
70 'F': 'follow_in_tab'
71 'gf': 'follow_in_focused_tab'
72 'af': 'follow_multiple'
73 '[': 'follow_previous'
74 ']': 'follow_next'
75 'gi': 'text_input'
76 'gu': 'go_up_path'
77 'gU': 'go_to_root'
78 'H': 'back'
79 'L': 'forward'
80
81 '/': 'find'
82 'a/': 'find_hl'
83 'n': 'find_next'
84 'N': 'find_prev'
85 'i': 'insert_mode'
86 'I': 'quote'
87 '?': 'help'
88 ':': 'dev'
89 '<escape>': 'Esc'
90
91 'insert':
92 '<s-escape>': 'exit'
93
94 'hints':
95 '<escape>': 'exit'
96 '<space>': 'rotate_markers_forward'
97 '<s-space>': 'rotate_markers_backward'
98 '<backspace>': 'delete_hint_char'
99
100 'find':
101 '<escape> <enter>': 'exit'
102
103 options =
104 'hint_chars': 'fjdkslaghrueiwovncm'
105 'prev_patterns': 'prev,previous,‹,«,◀,←,<<,<,back,newer'
106 'next_patterns': 'next,›,»,▶,→,>>,>,more,older'
107 'black_list': ''
108 'prevent_autofocus': true
109 'ignore_keyboard_layout': false
110
111 advanced_options =
112 'autofocus_limit': 100
113 'smoothScroll.lines.spring-constant': '1000'
114 'smoothScroll.pages.spring-constant': '2500'
115 'smoothScroll.other.spring-constant': '2500'
116 'translations': '{}'
117
118
119
120 key_options = {}
121 for modeName, modeShortcuts of shortcuts
122 for keys, name of modeShortcuts
123 name = "mode_#{ modeName }_#{ name }" unless modeName == 'normal'
124 key_options["commands.#{ name }.keys"] =
125 keys.split(/\s+/).map(notation.parseSequence)
126
127 all = Object.assign({}, options, advanced_options, key_options)
128
129 exports.options = options
130 exports.advanced_options = advanced_options
131 exports.key_options = key_options
132 exports.all = all
133 exports.BRANCH = 'extensions.VimFx.'
Imprint / Impressum