# HG changeset patch # User Steve Losh # Date 1437662497 14400 # Node ID 7e5a8f221df61b89c49a676c716aea74494c9dd1 # Parent 80d5d9d0d9bcfaf67be5274fb08937920b715d6d# Parent e7f1e7f3a7970c64cce0e5af8a93464f1e24bc01 Merge. diff -r 80d5d9d0d9bc -r 7e5a8f221df6 vim/vimrc --- a/vim/vimrc Thu Jul 23 10:41:28 2015 -0400 +++ b/vim/vimrc Thu Jul 23 10:41:37 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 80d5d9d0d9bc -r 7e5a8f221df6 weechat/python/autoload/quotes.py --- a/weechat/python/autoload/quotes.py Thu Jul 23 10:41:28 2015 -0400 +++ b/weechat/python/autoload/quotes.py Thu Jul 23 10:41:37 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', + '')