# HG changeset patch # User Steve Losh # Date 1436370740 14400 # Node ID e7f1e7f3a7970c64cce0e5af8a93464f1e24bc01 # Parent f8ea2a0220bb2efa207fb745bcb925d9aa790b9b# Parent ac0a622a5245cc43c2c62e23942970259417ef2e Merge. diff -r ac0a622a5245 -r e7f1e7f3a797 vim/vimrc --- a/vim/vimrc Mon Jun 29 23:19:41 2015 -0400 +++ b/vim/vimrc Wed Jul 08 11:52:20 2015 -0400 @@ -394,7 +394,7 @@ " " Useful for writing GitHub comments in actual Markdown and then translating it " to their bastardized version of Markdown. -nnoremap J mzvipJ`z +nnoremap j mzvipJ`z " Split line (sister to [J]oin lines) " The normal use of S is covered by cc, so don't worry about shadowing it. diff -r ac0a622a5245 -r e7f1e7f3a797 weechat/python/autoload/quotes.py --- a/weechat/python/autoload/quotes.py Mon Jun 29 23:19:41 2015 -0400 +++ b/weechat/python/autoload/quotes.py Wed Jul 08 11:52:20 2015 -0400 @@ -7,8 +7,10 @@ SCRIPT_DESC = 'Grab quotes and shove them into a text file.' SCRIPT_COMMAND = 'quo' SCRIPT_COMMAND_LONG = 'quoo' +SCRIPT_COMMAND_COPY = 'cop' QUOTE_FILE = '/Users/sjl/Dropbox/quotes.txt' +COPY_FILE = '/Users/sjl/.ircopy.irc' import_ok = True @@ -76,6 +78,19 @@ def quote_grab_long(data, buffer, args): return quote_grab(data, buffer, args, 75) +def quote_grab_copy(data, buffer, args): + lines = get_lines(buffer, 1000) + + with open(COPY_FILE, 'w') as f: + f.write('\n'.join(lines)) + + subprocess.call(["vim", COPY_FILE, + # start at the bottom of the file + "+"]) + weechat.command("", "/window refresh") + + return weechat.WEECHAT_RC_OK + if __name__ == '__main__' and import_ok: if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE, SCRIPT_DESC, '', ''): @@ -98,3 +113,11 @@ '', 'quote_grab_long', '') + weechat.hook_command( + SCRIPT_COMMAND_COPY, + 'Open the last 1000 lines of the file in Vim so you can copy.', + '', + '', + '', + 'quote_grab_copy', + '')