LoginSignup
25
25

More than 5 years have passed since last update.

エディタで半角スペースとタブを相互に変換

Posted at

エディタで開いているファイルに含まれる半角スペースをタブに変換します。
範囲指定すれば変換対象を一部に限定することができます。
区切り文字にタブしか受け付けない太古の syslog.conf などを編集するときに重宝します。

Space → Tab Tab → Space
Vim :%!unexpand -a :%!expand
Emacs M-x tabify M-x untabify

(*) unexpand, expand はコマンドなのでシェルからでも実行できます。

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