This commit is contained in:
StackSmith 2023-09-16 14:40:12 -04:00
parent 5840299a65
commit 05f5054507
2 changed files with 14 additions and 0 deletions

6
vimrepl/README.md Normal file
View File

@ -0,0 +1,6 @@
To use vim as a repl, copy the attached script file into ~/.vim/plugins.
Start a tmux session and split the pane. Start nforth in the first pane. Start vim in the second pane, and edit a source file of your choice.
Place the cursor onto a paragraph. C-c C-c will send the paragraph into nforth.

8
vimrepl/repl.vim Normal file
View File

@ -0,0 +1,8 @@
let g:tmux_target = "%0"
function Send_to_Pane(text)
echo system("tmux send-keys -t " . g:tmux_target . " '" . substitute(a:text, "'", "'\\\\''", 'g') . "'")
endfunction
vmap <C-c><C-c> "ry :call Send_to_Pane(@r)<CR>
nmap <C-c><C-c> vip<C-c><C-c>