keysender.vim


Ⅰ. 插件描述

Keysender is Vim plugin to send an application key events.

Ⅱ. 基本信息

创建日期:  2015-11-23
使用用户:  1
Github星:  7
插件作者:  shikato

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'shikato/keysender-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'shikato/keysender-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'shikato/keysender-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/shikato/keysender.vim

Ⅳ. 文档说明

# keysender.vim
Keysender is Vim plugin to send an application key events.

demo1

demo2

You can use this software only in Mac.
Because this software uses JXA.

Download

ex. NeoBundle

.vimrc

NeoBundle 'shikato/keysender.vim'

Usage

CommandAction
:KeysenderKeystroke ...somethingThe command sends an application keystroke.
:KeysenderKeyCode ...somethingThe command sends an application key code.
:KeysenderSetTargetAppName somethingThe command sets target application name. (Default: Chrome)
:KeysenderSetVimAppName somethingThe command sets Vim application name. (Default: MacVim)

Example

Basic

If you want to send Chrome [a]

:KeysenderKeystroke a

Plural & Change target application

If you want to send Safari [abc], [d], [ef]

:KeysenderSetTargetAppName Safari
:KeysenderKeystroke abc d ef

Attribute Key

If you want to send Chrome [a + ctrl], [bc + command + option], [e + shift]

:KeysenderKeystroke a,c bc,d,a e,s
KeyDescription
cctrl
dcommand
aoption
sshift

Key code

Keysender can send key code of Mac.

:KeysenderTypeKeyCode 2,c,a

You can know the key code by this command.

grep 'kVK_.*=' /System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/Events.h

Other documents

Qiita

License

MIT

添加新评论