christoomey / dotfiles

My vim, zsh, git, tmux, and other config files and utility scripts.
MIT License
465 stars 31 forks source link

Add commands to send JS to chrome for execution #110

Open christoomey opened 9 years ago

christoomey commented 9 years ago

Using chrome-cli I can execute arbitrary JS in a page context. Just need to slap together the right system call from Vim. A start:

function! s:ExecuteInPageConsole()
  let line = escape(getreg("."), "'")
  silent call system("chrome-cli execute '" . line . "'")
endfunction

command! ExecuteInPageConsole call <sid>ExecuteInPageConsole()