Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Vim on Browser (short)

Linda_pp
October 04, 2016

Vim on Browser (short)

emscripten night LT

Linda_pp

October 04, 2016
Tweet

More Decks by Linda_pp

Other Decks in Technology

Transcript

  1. Vim.js ͱ͸ • https://github.com/coolwanglu/vim.js/ • Vim Λϒϥ΢βʹҠ২ͨ͠΋ͷ • Author: Wang

    Lu (ɹɹ@coolwanglu) • Emscripten Λ࢖ͬͯ Vim ͷίʔυΛ JavaScript (asm.js) ʹίϯύΠϧ 
  2. Vim.js ͷ࢓૊Έ • Vim ͷϑϩϯτΤϯυ෦෼Λ֦ு • gui_gtk.c ΍ gui_win32.c, gui_x11.c

    ͳͲʹՃ͑ ͯ gui_web.c Λ࣮૷ • gui_web.c ಺Ͱ Emscripten ͷ API Λ௨ͯ͠ϒϥ ΢βଆ (JavaScript) ͱͭͳ͛Δ 
  3. Vim.js ͷػೳ • .vimrc ͸ Local Storage ্ʹஔ͔ΕΔͷͰΧε λϚΠζˍอଘ͕Մೳ •

    Vim script ͕ಈ͘ → Vim ϓϥάΠϯ͕ಈ͘ • :! console.log(‘Hello, JavaScript!’) 
  4. react-vimjs ͱ͸ ίϯύΠϧࡁΈͷ Vim.js Λ bundle ͠ɼReact ίϯϙʔωϯτͱͯ͠؆୯ ʹ࢖͑ΔΑ͏ʹͨ͠΋ͷ 

    1 import React from 'react' 2 import Vim from 'react-vimjs' 3 4 React.render( 5 <Vim memPath="path/to/dist/vim.js.mem"> 6 Loading... 7 </Vim>, 8 document.body 9 );