xcodeにvimの翼を挿す

6036 ワード

From : http://blog.cnrainbird.com/index.php/2012/12/11/gei_xcode_cha_sharing_vim同前ちぃbang/
 
eclipseのクラスメートでxcodeを使い始める時、いつも聞きます。上下二行の交換位置は何のショートカットを使っていますか?はい、上下二行の交換位置は確かに4.xのxcodeにショートカットがあります。optionn+comand+[上に移動します。optionn+comand+]は下に移動します。しかし、この{}の間を行ったり来たりするのは確かに研究できませんでした。そこで、vimにこのようなショートカットがあると思います。google:xcode+vimにxvimという神器があります。以下はこの環境で三、四日間プログラミングした感じです。
1.vim党として、このプラグインを使って確かに楽しんでいます。特にh、j、k、lこれらのキーは上下に移動します。
2.{}ジャンプして解決しました。大量if、elseの時に役に立ちますよ。
3.どの行に直接ジャンプできますか?yy、ddはもちろんです。また上下二行の交換位置もそんなに多くキーを押す必要はなく、直接ddpで解決します。
4.vimにものを入力するのに慣れました。そして:w保存します。xcodeがコンパイルするたびにコードが自動的に保存されます。ソ、次第に適応しています。runは、マンドル+bに相当しますよ。
唯一不愉快な:
多くの行を選択して、command+xカットする時崩壊して、この問題は2回現れたことがあって、まだコードを見ていないでBugを解決して、でもこのような情況に出会ってvimのショートカットを使ってよくなりました。
また、現時点ではサポートされていません。20,30 dというコマンドは、空いています。コードをよく見て追加してください。
 
最後に設置方法を言います。
1.インストールパッケージをダウンロード
2.ダブルインストール
3.xcodeを再起動する
 
そしてhaveです ふうん
 
Feature List
We try to keep this up to date,but sometimes implement can get aead of documentation.If a command is missing,just try it in XVirst-it might already be there!
If you've tried a command it really is missing、feel free to create an issue and a friendly contributor will pick it up eventualy.
Motion
b,B,f,F,gg,G,h,j,k,l,w,W,t,T,0,$
Command semicolon are supported.Togle inclusive/exclusive by v is supported.
マルク
File-local marks are supported.Global marks are not yet supported.
The''mark(last insertion point)is supported.gi(insert mode at last insertion point)is supported.
Sroll
C-d,C-f,C-e,C-u,C-b,C-y,zz,zb,zt
ジャンプ
C-o,C-i,gd
If you want to open the file under the cursor you can use'gd'instead of'gf'in XVim environment.
インセンス
a,A,i,I,o,O
Yank、put and change
d,dd,D,y,y,Y,c,cc,C,r,s,x,X
Line join
J
Shift block
Normal mode:>>,<<
Visual mode:>、<
Case change operations
Normal mode:~,gu,gU,g~
Visual mode:u,U,~gu,gU
ユニド
u,C-r
ビジュアル
v,V
Ctrl-v is not supported now.(v,V in visual mode to toggale or escape from visual mode is supported)
Visual block mode is currently not supported.
Window maipulation
Input Operation
C-w n
Add new assitant editor
C-w q
Delete one assitant editor
C-w
Add new assitant editor horizontally
C-w v
Add new assitant editor vertically
C-w h,j,k,l
Move focus between editors
Search and Replace
//と、g*,g菺,:s,n,N
Regex search is supported using the ICU regex format.
Substition does not work as Vim does.When you input command following
:%s/xxxx/yyyy/
XVim does replace the first occurence of xxxx IN THE FILE.If you want to replace all the occurence of xxxxxyy in the file you can specify
:%s/xxxx/yyyy/g
Currenently replace first occurence of xxxxx with yy each line is not available
Insert mode commands
C-y,C-e
Print status commands
C-g
Text Object
ib,iB,i(,i),i{,i},i',i',i',i',i w,iW ab,aB,a(,a),a',a',a',a',a',a',a',a',a',aw,aW
レコード
q,@
Dot command
The dot command('.')is supported.
Exコマース
Command Note
:w[rite]
 
:wq
 
:q[uit]
 
:s[bstitute]
 
:セット
See Options for supported variables
:map
Maps globally acros XVim,in all modes
:nmap
Maps normal mode
:vmap
Maps visual mode
:イメージP
Maps insert mode
:omap
Maps operator pending mode
XVim original commands
Command Note
:run
Invoke Xcode's'run'mand
:メーク
Invoke Xcode's'build'mand
:xhelp
Show quick help for current insertion point
:xccmd
Invoke arbitrary command in Xcode's actions in its menu.Takes one argment as its action to invoke.Acts here are available.
:nissue
Invoke「jump to next issue」.「:ni」does the samse.
:pissue
Invoke「jump to previous issue」.「:pi」does the same.
:ncounter part
Invoke「jump to next counterpart」.「nc」does the same.
:pcounterpart
Invoke“jump to previous counter part”.“:pc”does the same.
Options
Command Note
[no]ignorecase
 
[ノ]wrap
 
[ノ]wrapscan
 
[no]errorbells
 
[no]incsearch
 
[no]gdefault
 
[no]smart case
 
アグネスネス
See below
タイムアウト
The time in miliseconds that is waited for mapped key sequence to complettee(default 1000)
laststatus
0 or 1:status line is hidden、2:status line is displayed(default 2)
[no]pasteboard
Whether yank/delete/pulse uses the standard clipboard
pasteboard
アグネスネス
A limited subset of Vim options is implemened.
Option Effect
r
Show vertical scrollbar
b
Show horizontal scrollbar
The changes only take effect on startup、meaning this option is only effective if used from within your.xvimrc.
Key mapping
XVim supports five map command:map,nmap,vmap,map,map,map,map.A map command can change one or more keystrocs.
Note:The default timeout value for multi-key mapping completion is 1 seconds(1000 miliseconds).You can change it using'timeoutlen'option.
Examples:
nmap n e
imap ' <Esc>
nmap u 5jiInsert some text<Esc>
nmap ,w :w<cr>
.xvimrc
At startup XVim look s for~/.xvimrc.Each line in this file is executed as and This allows you to configure mappins and options.
Example:
set ignorecase
set wrapscan
set guioptions=r
nmap n e
Known problems
See X Vim issue page.