Re: How ctags search outside current directory

2011-06-30 Thread Gary Johnson
On 2011-06-30, ? wrote:
 Hello, I'm using vim to read some project source codes, but  some problem 
 using
 ctags come to me. If my directory hierarchy is somewhat like that:
 
 ---src
 |-thread
  |---Tiger
 |--device
 
 If I am in /src/thread/ and type ctags -R , then I can jump to function that 
 in
 both the current directory and the directory named Tiger, but I cann't read
 functions that are in /src/device. That's my problem.
 If I am in the root directory, say, /src/, then type ctags -R, then switch to 
 /
 src/thread, and use C-] try to jump to the function in /src/device, it pop the
 message: file device/timer.c does not exist. the file timer.c is where my
 jumped function stays.
 
 I want to jump to any functions with /src/, but how to realize it? can you 
 give
 me a hand?

If you cd to some directory and execute ctags -R, the resulting
tags file will contain path names relative to that directory, making
it difficult to use the tags when Vim is started in any other
directory.  A solution to this is to give ctags the absolute path
names of the directories you wish to search.  In your case, you
could execute ctags as

ctags -R /src

or as

ctags -R /src/thread /src/device

Additionally, you can specify the location for the tags file with
the -f option, e.g.,

ctags -f /src/thread/tags -R /src

and you can tell Vim where that tags file is with

:set tags=/src/thread/tags

Then it won't matter where you start Vim, it will be able to find
the tags file and the tags commands (e.g., C-]) will be able to find
the target files.

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


Re: Using 'O' to open a new line and insert is slow

2011-06-30 Thread vs
I have the same problem.
It is slow for any of filetypes (tested php,python,txt)
But it works faster for small files.
:noremap O  gives no mappings found.

I use latest Linux Mint , wmii as window manager.

On Jun 30, 1:18 am, Benjamin R. Haskell v...@benizi.com wrote:
 On Wed, 29 Jun 2011, seed wrote:
  Sometime when I use 'O' to open a new line above the current line, the
  letter 'O' is displayed on the screen for a few seconds before I can
  insert. Does anybody have this problem? However, it's ok when I use
  gVim or use Vim with X off.

 Sounds like something is setting up a shortcut that starts with 'O'.
 Vim is waiting for the next keystroke in a multi-key mapping.  To see if
 that's the case, type:

 :noremap O

 If there's any output, that would be the reason.

 It might depend on what plugins you've got installed, and might only
 happen for certain filetypes.  So, test it from a situation in which the
 problem occurs.

 --
 Best,
 Ben

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

2011-06-30 Thread Gary Johnson
On 2011-06-30, meino.cra...@gmx.de wrote:
 Hi,
 
 at work there is Solaris machine with an oler vim installed. I am
 neither sysadmin nor can I acchieve root privileges.

I used a Solaris system for years without root privileges and was
still able to install everything I needed in my ~/bin, ~/man, etc.
directories.

 When starting vim (terminal) and trying to type anything else than
 printable characters, these characters are inserted as
 control-sequence but they are not executed (read: Cursor arrow down
 does not move the cursor down but inserts its control sequence).
 
 echo $TERM 
 at the console says xterm. CDE is used (motif).

It appears that the terminfo entry for xterm does not match the
behavior of the terminal you're using.  What are you really using?

It may also be that the terminfo database on your Solaris system is
poorly maintained and doesn't have the correct or complete
description of an xterm.

There are several possible solutions to this.

First, make sure that the value of $TERM matches the terminal you're
using.

Next, check that the terminfo database exists and is correct for
that terminal.  You can execute the infocmp command to see the
terminfo description of your terminal.  You can also execute Vim's
:set termcap command to see Vim's idea of your terminal's
capabilities.  These usually come from the terminfo database but Vim
sometimes fills in some values from it's built-in terminal
information.

If the terminfo database information is wrong for your terminal, you
can look in the database for a terminal description that more
closely matches your terminal.  Then you can just set TERM to that
name.  Alternatively, you can build your own terminfo database from
publicly-available sources or your own description, but that may be
more than you want to tackle for now.

 Is there any chance to tweak, so that such things work without 
 remapping each charcter, which does not work, to a command sequence?
 Thank you very much for any help in advance!

I don't understand what does not work.

One way to create your own mappings for the arrow keys, for example,
is to put in your ~/.vimrc at set of lines like these,

map  OD Left
map  OC Right
map  OA Up
map  OB Down

where for each of those I typed map , then Ctrl-V, then hit the
actual arrow key to be mapped, then a space and Vim's name for that
key.

Instead of mapping each key, you could set Vim's termcap name for
each key like this:

set t_kl= OD
set t_kr= OC
set t_ku= OA
set t_kd= OB

where again I inserted the key's character sequence by typing Ctrl-V
then hitting the arrow key.

Those are just some ideas since I don't know exactly what the
problem is nor what constraints your under.

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


Re: Fold the output of grep

2011-06-30 Thread Marko Mahnič
On Jun 30, 4:46 am, howard Schwartz howard...@gmail.com wrote:
 Here's what I would like to do: Using gnu grep (or similar one), search files
 for some string, STRING, with the output including a context line before and
 after each line found. That would look like:

 filename:21: This is a context line
 filename:22: This line contains STRING
 filename:23: This is another context line

The command VxOccur from the script 2606 will run grep and turn the
above list into something like:
filename
  21: This is a context line
  22: This line contains STRING
  23: This is another context line
filename 2
  ...
It will display the matches in a popup window. Then you can use the
filter mode (press f) to narrow the results interactively. If you
search for 'STR' you would see:
filename
  22: This line contains STRING

In the new (unpublished) version the 'STR' in STRING would also be
highlighted.

You have to set g:vxoccur_grep_mode to 1 or 2 if you want to use grep
(0 uses :vimgrep).
For grep to display N context lines, add -CN to the range of files to
search when prompted.

VxOccur documentation:
  http://vimuiex.sourceforge.net/vimdoc/vimuiex_plugins.html#vimuiex-vxoccur
The script
  http://www.vim.org/scripts/script.php?script_id=2606

The preview of the next version:
  
http://sourceforge.net/projects/vimuiex/files/tar/vim-7.3-226-puls-vimuiex-0.8.tar.bz2/download
  This implements the popuplist() function in C. Different algorithms
are implemented for filtering the displayed items. They are described
in help, see :h puls-matchers, or the file runtime/doc/popuplist.txt
in the tar file.

Marko

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


Tag jumping problem

2011-06-30 Thread Karol Samborski
Hello all,

I have a problem with using tags. When I hit C-] on a word vim opens a
list of tags and then I must select number of correct place to jump.
So it is working like a :tselect instead of :tag (jumping to the first
one). When I added cscope database besides tags the behavior has
changed to work properly. So I was happy ;) and I decided to add some
mappings from help about cscope and then behavior of C-] has changed
again. Does anyone know how to set C-] to work properly?

Best regards,
Karol Samborski

-- 
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: Tag jumping problem

2011-06-30 Thread Karol Samborski
I forgot mention that I'm using vim 7.3 on fedora 14 x86_64

Regards,
Karol Samborski

2011/6/30 Karol Samborski edv.ka...@gmail.com:
 Hello all,

 I have a problem with using tags. When I hit C-] on a word vim opens a
 list of tags and then I must select number of correct place to jump.
 So it is working like a :tselect instead of :tag (jumping to the first
 one). When I added cscope database besides tags the behavior has
 changed to work properly. So I was happy ;) and I decided to add some
 mappings from help about cscope and then behavior of C-] has changed
 again. Does anyone know how to set C-] to work properly?

 Best regards,
 Karol Samborski


-- 
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: Tag jumping problem

2011-06-30 Thread Jürgen Krämer

Hi,

Karol Samborski wrote:
 
 I have a problem with using tags. When I hit C-] on a word vim opens a
 list of tags and then I must select number of correct place to jump.
 So it is working like a :tselect instead of :tag (jumping to the first
 one). When I added cscope database besides tags the behavior has
 changed to work properly. So I was happy ;) and I decided to add some
 mappings from help about cscope and then behavior of C-] has changed
 again. Does anyone know how to set C-] to work properly?

I don't see an option that would switch the behaviour of C-], but you
don't happen to have C-] remapped to :tselect or something else, do
you? See, if

  :verbose map C-]

shows you a mapping.

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: Tag jumping problem

2011-06-30 Thread Karol Samborski
This is my .vimrc:

if has(cscope)
set csto=0
set cst
set nocsverb
cs add ~/.vim/tags/cscope.out
set csverb
if has('quickfix')
set cscopequickfix=s-,c-,d-,i-,t-,e-
endif

nmap C-_s :cs find s C-R=expand(cword)CRCR
nmap C-_g :cs find g C-R=expand(cword)CRCR
nmap C-_c :cs find c C-R=expand(cword)CRCR
nmap C-_t :cs find t C-R=expand(cword)CRCR
nmap C-_e :cs find e C-R=expand(cword)CRCR
nmap C-_f :cs find f C-R=expand(cfile)CRCR
nmap C-_i :cs find i ^C-R=expand(cfile)CR$CR
nmap C-_d :cs find d C-R=expand(cword)CRCR

 Using 'CTRL-spacebar' then a search type makes the vim window
 split horizontally, with search result displayed in
 the new window.

nmap C-Spaces :scs find s C-R=expand(cword)CRCR
nmap C-Spaceg :scs find g C-R=expand(cword)CRCR
nmap C-Spacec :scs find c C-R=expand(cword)CRCR
nmap C-Spacet :scs find t C-R=expand(cword)CRCR
nmap C-Spacee :scs find e C-R=expand(cword)CRCR
nmap C-Spacef :scs find f C-R=expand(cfile)CRCR
nmap C-Spacei :scs find i ^C-R=expand(cfile)CR$CR
nmap C-Spaced :scs find d C-R=expand(cword)CRCR

 Hitting CTRL-space *twice* before the search type does a vertical
 split instead of a horizontal one

nmap C-SpaceC-Spaces
\:vert scs find s C-R=expand(cword)CRCR
nmap C-SpaceC-Spaceg
\:vert scs find g C-R=expand(cword)CRCR
nmap C-SpaceC-Spacec
\:vert scs find c C-R=expand(cword)CRCR
nmap C-SpaceC-Spacet
\:vert scs find t C-R=expand(cword)CRCR
nmap C-SpaceC-Spacee
\:vert scs find e C-R=expand(cword)CRCR
nmap C-SpaceC-Spacei
\:vert scs find i ^C-R=expand(cfile)CR$CR
nmap C-SpaceC-Spaced
\:vert scs find d C-R=expand(cword)CRCR
endif

-- 
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: Tag jumping problem

2011-06-30 Thread Karol Samborski
2011/6/30 Jürgen Krämer jottka...@googlemail.com:
 I don't see an option that would switch the behaviour of C-], but you
 don't happen to have C-] remapped to :tselect or something else, do
 you? See, if
  :verbose map C-]
 shows you a mapping.


It shows nothing. Vim didn't found any mapping for that. I didn't
found any option either so I wrote to this list ;)

Karol

-- 
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: Tag jumping problem

2011-06-30 Thread Jürgen Krämer

Hi,

Karol Samborski wrote:
 2011/6/30 Jürgen Krämer jottka...@googlemail.com:
 I don't see an option that would switch the behaviour of C-], but you
 don't happen to have C-] remapped to :tselect or something else, do
 you? See, if
  :verbose map C-]
 shows you a mapping.

 
 It shows nothing. Vim didn't found any mapping for that. I didn't
 found any option either so I wrote to this list ;)

I don't use cscope, so I can't help much, but the last paragraph at

  :help cscope-howtouse

says

| If the results return only one match, you will automatically be taken to it.
| If there is more than one match, you will be given a selection screen to pick
| the match you want to go to.  After you have jumped to the new location,
| simply hit Ctrl-T to get back to the previous one.

I don't know if this is only true for explicit cscope commands or also
if 'cscopetag' is set.

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: Tag jumping problem

2011-06-30 Thread Karol Samborski
2011/6/30 Jürgen Krämer jottka...@googlemail.com:

 Hi,


 I don't use cscope, so I can't help much, but the last paragraph at

  :help cscope-howtouse

 says

 | If the results return only one match, you will automatically be taken to it.
 | If there is more than one match, you will be given a selection screen to 
 pick
 | the match you want to go to.  After you have jumped to the new location,
 | simply hit Ctrl-T to get back to the previous one.

 I don't know if this is only true for explicit cscope commands or also
 if 'cscopetag' is set.

I have the same behavior when I turn off cscope feature. But it worked
for me for the moment. I don't know what I did that it is not working
now.

I think that showing the list of places to jump is needless because it
populates the quickfix list and it is much more powerful (for example
I can search on this list and I can switch place at any time without
jumping backwards). The behavior I want to achieve is that when I
press C-] it will jump to the first place on the list and will
automatically show the quickfix list.

Any ideas?

Regards,
Karol

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

2011-06-30 Thread Charles Campbell

Charles Smith wrote:

The after directory is new to me, thank you for introducing it to me.  
Unfortunately, I can find very little information about how it works exactly (vim version 
7.2.264).

I don't understand this mechanism...

   Normally, when a file matching a particular name pattern is loaded
   into a buffer, a syntax file matching that pattern is loaded and
   invoked.  Now, the rules that are causing me trouble are defined in a
   file called vim.vim and I don't find any matching patterns using
   that syntax file in my own filetypes.vim or the system-wide one.

   In general, it seems a pity that new features should break such
   simple, unambiguous, and useful functionality as, e.g. syn clear:

 This command should be used when you want to switch off syntax
 highlighting, or when you want to switch to using another syntax.
 It's normally not needed in a syntax file itself, because syntax is
 cleared by the autocommands that load the syntax file.  The command
 also deletes the b:current_syntax variable, since no syntax is
 loaded after this command.

Hopefully, I'm still missing something ...
   
syn clear is not broken.  If one loads syntax definitions after a syn 
clear, then that new syntax applies; in fact, many of the syntax files 
distributed with vim have syn clear embedded in them.


So your difficulty I suspect is in understanding the loading sequence.  
Here's some reading on the subject:


:help .vimrc
:help load-plugins
:help 'runtimepath'

Your first email mentioned that syn clear didn't work in your syntax 
file.  What is it named, in what directory is it in (so we may infer 
when it gets loaded), how are you triggering your syntax to be loaded 
(.vim/filetype.vim?) and how does syntax/vim.vim get involved?


Remember that things that are loaded later can modify what's happened 
thus far.  So, if your syntax file is loaded with its syn clear and 
then syntax/vim.vim is loaded, naturally vim.vim's definitions have not 
been cleared; in this case they weren't even loaded and defined when 
that syn clear was issued.


Regards,
Chip Campbell

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

2011-06-30 Thread meino . cramer
Gary Johnson garyj...@spocom.com [11-06-30 17:27]:
 On 2011-06-30, meino.cra...@gmx.de wrote:
  Hi,
  
  at work there is Solaris machine with an oler vim installed. I am
  neither sysadmin nor can I acchieve root privileges.
 
 I used a Solaris system for years without root privileges and was
 still able to install everything I needed in my ~/bin, ~/man, etc.
 directories.
 
  When starting vim (terminal) and trying to type anything else than
  printable characters, these characters are inserted as
  control-sequence but they are not executed (read: Cursor arrow down
  does not move the cursor down but inserts its control sequence).
  
  echo $TERM 
  at the console says xterm. CDE is used (motif).
 
 It appears that the terminfo entry for xterm does not match the
 behavior of the terminal you're using.  What are you really using?
 
 It may also be that the terminfo database on your Solaris system is
 poorly maintained and doesn't have the correct or complete
 description of an xterm.
 
 There are several possible solutions to this.
 
 First, make sure that the value of $TERM matches the terminal you're
 using.
 
 Next, check that the terminfo database exists and is correct for
 that terminal.  You can execute the infocmp command to see the
 terminfo description of your terminal.  You can also execute Vim's
 :set termcap command to see Vim's idea of your terminal's
 capabilities.  These usually come from the terminfo database but Vim
 sometimes fills in some values from it's built-in terminal
 information.
 
 If the terminfo database information is wrong for your terminal, you
 can look in the database for a terminal description that more
 closely matches your terminal.  Then you can just set TERM to that
 name.  Alternatively, you can build your own terminfo database from
 publicly-available sources or your own description, but that may be
 more than you want to tackle for now.
 
  Is there any chance to tweak, so that such things work without 
  remapping each charcter, which does not work, to a command sequence?
  Thank you very much for any help in advance!
 
 I don't understand what does not work.
 
 One way to create your own mappings for the arrow keys, for example,
 is to put in your ~/.vimrc at set of lines like these,
 
 map  OD Left
 map  OC Right
 map  OA Up
 map  OB Down
 
 where for each of those I typed map , then Ctrl-V, then hit the
 actual arrow key to be mapped, then a space and Vim's name for that
 key.
 
 Instead of mapping each key, you could set Vim's termcap name for
 each key like this:
 
 set t_kl= OD
 set t_kr= OC
 set t_ku= OA
 set t_kd= OB
 
 where again I inserted the key's character sequence by typing Ctrl-V
 then hitting the arrow key.
 
 Those are just some ideas since I don't know exactly what the
 problem is nor what constraints your under.
 
 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
 


Hi Gary,

thank you for your help! :)

I am simply not allowed to install anything regardless
of the prevelidges I have or better: not have...
Thats the reason, why the vim is that old.

I will try what you have written. If I will get further 
or different problems, I will contact this friendly
list :) again...

w!

Best regards and have a nice weekend!
mcc



-- 
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: How ctags search outside current directory

2011-06-30 Thread Ben Fritz


On Jun 29, 9:52 pm, 何聪辉 hecong...@gmail.com wrote:
 Hello, I'm using vim to read some project source codes, but  some problem
 using ctags come to me. If my directory hierarchy is somewhat like that:

 ---src
     |-thread
              |---Tiger
     |--device

 If I am in /src/thread/ and type *ctags -R , *then I can jump to function
 that in both the current directory and the directory named Tiger, but I
 cann't read functions that are in /src/device. That's my problem.
 If I am in the root directory, say, /src/, then type ctags -R, then switch
 to /src/thread, and use C-] try to jump to the function in /src/device, it
 pop the message: file *device/timer.c* does not exist. the file timer.c is
 where my jumped function stays.

 I want to jump to any functions with /src/, but how to realize it? can you
 give me a hand?


I've never had any problems when using ctags -R. Currently I use:

  ctags -R --extra=+f --fields=+SK-k --totals .

And my 'tags' option is set to:

  ./tags;/,tags

But, I just discovered that I normally build tags using a command
defined in my .vimrc, which uses getcwd(), which always seems to
return an absolute path. So that's probably why it works for me.

-- 
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: Multiple Vim setup on the same computer?

2011-06-30 Thread kuru
Gary thanks for the answer, this is good start for me.

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


Passing Env Variables to Grep(as intended folders) search does not work under win32?

2011-06-30 Thread kuru
Hi

I am trying to use this format to search certain folders that are
designed within the variable

This line
:grep -i random $INCLUDES/*

nor this line works
:!grep -i random $INCLUDES/*

but this line inside Cygwin shell works(Mintty in this case)
grep -i random $INCLUDES/*

Windows User env variable
INCLUDES=c:\mingw\includes


I have tried defining it as a variable inside my startup scripts
let $INCLUDES=c:\mingw\includes


that did not help either.


How can I use env variables with grep inside Vim?


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


Re: Passing Env Variables to Grep(as intended folders) search does not work under win32?

2011-06-30 Thread Chris Sutcliffe
On 30 June 2011 13:54, kuru wrote:
 I am trying to use this format to search certain folders that are
 designed within the variable

 This line
 :grep -i random $INCLUDES/*

 nor this line works
 :!grep -i random $INCLUDES/*

 but this line inside Cygwin shell works(Mintty in this case)
 grep -i random $INCLUDES/*

 Windows User env variable
 INCLUDES=c:\mingw\includes

Are you using Cygwin grep?  If so, does it work from the shell?  Are
you using Cygwin vim or Windows (g)vim?  What does 'echo $INCLUDES'
show in the Cygwin shell?  Generally if you are in a Cygwin
environment you should be using unix paths, not Windows paths.

Cheers,

Chris

-- 
Chris Sutcliffe
http://emergedesktop.org
http://www.google.com/profiles/ir0nh34d

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


Saving netrw hide list to session file

2011-06-30 Thread Tim Johnson
Using vim 7.2 on ubuntu 10.04, huge version.

I make use of Dr. Campbell's netrw browse window, which has the
ctrl-h feature that allows me to edit the hide list. 

The hide list is associated with g:netrw_list_hide. I would like to
be able to save that variable to my session file. However, when I
save the session, I do not see that the g:netrw_list_hide is saved.
In fact g:netrw_list_hide is not even defined until netrw is first
invoked.

Is it possible to save g:netrw_list_hide?

Thanks
-- 
Tim 
tim at johnsons-web dot com or akwebsoft dot com
http://www.akwebsoft.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


Re: Saving netrw hide list to session file

2011-06-30 Thread Charles Campbell

Tim Johnson wrote:

Using vim 7.2 on ubuntu 10.04, huge version.

I make use of Dr. Campbell's netrw browse window, which has the
ctrl-h feature that allows me to edit the hide list.

The hide list is associated with g:netrw_list_hide. I would like to
be able to save that variable to my session file. However, when I
save the session, I do not see that the g:netrw_list_hide is saved.
In fact g:netrw_list_hide is not even defined until netrw is first
invoked.

Is it possible to save g:netrw_list_hide?

   


Hello!

From the vim manual, under  :help mks...

2. Restores global variables that start with an uppercase letter and contain
   at least one lowercase letter, if 'sessionoptions' contains globals.

So, unfortunately, g:netrw_list_hide does not satisfy that constraint.

I checked into whether this process could be automated; unfortunately, 
there does not appear to be a SessionWritePre autocmd event.  If there 
was, something like


au SessionWritePre  * let g:Netrw_list_hide= g:netrw_list_hide
au SessionLoadPost * let g:netrw_list_hide= g:Netrw_list_hide

might work.

Regards,
Chip Campbell


--
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: Saving netrw hide list to session file

2011-06-30 Thread Tim Johnson
* Charles Campbell charles.e.campb...@nasa.gov [110630 11:18]:
 Tim Johnson wrote:
 Using vim 7.2 on ubuntu 10.04, huge version.
 
 I make use of Dr. Campbell's netrw browse window, which has the
 ctrl-h feature that allows me to edit the hide list.
 
 The hide list is associated with g:netrw_list_hide. I would like to
 be able to save that variable to my session file. However, when I
 save the session, I do not see that the g:netrw_list_hide is saved.
 In fact g:netrw_list_hide is not even defined until netrw is first
 invoked.
 
 Is it possible to save g:netrw_list_hide?
 
 
 Hello!
 Thank you for the quick reply. 
 From the vim manual, under  :help mks...
  Understood. 
 2. Restores global variables that start with an uppercase letter and contain
at least one lowercase letter, if 'sessionoptions' contains globals.
 
 So, unfortunately, g:netrw_list_hide does not satisfy that constraint.
 
 I checked into whether this process could be automated;
 unfortunately, there does not appear to be a SessionWritePre autocmd
 event.  If there was, something like
   
 au SessionWritePre  * let g:Netrw_list_hide= g:netrw_list_hide
  I put let g:Netrw_list_hide= g:netrw_list_hide into
  the 'wrapper' function that saves the session.
 Save session after confirmation
function! TjSaveSession()
let g:Netrw_list_hide = g:netrw_list_hide
let res = input(Save Session: [ . v:this_session .] (Y/N))
if res == y
exe ':call AutoSaveVimSesn()'
endif
endfunction
 Global variable saved

 au SessionLoadPost * let g:netrw_list_hide= g:Netrw_list_hide
 And the line above in my .vimrc 
 might work.
 And now it works! 

 Thanks for the solution.
 regards
-- 
Tim 
tim at johnsons-web dot com or akwebsoft dot com
http://www.akwebsoft.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


Re: Passing Env Variables to Grep(as intended folders) search does not work under win32?

2011-06-30 Thread kuru
Chris

I do have Cygwin here and I cannot tell which grep Vim(windows
version) uses to be honest, since I cannot get grep to print the
platform but I believe it is the windows version from Windows Gnu
utilities which has v 2.5 while Cygwin version is 2.6. I have both
greps in my system because I am on 64bit and I had issues with Cygwin
utilities.

In any case I have export ed $INCLUDES in my .bashrc so when I echo in
Cygwin shell

$ echo $INCLUDES
/cygdrive/c/MinGW/include

When I echo in Vim
c:\\MinGW\\include

I am using Windows version of Gvim

I feel like Vim is not expanding $INCLUDES to grep  in this command
because if I just put straight absolute path to MinGW\include grep
works
works
:grep -i rand c:\MinGW\include/*

does not work
:grep -i random $INCLUDES/*


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


Python plugin using PyWin32

2011-06-30 Thread Alexandre Martani

Hello all,

I am trying to use Vim R plugin [1], which is a Python plugin that uses 
PyWin32 on Windows. I have installed Python 2.7.1 and PyWin32. It is 
installed correctly, as I am able to do a import win32api from python 
shell without errors. But, on GVim, if I do:


:python import win32api

I receive the following error:

Traceback (most recent call last):
File string, line 1, in module
ImportError: DLL load failed: The specified module could not be found.

Notice that this is not the standard error for module not found (No 
module named x). It is probably related to the path python uses for its 
DLL modules. I have played with sys.path, but without success.


I also noticed the first path in sys.path is C:\\mustnotexist, which 
is probably a bug. Don't know if this could be related, but I tried do a 
sys.path.pop(0), and it didn't work.


Anyone has an idea of the problem?

Thanks

[1] - http://www.vim.org/scripts/script.php?script_id=2628
--
*Alexandre Martani* | GDX Investimentos

mailto:alexandre.mart...@gdx.com.br

--
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: Passing Env Variables to Grep(as intended folders) search does not work under win32?

2011-06-30 Thread Gary Johnson
On 2011-06-30, kuru wrote:
 Chris
 
 I do have Cygwin here and I cannot tell which grep Vim(windows
 version) uses to be honest, since I cannot get grep to print the
 platform but I believe it is the windows version from Windows Gnu
 utilities which has v 2.5 while Cygwin version is 2.6. I have both
 greps in my system because I am on 64bit and I had issues with Cygwin
 utilities.
 
 In any case I have export ed $INCLUDES in my .bashrc so when I echo in
 Cygwin shell
 
 $ echo $INCLUDES
 /cygdrive/c/MinGW/include
 
 When I echo in Vim
 c:\\MinGW\\include
 
 I am using Windows version of Gvim
 
 I feel like Vim is not expanding $INCLUDES to grep  in this command
 because if I just put straight absolute path to MinGW\include grep
 works
 works
 :grep -i rand c:\MinGW\include/*
 
 does not work
 :grep -i random $INCLUDES/*

Vim doesn't expand environment variables in commands executed by the
shell, it lets the shell do the expansion.  If your shell is
Window's cmd.exe, it won't know how to expand a Unix-style
environment variable.

To see which shell Vim is using, execute

:set shell?

You should be able to see the command Vim executes when you execute

:grep -i random $INCLUDES/*

When I do that, I see

:!findstr /n -i random $INCLUDES/* 
C:\DOCUMEN~1\garyjohn\LOCALS~1\Temp\VIeCF5.tmp 21
shell returned 1
(1 of 1): FINDSTR: Cannot open $INCLUDES/*

(You may have redefined 'grepprg', but if your shell is cmd.exe, the
principles will be the same.)

I don't have $INCLUDES defined, so I tried an environment variable
that I do have defined, $USERNAME.  The results were essentially the
same, as expected.

:!findstr /n -i random $USERNAME/* 
C:\DOCUMEN~1\garyjohn\LOCALS~1\Temp\VIeCFA.tmp 21
shell returned 1
(1 of 1): FINDSTR: Cannot open $USERNAME/*

However, the following worked, in the sense that $USERNAME, or
rather %USERNAME%, was correctly expanded.

:grep -i random \%USERNAME\%/*

:!findstr /n -i random %USERNAME%/* 
C:\DOCUMEN~1\garyjohn\LOCALS~1\Temp\VIeCFB.tmp 21
shell returned 1
(1 of 1): FINDSTR: Cannot open garyjohn/*

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


Re: Passing Env Variables to Grep(as intended folders) search does not work under win32?

2011-06-30 Thread kuru
Gary thank you for very detail follow up on this. It helped me to see
some of the issues.

You are right that I have set up the grepprg in my rc
set grepprg=grep\ -niH

-Cmd.exe
grep -i random %INCLUDES%/*
--works--

- Gvim(win32)
:grep -i random \%INCLUDES\%/*
--works--

This way I am also able to use the Vim defined variables as env
variables. For example
let $INCLUDES1=c:\somedevfolder

:grep -i random \%INCLUDES1\%/*
--works--


I set my shell to c:\cygwin\bin\bash in Gvim
:grep -i random $INCLUDES/*
--works(because uses Cygwin grep) but then I cannot open the files in
the quick fix because they are all in Cygwin Unix paths--


Thanks again for all the help. This is going to be super helpful to
me.

-- 
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: Python plugin using PyWin32

2011-06-30 Thread sc
On Thursday, June 30, 2011 09:35:51 Alexandre Martani wrote:

 Hello all,

 I am trying to use Vim R plugin [1], which is a Python plugin
 that uses PyWin32 on Windows. I have installed Python 2.7.1
 and PyWin32. It is installed correctly, as I am able to do a
 import win32api from python

 shell without errors. But, on GVim, if I do:
 :python import win32api

 I receive the following error:

 Traceback (most recent call last):
 File string, line 1, in module
 ImportError: DLL load failed: The specified module could not
 be found.

 Notice that this is not the standard error for module not
 found (No module named x). It is probably related to the
 path python uses for its DLL modules. I have played with
 sys.path, but without success.

 I also noticed the first path in sys.path is
 C:\\mustnotexist, which is probably a bug. Don't know if
 this could be related, but I tried do a sys.path.pop(0), and
 it didn't work.

 Anyone has an idea of the problem?

just guessing here, but python 2.7.1 is fairly new -- there's
a good chance your vim was compiled with 2.6 and can't find
the 2.6 dll


 Thanks

 [1] - http://www.vim.org/scripts/script.php?script_id=2628

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


Fold the output of grep

2011-06-30 Thread howard Schwartz
Your output sounds great, and the grep display format is one I prefer, but it 
is not supported directly by gnu grep.


Is there a way to fold the context lines that appear in your popup window?
If so, how?


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


Keeping the Cursor in the Taglist Window

2011-06-30 Thread Roy Fulbright




I have the taglist plugin and it works great. I have 
'Tlist_GainFocus_On_ToggleOpen' set so that the cursor is in the taglist window 
when it opens. This works fine, but when I scroll the cursor down to an entry 
and press ENTER the cursor is moved to the main Vim window. I would like the 
cursor to remain in the taglist window as I select different taglist entries so 
I won't have to keep moving it back each time to make another selection. Is 
there a setting that keeps the cursor in the taglist window while making 
selections from the taglist? 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


Re: Keeping the Cursor in the Taglist Window

2011-06-30 Thread Kent Sibilev
On Thu, Jun 30, 2011 at 9:54 PM, Roy Fulbright rfulb...@hotmail.com wrote:
 I have the taglist plugin and it works great. I have
 'Tlist_GainFocus_On_ToggleOpen' set so that the cursor is in the taglist
 window when it opens. This works fine, but when I scroll the cursor down to
 an entry and press ENTER the cursor is moved to the main Vim window. I would
 like the cursor to remain in the taglist window as I select different
 taglist entries so I won't have to keep moving it back each time to make
 another selection. Is there a setting that keeps the cursor in the taglist
 window while making selections from the taglist? 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


Instead of Enter press 'p'. Also :help taglist.txt

-- 
Kent

-- 
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: How to retrigger 'autocmd' ?

2011-06-30 Thread narke
On 29 June 2011 11:08, Ben Fritz fritzophre...@gmail.com wrote:


 On Jun 28, 4:31 am, narke narkewo...@gmail.com wrote:
 Hi,

 When I 'vimgrep' on a large file tree, I usually turn of 'autocmd' by
 ':noau vimgrep /xxx/ **/*.c'.   Then I got c file open in a buffer but
 without the syntax highlighting (maybe also other good things). So I
 think what I need to do is to retriggle those 'autocmd' that would
 been usually executed if I don't do 'noau ...'.  Can anyone tell me
 how to, if possible?

 Thanks in advance.


 I normally add the 'j' flag to my vimgrep to avoid an automatic jump
 to the first match. Then I can use the quickfix window with :copen, or
 just use :cnext/:cprev/:ccurrent to navigate. When these commands load
 a new file, it triggers all the proper autocmds.

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


Thanks for all your inputs.  At the end, I so much like Ben's
solution: using the 'j' flag of vimgrep.

Cheers!
narke


-- 
Life is the only flaw in an otherwise perfect nonexistence
    -- Schopenhauer

narke
public key at http://subkeys.pgp.net:11371 (narkewo...@gmail.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