From 33b7f04e37d1fbf3956758fd774290ca748a085a Mon Sep 17 00:00:00 2001 From: Clsan Date: Fri, 12 Jun 2026 15:28:25 +0900 Subject: [PATCH] feat: add Neovim + LazyVim + avante.nvim setup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a dedicated nvim_setup.sh module (sourced by setup.sh, alongside the existing classic Vim section) that installs Neovim and its deps, bootstraps LazyVim, and drops an avante.nvim plugin spec. - nvim_setup.sh: brew neovim/ripgrep/fd/lazygit + JetBrains Mono Nerd Font; clone LazyVim starter only if ~/.config/nvim is empty; place avante.lua only if it doesn't already exist (preserves locally-customized provider config). Uses repo file on git checkout, curl from raw GitHub in download mode. - nvim/lua/plugins/avante.lua: generic spec with provider intentionally unset (personal-setup repo โ€” no gateway baked in). - setup.sh: source nvim_setup.sh after the Vim section. - common.sh: include nvim_setup in cleanup_downloads list. - README.md: add nvim_setup.sh to both download one-liners. Co-Authored-By: Claude Opus 4.8 (1M context) --- README.md | 2 ++ common.sh | 2 +- nvim/lua/plugins/avante.lua | 52 ++++++++++++++++++++++++++++++++ nvim_setup.sh | 59 +++++++++++++++++++++++++++++++++++++ setup.sh | 5 ++++ 5 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 nvim/lua/plugins/avante.lua create mode 100644 nvim_setup.sh diff --git a/README.md b/README.md index fc0c7d7..e079bcd 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ curl -fsSL https://raw.githubusercontent.com/Clsan/setup/master/common.sh -o common.sh && \ curl -fsSL https://raw.githubusercontent.com/Clsan/setup/master/system_setup.sh -o system_setup.sh && \ curl -fsSL https://raw.githubusercontent.com/Clsan/setup/master/interactive_setup.sh -o interactive_setup.sh && \ +curl -fsSL https://raw.githubusercontent.com/Clsan/setup/master/nvim_setup.sh -o nvim_setup.sh && \ curl -fsSL https://raw.githubusercontent.com/Clsan/setup/master/setup.sh -o setup.sh && \ bash setup.sh ``` @@ -16,6 +17,7 @@ bash setup.sh curl -fsSL https://raw.githubusercontent.com/Clsan/setup/master/common.sh -o common.sh && \ curl -fsSL https://raw.githubusercontent.com/Clsan/setup/master/system_setup.sh -o system_setup.sh && \ curl -fsSL https://raw.githubusercontent.com/Clsan/setup/master/interactive_setup.sh -o interactive_setup.sh && \ +curl -fsSL https://raw.githubusercontent.com/Clsan/setup/master/nvim_setup.sh -o nvim_setup.sh && \ curl -fsSL https://raw.githubusercontent.com/Clsan/setup/master/setup.sh -o setup.sh && \ curl -fsSL https://raw.githubusercontent.com/Clsan/setup/master/work_setup.sh -o work_setup.sh && \ bash work_setup.sh diff --git a/common.sh b/common.sh index 67ba170..16ea256 100644 --- a/common.sh +++ b/common.sh @@ -77,7 +77,7 @@ cleanup_downloads() { return 0 fi echo "๐Ÿงน Cleaning up downloaded scripts..." - rm -f "$dir"/{common,system_setup,interactive_setup,setup,work_setup}.sh + rm -f "$dir"/{common,system_setup,interactive_setup,setup,work_setup,nvim_setup}.sh } # ============================================ diff --git a/nvim/lua/plugins/avante.lua b/nvim/lua/plugins/avante.lua new file mode 100644 index 0000000..5057755 --- /dev/null +++ b/nvim/lua/plugins/avante.lua @@ -0,0 +1,52 @@ +-- avante.nvim โ€” Cursor ์Šคํƒ€์ผ AI ์–ด์‹œ์Šคํ„ดํŠธ (LazyVim plugin override) +-- ํ”„๋กœ๋ฐ”์ด๋”/API ํ‚ค๋Š” ์˜๋„์ ์œผ๋กœ ๋ฏธ์„ค์ • (๊ฐœ์ธ ์…‹์—… ๊ธฐ๋ณธ๊ฐ’). +-- ์‚ฌ์šฉํ•˜๋ ค๋ฉด opts.provider ์™€ providers ๋ฅผ ์ฑ„์šด ๋’ค nvim ์žฌ์‹œ์ž‘. ์˜ˆ์‹œ: +-- opts = { +-- provider = "claude", +-- providers = { +-- claude = { +-- endpoint = "https://api.anthropic.com", +-- model = "claude-sonnet-4-6", +-- api_key_name = "ANTHROPIC_API_KEY", -- ํ•ด๋‹น ํ‚ค๊ฐ€ ๋‹ด๊ธด env ์ด๋ฆ„ +-- }, +-- }, +-- } +-- ์‚ฌ์šฉ๋ฒ•: :AvanteAsk ๋กœ ๋Œ€ํ™”, :AvanteToggle ๋กœ ํŒจ๋„ ํ† ๊ธ€ +return { + "yetone/avante.nvim", + event = "VeryLazy", + version = false, -- ํ•ญ์ƒ ์ตœ์‹  (avante ๋Š” ์ž์ฃผ ๋ฐ”๋€œ) + -- prebuilt ๋ฐ”์ด๋„ˆ๋ฆฌ ๋‹ค์šด๋กœ๋“œ. ์†Œ์Šค ๋นŒ๋“œ๋ฅผ ์›ํ•˜๋ฉด: + -- build = "make BUILD_FROM_SOURCE=true" (rust ํ•„์š”) + build = "make", + opts = { + -- provider = "claude", -- ์‚ฌ์šฉ ์‹œ ์œ„ ์˜ˆ์‹œ์ฒ˜๋Ÿผ ์ฑ„์šฐ๊ธฐ + }, + dependencies = { + "nvim-treesitter/nvim-treesitter", + "nvim-lua/plenary.nvim", + "MunifTanjim/nui.nvim", + -- ์„ ํƒ ์˜์กด์„ฑ + "nvim-mini/mini.pick", -- file selector + "stevearc/dressing.nvim", + "folke/snacks.nvim", + { + -- ํด๋ฆฝ๋ณด๋“œ ์ด๋ฏธ์ง€ ๋ถ™์—ฌ๋„ฃ๊ธฐ + "HakonHarnes/img-clip.nvim", + event = "VeryLazy", + opts = { + default = { + embed_image_as_base64 = false, + prompt_for_file_name = false, + drag_and_drop = { insert_mode = true }, + }, + }, + }, + { + -- ๋งˆํฌ๋‹ค์šด/์‘๋‹ต ๋ Œ๋”๋ง + "MeanderingProgrammer/render-markdown.nvim", + opts = { file_types = { "markdown", "Avante" } }, + ft = { "markdown", "Avante" }, + }, + }, +} diff --git a/nvim_setup.sh b/nvim_setup.sh new file mode 100644 index 0000000..61e03a6 --- /dev/null +++ b/nvim_setup.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# ============================================ +# Neovim + LazyVim + avante.nvim (๋น„๋Œ€๋ฉด) +# - setup.sh ์—์„œ source ๋กœ ํ˜ธ์ถœ (common.sh ํ—ฌํผ๊ฐ€ ์ด๋ฏธ ์Šค์ฝ”ํ”„์— ์žˆ์Œ) +# - ๊ธฐ์กด .vimrc(ํด๋ž˜์‹ Vim) ์„ธํŒ…๊ณผ๋Š” ๋ณ„๊ฐœ๋กœ ๊ณต์กด +# ============================================ + +NVIM_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +echo "๐Ÿง  Setting up Neovim + LazyVim..." + +# ============================================ +# Dependencies +# - C ์ปดํŒŒ์ผ๋Ÿฌ/make ๋Š” Xcode CLT ๊ฐ€ ์ด๋ฏธ ์ œ๊ณต (treesitter ์ปดํŒŒ์ผ์šฉ) +# ============================================ +brew_install neovim +brew_install ripgrep # Telescope live-grep +brew_install fd # Telescope find files +brew_install lazygit # LazyVim git UI ํ†ตํ•ฉ +brew_install_cask font-jetbrains-mono-nerd-font # ์•„์ด์ฝ˜ ๊ธ€๋ฆฌํ”„ + +# ============================================ +# LazyVim ๋ถ€ํŠธ์ŠคํŠธ๋žฉ +# - ~/.config/nvim ์ด ๋น„์–ด์žˆ์„ ๋•Œ๋งŒ starter ํด๋ก  (๊ธฐ์กด ์„ค์ • ๋ณด์กด) +# ============================================ +NVIM_CONFIG="$HOME/.config/nvim" +if [[ ! -e "$NVIM_CONFIG/init.lua" ]]; then + echo " โ†ณ Cloning LazyVim starter..." + mkdir -p "$(dirname "$NVIM_CONFIG")" + git clone --depth 1 https://github.com/LazyVim/starter "$NVIM_CONFIG" + rm -rf "$NVIM_CONFIG/.git" +else + echo " โ†ณ ~/.config/nvim ์ด๋ฏธ ์กด์žฌ โ€” starter ํด๋ก  ์Šคํ‚ต" +fi + +# ============================================ +# avante.nvim plugin spec ๋ฐฐ์น˜ +# - git ์ฒดํฌ์•„์›ƒ์ด๋ฉด ์ €์žฅ์†Œ ํŒŒ์ผ ์‚ฌ์šฉ, ๋‹ค์šด๋กœ๋“œ ๋ชจ๋“œ๋ฉด raw GitHub ์—์„œ curl +# (PR CI ์—์„œ ์•„์ง master ์— ์—†๋Š” ํŒŒ์ผ์„ 404 ๋กœ ๋ฐ›๋Š” ๋ฌธ์ œ ๋ฐฉ์ง€) +# ============================================ +AVANTE_DEST="$NVIM_CONFIG/lua/plugins/avante.lua" +AVANTE_SRC="$NVIM_SCRIPT_DIR/nvim/lua/plugins/avante.lua" +if [[ -f "$AVANTE_DEST" ]]; then + # ๋กœ์ปฌ์—์„œ ํ”„๋กœ๋ฐ”์ด๋”(์˜ˆ: ์‚ฌ๋‚ด ๊ฒŒ์ดํŠธ์›จ์ด)๋ฅผ ์ง์ ‘ ์„ค์ •ํ•ด ๋‘˜ ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ ๋ฎ์–ด์“ฐ์ง€ ์•Š์Œ + echo " โ†ณ avante.lua ์ด๋ฏธ ์กด์žฌ โ€” ๋ฐฐ์น˜ ์Šคํ‚ต (๋กœ์ปฌ ์„ค์ • ๋ณด์กด)" +else + mkdir -p "$(dirname "$AVANTE_DEST")" + if [[ -f "$AVANTE_SRC" ]]; then + cp "$AVANTE_SRC" "$AVANTE_DEST" + echo " โ†ณ avante.lua ๋ฐฐ์น˜ (๋กœ์ปฌ)" + else + curl -fsSL https://raw.githubusercontent.com/Clsan/setup/master/nvim/lua/plugins/avante.lua -o "$AVANTE_DEST" + echo " โ†ณ avante.lua ๋ฐฐ์น˜ (curl)" + fi +fi + +echo "โœ… Neovim + LazyVim + avante ready" +echo " โ†ณ ์ฒซ nvim ์‹คํ–‰ ์‹œ LazyVim ์ด ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ์ž๋™ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค (avante ๋นŒ๋“œ ํฌํ•จ)" +echo " โ†ณ avante ํ”„๋กœ๋ฐ”์ด๋”/API ํ‚ค๋Š” ๋ฏธ์„ค์ • โ€” $AVANTE_DEST ์ฐธ๊ณ " diff --git a/setup.sh b/setup.sh index 8b2d710..2e4f177 100755 --- a/setup.sh +++ b/setup.sh @@ -75,6 +75,11 @@ curl -fsSL https://raw.githubusercontent.com/Clsan/setup/master/.vimrc -o ~/.vim curl -fsSL https://raw.githubusercontent.com/morhetz/gruvbox/master/colors/gruvbox.vim -o ~/.vim/colors/gruvbox.vim echo "โœ… Vim ready" +# ============================================ +# Neovim + LazyVim + avante.nvim +# ============================================ +source "$SCRIPT_DIR/nvim_setup.sh" + # ============================================ # mise (Runtime Version Manager) # ============================================