{"id":26486941,"url":"https://github.com/carsonslovoka/nvim","last_synced_at":"2026-04-15T13:33:14.901Z","repository":{"id":283205849,"uuid":"907666705","full_name":"CarsonSlovoka/nvim","owner":"CarsonSlovoka","description":"Write your own lua to create your own neovim","archived":false,"fork":false,"pushed_at":"2026-04-10T13:11:20.000Z","size":1192,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-10T14:22:49.142Z","etag":null,"topics":["chinese","lua","neovim","taiwan","vim"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/CarsonSlovoka.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-24T05:35:39.000Z","updated_at":"2026-04-10T13:11:27.000Z","dependencies_parsed_at":"2025-06-25T04:19:47.781Z","dependency_job_id":"4a795a46-131f-43ab-8b11-c4b77da64bbd","html_url":"https://github.com/CarsonSlovoka/nvim","commit_stats":null,"previous_names":["carsonslovoka/nvim"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/CarsonSlovoka/nvim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarsonSlovoka%2Fnvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarsonSlovoka%2Fnvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarsonSlovoka%2Fnvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarsonSlovoka%2Fnvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CarsonSlovoka","download_url":"https://codeload.github.com/CarsonSlovoka/nvim/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarsonSlovoka%2Fnvim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31842914,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T13:28:40.153Z","status":"ssl_error","status_checked_at":"2026-04-15T13:28:29.396Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["chinese","lua","neovim","taiwan","vim"],"created_at":"2025-03-20T06:31:08.517Z","updated_at":"2026-04-15T13:33:14.890Z","avatar_url":"https://github.com/CarsonSlovoka.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 專案動機\n\n我從0開始，沒接觸過lua，之前也未用過vim\n\n我會想要自己可以完全作主，所以有需要的功能會自己寫lua來完成 (如果你沒用過lua，問一下AI很快就能進入狀況)\n\n插件盡可能的少用且插件並非透過插件管理器來安裝，而是自己git clone下來放到指定目錄\n\n不過這些項目都有加到submodule之中，因此還是可以快速的完成配置\n\n總之如果你想要自己完全作主，不想要依靠太多的插件，你可以從這個專案的一開始看起\n\n我相信能讓您得到很好的起發😊\n\n\n# Install neovim\n\n```bash\nsudo apt-get install ninja-build gettext cmake unzip curl build-essential\ngit clone https://github.com/neovim/neovim.git ~/neovim\n\ngit checkout v0.11.0 # a99c469\n\nmake CMAKE_BUILD_TYPE=RelWithDebInfo\n\n# https://github.com/neovim/neovim/blob/096ae3bfd7075dce69c70182ccedcd6d33e66d31/BUILD.md?plain=1#L16\ncd build \u0026\u0026 cpack -G DEB \u0026\u0026 sudo dpkg -i \"nvim-linux-$(uname -m).deb\"\n\n# check\ndpkg -l | grep neovim\nnvim -V1 -v\n```\n\n# Version\n\n`nvim --version`\n\n```\nNVIM v0.12.0\nBuild type: Release\nLuaJIT 2.1.1774896198\n```\n\n## v0.12.0\n\n0.12.0開始提供內建的插件管理器，當使用\n\n```lua\nvim.pack.add({\n    \"https://github.com/nvim-treesitter/nvim-treesitter\",\n    \"...\"\n\n    -- Warn: 裡面可以加上rev, 但是: nvim-pack-lock.json 中可能不會和設定的一樣，所以還是以nvim-pack-lock.json的內容為主，如果有需要調整就去更改它\n})\n```\n\n會自動來下載，並且儲放於目錄: `$XDG_DATA_HOME/nvim/site/pack/core/opt/`\n\n```vim\n:lua print(vim.fn.stdpath('data') .. '/site/pack/core/opt/')\n```\n\n在mac下預設是此位置:\n\n```sh\n~/.local/share/nvim/site/pack/core/opt/\u003cpackage_name\u003e\n\nrm -rf ~/.local/share/nvim/site/pack/core/opt\n```\n\n\n並且用: [nvim-pack-lock.json](nvim-pack-lock.json) 來記錄版本\n\n\n\u003e [!IMPORTANT] nvim.pack.add只負責生成 nvim-pack-lock.json 而真實的版本控管都是靠 nvim-pack-lock.json 也就是就算 `nvim.pack.add` 當中的rev與json不同時，還是以json的資料為主\n\n\n\u003e [!TIP] 因此如果有新的插件，或者要鎖定插件的版本，只要簡單的用`vim.pack.add()`寫一次套件的下載來源，而真實的版控只要在 nvim-pack-lock.json 寫對\n\u003e\n\u003e 那麼nvim啟動時，如果發現`$XDG_DATA_HOME/nvim/site/pack/core/opt/`目錄中沒有該套件，就會主動依據json中告知的rev去下載到其版本！\n\n\n---\n\n如果動到了`~/.local/share/nvim/site/pack/core/opt/`當中某些插件的版本，又想要還原，可以直接刪除該套件目錄，靠`nvim-pack-lock.json`來重新產生\n\n```sh\n# 也可以整個目錄都刪除，讓所有內容再次依據`nvim-pack-lock.json`來生成\nrm -rf ~/.local/share/nvim/site/pack/core/opt/\n```\n\n### ssh\n\nvim.pack.add 會靠git去下載，如果你用的是ssh的方式且有 passphrase 設定，就會沒辦法下載成功\n\n此時可以考慮先將 passphrase 移除\n\n```sh\nssh-keygen -p -f ~/.ssh/myPrivateKey  # 重新設定，都留下空白，就等於移除\n# 之後等套件載完了之後，可以再做一次指令，打上原本的密碼，或者一開始就先備份再還原都行\n```\n\n如果還是不行在 `~/.ssh/config` 可以考慮新增此內容\n```sh\nHost github.com\n    HostName github.com\n    User git\n    IdentityFile ~/.ssh/my_key\n#                 👆 換成你的key\n```\n\n\n接著用`ssh git@github.com`測試，若成功即可\n\n\n# INSTALL carson/nvim\n\n```sh\nmkdir -p ~/.config/nvim\ngit clone https://github.com/CarsonSlovoka/nvim.git ~/.config/nvim\ncd ~/.config/nvim\ngit submodule update --init --recursive\n\n# (可選) 初始化自定義永定書籤 (此檔案如果沒有, 會幫忙生成)\necho 'return {\n   { name = \"Documents\", path = \"~/Documents\" },\n   { name = \"Downloads\", path = \"~/Downloads\" },\n}' \u003e\u003e ~/.config/nvim/bookmarks/default.lua\n\n\n# (可選) 安裝Nerd Fonts\nwget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/FiraCode.zip\nunzip FiraCode.zip -d ~/.fonts\nrm -v *.zip\necho 'font=FiraCodeNerdFontMono-Retina:size=14' \u003e\u003e ~/.config/foot/foot.ini # 設定終端機的字型\n\n\n# (可選) 為了javascript的lsp\nsudo npm install -g typescript-language-server typescript\ntypescript-language-server -V\nsudo npm install -g prettier # 可以格式化\nprettier -v\n# 3.6.2\ntee ~/.prettierrc \u003c\u003c EOF\n{\n  \"semi\": false,\n  \"endOfLine\": \"lf\",\n  \"overrides\": [\n    {\n      \"files\": \"*.jxa\",\n      \"options\": {\n        \"parser\": \"babel\"\n      }\n    }\n  ]\n}\nEOF\n# Note: 如果想要更改，還是可以在專案中再新增 .prettierrc 會用最先抓到的當成設定檔\n\n\n# deno fmt 配置: 沒有預設的全域設定，只能在各別的專案中調整\n# https://docs.deno.com/runtime/fundamentals/linting_and_formatting/\n# https://docs.deno.com/runtime/fundamentals/configuration/#formatting\n# tee path/to/deno.json \u003c\u003c EOF\n# {\n#   \"fmt\": {\n#     \"semiColons\": false\n#   }\n# }\n# EOF\n\n# (可選) 安裝sqls\n# https://github.com/sqls-server/sqls\ngo install github.com/sqls-server/sqls@latest\nsqls --version\n# dsqls version Version:0.2.28, Revision:HEAD\n\n```\n\nwindows的font family切換可以參考[windows.md](docs/windows.md#Fonts)\n\n\u003e 如果有需要還要安裝想要的[lsp server](#安裝語言伺服器)\n\n\n添加doc\n\n```bash\n# (可選) tags\n# ALL 會將所有runtimepath，有doc的資料夾自動去生成 tags 目錄\n:helptags ALL\n\n# 你也可以選擇各別添加\n:helptags ~/.config/nvim/doc\n:helptags ~/.config/nvim/pack/search/start/telescope.nvim/doc/\n:helptags ~/.config/nvim/pack/git/start/gitsigns.nvim/doc/\n:helptags ~/.config/nvim/pack/tree/start/nvim-tree.lua/doc/\n# \u003e 會在該目錄下生成出tags的文件，如果這些目錄在runtimepath下，就會自動生成文檔\n```\n\n## [ripgrep](https://github.com/BurntSushi/ripgrep) (可選)\n\n```sh\nsudo apt install ripgrep\n```\n\nwindows可以來此頁面: https://github.com/BurntSushi/ripgrep/releases/tag/14.1.1 找到合適的選項下載,\n\n例如: [ripgrep-14.1.1-x86_64-pc-windows-gnu.zip](https://github.com/BurntSushi/ripgrep/releases/download/14.1.1/ripgrep-14.1.1-x86_64-pc-windows-gnu.zip)\n\n完成之後解壓縮，並設定該目錄可以讓環境變數`PATH`抓到rg.exe, 例如: `C:\\usr\\bin\\ripgrep\\rg.exe`\n\n# 目錄結構\n\n- ✅ 表示目前已經有實作\n- 沒有標記的部份就只是目前規劃\n\n```lua\n~/.config/nvim/\n├── init.lua                         -- ✅ 主入口配置文件\n├── bookmarks/                       -- ✅ 自定義永久書籤的內容\n│   ├── default.lua                  -- 預設的永久書籤\n│   ├── other_bookmark.lua           -- (可選) 其他永久書籤\n│   └── ...\n├── doc/                             -- ✅ nvim的幫助文檔(可用:help找尋關聯tag)\n├── pack/                            -- 🔹 git rev-parse --short HEAD | wl-copy 🔹 git branch -v\n│   ├── syntax/start/\n│   │          ├── nvim-treesitter              -- ✅ 語法高亮 (99dfc5a 2026-01-04)\n│   │          ├── nvim-treesitter-context      -- ✅ 頂端凍結函數名 (v1.0.0... 59f318a)\n│   │          └── nvim-treesitter-textobjects  -- ✅ visual下的選取, 移動(function, class), 參數交換 (需要先裝nvim-treesitter以及lsp之後才能有效使用) (28a3494 2026-01-02)\n│   │\n│   ├── lsp/start/                   -- ✅ language server protocol\n│   │       │\n│   │       └── nvim-lspconfig/      -- 🚮 從nvim 0.11開始，這已經不需要了, 不過當中的語言設定檔還是有一些參考價值\n│   │\n│   ├── git/start/                   -- ✅ git\n│   │       │\n│   │       └── gitsigns.nvim/       -- ✅ 編輯的時候，可以看到git上的異動(新增, 刪除, 修改...) (v2.0.0...  6bd2949 2026-01-01)\n│   │\n│   ├── motion/start/                -- ✅ 移動相關 2b68ddc\n│   │          ├── leap.nvim         -- ✅ 用兩鍵的方式來移動，預設觸發鍵為s (f19d435 2025-12-04)\n│   │          ├── hop.nvim          -- 🚮 使用模糊搜尋來快速移動. 熱鍵f, F, t, T (v2.7.2... efe5818) -- 我後來選擇用vim預設的motion即可，你可以參考 :help motion.txt 把你面的東西看完，會發現預設的動作其實也不慢！\n│   │          └── precognition.nvim -- ⚠ 可以幫助您學習vi,它會提示可以如何移動  (v1.1.0... 531971e) -- 這個可能是一個過度期會用到的東西，等你熟了以後應該是不再需要了，所以我已經移除，你可以選擇自己再加回\n│   │\n│   ├── icon/start/                  -- ✅ 圖標類\n│   │        └── nvim-web-devicons   -- ✅ 可豐富nvim-tree的導覽，替其新增圖標 (40e9d5a 2026-04-03) ([github-nvim-theme](#github-nvim-theme)可以輔助)\n│   │\n│   ├── tree/start/                  -- ✅ 導覧相關\n│   │        └── nvim-tree.lua       -- ✅ 左測目錄導覽(還可創建目錄,重新命名,...) (v1.14.0  321bc615)\n│   │\n│   ├── search/start/                -- ✅ 搜尋相關\n│   │          ├── telescope.nvim    -- ✅ 可以找文件, 搜索文本, 查看大綱(需與lsp配合)... (3333a52 2025-12-31)\n│   │          └── fzf-lua.nvim      -- ✅ 與 telescope.nvim 類似，但是速度更快 ( fd244f2 )\n│   │\n│   ├── theme/start/                 -- ✅ 主題相關\n│   │         └── github-nvim-theme  -- ✅ 配色 (v1.1.2... c106c94)\n│   │\n│   ├── edit/start/                  -- ✅ 與編輯相關\n│   │         └── cmp                -- ✅ 自動完成 (主要依靠`\u003cC-X\u003e`)\n│   │\n│   ├── sdk/start/\n│   │         └── flutter-tools.nvim     -- ✅ 主要用的語言是dart, 而flutter是一個框架, flutter-tools.nvim能提供其lsp與dap相關設定 (v1.14.0... 8fa438f)\n│   │\n│   ├── other/start/                     -- ✅ 未分類\n│   │         ├── render-markdown.nvim   -- ✅ 將markdown渲染的比較好看 (da6a7b2 2026-01-03)\n│   │         ├── lualine.nvim           -- ✅ statusbar (47f91c4 2025-11-23)\n│   │         └── indent-blankline.nvim  -- ✅ 簡稱為ibl 幫你找出括號配對等等 (v3.8.6 259357f) 考慮到非所有程式都很複雜，因此如果有需要請用指令 :Ibl 去開啟\n│   │\n│   ├── schedule/start/                  -- ✅ 排程相關\n│   │            └── ~~atq.nvim~~        -- ⚠  通知提醒 ( 396ed33 ) -- 不需要用到插件，寫一個簡單的command即可完成: https://github.com/CarsonSlovoka/nvim/blob/62f78b8b2f506b1b4a3eff6006b0fcbbcf06c890/lua/config/commands.lua#L1142-L1223\n│   │\n│   ├── debug/start/                            -- ✅ debug相關套件集\n│   │         ├── nvim-dap                      -- ✅ 一個協議用於neovim上debug等相關事宜(需要再找每一個語言的debug adapter) (03e83f1  2026-01-04) https://microsoft.github.io/debug-adapter-protocol/implementors/adapters/\n│   │         ├── nvim-dap-ui                   -- ✅ 取得 require\"dapui\" (v4.0.0... bc81f8d)\n│   │         ├── nvim-nio                      -- ✅ 此為nvim-dap-ui需要用到的插件 (v1.10.1 21f5324)\n│   │         ├── nvim-dap-python               -- ✅ debug adapter: python ( 3428282 )\n│   │         ├── one-small-step-for-vimkind    -- ✅ debug adapter: lua ( 330049a )\n│   │         └── nvim-dap-go                   -- ✅ debug adapter: go ( 8763ced )\n│   ├── ios/start/\n│   │         └── ~~xcodebuild.nvim~~           -- swift debug相關 (就算要debug swift的專案) e0d54db\n│   │\n│   ├── tools/start/\n│   │         ├── image.nvim                    -- ✅ 使用kitty終端機，能在markdown文件直接看到圖片 ( v1.4.0 446a8a5c )\n│   │         ├── pantran.nvim                  -- ✅ 翻譯工具, engine: google, deepl, ... ( b87c3ae4 )\n│   │         ├── live-preview.nvim             -- ✅ 即時渲染html, md, svg, ...的結果 2026-03-05 v0.9.6... ( c1fcf75c )\n│   │         └── ccc.nvim                      -- ✅ 取色器 v2.0.3... ( 9d1a256 )\n│   │\n│   ├── view/start/\n│   │         └── csvview.nvim       -- ✅ 方便查看和編輯csv ( v1.4.0 9b483f8 )\n│   │\n│   ├── sql/start/                   -- ✅ sql相關\n│   │         └── sqls.nvim          -- ( d1bc542 )\n│   │\n│   └── utils/start/                 -- ✅ 常用函數包裝\n│             ├── ~~nui.nvim~~       -- xcodebuild 需要 de74099\n│             └── plenary.nvim       -- ✅ require('plenary.path'):new(\"~/init.lua\").{exists(), is_dir())... (v1.1.4... 2d9b0617)\n│\n├── ftplugin/                        -- ✅ 依據附檔名才會載入的插件\n│   │\n│   └── markdown/                    -- ✅ markdown編輯, toc相關\n│       ├── editor.lua               -- ✅ editor編輯相關\n│       ├── markdown.lua             -- ✅ markdown大綱生成 (除非沒有裝telescope才會用這種模式)\n│       └── telescope_markdown.lua   -- ✅ 使用telescope生成markdown大綱\n│\n├── lua/                             -- ✅ Lua 配置模組的根目錄\n│   ├── config/                      -- ✅ 基本設定\n│   │   ├── telescope_bookmark.lua   -- ✅ 可以加入書籤(導引到該檔案或目錄)\n│   │   ├── options.lua              -- ✅ 基本選項 (e.g., 編輯器行為、外觀設定)\n│   │   ├── commands.lua             -- ✅ 自定義的命令(:MyCommand, ...)\n│   │   ├── keymaps.lua              -- ✅ 鍵位綁定\n│   │   ├── autocmds.lua             -- 自動命令 (autocommands)\n│   │   └── ...                      -- 其他相關設定\n│   └── utils/                       -- 實用工具函數\n│       ├── exec.lua                 -- ✅ 執行工作相關\n│       └── ...                      -- 其他工具\n├── after/                           -- 用於延遲加載的配置\n│   ├── ftplugin/                    -- 文件類型相關的配置\n│   ├── syntax/                      -- 語法高亮相關配置\n│   └── ...                          -- 其他延遲加載配置\n└── README.md                        -- ✅ 簡單說明文件\n```\n\n# my-customize.lua\n\n如果你有自定義的設定，可以加在`my-customize.lua`中, 例如:\n\n```sh\necho '\nvim.cmd(\"ToggleDiagnosticVirtualText --quite\")\nvim.cmd(\"ToggleDiagnosticHover --quite\")\nvim.cmd(\"SetDiagnostics 0\")\nrequire(\"config.autocmd\").autoReformat = false\n-- vim.opt.runtimepath:append(\"/path/to/project/\") -- 執行`:helptags ALL` 會生成`/path/to/project/doc/tags` 檔案\n-- vim.cmd(\"helptags ALL\")\n' \u003e ~/.config/nvim/lua/my-customize.lua\n```\n\n\n# pack\n\n```\n:help runtimepath\n:help :packadd\n    pack/*/start/{name}\n```\n\n---\n\n有關於插件的位置，其實放在`runtimepath`能找的到的地方都可以\n\n以下指令可查看其所有的位置\n\n```lua\n:echo \u0026runtimepath -- 這是一個字串用,串接每一個路徑\n\n:echo join(split(\u0026runtimepath, ','), \"\\n\") -- 先用,拆成array, 在用\\n來串接，可以把每一個路徑都呈現\n```\n\n\n```bash\nfor dir in ./pack/*; do du -hs \"$dir\"; done\n```\n\n\n## nvim-treesitter\n\n```bash\nmkdir -p ~/.config/nvim/pack/syntax/start/ # 建立一個syntax的群組\ngit clone https://github.com/nvim-treesitter/nvim-treesitter.git ~/.config/nvim/pack/syntax/start/nvim-treesitter\n```\n\n```yaml\n# 此項目是nvim-treesitter所提供的: https://github.com/nvim-treesitter/nvim-treesitter/blob/096babebf6daef2a046650883082ed2b3dcc5b67/lua/nvim-treesitter/health.lua#L117-L174\n:checkhealth\n```\n\n[![treesitter_health](.img/treesitter_health.webp)](./pack/syntax/start/nvim-treesitter/lua/nvim-treesitter/health.lua)\n\n```yaml\n# 更新\n:TSInstall bash lua go gotmpl python xml json jsonc markdown markdown_inline dart elixir sql diff html latex yaml\n:TSUninstall  lua sql gotmpl # 目前這幾個會有問題, 所以先移除\n# ~~:TSUpdate~~\n```\n\n\n[tree-sitter-cli安裝](https://github.com/tree-sitter/tree-sitter/blob/17e3c7a5c56527a179fa6e37ce7ee934493e5047/crates/cli/README.md?plain=1#L12-L24)\n\n```sh\n# ❌ ERROR tree-sitter-cli not found\nsudo npm install -g tree-sitter-cli  # 裝完，終端機整個關閉重啟，就不會再看到以上的錯誤，而是以下內容\n# ✅ OK tree-sitter-cli 0.26.3 (/opt/homebrew/bin/tree-sitter)\n```\n\n### [nvim-treesitter-context](https://github.com/nvim-treesitter/nvim-treesitter-context)\n\n```bash\ngit clone https://github.com/nvim-treesitter/nvim-treesitter-context.git ~/.config/nvim/pack/syntax/start/nvim-treesitter-context\n```\n\n\n### [nvim-treesitter-textobjects](https://github.com/nvim-treesitter/nvim-treesitter-textobjects)\n\n```bash\ngit clone https://github.com/nvim-treesitter/nvim-treesitter-textobjects.git ~/.config/nvim/pack/syntax/start/nvim-treesitter-textobjects\n```\n\n---\n\n此插件只要裝好就可以了，配置了話，要直接在[nvim-treesitter](#nvim-treesitter)的設定新增`textobjects`再輸入想要的內容即可\n\n```lua\nrequire 'nvim-treesitter.configs'.setup {\n    textobjects = {\n        select = {\n            -- ...\n        },\n        move = {\n            -- ...\n        },\n        swap = {\n            -- ...\n        }\n    }\n}\n```\n\n```yaml\n:TSUpdate\n```\n\n測試用腳本\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\n// Add is a simple function that adds two integers.\nfunc Add(a int, b int) int {\n\tresult := a + b\n\treturn result\n}\n\n// Subtract is a simple function that subtracts one integer from another.\nfunc Subtract(a int, b int) int {\n\treturn a - b\n}\n\ntype Calculator struct {\n\tName string\n}\n\n// Multiply multiplies two integers.\nfunc (c Calculator) Multiply(a int, b int) int {\n\treturn a * b\n}\n\nfunc main() {\n\tcalculator := Calculator{Name: \"Basic Calculator\"}\n\tfmt.Println(calculator.Multiply(3, 4))\n}\n```\n\n## lsp\n\n1. ~~下載LSP~~\n2. 安裝語言伺服器\n3. 編輯init.lua: `require'lspconfig'.gopls.setup{}`\n\n![lsp_checkhealth](.img/lsp_checkhealth.webp)\n\n### ~~下載lsp(language server protocol)~~ (已不再需要)\n\n```bash\n## 這個只是protocol, 至於server還是要再另外安裝\nmkdir -p ~/.config/nvim/pack/lsp/start\ngit clone https://github.com/neovim/nvim-lspconfig.git ~/.config/nvim/pack/lsp/start/nvim-lspconfig\n```\n\n\u003e [!NOTE] 可以參考裡面的設定檔，至於安裝則是不用了\n\n### 安裝語言伺服器\n\n#### go\n\n```\ngo install golang.org/x/tools/gopls@latest\nwhich gopls\n# $GOPATH/bin/gopls\n```\n\n\u003e 注意! 當你的go版本有更新的時候，可能要重新再執行一次命令此命令來得到最新版本的解析器\n\u003e\n\u003e 不然在診斷(diagnostic)上可能會看到錯誤或警告\n\n\n#### python\n\n\u003cdetails\u003e\n\u003csummary\u003e👎用虛擬環境(不推薦)\u003c/summary\u003e\n\n```bash\npyenv virtualenv 3.13.0 pyright-env\npyenv activate pyright-env\npyenv versions # check switch\npython -m pip install --upgrade pip\npip install pyright\npip freeze\n# nodeenv==1.9.1\n# pyright==1.1.391\n# typing_extensions==4.12.2\npyenv deactivate\nwhich pyright | wl-copy\n# vim.g.lsp_pyright_path = vim.fn.expand('~/.pyenv/shims/pyright') # 貼上路徑\n\n# 進入nvim之前要啟用虛擬環境, 才會有作用, 而且相關的python套件也要在該虛擬環境有，不然也沒辦法做檢測\npyenv activate pyright-env\nnivm ~/test.py\n```\n\u003c/details\u003e\n\n建議安裝在全局上，可以省得麻煩\n```bash\npyenv versions # 看本機有的python版本或者確認當前使用的python版本\n\n# 安裝指定版本 (如果已經安裝可以省略)\npyenv install 3.13.0\n\n# 啟用指定版本的python\npyenv global 3.13.0\n\n# 安裝pyright\npip install pyright\npip freeze | grep pyright\n# pyright==1.1.399\nwhich pyright | wl-copy\n# vim.g.lsp_pyright_path = vim.fn.expand('~/.pyenv/shims/pyright') # 貼上路徑\n\n# 取得black, isort兩個格式化python用的工具\npip install black isort\n\n# debugpy 在debug python的時候會需要用到: https://github.com/microsoft/debugpy\npip install debugpy\n```\n\n#### [bash-language-server](https://github.com/bash-lsp/bash-language-server)\n\ninstall from [snap](https://snapcraft.io/install/bash-language-server/ubuntu)\n\n```bash\nsudo snap install bash-language-server --classic\nsnap list | grep bash-language-server\n# bash-language-server   4.7.0  69   latest/stable    alexmurray*  classic\n```\n\n另一種方式是透過npm\n\n```bash\n# choco install nodejs -y # 如果是windows，可以考慮用choco來裝nodejs裡面就會有提供npm工具\n# choco upgrade nodejs # 需要管理員權限\n# npm --version # 10.8.3\n# npm install -g npm@11.1.0 # 如果nodejs的版本太舊會沒辦法更新npm\n\nnpm i -g bash-language-server\n```\n\n#### [markdown-oxide](https://github.com/Feel-ix-343/markdown-oxide)\n\n這是用rust寫的項目，如果還沒有安裝rust可以先[安裝](https://rust-lang.github.io/rustup/installation/other.html#other-installation-methods)\n\n安裝好了之後可以得到cargo，就可以透過cargo安裝\n\n\n**install rust**\n\n```yaml\n# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --help\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -v\n# metadata and tool chains\nls ~/.rustup\nls ~/.cargo\nls ~/.cargo/bin # cargo, cargo-fmt, rustfmt, ...\n# ~/.profile # 會自動添加 `. \"$HOME/.cargo/env\"`\n# ~/.bashrc # 會自動添加 `. \"$HOME/.cargo/env\"`\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003esh.rustup.rs的互動訊息\u003c/summary\u003e\n\n```\nWelcome to Rust!\n\nThis will download and install the official compiler for the Rust\nprogramming language, and its package manager, Cargo.\n\nRustup metadata and toolchains will be installed into the Rustup\nhome directory, located at:\n\n  ~/.rustup\n\nThis can be modified with the RUSTUP_HOME environment variable.\n\nThe Cargo home directory is located at:\n\n  ~/.cargo\n\nThis can be modified with the CARGO_HOME environment variable.\n\nThe cargo, rustc, rustup and other commands will be added to\nCargo's bin directory, located at:\n\n  ~/.cargo/bin\n\nThis path will then be added to your PATH environment variable by\nmodifying the profile files located at:\n\n  ~/.profile\n  ~/.bashrc\n\nYou can uninstall at any time with rustup self uninstall and\nthese changes will be reverted.\n\nCurrent installation options:\n\n\n   default host triple: x86_64-unknown-linux-gnu\n     default toolchain: stable (default)\n               profile: default\n  modify PATH variable: yes\n\n1) Proceed with standard installation (default - just press enter)\n2) Customize installation\n3) Cancel installation\n```\n\n\u003c/details\u003e\n\n\u003e 安裝完成之後，記得重新啟動終端機！\n\n\n```sh\ncargo -V\n# cargo 1.84.1 (66221abde 2024-11-19)\n```\n\n**[install markdown-oxide](https://github.com/Feel-ix-343/markdown-oxide/tree/main?tab=readme-ov-file#vscode)**\n\n```sh\ncargo install --locked --git https://github.com/Feel-ix-343/markdown-oxide.git markdown-oxide # 如果日後有更新, 可以再用同樣的指令即可\ncargo install --list | grep markdown-oxide\n# markdown-oxide v0.25.8 (https://github.com/Feel-ix-343/markdown-oxide.git#7365fbe5)\nls -l $(which markdown-oxide)\n# ~/.cargo/bin/markdown-oxide\n\n# cargo uninstall markdown-oxide\n```\n\n\u003e [!NOTE] cargo 安裝的動作, 可能要先將 `[url \"github:\"]` 先移除才能安裝\n\n\n#### [clangd](https://github.com/clangd/clangd)\n\n```sh\nsudo apt install clangd # 113MB\nls -l $(which clangd)\n# /usr/bin/clangd -\u003e clangd-18\n```\n\n---\n\nwindows: 可以到此[頁面](https://github.com/llvm/llvm-project/releases)，找一個喜歡的版本去下載,\n\n例如: [LLVM-20.1.0-rc1-win64.exe](https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.0-rc1/LLVM-20.1.0-rc1-win64.exe)\n\n選擇要安裝的目錄，假設你是裝在`D:\\LLVM`, 那麼最後得到的clangd的位置是\n\n( 建議可以直接勾選添加環境變數，否則你要自己找出clangd的位置添加到PATH\n\n```\n(gcm clangd.exe).Source\n# D:\\LLVM\\bin\\clangd.exe\n```\n\n\n#### [lua-language-server](https://github.com/luals/lua-language-server)\n\n```sh\n# 下載並且放到自己想要的目錄\nVERSION='3.15.0' # 查看版本: https://github.com/LuaLS/lua-language-server/releases\nuname -m # 查看arch\nARCH=linux-x64\nARCH=linux-arm64\nARCH=darwin-arm64\nwget https://github.com/LuaLS/lua-language-server/releases/download/$VERSION/lua-language-server-$VERSION-$ARCH.tar.gz\ndu -hs *.tar.gz\n# 3.7M lua-language-server-$VERSION-$ARCH.tar.gz\nmkdir -pv ~/lua-language-server/ # 依照個人喜號設定，我是選擇放到家目錄下\nmv -v lua-language-server-$VERSION-$ARCH.tar.gz ~/lua-language-server/\n\n# 解壓縮\ncd ~/lua-language-server/\ntar -xzvf lua-language-server-$VERSION-$ARCH.tar.gz # 於此目錄解壓縮，它不會在有多餘的目錄，直接會把檔案展開於此目錄\nrm -v lua-language-server-$VERSION-$ARCH.tar.gz\nls -l ~/lua-language-server/bin/lua-language-server # 此檔案為執行檔\n\n# 連立連結\nsudo ln -s ~/lua-language-server/bin/lua-language-server /usr/bin/\nls -l /usr/bin/lua-language-server\n\n# Warn: 在mac上, 除非禁用SIP不然建立連結時候會遇到: `Operation not permitted` 的錯誤, 所以可以考慮直接新增環境變數\necho 'export PATH=\"$PATH:$HOME/lua-language-server/bin\"' \u003e\u003e ~/.zshrc\n\n# 確認\nlua-language-server --version\n```\n\n#### [vscode-langservers-extracted](https://github.com/hrsh7th/vscode-langservers-extracted)\n\n```bash\n# npm view npm version           # 查看目前最新版本的npm版號\n# sudo npm install npm@latest -g # (可選) 直接更新到最後一版\n\nsudo npm i -g vscode-langservers-extracted\nnpm info vscode-langservers-extracted # 看套件資訊，當中也可以看到版號: vscode-langservers-extracted@4.10.0\n```\n\n```bash\nls -l $(which vscode-html-language-server)\n...\nls -l $(which vscode-eslint-language-server )\n# /usr/bin/vscode-html-language-server -\u003e ../lib/node_modules/vscode-langservers-extracted/bin/vscode-html-language-server\nls -l /usr/lib/node_modules/vscode-langservers-extracted/bin/\n# vscode-css-language-server\n# vscode-eslint-language-server\n# vscode-html-language-server\n# vscode-json-language-server\n# vscode-markdown-language-server\n```\n\n\n#### swift\n\n```sh\n# https://github.com/swiftlang/swiftly\n# 安裝swiftly\ncurl -O https://download.swift.org/swiftly/linux/swiftly-$(uname -m).tar.gz \u0026\u0026 \\\n  tar zxf swiftly-$(uname -m).tar.gz \u0026\u0026 \\\n  ./swiftly init --quiet-shell-followup \u0026\u0026 \\\n  . \"${SWIFTLY_HOME_DIR:-$HOME/.local/share/swiftly}/env.sh\" \u0026\u0026 \\\n  hash -r\n\n# 設定環境變數\ntee -a ~/.bashrc \u003c\u003cEOF\n# swift\nexport SWIFTLY_HOME_DIR=\\$HOME/.local/share/swiftly\nexport SWIFTLY_BIN_DIR=\\$HOME/.local/share/swiftly/bin\nexport SWIFTLY_TOOLCHAINS_DIR=\\$HOME/.local/share/swiftly/toolchains\nif [[ \":\\$PATH:\" != *\":\\$SWIFTLY_BIN_DIR:\"* ]]; then\n    # 如果當前的環境變數中沒有 \\$SWIFTLY_BIN_DIR 的目錄才會加入\n    export PATH=\"\\$SWIFTLY_BIN_DIR:\\$PATH\"\nfi\nEOF\n```\n\nCaution: Xcode/Command Line Tools (CLT) 已经包含了 {swift, swiftc, swift build}等工具，可以不需要再裝swiftly\nmac os\n\n```sh\ncurl -O https://download.swift.org/swiftly/darwin/swiftly.pkg \u0026\u0026 \\\n    installer -pkg swiftly.pkg -target CurrentUserHomeDirectory \u0026\u0026 \\\n    ~/.swiftly/bin/swiftly init --quiet-shell-followup \u0026\u0026 \\\n    . \"${SWIFTLY_HOME_DIR:-$HOME/.swiftly}/env.sh\" \u0026\u0026 \\\n    hash -r\necho \"source \\$HOME/.swiftly/env.sh\" \u003e\u003e ~/.zshrc\nrm -v swiftly.pkg\nswiftly --version\n# 1.1.0\n\n# 解除安裝:\nrm -rfv ~/.swiftly\n# 更新: ~/.zshrc\nwhich swift\nwhich swiftc\n# /usr/bin/swiftc  # 看到的就會是/usr/bin的位置, 而不是來至於swiftly\n```\n\n\n##### 取得codelldb (debug用)\nmkdir -v ~/codelldb\n\n\u003e https://github.com/vadimcn/codelldb/releases/\n\n```sh\nwget https://github.com/vadimcn/codelldb/releases/download/v1.11.5/codelldb-linux-x64.vsix    -O ~/codelldb/codelldb.zip # 52.34M\nwget https://github.com/vadimcn/codelldb/releases/download/v1.11.8/codelldb-darwin-arm64.vsix -O ~/codelldb/codelldb.zip\nunzip ~/codelldb/codelldb.zip -d ~/codelldb/\ndu -hs ~/codelldb/\n# 164M\nrm -v ~/codelldb/codelldb.zip\n```\n\n\u003e [!IMPORTANT]\n\u003e 在mac上不需要安裝codelldb, 使用xcode的工具就可以debug了\n\u003e\n\u003e `rm -rfv ~/codelldb/`\n\n#### rust\n\n```sh\n# 🟧 lsp\nrustup component add rust-analyzer\nrust-analyzer --version\n# rust-analyzer 1.92.0 (ded5c06c 2025-12-08)\n\n\n# 🟧 codelldb (為了debug)\nmkdir -pv ~/codelldb\n# https://github.com/vadimcn/codelldb/releases/download/\nwget https://github.com/vadimcn/codelldb/releases/download/v1.12.1/codelldb-darwin-arm64.vsix -O ~/codelldb/codelldb.zip\ncd ~/codelldb\nunzip ~/codelldb\n```\n\n\n## ios\n\n```bash\nmkdir -pv ~/.config/nvim/pack/ios/start\n```\n\n### ~~xcodebuild.nvim~~\n\n\u003e [!IMPORTANT] 可以不需要安裝, 自己手動打命令就好\n\n```sh\ngit clone https://github.com/wojciech-kulik/xcodebuild.nvim.git ~/.config/nvim/pack/ios/start/xcodebuild.nvim\ncd ~/.config/nvim/pack/ios/start/xcodebuild.nvim\nmake install\n# https://github.com/wojciech-kulik/xcodebuild.nvim/blob/e0d54db14ae87ac1cc205e31de5923565a33882c/Makefile#L34-L37\n# 成功後會看到類似以下的訊息👇\n# pipx install pymobiledevice3 --quiet\n#   installed package pymobiledevice3 7.0.5, installed using Python 3.14.2\n#   These apps are now globally available\n#     - pymobiledevice3\n# done! ✨ 🌟 ✨\n\n\n# https://github.com/wojciech-kulik/xcodebuild.nvim/wiki/Neovim-Configuration\nbrew install xcode-build-server\nxcode-build-server config -project \u003cxcodeproj\u003e -scheme \u003cscheme\u003e\n\n# :checkhealth xcodebuild\n# :help xcodebuild.remote-debugger\n```\n\n## motion\n\n```bash\nmkdir -pv ~/.config/nvim/pack/motion/start/\n```\n\n### [precognition](https://github.com/tris203/precognition.nvim.git)\n\n```bash\ngit clone https://github.com/tris203/precognition.nvim.git ~/.config/nvim/pack/motion/start/precognition.nvim\n```\n\n\u003e 插件特色: https://www.youtube.com/watch?v=7hQZhHve4HI\n\n\n### 🚮 ~~[hop.nvim](https://github.com/smoka7/hop.nvim)~~ 建議使用leap.nvim\n\n\n```bash\ngit clone https://github.com/smoka7/hop.nvim.git ~/.config/nvim/pack/motion/start/hop.nvim\n```\n\n### [leap.nvim](https://github.com/ggandor/leap.nvim.git)\n\n\n```sh\ngit clone https://github.com/ggandor/leap.nvim.git ~/.config/nvim/pack/motion/start/leap.nvim\n```\n\n熱鍵: `:help leap-mappings`\n\n- s: leap\n- S: leap from window\n\n\n## git\n\n```bash\nmkdir -pv ~/.config/nvim/pack/git/start/\n```\n\n### [gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim)\n\n```bash\ngit clone https://github.com/lewis6991/gitsigns.nvim.git ~/.config/nvim/pack/git/start/gitsigns.nvim\n```\n\n## tree\n\n```bash\nmkdir -pv ~/.config/nvim/pack/tree/start/\n```\n\n### [nvim-tree.lua](https://github.com/nvim-tree/nvim-tree.lua)\n\n```bash\ngit clone https://github.com/nvim-tree/nvim-tree.lua.git ~/.config/nvim/pack/tree/start/nvim-tree.lua\n```\n\n#### 解決亂碼: Nerd Fonts\n\n下載 [Nerd Fonts](https://www.nerdfonts.com/)\n\n```bash\nwget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/FiraCode.zip\nunzip FiraCode.zip -d ~/.fonts\ndu -hs ~/.fonts # 45M\n\n# 刷新字體緩存(非必要樣)\nfc-cache -fv\n\n# 查看是否安裝成功\nfc-list | grep \"FiraCode\"\n# ~/.fonts/FiraCodeNerdFontMono-Retina.ttf: FiraCode Nerd Font Mono,FiraCode Nerd Font Mono Ret:style=Retina,Regular\n\nrm *.zip\n```\n\n記得還要在終端機上換掉字型才可以\n\n以foot終機為例，要在foot.int做以下調整\n```yaml\n# foot.ini\nfont=FiraCodeNerdFontMono-Retina:size=14\n```\n\n\u003e 如果想讓圖標比較豐富可以再安裝[nvim-web-devicons](#nvim-web-devicons)\n\n---\n\n我建議在您的其它編輯器上也裝上FiraCodeNerdFont, 如果不想要至少讓備用字型是它，以防缺字的情況\n\n![FireCode_NerdFont](.img/FireCode_NerdFont.webp)\n\n\n## icon\n\n```bash\nmkdir -pv ~/.config/nvim/pack/icon/start/\n```\n\n### [nvim-web-devicons](https://github.com/nvim-tree/nvim-web-devicons)\n\n```bash\ngit clone https://github.com/nvim-tree/nvim-web-devicons.git ~/.config/nvim/pack/icon/start/nvim-web-devicons\n```\n\n## utils\n\n```sh\nmkdir -pv ~/.config/nvim/pack/utils/start/\n```\n\n### [plenary](https://github.com/nvim-lua/plenary.nvim)\n\n是一個語法糖套件，也有些插件也會使用到此插件，例如\n\n- [telescope.nvim](#telescope)\n- vgit.nvim\n- neogit\n- neo-tree.nvim\n\n---\n\n安裝:\n\n```sh\ngit clone https://github.com/nvim-lua/plenary.nvim ~/.config/nvim/pack/utils/start/plenary.nvim\n```\n\n#### USAGE\n\n它共有提供以下這些[模組](https://github.com/nvim-lua/plenary.nvim/blob/2d9b06177a975543726ce5c73fca176cedbffe9d/README.md?plain=1#L29-L39)\n\n- plenary.async\n- plenary.async_lib\n- plenary.job\n- plenary.path\n- plenary.scandir\n- plenary.context_manager\n- plenary.test_harness\n- plenary.filetype\n- plenary.strings\n\n\n##### Path\n\n```lua\nlocal Path=require('plenary.path')\nlocal path = Path:new(\"~/.config/nvim/init.lua\")\nprint(path:exists()) -- 文件是否存在\nprint(path:is_dir()) -- 是否為一個目錄\n```\n\n##### test_harness\n\n```lua\nlocal tests = require('plenary.test_harness')\ntests.describe('basic tests', function()\n  tests.it('should add numbers', function()\n    assert.are.same(2 + 2, 4)\n  end)\nend)\n```\n\n\n### nui.nvim\n\n[xcodebuild](https://github.com/wojciech-kulik/xcodebuild.nvim/wiki#2-install-plugin)需要用到此插件\n\n```sh\ngit clone https://github.com/MunifTanjim/nui.nvim.git ~/.config/nvim/pack/utils/start/nui.nvim\n```\n\n## search\n\n```sh\nmkdir -pv ~/.config/nvim/pack/search/start/\n```\n\n### [telescope](https://github.com/nvim-telescope/telescope.nvim)\n\n此插件需要用到[plenary](#plenary)\n\n```sh\ngit clone https://github.com/nvim-telescope/telescope.nvim ~/.config/nvim/pack/search/start/telescope.nvim\n```\n\n### [fzf-lua](https://github.com/ibhagwan/fzf-lua)\n\n```sh\ngit clone --depth 1 https://github.com/ibhagwan/fzf-lua ~/.config/nvim/pack/search/start/fzf-lua\n```\n\n```vim\n:lua require(\"fzf-lua\").files()\n:FzfLua files cwd=~/.config  \" 之後的可選項可以用tab叫出，但是當中的數值需要自己完成\n:FzfLua files     \" 找檔案\n:FzfLua git_files \" 找檔案(git提交的)\n:FzfLua lines     \" 找內文(僅限: 當前檔案)\n:FzfLua live_grep \" 找內文\n\n:lua FzfLua.live_grep({resume=true}) -- 透過resume可以接續上一次的搜尋, 所有的項目都可以加上resume\n:lua FzfLua.git_files({resume=true})\n:FzfLua git_files resume=true \" 也可以這樣來簡化\n\n:checkhealth fzf_lua\n```\n\n## theme\n\n```sh\nmkdir -pv ~/.config/nvim/pack/theme/start/\n```\n\n### [github-nvim-theme](https://github.com/projekt0n/github-nvim-theme)\n\n```sh\ngit clone https://github.com/projekt0n/github-nvim-theme.git ~/.config/nvim/pack/theme/start/github-nvim-theme\n```\n\n## sdk\n\n```sh\nmkdir -pv ~/.config/nvim/pack/sdk/start/\n```\n\n### [flutter-tools.nvim](https://github.com/nvim-flutter/flutter-tools.nvim)\n\n```\ngit clone https://github.com/nvim-flutter/flutter-tools.nvim ~/.config/nvim/pack/sdk/start/flutter-tools.nvim\n```\n\n\n## other\n\n```sh\nmkdir -pv ~/.config/nvim/pack/other/start/\n```\n\n### [indent-blankline.nvim](https://github.com/lukas-reineke/indent-blankline.nvim)\n\n```sh\ngit clone https://github.com/lukas-reineke/indent-blankline.nvim.git ~/.config/nvim/pack/other/start/indent-blankline.nvim\n```\n\n### [lualine.nvim](https://github.com/nvim-lualine/lualine.nvim)\n\n```sh\ngit clone https://github.com/nvim-lualine/lualine.nvim.git ~/.config/nvim/pack/other/start/lualine.nvim\n```\n\n\n### [render-markdown.nvim](https://github.com/MeanderingProgrammer/render-markdown.nvim)\n\n```sh\ngit clone https://github.com/MeanderingProgrammer/render-markdown.nvim.git ~/.config/nvim/pack/other/start/render-markdown.nvim\n```\n\n\n## schedule\n\n```sh\nmkdir -pv ~/.config/nvim/pack/schedule/start/\n```\n\n### ~~[atq.nvim](https://github.com/CarsonSlovoka/atq.git)~~ (使用`:NotifySend`  即可)\n\n```sh\ngit clone https://github.com/CarsonSlovoka/atq.git ~/.config/nvim/pack/schedule/start/atq.nvim\n```\n\n## edit\n\n```sh\nmkdir -pv ~/.config/nvim/pack/edit/start/\n```\n\n### [cmp.nvim](https://github.com/CarsonSlovoka/cmp.git)\n\n```sh\ngit clone https://github.com/CarsonSlovoka/cmp.git ~/.config/nvim/pack/edit/start/cmp.nvim\n```\n\n## debug\n\n```sh\nmkdir -pv ~/.config/nvim/pack/debug/start/\n```\n\n### [go-delve](https://github.com/go-delve/delve)\n\n類似於gdb, 不過在go語言上會推薦用go-delve會更好\n\n```sh\n# Warn: 如果go的版本太新, 而dlv的工具沒有跟上，就會沒辦法debug\ngo install github.com/go-delve/delve/cmd/dlv@latest\ndlv version\n# Version: 1.26.0\n# Build: $Id: 7fd7302eab8b16d715a94af1b5dfbffc2e1359bc\n```\n\n\n### [nvim-dap](https://github.com/mfussenegger/nvim-dap)\n\ndap(Debug Adapter Protocol), 要有這個才可以在neovim上debug (接著還要自己找每一個語言用的debug adapter)\n\n```sh\ngit clone https://github.com/mfussenegger/nvim-dap.git ~/.config/nvim/pack/debug/start/nvim-dap\n```\n\n#### [debug adapter](https://github.com/mfussenegger/nvim-dap/blob/master/doc/dap.txt)\n\n##### go [nvim-dap-go](https://github.com/leoluz/nvim-dap-go)\n\n```sh\ngit clone https://github.com/rcarriga/nvim-dap-ui.git ~/.config/nvim/pack/debug/start/nvim-dap-ui # require\"dapui\"\ngit clone https://github.com/nvim-neotest/nvim-nio.git ~/.config/nvim/pack/debug/start/nvim-nio # nvim-dap-ui需要用到的插件\ngit clone https://github.com/leoluz/nvim-dap-go.git ~/.config/nvim/pack/debug/start/nvim-dap-go\n```\n\n\n##### python [nvim-dap-python](https://github.com/mfussenegger/nvim-dap-python)\n\n```sh\n# pip install debugpy # nvim-dap-python 有需要依賴debugpy這個工具\ngit clone https://github.com/mfussenegger/nvim-dap-python.git ~/.config/nvim/pack/debug/start/nvim-dap-python\n```\n\n\n##### lua\n\n分為兩個版本:\n\n- one-small-step-for-vimkind: 這是attact在nvim下\n- local-lua-debugger-vscode: 這個以呼叫外部的lua執行檔，例如: lua5.1, lua5.2, ..., lua5.4\n\n###### [one-small-step-for-vimkind](https://github.com/jbyuki/one-small-step-for-vimkind)\n\n```sh\ngit clone https://github.com/jbyuki/one-small-step-for-vimkind.git ~/.config/nvim/pack/debug/start/one-small-step-for-vimkind\n```\n\n###### [local-lua-debugger-vscode](https://github.com/tomblind/local-lua-debugger-vscode)\n\n\u003e [!TIP]\n\u003e 這個項目不是nvim的插件，所以不需要安裝到pack下也可以\n\n```sh\ngit clone https://github.com/tomblind/local-lua-debugger-vscode.git ~/.local/share/nvim/lsp_servers/local-lua-debugger-vscode\ncd ~/.local/share/nvim/lsp_servers/local-lua-debugger-vscode\ngit checkout d51ee290 # version bump to 0.3.3 # Date: 2022-04-03 (日) 17:46:07 -0600\nnpm install\n# npm audit fix\nnpm audit fix --force # xml2js  \u003c0.5.0\nnpm audit fix --force # markdown-it  \u003c12.3.2\n```\n\n開啟\n\n[package.json](~/.local/share/nvim/lsp_servers/local-lua-debugger-vscode/package.json)\n\n```jsonc\n{\n  // ... 原有內容 ...\n  \"overrides\": { // 👈 新增這一段\n    \"xml2js\": \"^0.6.2\"\n  }\n}\n```\n\n```sh\n\nnpm audit fix --force\n# found 0 vulnerabilities # 如果看到結尾是這樣就可以install了\nnpm install\nnpm run bundle # 為 package.json 中的 scripts 的內容之一\n```\n\n做完之後相關的[ts](~/.local/share/nvim/lsp_servers/local-lua-debugger-vscode/extension/debugAdapter.ts)檔案，就會生成出[js](~/.local/share/nvim/lsp_servers/local-lua-debugger-vscode/extension/debugAdapter.js)的版本\n\n\n## view\n\n```sh\nmkdir -pv ~/.config/nvim/pack/view/start/\n```\n\n### [csvview.nvim](https://github.com/hat0uma/csvview.nvim)\n\n\n```sh\ngit clone https://github.com/hat0uma/csvview.nvim.git ~/.config/nvim/pack/view/start/csvview.nvim\n```\n\n\n## sql\n\n\n```sh\nmkdir -pv ~/.config/nvim/pack/sql/start/\n```\n\n\n### sqls\n\n```sh\ngit clone https://github.com/nanotee/sqls.nvim.git ~/.config/nvim/pack/sql/start/sqls.nvim\n```\n\n#### [command](https://github.com/nanotee/sqls.nvim/blob/d1bc5421ef3e8edc5101e37edbb7de6639207a09/doc/sqls-nvim.txt#L14-L87)\n\n```vim\nSqlsSwitchConnection \" 切換連線\nSqlsExecuteQuery \" 執行sql文件或者只執行選取的內容\nSqlsExecuteQueryVertical \" 同Query只是輸出的樣式不同\nSqlsShowTables \" 顯示當前連線中的所有tables\n\" ...\n\nSqlsInsertConnecions \" 此為我新增的命令, 新增連線\n```\n\n## tools\n\n```sh\nmkdir -pv ~/.config/nvim/pack/tools/start/\n```\n\n### [image.nvim](https://github.com/3rd/image.nvim)\n\n```sh\ngit clone https://github.com/3rd/image.nvim.git ~/.config/nvim/pack/tools/start/image.nvim\n```\n\n### [pantran.nvim](https://github.com/potamides/pantran.nvim)\n\n\n```sh\ngit clone https://github.com/potamides/pantran.nvim.git ~/.config/nvim/pack/tools/start/pantran.nvim\n```\n\n### [ccc.nvim](https://github.com/uga-rosa/ccc.nvim)\n\n```\ngit clone https://github.com/uga-rosa/ccc.nvim.git ~/.config/nvim/pack/tools/start/ccc.nvim\n```\n\n- `:CccConvert` 在選取的色彩文字上使用, 可以做轉換\n\n    ```\n    #ff00ff\n    ```\n\n- `:CccPick` 如果在使用此command的文字上符合色彩的定義(rgb, #ffffff, hsl)則預設會用該色彩去呈現\n    - i 切換不同的色彩模式\n    - j, k 往下, 往上移動\n    - l 該數值加1\n    - h 減1\n    - a 新增alpha通道\n    - 0, 1, ... 9: 設定該數值所佔的比率\n\n### [live-preview.nvim](https://github.com/brianhuster/live-preview.nvim)\n\n\u003cspan\u003e\n    \u003cimg src=\"https://img.shields.io/github/stars/brianhuster/live-preview.nvim\" alt=\"\"/\u003e\n    \u003cimg src=\"https://img.shields.io/github/last-commit/brianhuster/live-preview.nvim\" alt=\"\"/\u003e\n    \u003cimg src=\"https://img.shields.io/github/commit-activity/y/brianhuster/live-preview.nvim\" alt=\"\"/\u003e\n\u003c/span\u003e\n\n\n```sh\ngit clone --depth 1 https://github.com/brianhuster/live-preview.nvim ~/.config/nvim/pack/tools/start/live-preview.nvim\n```\n\n```vim\n:LivePreview pick \" 在目前的工作目錄中，挑選出可以執行的項目\n:LivePreview start \" 預設用當前buffer的檔案 (附檔名需要一致，不是看filetype)\n\" NOTE: 一次只能啟動一個項目，不能start之後又再去start其它的，要先close才行\n\" :LivePreview start ~/my.svg \" ❌ 不支持路徑的expand\n:LivePreview start redir/my.svg \" ⚠️ 可以指定文件路徑，但是路徑只適用相對路徑\n\n:LivePreview close \" 結束\n```\n\n\u003e [!WARNING] 如果執行失敗，就算close後再start也沒用，需要整個重啟\n\n\n# [neovide](https://github.com/neovide/neovide)\n\n提供一個neovim的GUI, [特色](https://neovide.dev/features.html)\n\n## Installation\n\n### linux\n\nUbuntu/Debian\n```sh\nsudo apt install -y curl \\\n    gnupg ca-certificates git \\\n    gcc-multilib g++-multilib cmake libssl-dev pkg-config \\\n    libfreetype6-dev libasound2-dev libexpat1-dev libxcb-composite0-dev \\\n    libbz2-dev libsndio-dev freeglut3-dev libxmu-dev libxi-dev libfontconfig1-dev \\\n    libxcursor-dev\n\n# 安裝rust(如果已經裝了，可以略過)來取得cargo\ncurl --proto '=https' --tlsv1.2 -sSf \"https://sh.rustup.rs\" | sh -v\n\n# fetch and build\ncargo install --git https://github.com/neovide/neovide\n# (如果你用ssh, 可以暫時先將~/.gitconfig相關的url有關於https://github.com先註解掉裝完再恢復)\n\ncargo install --list\nls -l $(which neovide)\n# ~/.cargo/bin/neovide\nneovide -V\n# neovide 0.14.0\n```\n\n### windows\n\n你可以到release的[頁面](https://github.com/neovide/neovide/releases)下載, 例如[0.14.0 neovide.msi](https://github.com/neovide/neovide/releases/download/0.14.0/neovide.msi)，接著點選後安裝完畢，就會得到`neovide.exe`\n\n或者透過[scoop](https://neovide.dev/installation.html#scoop)來安裝\n\n```bash\n# 如果是要透過scoop，要先確保有extras\nscoop bucket list\n# main\n# extras\n\n# 如果沒有請先添加 extras\nscoop bucket add extras\n\n# 接著就可以安裝\nscoop install neovide\n\n# 確認執行檔位置\n(gcm neovide).Source\n# %userprofile%\\scoop\\shims\\neovide.exe\n\n# neovide -V # 如果用scoop來裝，這個可能會看不到任何內容，要改用scoop list來查看\nscoop list neovide\n# Name    Version Source Updated             Info\n# ----    ------- ------ -------             ----\n# neovide 0.14.0  extras 2025-02-12 17:57:53\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarsonslovoka%2Fnvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarsonslovoka%2Fnvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarsonslovoka%2Fnvim/lists"}