Created
January 24, 2020 12:49
-
-
Save bobbicodes/799df2c1c26fda47972bf66d1d4e30e1 to your computer and use it in GitHub Desktop.
shell out to vim from repl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
there's a one liner I've got somewhere, I can even exec vim, edit a file, then exit back to a repl | |
2:15 | |
the gotcha is you have to make the shell (which is reading form the same terminal) wait for the process to exit | |
Eamonn Sullivan 2:15 PM | |
@noisesmith, that sounds like a good workaround. Can you share the one-liner? | |
noisesmith 2:15 PM | |
grabbing it now | |
2:16 | |
@Eamonn Sullivan | |
user=> (-> (ProcessBuilder. ["nvim"]) (.inheritIO) (.start) (.waitFor)) | |
0 | |
2:16 | |
that 0 is the exit code of neovim | |
2:17 | |
you can of course add more args to that vector, or run /bin/sh if you need redirects etc. | |
2:18 | |
the waitFor prevents the editor and the repl from fighting over the same characters on input (edited) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment