Possible bug in localtion list

2010-09-03 Thread Dominique Pellé
Hi

Here something which may be a bug with the location list.

This works:

$ cd vim/src
$ vim -u NONE -N \
   -c 'setlocal errorformat=%f:%l:%c:%m' \
   -c 'laddexpr buffer.c:2:1:xxx' \
   -c 'laddexpr buffer.c:5:1:yyy' \
   -c 'lopen' buffer.c

Pressing Enter on line buffer.c|2 col 1| xxx in location-list window
jumps to line 2 in buffer.c (good).

This does not work:

$ cd vim/src
$ vim -u NONE -N \
   -c 'setlocal errorformat=%l:%c:%m' \
   -c 'laddexpr 2:1:xxx' \
   -c 'laddexpr 5:1:yyy' \
   -c 'lopen' buffer.c

Pressing Enter on line 2|1| xxx for example in location-list jumps
to file 2. I would expect it to jump to line 2 in file buffer.c.

Is this a bug?  Or is specifying %f mandatody in errorformat?

Regards
-- Dominique

-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


[bug?] \zs in regex not working with :syn match ...

2010-09-03 Thread Dominique Pellé
Given the fillowing text in a buffer:

ABCDEF
GHIJKL

The following command does not highlight anything
and I don't see why:

:syn clear | syn match Error 'DEF\_.\zsGHI'

Nothing is highlighted.  I would expect GHI to be highlighted.

Is it a bug?

You can reproduce it with:

$ (echo ABCDEF; echo GHIJKL) | \
  vim -u NONE -N \
-c 'syntax on' \
-c :syn clear | syn match Error 'DEF\_.\zsGHI' -

If I remove \zs (start of match) then text is highlighted as expected:

  :syn clear | syn match Error 'DEF\_.GHI'

If I use \ze, then text is also highlighted as expected:

  :syn clear | syn match Error 'DEF\_.\zeGHI'

But somehow it does not work when I try to use \zs.
I'm using Vim-7.3.3 on Linux x86.

-- Dominique

-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Re: [bug?] \zs in regex not working with :syn match ...

2010-09-03 Thread Jürgen Krämer

Hi,

Dominique Pellé schrieb:
 Given the fillowing text in a buffer:
 
 ABCDEF
 GHIJKL
 
 The following command does not highlight anything
 and I don't see why:
 
 :syn clear | syn match Error 'DEF\_.\zsGHI'
 
 Nothing is highlighted.  I would expect GHI to be highlighted.
 
 Is it a bug?
 
 You can reproduce it with:
 
 $ (echo ABCDEF; echo GHIJKL) | \
   vim -u NONE -N \
 -c 'syntax on' \
 -c :syn clear | syn match Error 'DEF\_.\zsGHI' -
 
 If I remove \zs (start of match) then text is highlighted as expected:
 
   :syn clear | syn match Error 'DEF\_.GHI'
 
 If I use \ze, then text is also highlighted as expected:
 
   :syn clear | syn match Error 'DEF\_.\zeGHI'
 
 But somehow it does not work when I try to use \zs.
 I'm using Vim-7.3.3 on Linux x86.

there is a note in :help syntax.txt at line 3567 (Vim 7.3.3):

  - The start of a match cannot be in a line other than where the pattern
matched.  This doesn't work: a\nbms=e.  You can make the highlighting
start in another line, this does work: a\nbhs=e.

This seems to talk about the ms-flag, but it might be relevant to your
case, too.

Regards,
Jürgen

-- 
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)

-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Re: tab name in MacVim

2010-09-03 Thread mitch
It looks like :set guitablabel=%t guitabtooltip=%F should do what I
want.  It would be nice to see the simple file name as the label
visible all the time, and the full path as the tooltip.  But the
tooltip isn't working.  It almost looks like guitabtooltip doesn't
work with macvim.  Does anybody know about this, or is there something
I have to do to set it up to work?  Thanks.


On Sep 2, 8:35 pm, sc tooth...@swbell.net wrote:
 On Thursday 02 September 2010 18:14:41 ZyX wrote:

  I think that 'tabline' and 'guitablabel' options are more
  suitable in this case.

 oops -- he did say title of the tab didn't he -- my bad

 sc

-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Possible bug with wildcard expansion patterns on command line: question mark (match any single character) metacharacter doesn't seem to work

2010-09-03 Thread Stahlman Family

According to the help on cmdline-completion...

The 'wildchar' option defaults to Tab (CTRL-E when in Vi compatible 
mode; in a previous version Esc was used).  In the pattern standard 
wildcards '*' and '?' are accepted.  '*' matches any string, '?' matches 
exactly one character.


The ? doesn't work for me. If I do...

set gui*Tab

...I get option completion as expected. If, on the other hand, I do...

set gui?ptionsTab

...Vim doesn't attempt any completion, but simply inserts a literal tab 
(^I) at the cursor position on the command line. Shouldn't I get a 
completion in the second case also?


Thanks,
Brett Stahlman


--
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Re: Is there an autocmd for when buffer modified flag changed?

2010-09-03 Thread Ben Fritz


On Sep 2, 3:17 am, Aarto Matti aarto.ma...@gmail.com wrote:
 On Thu, Sep 2, 2010 at 10:23 AM, Aarto Matti aarto.ma...@gmail.com wrote:

  I'm using MiniBufExplorer, and I want it's buffer to be updated
  whenever buffer's modified flag ([+] in statusline) gets changed, but I
  couldn't find an appropriate autocmd for it. There is FileChangedRO event,
  but why it's only for read-only files? So, I added this au to my .vimrc:


 I used a combination of CursorMoved, CursorMovedI, BufWritePost
 and FileWritePost.


Personally, I'd use CursorHold and CursorHoldI. I'd store off the old
value of modified and compare it to the current value in these
events. You could add the CursorMoved events too if you really wanted
but I think that's not really necessary.

-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


external compiler output into window/buffer/quickfix from vim

2010-09-03 Thread Jeri Raye

Hi,

I'm experimenting in getting my compiler output redirected into vim, 
while editing my file to get it bugfree.


When I compile my file in my other program the command is as below:

vcom -work work -2002 -explicit C:/projects/iic_slave_pa_a0.vhd

In this line you can see that:
1) vcom is the external compiler
2) -work work -2002 -explicit are the given arguments (without the 
double qoute signs )

3) C:/projects/iic_slave_pa_a0.vhd is the file that is compiled.

In the program the output is something like this:
# Model Technology ModelSim ALTERA vcom 6.5b Compiler 2009.10 Oct  1 2009
# -- Loading package standard
# -- Loading package textio
# -- Loading package std_logic_1164
# -- Loading package std_logic_textio
# -- Loading package std_logic_arith
# -- Loading package std_logic_unsigned
# -- Compiling entity cntrlio_module
# -- Compiling architecture rtl of cntrlio_module
# -- Compiling entity iic_state
# -- Compiling architecture a0 of iic_state
# -- Compiling entity iic_in
# -- Compiling architecture a0 of iic_in
# -- Compiling entity iic_bundle
# -- Compiling architecture a0 of iic_bundle
# -- Compiling entity iic_sync
# -- Compiling architecture a0 of iic_sync
# -- Compiling entity iic_divide
# -- Compiling architecture a0 of iic_divide
# -- Compiling entity iic_init
# -- Compiling architecture rtl of iic_init
# -- Compiling entity iic_register_map
# -- Compiling architecture structure of iic_register_map
# -- Compiling entity iic_88_default
# -- Compiling architecture rtl of iic_88_default
# -- Compiling entity from7to14addresslines
# -- Compiling architecture rtl of from7to14addresslines
# -- Compiling entity iic_io_cntrl
# -- Compiling architecture a0 of iic_io_cntrl
# -- Compiling entity cntrl_module
# -- Compiling architecture structure of cntrl_module
# -- Compiling entity iic_slave_pa_a0
# -- Compiling architecture a0 of iic_slave_pa_a0


If I'm editing my file iic_slave_pa_a0.vhd in vim and I want to 
compile it, how should I call this external compiler with these arguments?


I've come this far, but this still doesn't work:

nmap F9 :set makeprg=vcom\ %CR!make [-work work 2002 -explicit] 1CR

What's wrong with this?

I'm using Windows XP and gvim 7.3, included patches 1-3

Rgds,
Jeri







--
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Re: external compiler output into window/buffer/quickfix from vim

2010-09-03 Thread Gary Johnson
On 2010-09-03, Jeri Raye wrote:
 Hi,
 
 I'm experimenting in getting my compiler output redirected into vim, 
 while editing my file to get it bugfree.
 
 When I compile my file in my other program the command is as below:
 
 vcom -work work -2002 -explicit C:/projects/iic_slave_pa_a0.vhd
 
 In this line you can see that:
 1) vcom is the external compiler
 2) -work work -2002 -explicit are the given arguments (without the 
 double qoute signs )
 3) C:/projects/iic_slave_pa_a0.vhd is the file that is compiled.
 
 In the program the output is something like this:
 # Model Technology ModelSim ALTERA vcom 6.5b Compiler 2009.10 Oct  1 2009
 # -- Loading package standard
...
 # -- Compiling entity iic_slave_pa_a0
 # -- Compiling architecture a0 of iic_slave_pa_a0
 
 
 If I'm editing my file iic_slave_pa_a0.vhd in vim and I want to 
 compile it, how should I call this external compiler with these arguments?
 
 I've come this far, but this still doesn't work:
 
 nmap F9 :set makeprg=vcom\ %CR!make [-work work 2002 -explicit] 1CR
 
 What's wrong with this?

I don't know what you are trying to do with the [ and ], but they
shouldn't be there.

Since the compiler needs the file's extension, the file name
argument should be % and not %.

If you want to use Vim's :make command, then you need to execute
:make, not :!make.

Vim takes care of output redirection, so the 1 should not be
there.

To fix this, first of all I would put all the compiler options into
'makeprg' and set 'makeprg' once rather than each time you compile.

:set makeprg=vcom\ -work\ work\ -2002\ -explicit\ %

Then to compile your file, just execute

:make

or if you want to just hit F9, map F9 like this:

:map F9 :makeCR

You will probably have to change 'errorformat' to recognize the
output format of your compiler as well, but I don't know what your
compiler's error messages look like.

HTH,
Gary

-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


The result of :grep in the quickfix list can not jump to files

2010-09-03 Thread H Xu

 Hello everybody,

When I use :grep, I was confused that why I can't jump to the file from the
quickfix list. For example, when I use :grep aaa *, I get the 
following result:


|| 29:   aaa.bbb load aaa and then bbb.
|| 25:   aaa.bbb load indent/aaa.vim and then indent/bbb.vim.
|| Binary file libiconv2.dll matches
|| Binary file python26.dll matches

My vim version is 7.3, Windows.

Regards,
Hong Xu
2010/9/3

--
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Re: tab name in MacVim

2010-09-03 Thread mitch
The latest one here is still 7.2

http://code.google.com/p/macvim/downloads/list

where is 7.3?

On Sep 3, 9:11 am, björn bjorn.winck...@gmail.com wrote:

 I can't remember if 'guitabtooltip' is supported with the (ancient)
 version of MacVim you are using.  If you upgrade to MacVim 7.3 [1] it
 will work (nb. requires 10.5+, I haven't built a 10.4 version yet).
 Oh, and that version has the following default:

 set guitablabel=%M%t

 which is a lot more pleasant than the default behavior in 7.2.

 Björn

 [1]http://code.google.com/p/macvim/

-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Re: The result of :grep in the quickfix list can not jump to files

2010-09-03 Thread Marc Weber
Excerpts from H Xu's message of Fri Sep 03 20:04:49 +0200 2010:
   Hello everybody,
 
 When I use :grep, I was confused that why I can't jump to the file from the
 quickfix list. For example, when I use :grep aaa *, I get the 
 following result:
 
 || 29:   aaa.bbb load aaa and then bbb.
 || 25:   aaa.bbb load indent/aaa.vim and then indent/bbb.vim.
 || Binary file libiconv2.dll matches
 || Binary file python26.dll matches

THere are two components which must fit:
echo grepprg (the command producing the output)
echo grepformat (the format parsing the grep locations)

my grepprg is grep -n $* /dev/null 
my grepformat is %f:%l:%m,%f:%l%m,%f  %l%m

which work nicely with gnu grep.

Your output does not seem to include a filename (?).

Marc Weber

-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Vim for code navigation

2010-09-03 Thread vtadipatri
  I really want to learn to use vi for navigating through code files.
But I'm running into a couple of issues:
To jump to a tag I think I should use ctrl+], but if I've changed
the file it keeps prompting me that I need to use ! to override. I
know
I can use '!' for one of the colon commands. How do I do it for ctrl
+]?
Also, I don't want it to blindly jump to the code - if there are
multiple
 matches i want to choose where to go.
 I tried using :ts and :ta but it seems like that's not what I
want
either since it jumps to what's already on the stack. Maybe I need to
make a vi shortcut to push the function I want to go to onto the
stack,
close the new buffer so the tag is still on the stack, then jump to
the
tag that's at the top of the stack?  And also when I close one buffer
(with :bd), it doesn't seem to go back to the position on the line I
last left off on, so maybe I need to make a mark before jumping to
the
function, so I can get back to it?  This seems really cumbersome, and
I'm sure navigating through functions is easier than that.
Again, the difficulty is that I want to step into a function
without
writing the file that I'm on. I could probably open it with ctrl+w,
then
maximize it. Then when I want to get back, I can just close the
window
instead of popping it off the stack. If I open the function in a new
window with ctrl+w, then hitting ctrl+t on the code I jumped to
results
in the same code appearing in 2 windows, top and bottom.

Thanks,
Ven

-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Re: Vim for code navigation

2010-09-03 Thread Reid Thompson
On Fri, 2010-09-03 at 09:35 -0700, vtadipatri wrote:
 I really want to learn to use vi for navigating through code files.
 But I'm running into a couple of issues:
 To jump to a tag I think I should use ctrl+], but if I've changed
 the file it keeps prompting me that I need to use ! to override. I
 know
 I can use '!' for one of the colon commands. How do I do it for ctrl
 +]?
 Also, I don't want it to blindly jump to the code - if there are
 multiple
  matches i want to choose where to go.
  I tried using :ts and :ta but it seems like that's not what I
 want
 either since it jumps to what's already on the stack. Maybe I need to
 make a vi shortcut to push the function I want to go to onto the
 stack,
 close the new buffer so the tag is still on the stack, then jump to
 the
 tag that's at the top of the stack?  And also when I close one buffer
 (with :bd), it doesn't seem to go back to the position on the line I
 last left off on, so maybe I need to make a mark before jumping to
 the
 function, so I can get back to it?  This seems really cumbersome, and
 I'm sure navigating through functions is easier than that.
 Again, the difficulty is that I want to step into a function
 without
 writing the file that I'm on. I could probably open it with ctrl+w,
 then
 maximize it. Then when I want to get back, I can just close the
 window
 instead of popping it off the stack. If I open the function in a new
 window with ctrl+w, then hitting ctrl+t on the code I jumped to
 results
 in the same code appearing in 2 windows, top and bottom.
 
 Thanks,
 Ven
 

investigate using cscope with [g]vim.

-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Re: tab name in MacVim

2010-09-03 Thread Israel Chauca F.

On Sep 3, 2010, at 2:25 PM, mitch wrote:

 The latest one here is still 7.2
 
 http://code.google.com/p/macvim/downloads/list
 
 where is 7.3?

http://github.com/b4winckler/macvim/downloads

Cheers,
Israel

-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Re: Vim for code navigation

2010-09-03 Thread Ben Fritz


On Sep 3, 11:35 am, vtadipatri vtadipa...@gmail.com wrote:
   I really want to learn to use vi for navigating through code files.
 But I'm running into a couple of issues:
     To jump to a tag I think I should use ctrl+], but if I've changed
 the file it keeps prompting me that I need to use ! to override. I
 know
 I can use '!' for one of the colon commands. How do I do it for ctrl
 +]?
 Also, I don't want it to blindly jump to the code - if there are
 multiple
  matches i want to choose where to go.
      I tried using :ts and :ta but it seems like that's not what I
 want
 either since it jumps to what's already on the stack.

If you give either of these commands an argument, it will jump to that
tag instead of the current top of the stack.

You can make a mapping or just press CTRL-R followed by CTRL-W to
automatically get the word under the cursor.

Actually, you probably want the :tjump command. Or even better, just
set the 'cscopetag' option (a little counter-intuitive) and CTRL-]
will act like :tjump instead of like :tag.

-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


question about cursor line positioning and :view! or :edit!

2010-09-03 Thread Osho GG
Hi,

I have a question about cursor line positioning after doing :view! or
:edit!. Currently, when I do :edit! or :view! for a file, the line
that the cursor is on, is centered in the buffer in the vim. What do I
need to do to make sure that when I do :view! or :edit! - the position
of the line on which the cursor is does not change in the buffer? Is
there a quick setting to achieve this behavior?

Thanks,
Osho

-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


RE: Vim for code navigation

2010-09-03 Thread John Beckett
vtadipatri wrote:
 To jump to a tag I think I should use ctrl+], but if I've
 changed the file it keeps prompting me that I need to use !
 to override.

You do not want '!' because if you managed to use it, your
changes to the file would be lost. You need to do some reading
about buffers and the 'hidden' option. Try:
http://vim.wikia.com/wiki/Easier_buffer_switching

 Also, I don't want it to blindly jump to the code - if there
 are multiple  matches i want to choose where to go.

Instead of Ctrl-] type:
g Ctrl-]

John

-- 
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Re: The result of :grep in the quickfix list can not jump to files

2010-09-03 Thread H Xu

 On 2010/9/4 3:26, Marc Weber wrote:

Excerpts from H Xu's message of Fri Sep 03 20:04:49 +0200 2010:

   Hello everybody,

When I use :grep, I was confused that why I can't jump to the file from the
quickfix list. For example, when I use :grep aaa *, I get the
following result:

|| 29:   aaa.bbb load aaa and then bbb.
|| 25:   aaa.bbb load indent/aaa.vim and then indent/bbb.vim.
|| Binary file libiconv2.dll matches
|| Binary file python26.dll matches

THere are two components which must fit:
echogrepprg (the command producing the output)
echogrepformat (the format parsing the grep locations)

my grepprg is grep -n $* /dev/null
my grepformat is %f:%l:%m,%f:%l%m,%f  %l%m

which work nicely with gnu grep.

Your output does not seem to include a filename (?).

Marc Weber


Hello,

I have solved this problem. My grepprg is grep -nh $*, so there is no 
file name.

Thank you very much.

Regards,
Hong Xu
2010/9/4

--
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


examinee is regarded as an incorrect word in vim

2010-09-03 Thread H Xu

 Hello,

The word examinee is regarded as an incorrect word when spell check is
on, while it is a very common word. Is this a bug?

Regards,
Hong Xu
09/04/2010

--
You received this message from the vim_use maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php