百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
N

nap

> 编程语言
开源

终端中的代码片段

2.2K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

终端中的代码片段

# Nap zzz Nap is a code snippet manager for your terminal. Create and access new snippets quickly with the command-line interface or browse, manage, and organize them with the text-user interface. Keep your code snippets safe, sound, and well-rested in your terminal.


## Text-based User Interface Launch the interactive interface: ```bash nap ``` Key Bindings
| Action | Key | | :--- | :--- | | Create a new snippet | n | | Edit selected snippet (in `$EDITOR`) | e | | Copy selected snippet to clipboard | c | | Paste clipboard to selected snippet | p | | Delete selected snippet | x | | Rename selected snippet | r | | Set folder of selected snippet | f | | Set language of selected snippet | L | | Move to next pane | tab | | Move to previous pane | shift+tab | | Search for snippets | / | | Toggle help | ? | | Quit application | q ctrl+c | ## Command Line Interface Create new snippets: ```bash # Quick save an untitled snippet. nap < main.go # From a file, specify Notes/ folder and Go language. nap Notes/FizzBuzz.go < main.go # Save some code from the internet for later. curl https://example.com/main.go | nap Notes/FizzBuzz.go # Works great with GitHub gists gh gist view 4ff8a6472247e6dd2315fd4038926522 | nap ``` Output saved snippets: ```bash # Fuzzy find snippet. nap fuzzy # Write snippet to a file. nap go/boilerplate > main.go # Copy snippet to clipboard. nap foobar | pbcopy nap foobar | xclip ``` List snippets: ```bash nap list ``` Fuzzy find a snippet (with [Gum](https://github.com/charmbracelet/gum)). ```bash nap $(nap list | gum filter) ``` ## Installation Install with Go: ```sh go install github.com/maaslalani/nap@main ``` Or download a binary from the [releases](https://github.com/maaslalani/nap/releases). ## Customization Nap is customized through a configuration file located at `NAP_CONFIG` (`$XDG_CONFIG_HOME/nap/config.yaml`). ```yaml # Configuration home: ~/.nap default_language: go theme: nord # Colors background: "0" foreground: "7" primary_color: "#AFBEE1" primary_color_subdued: "#64708D" green: "#527251" bright_green: "#BCE1AF" bright_red: "#E49393" red: "#A46060" black: "#373B41" gray: "240" white: "#FFFFFF" ``` The configuration file can be overridden through environment variables: ```bash # Configuration export NAP_CONFIG="~/.nap/config.yaml" export NAP_HOME="~/.nap" export NAP_DEFAULT_LANGUAGE="go" export NAP_THEME="nord" # Colors export NAP_PRIMARY_COLOR="#AFBEE1" export NAP_RED="#A46060" export NAP_GREEN="#527251" export NAP_FOREGROUND="7" export NAP_BACKGROUND="0" export NAP_BLACK="#373B41" export NAP_GRAY="240" export NAP_WHITE="#FFFFFF" ```

## License [MIT](https://github.com/maaslalani/nap/blob/master/LICENSE) ## Feedback I'd love to hear your feedback on improving `nap`. Feel free to reach out via: * [Email](mailto:[email protected]) * [Twitter](https://twitter.com/maaslalani) * [GitHub issues](https://github.com/maaslalani/nap/issues/new) --- zzz

GitHub Issues· 0 开放

在 GitHub 查看全部

暂无开放 Issues,或尚未同步最近议题。

核心特点

  • •Go

> 标签

Go

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言