This plugin sends lines from either Vim or Neovim to a command line
interpreter (REPL application). There is support for
Clojure, Golang, Haskell, JavaScript, Julia, Jupyter, Kotlin, Lisp,
Lua, Macaulay2, Matlab, Prolog, Python, R, Racket, Ruby, Sage,
Scala, Shell script, Swift, Kdb/q and TypeScript
(see Nvim-R for a more compreehsive support for R in Vim/Neovim).
If the file type is quarto
, vimcmdline
will try to infer what interpreter
should be started.
The interpreter runs in Neovim's built-in terminal. If Tmux is installed, the interpreter can also run in an external terminal emulator or in a tmux pane. The main advantage of running the interpreter in a Neovim terminal is that the output is colorized, as in the screenshot below, where we have different colors for general output, positive and negative numbers, and the prompt line:
If running in either a Neovim built-in terminal or an external terminal, the plugin runs one instance of the REPL application for each file type. If running in a tmux pane, it runs one REPL application for Vim instance.
Support for running the interpreter in Vim's built-in terminal was not implemented. I have never adapted the plugin to run the interpreter within Vim's built-in terminal (as it does in Neovim) because Vim cannot colorize the output printed in its terminal.
Use a plugin manager to install vimcmdline.
You have to install Tmux if you either want to run the interpreter in an external terminal emulator or are using Vim.
Please, read the plugin's documentation for further instructions.
-
Look at the Vim scripts in the
ftplugin
directory and make a copy of the script supporting the language closer to the language that you want to support. -
Save the new script with the name "filetype_cmdline.vim" where "filetype" is the output of
:echo &filetype
when you are editing a script of the language that you want to support. -
Edit the new script and change the values of its variables as necessary.
-
Test your new file-type script by running your application in either Vim or Neovim and using either the built-in terminal or a Tmux split pane.
-
Look at the Vim scripts in the
syntax
directory and make a copy of the script supporting the language whose output is closer to the output of the language that you want to support. -
Save the new script with the name "cmdlineoutput_filetype.vim" where "filetype" is the output of
:echo &filetype
. -
Edit the new script and change both the pattern used to recognize the input line and the pattern used to recognize errors.
-
Test your new syntax highlighting script by running your application in a Neovim built-in terminal.
Plugins with similar functionality are vim-slime and neoterm.