1a09a1c137ff

oh christ
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Fri, 13 Nov 2015 22:46:00 +0000
parents 1da770d23a21
children 65685da8eca0
branches/tags (none)
files .hgsub .hgsubstate vim/vimrc weechat/script.conf

Changes

--- a/.hgsub	Sun Sep 20 14:50:41 2015 +0000
+++ b/.hgsub	Fri Nov 13 22:46:00 2015 +0000
@@ -15,6 +15,7 @@
 vim/bundle/fireplace             = [git]git://github.com/tpope/vim-fireplace.git
 vim/bundle/fugitive              = [git]git://github.com/tpope/vim-fugitive.git
 vim/bundle/gnupg                 = [git]git://github.com/jamessan/vim-gnupg.git
+vim/bundle/gnuplot               = [git]git://github.com/vim-scripts/gnuplot.vim.git
 vim/bundle/gundo                 = [hg]https://bitbucket.org/sjl/gundo.vim/
 vim/bundle/html5                 = [git]git://github.com/othree/html5.vim.git
 vim/bundle/indent-object         = [git]git://github.com/michaeljsmith/vim-indent-object.git
--- a/.hgsubstate	Sun Sep 20 14:50:41 2015 +0000
+++ b/.hgsubstate	Fri Nov 13 22:46:00 2015 +0000
@@ -15,6 +15,7 @@
 3a843cb1b183bd853b843fbaef89af27b726ac25 vim/bundle/fireplace
 935a2cccd3065b1322fb2235285d42728600afdf vim/bundle/fugitive
 6e9f52a160e3d15060848a8f453bd1b5bfa70db2 vim/bundle/gnupg
+0d57b080f9fae8573c688b6679b31eb1666edc4c vim/bundle/gnuplot
 eb9fc8676b8959c3c2c95bf6b6e8f0f44317c5c0 vim/bundle/gundo
 34b407d2344a3c2a94b56e9d443e18e01e8544d9 vim/bundle/html5
 78fffa609b3e6b84ef01ee4c9aba6d7435d7b18e vim/bundle/indent-object
--- a/vim/vimrc	Sun Sep 20 14:50:41 2015 +0000
+++ b/vim/vimrc	Fri Nov 13 22:46:00 2015 +0000
@@ -1090,6 +1090,15 @@
 augroup END
 
 " }}}
+" gnuplot {{{
+
+augroup ft_gnuplot
+    au!
+
+    au BufNewFile,BufRead *.gp setlocal filetype=gnuplot
+augroup END
+
+" }}}
 " Haskell {{{
 
 augroup ft_haskell
@@ -1305,6 +1314,29 @@
 " }}}
 " Python {{{
 
+function! SelectTopLevelPythonHunk() "{{{
+    " oh darling what have I done
+
+    " if we're on toplevel line that ends in a :, drop down one line before
+    " we move on.  this is bad and i feel bad.
+    let line = getline(".")
+    if len(line) > 0 && line[0] != " " && line[len(line) - 1] == ":"
+        normal! j
+    endif
+
+    normal! v
+
+    " use the non-bang version of normal here because we need to use the
+    " indentation script.  this is also bad and i still feel bad.
+    normal ai
+
+    " keep chomping upwards in the indentation stack til we get to something
+    " that's at the top level.  its bad.
+    while getline(".")[0] == " "
+        normal ai
+    endwhile
+endfunction "}}}
+
 function! OpenPythonRepl() "{{{
     "fucking kill me
     NeoRepl fish
@@ -1327,18 +1359,13 @@
 endfunction "}}}
 function! SendPythonTopLevelHunk() "{{{
     let view = winsaveview()
-
-    " TODO: This is horseshit, ugh
-
-    " If we're on the first char of the form, calling PareditFindDefunBck will
-    " move us to the previous form, which we don't want.  So instead we'll just
-    " always move a char to the right.
-    silent! normal! l
-
-    call PareditFindDefunBck()
-    execute "normal! vab\<esc>"
-    call NeoReplSendSelection()
-
+    let old_z = @z
+
+    call SelectTopLevelPythonHunk()
+    normal! gv"zy
+    call NeoReplSendRaw("%cpaste\n" . @z . "\n--\n")
+
+    let @z = old_z
     call winrestview(view)
 endfunction "}}}
 function! SendPythonSelection() "{{{
@@ -1394,7 +1421,7 @@
     au FileType python nnoremap <buffer> <silent> <localleader>p :call SendPythonParagraph()<cr>
 
     " " Send the current top-level hunk to the REPL
-    " au FileType python nnoremap <buffer> <silent> <localleader>e :call SendPythonTopLevelHunk()<cr>
+    au FileType python nnoremap <buffer> <silent> <localleader>e :call SendPythonTopLevelHunk()<cr>
 
     " Send the current selection to the REPL
     au FileType python vnoremap <buffer> <silent> <localleader>e :<c-u>call SendPythonSelection()<cr>
@@ -1896,7 +1923,7 @@
 " Python-Mode {{{
 
 let g:pymode_doc = 1
-let g:pymode_doc_key = 'M'
+let g:pymode_doc_bind = 'M'
 let g:pydoc = 'pydoc'
 let g:pymode_syntax = 1
 let g:pymode_syntax_all = 0
--- a/weechat/script.conf	Sun Sep 20 14:50:41 2015 +0000
+++ b/weechat/script.conf	Fri Nov 13 22:46:00 2015 +0000
@@ -43,7 +43,7 @@
 [scripts]
 autoload = on
 cache_expire = 60
-dir = "%h/script"
 hold = ""
+path = "%h/script"
 url = "http://www.weechat.org/files/plugins.xml.gz"
 url_force_https = on