feat: add im-select.nvim with terminal-compatible config#20
Merged
Conversation
Add im-select.nvim plugin to automatically switch input method to English when leaving insert mode and restore previous input method when entering insert mode. Changes: - Add nvim/lua/plugins/im-select.lua configuration - Install im-select via Homebrew in nvim_setup.sh - Deploy im-select.lua to ~/.config/nvim/lua/plugins/ during setup - Support all input methods (Korean, Japanese, Chinese, etc.) The plugin automatically detects and handles any non-English input method, switching to English (com.apple.keylayout.ABC) in normal mode and restoring the previous input method in insert mode. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
im-select is not available in the main Homebrew repository. It requires tapping daipeihust/tap first. Changes: - Replace direct brew_install with explicit tap + trust + install sequence - Add idempotency check with command -v im-select - Handle trust requirement for third-party tap Verified idempotent: running the script multiple times shows "im-select already installed" without attempting reinstallation. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Extract the tap + trust + install pattern into a reusable helper function in common.sh, similar to brew_install and brew_install_cask. Changes: - Add brew_tap_and_install(tap, formula) helper to common.sh - Simplify nvim_setup.sh to use one-line brew_tap_and_install call - Maintain idempotency with command -v check inside the helper This makes it easier to install formulae from third-party taps in the future. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Simplify im-select events: remove FocusGained/VimEnter (caused timing issues with snacks terminal double-Esc), remove set_previous_events - Add TermLeave to set_default_events so IM switches to ABC when leaving any terminal buffer (raw :terminal or snacks terminal) - Add idempotent keymaps.lua setup in nvim_setup.sh: appends double-Esc → <C-\><C-N> keymap for raw :terminal buffers via append_line_if_missing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
common.sh: addbrew_tap_and_installhelper for tapped formulaenvim_setup.sh:im-selectviadaipeihust/tapim-select.luaplugin spec (same copy-if-missing pattern as avante)keymaps.luaviaappend_line_if_missingnvim/lua/plugins/im-select.lua: new plugin specInsertLeave,CmdlineLeave,TermLeaveTermLeaveensures IM switches correctly when exiting both snacks terminal and raw:terminalbuffersset_previous_events = {}prevents Korean IME from being restored inside terminal buffers (which caused Escape to be intercepted by the IME)Test plan
nvim_setup.shon a fresh machine — im-select installed and configurednvim_setup.sh— no duplicates, all steps skipped idempotently<leader>ft), double-Esc → Normal mode, IM → ABC:vsplit | terminal), double-Esc → Normal mode, IM → ABC🤖 Generated with Claude Code