Thursday, January 31, 2013

Re: Syntax highlight not happening on :newtab

On Fri, February 1, 2013 05:51, naaj_ila wrote:
> Hi Gary ,
>
> Thanks for the reply.
> By default, when i used "which vim" . It shows "/usr/<comp_name>/bin/vim"
> .
> I didnot like taht version of vim .
> So in my .cshrc file i used an alias like this
>
> "alias vim /usr/<comp_name>/pkgs/vim/7.2/bin/vim" . I liked this version.
>
> Is this effecting anyways?

Possibly.

It would help, if you started answering the questions,
that have been asked. Try to redo the examples given by Gary in
<20130131162709.GA1644@phoenix> and show us the result.

BTW: Where did you get the verilog.vim file from (there should be
some installation instructions other then drop into your .vim
directory, this is usually just plain wrong)? And what is wrong
with the one that is bundled with vim?

regards,
Christian

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Sorting multiple "sections"

On Fri, February 1, 2013 06:49, Chris Lott wrote:
> I have various markdown documents with with lists contained in sections
> like so:
>
> One Section
> --------
>
> * list item 1
> * another
> * etc
>
> Second Section
> ----------
>
> * more list items
> * etc
>
> The sections are always formatted as the above (level 2 markdown
> headers); the lists are of variable length.
>
> What I need to do is figure the most efficient way to sort each list
> in each section alphabetically.
>

You can combine a :g command with the sort command, e.g. something like
this:
:g/^-\+$/+2;'}-sort
Which selects the range from just 1 line after the '----' lines
until the the last list item and sort them accordingly.

(Interestingly ':g/^-\+$/+2,'}-sort' (comma instead of semicolon)
gives an error. Not sure, why this happens).

regards,
Christian

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Sorting multiple "sections"

I have various markdown documents with with lists contained in sections like so:

One Section
--------

* list item 1
* another
* etc

Second Section
----------

* more list items
* etc

The sections are always formatted as the above (level 2 markdown
headers); the lists are of variable length.

What I need to do is figure the most efficient way to sort each list
in each section alphabetically.

Thoughts?

c
--
Chris Lott <chris@chrislott.org>

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Syntax highlight not happening on :newtab

Hi Gary ,

Thanks for the reply.
By default, when i used "which vim" . It shows "/usr/<comp_name>/bin/vim" .
I didnot like taht version of vim .
So in my .cshrc file i used an alias like this

"alias vim /usr/<comp_name>/pkgs/vim/7.2/bin/vim" . I liked this version.

Is this effecting anyways?





--
View this message in context: http://vim.1045645.n5.nabble.com/VIM-loses-syntax-highlighting-when-using-split-command-tp5713478p5713517.html
Sent from the Vim - General mailing list archive at Nabble.com.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: How to make search with 'wrapscan' more convenient?

On Jan 31, 3:42 am, Tim Chase <v...@tim.thechases.com> wrote:
> On Wed, 30 Jan 2013 20:05:06 -0800 (PST) Bee <fo...@calcentral.com>
> wrote:
>
> > On Jan 30, 11:00 am, Tim Chase <v...@tim.thechases.com> wrote:
> > >   :g/pattern/#
>
> > > number them (which then usually
> > > leads to a jump to the line in question with something like 314G).
>
> > Where is that documented?
>
> It's a combination of
>
>   :help :g
>
> with the "#" ex command:
>
>   :help :#
>
> -tim

Ah, thank you...
I tried
:help #

Forgot about using : for commands.

Bill

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Updating Syntax menu

So, would this imply that the Syntax menu should only be updated when a new version is compiled?

I hink i'm going to keep a copy of the files i updated, probably putting them in the directory that does not get changed, along with a README, for myself, to remind me how to update this file.

Thanks,

Russ

> Hm, after some more searching, I could find no "makemenu.vim" at any
> depth under $VIMRUNTIME in the Vim distribution. Where I see it is in
> the source, at ./runtime/makemenu.vim, and it says it is used by "make
> menu" in the src directory, which implies a compile-time rather than
> run-time use.
>
> I suppose you might create an unnamed branch in your hg clone, with your
> modified runtime/makemenu.vim, and then use
>
> cd src
> # source any script to set config settings
> make menu
>
> to generate the menu.
>
> See also
> hg help branch
> http://vim.wikia.com/wiki/Getting_the_Vim_source_with_Mercurial
> http://users.skynet.be/antoine.mechelynck/vim/compunix.htm
>
> The above assumes a Unix-like OS. I'm not sure which differences (if
> any) would be required to generate the menus on Windows. It may or may
> not depend on which compiler you use to compile Vim.
>
>
> Best regards,
> Tony.
> --
> "Even if you're on the right track, you'll get run over if you just sit
> there."
> -- Will Rogers
>
> --
> --
> 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
>
>
>

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Powerline and terminal issues

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRCtIlAAoJEFDgLr75E3sPorMH/imI+UMfCkZFmLyR7RUOz3/f
cvyVglGmbT6+ea/frfq7r7t2wvLaq9xEjFYwT5HlLi7C1lQOxn3xoXCkVpDzrCKF
9Gxtv/HcKtqdGDnTCDi+A0aNt7onQGe1DdFWz91TxWkCA7HSIzy8DwPj8fYl8oem
Y1AQC/fCPysXeuhmeFg7kAkcjwlgI3pCXE0Lqw1Wf5RK0IbOeimiAcKv+RvlRiiJ
jUCztM1gT6Rlidou8BCxZqZRdPzYuPgL5LHzH0ELetWVL0D0j8epu4WBjThX73f7
JUkChkkZJb2PqU2Z6m3M3GpNsU1N0PmGLZcfdR+mea+gbeAv5rKRWwch+pF4CkQ=
=fVO8
-----END PGP SIGNATURE-----
On 01/31/2013 08:14 PM, Marco wrote:

> Hi,
>
> this might be the wrong mailing list for my issue. However, I think
> that many of you use a very similar setup and might have an idea how
> to solve it.
>
> I use the vim-powerline plugin. The problem is that in rxvt-unicode
> it does not show up properly. The background colour is not applied,
> see the attached screenshots. The appearance is fine in gVim, xterm
> and in urxvt with tmux, but not in plain urxvt.
>
> The screenshots show the output of :echo $TERM. I assume that I did
> not configure my urxvt correctly. Any ideas?

There are several issues on GitHub concerning similar problems with
rxvt-unicode: example <https://github.com/Lokaltog/powerline/issues/121>

It may be worthwhile opening a new one if you can't find the answer
you're looking for there.

Cheers,

Phil...

--
currently (ab)using
CentOS 5.8 & 6.3, Debian Squeeze & Wheezy, Fedora Beefy & Spherical,
Lubuntu 12.10, OS X Snow Leopard & Ubuntu Precise & Quantal

Powerline and terminal issues

Hi,

this might be the wrong mailing list for my issue. However, I think
that many of you use a very similar setup and might have an idea how
to solve it.

I use the vim-powerline plugin. The problem is that in rxvt-unicode
it does not show up properly. The background colour is not applied,
see the attached screenshots. The appearance is fine in gVim, xterm
and in urxvt with tmux, but not in plain urxvt.

The screenshots show the output of :echo $TERM. I assume that I did
not configure my urxvt correctly. Any ideas?

Marco

Re: Syntax highlight not happening on :newtab

On 2013-01-31, Ben Fritz wrote:
> On Thursday, January 31, 2013 12:01:53 PM UTC-6, Gary Johnson wrote:
> >
> > The "filetype on" command is not needed for "syntax on" to work.
> >
>
> But, doesn't Vim use the filetype to figure out which syntax file to load?

Yes, but if filetype detection is not already enabled when "syntax
on" is executed, the syntax system enables it itself.

The command "syntax on" sources the file
$VIMRUNTIME/syntax/syntax.vim. You can see in that file where
"filetype on" is executed.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Syntax highlight not happening on :newtab

On Thursday, January 31, 2013 12:01:53 PM UTC-6, Gary Johnson wrote:
>
> The "filetype on" command is not needed for "syntax on" to work.
>

But, doesn't Vim use the filetype to figure out which syntax file to load?

From the help:

*:filetype* *:filet*
To enable file type detection, use this command in your vimrc: >
:filetype on
Each time a new or existing file is edited, Vim will try to recognize the type
of the file and set the 'filetype' option. This will trigger the FileType
event, which can be used to set the syntax highlighting, set options, etc.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Syntax highlight not happening on :newtab

On 2013-01-31, Ben Fritz wrote:

> Is filetype detection turned on in your .vimrc?
>
> Some systems turn it on by default in a "system .vimrc" but others do not.
>
> Try putting
>
> filetype plugin indent on
>
> or
>
> filetype plugin on
>
> or
>
> filetype indent on
>
> or
>
> filetype on
>
> into your .vimrc, before the "sytnax on" command.
>
> :help :filetype
> :help :filetype-overview
> :help filetype-detect

The "filetype on" command is not needed for "syntax on" to work.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Syntax highlight not happening on :newtab

On Thursday, January 31, 2013 3:24:59 AM UTC-6, ali jaan wrote:
> Hi Gary ,
>
> Followed the steps which you had given,
>
> but its not working
>
> Even opening the single file is not having the syntax enabled .
>

Is filetype detection turned on in your .vimrc?

Some systems turn it on by default in a "system .vimrc" but others do not.

Try putting

filetype plugin indent on

or

filetype plugin on

or

filetype indent on

or

filetype on

into your .vimrc, before the "sytnax on" command.

:help :filetype
:help :filetype-overview
:help filetype-detect

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Syntax highlight not happening on :newtab

On 2013-01-31, naaj_ila wrote:
> Hi Gary ,
> Followed the steps which you had given,
> but its not working
> Even opening the single file is not having the syntax enabled .

I just tried the following experiments. I first created a ~/file1.v
from your example, then copied the default verilog.vim to my ~/.vim
hierarchy:

cp /usr/local/share/vim/vim73/syntax/verilog.vim ~/.vim/syntax

1.
vim -N -u NONE --cmd 'syntax on' file1.v

The file was syntax highlighted.

:scriptnames
1: /usr/local/share/vim/vim73/syntax/syntax.vim
2: /usr/local/share/vim/vim73/syntax/synload.vim
3: /usr/local/share/vim/vim73/syntax/syncolor.vim
4: /usr/local/share/vim/vim73/filetype.vim
5: ~/.vim/syntax/verilog.vim
6: /usr/local/share/vim/vim73/syntax/verilog.vim

2.
Created a file2.v identical to file1.v with Hello changed to
Goodbye.

Moved my ~/.vimrc asided and created a new one containing only

syntax on

Executed

vim file1.v
:split file2.v

Both buffers are highlighted.

Something in your configuration is keeping file1.v from being
properly syntax highlighted. It works for me with my normal
configuration and with a minimal configuration with just "syntax
on". We just need to find out what in your configuration is keeping
this from working for you.

One approach is for you to start with a minimal configuration, get
highlighting to work, then add pieces of your normal configuration
until highlighting stops.

Why are you using your own verilog.vim instead of the default
$VIMRUNTIME/syntax/verilog.vim?

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: How to make search with 'wrapscan' more convenient?

On Wed, 30 Jan 2013 20:05:06 -0800 (PST) Bee <forth@calcentral.com>
wrote:

> On Jan 30, 11:00 am, Tim Chase <v...@tim.thechases.com> wrote:
> >   :g/pattern/#
> >
> > number them (which then usually
> > leads to a jump to the line in question with something like 314G).
>
> Where is that documented?

It's a combination of

:help :g

with the "#" ex command:

:help :#

-tim


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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

gtk-vim-syntax

Hi,
I am using gtk-vim-syntax. As directed, I have copied it and :run
glib.vim which highlights my glib commands.
I tried to enable gtk3 as well by :run gtk3.vim but that is not
highlighted.

A screenshot to explain this is at http://imagebin.org/244914



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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Syntax highlight not happening on :newtab

Hi Gary ,
Followed the steps which you had given,
but its not working
Even opening the single file is not having the syntax enabled .




--
View this message in context: http://vim.1045645.n5.nabble.com/VIM-loses-syntax-highlighting-when-using-split-command-tp5713478p5713503.html
Sent from the Vim - General mailing list archive at Nabble.com.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Syntax highlight not happening on :newtab

On 2013-01-30, naaj_ila wrote:
> In my home directory
> "verilog.vim" file is there, which defines syntax highlighting whnever we
> will open <filename>.v files.
> In .vimrc , i added "source ~/verilog.vim" .
>
> Example: file1.v
> module test ;
> $display("Hello");
> endmodule
>
> "module", "display" are keywords and they will be in colour/highlighted .
>
> Whenever a single file(say file1.v) is opened , its working fine (syntax
> highlight is working)
>
>
> whne i opened another file(file2.v) in the file1.v using ":sp file2.v" or
> ":newtab file2.v"
> For file2.v syntax highlight is not enabled/working , file1.v syntax is
> still OK.

Syntax files such as your verilog.vim contain :syntax commands that
assign colors to patterns. The scope of those :syntax commands is
the current buffer. (I can't find that in the documentation.) When
you open a new buffer, the :syntax commands from the original buffer
are not applied to the new buffer.

When you start vim to open a file, the "source ~/verilog.vim"
command in your ~/.vimrc executes a number of :syntax commands that
apply colors to the contents of that first buffer. When you open
another file, that file is opened into a new buffer that has no
:syntax commands applied to it, so you see no colors.

The problem is that you are not using Vim's syntax highlighting
facility as it was designed to be used. You are throwing commands
into your ~/.vimrc and hoping for the best. You should probably
read

:help usr_06.txt
:help usr_43.txt

To fix this problem, you need to:

1. Move ~/verilog.vim to ~/.vim/syntax/verilog.vim where it
belongs;

2. Remove the "source ~/verilog.vim" command from your ~/.vimrc;

3. Add to your ~/.vimrc the command "syntax on".

Vim already knows that the .v suffix means that the file type is
verilog.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Wednesday, January 30, 2013

Re: Syntax highlight not happening on :newtab

In my home directory
"verilog.vim" file is there, which defines syntax highlighting whnever we
will open <filename>.v files.
In .vimrc , i added "source ~/verilog.vim" .

Example: file1.v
module test ;
$display("Hello");
endmodule

"module", "display" are keywords and they will be in colour/highlighted .

Whenever a single file(say file1.v) is opened , its working fine (syntax
highlight is working)


whne i opened another file(file2.v) in the file1.v using ":sp file2.v" or
":newtab file2.v"
For file2.v syntax highlight is not enabled/working , file1.v syntax is
still OK.





--
View this message in context: http://vim.1045645.n5.nabble.com/Syntax-highlight-not-happening-on-newtab-filename-tp5713478p5713501.html
Sent from the Vim - General mailing list archive at Nabble.com.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: How to make search with 'wrapscan' more convenient?

On Jan 30, 11:00 am, Tim Chase <v...@tim.thechases.com> wrote:
>   :g/pattern/#
>
> number them (which then usually
> leads to a jump to the line in question with something like 314G).

Where is that documented?

Bill

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: How to determine the start of a visual block (C-V) when it starts in the void?

On Thursday, January 31, 2013 5:02:56 AM UTC+13, Ben Fritz wrote:
>...BECAUSE THE : ENDS VISUAL MODE. ... Visual mode is over. Done. Complete...

Yes, but it is still showing in the window. Not that I'd want it not to, but the situation is a little murky, in that what you see is not what you get.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Download counter of Vim scripts no longer incremented?

Hi

The Vim scripts at http://www.vim.org/scripts/index.php
show something like...

script karma Rating 166/43, Downloaded by 513

I've noticed in the last few days that the download
counters are no longer incremented. It seems to
affect all scripts.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: How to make search with 'wrapscan' more convenient?

On Wed, 30 Jan 2013 03:21:11 -0800 (PST) Wiktor Ruben
<smieciarski@gmail.com> wrote:
> My current workflow is to set 'nowrapscan', then mark my current
> position with 'mm', then 'gg' and doing 'n' until Vim displays
> 'search hit bottom, without match for foo'. Then I do '`m' to get
> back where I were before search. How can I improve it?

While I've experienced the same want for a "wrapscan from where my
search started" sort of option, and I don't have a good solution, in
such cases I sometimes use either

:g/pattern

or

:g/pattern/#

to either just print the matches, or number them (which then usually
leads to a jump to the line in question with something like 314G).

You can modify the command to print a range of lines if needed:

:g/pattern/-5;+5#

or

:g/pattern/?{?,/}/#

to give some context.

So, while not a perfect answer, it works for most of my use cases.

-tim


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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: ctags processing jumps to wrong tag?

On Wednesday, January 30, 2013 12:02:19 PM UTC-6, Ben Fritz wrote:
>
> I found a reasonable workaround for my uses. Using the -B flag to ctags
> generation generates backwards search patterns from the end of the file,
> so always the last occurrence (the function definition) is found instead
> of always the first (the function prototype). This makes the prototype for
> these functions inaccessible via tag jumping, but normally I want the
> function definition anyway so it's less of an issue than the behavior
> without -B.
>
> I may experiment sometime to see if I can generating ONLY prototype tags
> and append them to a tags file generated without prototypes. Then I could
> use forward search for prototypes and backwards search for definitions.

Forward searching prototypes and backward searching functions is actually
really easy, I found. Just invoke ctags twice, as follows:

!"C:/Documents and Settings/ben/ctags58_win32/ctags.exe" --extra=+f --fields=+SK-k --totals -B %
!"C:/Documents and Settings/ben/ctags58_win32/ctags.exe" --extra=+f --fields=+SK-k --totals --c-kinds=p -a %

Now I can access both the prototype and the function definition regardless
of how similar the location pattern!

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: ctags processing jumps to wrong tag?

On Wednesday, January 30, 2013 10:35:44 AM UTC-6, Ben Fritz wrote:
>
> After some investigation, the root cause is that ctags by default uses
>
> a search pattern for the tag location. Thus when a function prototype
>
> and definition are spread over multiple lines, and the first line is
>
> the same for each, the tag location in the generated tags file uses an
>
> identical pattern.
>
>
>
> This is somewhat documented (but not explicitly):
>
>
>
> http://ctags.sourceforge.net/ctags.html#CAVEATS
>
>
>
> I see three ways to fix this:
>
>
>
> 1. Modify the file to force a difference between the prototype and
>
> function definition. Not really an option, files I edit are under
>
> strict change control and this would be a fairly pointless edit.
>
> 2. Move the prototypes into a header file. Not an option for the same
>
> reason as (1), and because the problem occurs mostly for "private"
>
> helper functions scoped to the file itself using the static keyword.
>
> 3. Generate tags using line numbers as locations, by adding
>
> --excmd=number to my ctags options. I don't like this method because
>
> then jumping to tags with an older tags file will miss frequently if
>
> the file has changed.
>
>
>
> Is there some unknown fourth option without the drawbacks of (3) that
>
> does not involve modifying the file itself?

I found a reasonable workaround for my uses. Using the -B flag to ctags generation generates backwards search patterns from the end of the file, so always the last occurrence (the function definition) is found instead of always the first (the function prototype). This makes the prototype for these functions inaccessible via tag jumping, but normally I want the function definition anyway so it's less of an issue than the behavior without -B.

> Just generating tags for
>
> prototypes using line numbers but using patterns for the rest of the
>
> tags would be a decent compromise, but I'm not sure how I'd accomplish
>
> that (if it's even possible).
>
>

I realized after some thought that this still wouldn't work, unless I also use backwards search. I may experiment sometime to see if I can generating ONLY prototype tags and append them to a tags file generated without prototypes. Then I could use forward search for prototypes and backwards search for definitions.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: How to determine the start of a visual block (C-V) when it starts in the void?

On Wednesday, January 30, 2013 10:35:21 AM UTC-6, Axel Bender wrote:
> Hi Christian,
>
> thanks for the answer. I completely go with you concerning <expr>, but this was not my original problem.
>
> In fact, I already have a solution for it (temporarily setting ve to "all"), which doesn't require me to change any mapping.
>
> However the inconsistency remains: when - with ve=block - I select a visual block and one corner is in the void, :<C-U>echo virtcol("'<") returns 1, while with ve set to "all" - the same command correctly(?) returns the start of the block.
>
> If - as Ben said - by moving into the command line - I've ended visual mode, then why doesn't this hold for both settings?

Because with ve=all, the cursor is allowed to be outside the real text lines even when not in visual mode.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: ctags processing jumps to wrong tag?

/* this function prototype spreads multiple lines, so there is no terminating
* ; character on the first line, so the tag definition is the same as the
* function definition
*/
int func1(
void);

/* this function prototype is all on a single line, so there is an obvious
* difference (the terminating ; character) in the tags file
*/
int func2(void);

int func1(
void)
{
return 1;
}

int func2(void)
{
return 2;
}
On Tuesday, January 29, 2013 10:48:00 AM UTC-6, Ben Fritz wrote:
> I generate CTags for C code with the following:
>
> " -R : recursive
> " --extra=+f : include file name as a tag
> " --fields=+S : include signature (e.g. parameter list)
> " K : include kind of tag as full name
> " -k : not kind of tag as single letter
> " --totals : print on standard output total number of tags, etc.
> " --c-kinds=+p : include function prototype in C code
> let ctags_command=Tlist_Ctags_Cmd.' -R --extra=+f --fields=+SK-k --totals --c-kinds=+p .'
>
> I have 'cscopetag' set, so that pressing CTRL-] on a tag name with multiple matches will prompt me before jumping.
>
> When I CTRL-] on a function name, I usually get 2 hits, one for the prototype, the other for the function. If both are in the same file, choosing either hit will jump to the prototype always.
>
> Does anyone else see this issue? Am I doing something wrong?

After some investigation, the root cause is that ctags by default uses
a search pattern for the tag location. Thus when a function prototype
and definition are spread over multiple lines, and the first line is
the same for each, the tag location in the generated tags file uses an
identical pattern.

This is somewhat documented (but not explicitly):

http://ctags.sourceforge.net/ctags.html#CAVEATS

I see three ways to fix this:

1. Modify the file to force a difference between the prototype and
function definition. Not really an option, files I edit are under
strict change control and this would be a fairly pointless edit.
2. Move the prototypes into a header file. Not an option for the same
reason as (1), and because the problem occurs mostly for "private"
helper functions scoped to the file itself using the static keyword.
3. Generate tags using line numbers as locations, by adding
--excmd=number to my ctags options. I don't like this method because
then jumping to tags with an older tags file will miss frequently if
the file has changed.

Is there some unknown fourth option without the drawbacks of (3) that
does not involve modifying the file itself? Just generating tags for
prototypes using line numbers but using patterns for the rest of the
tags would be a decent compromise, but I'm not sure how I'd accomplish
that (if it's even possible).

See attached test C file and generated tags file demonstrating this problem.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: How to determine the start of a visual block (C-V) when it starts in the void?

Hi Christian,

thanks for the answer. I completely go with you concerning <expr>, but this was not my original problem.

In fact, I already have a solution for it (temporarily setting ve to "all"), which doesn't require me to change any mapping.

However the inconsistency remains: when - with ve=block - I select a visual block and one corner is in the void, :<C-U>echo virtcol("'<") returns 1, while with ve set to "all" - the same command correctly(?) returns the start of the block.

If - as Ben said - by moving into the command line - I've ended visual mode, then why doesn't this hold for both settings?

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: How to determine the start of a visual block (C-V) when it starts in the void?

On Wed, January 30, 2013 16:49, Axel Bender wrote:
> Hi Ben,
>
> try this:
>
> xnoremap <silent> _C :<C-U>call SomeFunc()<CR> " My current
> mapping
> xnoremap <silent><expr>_D SomeFunc()<CR> " John's proposal

For expression mappings, you don't need the trailing <CR>, because
they don't execute the rhs of the mapping, but rather evaluate it.

> xnoremap <silent> _E SomeFunc()<CR> " same w/o <expr>

Not sure, what you are expecting here. This won't work.

>
> fun! SomeFunc()
> let col = virtcol("'<") - 1
> let ecol = virtcol("'>")
>
> for l in range(line("'<"), line("'>"))
> call setline(l, strpart(getline(l), col, ecol - col))
> endfor
> endf
>
> Select (ve=block) a visual block from "Fun" down to "ol ", the press _C,
> _D, and _E. Repeat the same (_C, _E) with an extended block (one line
> further down - in the void).

The problem is, expression-mappings are not allowed to change the
text, therefore they can't work exactly the same. To work around this
issue, they need to return what the user would type, which would then
be executed. E.g. for your usecase, use this function (there might
actually be better ways to achieve what you want, I haven't thought
about it):

xnoremap <silent> _C :<C-U>call SomeFunc()<CR> " My current mapping
xnoremap <silent><expr>_D SomeFunc1() " John's proposal

[匽

fun! SomeFunc1()
let col = virtcol("'<") - 1
let ecol = virtcol("'>")
let range= range(line("'<"), line("'>"))

let result=printf(": for l in %s|".
\ "call setline(l, strpart(getline(l), %d, %d))|".
\ "endfor", string(range), col, ecol-col)
return result
endf

regards,
Christian

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: How to determine the start of a visual block (C-V) when it starts in the void?

Please try it again w/o commenting out the stuff.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: How to determine the start of a visual block (C-V) when it starts in the void?

On Wednesday, January 30, 2013 9:49:52 AM UTC-6, Axel Bender wrote:
> Hi Ben,
>
> try this:
>
> xnoremap <silent> _C :<C-U>call SomeFunc()<CR> " My current mapping
> xnoremap <silent><expr>_D SomeFunc()<CR> " John's proposal
> xnoremap <silent> _E SomeFunc()<CR> " same w/o <expr>
>

This should be:
xnoremap <silent> _C :<C-U>call SomeFunc()<CR>
xnoremap <silent><expr>_D SomeFunc()

Your third mapping will never work, why do you expect it to? It is like pressing the keys S o m e F u n c ( ) and then <CR> in sequence, in visual mode. The S will replace the entire visual selection and enter the rest of the text in insert mode.

> fun! SomeFunc()
> let col = virtcol("'<") - 1
> let ecol = virtcol("'>")
>
> for l in range(line("'<"), line("'>"))
> call setline(l, strpart(getline(l), col, ecol - col))
> endfor
> endf
>

I modified this to echo the columns instead of doing whatever the for loop does.

> Select (ve=block) a visual block from "Fun" down to "ol ", the press _C, _D, and _E. Repeat the same (_C, _E) with an extended block (one line further down - in the void).

The first mapping clears visual mode and echos 1 on empty lines, as you reported, and as I and John expect, BECAUSE THE : ENDS VISUAL MODE. There is nothing you can do about this. There is nothing Vim SHOULD do about this. Visual mode is over. Done. Complete. You are no longer in visual block mode so the cursor can no longer be outside the real text.

The second mapping works as expected, getting the virtual column of the visual block selection, because IT NEVER LEAVES VISUAL MODE.

Note to call a function in a visual mode <expr> mapping, the function should return the text desired for the RHS of the mapping. In this case, adding:

return ""

to the end of the mapping lets it do no further action on the visual selection.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: How to determine the start of a visual block (C-V) when it starts in the void?

Hi Ben,

try this:

xnoremap <silent> _C :<C-U>call SomeFunc()<CR> " My current mapping
xnoremap <silent><expr>_D SomeFunc()<CR> " John's proposal
xnoremap <silent> _E SomeFunc()<CR> " same w/o <expr>

fun! SomeFunc()
let col = virtcol("'<") - 1
let ecol = virtcol("'>")

for l in range(line("'<"), line("'>"))
call setline(l, strpart(getline(l), col, ecol - col))
endfor
endf

Select (ve=block) a visual block from "Fun" down to "ol ", the press _C, _D, and _E. Repeat the same (_C, _E) with an extended block (one line further down - in the void).

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: TOhtml reverses text/background color for default colorscheme

On Jan 29, 12:32 pm, Ben Fritz <fritzophre...@gmail.com> wrote:
> On Monday, January 28, 2013 4:20:24 PM UTC-6, Paul wrote:
>>> There are multiple ways to get an up-to-date Vim on Windows...
>>> See
>>> http://vim.wikia.com/wiki/Where_to_download_Vimorhttp://sourceforge.n...
>>
>> That *is* odd. I could have sworn that I downloaded the built-in
>> executable installer of the Windows from vim.org in fall 2012.
>
> You may have. vim.org only gives downloads for major releases (in
> this case 7.3) and only rarely provides any patched versions (in
> this case 7.3.46, because of very severe Windows issues fixed) for
> download in binary form.
>
> The cream site I linked above is a project which packages a
> Point-and-click style configuration of Vim, but also provides a
> compilation for Windows of the unmodified Vim from the latest code
> in the Mercurial repository.

OK, thanks for that.

>> I actually tried your virgin gvim command and it did not create
>> erroneous HTML colors. I then tried gvim without the virgin
>> swithes (I know, I'm probably abusing the term "virgin") and failed
>> to re- create the problem. I even turned on folds and turned on
>> search highlighting in case that was the case. Still no erroneous
>> colours.
>
> I'm not sure what happened here, but at least the issue went away.
> If it pops up again, please send a test file and the resulting
> output, if you can.

Will do. It's getting hard these days after getting out of grad
school. Not as much time to do explore things under the hood. Not a
complaint, just relating the reality. Even minor things seem
impossible, but I sometimes manage to get a weekend afternoon.


On Jan 29, 1:37 pm, Steve Hall <digit...@dancingpaper.com> wrote:
> On Tue, Jan 29, 2013 at 12:32 PM, Ben Fritz
> <fritzophre...@gmail.com> wrote:
>> On Monday, January 28, 2013 4:20:24 PM UTC-6, Paul wrote:
>
>>> There are multiple ways to get an up-to-date Vim on Windows, my
>>> preferred method being the 32-bit "Vim without Cream" installer
>>> from the Cream project.
>
>>> Seehttp://sourceforge.net/projects/cream/files
>
> The direct URL for the latest distribution without Cream is:
>
> http://sourceforge.net/projects/cream/files/Vim/
>
> We're a little behind the current pach level at the moment because
> of some critical Vim bugs. With my customizations, gVim crashes on
> startup since about 7.3.780 or so. I haven't had time to diagnose
> what is causing it.

I'm still happy with my old 7.3, but appreciate that the yard sticks
are being moved.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: foldmethod=indent: Show preceding & succeeding lines of context

On Jan 29, 12:14 pm, Ben Fritz <fritzophre...@gmail.com> wrote:
> There is the 'foldminlines' option. foldmethod=indent cannot show
> the context you desire for closed folds, but you could make your own
> function for foldmethod=expr.

OK, I'm going to have to save that for an weekend afternoon delving
into vim under the hood. Thanks.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Windows ALT characters

On Wednesday, January 30, 2013 7:51:01 AM UTC-6, Tony Mechelynck wrote:
> On 30/01/13 02:53, John McGlynn wrote:
>
> > Hi Vim,
>
> >
>
> > I have a load of csv files in which some rows have an arrow at the end.
>
> > The arrow seems to have been made using Windows ALT 26.
>
> >
>
> > It shows up in Vim as ^Z^M.
>
> >
>
> > Can anyone tell me how to remove these pesky objects?
>
> >
>
> > Thanks,
>
> >
>
> > John
>
>
>
> You already got several replies about how to remove them.
>
>
>
> Those Ctrl-Z characters are a leftover from DOS "ASCII" mode, where they
>
> signaled end-of-file. When reading a file, DOS used to disregard the
>
> Ctrl-Z and everything after it. This peculiarity was used when typing in
>
> a file at the console (to be read via a < redirection): the user typed
>
> Ctrl-Z to signal the end of data and come back to the command prompt.
>
>
>
> The Ctrl-M is a carriage return, which may have been added by some
>
> program unaware of the special meaning of the Ctrl-Z.
>
>

In the past, I discovered the hard way that Perl (at least, ActivePerl on Windows) also treats the CTRL-Z as "end of file" and stops processing. Certainly removing them is a good idea.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: How to determine the start of a visual block (C-V) when it starts in the void?

On Wednesday, January 30, 2013 8:06:36 AM UTC-6, Axel Bender wrote:
> Hi John,
>
> unfortunately this approach doesn't work in my situation. I'm using the same function in a mapping operating either on visuals, or on motions (:map-operator).
>
> Also, I think that if a visual block is displayed (set virtualedit=block, upper left corner in the void), then when switching to the command line and issuing :<C-U>echo virtcol("'<"), the function should return the "correct" left column, as this selection is perfectly legal in "block" mode...

I think you are missing the point.

By pressing the : key, you are no longer in visual mode. Visual mode ends the moment you enter command line mode.

John was trying to demonstrate that you can use <expr> mappings to perform an action in visual mode *without leaving visual mode*. Why exactly doesn't this method apply in your case? You can continue using the same function in both modes.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: How to determine the start of a visual block (C-V) when it starts in the void?

Hi John,

unfortunately this approach doesn't work in my situation. I'm using the same function in a mapping operating either on visuals, or on motions (:map-operator).

Also, I think that if a visual block is displayed (set virtualedit=block, upper left corner in the void), then when switching to the command line and issuing :<C-U>echo virtcol("'<"), the function should return the "correct" left column, as this selection is perfectly legal in "block" mode...


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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Windows ALT characters

On 30/01/13 02:53, John McGlynn wrote:
> Hi Vim,
>
> I have a load of csv files in which some rows have an arrow at the end.
> The arrow seems to have been made using Windows ALT 26.
>
> It shows up in Vim as ^Z^M.
>
> Can anyone tell me how to remove these pesky objects?
>
> Thanks,
>
> John

You already got several replies about how to remove them.

Those Ctrl-Z characters are a leftover from DOS "ASCII" mode, where they
signaled end-of-file. When reading a file, DOS used to disregard the
Ctrl-Z and everything after it. This peculiarity was used when typing in
a file at the console (to be read via a < redirection): the user typed
Ctrl-Z to signal the end of data and come back to the command prompt.

The Ctrl-M is a carriage return, which may have been added by some
program unaware of the special meaning of the Ctrl-Z.


Best regards,
Tony.
--
Unquestionably, there is progress. The average American now pays out
twice as much in taxes as he formerly got in wages.
-- H. L. Mencken

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: How to make search with 'wrapscan' more convenient?

On 03:21 Wed 30 Jan , Wiktor Ruben wrote:
> Hello,
>
> I have 'set wrapscan' in my .vimrc. During search Vim displays 'search
> hit bottom, continuing at top' message. It is pretty useless with
> 'wrapscan' because in most cases what I'm really interested in, is
> notification whether I have reached position from which my search
> started.
>
> Example: I have file with 1000 lines of text. I start '/foo' at line
> 400. I want to search whole file i.e. lines 400 - 1000 and 1 - 400.
> Then I want Vim to notify me "search hit starting position". Is there
> a way to make Vim to behave like this?
>
> Without such notification I end up racking my brain: "Hmm, have I
> already reached line 400?" every 'n' pressing after 'search hit
> bottom, continuing at top' message. I often miss starting position and
> after couple of redundant 'n' find myself doing search through text
> that has been already searched.
>
> My current workflow is to set 'nowrapscan', then mark my current
> position with 'mm', then 'gg' and doing 'n' until Vim displays 'search
> hit bottom, without match for foo'. Then I do '`m' to get back where I
> were before search. How can I improve it?
>
> --
> --
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

You can write your own function which can use searchpos() function,
setting mark with ':normal mmgg' (or even better remember the position in
a global (g:) variable. You can set the nowrapscan flag on the search()
function and only thet if the position is beyond (for forward search) if
it already hit bottom. Finally, you can write a command which invokes
the function. If you use <q-args> you will type a pattern in exactly
the same way as you type it in the command line. The last step would be
to makes maps n and N which invokes the search, but in such a way that
it uses the starting position set by the first search. I guess this
difficulty is the reason why vim behaves like it behaves. How you could
now using n/N that the search is a new search.

AFAIK vim has no option for that.

Happy Vimming,
Marin


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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

How to make search with 'wrapscan' more convenient?

Hello,

I have 'set wrapscan' in my .vimrc. During search Vim displays 'search
hit bottom, continuing at top' message. It is pretty useless with
'wrapscan' because in most cases what I'm really interested in, is
notification whether I have reached position from which my search
started.

Example: I have file with 1000 lines of text. I start '/foo' at line
400. I want to search whole file i.e. lines 400 - 1000 and 1 - 400.
Then I want Vim to notify me "search hit starting position". Is there
a way to make Vim to behave like this?

Without such notification I end up racking my brain: "Hmm, have I
already reached line 400?" every 'n' pressing after 'search hit
bottom, continuing at top' message. I often miss starting position and
after couple of redundant 'n' find myself doing search through text
that has been already searched.

My current workflow is to set 'nowrapscan', then mark my current
position with 'mm', then 'gg' and doing 'n' until Vim displays 'search
hit bottom, without match for foo'. Then I do '`m' to get back where I
were before search. How can I improve it?

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Syntax highlight not happening on :newtab

On Wed, January 30, 2013 09:47, naaj_ila wrote:
> If i opened a file <file1>
> 1)gvim file1.v -- syntax highlight is enabled
> 2):tabnew file2.v -- syntax highlight is gone
> 3):sp file3.v -- syntax highligh is gone
>
>
> Can anybody tell step by step what i have to do to resolve this problem
>
> Just for info::: ".vimrc" , "verilog.vim" file are in the same place
>

The question is, what did you do to make Vim recognize .v files
and what did you do with the verilog.vim file? Please give us
more input here.

regards,
Christian

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Syntax highlight not happening on :newtab

If i opened a file <file1>
1)gvim file1.v -- syntax highlight is enabled
2):tabnew file2.v -- syntax highlight is gone
3):sp file3.v -- syntax highligh is gone


Can anybody tell step by step what i have to do to resolve this problem

Just for info::: ".vimrc" , "verilog.vim" file are in the same place




--
View this message in context: http://vim.1045645.n5.nabble.com/Syntax-highlight-not-happening-on-newtab-filename-tp5713478.html
Sent from the Vim - General mailing list archive at Nabble.com.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Tuesday, January 29, 2013

Re: Possible to stretch cursor on tab character?

ah ok I found some hoops to jump through
....
function! TabCursor()
let currentchar = getline('.')[col('.')-1]
if currentchar == ' '
if mode() == "n"
normal v
redraw
sleep 4m
normal v
endif
highlight Cursor guibg=#0FF74A
else
highlight Cursor guibg=#7F97AA
endif
endfunction

this is actually closer to what I had in mind, except ideally I would have
it blink and highlight the current tab at every blink.





--
View this message in context: http://vim.1045645.n5.nabble.com/Possible-to-stretch-cursor-on-tab-character-tp5713419p5713477.html
Sent from the Vim - General mailing list archive at Nabble.com.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Windows ALT characters

On Tuesday, January 29, 2013 7:53:20 PM UTC-6, John McG wrote:
> Hi Vim,
>
> I have a load of csv files in which some rows have an arrow at the end. The arrow seems to have been made using Windows ALT 26.
>

I assume you mean somebody entered a unicode RIGHTWARDS ARROW character by holding ALT and typing 0026 in Windows on some non-Vim app.

> It shows up in Vim as ^Z^M.
>

I don't know how Vim would get these specific bytes, but you can get Vim to correctly read the character instead of getting garbage, by getting the encoding correctly.

Take a look at http://vim.wikia.com/wiki/Working_with_Unicode for a decent setup to use. You can override encoding detection with :e ++enc=utf-16 or similar if you don't see the characters correctly automatically.

I wonder if you have multiple issues here, and the ^M is not due to the arrow glyph, but rather due to line endings being detected as Unix instead of Windows. See http://vim.wikia.com/wiki/File_format

>
> Can anyone tell me how to remove these pesky objects?
>

A simple substitute should work. You can enter the ^Z (CTRL-Z) literally by typing CTRL-V followed by CTRL-Z, and similarly for the ^M (CTRL-M) character.

Your substitute should *look* like:

:s/^Z^M$//

But the ^Z and ^M are actually single bytes, not two characters.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Windows ALT characters

On Wed, 30 Jan 2013 12:53:20 +1100 John McGlynn
<johnmmcglynn@gmail.com> wrote:

> Hi Vim,
>
> I have a load of csv files in which some rows have an arrow at the
> end. The arrow seems to have been made using Windows ALT 26.
>
> It shows up in Vim as ^Z^M.
>
> Can anyone tell me how to remove these pesky objects?

I think you mean "control" rather than ALT. You have several ways to
do it. Assuming "l" isn't in your 'cpoptions' (":set cpoptions-=l"
if it is), you can use

:%s/[\x1a]//g

to remove them. Alternatively, you can enter it by prefixing it with
control-V, so you can type

colon
percent
ess
slash
control+v
control+z
slash
slash
gee

to produce what appears as

:%s/^Z//g

Hope this helps,

-tim


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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Windows ALT characters

Hi Vim,

I have a load of csv files in which some rows have an arrow at the end. The arrow seems to have been made using Windows ALT 26.

It shows up in Vim as ^Z^M.

Can anyone tell me how to remove these pesky objects?

Thanks,

John

--
Time flies like an arrow. Fruit flies like bananas.
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Unless explicitly stated, the opinions expressed in this email are that of the author and not of any other person or organisation.

--
--
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
 
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: ctags processing jumps to wrong tag?

On Tue, Jan 29, 2013 at 08:48:00AM -0800, Ben Fritz did gyre and gimble:

>I generate CTags for C code with the following:
>
>" -R : recursive
>" --extra=+f : include file name as a tag
>" --fields=+S : include signature (e.g. parameter list)
>" K : include kind of tag as full name
>" -k : not kind of tag as single letter
>" --totals : print on standard output total number of tags, etc.
>" --c-kinds=+p : include function prototype in C code
>let ctags_command=Tlist_Ctags_Cmd.' -R --extra=+f --fields=+SK-k --totals --c-kinds=+p .'
>
>I have 'cscopetag' set, so that pressing CTRL-] on a tag name with multiple matches will prompt me before jumping.
>
>When I CTRL-] on a function name, I usually get 2 hits, one for the prototype, the other for the function. If both are in the same file, choosing either hit will jump to the prototype always.
>
>Does anyone else see this issue? Am I doing something wrong?

I have the same behavior here, when setting 'cscopetag' on. Here's my
ctag's line:
ctags -R --c-kinds=+pm --c++-kinds=+cpmn --fields=+iaS --extra=+q -I *

--
Ivan Sichmann Freitas
GNU/Linux user #509059
SDF Arpa Member http://isf.sdf.org/about.html

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Screen not redrawing on search

Solution: Apparently, this error is not caused by vim itself. It seems to be a malfunctioning interplay between GNOME 3 and the NVIDIA drivers. Reverting to GNOME Classic solved the problem.

Best regards
Ole

On Monday, January 21, 2013 4:31:22 PM UTC+1, Ole Juul Andersen wrote:
> Hi.
>
> After installing the correct drivers for my graphics card (NVIDIA GeForce 560 Ti) in Fedora 16, I have started getting the same error as this guy in this 3 year old post.
>
> http://vim.1045645.n5.nabble.com/Screen-not-redrawing-on-search-td1179636.html
>
> It does not seem that any solution was found, and an extensive google search did not help me. I have access to three identical, brand new computers, and the error is reproducible. Before installing the correct drivers, still using the basic nouveau drivers, search in vi with syntax highlighting works perfect, but after installing the proper drivers, the error occurs.
>
> Any help would be much appreciated, as I am going crazy whenever using vi. I am aware of the option to press Ctrl+L to redraw the screen, however, this is not very pleasent upon heavy and long-term use. Furthermore, uninstalling the new driver is also not an option, at it is needed for other programs on the computer.
>
> Best regards
> Ole

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Two questions for script 2666: Highlight several words in different colors simultaneously

First , this script is a life change one, Thanks Ingo for it. However, I do have a few questions regarding to it. After playing with this script for a few hours, I still failed to figure out how to use it for two important scenario:

1, Suppose I am edit a big file, and I want to search for a pattern using <Leader>r, after I input the regular expression and press Return, I don't know if there is any match since the cursor does not jump to the first match. I have to return to the old Vim search way, is there any way I can know if the search hit any thing?

2, Suppose I have a few patterns highlighted, for example, 'foo', 'bar' and 'qaz'. Now I just searched for 'qaz' and it is in the screen, now if I want to jump to the occurrence of 'bar', I don't know what to do other than randomly srolling the screen up and down for that pattern. I don't know if this script has a search command which accepts a marker number [N], other than just reuse the last marker?

Regards

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: How to determine the start of a visual block (C-V) when it starts in the void?

On Wednesday, January 30, 2013 3:08:04 AM UTC+13, Axel Bender wrote:

>If(!) I'm able to create a block with corners in the void using 'block' mode, >then why should virtcol() not adapt to that?

It does, the point in your example is the observation affecting the result. By going to the command line, vim has gone out of visual block mode. If your plug-in is careful, it can avoid this. For example,

:vmap <expr> z Col()
:fun! Col()
echo virtcol("'<")
return ""
endf

Select a block and press z. If ve=block, when virtcol is called vim is still in visual block mode.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: TOhtml reverses text/background color for default colorscheme

On Tue, Jan 29, 2013 at 12:32 PM, Ben Fritz <fritzophrenic@gmail.com> wrote:
> On Monday, January 28, 2013 4:20:24 PM UTC-6, Paul wrote:
> >
> > There are multiple ways to get an up-to-date Vim on Windows, my
> > preferred method being the 32-bit "Vim without Cream" installer
> > from the Cream project.
> >
> > See http://sourceforge.net/projects/cream/files

The direct URL for the latest distribution without Cream is:

http://sourceforge.net/projects/cream/files/Vim/

We're a little behind the current pach level at the moment because of
some critical Vim bugs. With my customizations, gVim crashes on
startup since about 7.3.780 or so. I haven't had time to diagnose what
is causing it.


--
Steve Hall  [ digitect dancingpaper com ]
:: Cream for Vim (http://cream.sourceforge.net)

--
--
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
 
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: TOhtml reverses text/background color for default colorscheme

On Monday, January 28, 2013 4:20:24 PM UTC-6, Paul wrote:
> >
>
> > There are multiple ways to get an up-to-date Vim on Windows, my
>
> > preferred method being the 32-bit "Vim without Cream" installer from
>
> > the Cream project.
>
> > See http://vim.wikia.com/wiki/Where_to_download_Vimorhttp://sourceforge.net/projects/cream/files
>
>
>
> That *is* odd. I could have sworn that I downloaded the built-in
>
> executable installer of the Windows from vim.org in fall 2012.
>
>

You may have. vim.org only gives downloads for major releases (in this case 7.3) and only rarely provides any patched versions (in this case 7.3.46, because of very severe Windows issues fixed) for download in binary form.

The cream site I linked above is a project which packages a Point-and-click style configuration of Vim, but also provides a compilation for Windows of the unmodified Vim from the latest code in the Mercurial repository.

>
> I actually tried your virgin gvim command and it did not create
>
> erroneous HTML colors. I then tried gvim without the virgin swithes
>
> (I know, I'm probably abusing the term "virgin") and failed to re-
>
> create the problem. I even turned on folds and turned on search
>
> highlighting in case that was the case. Still no erroneous colours.
>
>

I'm not sure what happened here, but at least the issue went away. If it pops up again, please send a test file and the resulting output, if you can.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: "shift+%" not working in newtab

On Tue, Jan 29, 2013 at 12:11 PM, Ben Fritz <fritzophrenic@gmail.com> wrote:
On Tuesday, January 29, 2013 3:57:11 AM UTC-6, ali jaan wrote:
> I added some commands in .vimrc
>
> source ~/vimfiles/matchit.vim
>
> let b:match_words =
>
> '\<begin\>:\<end\>,'.'\<class\>:\<endclass\>,'.'\<task\>:\<endtask\>,'.'\<case\>:\<endcase\>'

b:match_words is a buffer-local variable, as indicated by the b: prefix.

If you want to set b:match_words on every file of a given filetype, you want to use a FileType autocmd or a custom ftplugin or after/ftplugin file.

:help internal-variables
  (or :help b:var)
:help :autocmd
:help filetype

     Those are good references, but you might skip a few paragraphs and go to

:help :filetype-plugin-on

What type of file are you editing?  Chances are that vim already has an ftplugin with matchit support.  If so, then all you have to do is add

:filetype-plugin-on

to your vimrc file.

     Historical note:  when filetype plugins were first added to vim, Dan Sharp contributed several of them that did little more than add configuration for matchit.

HTH  --Benji Fisher
(For once I remembered not to top-post when using the Gmail web interface!)

--
--
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
 
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: "shift+%" not working in newtab

Hi naaj_ila!

On Di, 29 Jan 2013, naaj_ila wrote:

> I added some commands in .vimrc
>
>
> source ~/vimfiles/matchit.vim
> let b:match_words =
> '\<begin\>:\<end\>,'.'\<class\>:\<endclass\>,'.'\<task\>:\<endtask\>,'.'\<case\>:\<endcase\>'
>
>
> If the cursor is at "begin" and "shift+%" will go to "end" of the statement.
> If i opened another file in newtab or "sp <filename> " . "Shift+%" is not
> working.(Working only in the first file) And also 'syntax highlighting; is
> also not working .

You have defined the matchit configuration value specifically for your
current file since all b: variables are local scoped to the current
buffer.


When you edit another file, this variable is not set, and I guess
matchit won't do anything in that case. So you probably want to define
the b:match_words variable in a filetype-specific plugin. To do this,
read those entries in the faq:

http://vimhelp.appspot.com/vim_faq.txt.html#faq-26.1
http://vimhelp.appspot.com/vim_faq.txt.html#faq-26.3
http://vimhelp.appspot.com/vim_faq.txt.html#faq-26.6

and then set your variable in a filetype plugin.

regards,
Christian
--
Es gibt Dinge, über die spreche ich nicht einmal mit mir selbst.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.