https://github.com/sbdchd/vim-run
:runner: A Neovim plugin to run the current filetype.
https://github.com/sbdchd/vim-run
Last synced: 7 months ago
JSON representation
:runner: A Neovim plugin to run the current filetype.
- Host: GitHub
- URL: https://github.com/sbdchd/vim-run
- Owner: sbdchd
- Created: 2016-02-21T03:57:28.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2023-06-22T23:54:58.000Z (over 2 years ago)
- Last Synced: 2025-01-02T02:29:14.783Z (about 1 year ago)
- Language: Vim Script
- Homepage:
- Size: 11.7 KB
- Stars: 10
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vim-run
A plugin to run the current file in a terminal split using neovim's terminal functionality.
This plugin is based on [vim-go's](https://github.com/fatih/vim-go) `:GoRun`.
_Requires [Neovim](https://neovim.io)_
## Install
[vim-plug](https://github.com/junegunn/vim-plug)
```viml
Plug 'sbdchd/vim-run'
```
## Usage
Run the current file with the default shebang / command.
`:Run`
To specify a command to run the current file, pass the command and its arguments
to `:Run`. The filepath will be automatically appended.
```viml
:Run python3 -b -E
```
Run the current file using a specific filetype.
```viml
:Run javascript
```
If you wish to end execution before the program has returned, simply type
` + c` or return to normal mode by hitting `` and then type `:q`.
If the file has a shebang, `:Run` will execute the file using that shebang.
Otherwise, `:Run` will use the default command for the filetype.
## Configuration [Optional]
You can define your own default commands for specific filetypes.
_Note:_ Your command must be in the naming scheme `g:run_cmd_`.
If your command is only one element long, then the filepath with be added automatically.
```viml
let g:run_cmd_python = ['python3']
```
A more advance example.
```viml
let g:run_cmd_java = [
\ 'javac',
\ '-g:none',
\ run#defaults#fullfilepath(),
\ '&&',
\ 'java',
\ run#defaults#basefilename()
\ ]
```
Enabled auto-closing of `:Run` output window when the command exits.
```viml
let g:run_auto_close = 1
```
Choose the direction of splitting (up, down, left, right).
```viml
let g:run_split = 'down'
```
## Supported Filetypes
- Applescript
- Bash
- Coffescript
- Elixir
- Erlang (Escript)
- Go
- Haskell (GHCI)
- Idris
- Java
- Javascript (Node)
- Lua
- Moonscript
- Perl
- Php
- Python
- Ruby
- Sh
- Typescript