Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ellisonleao/carbon-now.nvim
Create beautiful code snippets directly from your neovim terminal
https://github.com/ellisonleao/carbon-now.nvim
carbon-now carbon-now-sh lua neovim neovim-plugin plugin snippets vim
Last synced: 5 days ago
JSON representation
Create beautiful code snippets directly from your neovim terminal
- Host: GitHub
- URL: https://github.com/ellisonleao/carbon-now.nvim
- Owner: ellisonleao
- Created: 2022-02-22T01:07:38.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-17T02:22:21.000Z (6 months ago)
- Last Synced: 2024-10-23T02:56:33.360Z (12 days ago)
- Topics: carbon-now, carbon-now-sh, lua, neovim, neovim-plugin, plugin, snippets, vim
- Language: Lua
- Homepage:
- Size: 37.1 KB
- Stars: 172
- Watchers: 3
- Forks: 7
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-neovim - ellisonleao/carbon-now.nvim - Create beautiful code snippets directly from Neovim. (Snippet / PHP)
README
Create beautiful code snippets directly from your neovim terminal
## Requirements
Neovim 0.10+
## Installing
Using your preferred plugin manager, add:
```
'ellisonleao/carbon-now.nvim'
```Example with packer:
```lua
use {"ellisonleao/carbon-now.nvim", config = function() require('carbon-now').setup() end}
```Example with lazy.nvim:
```lua
{
"ellisonleao/carbon-now.nvim",
lazy = true,
cmd = "CarbonNow",
---@param opts cn.ConfigSchema
opts = { [[ your custom config here ]] }
}
```## Configuration and customization
The plugin comes with the following default configs:
```lua
{
base_url = "https://carbon.now.sh/",
options = {
bg = "gray",
drop_shadow_blur = "68px",
drop_shadow = false,
drop_shadow_offset_y = "20px",
font_family = "Hack",
font_size = "18px",
line_height = "133%",
line_numbers = true,
theme = "monokai",
titlebar = "Made with carbon-now.nvim",
watermark = false,
width = "680",
window_theme = "sharp",
padding_horizontal = "0px",
padding_vertical = "0px",
},
}
```You can override it in `setup()` function. Example:
```lua
local carbon = require('carbon-now')
carbon.setup({
options = {
theme = "solarized",
font_family = "Monoid",
}
})
```## Generating snippets from visual selection
Adding a custom mapping for generating a new snippet is really easy
```lua
vim.keymap.set("v", "cn", ":CarbonNow", { silent = true })
```But if you preferer a command, visual select the code you want to share and call:
```
:CarbonNow
```## Generating snippets from github gists
```
:CarbonNow GIST_ID