Coder Social home page Coder Social logo

asyncrun.extra's Introduction

Obsoleted

This plugin is obsoleted, because latest asyncrun has included these runners below, and no reason to maintain this project any more.

User should use asyncrun directly.

What is it ?

Extra runners for asyncrun to run your command in gnome-terminal, tmux, floaterm and more:

Runner Description
gnome run command in a new gnome-terminal window
gnome-tab run command in a new gnome-terminal tab
xterm run command in a new xterm window
external run command in cmd.exe / gnome-terminal / xterm if possible
floaterm run command in a floaterm window
floaterm-reuse run command in a reusable floaterm window
tmux run command in another tmux pane
termhelp run command in the terminal_help window

Installation

For vim-plug:

Plug 'skywind3000/asyncrun.vim'
Plug 'skywind3000/asyncrun.extra'

asyncrun version 2.7.8 or latter is required.

Available Runners

Gnome-terminal

Run command in a new gnome-terminal window:

:AsyncRun -mode=term -pos=gnome  ls -la

GVim Screencast:

Terminal Vim:

Run command in a new gnome-terminal tab:

:AsyncRun -mode=term -pos=gnome_tab  ls -la

Screencast:

NOTE: -pos=external is an alias of -pos=gnome on Linux.

Xterm

Run command in a new xterm window:

:AsyncRun -mode=term -pos=xterm  ls -la

Screencast:

External

The default external runner in asyncrun can run commands in cmd.exe:

:AsyncRun -mode=term -pos=external  echo Hello, World !!

The command above runs in cmd.exe:

The default external runner in asyncrun works on Windows only, and will do nothing if you are using Linux.

This plugin provide an enhanced version of external runner which detect what OS currently in used and choose an appropriate external terminal (cmd.exe, gnome-terminal or xterm) when possible.

Floaterm

Run command in floaterm:

:AsyncRun -mode=term -pos=floaterm  ls -la

With more floaterm options:

:AsyncRun -mode=term -pos=floaterm -position=bottomright -width=0.4  ls -la
:AsyncRun -mode=term -pos=floaterm -focus=0  ls -la

Gif:

Hint: try -pos=floaterm_reuse if you want to reuse existing floaterm window.

Tmux

Run command in another tmux panel (vimux is required):

:AsyncRun -mode=term -pos=tmux  ls -la

Gif:

Terminal Help

Run command in the terminal_help window:

:AsyncRun -mode=term -pos=termhelp  ls -la

Gif:

Help Required

  • iterm2 runner
  • terminal.app runner
  • windows terminal runner

Credit

TODO

asyncrun.extra's People

Contributors

caoshenghui avatar sakkke avatar skywind3000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sakkke

asyncrun.extra's Issues

No option to keep floaterm open after task finishes

The floaterm runner that used to be listed at https://github.com/skywind3000/asyncrun.vim/wiki/Customize-Runner didn't terminate the process after the task was completed, which allowed for running other commands. Is it possible to add an option for the floaterm runner in this repo to do the same thing?

For reference, the old version of the runner is here:

function! s:runner_proc(opts)
  let curr_bufnr = floaterm#curr()
  if has_key(a:opts, 'silent') && a:opts.silent == 1
    FloatermHide!
  endif
  let cmd = 'cd ' . shellescape(getcwd())
  call floaterm#terminal#send(curr_bufnr, [cmd])
  call floaterm#terminal#send(curr_bufnr, [a:opts.cmd])
  stopinsert
  if &filetype == 'floaterm' && g:floaterm_autoinsert
    call floaterm#util#startinsert()
  endif
endfunction
let g:asyncrun_runner = get(g:, 'asyncrun_runner', {})
let g:asyncrun_runner.floaterm = function('s:runner_proc')

Floaterm shows error in window 10

Running ":AsyncRun -mode=term -pos=floaterm ls -la" shows error " 'ls' is not recognized as an internal or external command'

image

Here below is my partial .vimrc setting:

let opts = 'AsyncRun -mode=term -pos=floaterm ls -la'
"let opts = 'AsyncRun -mode=term -pos=external'
function! MyRunner(opts)
    echo "command to run is: " . a:opts.cmd
endfunction
  
let g:asyncrun_runner = get(g:, 'asyncrun_runner', {})
let g:asyncrun_runner.test = function('MyRunner')
let g:asynctasks_term_pos = 'test'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.