2
4

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 5 years have passed since last update.

gVimでちょっとしたメモを保存するときのコマンドを作った

Last updated at Posted at 2018-12-04

背景

WindowsのメインエディタでgVimを利用しているが、ちょっとしたメモを書いたときにgVimのエディタ上で保存場所のディレクトリを辿るのが少しめんどくさい。
できればエクスプローラとかのクイックアクセスとか使いたい。

解決

gvimrcに下記を追加する

function SaveasFunc() "名前を付けて保存のコマンド{
  browse confirm saveas
  cd %:h
endfunction
command Saveas call SaveasFunc()
"}

使い方

  1. gVimを開く
  2. メモを書く
  3. :Saveasコマンドを実行する
  4. GUIのファイラーが開くのでフォルダ選択してファイル名書いて保存!
  5. gVimのカレントディレクトリも保存したディレクトリになるので同じところに別のメモもすぐ作れる!

あとがき

こういうちょっとしたメモを書きたいときみんなどうしているんだろう。
まずエクスプローラでファイル作ってからgVimで開いているんだろうか。

2
4
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
2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?