install.fairie/dotfiles/.vim/plugged/vim-carbon-now-sh
Git E2E Dev Test Username be93c28e01 git subrepo clone (merge) https://github.com/kristijanhusak/vim-carbon-now-sh.git ./dotfiles/.vim/plugged/vim-carbon-now-sh
subrepo:
  subdir:   "dotfiles/.vim/plugged/vim-carbon-now-sh"
  merged:   "31a18d26"
upstream:
  origin:   "https://github.com/kristijanhusak/vim-carbon-now-sh.git"
  branch:   "master"
  commit:   "31a18d26"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"
2022-10-18 10:37:00 -04:00
..
doc git subrepo clone (merge) https://github.com/kristijanhusak/vim-carbon-now-sh.git ./dotfiles/.vim/plugged/vim-carbon-now-sh 2022-10-18 10:37:00 -04:00
plugin git subrepo clone (merge) https://github.com/kristijanhusak/vim-carbon-now-sh.git ./dotfiles/.vim/plugged/vim-carbon-now-sh 2022-10-18 10:37:00 -04:00
.gitrepo git subrepo clone (merge) https://github.com/kristijanhusak/vim-carbon-now-sh.git ./dotfiles/.vim/plugged/vim-carbon-now-sh 2022-10-18 10:37:00 -04:00
LICENSE git subrepo clone (merge) https://github.com/kristijanhusak/vim-carbon-now-sh.git ./dotfiles/.vim/plugged/vim-carbon-now-sh 2022-10-18 10:37:00 -04:00
README.md git subrepo clone (merge) https://github.com/kristijanhusak/vim-carbon-now-sh.git ./dotfiles/.vim/plugged/vim-carbon-now-sh 2022-10-18 10:37:00 -04:00

vim-carbon-now-sh

(n)vim implementation plugin for opening selected content in https://carbon.now.sh.

Installation

Vundle

Add the following line to your .vimrc

Plugin 'kristijanhusak/vim-carbon-now-sh'

Then run the following in Vim:

:source %
:PluginInstall

Usage

Select some text in visual mode and run this command:

:CarbonNowSh

You can also map it to something and use it after selection:

vnoremap <F5> :CarbonNowSh<CR>

Alternate Endpoint

To send your code snippets to a local instance of carbon.now instead of the public, shared site (e.g. if you're doing private development, your code is internal, etc.), pass in an alternate base URL via your Vim config:

let g:carbon_now_sh_base_url = 'http://localhost:3000'

Browser

Plugin will try it's best to use your default browser. If it fails, or you want to customize it, provide browser executable through this option to your vimrc. Example for google-chrome:

let g:carbon_now_sh_browser = 'google-chrome'

Options

You can set the query string that will be passed to https://carbon.now.sh. Example for setting font and line number:

let g:carbon_now_sh_options =
\ { 'ln': 'true',
  \ 'fm': 'Source Code Pro' }