f6c9df4f2bab

RU stuff
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Wed, 19 Aug 2015 17:29:47 +0000
parents 193b2c26beea
children f93fd42c8df8
branches/tags (none)
files fish/config.fish mutt/muttrc pentadactylrc vim/custom-dictionary.utf-8.add vim/vimrc

Changes

--- a/fish/config.fish	Wed Aug 19 17:29:04 2015 +0000
+++ b/fish/config.fish	Wed Aug 19 17:29:47 2015 +0000
@@ -138,7 +138,9 @@
 set PYTHONPATH "$HOME/lib/hg/hg:$PYTHONPATH"
 
 set -gx WORKON_HOME "$HOME/lib/virtualenvs"
-. ~/.config/fish/virtualenv.fish
+eval (python -m virtualfish)
+
+set -g -x NLTK_DATA "/Users/sjl/src/ru/malv/nltk_data"
 
 # }}}
 # Z {{{
--- a/mutt/muttrc	Wed Aug 19 17:29:04 2015 +0000
+++ b/mutt/muttrc	Wed Aug 19 17:29:47 2015 +0000
@@ -149,7 +149,7 @@
 set spoolfile = "+INBOX"
 
 # Alternate email addresses.
-alternates sjl@pculture.org still\.?life@gmail.com steve@ladyluckblues.com steve@pculture.org
+alternates sjl@pculture.org still\.?life@gmail.com steve@ladyluckblues.com steve@pculture.org steven15@ru.is
 
 # Mailboxes to show in the sidebar.
 mailboxes +INBOX \
--- a/pentadactylrc	Wed Aug 19 17:29:04 2015 +0000
+++ b/pentadactylrc	Wed Aug 19 17:29:47 2015 +0000
@@ -67,3 +67,6 @@
 
 " Apparently the d key broke at some point.  What the Christ?
 nmap -builtin d :tabclose<cr>
+
+" Kill me
+style -name ublick * #nav-bar * { visibility: visible; }
--- a/vim/custom-dictionary.utf-8.add	Wed Aug 19 17:29:04 2015 +0000
+++ b/vim/custom-dictionary.utf-8.add	Wed Aug 19 17:29:47 2015 +0000
@@ -169,3 +169,5 @@
 healthcheck
 cron4j
 realtime
+carabiner
+monopod
--- a/vim/vimrc	Wed Aug 19 17:29:04 2015 +0000
+++ b/vim/vimrc	Wed Aug 19 17:29:47 2015 +0000
@@ -1251,17 +1251,94 @@
 " }}}
 " Python {{{
 
+function! OpenPythonRepl()
+    "fucking kill me
+    NeoRepl fish
+endfunction
+
+function! SendPythonLine()
+    let view = winsaveview()
+
+    execute "normal! ^vg_\<esc>"
+    call NeoReplSendSelection()
+
+    call winrestview(view)
+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()
+
+    call winrestview(view)
+endfunction
+
+function! SendPythonSelection()
+    let view = winsaveview()
+    let old_z = @z
+
+    normal! gv"zy
+    call NeoReplSendRaw("%cpaste\n" . @z . "\n--\n")
+
+    let @z = old_z
+    call winrestview(view)
+endfunction
+
+function! SendPythonBuffer()
+    let view = winsaveview()
+
+    execute "normal! ggVG\<esc>"
+
+    normal! gv"zy
+    call NeoReplSendRaw("%cpaste\n" . @z . "\n--\n")
+
+    call winrestview(view)
+endfunction
+
 augroup ft_python
     au!
 
     au FileType python setlocal define=^\s*\\(def\\\\|class\\)
-    au FileType man nnoremap <buffer> <cr> :q<cr>
 
     " Jesus tapdancing Christ, built-in Python syntax, you couldn't let me
     " override this in a normal way, could you?
     au FileType python if exists("python_space_error_highlight") | unlet python_space_error_highlight | endif
 
-    au FileType python iabbrev <buffer> afo assert False, "Okay"
+    " Set up some basic neorepl mappings.
+    "
+    " key  desc                   mnemonic
+    " \p - connect neorepl        [p]ython
+    " \l - send current line      [l]ine
+    " \e - send top-level hunk    [e]val
+    " \e - send selected hunk     [e]val
+    " \r - send entire file       [r]eload file
+    " \c - send ctrl-l            [c]lear
+
+    au FileType python nnoremap <buffer> <silent> <localleader>p :call OpenPythonRepl()<cr>
+
+    " Send the current line to the REPL
+    au FileType python nnoremap <buffer> <silent> <localleader>l :call SendPythonLine()<cr>
+
+    " " Send the current top-level hunk to the REPL
+    " 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>
+
+    " Send the entire buffer to the REPL ([r]eload)
+    au FileType python nnoremap <buffer> <silent> <localleader>r :call SendPythonBuffer()<cr>
+
+    " Clear the REPL
+    au FileType python nnoremap <buffer> <silent> <localleader>c :call NeoReplSendRaw("")<cr>
 augroup END
 
 " }}}
@@ -1696,7 +1773,7 @@
 let g:pymode_options_other = 0
 let g:pymode_options = 0
 
-let g:pymode_rope = 1
+let g:pymode_rope = 0
 let g:pymode_rope_global_prefix = "<localleader>R"
 let g:pymode_rope_local_prefix = "<localleader>r"
 let g:pymode_rope_auto_project = 1
@@ -2535,6 +2612,7 @@
 
 if has('nvim')
     tnoremap <Esc> <C-\><C-n>
+    tnoremap <leader><esc> <esc>
     nnoremap <bs> <c-w>h
 endif