Giter Club home page Giter Club logo

floobits-vim's Introduction

Floobits Vim Plugin

Real-time collaborative editing. Think Etherpad, but with native editors. This is the plugin for Vim. We're also working on Emacs and have a working plugin for Sublime Text as well as a web-based editor.

Development status: fairly stable.

Unfortunately, Vim's plugin API has few options for running event-driven code. We've figured out two ways, which are described below. Floobits will fall back to the second method if something goes wrong with the first.

1. Vim Server and --remote-expr (Recommended)

To take advantage of this method, you should launch Vim as a server. Some versions of Vim do this automatically, like MacVim. On others, you may need to invoke Vim like so:

vim --servername superawesomename

You will also need to define vim_executable exectable_name in your ~/.floorc file. If you use MacVim, your floorc should contain the line:

vim_executable mvim

This option will sometimes call redraw, which can make the minibuffer blink on ocassion.

2. CursorHold/CursorHoldI with feedkeys.

If your Vim wasn't launched as a server, or something goes wrong, floobits falls back to making an event loop by repeatedly triggering autocommands. This will unfortuantely escape any key sequence, like ctrl-w j, unless you finish it within one tick of the event loop. You can call :FlooPause and :FlooUnpause to pause/unpause the event loop if you have to. Alternatively, you can type really quickly.

Unfortunately, at the end of the day, Vim is purposefully designed to make async actions impossible and these are the only options available.

Installation

username myuser
secret gii9Ka8aZei3ej1eighu2vi8D
vim_executable mvim
  • Vundle users: Add Bundle 'Floobits/floobits-vim' to your ~/.vimrc.
  • Pathogen users: cd ~/.vim/bundle and git clone https://github.com/Floobits/floobits-vim Floobits

Usage

  • :FlooShareDir /path/to/files. Share a directory with others. This will create a new room, populate it with the files in that directory, and open the room's settings in your browser.
  • :FlooJoinRoom https://floobits.com/r/room_owner/room_name/. Join a Floobits room. Room URLs are the same as what you see in the web editor.
  • :FlooPartRoom. Leave the room.
  • :FlooToggleFollowMode. Toggle follow mode. Follow mode will follow the most recent changes to buffers.
  • :FlooSummon. Make everyone in the room jump to your cursor.
  • :FlooPause. Pause the event loop so you can type keyboard shortcuts. (Only necessary in feedkeys fall-back mode.)
  • :FlooUnPause. Resume the event loop so you can collaborate again. (Only necessary in feedkeys fall-back mode.)
  • :FlooDeleteBuf. Delete the current buffer from the room.

Troubleshooting

Other plugins can interfere with Floobits. For example, YouCompleteMe changes updatetime to 2000 milliseconds. This causes increased latency and decreased reliability when collaborating. add let g:ycm_allow_changing_updatetime = 0 to your ~/.vimrc.

If you experience problems, try disabling other plugins before submitting a bug report.

floobits-vim's People

Contributors

ggreer avatar kans avatar larrybolt avatar

Watchers

 avatar  avatar

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.