Re: How do I make the current working directory follow the active document in Gvim?

2007-02-28 Thread Bram Moolenaar

Tony Mechelynck wrote:
 Bram Moolenaar wrote:
  Tony Mechelynck wrote:
  
  here are a few examples; some of them use a fictional subject:
  
  Nice overview.  Let me add this to the user manual.
  
 
 In the paragraph about :help patternTab with 'wildmenu' on, I let
 myself be carried away: Up and Down don't apply to the wildmenu
 for helptags.

I wanted to keep it simple, thus I left out the whole part of the
'wildmenu'.

-- 
hundred-and-one symptoms of being an internet addict:
223. You set up a web-cam as your home's security system.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: How do I make the current working directory follow the active document in Gvim?

2007-02-27 Thread Bram Moolenaar

Tony Mechelynck wrote:

 here are a few examples; some of them use a fictional subject:

Nice overview.  Let me add this to the user manual.

-- 
panic(Fod fight!);
-- In the kernel source aha1542.c, after detecting a bad segment list

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: How do I make the current working directory follow the active document in Gvim?

2007-02-27 Thread A.J.Mechelynck

Bram Moolenaar wrote:

Tony Mechelynck wrote:


here are a few examples; some of them use a fictional subject:


Nice overview.  Let me add this to the user manual.



In the paragraph about :help patternTab with 'wildmenu' on, I let myself be 
carried away: Up and Down don't apply to the wildmenu for helptags.


Best regards,
Tony.
--
How wonderful opera would be if there were no singers.


Re: How do I make the current working directory follow the active document in Gvim?

2007-02-26 Thread cga2000
On Sun, Feb 25, 2007 at 07:57:39PM EST, A.J.Mechelynck wrote:
[..]
 
 - To change (once) to the dir of the current file
 
   :cd %:p:h

Nice. 

But I'm not going to remember it until I understand it.

I scoured the :help files but couldn't find and explanation of the
syntax. 

:p is short for :print and :h is help.

So there's two things I don't know:

1. The symbolic (?) language you are using - the same that's used when
   scripting vim, I would imagine.

2. How to use vim's help efficiently 

:-)

Thanks,

cga


RE: How do I make the current working directory follow the active document in Gvim?

2007-02-26 Thread Sibin P. Thomas

-Original Message-
From: cga2000 [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 26, 2007 10:28 PM
To: vim@vim.org
Subject: Re: How do I make the current working directory follow the active
document in Gvim?

On Sun, Feb 25, 2007 at 07:57:39PM EST, A.J.Mechelynck wrote:
[..]
 
 - To change (once) to the dir of the current file
 
   :cd %:p:h

Nice. 

But I'm not going to remember it until I understand it.

I scoured the :help files but couldn't find and explanation of the
syntax. 

:p is short for :print and :h is help.

So there's two things I don't know:

1. The symbolic (?) language you are using - the same that's used when
   scripting vim, I would imagine.

2. How to use vim's help efficiently 

:-)

Thanks,

Cga



2. How to use vim's help efficiently -- try :help topic.
If that doesn't give you what you want try - :helpgrep topic (followed by
:cwin if needed).

Try :helpgrep %:p:h  you will find the meaning of %:p:h


Regards,
Sibin


DISCLAIMER:
This message (including attachment if any) is confidential and may be 
privileged. Before opening attachments please check them for viruses and 
defects. MindTree Consulting Limited (MindTree) will not be responsible for any 
viruses or defects or any forwarded attachments emanating either from within 
MindTree or outside. If you have received this message by mistake please notify 
the sender by return  e-mail and delete this message from your system. Any 
unauthorized use or dissemination of this message in whole or in part is 
strictly prohibited.  Please note that e-mails are susceptible to change and 
MindTree shall not be liable for any improper, untimely or incomplete 
transmission.


Re: How do I make the current working directory follow the active document in Gvim?

2007-02-26 Thread Tim Chase

- To change (once) to the dir of the current file

:cd %:p:h


Nice. 


But I'm not going to remember it until I understand it.

I scoured the :help files but couldn't find and explanation of the
syntax. 


:p is short for :print and :h is help.

So there's two things I don't know:

1. The symbolic (?) language you are using - the same that's used when
   scripting vim, I would imagine.


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, 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.


Another attack might be to use

:helpgrep :p
:copen

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\

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. 
 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.


-tim








Re: How do I make the current working directory follow the active document in Gvim?

2007-02-26 Thread Christian Ebert
* cga2000 on Monday, February 26, 2007 at 11:57:39 -0500:
 On Sun, Feb 25, 2007 at 07:57:39PM EST, A.J.Mechelynck wrote:
 - To change (once) to the dir of the current file
 
  :cd %:p:h
 
 Nice. 
 
 But I'm not going to remember it until I understand it.
 
 I scoured the :help files but couldn't find and explanation of the
 syntax. 
 
 :p is short for :print and :h is help.

:help ::p
:help ::h
:help filename-modfiers

You can find out eg. by

:h :p

and then pressing Ctrl-D, or tab.

c
-- 
Vim plugin to paste current GNU Screen buffer in (almost) any mode:
http://www.vim.org/scripts/script.php?script_id=1512


Re: How do I make the current working directory follow the active document in Gvim?

2007-02-26 Thread cga2000
On Mon, Feb 26, 2007 at 12:24:33PM EST, Sibin P. Thomas wrote:
 
 -Original Message-
 From: cga2000 [mailto:[EMAIL PROTECTED] 
 Sent: Monday, February 26, 2007 10:28 PM
 To: vim@vim.org
 Subject: Re: How do I make the current working directory follow the active
 document in Gvim?
 
 On Sun, Feb 25, 2007 at 07:57:39PM EST, A.J.Mechelynck wrote:
 [..]
  
  - To change (once) to the dir of the current file
  
  :cd %:p:h
 
 Nice. 
 
 But I'm not going to remember it until I understand it.
 
 I scoured the :help files but couldn't find and explanation of the
 syntax. 
 
 :p is short for :print and :h is help.
 
 So there's two things I don't know:
 
 1. The symbolic (?) language you are using - the same that's used when
scripting vim, I would imagine.
 
 2. How to use vim's help efficiently 
 
 :-)
 
 Thanks,
 
 Cga
 
 
 
 2. How to use vim's help efficiently -- try :help topic.
 If that doesn't give you what you want try - :helpgrep topic (followed by
 :cwin if needed).
 
 Try :helpgrep %:p:h  you will find the meaning of %:p:h

Interesting approach.. 

.. a bit like doing a google search on the vim helpfiles in a sense.  

All it brings up in my case is references to the what's new with vim
6.x as compared with vim 5.x but with difficult cases, this should give
me enough pointers to search the manuals.

Thanks,
cga


Re: How do I make the current working directory follow the active document in Gvim?

2007-02-26 Thread cga2000
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




Re: How do I make the current working directory follow the active document in Gvim?

2007-02-26 Thread A.J.Mechelynck

cga2000 wrote:

On Sun, Feb 25, 2007 at 07:57:39PM EST, A.J.Mechelynck wrote:
[..]

- To change (once) to the dir of the current file

:cd %:p:h


Nice. 


But I'm not going to remember it until I understand it.

I scoured the :help files but couldn't find and explanation of the
syntax. 


:p is short for :print and :h is help.


Not here. Here they are |filename-modifiers|

When used as a file name:
  % means the current file
let's say projectfoo/foobar.txt
  %:p means (the current file) expanded to a full path (from :p = path)
let's say /home/johndoe/projectfoo/foobar.txt
  %:p:h means (the current file expanded to a full path) minus the last 
component (from :h = head)

let's say /home/johndoe/projectfoo



So there's two things I don't know:

1. The symbolic (?) language you are using - the same that's used when
   scripting vim, I would imagine.


yes



2. How to use vim's help efficiently 


:-)


here are a few examples; some of them use a fictional subject:

:help
		gives you very general help. Start scrolling and you will see a list of all 
known helpfiles, including those added locally (i.e. not distributed with Vim).

:help subject
gives you help about some subject, which can be (the list is 
not exhaustive):
:help :subject
an ex-command, for instance the following:
:help :help
help on getting help
:help 'subject'
an option
:help subject()
a function
:help -subject
a command-line option
:help +subject
a compile-time feature
:help EventName
an autocommand event
:help abc
a normal-mode command
:help CTRL-B
a control key in Normal mode
:help i_abc
:help i_CTRL-B
the same in Insert mode
:help v_abc
:help v_CTRL-B
the same in Visual mode
:help c_abc
:help c_CTRL-B
the same in Command-line mode
:help user-toc.txt
table of contents of the User Manuel
:help digraphs.txt
the top of the helpfile digraph.txt
similarly ofr any other helpfile
:help patternTab
get a helptag matching /pattern/
If 'wildmenu' is ON, the last one above will (if there are at least two 
matches) replace the bottom statusline by a menu. Navigate with Left 
Right, move up or down directory trees with Up Down, accept with 
Enter, abort with Esc -- see :help 'wildmenu' for details

:help patternCtrl-D
see all possible matches at once
:helpgrep pattern
		search the whole text of all helpfiles for the given pattern. Results are 
built into a quickfix error file and can be viewed with

:cn
next match
:cprev
  or
:cN
previous match
:cfirst
:clast
first or last match
:copen
:cclose
open/close the quickfix window

But, like a dictionary or an encyclopedia, the Vim help system also lends 
itself to reading by the Montecarlo method and to the dictionary game:


- Montecarlo method: start anywhere and read what you find there. Read on. 
When bored, open another page at random.
- the Dictionary Game: Start by the Montecarlo method. When you see a subject 
name (here anything in dark green) with which you are not familiar, look it up 
(here: double-click it or hit Ctrl-] on it). Repeat until bedtime.





Thanks,

cga



My pleasure.

Best regards,
Tony.
--
Saturday night in Toledo Ohio,
Is like being nowhere at all,
All through the day how the hours rush by,
You sit in the park and you watch the grass die.
-- John Denver, Saturday Night in Toledo Ohio


Re: How do I make the current working directory follow the active document in Gvim?

2007-02-26 Thread A.J.Mechelynck

cga2000 wrote:
[...]

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.


Some French author of the 17th century I think (Boileau?):

Ce qui se conçoit bien s'énonce clairement
Et les mots pour le dire arrivent aisément.

(What one conceives well is expressed clearly
And the words to describe it come to mind easily.) I don't 100% agree.

[...]

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.


Yes, I agree. Sometimes before your mailer comes around to polling the server 
again, three or four people will have answered with so many different -- and 
valid -- solutions to your problem.


-- Pierre Larousse wrote: /A dictionary without examples is a skeleton./ I'll 
add: The best-coded program won't spread well if it hasn't got good 
documentation. (Let me rephrase this, since after all there exist some 
badly-coded and badly-documented programs which do spread well because huge 
marketing $$$ are spent on them. So let'say: ) Good documentation is a plus 
for any program; a well-coded and well-documented program will need hardly any 
marketing effort. The Vim code isn't bad, and it benefits from the Bazaar 
model, but the Vim documentation is _outstanding_. /Everything/ is in there. 
It's so complete that at times, it poses sort of a needle-and-haystack 
problem, but even that has been addressed with features like helptag 
completion, help hyperlinks, and the :helpgrep command. Then these mailing 
lists carry that a step further: if RTFM doesn't get you what you want, come 
here and you'll find real people who will show you where to look and what to do.




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


The patience and good humor of the old-timers here (first and foremost Bram) 
certainly acts by virtue of example. Another possibility (but I'm on less 
firmer ground there): maybe these lists are too confidential to attract a lot 
of trolls?



Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
68. Your cat always puts viruses on your dogs homepage


Re: How do I make the current working directory follow the active document in Gvim?

2007-02-26 Thread cga2000
On Mon, Feb 26, 2007 at 08:47:00PM EST, A.J.Mechelynck wrote:
 cga2000 wrote:
 [...]
 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.
 
 Some French author of the 17th century I think (Boileau?):
 
 Ce qui se conçoit bien s'énonce clairement
 Et les mots pour le dire arrivent aisément.
 
 (What one conceives well is expressed clearly
 And the words to describe it come to mind easily.) I don't 100% agree.

Maybe because you leave out the context.  This is indeed from Nicolas
Boileau's l'Art Poétique .. a treatise on writing .. recommendations
relative to style .. etc. 

As far as I can remember this was mainly in reaction to the appalling
state of French official poetry of the time .. you know, all that
artificial stuff with shepherds and shepherdesses ..

Another one he wrote could probably be added to netiquette manuals
without changing a comma:

Avant donc que d'écrire, apprenez à penser.

(Before writing, one must learn to think) .. (rough translation)

But I think I know where you're coming from .. and it reminds me of
another one of my favorites: 

For every problem there is one solution which is simple, neat, and
wrong.

H.L. Mencken.

 [...]
 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.
 
 Yes, I agree. Sometimes before your mailer comes around to polling the 
 server again, three or four people will have answered with so many 
 different -- and valid -- solutions to your problem.
 
 -- Pierre Larousse wrote: /A dictionary without examples is a skeleton./ 
 I'll add: The best-coded program won't spread well if it hasn't got good 
 documentation. (Let me rephrase this, since after all there exist some 
 badly-coded and badly-documented programs which do spread well because huge 
 marketing $$$ are spent on them. So let'say: ) Good documentation is a plus 
 for any program; a well-coded and well-documented program will need hardly 
 any marketing effort. The Vim code isn't bad, and it benefits from the 
 Bazaar model, but the Vim documentation is _outstanding_. /Everything/ is 
 in there. It's so complete that at times, it poses sort of a 
 needle-and-haystack problem, 

I tend to consider that vim@vim.org is actually a priceless extension to
the vim documentation system. 

 but even that has been addressed with features 
 like helptag completion, help hyperlinks, and the :helpgrep command. Then 
 these mailing lists carry that a step further: if RTFM doesn't get you what 
 you want, come here and you'll find real people who will show you where 
 to look and what to do.

I have had this feeling before that learning vim is a bit like mastering
craft and consider myself a lucky apprentice.

 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
 
 The patience and good humor of the old-timers here (first and foremost 
 Bram) certainly acts by virtue of example. Another possibility (but I'm on 
 less firmer ground there): maybe these lists are too confidential to 
 attract a lot of trolls?

And possibly a consensus that if anyone barges in with outrageous
nonsense he will be met with complete silence.  He will feel like the
idiot that he is and go sell his wares elsewhere.

Thanks,
cga


Re: How do I make the current working directory follow the active document in Gvim?

2007-02-26 Thread cga2000
On Mon, Feb 26, 2007 at 08:06:12PM EST, A.J.Mechelynck wrote:
 cga2000 wrote:

[..]

 2. How to use vim's help efficiently 

 here are a few examples; some of them use a fictional subject:
 
   :help
   gives you very general help. Start scrolling and you will 
   see a list of all known helpfiles, including those added 
 locally (i.e. not 
 distributed with Vim).
   :help subject
   gives you help about some subject, which can be (the list is 
   not exhaustive):
   :help :subject
   an ex-command, for instance the following:
   :help :help
   help on getting help
   :help 'subject'
   an option
   :help subject()
   a function
   :help -subject
   a command-line option
   :help +subject
   a compile-time feature
   :help EventName
   an autocommand event
   :help abc
   a normal-mode command
   :help CTRL-B
   a control key in Normal mode
   :help i_abc
   :help i_CTRL-B
   the same in Insert mode
   :help v_abc
   :help v_CTRL-B
   the same in Visual mode
   :help c_abc
   :help c_CTRL-B
   the same in Command-line mode
   :help user-toc.txt
   table of contents of the User Manuel
   :help digraphs.txt
   the top of the helpfile digraph.txt
   similarly ofr any other helpfile
   :help patternTab
   get a helptag matching /pattern/
 If 'wildmenu' is ON, the last one above will (if there are at least two 
 matches) replace the bottom statusline by a menu. Navigate with Left 
 Right, move up or down directory trees with Up Down, accept with 
 Enter, abort with Esc -- see :help 'wildmenu' for details
   :help patternCtrl-D
   see all possible matches at once
   :helpgrep pattern
   search the whole text of all helpfiles for the given 
   pattern. Results are built into a quickfix error file and can 
 be viewed 
 with
   :cn
   next match
   :cprev
 or
   :cN
   previous match
   :cfirst
   :clast
   first or last match
   :copen
   :cclose
   open/close the quickfix window

This is beginning to make more sense. 

I need to xml-ize the above into a docbook table and add it to my
little cheat sheet.

Thanks for all the details.

 But, like a dictionary or an encyclopedia, the Vim help system also lends 
 itself to reading by the Montecarlo method and to the dictionary game:
 
 - Montecarlo method: start anywhere and read what you find there. Read on. 
 When bored, open another page at random.
 - the Dictionary Game: Start by the Montecarlo method. When you see a 
 subject name (here anything in dark green) with which you are not familiar, 
 look it up (here: double-click it or hit Ctrl-] on it). Repeat until 
 bedtime.

Or to paraphrase Marguerite Duras .. Des journées entière dans les livres.

Thanks,
cga


Re: How do I make the current working directory follow the active document in Gvim?

2007-02-26 Thread A.J.Mechelynck

cga2000 wrote:

On Mon, Feb 26, 2007 at 08:47:00PM EST, A.J.Mechelynck wrote:

cga2000 wrote:
[...]

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.

Some French author of the 17th century I think (Boileau?):

Ce qui se conçoit bien s'énonce clairement
Et les mots pour le dire arrivent aisément.

(What one conceives well is expressed clearly
And the words to describe it come to mind easily.) I don't 100% agree.


Well, maybe 85% or so. That distych is (too) often used in French to mean that 
what can't be expressed in Cartesian language is not worthy of any attention.




Maybe because you leave out the context.  This is indeed from Nicolas
Boileau's l'Art Poétique .. a treatise on writing .. recommendations
relative to style .. etc. 


As far as I can remember this was mainly in reaction to the appalling
state of French official poetry of the time .. you know, all that
artificial stuff with shepherds and shepherdesses ..

Another one he wrote could probably be added to netiquette manuals
without changing a comma:

Avant donc que d'écrire, apprenez à penser.

(Before writing, one must learn to think) .. (rough translation)


Let's try to recapture the alexandrine rhythm:

Before you start to write, teach yourselves to think.



But I think I know where you're coming from .. and it reminds me of
another one of my favorites: 


For every problem there is one solution which is simple, neat, and
wrong.

H.L. Mencken.


I hark from Brussels, Belgium, if that's what you mean.

[...]

I tend to consider that vim@vim.org is actually a priceless extension to
the vim documentation system. 


Indeed.

[...]

I have had this feeling before that learning vim is a bit like mastering
craft and consider myself a lucky apprentice.


:-)

[...]
The patience and good humor of the old-timers here (first and foremost 
Bram) certainly acts by virtue of example. Another possibility (but I'm on 
less firmer ground there): maybe these lists are too confidential to 
attract a lot of trolls?


And possibly a consensus that if anyone barges in with outrageous
nonsense he will be met with complete silence.  He will feel like the
idiot that he is and go sell his wares elsewhere.

Thanks,
cga



:-) Don't feed the trolls indeed.


Best regards,
Tony.
--
No woman can call herself free until she can choose consciously whether
she will or will not be a mother.
-- Margaret H. Sanger


Re: How do I make the current working directory follow the active document in Gvim?

2007-02-26 Thread cga2000
On Mon, Feb 26, 2007 at 11:39:08PM EST, A.J.Mechelynck wrote:
 cga2000 wrote:
 On Mon, Feb 26, 2007 at 08:47:00PM EST, A.J.Mechelynck wrote:
[..]
 
 Avant donc que d'écrire, apprenez à penser.
 
 (Before writing, one must learn to think) .. (rough translation)
 
 Let's try to recapture the alexandrine rhythm:
 
 Before you start to write, teach yourselves to think.

A marked improvement if I may say so.

 
 But I think I know where you're coming from .. and it reminds me of
 another one of my favorites: 
 
 For every problem there is one solution which is simple, neat, and
 wrong.
 
 H.L. Mencken.
 
 I hark from Brussels, Belgium, if that's what you mean.

I know where you're coming from has nothing much to do with geography
these days.  It's more like I hear you .. or I know what you're
saying. It's just one of those expressions you keep hearing.  I try to
avoid them even in informal conversations but somehow it crept into my
prose above.  I have a feeling that when used in the first person by
someone after voicing his opinion on some matter or other such as in,
for instance, do you understand where I'm coming from?  the said
individual is trying to add more weight to that view of his by
conveying that it evolved as a result of a lengthy and presumably
painful learning experience.  When used in the second person as I did
above it probably adds a touch of empathy .. ie. not only do I
rationally understand what you are saying but I am also aware of what
led you to think thusly and feel pretty much the same myself about it.

Thanks,
cga


Re: How do I make the current working directory follow the active document in Gvim?

2007-02-25 Thread Bill McCarthy
On Sun 25-Feb-07 6:22pm -0600, Noah Spurrier wrote:

 How do I configure Gvim so that the current directory
 follows the active document?

Try this:

  autocmd BufReadPost * lcd %:h


-- 
Best regards,
Bill



Re: How do I make the current working directory follow the active document in Gvim?

2007-02-25 Thread Thor Andreassen
On Sun, Feb 25, 2007 at 06:50:41PM -0600, Bill McCarthy wrote:
 On Sun 25-Feb-07 6:22pm -0600, Noah Spurrier wrote:
  How do I configure Gvim so that the current directory
  follows the active document?
 
 Try this:
   autocmd BufReadPost * lcd %:h

You could also try :set autochdir, see :help 'autochdir'.

-- 
with kind regards
Thor Andreassen


Re: How do I make the current working directory follow the active document in Gvim?

2007-02-25 Thread A.J.Mechelynck

Noah Spurrier wrote:

How do I configure Gvim so that the current directory
follows the active document?
I know I've seen this somewhere in the Vim docs, but
none of my searches are turning it up now.

When I'm editing a document in Gvim,
I find that Gvim always uses my home directory as the working directory.
If I use :w newname to save the current file under a new name
the new file appears in my home directory rather than the
directory of the current file. The same happens if I enter
:split . to open a new file in my project. I first see my
home directory. I have to browse back to my project directory.
I would like :split . to open the same directory as my active document.
I have the same problem with :make!

I don't have this problem with vim from the command-line because
I usually start vim from my project directory so the
current working directory is already set.

I'm using Gvim 7.0 under Linux Ubuntu 6.10

Yours,
Noah





- To always change to the directory of the current file

:set autochdir

I find this very disturbing, though, because after :split subdir/file I'll 
find myself editing file with the current dir changed without me having 
issued any change-dir command. I prefer using :lcd explicitly, and not 
necessarily to the file's dir.


- To change (once) to the dir of the current file

:cd %:p:h

- To change a single window's local directory to that of its file without 
touching the other windows


:lcd %:p:h

Note: The status-line of each window will show you its file path relative to 
the current working directory. You may want to set


:set laststatus=2

to always have a status line on all windows.


Best regards,
Tony.
--
Resisting temptation is easier when you think you'll probably get
another chance later on.