Code Monkey home page Code Monkey logo

Comments (7)

kovisoft avatar kovisoft commented on July 2, 2024

I have never used vim-dispatch (TBH I have never heard about it until now).
As I see it has a :Dispatch! command which just runs anything in the background. So I guess it should be possible to run the swank server this way:
:Dispatch! command_that_runs_the_swank_server_from_command_line

If it works then this may be assigned to g:slimv_swank_cmd in the .vimrc:
let g:slimv_swank_cmd = ':Dispatch! command_that_runs_the_swank_server_from_command_line'

E.g. if you can run the swank server via lein swank (clojure example), then (in theory) this should go into .vimrc:
let g:slimv_swank_cmd = ':Dispatch! lein swank'

from slimv.

ELLIOTTCABLE avatar ELLIOTTCABLE commented on July 2, 2024

πŸ‘!

vim-dispatch is pretty popular; it wouldn't be a bad idea to add support for this natively. (i.e. :Dispatch swank, and information in the README to that effect.)

from slimv.

kovisoft avatar kovisoft commented on July 2, 2024

Is it really that simple, just enter :Dispatch swank and it starts the swank server? Did you try it?

from slimv.

ELLIOTTCABLE avatar ELLIOTTCABLE commented on July 2, 2024

Sorry, it wouldn't be :Dispatch, I made the mistake of repeating what I read above. It'd be :Start!; and I suppose all that'd be useful is adding a note to the README. :P

from slimv.

kovisoft avatar kovisoft commented on July 2, 2024

It's no problem to add support for it if I know

(1) how to detect the presence of vim-dispatch;
(2) what exact command should I build which starts the swank server.

(1) may be easy, e.g. by checking if command :Dispatch is defined
But I don't know (2) what command to build.
Is using vim-dispatch like starting a command in a new screen/tmux/xterm session?
I mean I have a command that would start the swank server when typed in the shell.
When I want to run this from within vim, then I can execute one of these (or similar):

:! screen -X eval "command"
:! tmux new-window -d 'command'
:! xterm -e command &

What would be the vim-dispatch equivalent?

from slimv.

ELLIOTTCABLE avatar ELLIOTTCABLE commented on July 2, 2024

The entire point of vim-dispatch is basically to make all the things you're doing in your readme, unnecessary. It handles any forking, or opening of new windows, or whatever, that may be necessary (for almost all vim-dispatch users, this means β€œopen a new tmux split,” because it has special first-class tmux integration). So, basically, to start a background task in a new β€˜window’ (or tmux pane), you'd use:

:Start! command

I'm sure @tpope might be able to better explain than I, if he's listening to his notifications. (=

from slimv.

tpope avatar tpope commented on July 2, 2024

Yes, depending on the environment, :Start command or :Start! command could invoke something similar to any of those 3 (the former being foregrounded and the latter backgrounded). Check with exists(':Start') == 2.

from slimv.

Related Issues (20)

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.