Create doc comments in vim using pre-typed text
Okay, I currently have a set up in vim so that when I type "<leader>ns" it takes any given word and turns it into a sub "sub word(){}". I also have it when I type "<leader>nc" it creates a doc comment section that is "blank". I was wondering if someone could help me out with combining the two so that when I typed <leader>ns it would create the doc comments with the word already in the Subroutine: line and create the new sub routine aswell. I'm trying to understand what I have (downloaded from the internet) and only doing so so. If someone could help explain how the vim function works, I might be able to go from there but I can't really find any relevant info online for it.
Code:
" Put cursor over word and hit ,ns to create new Sub Thank you RzITex |
Moved: This thread is more suitable in <PROGRAMMING> and has been moved accordingly to help your thread/question get the exposure it deserves.
|
Not sure if this will help
http://www.eandem.co.uk/mrw/vim/usr_doc/index.html http://researchweb.iiit.ac.in/~smr/d...m_tutorial.pdf I can find my way around vi but have never used functions, mappings etc |
thanks Wim. I was only able to get to the researchweb pdf because of firewall. I'm definitely going to keep that pdf close by. Had a lot of great info (and some spelling errors). It didn't really help that much in relation to an insertion function like I'm trying to do. I just asked on stackoverflow to see if I could get eyes on the topic (will relay answer here if it works).
I'm pretty much the same as you. I can navigate and use vi/vim (though I'm barely touching vim's power). |
All times are GMT -5. The time now is 06:25 PM. |