LoginSignup
5
5

More than 5 years have passed since last update.

AtomとかでVimModeを使ってみるメモ

Last updated at Posted at 2015-03-02

AtomでVimMode

Vim
VimMode
コマンドモード(insert or visual の時に ESC)
インサートモード (コマンドモードから a,i,s,cc)
ヴィジュアルモード(コマンドモードから v)

モード遷移

インサートモード i
行頭からインサートモード I
カーソルの右からインサートモード a
行末からインサートモード A

移動

一文字右へ space, l

・移動 h,j,k,l
行頭へ 0
行末へ $

ファイル先頭へ gg
ファイル末尾へ G

・次の単語へ w
・前の単語へ b

・大きく移動 {, }

操作、コピペ

一文字 削除 x

d d - 1行削除切り取り(カット)
d $ - カーソル位置から行末まで削除

d w - カーソル位置から空白を含む単語の末尾まで削除
d e - カーソル位置から空白を含まない単語の末尾まで削除

・ビジュアルモード v
1行コピー yy
・ペースト p
・一行切り取り dd
・二行切り取り dj, dk

macでvim

ターミナルでvi(vim)と書くと開く。

$ vi

閉じる時は :q
ESCでコマンドが入れれるようになる。
iでインサートモード。

ファイルを開く時は

vi 既存のファイル名

vi test.txt

vi 新規ファイル名で新規ファイル作成。

vi testfile

で、testfileが生成。

:wで保存。
:wqで保存して終了。
:q!で保存せずに終了。

モード

a か i でインサートモードに移動。
ESCでコマンドモードに。
インサートとappend。

i その場でインサートモード
a 次の文字入力場所でインサートモード

コマンドモードで、
大文字 A で行末に移動。

移動
h 左移動
j 下移動
k 上移動
l 右移動

0 行頭
$ 行末
A 行末に移動してインサートモード

ctrl+f 1ページ進む
ctrl+b 1ページ戻る

:数字 行番号に移動(例 :10 10行目に移動)

gg 文頭に移動
G 文書末に移動

5
5
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
5
5