vim server ? security hole?

2006-07-26 Thread Marc Weber
I did notice that you can do su gvim :echo SERVERNAME and then using another user gvim --servername=GVIMxx --remote-send='!/dowhatyouwant ;-)' Thus: If you know your admin is using vim you can easily try to get one gvim instance to execute arbitrary commands as super user!! Don't think this

Re: vim server ? security hole?

2006-07-26 Thread Yakov Lerner
On 7/26/06, Marc Weber [EMAIL PROTECTED] wrote: I did notice that you can do su gvim :echo SERVERNAME and then using another user gvim --servername=GVIMxx --remote-send='!/dowhatyouwant ;-)' Marc, In case you are talking X11: D you have x11 authorization enabled or disabled ? Command 'xhost'

Re: vim server ? security hole?

2006-07-26 Thread Marc Weber
Marc, In case you are talking X11: D you have x11 authorization enabled or disabled ? I've been taking x11. I did modify xhost because I wanted a php script be able to launch vim. But I've restarted X now and xhost - shows the same as xhost. It still works. So c-rsystem('xhost') inserts:

Re: vim server ? security hole?

2006-07-26 Thread Yakov Lerner
On 7/26/06, Marc Weber [EMAIL PROTECTED] wrote: Marc, In case you are talking X11: D you have x11 authorization enabled or disabled ? I've been taking x11. I did modify xhost because I wanted a php script be able to launch vim. But I've restarted X now and xhost - shows the same as xhost. It

Re: vim server ? security hole?

2006-07-26 Thread David Brown
Marc Weber wrote: Marc, In case you are talking X11: D you have x11 authorization enabled or disabled ? I've been taking x11. I did modify xhost because I wanted a php script be able to launch vim. But I've restarted X now and xhost - shows the same as xhost. It still works. So

Re: foldmethod=expr very slow

2006-07-26 Thread Cory Echols
On 7/26/06, Thore B. Karlsen [EMAIL PROTECTED] wrote: set foldexpr=GetFoldLevel() function! GetFoldLevel() let line_text = getline(v:lnum) let left_idx = (stridx(line_text, '{') = 0) let right_idx = (stridx(line_text, '}') = 0) if left_idx if ! right_idx

Re: vim server ? security hole?

2006-07-26 Thread James Vega
On Wed, Jul 26, 2006 at 10:20:05AM +0200, Marc Weber wrote: I did notice that you can do su gvim :echo SERVERNAME and then using another user gvim --servername=GVIMxx --remote-send='!/dowhatyouwant ;-)' Thus: If you know your admin is using vim you can easily try to get one gvim

Re: foldmethod=expr very slow

2006-07-26 Thread Thore B . Karlsen
On Wed, 26 Jul 2006 11:16:31 -0400, Cory Echols [EMAIL PROTECTED] wrote: set foldexpr=GetFoldLevel() function! GetFoldLevel() let line_text = getline(v:lnum) let left_idx = (stridx(line_text, '{') = 0) let right_idx = (stridx(line_text, '}') = 0) if left_idx

Re: foldmethod=expr very slow

2006-07-26 Thread Cory Echols
On 7/26/06, Thore B. Karlsen [EMAIL PROTECTED] wrote: On Wed, 26 Jul 2006 11:16:31 -0400, Cory Echols [EMAIL PROTECTED] wrote: Use of return values like 'a1', 's1' and '=' in a fold expression will cause significant slowdown. This is because vim has to recursively evaluate the fold expression

Re: Bug in :runtime ?

2006-07-26 Thread A.J.Mechelynck
Benji Fisher wrote: On Wed, Jul 26, 2006 at 07:45:12AM +0200, A.J.Mechelynck wrote: Bill McCarthy wrote: Hello Vim Developers, I was timing the startup process by stepping though what I think Gvim does (on Win XP Pro with 7.0.42). gvim -u NONE -N That starts up without _vimrc or _gvimrc

Re: foldmethod=expr very slow

2006-07-26 Thread Thore B . Karlsen
On Wed, 26 Jul 2006 14:05:45 -0400, Cory Echols [EMAIL PROTECTED] wrote: In other words, I would expect vim to continuously evaluate the foldexpr on the current line for every character I typed, and not do anything else until the fold level changed. I once wrote a foldexpression that kept

Re: Bug in :runtime ?

2006-07-26 Thread Bill McCarthy
On Wed 26-Jul-06 1:20pm -0600, A.J.Mechelynck wrote: Morality: Whenever possible, use / as path separator in Vim, even on Windows. There are a few exceptions (where they don't work). IMHO too many. One common example is passing a file to a program within Vim - the '/' appears to be treated

Re: foldmethod=expr very slow

2006-07-26 Thread Benji Fisher
On Wed, Jul 26, 2006 at 03:33:55PM -0500, Thore B. Karlsen wrote: Well, I think I've found a solution that works for me. It turns out that what was causing my problems was where vim interpreted a number following a marker as a fold level. A line like this would mess up my folds: int

Re: foldmethod=expr very slow

2006-07-26 Thread Thore B . Karlsen
On Wed, 26 Jul 2006 17:19:42 -0400, Benji Fisher [EMAIL PROTECTED] wrote: Well, I think I've found a solution that works for me. It turns out that what was causing my problems was where vim interpreted a number following a marker as a fold level. A line like this would mess up my folds:

Re: Bug in :runtime ?

2006-07-26 Thread A.J.Mechelynck
Bill McCarthy wrote: On Wed 26-Jul-06 12:45am -0600, A.J.Mechelynck wrote: IIUC, it's a feature: \* means a literal asterisk. Not a very good feature since IIUC, asterisks are not allowed in filenames on Windows. Or can they happen in long file names? I know \* means a literal asterisk in a

Re: Bug in :runtime ?

2006-07-26 Thread A.J.Mechelynck
Bill McCarthy wrote: On Wed 26-Jul-06 5:03pm -0600, A.J.Mechelynck wrote: $HOME/vimfiles and $HOME/vimfiles/after should be in your 'rtp' (on Windows); the first place where Vim looks for your _vimrc is $HOME even though it is not in 'rtp'. (And BTW, $VIM should not be in your 'rtp' either;

Re: foldmethod=expr very slow

2006-07-26 Thread Peter Hodge
Hi Thore, You can probably get away with foldmethod=expr in large files by de-activating it in Insert mode. I.e., add this to your after/ftplugin/php.vim: augroup FastFold autocmd! autocmd InsertEnter * if ft == 'php' | setlocal foldmethod=manual | endif autocmd Insertleave * if ft ==

Vim Mirror - Singapore

2006-07-26 Thread Sven Guckes
- Forwarded message - From: Loo Kok Wee [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Mirroring Vim Date: Wed, 26 Jul 2006 18:41:56 +0800 Dear Sir/Madam, I would like to enquire whether is there still a need for a Vim mirror in Singapore/Asia. We are looking into

bug in diff Win version of diff

2006-07-26 Thread Linda W
Seems to be a bug in the diff.exe program included in the VIMRUNTIME dir in the Win32-GUI distribution. It compares files with CRLF endings as identical with the same text LF endings. Note -- I'm not using any of the ignore white space, or ignore CR's at the end of the line. I was trying to

Re: bug in diff Win version of diff

2006-07-26 Thread A.J.Mechelynck
Linda W wrote: Seems to be a bug in the diff.exe program included in the VIMRUNTIME dir in the Win32-GUI distribution. It compares files with CRLF endings as identical with the same text LF endings. Note -- I'm not using any of the ignore white space, or ignore CR's at the end of the line. I

Re: bug in diff Win version of diff

2006-07-26 Thread Bram Moolenaar
Linda W wrote: Seems to be a bug in the diff.exe program included in the VIMRUNTIME dir in the Win32-GUI distribution. It compares files with CRLF endings as identical with the same text LF endings. Note -- I'm not using any of the ignore white space, or ignore CR's at the end of the

Re: bug in diff Win version of diff

2006-07-26 Thread Linda W
A.J.Mechelynck wrote: For a single file: :e ++ff=dos foobar.txt :setlocal ff=unix :w For all *.txt files in the current directory: :set fileformats=dos :args *.txt :set nomore :argdo setl ff=unix | w :set more assuming this is your preferred setting

Re: bug in diff Win version of diff

2006-07-26 Thread A. S. Budden
On 26/07/06, Linda W [EMAIL PROTECTED] wrote: A.J.Mechelynck wrote: For a single file: :e ++ff=dos foobar.txt :setlocal ff=unix :w For all *.txt files in the current directory: :set fileformats=dos :args *.txt :set nomore :argdo setl ff=unix | w :set

Re: Inserting hex characters

2006-07-26 Thread Trent Gamblin
Thank you both for the reply. But when I type ^V010 or ^Vx0a it enters 00 instead of 0a (LF). Does anyone know why?

Re: Inserting hex characters

2006-07-26 Thread A.J.Mechelynck
Trent Gamblin wrote: Thank you both for the reply. But when I type ^V010 or ^Vx0a it enters 00 instead of 0a (LF). Does anyone know why? That is documented under :help i_CTRL-V_digit, which we both mentioned. Nulls are represented by linefeeds internally. To enter a linefeed, break the

Another regular expression substitute question

2006-07-26 Thread Xiaoshen Li
Dear All, Thank you very much for all your responses. I am sorry. My file is a little different now. It is like following: 1 data_34.dat pre= -7872.11914060 post= -7812.80517600 diff= 59.31396460 2 data_5.dat pre= -7986.76147466 post= -7926.94091800 diff= 59.82055666 3 data_16.dat pre=

Re: Inserting hex characters

2006-07-26 Thread Trent Gamblin
On Wed, 2006-07-26 at 15:24 +0200, A.J.Mechelynck wrote: That is documented under :help i_CTRL-V_digit, which we both mentioned. Nulls are represented by linefeeds internally. To enter a linefeed, break the line. Sorry, should have read that first. Thanks again!

Re: Matching non-capitalized words?

2006-07-26 Thread Tim Chase
:%s/\[a-z]\+\//gI another option is to include \C in the regular expression itself: :%s/\C\[a-z]\+\//g One should be careful about this, as the help states: :help /\C Note that 'ignorecase', \c and \C are not used for the character classes. And when you

Re: Another regular expression substitute question

2006-07-26 Thread Trent Gamblin
On Wed, 2006-07-26 at 09:27 +, Xiaoshen Li wrote: Dear All, Thank you very much for all your responses. I am sorry. My file is a little different now. It is like following: 1 data_34.dat pre= -7872.11914060 post= -7812.80517600 diff= 59.31396460 2 data_5.dat pre= -7986.76147466

Re: Matching non-capitalized words?

2006-07-26 Thread Jürgen Krämer
Hi, Tim Chase wrote: :%s/\[a-z]\+\//gI another option is to include \C in the regular expression itself: :%s/\C\[a-z]\+\//g One should be careful about this, as the help states: :help /\C Note that 'ignorecase', \c and \C are not used for the character

Re: Another regular expression substitute question

2006-07-26 Thread A.J.Mechelynck
Xiaoshen Li wrote: Dear All, Thank you very much for all your responses. I am sorry. My file is a little different now. It is like following: 1 data_34.dat pre= -7872.11914060 post= -7812.80517600 diff= 59.31396460 2 data_5.dat pre= -7986.76147466 post= -7926.94091800 diff= 59.82055666

Re: Inserting hex characters

2006-07-26 Thread Tim Chase
Careful, Tim: UTF-8 is unsuited to binary editing, because you can't enter a byte 127 by itself in UTF-8. True enough. I tend not to use UTF-8, so I defer to your far greater experience/knowledge on the matter. For doing binary editing in vim (a rare occurance, when I'm not just using a

Re: Inserting hex characters

2006-07-26 Thread A.J.Mechelynck
Tim Chase wrote: Careful, Tim: UTF-8 is unsuited to binary editing, because you can't enter a byte 127 by itself in UTF-8. True enough. I tend not to use UTF-8, so I defer to your far greater experience/knowledge on the matter. For doing binary editing in vim (a rare occurance, when I'm not

Re: Another regular expression substitute question

2006-07-26 Thread Alan G Isaac
On Wed, 26 Jul 2006, Xiaoshen Li apparently wrote: Thank you very much for all your responses. I am sorry. My file is a little different now. It is like following: 1 data_34.dat pre= -7872.11914060 post= -7812.80517600 diff= 59.31396460 2 data_5.dat pre= -7986.76147466 post=

Re: Another regular expression substitute question

2006-07-26 Thread dcuaron
I know you lose some generality with this solution... :%s/.*\(data_\d*\.dat\).*/\1 but it looks a little easier on the eyes. Any cons to doing it this way? On Wed, 26 Jul 2006, Alan G Isaac wrote: On Wed, 26 Jul 2006, Xiaoshen Li apparently wrote: Thank you very much for all your responses.

Re[2]: Another regular expression substitute question

2006-07-26 Thread Alan G Isaac
:[EMAIL PROTECTED](\S\+\)[EMAIL PROTECTED] On Wed, 26 Jul 2006, (MDT) [EMAIL PROTECTED] apparently wrote: I know you lose some generality with this solution... :%s/.*\(data_\d*\.dat\).*/\1 but it looks a little easier on the eyes. Any cons to doing it this way? One extra character?

Re: Inserting hex characters

2006-07-26 Thread Trent Gamblin
On Wed, 2006-07-26 at 09:04 -0500, Tim Chase wrote: For doing binary editing in vim (a rare occurance, when I'm not just using a proper hex-editor), I tend to use the xxd that comes with the windows version (and is usually available on most Linux systems I've used) for transforming into an

Output of a function...goes where?

2006-07-26 Thread Robert Hicks
Currently I have a couple functions defined that when I do \rc for example it checks my Perl code. When I run this it opens up a DOS window to show me the ok or error message. How do I get that to show up in the bottom of my window (is that the command area?). :Robert

Re: Output of a function...goes where?

2006-07-26 Thread Yakov Lerner
On 7/26/06, Robert Hicks [EMAIL PROTECTED] wrote: Currently I have a couple functions defined that when I do \rc for example it checks my Perl code. When I run this it opens up a DOS window to show me the ok or error message. How do I get that to show up in the bottom of my window (is that the

Re: Output of a function...goes where?

2006-07-26 Thread Robert Hicks
Yakov Lerner wrote: On 7/26/06, Robert Hicks [EMAIL PROTECTED] wrote: Currently I have a couple functions defined that when I do \rc for example it checks my Perl code. When I run this it opens up a DOS window to show me the ok or error message. How do I get that to show up in the bottom of my

bug in 'cdpath' on Windows?

2006-07-26 Thread Gary Johnson
I tried using 'cdpath' on Windows and it seems to be broken, but I don't know for sure since I've never used it before. From the Command Prompt I execute gvim -N -u NONE Then within gvim, :set cdpath? cdpath=,, :pwd C:\Documents and Settings\garyjohn :cd Desktop

Clickable error messages

2006-07-26 Thread Robert Hicks
Is there a way Vim, when it displays an error and gives me a line number for me to click on that line number and Vim takes me there? :Robert

Re: Inserting hex characters

2006-07-26 Thread Yakov Lerner
On 7/26/06, Trent Gamblin [EMAIL PROTECTED] wrote: On Wed, 2006-07-26 at 09:04 -0500, Tim Chase wrote: For doing binary editing in vim (a rare occurance, when I'm not just using a proper hex-editor), I tend to use the xxd that comes with the windows version (and is usually available on most

Re: bug in 'cdpath' on Windows?

2006-07-26 Thread Cory Echols
On 7/26/06, Gary Johnson [EMAIL PROTECTED] wrote: I tried using 'cdpath' on Windows and it seems to be broken, but I don't know for sure since I've never used it before. From the Command Prompt I execute gvim -N -u NONE Then within gvim, :set cdpath? cdpath=,, :pwd

Re: Inserting hex characters

2006-07-26 Thread Trent Gamblin
On Wed, 2006-07-26 at 21:53 +0300, Yakov Lerner wrote: If you add '-p' option to 'xxd' (see man xxd), like this: au BufReadPost *.bin if bin | %!xxd -p then you different hex format (without offsets) where you can easily add and remove bytes. The downside of 'xxd -p' format is, it

Re: Running win32 vim and gvim under Cygwin and pure Windows XP

2006-07-26 Thread Luc Hermitte
Hello, I run vim on Solaris, Linux and Cygwin (actually I use only the win32 native version of vim, generally the one compiled by Tony). And I have one set of scripts for all systems. * On Tue, Jul 25, 2006 at 12:14:43AM -0700, Gary Johnson [EMAIL PROTECTED] wrote: To that end, I have done a

How can I avoid 'missing quote error'?

2006-07-26 Thread SungHyun Nam
Hello, I could not find a way to avoid the error. $ cat .vimrc set nocp nmap buffer ,nc :let @x='0ct*tababcd escf;i)esc+'cr $ LANG= vim -u .vimrc -U NONE --noplugin If I typed ',nc', then I've got error message. E115: Missing quote: '0ct*^Iabcd E15: Invalid expression: '0ct*^Iabcd Press ENTER

Re: Running win32 vim and gvim under Cygwin and pure Windows XP

2006-07-26 Thread A.J.Mechelynck
Luc Hermitte wrote: Hello, I run vim on Solaris, Linux and Cygwin (actually I use only the win32 native version of vim, generally the one compiled by Tony). [...] I'm not distributing them anymore at the moment. My latest Vim for Windows was a v7.0aa ALPHA, now outdated. Please fall back on

Re: How can I avoid 'missing quote error'?

2006-07-26 Thread A.J.Mechelynck
SungHyun Nam wrote: Hello, I could not find a way to avoid the error. $ cat .vimrc set nocp nmap buffer ,nc :let @x='0ct*tababcd escf;i)esc+'cr $ LANG= vim -u .vimrc -U NONE --noplugin If I typed ',nc', then I've got error message. E115: Missing quote: '0ct*^Iabcd E15: Invalid expression:

Search pattern - without keywords

2006-07-26 Thread SHANKAR R-R66203
Hi All, I want to match all the words in a file which are not keywords. In a verilog code, I want to match all the signal names execpt for the keywords. /\w\+ finds all the words. But How do I make vim understand, not to pick up any keyword. Best Regards, Shankar

Re: debugging with breakadd

2006-07-26 Thread Benji Fisher
On Tue, Jul 25, 2006 at 11:14:09AM -0400, Charles E Campbell Jr wrote: Hello! I was trying :breakadd file 484 */visincr.vim and got Breakpoint in /home/cec/.vim/autoload/visincr.vim line 484 Entering Debug mode. Type cont to continue. /home/cec/.vim/autoload/visincr.vim line 638: fun!

Re: please, comment my script

2006-07-26 Thread Benji Fisher
On Tue, Jul 25, 2006 at 12:36:44AM +0400, Pavel Volkovitskiy wrote: Hello! I have to sort python's list quite often, so i want to make a script to do that for example i have: a = [ 'aaa' , 'XXX', '','dsgrg', 'sdgsfdg', 'gfdgffg', 'dfgfdgw:swf', 'sdfsdg', 'sdfgsdg',

Re: debugging with breakadd

2006-07-26 Thread Hari Krishna Dara
On Tue, 25 Jul 2006 at 11:14am, Charles E Campbell Jr wrote: Hello! I was trying :breakadd file 484 */visincr.vim and got Breakpoint in /home/cec/.vim/autoload/visincr.vim line 484 Entering Debug mode. Type cont to continue. /home/cec/.vim/autoload/visincr.vim line 638: fun!