0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【小ネタ】Vim 上からよく開くファイル(init.vimなど)をさっと開けるコマンドを設定する

Posted at

きっかけ

私はメモを特定のテキストファイルに書いて管理しています。もちろん編集は Vim(正確には Neovim)で行っています。

業務でコードを修正しているとき、メモを書きたいなーと思うことがあります。
そんなとき、コマンド一発でメモ用のテキストファイルが表示できると嬉しいということに気づきました。

方法

init.vim に以下のような設定を行いました。path の部分は自環境に合わせて修正が必要です。
ついでに init.vim 自体もぱっと開けるようにしておきました。

init.vim
" :Memo コマンドでメモファイルをひらく
command Memo edit path
" :EditInitVim コマンドで init.vim をひらく
command EditInitVim edit path

効果

こりゃあ便利。なぜ今まで気づかなかったんだろうと思いました。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?