{"id":26467440,"url":"https://github.com/brianhuster/nvcat","last_synced_at":"2025-03-19T14:41:33.264Z","repository":{"id":281389317,"uuid":"945000677","full_name":"brianhuster/nvcat","owner":"brianhuster","description":"`cat` but with syntax highlighting powered by Neovim","archived":false,"fork":false,"pushed_at":"2025-03-18T09:50:37.000Z","size":1681,"stargazers_count":30,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T10:38:35.661Z","etag":null,"topics":["neovim","nvim"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brianhuster.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":"2025-03-08T12:27:59.000Z","updated_at":"2025-03-18T09:50:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"f9032889-bba8-4ea4-afa1-a32720e34736","html_url":"https://github.com/brianhuster/nvcat","commit_stats":null,"previous_names":["brianhuster/nvcat"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianhuster%2Fnvcat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianhuster%2Fnvcat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianhuster%2Fnvcat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianhuster%2Fnvcat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brianhuster","download_url":"https://codeload.github.com/brianhuster/nvcat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244448074,"owners_count":20454433,"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":["neovim","nvim"],"created_at":"2025-03-19T14:41:32.659Z","updated_at":"2025-03-19T14:41:33.256Z","avatar_url":"https://github.com/brianhuster.png","language":"Go","funding_links":["https://paypal.me/brianphambinhan"],"categories":[],"sub_categories":[],"readme":"# nvcat\n\nA command-line utility that displays files with Neovim's syntax highlighting in the terminal.\n\n## Overview\n\n`nvcat` is a CLI tool similar to Unix's `cat` but with syntax highlighting powered by Neovim's syntax and treesitter engines. It leverages Neovim's capabilities to provide accurate syntax highlighting for a wide range of file formats directly in your terminal.\n\n## Features\n\n- Syntax highlighting using Neovim's highlighting engine\n- Support for treesitter-based highlighting\n- Optional line numbers\n- Can use your existing Neovim configuration or run with a clean instance\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"600px\"\u003e\n      \u003cimg src=\"https://github.com/user-attachments/assets/cfc76a64-e0da-4ac1-8860-cf14a091e9fc\" /\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003cth\u003eViewing a Lua file with \u003ca href=\"https://github.com/folke/tokyonight.nvim\"\u003eTokyonight-night colorscheme\u003c/a\u003e\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"600px\"\u003e\n      \u003cimg src=\"https://github.com/user-attachments/assets/79d53df0-6fcc-4ada-a36d-42179e447bd3\" /\u003e\n    \u003c/td\u003e      \n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003cth\u003e\n      Nvcat as \u003ca href=\"https://github.com/junegunn/fzf\"\u003efzf\u003c/a\u003e's preview, with my custom \n      \u003ca href=\"https://github.com/brianhuster/dotfiles/blob/5e7aed6/nvim/colors/an.lua\"\u003ecolorscheme\u003c/a\u003e.\n    \u003c/th\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Installation\n\n**Prequisites**:\n- Neovim 0.10+ (must be accessible via `nvim`)\n- A terminal that supports true color\n\n### Prebuilt binaries\n\nSee the [releases page](https://github.com/brianhuster/nvcat/releases) for prebuilt binaries for Linux, macOS, and Windows.\n\n### From source\n\nRequires Go 1.22+\n\n```bash\ngo install github.com/brianhuster/nvimcat@latest\n```\n\nOr clone and build manually:\n\n```bash\ngit clone https://github.com/brianhuster/nvcat.git\ncd nvcat\nsudo make install\n```\n\n## Usage\n\n```bash\nnvcat [options] \u003cfile\u003e\n```\n\n### Options\n\n* `-n`: Show line numbers\n* `-clean`: Don't load Neovim's config\n* `-v`: Show version information\n* `-h`: Show help information\n\n## Configuration\n\nYou can configure Nvcat using Vimscript or Lua just the same as you would with Neovim. However, it is recommended to start from a scratch config, because LSP, plugins can cause unnecessary long startup time and other unexpected behaviors. Generally you would only need to set colorscheme, tabstop, or enable Treesitter highlighting\n\nThere are 2 ways to configure Nvcat:\n\n#### 1. Use Nvcat's config directory: `$XDG_CONFIG_HOME/nvcat/init.lua` or `$XDG_CONFIG_HOME/nvcat/init.vim`.\n\nWith this method, your Nvcat configuration will be seperated from your Neovim configuration, and it can be loaded even when the flag `-clean` is given\n\nExample:\n```lua\n--- ~/.config/nvcat/init.lua\nvim.opt.rtp:append(path/to/your/colorscheme/runtimepath)\n-- Add runtimepath directory containing 'parser/\u003cyour-treesitter-parsers\u003e'\nvim.opt.rtp:append(\"replace/with/your/actual/path\")\n\nvim.cmd.colorscheme(\"your-colorscheme\")\nvim.o.tabstop = 4\n\nvim.api.nvim_create_autocmd(\"FileType\", {\n    callback = function()\n        pcall(vim.treesitter.start)\n    end\n})\n```\n\n#### 2. Use Neovim's config dictionary (`:echo stdpath('config')`).\n\nNvcat sets Vimscript variable `g:nvcat` on startup, so you can use it to control which parts of your Neovim configuration should not be used by Nvcat.\n\nExample:\n```lua\n--- ~/.config/nvim/init.lua\nif vim.g.nvcat then\n    -- Nvcat configuration\nelse\n    -- LSP, plugins, etc.\nend\n```\n\n## Limitationns\n\n- `nvcat` only supports legacy and Treesitter-based syntax highlighting engines. It does not support LSP-based highlighting.\n- `nvcat` doesn't change background colors, so you should use a color scheme that has a background color similar to your terminal's\n\n## Buy me a coffee\n\n\u003ca href=\"https://paypal.me/brianphambinhan\"\u003e\n    \u003cimg src=\"https://www.paypalobjects.com/webstatic/mktg/logo/pp_cc_mark_111x69.jpg\" alt=\"Paypal\" style=\"height: 69px;\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://img.vietqr.io/image/mb-9704229209586831984-print.png?addInfo=Donate%20for%20livepreview%20plugin%20nvim\u0026accountName=PHAM%20BINH%20AN\"\u003e\n    \u003cimg src=\"https://github.com/user-attachments/assets/f28049dc-ce7c-4975-a85e-be36612fd061\" alt=\"VietQR\" style=\"height: 85px;\"\u003e\n\u003c/a\u003e\n\n## Credits\n\n- [neovim/go-client](https://github.com/neovim/go-client)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianhuster%2Fnvcat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianhuster%2Fnvcat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianhuster%2Fnvcat/lists"}