Reputation: 457
Nowadays I'm working with Objective Perl using ::
with ->
as well.
However, Vim doesn't recognise a tag which is pre/appended with ::
.
Is there a way to solve this?
ex) I can jump when it is Foo->foo() but can't do once BAR::bar().
Upvotes: 0
Views: 136
Reputation: 11
Update: Since I don't have a code sample that demonstrates the failure, I'm trying to find things that are helpful. As I stated below, basic Vim isn't going to have that functionality for custom marking, but plugins to Vim will get you further. Fritz Mehner's perl-support.vim plugin has been around for years and is quite good:
http://www.vim.org/scripts/script.php?script_id=556
There is a new plugin by Valloric found here that has a lot of language support (but this is one that I haven't personally tried):
https://valloric.github.io/YouCompleteMe/
Original post:
Hmm, usually when I am coding something more complicated in Perl than a command line script or a handful of lines in a file, I use emacs as my editor, not vim, because emacs has hooks to a debugger and quite frankly has better support for complicated syntax. There's a native perl support in emacs, but the better one is in cperl-mode in emacs. That's going to have a lot of bells and whistles in it and it's really what you want.
I do use Vim often as a basic editor, but I think that coding in Objective Perl gets you to that place where it's not going to be as robust as you'd like.
To get to cperl-mode you can add the following lines in your .emacs file:
;;; cperl-mode is preferred to perl-mode
;;; "Brevity is the soul of wit"
(defalias 'perl-mode 'cperl-mode)
You can see more about it here at the EmacsWiki:
http://www.emacswiki.org/emacs/CPerlMode
(What I'm trying to say here is that getting support in Vim for :: and -> syntax is going to likely require custom marking and that isn't in Vim basic. Instead, there are some packages like Fritz Mehner's perl-support.vim that might be helpful, but really, Vim isn't the best editor at the point where you jump to complicated syntax with classes (packages). You have to add a plugin or you have to find another solution.)
Upvotes: 1