Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

gokayburuc.dev
gokayburuc.dev

Posted on • Edited on

Neovim: Share Code as Screenshot

Carbon-Now.nvim

Carbon-now

Sharing code via Neovim has become easier than ever. Now you can share your codes as photos by simply copying them.

You can get information about the configurations from the following github address:

https://github.com/ellisonleao/carbon-now.nvim

If you are using the Lazy package installer, you can easily share it with the configurations I shared below. All you have to do is personalize these settings according to your wishes.

Image description

First, let's look at where these settings come from. When you click on the settings icon on the Carbon.now.sh web page, the names of the settings will appear.

Image description

When you change the values here, you will see a change in the relevant option value in the page URL.

Image description

SampleURL:

https://carbon.now.sh/?bg=midnightblue&t=verminal&wt=boxy&l=lua&width=680&ds=false&dsyoff=20px&dsblur=68px&wc=true&wa=true&pv=56px&ph=56px&ln=true&fl=1&fm=Monoid&fs=18px&lh=133%25&si=false&es=2x&wm=false&code=%2509print%28%27hello%2520World%21%27%29&tb=Made%2520with%2520carbon-now.nvim
Enter fullscreen modeExit fullscreen mode

when we parsed this URL usingfreeformatter.com HTML Query String looks like this:

-Query String-'bg':   midnightblue't':    verminal'wt':   boxy'l':    lua'width':    680'ds':   false'dsyoff':   20px'dsblur':   68px'wc':   true'wa':   true'pv':   56px'ph':   56px'ln':   true'fl':   1'fm':   Monoid'fs':   18px'lh':   133%'si':   false'es':   2x'wm':   false'code': %09print('hello%20World!')'tb':   Made%20with%20carbon-now.nvim
Enter fullscreen modeExit fullscreen mode

This means when we change bg value background changes. You can compare remains if you desire. Whatever, in our configuration parameters changes these values.

{"ellisonleao/carbon-now.nvim",lazy=true,cmd="CarbonNow",config=function()localcarbon=require("carbon-now")carbon.setup({open_cmd="chromium-browser",base_url="https://carbon.now.sh/",options={font_family="Monoid",theme="verminal",bg="midnightblue",drop_shadow=true,-- true, falsedrop_shadow_blur="68px",drop_shadow_offset_y="20px",font_size="18px",line_height="133%",line_numbers=true,-- true,falsetitlebar="@gokayburuc with carbon-now.nvim",watermark=false,-- true, falsewindow_theme="boxy",-- sharp, none, boxy, bw},})end,},
Enter fullscreen modeExit fullscreen mode

I'm using chromium-browser so i changedopen_cmd with this value. And I changed titlebar option with my own message.

Usage

Once you have adjusted everything and shut down the Lazy screen, launch the screen you wish to copy. Enter CarbonNow into the command line after selecting the text to copy from this screen in Virtual Mode. With your code, it will take you straight to the carbon.now website. Send your code as a PNG file or tweet it.

That is it!

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Industrial Engineer turned Full-Stack Developer. Fluent in Turkish, English, and Russian. Passionate about Go, Rust, Python, Linux, Neovim, and productivity tools like Obsidian.
  • Location
    Kırklareli, Turkey
  • Education
    ННГУ - Университет Лобачевского / University of Lobachevsky (Nizhny Novgorod, Russia
  • Pronouns
    he/him
  • Work
    Freelance Developer
  • Joined

More fromgokayburuc.dev

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp