-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build OTP tags and add to vim tags path #34
base: master
Are you sure you want to change the base?
Conversation
@hcs42 What do you think of this functionality? I have a very similar thing on my .vimrc at the moment, only that I'm extracting the path with |
folder, it will build a tags file called `otptags`. The next thing you need, is | ||
to make vim aware of this. That's where the next function comes in place: | ||
|
||
call GetOtpTagsPath() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we use echo
instead of call
? call
won't print anything.
endfunction | ||
|
||
function! AsyncBuildOtpTags() | ||
let cmd = '(OTPPATH=`' . s:otppath_cmd . '` && ' . s:exec_script . ' -i $OTPPATH -o $OTPPATH/otptags)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vim cannot necessarily write "$OTPPATH/otptags". For me erl -noinput -eval 'io:format("~ts", [code:lib_dir()]), init:stop().'
returns /usr/lib/erlang/lib
, which causes AsyncBuildOtpTags
to silently fail.
Three suggestions:
- Some error handling to report this situation.
- Maybe use the ":terminal" command instead of
system
+&
? (It was added in Vim 8.1.) - Maybe make it configurable to put the tags file somewhere else.
I posted my ideas in the review. I also generate a separate tagfile for OTP tags, so I understand the motivation. On the other hand, I generate my tags from bash (calling |
This is very useful in case you like having tags to OTP libs at hand, in many projects, and building tags for each project with the otp tags seems redundant. Like this, you can have one global otptags for all your projects.