{"id":19835919,"url":"https://github.com/ofadiman/nvim-codeshot","last_synced_at":"2025-05-01T17:34:16.958Z","repository":{"id":228140642,"uuid":"771755853","full_name":"Ofadiman/nvim-codeshot","owner":"Ofadiman","description":"Take a code screenshot in neovim.","archived":true,"fork":false,"pushed_at":"2024-06-25T17:25:11.000Z","size":6078,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T21:59:28.547Z","etag":null,"topics":["lua","neovim","neovim-plugin","nvim","nvim-plugin","plugin","puppeteer","screenshot","shiki","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ofadiman.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-13T22:24:25.000Z","updated_at":"2024-10-17T16:58:21.000Z","dependencies_parsed_at":"2024-06-24T18:13:40.987Z","dependency_job_id":null,"html_url":"https://github.com/Ofadiman/nvim-codeshot","commit_stats":null,"previous_names":["ofadiman/nvim-code-screenshot","ofadiman/nvim-codeshot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ofadiman%2Fnvim-codeshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ofadiman%2Fnvim-codeshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ofadiman%2Fnvim-codeshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ofadiman%2Fnvim-codeshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ofadiman","download_url":"https://codeload.github.com/Ofadiman/nvim-codeshot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251914992,"owners_count":21664461,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lua","neovim","neovim-plugin","nvim","nvim-plugin","plugin","puppeteer","screenshot","shiki","typescript"],"created_at":"2024-11-12T12:09:35.599Z","updated_at":"2025-05-01T17:34:13.384Z","avatar_url":"https://github.com/Ofadiman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nvim Codeshot\n\nNvim Codeshot is a plugin that allows you to take a screenshot of the code in the file you are currently working in.\n\n## Requirements\n\n- Neovim@0.9.0\n- NodeJS@20\n\n## Installation\n\nCodeshot can be installed using any package manager. Here is an example of installation using [lazy.nvim](https://github.com/folke/lazy.nvim):\n\n```lua\nrequire(\"lazy\").setup({\n  {\n    \"Ofadiman/nvim-codeshot\",\n    -- Install latest chrome browser required for puppeteer.\n    build = \":lua require('nvim-codeshot').install()\"\n  },\n})\n```\n\nAfter installation, you can configure a keyboard shortcut that invokes the screenshot command.\n\n```lua\nvim.keymap.set(\"v\", \"\u003cleader\u003eua\", function()\n  vim.cmd(\":CodeshotScreenshot\")\nend, { noremap = true, silent = true, nowait = true })\n```\n\n## Configuration\n\n```lua\nrequire(\"nvim-codeshot\").setup({\n  -- Setting this option to `true` will cause the screenshot to contain the path to the file where the screenshot was taken.\n  breadcrumbs = true,\n  padding = {\n    -- Allows to configure the amount of horizontal padding.\n    horizontal = 10,\n    -- Allows to configure the amount of vertical padding.\n    vertical = 10,\n  },\n  html = {\n    -- Allows to completely override default html template used for generating screenshots.\n    template = \"\",\n    -- Allows to add a watermark to the page that renders the code.\n    watermark = \"\",\n    -- Allows to add additional styles to the page that renders the code.\n    styles = \"\",\n  },\n  whitespace = {\n    -- Setting this option to `false` will result in the extra whitespace not being removed from the code at screenshot time.\n    trim = true,\n    -- Allows to set the indentation width for code that uses tabs for indentations.\n    tab_width = 2,\n  },\n  output = {\n    -- Setting this option to `true` will cause the screenshot to be saved to the file system. Screenshot by default is only copied to clipboard.\n    enable = false,\n    -- Path to the folder with screenshots.\n    directory = \"~/.codeshot\",\n    -- Allows to format screenshot filename using lua function. Screenshot file names will by default follow `filename.extension` format (e.g. `readme.md.png`).\n    -- For example, if you want to have `readme.md_2024_05_26_13:22:06.png` filename format, you have to add custom formatting function that would look like this:\n    -- formatter = function(filename)\n    --   return filename .. \"_\" .. os.date(\"%Y_%m_%d_%H:%M:%S\")\n    -- end,\n    formatter = function(filename)\n      return filename\n    end,\n  },\n  clipboard = {\n    -- Setting this option to `false` will cause the screenshot not being copied to the clipboard.\n    enable = true,\n    -- Allows to configure command which will be used to copy image to clipboard. The plugin currently supports the following clipboard managers:\n    -- * xclip (command: `xclip -selection clipboard -t image/png -i %s`)\n    -- If you are using unlisted clipboard manager you have to configure the script used to copy the image by yourself.\n    command = nil,\n  },\n  -- Allows to configure theme used for making screenshots. The full list of themes is available here: https://shiki.style/themes\n  theme = \"catppuccin-mocha\",\n  -- Allows to configure screenshot extension. Currently supported extensions are `webp`, `jpeg` and `png`.\n  extension = \"png\",\n  -- Allows to customize screenshot scale.\n  scale = 3,\n  aliases = {\n    -- Allows to set language aliases so that, for example, files with extension `.ofa` are treated as files with extension `.js` when taking a screenshot. Available language aliases: https://shiki.style/languages\n    languages = nil,\n    -- Allows to set file aliases so that, for example, files without extension (like Makefile) can be interpreted correctly when taking a screenshot. Available language aliases: https://shiki.style/languages\n    files = nil,\n  },\n})\n```\n\n## Similar projects\n\n- [carbon-now-sh.nvim](https://github.com/cameronviner/carbon-now-sh.nvim)\n- [codesnap.nvim](https://github.com/mistricky/codesnap.nvim)\n- [silicon.nvim](https://github.com/krivahtoo/silicon.nvim)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fofadiman%2Fnvim-codeshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fofadiman%2Fnvim-codeshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fofadiman%2Fnvim-codeshot/lists"}