runtimepathに置いた特定の名前のファイルを検索する
作者: 小見 拓
—
最終変更
2012年01月08日 12時14分
runtimepathに置いた特定の名前のファイルを検索する
- 例えば、pluginディレクトリに置いたsendmail.pyファイルを検索する場合、次のようにして検索できる。
:for f in split(globpath(&runtimepath, "plugin/sendmail.py"), '\n') :echo f :endfor "# sendmail.pyファイルのパスが出力される "# (例) "# => /home/taku/.vim/plugin/sendmail.py
- ワイルドカードを使用してパターンにマッチするファイルを検索
:for f in split(globpath(&runtimepath, "after/ftplugin/*_snippets.vim"), '\n') " 見つかったファイルに対して、ここで何らかの処理を行う :echo f :endfor "# after/ftpluginディレクトリ以下の、パターンにあうファイルのパスが出力される "# => /home/taku/.vim/after/ftplugin/java_snippets.vim "# => /home/taku/.vim/after/ftplugin/javascript_snippets.vim "# => /home/taku/.vim/after/ftplugin/latex_snippets.vim "# => ....
Recent Comments
ありがとうございます!
http://nanasi.jp/articles/howto/editing/visualcursor-endtoend.html · 8 years ago
知りませんでした。有難うございました。
http://nanasi.jp/articles/howto/file/open-with-format.html · 9 years ago
<c-f>1ページ分、下にスクロールする<c-b>1ページ分、上にスクロールする
どっちも逆です。
http://nanasi.jp/articles/howto/user-manual/user-manual-motion.html · 10 years ago
set 使用時に : で閉じるのを忘れて右往左往してました。
http://nanasi.jp/articles/howto/file/modeline.html · 11 years ago
やっぱり日本語の方が早いっす。
http://nanasi.jp/articles/howto/help/help_ja.html · 12 years ago