Skip to content

Commit 4dbd59a

Browse files
committed
Make default keybinding reverse dictionary to interable
1 parent 51dbf41 commit 4dbd59a

File tree

1 file changed

+2
-31
lines changed

1 file changed

+2
-31
lines changed

bpython/config.py

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -105,37 +105,8 @@ def loadini(struct, configfile):
105105
'right_arrow_completion' : True,
106106
}}
107107

108-
default_keys_to_commands = {
109-
'': 'exit',
110-
'C-n': 'down_one_line',
111-
'C-l': 'clear_screen',
112-
'C-k': 'kill_line',
113-
'C-o': 'search',
114-
'C-h': 'backspace',
115-
'C-f': 'right',
116-
'C-e': 'end_of_line',
117-
'C-d': 'delete',
118-
'C-b':'left',
119-
'C-a': 'beginning_of_line',
120-
'C-z': 'suspend',
121-
'C-y': 'yank_from_buffer',
122-
'C-x': 'edit_current_block',
123-
'C-w': 'clear_word',
124-
'C-u': 'clear_line',
125-
'C-t': 'transpose_chars',
126-
'C-s': 'save',
127-
'C-r': 'undo',
128-
'C-p': 'up_one_line',
129-
'F10': 'copy_clipboard',
130-
'F1': 'help',
131-
'F2': 'show_source',
132-
'F3': 'edit_config',
133-
'F5': 'toggle_file_watch',
134-
'F6': 'reimport',
135-
'F7': 'external_editor',
136-
'F8': 'pastebin',
137-
'F9': 'last_output'
138-
}
108+
default_keys_to_commands = dict((value, key) for (key, value)
109+
in defaults['keyboard'].iteritems())
139110

140111
fill_config_with_default_values(config, defaults)
141112
if not config.read(config_path):

0 commit comments

Comments
 (0)