0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Vimを覚える【VIMATE 中級】

Posted at

はじめに

使えるだけでかっこいい「Vim」を覚えていきます!

覚え方

コマンド 機能 覚え方
f F t T 左右検索移動 find 見つけて移動
till 直前まで移動
/ ? とごっちゃにならないように
; , f tの繰り返し 暗記するんだ!
m 現在の位置をマーク mark
maなどと入れると位置を記憶
:aでその場所に戻れる
D 現在の位置から行末まで削除 d$ と同じ意味
dd 一行削除、とごっちゃにならないように
J gJ 下の行と結合 join
g ありだと空白なしの結合。
. コマンド繰り返し shell. (現在位置)的な。「今のやつ」的な
U 変更の取り消し(行全体) Undo
保存前の変更を取り消す
:qa :qa! vimの終了 quit all
s S 文字の置き換えインサート substitute 置換する
ge gE 直前の単語の末尾へ移動 応用
% 対応するかっこにアクセス
(カーソルがかっこ上にないと無効)
暗記する!
ciw caw cis cas cip cap 置き換え change [inner/all] [words/sentenses/paragraphs]
iaの差は、空白を含むかどうか
ci" ci' ca" ca' cib cab ciB caB cit ciT "" '' () {} <tag>内を置き換え 上に同じ。bは block tは tag
diw di" ... 削除バージョン d delete
yiw yi" ... コピーバージョン y yank
g~iw g~i" 小文字・大文字切り替え g~ トグル(暗記する!
i inner
w word

おわりに

初級編はすぐいけたけど、中級編は難しいですね。
wbが対で、egeが対で・・・などなど、ぶっちゃけアレな組み合わせも多く、頭がこんがらがる。
実務で使い始めると早いのかなあ・・・
今のところは、直感的ではないなという印象が強いです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?