From 429efd70ff47474341f7080d36349b2de3ecc1fa Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 4 Jun 2018 23:02:33 +0530 Subject: [PATCH] More conf docs --- kitty/conf/definition.py | 5 +---- kitty/config_data.py | 31 ++++++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/kitty/conf/definition.py b/kitty/conf/definition.py index ea51ced68..095af5a33 100644 --- a/kitty/conf/definition.py +++ b/kitty/conf/definition.py @@ -165,10 +165,7 @@ def as_conf_file(all_options): for sc in shortcuts: a('map {} {}'.format(sc.key, sc.action_def)) if sc.long_text: - a('') - for line in sc.long_text.strip().splitlines(): - a('#: ' + line) - a('') + a(''), a(render_block(sc.long_text.strip())), a('') def handle_option(opt): if not opt.long_text or not opt.add_to_docs: diff --git a/kitty/config_data.py b/kitty/config_data.py index 0f6e87205..07a7f2a62 100644 --- a/kitty/config_data.py +++ b/kitty/config_data.py @@ -143,6 +143,14 @@ To setup shortcuts to change only the current window's font size:: map kitty_mod+f6 change_font_size current 10.0 ''')], + 'shortcuts.selection': [ + _('Select and act on visible text'), _('''\ +Use the hints kitten to select text and either pass it to an external program or +insert it into the terminal or copy it to the clipboard. +'''), _(''' +The hints kitten has many more modes of operation that you can map to different +shortcuts. For a full description see :doc:`kittens/hints`.''')], + }) # }}} @@ -740,11 +748,32 @@ g('shortcuts.layout') # {{{ k('next_layout', 'kitty_mod+l', 'next_layout', _('Next layout')) # }}} - g('shortcuts.fonts') # {{{ k('increase_font_size', 'kitty_mod+equal', 'change_font_size all +2.0', _('Increase font size')) k('decrease_font_size', 'kitty_mod+minus', 'change_font_size all -2.0', _('Decrease font size')) k('reset_font_size', 'kitty_mod+backspace', 'change_font_size all 0', _('Reset font size')) +# }}} + +g('shortcuts.selection') # {{{ +k('open_url', 'kitty_mod+e', 'kitten hints', _('Open URL'), _(''' +Open a currently visible URL using the keyboard. The program used to open the +URL is specified in :opt:`open_url_with`.''')) + + +k('insert_selected_path', 'kitty_mod+p>f', 'kitten hints --type path --program -', _('Insert selected path'), long_text=_(''' +Select a path/filename and insert it into the terminal. Useful, for instance to +run git commands on a filename output from a previous git command.''')) + +k('open_selected_path', 'kitty_mod+p>shift+f', 'kitten hints --type path', _('Open selected path'), long_text=_(''' +Select a path/filename and open it with the default open program.''')) + +k('insert_selected_line', 'kitty_mod+p>l', 'kitten hints --type line --program -', _('Insert selected line'), long_text=_(''' +Select a line of text and insert it into the terminal. Use for the +output of things like: ls -1''')) + +k('insert_selected_word', 'kitty_mod+p>w', 'kitten hints --type word --program -', _('Insert selected word'), long_text=_(''' +Select words and insert into terminal.''')) + # }}} # }}}