Are there any alternatives to ctags and cscope with Objective-c support. This does pertain to cocoa development, so inevitably it seems I will be using Xcode (and probably should). I was just wondering what are my Vim options.
Maybe there is some type of plugin system like eclim, but for xcode?
EDIT
So it seems that other than updating ctags to support objective-c, I'm out of luck. Does anyone know if cscope is the same?
a long time after this question, "playing" with vim, I wanted ObjC support, especially with taglist plugin. I found that question, then digged a bit, and here is a not so dirty solution:
You can easily install it on OSX via homebrew:
$ brew install ctags --HEAD
Note that when using ctags, .m
is treated as Matlab and .h
is treated as C++. To override, use:
$ ctags --langmap=ObjectiveC:.m.h
Then I added something like this to my .vimrc
for taglist support:
let tlist_objc_settings = 'ObjectiveC;P:protocols;i:interfaces;types(...)'
add any type interests you from that list:
ctags --list-kinds=all
ObjectiveC
i class interface
I class implementation
p Protocol
m Object's method
c Class' method
v Global variable
F Object field
f A function
p A property
t A type alias
s A type structure
e An enumeration
M A preprocessor macro
I hope that will help someone!
Universal-ctags(https://ctags.io) can capture properties of Objective-C.
[jet@localhost objectivec_property.h.d]$ cat input.h
@interface Person : NSObject {
@public
NSString *m_name;
@private
int m_age;
}
@property(copy) NSString *personName;
@property(readonly) int personAge;
-(id)initWithAge:(int)age;
@end
[jet@localhost objectivec_property.h.d]$ ../../../ctags -x -o - input.h
Person interface 2 input.h @interface Person : NSObject {
initWithAge: method 12 input.h -(id)initWithAge:(int)age;
m_age field 6 input.h int m_age;
m_name field 4 input.h NSString *m_name;
personAge property 10 input.h @property(readonly) int personAge;
personName property 9 input.h @property(copy) NSString *personName;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With