On Mon, Feb 26, 2007 at 12:32:19PM EST, Tim Chase wrote:
> >>- To change (once) to the dir of the current file
> >>
> >>    :cd %:p:h
> >
[..]
> 
> If you're impatient, full details can be found at
> 
>       :help filename-modifiers
> 
> >2. How to use vim's help efficiently 
> 
> There are several attacks one can use to get Vim's help to spit 
> out helpful stuff.  In this case, I found it by typing
> 
>       :help :p
> 
> and then hitting control+D instead of <enter> which causes Vim to 
> show auto-completion for what you've typed so far.  This brought 
> back 6 columns of 11 rows each of possibilities, 

Yes, I did that :-)

> but most of them 
> were clearly not what I was looking for (there was something 
> after the ":p").  The one that looked most promising was "::p" 
> which, though somewhat strange-looking, turned out to be what I 
> wanted.

Missed it .. and if I had seen it .. I probabably would have looked it
up just out of curiosity.

:-)

> Another attack might be to use
> 
>       :helpgrep :p
>       :copen

.. and to think that I have this on my own little personal cheat sheet
and never really used it up to now.  The nice thing is that you can then
use "/" to skim the output.  Sometimes the difficulty is not so much
learning the rich vim feature-set but integrating it to your day-to-day
habits.  Thank you so much for the reminder .. I feel guilty now so that
should help me do some :helpgrepping regularly from now on.

> This opens a quickfix window (":help quickfix-window") of all the 
> hits in the help where ":p" appears in the help.  While I get 
> just shy of 400 hits back, there are some obviously good leads 
> and some obviously bogus leads among the chaff.  One of the nice 
> things is that you can use regexps in your search, so you can 
> change it to
> 
>       :helpgrep :p\>

.. even cooler than my uneducated method.

> to winnow that list down to 47 according to the help I have here. 
>    A number of the top hits come back in cmdline.txt, all fairly 
> clustered together, so any of them would be a good starting 
> candidate.  Just navigate to a prospective candidate and hit 
> <enter> to jump to that piece of the helpfile.
> 
> These two methods are my usual attack into finding something in 
> the vim-help.  If these don't get you to where you want to go, 
> it's often a matter of finding the right search keyword/pattern. 

added to my cheat sheet .. which I try to write more as a
"task-oriented" document than a mere collection of commands.

I find the exercise useful since as, I believe, A. Einstein once
remarked .. if you can't explain it .. you don't fully understand it ..
or something to that effect.

>  I've been stumped by this before (just this month) and the 
> mailing list is quite friendly about answering questions as well 
> as guiding you in with keywords.  In my case it was finding what 
> turned out to be ":help i_CTRL-G_u" and Yakov was able to dig it 
> up in the help using the phrase "break undo" which I hadn't come 
> up with.
> 
> So dig a bit with the above tools, and if you hit a wall, drop a 
> line on the list with what you want and what you've tried, and 
> I'm sure you'll get all sorts of good answers back.

I often think that the intrinsic quality of vim@vim.org adds
considerable value to an already great piece of software.  What I
particularly like about it is that you can come up with a naive or even
dumb question and within the hour, somebody will come up with the answer
to the question you should have asked.

I am subscribed to about 25 mailing lists at this point and the only one
that comes close is the TeX/LaTeX list.  Interestingly enough there is
very little "trolling" on vim@vim.org .. as if the quality of the posts
acted as a deterrent.

Thanks
cga


Reply via email to