1
1

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.

Insert Final Newline とセットでセットして欲しい! Render Final Newline の話

Posted at

前提条件:ファイルの末尾に改行を入れる

  • Linux を使うならテキストファイルの末尾に改行を入れる方が便利
    • gitwc -lcat など、それが前提になっているものが多い
  • VSCode で Insert Final Newline にチェックを入れると保存時に改行を入れてくれる
    • prettier や eslint で設定してるから大丈夫だよっていう人も居るかも

image.png

When enabled, insert a final new line at the end of the file when saving it.

VSCode のオプション、Editor: Render Final Newline とは

ファイルの最後の行番号を表示するかどうか選べる。

image.png

Render last line number when the file ends with a newline.

Render Final Newline が off の場合

off にすると wc -l で表示したときのファイルの行数と最終行の行番号が一致するので嬉しい。

image.png

Render Final Newline が on の場合

最後の空行に行番号が表示されているとなんとなく違和感がある。

image.png

Render Final Newline が dimmed の場合

行番号が薄い色で表示されるようになる。中間の選択肢。

image.png

おわりに

Render Final Newline について説明している記事があんまりなかったので書いてみました。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?