6
6

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.

cartonでライブラリ管理してるperlプロジェクトでvimにパスを通す

Last updated at Posted at 2013-02-14

https://github.com/walf443/perl-local-lib-path.vim
を使えば以下のことをする必要はなくなります。


path固定だったりすると、プロジェクト内の他の人が使えなかったりリポジトリ内にコミットできなかったりして悲しいので、pathを切り離してみました

.local.perl.vimrc
function! l:set_path_directory()
    let target_dir = expand("%:p:h")
    let project_root = substitute(target_dir, "lib/.*", "", "")
    let libdir = project_root . "/lib"
    let localperl5dir = project_root . "/local/lib/perl5"
    let localperl5archdir = project_root . "/local/lib/perl5/darwin-2level"
    let perlbrewdir = $HOME . "/perl5/lib/perl5"
    let perlbrewarchdir = $HOME . "/perl5/lib/perl5/darwin-2level"
    execute "setlocal path =" . libdir
    execute "setlocal path +=" . localperl5dir
    execute "setlocal path +=" . localperl5archdir
    execute "setlocal path +=" . perlbrewdir
    execute "setlocal path +=" . perlbrewarchdir
endfunction

call l:set_path_directory()

perlbrewのパスとか、OSX限定になっているので、その辺もいい感じにまとまっているcarton.vimつくりたいけど、今はちょっと時間ないのですが、とりあえずまぁこんな感じで便利になります。

6
6
3

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?