LoginSignup
14
16

More than 5 years have passed since last update.

vimのファイル文字コード変更と開き直す方法

Last updated at Posted at 2016-03-25

この辺が全然覚えられないのでまとめ

現在の設定を確認

・vimの文字コードを確認
:set enc?
・ファイルの文字コードを確認
:set fenc?

ファイルの文字コード変更

:set fileencoding=文字コード
:set fenc=文字コード (上のコマンドの短縮形。)
:set fenc=euc-jp (指定エンコーディングに変更。)

ファイルフォーマット(改行コード)変更

:set fileformat=ファイルフォーマットの種類
:set ff=ファイルフォーマットの種類 (上のコマンドの短縮形。)
:set ff=dos OR mac OR unix (改行を指定形式に変更。)

ファイルの文字コード読みなおし

:e ++enc=指定したいエンコーディング
:e ++enc=euc-jp (指定エンコーディングで開き直す。)

ファイルフォーマット(改行コード)読みなおし

:e ++ff=指定したいファイルのフォーマット
:e ++ff=dos OR mac OR unix (指定形式で開き直す。)

参考というかほぼ引用

14
16
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
14
16