Re: Why bottom-posting is prefered on Vim Mainling List?

2007-05-30 Thread Jean-Rene David
* [EMAIL PROTECTED] [2007.05.29 05:15]:
 See, though I always do trim, I still suffered
 from those who do not trim and use
 bottom-posting.

I take it your mail program doesn't have a
hide-quoted-text function. Who says text-based
mail programs are primitive? :-)

-- 
JR


Re: vim 7.1 and cr/lf interpretation

2007-05-15 Thread Jean-Rene David
* A.J.Mechelynck [2007.05.15 08:01]:
 If you had, as I already told you twice (this is
 the third one) done
 
   :set fileformats=
   :e ++ff=dos list02.p
   :w
 
 your file would have been repaired immediately.
 SO WHY DIDN'T YOU?

Or equivalently:

:e list02.p
GAC-VC-MESC  add ^M at the end of the last line
:w
:e

-- 
JR


Re: omni-completion

2007-05-09 Thread Jean-Rene David
* Normandie Azucena [2007.05.09 09:30]:
 this will seem to be a dumb question.
 what is omni-completion?
 How can I use it in vim?
 How can I create my own?

Have you given 

:h omni-completion

a try?

-- 
JR


Re: Filename completion with all directories in 'path'?

2007-04-19 Thread Jean-Rene David
* Ben Kovitz [2007.04.19 20:00]:
 Is there a way to make filename completion
 (pressing tab at the command line in :find) use
 all the directories in the 'path'?

Not exactly what you ask, but here is a nice
little script I use quite a bit which you might
find helpful:

http://www.vim.org/scripts/script.php?script_id=1581

HTH,

-- 
JR


Re: about fonts in gvim

2007-04-18 Thread Jean-Rene David
* shawn bright [2007.04.18 12:45]:
 is there a way i can permanently set the font
 for gvim ?  i can't find a config file for it.

:h 'guifont'

-- 
JR


Re: CLTR-N and enter

2007-04-17 Thread Jean-Rene David
* Eric Leenman [2007.04.17 04:15]:
 Is it possible to select the right word with
 another key then the enter-key, and thus staying
 on the same line before CTRL-N was pressed at
 all?

Yes, just continue typing...

See:

:h popupmenu-keys

It defines the only keys which are special in the
popup menu. Any other key will just have its
normal effect.

-- 
JR


Re: Troubles configuring vim (multi-questions)

2007-04-16 Thread Jean-Rene David
* Gene Kwiecinski [2007.04.16 11:45]:
 Displays ^I just fine, but trashes actual
 indentation, at least for me (dunno if there's
 any magical 'vim' setting, like :set
 keepindent or something).

set listchars+=tab:-

-- 
JR


Re: command to delete just whitespace

2007-04-15 Thread Jean-Rene David
* shawn bright [2007.04.15 20:15]:
 Hey there, i am looking for a command that will
 delete all whitespace up until the first
 character.
 
 for example
 
 []some_characters
 []some_characters.

:s/^\[\]\zs\s*//

-- 
JR


Re: Setting font in console vim

2007-04-12 Thread Jean-Rene David
* [EMAIL PROTECTED] [2007.04.12 10:30]:
 I can set the font in gvim using:
 Set guifont=
 
 But how do I do the same with console vim?

You change the console font. :-)

If you use cygwin I can tell you how I do it for
rxvt or xterm.

-- 
JR


Re: how to delete all occur of a character

2007-04-09 Thread Jean-Rene David
* Przemyslaw Gawronski [2007.04.09 09:45]:
 :argdo %s/\//g | updateCR

 is not special, so no need to quote it.

:argdo %s///g | updateCR

-- 
JR


Re: delete buffer questions

2007-04-09 Thread Jean-Rene David
* alebo [2007.04.09 15:00]:
 But if I use another kind of deletion like dw, I
 couldnt fetch it from the buffers 1-9, only from
 the first unnamed buffer. Why is this so and
 which kind of delete operations are supported in
 the delete buffers?

If you delete less than one line, the data is put
in the small-delete register: -

:h quote-

It is number 3 in the list of register types found
at:

:h registers

You can see its current content by doing:

:di -

-- 
JR


Re: How to open a BIG file quickly?

2007-04-05 Thread Jean-Rene David
* Tom Purl [2007.04.05 10:30]:
 On Thu, April 5, 2007 2:38 am, ³Â·½ÈÙ wrote:
  If I want to open one 1G bytes size
  file,it's really slow.

I suggest splitting it into smaller chunks with
another tool.

 Just out of curiosity, why are you trying to
 edit a 1 GB file with any text editor?  I'm
 assuming that these files are flat file
 databases.  

I need to do that quite often. They are usually
log files from a long running program in debug
mode.

-- 
JR


Re: How to open a BIG file quickly?

2007-04-05 Thread Jean-Rene David
* Tom Purl [2007.04.05 12:00]:
  I need to do that quite often. They are usually
  log files from a long running program in debug
  mode.
 
 Actually, you can think of a log file as a sort
 of flat file database.  Here's an example

I appreciate all the help but I really don't have
a problem with large files. I *do* preprocess my
large files with grep/awk/perl in all sorts of
ways and *do* use vim to view and edit the
resulting chunks.

I am not the OP, and I was just mentioning log
files because someone sounded surprised one might
legitimately need to edit a 1GB file.

And before somebody mentions it, I do know about
logrotate... :-)

-- 
JR


Re: OT: Reply-To munging [was: [SOLVED] Need advice on pattern matching using match()]

2007-04-04 Thread Jean-Rene David
* Michael Klier [2007.04.04 17:30]:
 I am sure this has been questioned before but why is the
 Reply-To: header field not set via the mailing-list?

Short answer: because it makes it more difficult
to reply to the author without making it easier to
reply to the list.

Long answer:
http://www.unicom.com/pw/reply-to-harmful.html

-- 
JR
$ grep reply .muttrc
folder-hook . bind index r reply
folder-hook .*-L$ bind index r list-reply


Re: Error format and quickfix

2007-03-27 Thread Jean-Rene David
* Christophe Dupre [2007.03.27 07:15]:
 Here is what I get when I do copen.
 
 || ccsc main.c +FH +P +DC +LO +EA +STDOUT I+=..\Includes
 ||  Warning 201 C:\Project\Test\OnlineMS\Firmware\Source\rs232.c
 Line 48(1,1): Assignment inside relational expression
 || *** Error 12 C:\Project\Test\OnlineMS\Firmware\Source\main.c Line
 97(3,4): Undefined identifier   j
 ||   1 Errors,  1 Warnings.
 [...]

To avoid mistakes, it would be easier if you
provided your *compiler's* output, not what you
see in the quickfix window. For example, in the
above, one has to deduce that the line wrap has
been added by vim, but it may as well have been in
the compiler's output. Another reason will be
apparent below.

 I guess what I need to define is the format for
 only these 2 lines (correct me if I'm wrong) ,
 and can ignore the rest.

Yes, I think this is correct.

 ||  Warning 201 C:\Project\Test\OnlineMS\Firmware\Source\rs232.c
 Line 48(1,1): Assignment inside relational expression
 || *** Error 12 C:\Project\Test\OnlineMS\Firmware\Source\main.c Line
 97(3,4): Undefined identifier   j
 
 Here is what I think I should define.
 \|\|\  %t\ %n\ %f\ Line\ %lXXX%m
 \|\|\ \*\*\*\ %t\ %n\ %f\ Line\ %lXXX%m
 Can you spot anything wrong here?

Yes. 

The || characters at the beginning of the line are
added by vim on lines it doesn't recognize. You
needn't parse them because they are not part of
you compiler's output.

 How do I deal with the (1,1), and the (3,4)?

That depends what they mean. 

-- 
JR


Re: Deleting some lines from a log file

2007-03-27 Thread Jean-Rene David
* Eddine [2007.03.27 09:45]:
 ENTRY
 
 184
 185  
 **;
 186  *   PGMs Complexes   1 : enable - O : disable
   *;
 187  
 **;123
 
 188
 189   %include pgm.MainComplex.sas; ** Macro principale
 Base et Queries **;
 NOTE: %INCLUDE (level 1) file E:\IFM
  2005-01\gravure_2007_03_15\BRD_04-11-J\Database\Programs\MainComplex.sas
 is file E:\IFM
  2005-01\gravure_2007_03_15\BRD_04-11-J\Database\Programs\MainComplex.sas.
 
 269 
 +**;
 MPRINT(MAINCOMPLEX):
 **;
 
 RESULT :
 
 NOTE: %INCLUDE (level 1) file E:\IFM
  2005-01\gravure_2007_03_15\BRD_04-11-J\Database\Programs\MainComplex.sas
 is file E:\IFM
  2005-01\gravure_2007_03_15\BRD_04-11-J\Database\Programs\MainComplex.sas.
 
 **;
 
 (for a try :%s/^[0-9]*/TEST/ didn't work).

You are close. The problem is that this pattern
will match *every* line, since you accept zero or
more digits at the beginning of the line.

Try:

:%s/^[0-9]\+/TEST/

Using \+ instead of * in the pattern will match
one or more instead of zero or more.

Then to also match lines that begin with MPRINT:

:%s/^\([0-9]\+\|MPRINT\)/TEST/

Then to delete them (make sure you undo the
previous substitution...):

:g/^\([0-9]\+\|MPRINT\)/d

HTH,

-- 
JR


Re: Search Replace in VIM Script

2007-03-27 Thread Jean-Rene David
* oskar [2007.03.27 11:25]:
 I have a vim script which I want to use to
 search  replace a part out of a given line. The
 fields in the line are based on field length and
 the field I want to change starts at position 33
 and ends after 4 charachter.

Sample data and the result you expect would make
things so much easier...

This will match characters in columns 33-36:

/\%33c

:h /\%c

-- 
JR


Re: How to turn a q recording into a map?

2007-03-23 Thread Jean-Rene David
* [EMAIL PROTECTED] [2007.03.23 19:45]:
 I was thinking that there should be a way to
 take the register lines and automatically turn
 them into an noremap (including adding the @ to
 start register playback). Has anyone perfected
 this?

If you want your mapping to follow the (possibly
changing) content of q:

map F2 @q

If you want your mapping to stay fixed even if
register q changes:

:exe map F2  . expand(@q)

and then you can map that...

map F3 :exe map F2  . expand(@q)CR

HTH,

-- 
JR


Re: Count characters

2007-03-22 Thread Jean-Rene David
* Harald Kröll [2007.03.22 13:30]:
 Is there some function or script to count
 characters (letters without whitespaces) in vim?

One way is to use the 'substitute' command's
ability to tell you how many items it replaced. So
if you type:

:%s/\S//g

You will get a message saying how many non-blank
characters were found and replaced by themselves.

-- 
JR


Re: Customizing vim: How to change the char before commands

2007-03-22 Thread Jean-Rene David
* Some user [2007.03.22 15:00]:
  RANT 
 Though I don't really get the reason why every
 command is preceded by colon.

Not to nitpick, but commands themselves don't
really care about the colon. The colon is used to
*change mode*.

In normal mode, you can just type away your
commands without any colon, ever. 

Command-line mode accepts just one command at a
time, so you need to re-enter a colon for each new
command to re-enter command-line mode.

For multiple successive commands, you can use
either Ex mode or the command window:

:h Ex-mode
:h cmdwin

It sounds like you would like to be able to do
everything from normal-mode. But then you would be
lacking a lot of the expressive power of vim
commands.

 It should be one keypress, like maybe
 semi-colon. 

map ; :

 One quick question, please if you could answer:
 what if I want to map something like a two keys
 in succession to something, like gg for save, gz
 for quitting and saving. How would it change?

map gg :wCR
map gz :wqCR

-- 
JR


Re: Consistently exit message display with 'q'?

2007-03-20 Thread Jean-Rene David
* Bram Moolenaar [2007.03.20 11:45]:
  How many times did I repeat a command just because
  I had pressed Space one time too many...
 
 You can type g to go back to the messages.

Thanks! Didn't know about that.

Reading the help, this only brings back the last
viewed page of messages though. Not quite the same
thing as bringing up the complete output of the
last command.

-- 
JR


Re: How to show path?

2007-03-16 Thread Jean-Rene David
* Peng Yu [2007.03.16 16:30]:
 Can somebody let me know how to show the current
 value of path?

:set path?

-- 
JR


Re: How to switch between horizontal split and vertical split?

2007-03-13 Thread Jean-Rene David
* Peng Yu [2007.03.13 12:15]:
 Suppose I have horizontal splited window1 and
 window2, is there any way to change them into
 vertical split and vice versa?

CTRL-W H
CTRL-W J

Note the capital H and J.

-- 
JR


Re: mark an anchor

2007-03-02 Thread Jean-Rene David
* Bin Chen [2007.03.02 09:45]:
 If I am in line 100, now I want to search a key
 which will lead me to wherever. I want to back
 to the place before the seach, can vim support
 anchor for me to back?

If I understand your question, CTRL-O will do what
you want.

:h CTRL-O

-- 
JR


Re: Mapping to the numerical - and + and *

2007-03-01 Thread Jean-Rene David
* Eric Leenman [2007.03.01 13:30]:
 How were you planning to use those?

 I want to use these as cut, paste and copy iso
 CTRL-X, V and C.

Cutting and copying are compound operations in the
sense that you need to specify /what/ they are
going to act on. There are many ways to do this,
depending on the mode you are in.

 I now got
 :vnoremap kPlus +p
 :vnoremap kMinus +d
 :vnoremap kMultiply +y

This looks fine.

What you want to act on is implicitly the visual
selection.

 :noremap kPlus +p

This is fine.

 :noremap kMinus +d
 :noremap kMultiply +y

Here you will need to specify *what* you want to
cut or paste with a motion command after you
have pressed kMinus of kMultiply.

 :inoremap kMinus +d
 :inoremap kMultiply +y

These are insert-mode mappings. So of course you
get +d in your text. This is exactly what you
told vim to do.

What do you *mean* when you are in insert mode and
want to cut or copy? Copy what?

One possibility is to revert to normal mode and
follow the command with a motion:

:inoremap kMinus C-O+d
:inoremap kPlus  C-O+p

 :inoremap kPlus +p

This is meaningful but the syntax is incorrect.
Tony gave you the answer for this one.

 I tried the help CTRL-R but I don't follow that.

It would help if were more explicit about the
parts you don't understand.

In normal mode, pressing +p means: 
'put the content of register + after the cursor'.

In insert mode, pressing +p means: 
'insert  then + then p'. 

It has nothing whatsoever to do with registers.
This is where CTRL-R helps you. CTRL-R+ is the
insert-mode equivalent of +p in normal-mode.

-- 
JR


Re: Mapping to the numerical - and + and *

2007-02-28 Thread Jean-Rene David
* Eric Leenman [2007.02.28 08:00]:
 Is it possible to map the - and + and * keys on
 the nummerical section of a keyboard (in other
 words the keys in the group where the num-lock
 key is also)

That part of the keyboard is sometimes referred to
as the keypad. You can refer to those keys in
vim with the following (from :h key-notation, near
the end of the table):

notationmeaning equivalent  decimal value(s)~
---
[...]
kPlus keypad +*keypad-plus*
kMinuskeypad -*keypad-minus*
kMultiply keypad **keypad-multiply*

 to functioan as cut, paste and copy?

In vim, delete always saves the deleted data
somewhere. So in that sense, it's equivalent to
cut, as long as you know where vim put the
stuff. The other operations are referred to in vim's
documentation as put, and yank.

These operations usually require more than one
keystroke. How were you planning to use those?

-- 
JR


Re: trying to leave the GUI world and enter the world of VIM

2007-02-27 Thread Jean-Rene David
* Peter Michaux [2007.02.26 22:00]:
 Does vim have the concept of a project of files? 

You might want to look at this:

http://www.vim.org/scripts/script.php?script_id=69

Found by searching vim.org with the keyword
'project'.

HTH,

-- 
JR


Re: search something from vim in certain directory

2007-02-22 Thread Jean-Rene David
* Peng Yu [2007.02.22 11:15]:
 I have a C++ project in some dir say project
 or its subdir. Although I can use find and grep
 outside vim to search for any word in project.
 But this is not very convenient.

Well you can use an external grep from within vim.
One advantage is that it's relatively fast and you
can use the quickfix window. An inconvenient is
that you can't use vim regex.

:h grep
:h grepprg

If you have vim 7, then you can use vimgrep.

:h vimgrep

If your project is large, you could also use an
indexing program like glimpse. See

http://www.vim.org/tips/tip.php?tip_id=1021

-- 
JR


Re: search something from vim in certain directory

2007-02-22 Thread Jean-Rene David
* Peng Yu [2007.02.22 16:15]:
 I read the help. But I still don't see how to search in all the *.h
 and *.cc in a certain directory. Do I have to rely on the external
 command find?

It would help if you told us what version of vim
you use and what you tried.

If you have vim 7, you can use:

:vimgrep pattern directory/**/*.h

See

:h wildcard

Otherwise:

:grep -r pattern directory

though that will search all files in the
directory, recursively.

If your 'shell' is zsh, then you can use zsh's
recursive globbing patterns:

:grep pattern directory/**/*.(h|cc)(.)

If you use indexing with glimpse, you can specify
which files in which directory to index.

man glimpse
man glimpseindex

-- 
JR


Re: How to: display only the lines that have a matching pattern and fold /hide others.

2007-02-21 Thread Jean-Rene David
* Muddassirali Mirzani [2007.02.21 07:30]:
  Is there a way to display only the lines that match
  a search pattern and hide/fold others.

The foldutil plugin makes that very easy. I use it
quite a bit.

http://www.vim.org/scripts/script.php?script_id=158

-- 
JR


Re: :wq vs ZZ

2007-02-13 Thread Jean-Rene David
* Gene Kwiecinski [2007.02.13 17:00]:
 [...]
 I never liked :wq, because you gotta do
 
   depress shift
   :
   release shift
   w
   q
   enter

For most actions in vim, I too often look for the
very fastest, fewest-keystrokes way. However
quitting is not one of them.

I agree with Tim's point: when I quit I prefer
being forced to be explicit about *how* I quit.

-- 
JR


Re: Deleting control line feed in string

2007-01-30 Thread Jean-Rene David
* Mueller Stefan [2007.01.30 07:56]:
 How can I delete a control line feed in a string

:s/\\n//

Should do what you want. Insert range as
appropriate.

Or

:let value = substitute(string, n,,g)

:h substitute()

Discusses this specific case.

HTH,

-- 
JR


Re: disable é ma p in tex-suite

2007-01-23 Thread Jean-Rene David
* neolistic [2007.01.23 10:15]:
 * Jean-Rene David-2 wrote:
  See here for a possible solution:
  
  http://vim-latex.sourceforge.net/index.php?subject=faqtitle=FAQ#faq-e-acute

 I think this solution can work but I don't have
 the perms for the plugin direcory, is there a
 solution to unmap or surmap the é?

[Please don't top-post]

The solution given uses only files in your home
directory. It should work even if the plugin is
globally installed. Do you mean you don't have the
required permissions in your own home directory?

-- 
JR


Re: Folding away based on a seach

2007-01-11 Thread Jean-Rene David
* Samuel Wright [2007.01.11 06:15]:
 I have a todo list of single line entries.
 I'd like to fold everything away apart from a custom seach, say
 
 :customsearch urgent
 
 would fold away all lines that did not contain urgent.
 
 Has this been done already in some way?

Yes.

http://www.vim.org/scripts/script.php?script_id=158

-- 
JR


Re: Find and replace in visual area.

2007-01-08 Thread Jean-Rene David
* Silva, Paulo [2007.01.08 11:30]:
 I'm trying to do a replace in a selection.
 After selecting the area, with v, directional keys, v again (or not -
 both give the same result).
 
 Then I type
 :%s/\%V20/21/

Don't know why it doesn't work on your end. Works
here. In any case, to do what you want, you can
just select an area and, while still in visual
mode, type:

:s/20/21

This will appear as:

:','s/20/21

in your status line. The ' and ' indicate the
beginning and end of the current visual area.

HTH,

-- 
JR


Re: Making C-] do something different

2006-12-19 Thread Jean-Rene David
* Chuck Mason [2006.12.13 17:15]:
 In :help it follows links
 (Maybe there's a helptags file?).

Bingo.

:h helptags 

 [...]
 For instance I have a line that looks like:
 
 ... sometext somenumber1 someothertext2
 
 And if the user presses C-] anywhere on the line I would like to take
 somenumber1 and do something with it (follow it by replacing the current
 buffer with another file referenced by the number). If the line doesn't
 start with ... Then ignore the keypress.  I think I can handle all that
 but I want to know if its possible to:

One way:

Define a function which will determine if your line
matches and act accordingly:

function! Foo()
   if getline(.) =~ ^\\.\\.\\.
   extract somenumber1 and
   do something with it
   else
   do nothing
   endif
endfunction

And use autocommands to determine whether your
function should be called or not depending on
which buffer you're in:

autocmd BufEnter *.tmp map C-] :call Foo()CR
autocmd BufLeave *.tmp unmap C-]

All that is left is extracting somenumber1.

-- 
JR


Re: aligning text to a certain column

2006-12-05 Thread Jean-Rene David
* Lev Lvovsky [2006.12.05 13:53]:
 how can I align text under and after the cursor
 position to a  specific column number?  

:.,$s/^\s*/   /g

will align the first non-blank on the fourth
column, from the cursor's line to the end of the
file.

 and probably just as important, how can I  
 find out which column number a cursor is at ;)?

In normal mode:
:h g_Ctrl-G

In scripts:
:h getpos()

or add %c to your status line to have it all the
time.

:h statuslineCR7}

-- 
JR


Re: search and replace function in vimrc

2006-11-27 Thread Jean-Rene David
* Samuel Wright [2006.11.27 11:15]:
 The regular expression works if I call it
 directly, but when I write
 
 :function FixJHIndex
 
 it just echoes the function definition. What am
 I missing?

:function does exactly as documented.

You want:
:call FixJHIndex()

See

:h :call
:h :function

-- 
JR


Re: compile code from within vim

2006-11-26 Thread Jean-Rene David
* atstake atstake [2006.11.26 20:45]:
[...]
 eg. if it's a .pl file it would do perl
 filename, show the result and if there's any
 error it would take me to the line where the
 error is.
 
 Is there any easy way to do this with functions?
 Any example would be greatly appreciated.

To change the compiler based on file extension,
you can use autocommands:

:au BufNewFile,BufReadPre *.pl set makeprg=perl\ -c\ %
:au BufNewFile,BufReadPre *.c  set makeprg=make
:au BufNewFile,BufReadPre *.py set makeprg=pychecker\ %
etc.

To jump to the errors found, you can use the
quickfix window. Depending on the compiler you
use, you may need to tweak the 'errorformat'
option. This tells vim how to parse the error
file.

:h :make
:h 'makeprg'
:h 'errorformat'
:h quickfix

-- 
JR


Re: Searching/replacing literally

2006-11-23 Thread Jean-Rene David
* Meino Christian Cramer [2006.11.23 02:45]:
  I want to search a longer string totally
  literally...regexp totally switched of, no
  exceptions.

function! LiteralSearch(string) range
   let l:pattern = escape(a:string, '\\/.*$^~[]')
   let @/ = l:pattern
   normal n
endfunction

:command -nargs=1 LS call LiteralSearch (f-args)

Then:

:LS .*$

Will match one time in this message, in the
function code above instead of matching every
line.

Map as desired.

HTH,

-- 
JR


Search unfolded lines only

2006-11-13 Thread Jean-Rene David
Is there any way to search for text in open folds
only? For example, if fold 1 and fold 2 below are
closed and fold 3 is open, and placing the cursor
on the line which says Start search here, I
would like to end up on the foo in fold 3 when
typing /fooCR.

Start search here

{{{
   fold1
   foo
   fold1
}}}
{{{
   fold2
   foo
   fold2
}}}
{{{
   fold3
   foo
   fold3
}}}

-- 
JR
 vim: fdm=marker


Re: highlight after :s///g

2006-11-09 Thread Jean-Rene David
* Tim Chase [2006.11.09 17:30]:
   :map f4 :let @/='~'cr

Using :match also works, and doesn't modify @/.

:match Search '~'

Note that this gives a warning if no previous
replacement string exists.

-- 
JR


Re: Getting out of netrw

2006-11-04 Thread Jean-Rene David
* Gary Johnson [2006.11.04 18:30]:
 When you open file A, then open file B, then
 want to go back to A, you don't do so by
 quitting B--you explicitly open A.

Looking at it that way, it makes good sense.

Thanks again for all the suggestions.

-- 
JR


Getting out of netrw

2006-11-03 Thread Jean-Rene David
Say I open vim7's new super duper file explorer
netrw to browse some local directory. Say then I
decide I don't want to open any new file and just
want to go back to what I was doing. What would be
the standard way to do that?

I can use C-O to eventually land up where I was
but I need to backtrack all the motion commands I
did in the netrw buffer.

I thought of using :q but that closes vim if only
one window is open.

Am I missing something obvious?

-- 
JR


Re: projects manager/explorer

2006-11-02 Thread Jean-Rene David
* victor NOAGBODJI [2006.11.02 11:45]:
 Just looking for something like that in gvim.
 Do you know something like that?

Searching for project on www.vim.org yields many
hits. 

I use the project plugin. I like it, despite
some warts.

-- 
JR


Re: what are blue signs appearing in vimdiff panes ?

2006-10-23 Thread Jean-Rene David
* Yakov Lerner [2006.10.23 07:00]:
 If you look at lines 879-884 of the left pane,
 and lines 1583-1588 of the right pane  you can
 see blue signs near line numbers. What do they
 signify ?

They mean those lines are an open diff fold. 

 I just did vimdiff and no special options.
 What do they mean, those spooky signs, in the
 middle of no-difference region ?

Precisely that there are no differences in that
region, which is why it can be safely folded away
by the fold commands.

I notice you have the default 'context:6' in your
'diffopt', since there are 6 lines between the
delimited fold and the adjacent differences.

-- 
JR


Re: Question about listchars

2006-10-19 Thread Jean-Rene David
* Jeff Lanzarotta [2006.10.19 13:13]:
 If there a way to check and see if the listchar
 is actually set or not?

For options I change often, I use the following to
display its value in the statusline. 

function! OptSet(opt, string)
   if(exists(a:opt)  expand(a:opt))
  return a:string
   else
  return 
   endif
endfunction

Then put the following in the statusline:

set statusline=%%f\%h%m%r%y%{OptSet(ic,'[ic]')}[...]
 

So in this specific case, if 'ic' is set, I will
have '[ic]' in my status line.

I use that for 'ic' and 'ws' because I toggle them
quite ofen.

HTH,

-- 
JR


Re: search visual block

2006-10-18 Thread Jean-Rene David
* Robert Cussons [2006.10.18 06:30]:
 I did notice that between the if and else there
 are  which just act as comments as they are on
 newlines,

Sorry, I should have known that wouldn't come out
right. There's a literal newline between the
quotes. You can enter it by pressing
CTRL-VCTRL-M.

Here's that section of code with the literal
newline entered as two separate characters:

if a:direction == 'b'
   execute normal ? . l:pattern . ^M
else
   execute normal / . l:pattern . ^M
endif

 I was selecting text in visual mode, then
 pressing / or ? and I just get the normal action
 of pressing / or ?

Well you could do it with / and ? but I like
to keep their behavior intact as it is useful to
extend the visual region.

I remapped * and # instead, as shown in these
lines:

vnoremap silent * :call VisualSearch('f')CR
vnoremap silent # :call VisualSearch('b')CR

I prefer that because these don't have any special
meaning in visual mode and it ties in nicely with
the search next/previous word function they have
in normal mode.

-- 
JR


Re: search visual block

2006-10-18 Thread Jean-Rene David
* Benji Fisher [2006.10.18 09:15]:
  I try to avoid such problems by not including raw CR, ESC, etc.
 characters in my vim scripts.  I suggest replacing the two :execute
 lines with
  execute normal ? . l:pattern . \CR
 and
  execute normal / . l:pattern . \CR

I was looking for a way to avoid the literals.
Thanks for that. That's definitely better.

-- 
JR


Re: search visual block

2006-10-18 Thread Jean-Rene David
* Robert Cussons [2006.10.18 09:29]:
 Everything seems to work fine now, except the
 searched for items aren't highlighted like they
 normally are when I search

Whether or not search items are highlighted
depends on the value of the 'hlsearch' option.

The search item gets highlighted on my end when the
option is set. Is yours set?

:set hls?

-- 
JR


Re: automatically going from header file to implementation file

2006-10-18 Thread Jean-Rene David
* Naim Far [2006.10.18 13:00]:
  Does any body know a way of automatically going
  from header file to its implementation file?!
  and vice versa?!

a.vim : Alternate Files quickly (.c -- .h etc)
http://vim.sourceforge.net/scripts/script.php?script_id=31

-- 
JR


Re: Can the mailing list owner set Reply-to field be [EMAIL PROTECTED]

2006-10-18 Thread Jean-Rene David
* A.J.Mechelynck [2006.10.18 23:30]:
 Reply to Sender is meant to reply only to the author of an email.
 
 Reply to All is meant to reply to the author and all other recipients.

Reply to All usually results in the author
receiving duplicates. However since most mailers
offer nothing but those two choices, it's probably
the lesser of evils. Most mail clients suck.

Decent mailers have Reply to list which avoids
sending replies to both the mailing list and the
author. Some mail clients suck less. 

;-)

-- 
JR


Re: search visual block

2006-10-17 Thread Jean-Rene David
* Lev Lvovsky [2006.10.17 17:15]:
 Is it possible to search for a string by
 selecting that string in  visual mode?  Meaning,
 if I highlight something, and then want to
 search for that thing which is highlighted in
 the rest of the doc?

You already got lots of good answers. Here's
another one.

I've had this in my vimrc for years, and use it
when the string I'm searching for is not a
keyword. It works both forward and backward, puts
the searched pattern in the search history and
doesn't screw up any register.

-- cut here ---
 Search for visually selected text {{{
 From an idea by Michael Naumann, Jürgen Krämer.
function! VisualSearch(direction) range
   let l:saved_reg = @
   execute normal! vgvy
   let l:pattern = escape(@, '\\/.*$^~[]')
   let l:pattern = substitute(l:pattern, \n$, , )
   if a:direction == 'b'
  execute normal ? . l:pattern . 

   else
  execute normal / . l:pattern . 

   endif
   let @/ = l:pattern
   let @ = l:saved_reg
endfunction

vnoremap silent * :call VisualSearch('f')CR
vnoremap silent # :call VisualSearch('b')CR
-- cut here ---

HTH,

-- 
JR 
[who has a vague remembrance that this subject has
come up before]


Re: How to directly enter visual mode from insert mode ?

2006-10-03 Thread Jean-Rene David
* Ivan Vecerina [2006.10.03 12:15]:
 [...]
 Best case, I can type:   ESClv
 [...]
 Is there an easy way to do so ?

According to 

:h i_esc

there is not builtin way to do this. But you could
use a mapping:

imap F8 esclv

-- 
JR


Re: Specifying vim options in the files being edited

2006-09-08 Thread Jean-Rene David
* Russell Bateman [2006.09.08 15:30]:
 You see that pretty well anything you can do on
 the ex command line in Vim (:set ignorecase,
 etc.), you can put in these modelines. 

That's not true. You can only set options.

Excerpt from :help modeline:

   No other commands than set are supported, for
   security reasons (somebody might create a
   Trojan horse text file with modelines).

-- 
JR


Sharing vimproject file between WinXP and cygwin

2006-07-19 Thread Jean-Rene David
I've been using the Project plugin for many years
now and I like it a lot. However one problem keeps
bugging me.

I would like to share my ~/.vimprojects file
between my cygwin and windows version of vim.

The problem is the paths for the project. When I
enter a posix path, the windows version doesn't
recognize it and vice-versa. I could run the file
through a small script which converts the paths
with cygpath but keeping them synchronized would
be cumbersome.

Any ideas?

-- 
JR