Re: Pattern questions

2006-05-23 Thread A.J.Mechelynck

Zdenek Sekera wrote:

I have this:

if (char =~ '\m[;|?:[EMAIL PROTECTED]*(){}\\_+-[\]/\]')
  do something
endif

Basically it is checking for all non-alphanumeric chars
(expect '=').

1. how do I include the ' char?.
   I can't seem to find a proper way.
   (I'd like to keep the patter in enclosed in '...')

2. why when the pattern ends with '+' or '\+' do I get
   an error?

---Zdenek


1. Starting with version 7, you can have a single quote in a 
single-quoted string by doubling the single quote. Thus,  (four 
single quotes) represents one single quote and 'a''b' (quote a quote 
quote b quote) is a string consisting of the letters a and b with a 
single quote between them.


In all versions, you can concatenate strings, and a single quote can be 
enclosed in a double-quoted string. Thus, '' . ' (single double 
single space dot space double single double) is an expression whose 
value is a String consisting of a double quote followed by a single quote.


2. I don't know, but I think it's either a bug, or documented under 
:help pattern.txt somewhere.



Best regards,
Tony.


RE: Pattern questions

2006-05-23 Thread Zdenek Sekera
 -Original Message-
 From: A.J.Mechelynck [mailto:[EMAIL PROTECTED] 
 Sent: 23 May 2006 14:22
 To: Zdenek Sekera
 Cc: vim-dev@vim.org
 Subject: Re: Pattern questions
 
 Zdenek Sekera wrote:
  I have this:
 
  if (char =~ '\m[;|?:[EMAIL PROTECTED]*(){}\\_+-[\]/\]')
do something
  endif
 
  Basically it is checking for all non-alphanumeric chars
  (expect '=').
 
  1. how do I include the ' char?.
 I can't seem to find a proper way.
 (I'd like to keep the patter in enclosed in '...')
 
  2. why when the pattern ends with '+' or '\+' do I get
 an error?
 
  ---Zdenek
 
 
 1. Starting with version 7, you can have a single quote in a 
 single-quoted string by doubling the single quote. Thus,  (four 
 single quotes) represents one single quote and 'a''b' (quote a quote 
 quote b quote) is a string consisting of the letters a and b with a 
 single quote between them.
 

Arrrgh, missed that in the doc somewhere, I'm running vim7 
(I forgot to say so)

 In all versions, you can concatenate strings, and a single 
 quote can be 
 enclosed in a double-quoted string. Thus, '' . ' (single double 
 single space dot space double single double) is an expression whose 
 value is a String consisting of a double quote followed by a 
 single quote.
 

Arrrgh :-), that I new but didn't think of.

 2. I don't know, but I think it's either a bug, or documented under 
 :help pattern.txt somewhere.

My feelings, too, but I can't find it anywhere in the pattern.txt
(and I printer the newest on purpose :-)!

Thanks, Tony, for help.

---Zdenek


set readonly - strange?

2006-05-23 Thread Zdenek Sekera

create a file ~/.vimtest as follows:

cat  .vimtest
set nocompatible
set readonly
C-D

and execute (g)vim:

vim .vimtest -u .vimtest

try :set readonly? and you'll get 'noreadonly'.

Looks strange at the minimum, bug?

---Zdenek



Re: set readonly - strange?

2006-05-23 Thread Eric Arnold

I wouldn't expect that to work.  There is no defined loaded buffer
when the -u vimrc is run.  'readonly' is local to buffers only, so in
your example, it has no buffer to be applied to.

If you want everything to be readonly, try setting a BufEnter autocommand.

If you want just one file to be readonly, try setting the mode line.

Also consider:

gvimd -c 'so .vimtest' .vimtest

On 5/23/06, Zdenek Sekera [EMAIL PROTECTED] wrote:

create a file ~/.vimtest as follows:

cat  .vimtest
set nocompatible
set readonly
C-D

and execute (g)vim:

vim .vimtest -u .vimtest

try :set readonly? and you'll get 'noreadonly'.

Looks strange at the minimum, bug?

---Zdenek




Re: set readonly - strange?

2006-05-23 Thread Eric Arnold

As far as I can tell, there are several instances where there are
transitory buffers as vim is starting, opening a new tab, probably
some in closing op.s.

I don't know if I used the right word by saying the buffer is
undefined, but I don't think it it's guaranteed to be usable until a
certain point, which is after -u, and at the first file loaded, i.e.
-c

If you open a buffer explicitly from inside .vimtest , then that's a
different story.

It's kinda bug-ish, but it's not a bug unless it's contrary to stated
behavior.  It'll be interesting to see how Bram addresses it.

On 5/23/06, Yakov Lerner [EMAIL PROTECTED] wrote:

 On 5/23/06, Zdenek Sekera [EMAIL PROTECTED] wrote:
  create a file ~/.vimtest as follows:
 
  cat  .vimtest
  set nocompatible
  set readonly
  C-D
 
  and execute (g)vim:
 
  vim .vimtest -u .vimtest
 
  try :set readonly? and you'll get 'noreadonly'.

The buffer does exist when initfile is executed. The ':ls' in initfile shows it.
Adding more printouts to initfile shows interesting results:

vim -u 1 1
- file called 1 ---
set nocompatible
ls
call input('before set readonly 111')
set readonly
set readonly?
ls
set readonly?
set readonly?
echo readonly=.readonly
call input('after set readonly 222')
-
In vim, ':verb set readonly?' shows that readonly is misteriously reset.
The output differs between vim6 and vim7.
--- vim7 output --
  1 %1line 1
before set readonly 111
  1 % =  1line 1


readonly=1
after set readonly 222

Note the missing output of ':set readonly?'!!! It prints neither
'readonly' nor 'noreadonly'.
- vim6 output 

  1 %1line 1
before set readonly 111
 before set readonly 111
  1 % =  1line 1
  readonly
  readonly
readonly=1
after set readonly 222
-

Looks like a bug to me.

Yakov



Re: netrw, winxp, and a problem...

2006-05-23 Thread A.J.Mechelynck

Charles E Campbell Jr wrote:

Hello, Tony!

I've had several folks having a problem with WinXP and netrw.  The 
problems seem to involve temporary files during attempts to use ftp; 
since temporary filenames are produced by tempname(), they're o/s 
dependent.  Admittedly without having searched the source, I figure 
that these temporary files are in fact produced by the C function 
tmpnam() -- hmm, I did just do that search, and tmpnam() is used.  
Since that's a C-library function, these temporary files are 
presumably not only o/s dependent but compiler dependent.


I generally compile my own vim using cygwin+gcc for Windows.  I've 
never seen the problems these folks are having.  So, last night I 
downloaded a copy of your compiled vim (7.0aa, perhaps patched to 213? 
- I don't recall exactly).  I also installed my latest netrw, and used 
it in a dos (cmd.exe)
window, and furthermore used vim -u NONE  (also, set nocp and :so 
..path-to-netrwPlugin.vim).  I was hoping to finally see these 
problems, but I still was able to do remote browsing, readwrite and 
NreadNwrite without any problems.


So, have you had any issues with remote browsing/ftp with netrw?  Do 
you have any suspicions as to what the problem might be?  What 
compiler do you use?


Thank you,
Chip Campbell



Sorry, Dr. Chip, I can't help you there so I'm referring you to the 
vim-dev list:


1. As a rule, I don't edit over ftp, I edit my files locally and, when 
I'm satisfied with the result, I upload them with any available ftp 
client. If I want to make sure that my files look all right, I browse 
them with my favourite web browser (both locally with file: and 
remotely with http: or ftp; )


2. At the moment, my Windows computer is in the Netherlands for repairs 
(which will cost me almost 250 € including postage and handling), I'm on 
Linux at the moment. This also explains why my Vim builds for Windows 
have been temporarily discontinued -- no ETA when (if ever) I'll be 
able to resume them.


About the computer I use: my (now broken-down) Windows computer was a 
laptop with WinXP 5.1.2600 SP2 and the same vim  gvim as those I used 
to distribute; I compiled my latest Vim versions for native-Windows 
using Cygwin gcc and src/Make_cyg.mak. Before that I had used Borland 
BCC32 but it proved inadequate for UTF-8 operation (even if only the 
data, not the filenames, were in UTF-8). My current computer is a 
desktop with Novell-SuSE Linux Professional 9.3 and (currently) gvim 
7.0.017, huge version for GTK+2 and static perl, ruby and TCL, compiled 
with gcc 3.3.5 20050117 (prerelease) (SuSE Linux). I don't feel that 
this vim executable is good enough for public distribution but I will 
readily help other Unix Vimmers to compile their own if they need help: 
it's even easier than on Windows. (For Windows, there is a HowTo on my 
web site.)


Creation and opening of a temporary zero-length file with a unique name 
in a given directory is a well-documented system call on Dos-like 
systems; I wouldn't expect it to be compiler-dependent since the OS 
explicitly provides it. (I'm not familiar with specific Windows calls 
but there is a Dos system call for it since Dos 3 or maybe earlier.)


If it works OK with your latest version of netrw, then maybe the trouble 
is that the version of netrw distributed with Vim 7.0 is _not_ the 
latest one? The 7.0 release version I have here consists of:


$VIMRUNTIME/plugin/netrwPlugin.vim dated Oct. 27, 2005

$VIMRUNTIME/autoload/netrw.vim, version 98 dated May 02, 2006

$VIMRUNTIME/autoload/netrwFileHandlers.vim, version 8 dated May 01, 2006

$VIMRUNTIME/autoload/netrwSettings.vim, version 6 dated Mar 22, 2006.

I got my sources and runtimes over FTP (all 3 archives, unix+extra+lang 
-- so even patches for modules I don't need won't complain -- and 17 
patches). For Vim 7.0aa, I used to download the snapshot zipfiles 
whenever I noticed a new one -- until my laptop ceased to work.



Best regards,
Tony.


Using py commands to evaluate text for balloon commands..

2006-05-23 Thread Mohsin

I am trying to use the  ':py' interface to evaluate text under cursor and show
the result in a balloon text.  I got the python and vim code to work easily,
however I have problem communicating between the two (py and vim):

1. How do I access vim variables in py commands
  (like text under cursor, all the 'let variables', 'set options')?

2. In the Balloon vim function, how do I access py variables.
   Note that I am not  happy with just printing the py result on the
message line -
   I want the py output (ot data structures
   in a vim variable to display it in a balloon.

A transparent clean py/vim interface will allow us to
reuse a large part of python library inside vim scripts.

Any help appreciated.
thanks,
Mohsin


Re: Pattern questions

2006-05-23 Thread Yakov Lerner

On 5/23/06, Zdenek Sekera [EMAIL PROTECTED] wrote:

I have this:

if (char =~ '\m[;|?:[EMAIL PROTECTED]*(){}\\_+-[\]/\]')
   do something
endif

Basically it is checking for all non-alphanumeric chars
(expect '=').

1. how do I include the ' char?.
I can't seem to find a proper way.
(I'd like to keep the patter in enclosed in '...')


let pat='[;|?:[EMAIL PROTECTED]*(){}\\_+-[\]/\'.'.']'

Yakov


viminfo feature not working after upgrade from vim6.2-vim7.0

2006-05-23 Thread Srinivas Rao. M
Hi,
When i upgraded my vim from vim6.2 to vim7.0, i am finding that the
feature viminfo is not working. (Viminfo remembers last position in the
file when we reopen file). I had set the viminfo option in my .vimrc
file as.

set viminfo='1000,f1,\500

Do i have to add any special options for vim7 ?.



VIM - Vi IMproved 7.0 (2006 May 7, compiled May 23 2006 12:47:54)
Compiled by [EMAIL PROTECTED]
Big version with GTK2 GUI.  Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset
+cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info
+comments
+cryptv +cscope +cursorshape +dialog_con_gui +diff +digraphs +dnd
-ebcdic
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path
+find_in_path
+folding -footer +fork() -gettext -hangul_input +iconv +insert_expand
+jumplist
+keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap
+menu
+mksession +modify_fname +mouse +mouseshape +mouse_dec +mouse_gpm
-mouse_jsbterm +mouse_netterm +mouse_xterm +multi_byte +multi_lang
-mzscheme
+netbeans_intg -osfiletype +path_extra -perl +postscript +printer
-profile
-python +quickfix +reltime +rightleft -ruby +scrollbind +signs
+smartindent
-sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static
-tag_any_white -tcl +terminfo +termresponse +textobjects +title +toolbar
+user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
+vreplace
+wildignore +wildmenu +windows +writebackup +X11 -xfontset +xim
+xsmp_interact
+xterm_clipboard -xterm_save
   system vimrc file: $VIM/vimrc
 user vimrc file: $HOME/.vimrc
  user exrc file: $HOME/.exrc
  system gvimrc file: $VIM/gvimrc
user gvimrc file: $HOME/.gvimrc
system menu file: $VIMRUNTIME/menu.vim
  fall-back for $VIM: /usr/local/share/vim
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK 
-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0
-I/usr/include/pango-1.0 -I/usr/X11R6/include -I/usr/include/freetype2
-I/usr/include/freetype2/config -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -g -O2  -I/usr/X11R6/include
Linking: gcc  -L/usr/X11R6/lib   -L/usr/local/lib -o vim  
-Wl,--export-dynamic -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0
-lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0
-lgobject-2.0 -lgmodule-2.0 -lglib-2.0   -lXt -lncurses -lacl -lgpm


regards,
Srini...



Re: Printing on paper

2006-05-23 Thread A.J.Mechelynck

Robert Cussons wrote:

...snip
Alternately, you can /set/ different highlighting colors by using a 
color scheme (see :help :colorscheme). Make sure that you use a 
color scheme with a bright background and dark text. Or else, view 
the file in the GUI, which uses black text on white background by 
default, but requires a windowing system such as Windows, Macintosh 
or X11 (bare bones Unix without X11 won't do). You can then print 
with the same highlighting, but it will (at least temporarily) 
display (mostly) dark text on a bright background on your terminal too.



Best regards,
Tony.



Thanks Tony, I am actually running KDE Linux and using gvim, is that 
what you meant by viewing the file in the GUI, or did you mean the 
opposite and that I would have to view it in the terminal window, all 
the commands vim, vi and gvim, point to vim, which launches in a 
separate window, so I'm not sure how to launch in a terminal window.


Many thanks,
Rob.


The GUI is gvim -- the Graphical User Interface for Vim. On Unix, but 
not on Windows (I'm not sure about Mac), it is possible to use a single 
executable with (at different times) either a graphical interface (when 
invoked as gvim or as vim -g, and provided that it can establish a 
connection with X11) or a text one (when invoked as vim without -g, or 
IIUC when it cannot reach X11). The default colors (with no colorscheme) 
for the GUI (gvim) are nonbold black on white, for console Vim (vim) it 
is whatever was set in the shell console, typically light grey on black.


To launch console Vim in an xterm or konsole, invoke it as vim (not 
gvim), or as vim -X if you don't even want to have it try to check for 
X11 (a text-mode vim can, if compiled for it, use the X11 clipboard). 
You can also launch it that way in a non-X text terminal such as 
/dev/tty -- on Linux, or at least on the Linux flavours that I know, 
there are 6 such virtual consoles, /dev/tty1 to /dev/tty6, available 
for logging in in text mode and accessed by hitting any key combo from 
Ctrl-Alt-F1 for /dev/tty1, which is special in that its screen is not 
cleared at the end of the bootup sequence, showing the init messages, 
to Ctrl-Alt-F6 for /dev/tty6; and Ctrl-Alt-F7 brings you back to the 
graphical X11 display, if X11 is started.



Best regards,
Tony.


Re: viminfo feature not working after upgrade from vim6.2-vim7.0

2006-05-23 Thread James Vega
On Tue, May 23, 2006 at 05:30:37PM +0530, Srinivas Rao. M wrote:
 Hi,
 When i upgraded my vim from vim6.2 to vim7.0, i am finding that the
 feature viminfo is not working. (Viminfo remembers last position in the
 file when we reopen file). I had set the viminfo option in my .vimrc
 file as.
 
 set viminfo='1000,f1,\500
 
 Do i have to add any special options for vim7 ?.

That feature isn't an option that's set, but an autocommand that is run.
It was probably in your system-wide vimrc before you upgraded.  You can
add the code snippet at :help last-position-jump to your .vimrc to
re-enable that behavior.

James
-- 
GPG Key: 1024D/61326D40 2003-09-02 James Vega [EMAIL PROTECTED]


signature.asc
Description: Digital signature


RE: Pattern questions

2006-05-23 Thread Zdenek Sekera
 -Original Message-
 From: Yakov Lerner [mailto:[EMAIL PROTECTED] 
 Sent: 23 May 2006 11:37
 To: Zdenek Sekera; vim mailing list
 Subject: Re: Pattern questions
 
 On 5/23/06, Zdenek Sekera [EMAIL PROTECTED] wrote:
  I have this:
 
  if (char =~ '\m[;|?:[EMAIL PROTECTED]*(){}\\_+-[\]/\]')
 do something
  endif
 
  Basically it is checking for all non-alphanumeric chars
  (expect '=').
 
  1. how do I include the ' char?.
  I can't seem to find a proper way.
  (I'd like to keep the patter in enclosed in '...')
 
 let pat='[;|?:[EMAIL PROTECTED]*(){}\\_+-[\]/\'.'.']'

Thanks, Tony suggested similar solution.

---Zdenek


RE: Vim for Palm

2006-05-23 Thread Furash Gary
I tried SiEd - pedit seemed more complicated than I need.  Still would
be nice to have vim for palm os. 

-Original Message-
From: Marv Boyes [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 22, 2006 10:53 AM
To: vim@vim.org
Subject: Re: Vim for Palm

In terms of power beyond just editing, you can't do any better on Palm
than pedit (http://www.osuweb.net/~pc/pedit/man/pedit_man.html).
Scriptable and as feature-rich as Palm apps come. It's only vim-like
in terms of its power.

If you'd rather go the free route, there's SiEd
(http://benroe.com/sied/index.shtml). I've used this one for awhile and
like it. It edits and saves as plain text, supports macros, and offers
an optional split screen for editing two files at once. Not as powerful
as pedit, but much more straightforward in its operation.

Vim on palm would be nice indeed, especially if you use an external
keyboard.



On 5/22/06, Furash Gary [EMAIL PROTECTED] wrote:
  There used to be a build but I haven't found anything recently.  Does

 anyone know of a vim or vi like thing available for palms?



How to get cygwin command line to know where it is

2006-05-23 Thread Furash Gary
I'm using VIM on windows with cygwin.  In my _vimrc I've got the
following

 automatically swithc directories 
set autochdir

 For cygwin shell
set shell=C:/cygwin/bin/bash 
set shellcmdflag=--login\ -c 
set shellxquote=\ 

When I try to use cygwin stuff with the ! command or similar things
from vim, it doesn't seem to know where it is.

That is, if I open up a file on the desktop with gvim, and do

:pwd

It prints out the path of the desktop (thanks to autochdir I think).
However, if I do

:! pwd

It prints out the location of my windows home directory.  Is there
anyway I could automatically pass to the shell the location it should
start in?


Re: How to get cygwin command line to know where it is

2006-05-23 Thread Eric Arnold

This is partly due to the use of   --login  , which causes it to act
as if it's a fresh login shell, so of course, it goes to your home
directory.  Try it with just   -c  .

Without setting that, zsh and bash seem to honor $PWD, probably, which
I suspect is exported by Vim..  I'm having trouble getting my rc file
to print it out when started from Vim.


On 5/23/06, Furash Gary [EMAIL PROTECTED] wrote:

I'm using VIM on windows with cygwin.  In my _vimrc I've got the
following

 automatically swithc directories
set autochdir

 For cygwin shell
set shell=C:/cygwin/bin/bash
set shellcmdflag=--login\ -c
set shellxquote=\

When I try to use cygwin stuff with the ! command or similar things
from vim, it doesn't seem to know where it is.

That is, if I open up a file on the desktop with gvim, and do

:pwd

It prints out the path of the desktop (thanks to autochdir I think).
However, if I do

:! pwd

It prints out the location of my windows home directory.  Is there
anyway I could automatically pass to the shell the location it should
start in?



Re: How to get cygwin command line to know where it is

2006-05-23 Thread A.J.Mechelynck

Furash Gary wrote:

I'm using VIM on windows with cygwin.  In my _vimrc I've got the
following

	 automatically swithc directories 
	set autochdir


 For cygwin shell
	set shell=C:/cygwin/bin/bash 
	set shellcmdflag=--login\ -c 
	set shellxquote=\ 


When I try to use cygwin stuff with the ! command or similar things
from vim, it doesn't seem to know where it is.

That is, if I open up a file on the desktop with gvim, and do

:pwd

It prints out the path of the desktop (thanks to autochdir I think).
However, if I do

:! pwd

It prints out the location of my windows home directory.  Is there
anyway I could automatically pass to the shell the location it should
start in?



  
:pwd and :! pwd don't return the same directory, that is normal. 
:pwd returns Vim's internal current directory, it changes whenever 
you use internal :cd, and 'autochdir' can change it implicitly; such 
changes are not brought back to the shell. To change the shell's current 
directory (as shown by :! pwd on Unix-like systems and by :! cd on 
dos-like systems) you can use the :! cd command, as follows:


au BufReadPost * exe !cd expand(%:p:h)

The above is untested but I believe it ought to work on Unix as well as 
on Windows.



Best regards,
Tony.


Re: How to get cygwin command line to know where it is

2006-05-23 Thread Gary Johnson
On 2006-05-24, A.J.Mechelynck [EMAIL PROTECTED] wrote:
 Furash Gary wrote:
  I'm using VIM on windows with cygwin.  In my _vimrc I've got the
  following
 
   automatically swithc directories 
  set autochdir
 
   For cygwin shell
  set shell=C:/cygwin/bin/bash 
  set shellcmdflag=--login\ -c 
  set shellxquote=\ 
 
  When I try to use cygwin stuff with the ! command or similar things
  from vim, it doesn't seem to know where it is.
 
  That is, if I open up a file on the desktop with gvim, and do
 
  :pwd
 
  It prints out the path of the desktop (thanks to autochdir I think).
  However, if I do
 
  :! pwd
 
  It prints out the location of my windows home directory.  Is there
  anyway I could automatically pass to the shell the location it should
  start in?
 
 
 

 :pwd and :! pwd don't return the same directory, that is normal. 

In my experience, such behavior is not normal.

 :pwd returns Vim's internal current directory, it changes whenever 
 you use internal :cd, and 'autochdir' can change it implicitly; such 
 changes are not brought back to the shell.

They are not brought back to the parent shell's environment, but
they do affect the environment of any shell that vim executes.

To change the shell's current 
 directory (as shown by :! pwd on Unix-like systems and by :! cd on 
 dos-like systems) you can use the :! cd command, as follows:

:!cd somedirectory will not do anything useful.  It will start a
shell, change the working directory of that shell, and the shell
will exit, returning control to vim.  It will not affect the
environment of vim or of any subsequent shell.

 au BufReadPost * exe !cd expand(%:p:h)
 
 The above is untested but I believe it ought to work on Unix as well as 
 on Windows.

Windows handles its process environments differently than Unix does.
If the Windows shell, cmd.exe, starts another program and that
program performs a cd, when that program exits, the working
directory of cmd.exe will have changed to the directory set by the
program.  In Unix, on the other hand, a process inherits its
environment from its parent and passes its environment on to its
children, but changes to the environment by a child are never
reflected in the parent's environment.

Regards,
Gary

-- 
Gary Johnson | Agilent Technologies
[EMAIL PROTECTED] | Wireless Division
 | Spokane, Washington, USA


RE: How to get cygwin command line to know where it is

2006-05-23 Thread Furash Gary
I copied it from a vim help note without really understanding it.  Makes
100% sense now, but... Is there still a way to get it to act like I've
logged in (e.g., run .bashrc etc.)?  

-Original Message-
From: Gary Johnson [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 23, 2006 3:14 PM
To: vim@vim.org
Subject: Re: How to get cygwin command line to know where it is

On 2006-05-23, Furash Gary [EMAIL PROTECTED] wrote:
 I'm using VIM on windows with cygwin.  In my _vimrc I've got the 
 following
 
automatically swithc directories 
   set autochdir
 
For cygwin shell
   set shell=C:/cygwin/bin/bash 
   set shellcmdflag=--login\ -c 
   set shellxquote=\ 
 
 When I try to use cygwin stuff with the ! command or similar things 
 from vim, it doesn't seem to know where it is.
 
 That is, if I open up a file on the desktop with gvim, and do
 
   :pwd
 
 It prints out the path of the desktop (thanks to autochdir I think).
 However, if I do
 
   :! pwd
 
 It prints out the location of my windows home directory.  Is there 
 anyway I could automatically pass to the shell the location it should 
 start in?

The problem is the --login option that you included in 'shellcmdflag'.
Every shell that you execute from vim is executed as a login shell,
which means it starts in your home directory.  If you just

set shellcmdflag=-c 

instead, it should work fine.

Why did you include --login?

Gary

-- 
Gary Johnson | Agilent Technologies
[EMAIL PROTECTED] | Wireless Division
 | Spokane, Washington, USA


RE: How to get cygwin command line to know where it is

2006-05-23 Thread Furash Gary
Just tried it and ran into the problem I thought I would.  Removing
login eliminates the problem of it not knowing where it is, but it no
longer runs .profile and so on, so as a result it's missing my changes
to the path, aliases, etc.

Hmm...

-Original Message-
From: Gary Johnson [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 23, 2006 3:14 PM
To: vim@vim.org
Subject: Re: How to get cygwin command line to know where it is

On 2006-05-23, Furash Gary [EMAIL PROTECTED] wrote:
 I'm using VIM on windows with cygwin.  In my _vimrc I've got the 
 following
 
automatically swithc directories 
   set autochdir
 
For cygwin shell
   set shell=C:/cygwin/bin/bash 
   set shellcmdflag=--login\ -c 
   set shellxquote=\ 
 
 When I try to use cygwin stuff with the ! command or similar things 
 from vim, it doesn't seem to know where it is.
 
 That is, if I open up a file on the desktop with gvim, and do
 
   :pwd
 
 It prints out the path of the desktop (thanks to autochdir I think).
 However, if I do
 
   :! pwd
 
 It prints out the location of my windows home directory.  Is there 
 anyway I could automatically pass to the shell the location it should 
 start in?

The problem is the --login option that you included in 'shellcmdflag'.
Every shell that you execute from vim is executed as a login shell,
which means it starts in your home directory.  If you just

set shellcmdflag=-c 

instead, it should work fine.

Why did you include --login?

Gary

-- 
Gary Johnson | Agilent Technologies
[EMAIL PROTECTED] | Wireless Division
 | Spokane, Washington, USA


Re: How to get cygwin command line to know where it is

2006-05-23 Thread Eric Arnold

Try this:

set shell=C:/cygwin/bin/bash
  let $BASH_ENV = '~/.bashrc'
  let shellcmdflag='-c'


On 5/23/06, Eric Arnold [EMAIL PROTECTED] wrote:

Off hand, I can't remember the exact name, but I think that there is a
special rc filename that is executed even when it isn't a login
shell.



On 5/23/06, Furash Gary [EMAIL PROTECTED] wrote:
 Just tried it and ran into the problem I thought I would.  Removing
 login eliminates the problem of it not knowing where it is, but it no
 longer runs .profile and so on, so as a result it's missing my changes
 to the path, aliases, etc.

 Hmm...

 -Original Message-
 From: Gary Johnson [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, May 23, 2006 3:14 PM
 To: vim@vim.org
 Subject: Re: How to get cygwin command line to know where it is

 On 2006-05-23, Furash Gary [EMAIL PROTECTED] wrote:
  I'm using VIM on windows with cygwin.  In my _vimrc I've got the
  following
 
 automatically swithc directories
set autochdir
 
 For cygwin shell
set shell=C:/cygwin/bin/bash
set shellcmdflag=--login\ -c
set shellxquote=\
 
  When I try to use cygwin stuff with the ! command or similar things
  from vim, it doesn't seem to know where it is.
 
  That is, if I open up a file on the desktop with gvim, and do
 
:pwd
 
  It prints out the path of the desktop (thanks to autochdir I think).
  However, if I do
 
:! pwd
 
  It prints out the location of my windows home directory.  Is there
  anyway I could automatically pass to the shell the location it should
  start in?

 The problem is the --login option that you included in 'shellcmdflag'.
 Every shell that you execute from vim is executed as a login shell,
 which means it starts in your home directory.  If you just

 set shellcmdflag=-c

 instead, it should work fine.

 Why did you include --login?

 Gary

 --
 Gary Johnson | Agilent Technologies
 [EMAIL PROTECTED] | Wireless Division
  | Spokane, Washington, USA




Re: How to get cygwin command line to know where it is

2006-05-23 Thread Gerald Lai

On Wed, 24 May 2006, A.J.Mechelynck wrote:


Eric Arnold wrote:

Off hand, I can't remember the exact name, but I think that there is a
special rc filename that is executed even when it isn't a login
shell.

[...]

Yes, I think so too, and I don't remember it offhand either, but man bash 
(which is quite long for a manpage) will tell you.


Perhaps it's called .bashenv? Not sure. I use ZSH. It's equivalent is 
.zshenv.
--
Gerald


Re: How to get cygwin command line to know where it is

2006-05-23 Thread A.J.Mechelynck

Gerald Lai wrote:

On Wed, 24 May 2006, A.J.Mechelynck wrote:


Eric Arnold wrote:

Off hand, I can't remember the exact name, but I think that there is a
special rc filename that is executed even when it isn't a login
shell.

[...]

Yes, I think so too, and I don't remember it offhand either, but man 
bash (which is quite long for a manpage) will tell you.


Perhaps it's called .bashenv? Not sure. I use ZSH. It's equivalent 
is .zshenv.

--
Gerald



As said under INVOCATION in the bash manpage:

Login shell: /etc/profile (if found), then the first one (if any) found 
readable among ~/.bash_profile, ~/.bash_login, ~/.profile (all this 
unless --noprofile). At exit: ~/.bash_logout (if found).


Non-login interactive shell: ~/.bashrc (if found) unless --norc

Non-interactive shell: does as if executing
if [ -n BASH_ENV ]; then . $BASH_ENV; fi
but doesn't search the $PATH

There are more details about what bash does when invoked as sh, when 
invoked in posix mode, when invoked by the remote shell daemon, or when 
invoked in suid mode.


Under FILES, two additional files (for readline initialization) are 
mentioned.



Best regards,
Tony.


Omnitags [WAS: missing system functions in .vim/systags]

2006-05-23 Thread Gerald Lai

On Sun, 21 May 2006, Yakov Lerner wrote:


I created systags per ':help ft-c-omni' suggestion:
 ctags -R -f ~/.vim/systags /usr/include /usr/local/include
and added systags to tags (set tags+=~/.vim/systags).

Now I find that system() does not
appear in ~/.vim/systags generated as above. This is Linux, and
prototype for system() appears in /usr/include/stdlib.h

I realize this is ctags issue not vim issue, but maybe
someone knows what's the deal ? This is Linux


I notice the same thing.

After reading your mail, I was thinking about how the popup menu can be
made to show more information about the item currently being completed.
I was also thinking about standard functions that exist in different
programming languages (e.g., system() in the case of C).

Combining the two, it's about time someone cataloged the standard
functions with concise descriptions that will be displayed when the
omnicompletion popup menu is employed. For functions, the prototype can
be displayed to show what type of parameters the functions will accept,
and also the type of their return values.

This is not only limited to functions. It can be extended to standard
constants and typedefs, with brief descriptions of each shown in the
popup.

I went ahead and constructed what I call an omnitags file of the
standard C library, based on the ctags format at

  http://ctags.sourceforge.net/FORMAT

with reference to both these websites:

  http://www.utas.edu.au/infosys/info/documentation/C/CStdLib.html
  http://www.phim.unibe.ch/comp_doc/c_manual/C/FUNCTIONS/funcref.htm

and the GNU C library header files themselves.

So far, most of the functions have been included, among a few constants,
from these files:

  assert.h
  ctype.h
  math.h
  stdio.h
  stdlib.h
  string.h
  time.h

I try to stay faithful to a particular description format that's very
much like the library source code itself. At the moment, I haven't
written down the rules I followed, but I feel it's quite self
explanatory upon inspection.

The file c_std_omnitags, included in the attachment, can be activated
by something like

  :set tags+=~/.vim/c_std_omnitags
  :setf c
  (then use Ctrl-x + Ctrl-o)

A FileType event can be made to add the omnitags file.

The file c_std_omnitags_src is essentially the same file, except that
the tags are sorted according to header files. Work is done on the src
file. All tags in the src need to be sorted in alphabetical order before
being applied to the 'tags' option.

I don't have much experience with omnicompletion and the intricacies of
C, so I'd like to ask everyone about this omnitags idea.

Would this be useful?
Has this sort of thing been implemented before for Vim?

If this is useful, perhaps we could form a support group to maintain
omnitags files from different languages, and also different variants of
the same language. The popup menu could be made to include a (cascaded)
description popup to allow for a multiple-line desciptions instead of
the current single-line descriptions.

Feedbacks appreciated :)
--
Gerald

c_std_omnitags.tar.gz
Description: GNU Zip compressed data