desc stringlengths 3 26.7k | decl stringlengths 11 7.89k | bodies stringlengths 8 553k |
|---|---|---|
'Kill the text in the current region. By default, this command is unbound.'
| def kill_region(self, e):
| pass
|
'Copy the text in the region to the kill buffer, so it can be
yanked right away. By default, this command is unbound.'
| def copy_region_as_kill(self, e):
| pass
|
'Copy the word before point to the kill buffer. The word
boundaries are the same as backward-word. By default, this command
is unbound.'
| def copy_backward_word(self, e):
| pass
|
'Copy the word following point to the kill buffer. The word
boundaries are the same as forward-word. By default, this command is
unbound.'
| def copy_forward_word(self, e):
| pass
|
'Yank the top of the kill ring into the buffer at point.'
| def yank(self, e):
| self.l_buffer.yank()
|
'Rotate the kill-ring, and yank the new top. You can only do this
if the prior command is yank or yank-pop.'
| def yank_pop(self, e):
| self.l_buffer.yank_pop()
|
'Add this digit to the argument already accumulating, or start a
new argument. M-- starts a negative argument.'
| def digit_argument(self, e):
| args = e.char
c = self.console
line = self.l_buffer.get_line_text()
oldprompt = self.prompt
def nop(e):
pass
while 1:
(x, y) = self.prompt_end_pos
c.pos(0, y)
self.prompt = ('(arg: %s) ' % args)
self._print_prompt()
self._update_line()
... |
'This is another way to specify an argument. If this command is
followed by one or more digits, optionally with a leading minus
sign, those digits define the argument. If the command is followed
by digits, executing universal-argument again ends the numeric
argument, but is otherwise ignored. As a special case, if this... | def universal_argument(self, e):
| pass
|
'Deletes the character under the cursor if not at the beginning or
end of the line (like delete-char). If at the end of the line,
behaves identically to possible-completions. This command is unbound
by default.'
| def delete_char_or_list(self, e):
| pass
|
'Begin saving the characters typed into the current keyboard macro.'
| def start_kbd_macro(self, e):
| pass
|
'Stop saving the characters typed into the current keyboard macro
and save the definition.'
| def end_kbd_macro(self, e):
| pass
|
'Re-execute the last keyboard macro defined, by making the
characters in the macro appear as if typed at the keyboard.'
| def call_last_kbd_macro(self, e):
| pass
|
'Read in the contents of the inputrc file, and incorporate any
bindings or variable assignments found there.'
| def re_read_init_file(self, e):
| pass
|
'Abort the current editing command and ring the terminals bell
(subject to the setting of bell-style).'
| def abort(self, e):
| self._bell()
|
'If the metafied character x is lowercase, run the command that is
bound to the corresponding uppercase character.'
| def do_uppercase_version(self, e):
| pass
|
'Metafy the next character typed. This is for keyboards without a
meta key. Typing ESC f is equivalent to typing M-f.'
| def prefix_meta(self, e):
| self.next_meta = True
|
'Incremental undo, separately remembered for each line.'
| def undo(self, e):
| self.l_buffer.pop_undo()
|
'Undo all changes made to this line. This is like executing the
undo command enough times to get back to the beginning.'
| def revert_line(self, e):
| pass
|
'Perform tilde expansion on the current word.'
| def tilde_expand(self, e):
| pass
|
'Set the mark to the point. If a numeric argument is supplied, the
mark is set to that position.'
| def set_mark(self, e):
| self.l_buffer.set_mark()
|
'Swap the point with the mark. The current cursor position is set
to the saved position, and the old cursor position is saved as the
mark.'
| def exchange_point_and_mark(self, e):
| pass
|
'A character is read and point is moved to the next occurrence of
that character. A negative count searches for previous occurrences.'
| def character_search(self, e):
| pass
|
'A character is read and point is moved to the previous occurrence
of that character. A negative count searches for subsequent
occurrences.'
| def character_search_backward(self, e):
| pass
|
'Without a numeric argument, the value of the comment-begin
variable is inserted at the beginning of the current line. If a
numeric argument is supplied, this command acts as a toggle: if the
characters at the beginning of the line do not match the value of
comment-begin, the value is inserted, otherwise the characters... | def insert_comment(self, e):
| pass
|
'Print all of the settable variables and their values to the
Readline output stream. If a numeric argument is supplied, the
output is formatted in such a way that it can be made part of an
inputrc file. This command is unbound by default.'
| def dump_variables(self, e):
| pass
|
'Print all of the Readline key sequences bound to macros and the
strings they output. If a numeric argument is supplied, the output
is formatted in such a way that it can be made part of an inputrc
file. This command is unbound by default.'
| def dump_macros(self, e):
| pass
|
'When in vi command mode, this causes a switch to emacs editing
mode.'
| def init_editing_mode(self, e):
| self._bind_exit_key('Control-d')
self._bind_exit_key('Control-z')
self._bind_key('space', self.self_insert)
self._bind_key('Shift-space', self.self_insert)
self._bind_key('Control-space', self.self_insert)
self._bind_key('Return', self.accept_line)
self._bind_key('Left', self.backward_char)
... |
'setup the mapping from key to call the function.'
| def _bind_key(self, key, func):
| if (type(func) != type(self._bind_key)):
print ('Trying to bind non method to keystroke:%s,%s' % (key, func))
raise PyreadlineError(('Trying to bind non method to keystroke:%s,%s,%s,%s' % (key, func, type(func), type(self._bind_key))))
keyinfo = make_KeyPress_... |
'setup the mapping from key to call the function.'
| def _bind_exit_key(self, key):
| keyinfo = make_KeyPress_from_keydescr(key.lower()).tuple()
self.exit_dispatch[keyinfo] = None
|
'When in vi command mode, this causes a switch to emacs editing
mode.'
| def init_editing_mode(self, e):
| raise NotImplementedError
|
'Return a list of possible completions for the string ending at the point.
Also set begidx and endidx in the process.'
| def _get_completions(self):
| completions = []
self.begidx = self.l_buffer.point
self.endidx = self.l_buffer.point
buf = self.l_buffer.line_buffer
if self.completer:
while (self.begidx > 0):
self.begidx -= 1
if (buf[self.begidx] in self.completer_delims):
self.begidx += 1
... |
'Attempt to perform completion on the text before point. The
actual completion performed is application-specific. The default is
filename completion.'
| def complete(self, e):
| completions = self._get_completions()
if completions:
cprefix = commonprefix(completions)
rep = [c for c in cprefix]
point = self.l_buffer.point
self.l_buffer[self.begidx:self.endidx] = rep
self.l_buffer.point = ((point + len(rep)) - (self.endidx - self.begidx))
i... |
'List the possible completions of the text before point.'
| def possible_completions(self, e):
| completions = self._get_completions()
self._display_completions(completions)
|
'Insert all completions of the text before point that would have
been generated by possible-completions.'
| def insert_completions(self, e):
| completions = self._get_completions()
b = self.begidx
e = self.endidx
for comp in completions:
rep = [c for c in comp]
rep.append(' ')
self.l_buffer[b:e] = rep
b += len(rep)
e = b
self.line_cursor = b
|
'Similar to complete, but replaces the word to be completed with a
single match from the list of possible completions. Repeated
execution of menu-complete steps through the list of possible
completions, inserting each match in turn. At the end of the list of
completions, the bell is rung (subject to the setting of bell... | def menu_complete(self, e):
| pass
|
'Move to the start of the current line.'
| def beginning_of_line(self, e):
| self.l_buffer.beginning_of_line()
|
'Move to the end of the line.'
| def end_of_line(self, e):
| self.l_buffer.end_of_line()
|
'Move forward a character.'
| def forward_char(self, e):
| self.l_buffer.forward_char(self.argument_reset)
|
'Move back a character.'
| def backward_char(self, e):
| self.l_buffer.backward_char(self.argument_reset)
|
'Move forward to the end of the next word. Words are composed of
letters and digits.'
| def forward_word(self, e):
| self.l_buffer.forward_word(self.argument_reset)
|
'Move back to the start of the current or previous word. Words are
composed of letters and digits.'
| def backward_word(self, e):
| self.l_buffer.backward_word(self.argument_reset)
|
'Move forward to the end of the next word. Words are composed of
letters and digits.'
| def forward_word_end(self, e):
| self.l_buffer.forward_word_end(self.argument_reset)
|
'Move forward to the end of the next word. Words are composed of
letters and digits.'
| def backward_word_end(self, e):
| self.l_buffer.backward_word_end(self.argument_reset)
|
'Move to the start of the current line.'
| def beginning_of_line_extend_selection(self, e):
| self.l_buffer.beginning_of_line_extend_selection()
|
'Move to the end of the line.'
| def end_of_line_extend_selection(self, e):
| self.l_buffer.end_of_line_extend_selection()
|
'Move forward a character.'
| def forward_char_extend_selection(self, e):
| self.l_buffer.forward_char_extend_selection(self.argument_reset)
|
'Move back a character.'
| def backward_char_extend_selection(self, e):
| self.l_buffer.backward_char_extend_selection(self.argument_reset)
|
'Move forward to the end of the next word. Words are composed of
letters and digits.'
| def forward_word_extend_selection(self, e):
| self.l_buffer.forward_word_extend_selection(self.argument_reset)
|
'Move back to the start of the current or previous word. Words are
composed of letters and digits.'
| def backward_word_extend_selection(self, e):
| self.l_buffer.backward_word_extend_selection(self.argument_reset)
|
'Move forward to the end of the next word. Words are composed of
letters and digits.'
| def forward_word_end_extend_selection(self, e):
| self.l_buffer.forward_word_end_extend_selection(self.argument_reset)
|
'Move forward to the end of the next word. Words are composed of
letters and digits.'
| def backward_word_end_extend_selection(self, e):
| self.l_buffer.forward_word_end_extend_selection(self.argument_reset)
|
'Uppercase the current (or following) word. With a negative
argument, uppercase the previous word, but do not move the cursor.'
| def upcase_word(self, e):
| self.l_buffer.upcase_word()
|
'Lowercase the current (or following) word. With a negative
argument, lowercase the previous word, but do not move the cursor.'
| def downcase_word(self, e):
| self.l_buffer.downcase_word()
|
'Capitalize the current (or following) word. With a negative
argument, capitalize the previous word, but do not move the cursor.'
| def capitalize_word(self, e):
| self.l_buffer.capitalize_word()
|
'Clear the screen and redraw the current line, leaving the current
line at the top of the screen.'
| def clear_screen(self, e):
| self.console.page()
|
'Refresh the current line. By default, this is unbound.'
| def redraw_current_line(self, e):
| pass
|
'Accept the line regardless of where the cursor is. If this line
is non-empty, it may be added to the history list for future recall
with add_history(). If this line is a modified history line, the
history line is restored to its original state.'
| def accept_line(self, e):
| return True
|
'Delete the character at point. If point is at the beginning of
the line, there are no characters in the line, and the last
character typed was not bound to delete-char, then return EOF.'
| def delete_char(self, e):
| self.l_buffer.delete_char(self.argument_reset)
|
'Delete the character behind the cursor. A numeric argument means
to kill the characters instead of deleting them.'
| def backward_delete_char(self, e):
| self.l_buffer.backward_delete_char(self.argument_reset)
|
'Delete the character behind the cursor. A numeric argument means
to kill the characters instead of deleting them.'
| def backward_delete_word(self, e):
| self.l_buffer.backward_delete_word(self.argument_reset)
|
'Delete the character behind the cursor. A numeric argument means
to kill the characters instead of deleting them.'
| def forward_delete_word(self, e):
| self.l_buffer.forward_delete_word(self.argument_reset)
|
'Delete all spaces and tabs around point. By default, this is unbound.'
| def delete_horizontal_space(self, e):
| self.l_buffer.delete_horizontal_space()
|
'Insert yourself.'
| def self_insert(self, e):
| if (e.char and (ord(e.char) != 0)):
self.insert_text(e.char)
|
'Paste windows clipboard.
Assume single line strip other lines and end of line markers and trailing spaces'
| def paste(self, e):
| if self.enable_win32_clipboard:
txt = clipboard.get_clipboard_text_and_convert(False)
txt = txt.split('\n')[0].strip('\r').strip('\n')
log(('paste: >%s<' % map(ord, txt)))
self.insert_text(txt)
|
'Paste windows clipboard as multiline code.
Removes any empty lines in the code'
| def paste_mulitline_code(self, e):
| reg = re.compile('\r?\n')
if self.enable_win32_clipboard:
txt = clipboard.get_clipboard_text_and_convert(False)
t = reg.split(txt)
t = [row for row in t if (row.strip() != '')]
if (t != ['']):
self.insert_text(t[0])
self.add_history(self.l_buffer.copy())
... |
'Paste windows clipboard. If enable_ipython_paste_list_of_lists is
True then try to convert tabseparated data to repr of list of lists or
repr of array.
If enable_ipython_paste_for_paths==True then change \ to / and spaces to \space'
| def ipython_paste(self, e):
| if self.enable_win32_clipboard:
txt = clipboard.get_clipboard_text_and_convert(self.enable_ipython_paste_list_of_lists)
if self.enable_ipython_paste_for_paths:
if ((len(txt) < 300) and (' DCTB ' not in txt) and ('\n' not in txt)):
txt = txt.replace('\\', '/').replace(' ... |
'Copy the text in the region to the windows clipboard.'
| def copy_region_to_clipboard(self, e):
| self.l_buffer.copy_region_to_clipboard()
|
'Copy the text in the region to the windows clipboard.'
| def copy_selection_to_clipboard(self, e):
| self.l_buffer.copy_selection_to_clipboard()
|
'Copy the text in the region to the windows clipboard.'
| def cut_selection_to_clipboard(self, e):
| self.l_buffer.cut_selection_to_clipboard()
|
'Print all of the functions and their key bindings to the Readline
output stream. If a numeric argument is supplied, the output is
formatted in such a way that it can be made part of an inputrc
file. This command is unbound by default.'
| def dump_functions(self, e):
| print
txt = '\n'.join(self.rl_settings_to_string())
print txt
self._print_prompt()
|
'Return a list of possible completions for the string ending at the point.
Also set begidx and endidx in the process.'
| def _get_completions(self):
| completions = []
self.begidx = self.l_buffer.point
self.endidx = self.l_buffer.point
buf = self.l_buffer.line_buffer
if self.completer:
while (self.begidx > 0):
self.begidx -= 1
if (buf[self.begidx] in self.completer_delims):
self.begidx += 1
... |
'Try to act like GNU readline.'
| def readline(self, prompt=''):
| if self.first_prompt:
self.first_prompt = False
if self.startup_hook:
try:
self.startup_hook()
except:
print 'startup hook failed'
traceback.print_exc()
c = self.console
self.l_buffer.reset_line()
self.prompt =... |
'Move to the start of the current line.'
| def beginning_of_line(self, e):
| self.l_buffer.beginning_of_line()
|
'Move to the end of the line.'
| def end_of_line(self, e):
| self.l_buffer.end_of_line()
|
'Move forward a character.'
| def forward_char(self, e):
| self.l_buffer.forward_char()
|
'Move back a character.'
| def backward_char(self, e):
| self.l_buffer.backward_char()
|
'Move forward to the end of the next word. Words are composed of
letters and digits.'
| def forward_word(self, e):
| self.l_buffer.forward_word()
|
'Move back to the start of the current or previous word. Words are
composed of letters and digits.'
| def backward_word(self, e):
| self.l_buffer.backward_word()
|
'Clear the screen and redraw the current line, leaving the current
line at the top of the screen.'
| def clear_screen(self, e):
| self.console.page()
|
'Refresh the current line. By default, this is unbound.'
| def redraw_current_line(self, e):
| pass
|
'Accept the line regardless of where the cursor is. If this line
is non-empty, it may be added to the history list for future recall
with add_history(). If this line is a modified history line, the
history line is restored to its original state.'
| def accept_line(self, e):
| return True
|
'Move back through the history list, fetching the previous command.'
| def previous_history(self, e):
| self._history.previous_history(self.l_buffer)
|
'Move forward through the history list, fetching the next command.'
| def next_history(self, e):
| self._history.next_history(self.l_buffer)
|
'Move to the first line in the history.'
| def beginning_of_history(self, e):
| self._history.beginning_of_history()
|
'Move to the end of the input history, i.e., the line currently
being entered.'
| def end_of_history(self, e):
| self._history.end_of_history(self.l_buffer)
|
'Search backward starting at the current line and moving up
through the history as necessary. This is an incremental search.'
| def reverse_search_history(self, e):
| self._i_search(self._history.reverse_search_history, (-1), e)
|
'Search forward starting at the current line and moving down
through the the history as necessary. This is an incremental search.'
| def forward_search_history(self, e):
| self._i_search(self._history.forward_search_history, 1, e)
|
'Search backward starting at the current line and moving up
through the history as necessary using a non-incremental search for
a string supplied by the user.'
| def non_incremental_reverse_search_history(self, e):
| self._history.non_incremental_reverse_search_history(self.l_buffer)
|
'Search forward starting at the current line and moving down
through the the history as necessary using a non-incremental search
for a string supplied by the user.'
| def non_incremental_forward_search_history(self, e):
| self._history.non_incremental_reverse_search_history(self.l_buffer)
|
'Search forward through the history for the string of characters
between the start of the current line and the point. This is a
non-incremental search. By default, this command is unbound.'
| def history_search_forward(self, e):
| self.l_buffer = self._history.history_search_forward(self.l_buffer)
|
'Search backward through the history for the string of characters
between the start of the current line and the point. This is a
non-incremental search. By default, this command is unbound.'
| def history_search_backward(self, e):
| self.l_buffer = self._history.history_search_backward(self.l_buffer)
|
'Insert the first argument to the previous command (usually the
second word on the previous line) at point. With an argument n,
insert the nth word from the previous command (the words in the
previous command begin with word 0). A negative argument inserts the
nth word from the end of the previous command.'
| def yank_nth_arg(self, e):
| pass
|
'Insert last argument to the previous command (the last word of
the previous history entry). With an argument, behave exactly like
yank-nth-arg. Successive calls to yank-last-arg move back through
the history list, inserting the last argument of each line in turn.'
| def yank_last_arg(self, e):
| pass
|
'Delete the character at point. If point is at the beginning of
the line, there are no characters in the line, and the last
character typed was not bound to delete-char, then return EOF.'
| def delete_char(self, e):
| self.l_buffer.delete_char()
|
'Delete the character behind the cursor. A numeric argument means
to kill the characters instead of deleting them.'
| def backward_delete_char(self, e):
| self.l_buffer.backward_delete_char()
|
'Delete the character under the cursor, unless the cursor is at
the end of the line, in which case the character behind the cursor
is deleted. By default, this is not bound to a key.'
| def forward_backward_delete_char(self, e):
| pass
|
'Add the next character typed to the line verbatim. This is how to
insert key sequences like C-q, for example.'
| def quoted_insert(self, e):
| e = self.console.getkeypress()
self.insert_text(e.char)
|
'Insert a tab character.'
| def tab_insert(self, e):
| ws = (' ' * (self.tabstop - (self.line_cursor % self.tabstop)))
self.insert_text(ws)
|
'Insert yourself.'
| def self_insert(self, e):
| if (ord(e.char) != 0):
self.insert_text(e.char)
|
'Drag the character before the cursor forward over the character
at the cursor, moving the cursor forward as well. If the insertion
point is at the end of the line, then this transposes the last two
characters of the line. Negative arguments have no effect.'
| def transpose_chars(self, e):
| self.l_buffer.transpose_chars()
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.