検索について

概要

私が使用している検索テクニックをまとめました。

基本

*

検索で使うのは、ほぼこれだけです。

手打ちは面倒です。

検索ワードはファイル内に存在するので移動したほうが早いことが多いです。

単語を調べたいけれど、単語までが遠い場合

\<aaa\>

は、打つの面倒なので

/aaa

で検索してから、*を使用します。

単語を打つのが面倒でクリックするのも面倒な場合

.

で代用します。

a...b

みたいな感じです。
先頭と末尾だけで合致すれば、ほぼ見つけられます。

単語の途中を調べる場合

/<c-r><c-w>

でカーソルしたをとり、編集します。

検索して変更したい場合

cgn<c-r>"

消して復元して編集します。

検索して先頭の文字を変更したい場合

5s

先頭はこちらも使えます。

検索したやつの後ろに移動したい場合

//e+1

//e+1をもう一回編集する場合

/<c-n>

検索したやつをGrepする場合

:vim // %
:vim // *

もう一回検索する

//

さいごに

以上です。

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account