Yii Framework Forum: Yii API docs in vim help file format - Yii Framework Forum

Jump to content

  • (3 Pages)
  • +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

Yii API docs in vim help file format Vim users, fight for your rights now! Rate Topic: ***** 4 Votes

Poll: Yii API reference for vim (71 member(s) have cast votes)

Would Yii API manual in vim help file format be useful for you?

  1. Yes, i use vim a lot to develop yii apps (41 votes [57.75%])

    Percentage of vote: 57.75%

  2. No. Even though i use vim, i see no point in these help files (7 votes [9.86%])

    Percentage of vote: 9.86%

  3. No, i don't use vim (19 votes [26.76%])

    Percentage of vote: 26.76%

  4. What is vim? (4 votes [5.63%])

    Percentage of vote: 5.63%

Vote Guests cannot vote

#1 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 22 November 2010 - 09:14 AM

In an attempt to move a step forward with my vim+screen based IDE i spent some time to learn new vim features (you never know them all, right?). Together with some plugins like project and minibufexplorer i soon got pretty close to what i expect from a modern IDE. What i was still missing, though, was quick access to the class reference.

Having a look a the yiic commands that create yii's online HTML pages, it was quite easy to fork them into a VimApiCommand that created a useful API manual in vim help file format.

To me this is already useful but still misses some fine tuning when it comes e.g. to formatting of the code examples.

I'll release the files soon, but would like to know first, how many would use them at all.

So if you're a vim user - show yourself!! :)

I've attached a screenshot that shows how it looks like in action.

UPDATE:
This project is hosted on github now

https://github.com/m...rtl/yii-api-vim

You find the latest version in the tags section of the github repo.

Attached File(s)


4

#2 User is offline   imehesz 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 704
  • Joined: 13-June 09
  • Location:Jacksonville, FL

Posted 22 November 2010 - 11:19 AM

MIKE!

God bless you man, I've been trying to come up with something smart for VIM for ages (like CTags and stuff).

I use VIM every day and night ;) One of my favorite plugins is NERDTree! Check it out!

http://www.vim.org/s...?script_id=1658

--iM

ps: yes, I tried many others (Zend, Aptana, NetBeans, DreamWeaver!, Eclipse+PDT)
It’s done, the great act of creation.
The maker rests. The wheel’s in motion.
-- Imre Madách

check out Yii Theme Factory at http://yii.themefactory.net
0

#3 User is offline   Nemoden 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 68
  • Joined: 14-March 09
  • Location:Vancouver, Canada

Posted 22 November 2010 - 11:42 AM

I'm trying to migrate from NetBeans to VIM now.
Just saw the yiiframework tweet leading to here.
Mike, I'd love to take a look at the files. if you could make a screencast exposes all the power of Yii+VIM, that'd be just great and highly appreciated by those who is just starting with VIM (at least I'd be very thankful for sure :) ).

Nice shot BTW. THUMBS UP.
No brain - no pain.
My twitter :D
0

#4 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 22 November 2010 - 01:03 PM

Heh, thanks for the feedback. Ok, guys gimme some time. I'll try to fix the formatting for the code examples first.

@imehesz:
Didn't try NERDtree yet. It's only recently that i started looking for a replacement for vimcommander which i had used for years. Would you say it's better than project? I like project as it has some nice features like filters per directory or running a vim script each time you load a file into the buffer (you can also configure that per directory).

@Nemoden:
If you're new to vim take your time. Look up the keystrokes for the things you need most often and get used to them first. I'm not sure if i could give you much help. Things depend much on your preferences. And there are already lots of screencasts out there. Learning vim takes time, but it's worth every second!

Shame on me, but even though i've been using vim for 14 years now, for a long time i've only used the basic commands to move around, split a window and substitute text per regex and do some more simple text editing . With these features you can already be amazingly fast if you can use all your fingers.

Now i find out, that with some additional new key strokes you can get even faster and do more things inside vim. For example don't miss all the other window commands (they all start with <ctrl>-w). Now that i got used to opening, moving, maximizing and closing windows it's even more versatile. Understanding buffers makes another huge difference in your everyday work.

vim has really useful features. plenty of them. ;)
0

#5 User is offline   thyseus 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 300
  • Joined: 18-April 09
  • Location:Leipzig, Germany

Posted 22 November 2010 - 02:41 PM

hell yeah! i am an vim-addict for some years now, too. I'm using the minibufexplorer, NerdTREE and ctags/taglist. A vim-optimized help file for Yii's Classes would be amazing. Can't wait for your release!, so keep it going

edit: and yes. i also learn new things almost every day!
0

#6 User is offline   imehesz 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 704
  • Joined: 13-June 09
  • Location:Jacksonville, FL

Posted 22 November 2010 - 04:55 PM

View PostMike, on 22 November 2010 - 01:03 PM, said:

@imehesz:
Didn't try NERDtree yet. It's only recently that i started looking for a replacement for vimcommander which i had used for years. Would you say it's better than project? I like project as it has some nice features like filters per directory or running a vim script each time you load a file into the buffer (you can also configure that per directory).


Mike,

I've been using NERDTree for a while, I haven't tried the others. I works for me, but, I also learn something new every day :)

--i
It’s done, the great act of creation.
The maker rests. The wheel’s in motion.
-- Imre Madách

check out Yii Theme Factory at http://yii.themefactory.net
0

#7 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 22 November 2010 - 05:44 PM

Here's a first version.

Please bear with me, this is the first vim help file i ever did. I tried to use the common help file notation (:help notation) but had to "misuse" some markup items. All in all i hope the layout is a good compromise between readability and not wasting too much precious screen space.


[ instructions where moved to top post ]


This post has been edited by Mike: 20 January 2011 - 07:04 AM

0

#8 User is offline   imehesz 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 704
  • Joined: 13-June 09
  • Location:Jacksonville, FL

Posted 22 November 2010 - 11:34 PM

hello Mike,

I got it to work! yaaaay

I know there is a way to pull up help(?) by standing on a word and pushing some kind of key-combination. So let's say I move my cursor to CHtml::activeDropDownList - press the buttons and the help would come up.

Do you know what that combination is?

thx,
--iM
It’s done, the great act of creation.
The maker rests. The wheel’s in motion.
-- Imre Madách

check out Yii Theme Factory at http://yii.themefactory.net
0

#9 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 23 November 2010 - 03:04 AM

Geat to hear that it works for you! :) What about the layout? Any glitches?

Try <shift>+k (See :help K) for help.

I don't remember why but somewhere i read, you might have to add this:

autocmd BufNewFile,Bufread *.php set keywordprg="help"

But there's one problem, though: I didn't really think about this feature, because most of the time i don't have text like "CGridView::columns" anywhere. That's why the keywords now use a '.' (dot) as seperator (to save another char). But you made me think. We could have lots of CHtml in the views. So maybe we should change the tag format to "class::property"? What do you think?
0

#10 User is offline   imehesz 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 704
  • Joined: 13-June 09
  • Location:Jacksonville, FL

Posted 23 November 2010 - 08:46 AM

View PostMike, on 23 November 2010 - 03:04 AM, said:

But there's one problem, though: I didn't really think about this feature, because most of the time i don't have text like "CGridView::columns" anywhere. That's why the keywords now use a '.' (dot) as seperator (to save another char). But you made me think. We could have lots of CHtml in the views. So maybe we should change the tag format to "class::property"? What do you think?


What I run into mostly with CHtml is that "oh, I forgot the parameters OR the order of the parameters, something like that" - so I need something quick. I think this would be very helpful...

The layout seemed fine, but I only played with it a little bit!

--iM
It’s done, the great act of creation.
The maker rests. The wheel’s in motion.
-- Imre Madách

check out Yii Theme Factory at http://yii.themefactory.net
0

#11 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 23 November 2010 - 01:16 PM

Ok, here you go.

Tags are now in this format: CClassname::method

Don't hesitate if you have more feedback. I wonder wether it makes sense to create an extension for this. But before that it should be tested in real life for some time.
0

#12 User is offline   imehesz 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 704
  • Joined: 13-June 09
  • Location:Jacksonville, FL

Posted 23 November 2010 - 01:28 PM

you mean a VIM extension? - I think so

--iM

ps: thx again for this tool!
It’s done, the great act of creation.
The maker rests. The wheel’s in motion.
-- Imre Madách

check out Yii Theme Factory at http://yii.themefactory.net
0

#13 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 24 November 2010 - 03:55 AM

I was thinking about a Yii extension - but you're right, maybe better put this on the vim site.

What do you think about inherited properties/methods? I've left them out to keep the pages small. So you have to go to the base class (using the inheritance "breadcrumb" on top). Maybe i should still add them as a list of linked tags on top or on bottom?
0

#14 User is offline   imehesz 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 704
  • Joined: 13-June 09
  • Location:Jacksonville, FL

Posted 24 November 2010 - 10:46 AM

View PostMike, on 24 November 2010 - 03:55 AM, said:

I was thinking about a Yii extension - but you're right, maybe better put this on the vim site.

What do you think about inherited properties/methods? I've left them out to keep the pages small. So you have to go to the base class (using the inheritance "breadcrumb" on top). Maybe i should still add them as a list of linked tags on top or on bottom?


the speed is pretty good right now - don't you think the additional tags would slow it down?

(actually I'm using a netbook most of the time, so my processor is not the fastest :/ )

--iM
It’s done, the great act of creation.
The maker rests. The wheel’s in motion.
-- Imre Madách

check out Yii Theme Factory at http://yii.themefactory.net
0

#15 User is offline   H Samuels 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 22-May 10

Posted 05 December 2010 - 11:03 AM

This is great! I'm about to give it a try and see if I can get it to work.
0

#16 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 05 December 2010 - 01:51 PM

Yes, please let me know of any problems. I've been using it for some time now and it works pretty good.

Still wonder, where's the best place to release them. If someone's interested: I can also share the build yiic command that i used to create the files.
0

#17 User is offline   balrok 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 61
  • Joined: 13-June 10

Posted 10 December 2010 - 02:05 PM

Realy great what you did, thank you I give it a try.
0

#18 User is offline   Penny 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 19-December 10

Posted 19 December 2010 - 02:46 AM

Hi Mike,

Thanks a lot for the development, it looks great and I am trying to make it happen on my server and to my development team. Thanks!

NB - I registered the account here just for letting you know there are vim fans behind your work!

Cheers,
Penny
0

#19 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 19 December 2010 - 04:50 AM

View PostPenny, on 19 December 2010 - 02:46 AM, said:

NB - I registered the account here just for letting you know there are vim fans behind your work!


Thanks for your feedback - good to know that someone finds it useful, too :)

For those interested: You can also download the command i've written to create the docs. It's a CConsoleCommand for the yiic build script of Yii. See top post.
0

#20 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 20 January 2011 - 07:05 AM

I've created an updated version for Yii 1.1.6 and updated the top post accordingly.
1

Share this topic:


  • (3 Pages)
  • +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users