update at 2025-11-04 19:58:03

This commit is contained in:
douboer
2025-11-04 19:58:03 +08:00
parent fe4daf0469
commit 931c99a4d8
7 changed files with 301 additions and 45 deletions

View File

@@ -1,8 +1,10 @@
# Obsidian Vim Input Method Switch Plugin
# Vim Input Method Switch Plugin
English | [中文](./README.md)
An input method auto-switching plugin designed for Obsidian's Vim mode.
An input method auto-switching plugin designed for Vim and Obsidian's Vim mode, including:
- **Obsidian Plugin**: For Obsidian editor's Vim mode
- **Vim Plugin**: For native Vim/NeoVim editors
## Features
@@ -53,6 +55,8 @@ Download [fcitx-remote.exe](https://github.com/yuanotes/obsidian-vim-im-switch-p
### Installation
#### Obsidian Plugin Installation
1. Download plugin to Obsidian plugins directory:
```bash
cd /path/to/your/vault/.obsidian/plugins/
@@ -67,6 +71,33 @@ Download [fcitx-remote.exe](https://github.com/yuanotes/obsidian-vim-im-switch-p
- Set English input method (default: `com.apple.keylayout.ABC`)
- Set Chinese input method (default: auto-detect)
#### Vim Plugin Installation
1. Copy plugin file to Vim config directory:
```bash
mkdir -p ~/.vim/plugin
cp fcitx-osx.vim ~/.vim/plugin/
```
2. Restart Vim, the plugin will load automatically
3. Configure input methods (optional):
Add to `.vimrc`:
```vim
" English input method ID (default)
let g:fcitx_english_im = 'com.apple.keylayout.ABC'
" Chinese input method ID (optional, auto-detect by default)
" let g:fcitx_chinese_im = 'com.tencent.inputmethod.wetype.pinyin'
```
#### One-Click Deploy (Recommended)
Deploy both plugins with a single command:
```bash
./deploy.sh
```
## Usage
### Basic Usage Scenarios
@@ -169,14 +200,25 @@ npm run build
```
### Deploy
Deploy both Obsidian and Vim plugins with one command:
```bash
./deploy.sh
```
#### Debug
### Debug
#### Obsidian Plugin
The plugin outputs key logs in the console:
- `Loading plugin...` - Plugin loaded
- `ESC → English` - ESC switches to English
- `→ Chinese` - Switches to Chinese
- `Error...` - Error messages
#### Vim Plugin
View messages in Vim:
```vim
:messages
```
- `→ Chinese` - Switch to Chinese
- `Error...` - Error messages