Share
Embed
Transcript
13 slides
-
Vim and the Web Ways to use Vim in ways
you probably shouldn’t, but someone on Hacker News will convince you to buy a Chromebook, so… -
Working in the cloud “A buzz from my iPhone tells
me my build and tests are finished. I pull it out and glance at the push notification, courtesy of Prowl. New test failures. I finish jotting down my thoughts so far into the Pages document I’m using for the spec then swipe back to iSSH.” ! — Mark O’Connor -
Cloud9 Vim Features • hjkl (phew) • Visual, Visual-block •
Left-right and up-down motions, repeat motion • Commands (r, d), motions as arguments • Numerical arguments • Repeat with . • Yank, put • No named registers, no replace, :%s, no split windows… -
Ace Open source, derived from Cloud9, used by GitHub !
GitHub trick: http://lauris.h-s.io/2013/12/13/github-vim-editor/ -
Vim.js • Real Vim! • Emscripten • 1,800 stars •
HTML5 File API • .vimrc • https://github.com/coolwanglu/vim.js -
Vim.js build process 1. Build Vim 2. Take the LLVM
byte code and process it with Emscripten 3. Emscripten generates asm.js JavaScript 4. Transformed with Node programs 5. Closure Compiler Client-side code for keyboard DOM events and HTML5 filesystem API is added as well. -
Browser support • Chrome: Fast • Firefox: Best support •
IE: Average performance and support • Note: The online demo is built with a small feature set -
Performance • Firefox on Mac OS X: Mavericks • Duck
Duck Go: 260 MB • Cloud9, Vim mode: 446.1 MB • Running Vim.js: 592 MB -
What can you do with Vim.js? • Help the author,
because it would be a way of running everything (like plugins) on the web • You could technically drop it into a project • Imagine a combination of GitHub, Heroku, and Vim.js to make an online IDE -
Chromebooks, Tablets • There are times when you don’t have
access to a regular Linux, Mac OS, or Windows computer • NPD: 21% of laptop sales in 2013 were Chromebooks • Chromebooks can be cheap, ARM-based, with small storage • Android and iOS tablets have fast and capable browsers • Does Safari crash all the time for everyone else or is it just me? -
But I can use ssh! • Experiments like Vim.js may
open up new opportunities • Embed Ace with Vim mode in your own web apps! • Trick GitHub into using Vim • Education: Read an eBook on a tablet, edit code in Vim without leaving the book • Edit your projects from any browser… at least for browser and Node projects