Re: Anybody can tell me how to use "auto add "

2006-10-19 Thread panshizhu
"李 俊燕" <[EMAIL PROTECTED]> 写于 2006-10-20 14:17:55:
> hi,all
>
> I don't know how to say that.
> I just remember that I can type [ control - a ] before a number
> to let it add 1, for example let 1 change to 2.
> But it doesn't work in gvim 7.0 for windows.
> Is there any other method to do that?
>
> thank you very much.
> Li

If you had sourced the vimrc_example.vim, the mswin.vim might be sourced,
then the Ctrl-A will be mapped to something else.

So, you have to choices:

1. remove the reference to the mswin.vim, you can search and find which
script call the mswin.vim and remove it.

or just:

2. unmap all the remappings to 
Add the following to the end of your .vimrc:
" CTRL-A is the default
unmap 
unmap! 

--
Sincerely, Pan, Shi Zhu. ext: 2606

getchar() trick with recursive map

2006-10-19 Thread Hari Krishna Dara

I remember someone posting a patch to add a new event called GetChar to
receive an event for every keypress. This trick is not as powerful and
flexible as that, but it can be very useful for a plugin, and is
supported in Vim7.0 with no patches.

Often there are questions on this list on how to capture every key press
from a user, and the answer is that it can't, unless you map all keys.
But even if you map all keys, it is not flexible enough. Here is a trick
with recursive  maps and getchar() to get all keys pass through
your function. You can do whatever you want with the keys, swallow them
or pass them to Vim.

Here is a demo that shows how to use it in insert mode. What the
function does is to double every key you press, except  and ,
when it breaks the loop.

imap Double("\")
function! Double(mymap)
  try
let char = getchar()
  catch /^Vim:Interrupt$/
let char = "\"
  endtry
  "exec BPBreakIf(char == 32, 1)
  if char == '^\d\+$' || type(char) == 0
let char = nr2char(char)
  endif " It is the ascii code.
  if char == "\"
return ''
  endif
  redraw
  return char.char."\=Redraw()\".a:mymap
endfunction

function! Redraw()
  redraw
  return ''
endfunction

You can do almost eanything that you can do normally in an insert mode,
press ,  etc. Hope someone finds this useful.

I will also post this as a tip.

-- 
Hari

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Anybody can tell me how to use "auto add "

2006-10-19 Thread 李 俊燕

hi,all

I don't know how to say that.
I just remember that I can type [ control - a ] before a number
to let it add 1, for example let 1 change to 2.
But it doesn't work in gvim 7.0 for windows.
Is there any other method to do that?

thank you very much.
Li


Re: ruby indentation

2006-10-19 Thread Akbar

On 10/20/06, A.J.Mechelynck <[EMAIL PROTECTED]> wrote:

Akbar wrote:
> Hi, I use vim7 ( compiled from source )
>
> This is my situation:
> open bla.rb
>
> def bla  ( type def bla, enter )
>  print "bla"( type two spaces and print "bla", enter )
>  print "bli" ( no need to type two spaces, sweet, type print
> "bli", enter )
>  end ( type end, enter )
>
> I want my vim do this: after I press enter ( after typing end ), the
> word end will indent to left automatically aligning with word def. How
> do I do that?
>
> Thank you.
>

If there is a $VIMRUNTIME/indent/ruby.vim script which provides for it, all
you need may be to make sure that your vimrc includes one of the following
lines (each of which is enough by itself):

runtime vimrc_example.vim
or
source $VIMRUNTIME/vimrc_example.vim
or
filetype indent on
or
filetype plugin indent on


One way to check whether you have enabled filetype-related indentation is to
enter the ":filetype" command with no arguments. If the reply includes
"indent:ON" then the capability is enabled.


Best regards,
Tony.



filetype indent on do the trick. Thank you. ( For Tony, sorry for the
duplicate email )


Re: "change counter" ? -- test that buffer did not change between two calls

2006-10-19 Thread Hari Krishna Dara

On Thu, 19 Oct 2006 at 3:15pm, Yegappan Lakshmanan wrote:

> Hi Yakov,
>
> On 10/19/06, Yakov Lerner <[EMAIL PROTECTED]> wrote:
> > I'd like to cache some information about file, into
> > b:variables, and be able to check in my function,
> > whether buffer changed in any way between 2 calls
> > to the function. Is there any "change counter" that I can
> > store and compare later to detect the buffer change (any
> > change like any insertion, deletion, undo, redo, file was re-read from
disk) ?
> >
> > I though about using  &modified but it does not work. If file
> > was modified and saved, then &modified is off and I don't detect
> > anything.
> >
>
> You can try using the b:changedtick variable or the changenr() function.
>
>   :help b:changedtick-variable
>   :help changenr()
>
> - Yegappan

Right on what Yakov wants. I think diffing eval.txt with that of vim6
will reveal several hidden gems.

-- 
Thanks,
Hari

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Re: filename completion not recognising pdf's

2006-10-19 Thread Benji Fisher
On Thu, Oct 19, 2006 at 11:57:22PM +0200, Eric Smith wrote:
> Vim does not complete pdf files with C-X C-F.
> 
> Is there a place where I can alter this (mis)behavior?
> 
> -- 
> Eric Smith

 It does for me.  Two options that may affect this are 'suffixes'
and 'wildignore'.  The first just gives listed suffixes lower priority,
and the second removes them completely.

:help 'suffixes'
:help 'wildignore'
:verbose set suffixes? wildignore?

HTH --Benji Fisher


Re: checking for &cp in plugins

2006-10-19 Thread Benji Fisher
On Thu, Oct 19, 2006 at 11:43:22PM +0200, Yakov Lerner wrote:
> I am making a plugin which naturally requires &nocp
> because it uses  in lhs and rhs of mappings it defines.
> What if that plugin sees &cp, what it shall do ? Shall I
> save old value of &cp, then temporarily 'set nocp', define
> mappings, then restore &cp ? Is this OK ?
> 
> Or it shall check &cp and silently not load if it's &cp!=0 ?
> Or it shall not check &cp and define bogus mappings and
> to hell with checking &cp ?
> 
> Yakov

 Have a look at some of the default plugins.

" Exit quickly when:
" - this plugin was already loaded (or disabled)
" - when 'compatible' is set
" - the "CursorMoved" autocmd event is not availble.
if exists("g:loaded_matchparen") || &cp || !exists("##CursorMoved")
  finish
endif
let g:loaded_matchparen = 1

if v:version < 700
 echohl WarningMsg | echo "***netrw*** you need vim version 7.0 for this 
version of netrw" | echohl None
 finish
endif
let s:keepcpo= &cpo
set cpo&vim
" [snip]
let &cpo= s:keepcpo
unlet s:keepcpo

The matchparen plugin works "automatically," which seems likely to annoy
someone who wants vim to be 'compatible', so it makes sense for it to
bail out.  The netrw plugin provides new commands, so it is less likely
to annoy.  So one bails out when 'cp' is set, and the other saves and
restores.

HTH --Benji Fisher


Re: path is changing mysteriously...

2006-10-19 Thread Benji Fisher
On Thu, Oct 19, 2006 at 07:46:04PM +0200, Yakov Lerner wrote:
> On 10/19/06, Lev Lvovsky <[EMAIL PROTECTED]> wrote:
> >For some reason, with the many buffers that I have open, the path
> >that a particular file takes, is instead of the initial directory
> >where I started from (which is what I want), the directory that the
> >file resides in.  Trying ":cd", or ":lcd" only temporarily changes
> >it, and in a few seconds it changes back to the directory that the
> >file actually resides in - what's going on?
> 
> 'set acd' ('set autochdir') does it. Try :set noacd
> If that doesn't help, this means you have autocmd that
> does it.

 I suspect you are right, but then the question is where 'acd' was
set.  The way to find out is

:verbose set acd?

It is also possible that an autocommand (perhaps from a system vimrc
file) is causing the directory changes.

HTH --Benji Fisher


Re: ruby indentation

2006-10-19 Thread A.J.Mechelynck

Akbar wrote:

Hi, I use vim7 ( compiled from source )

This is my situation:
open bla.rb

def bla  ( type def bla, enter )
 print "bla"( type two spaces and print "bla", enter )
 print "bli" ( no need to type two spaces, sweet, type print
"bli", enter )
 end ( type end, enter )

I want my vim do this: after I press enter ( after typing end ), the
word end will indent to left automatically aligning with word def. How
do I do that?

Thank you.



If there is a $VIMRUNTIME/indent/ruby.vim script which provides for it, all 
you need may be to make sure that your vimrc includes one of the following 
lines (each of which is enough by itself):


runtime vimrc_example.vim
or
source $VIMRUNTIME/vimrc_example.vim
or
filetype indent on
or
filetype plugin indent on


One way to check whether you have enabled filetype-related indentation is to 
enter the ":filetype" command with no arguments. If the reply includes 
"indent:ON" then the capability is enabled.



Best regards,
Tony.


Re: Fighting with comments

2006-10-19 Thread A.J.Mechelynck

Meghdad Azriel wrote:

I was just kidding ;)

I know that they are not secret but, they´re not that intuitive... and i´m
still learning how to use that help  effectivelly...


maybe I neet to read those basic files with care...

[...]

To use the help effectively, one should learn to use the tools Vim itself 
includes to search the help (see, among others, ":help :help" and ":help 
:helpgrep"):


:help 

brings you to the help for  if there is one, otherwise to some help 
topic "resembling" what you typed


:help pattern

completes your command-line with the first help topic matching the pattern. 
Hit  again to see the next one. Hit Ctrl-D to see them all. If you have 
'wildmenu' on, the bottom status line will be replaced by a "menu" of possible 
matches: hit  or  to select,  to accept,  to abort.


:helpgrep pattern

searches the whole help text for /pattern/. The results are used to build a 
"quickfix error list" (see ":help quickfix.txt"). Then the following commands 
may come useful:


:cn[ext]
:cp[revious] or :cN[ext]
:cnf[ile]
:cpf[ile] or :cNf[ile]
:cfir[st] or :cr[ewind]
:cla[st]

to navigate the list, displaying the helpfiles with the cursor on a match;

:cope[n]

to open the list of matching lines in its own split-window, where you can 
position the cursor on any of those lines then hit  to see the same 
line in context in its helpfile;


:ccl[ose]

to close the quickfix window, even if it is not the current window. (Brackets 
represent the optional part of the command names: e.g. ":cp[revious]" means 
that the ":cprevious" command can be abbreviated to any of :cp :cpr :cpre 
:cprev etc.)


If you often use the ":helpgrep" command and/or other quickfix commands such 
as ":make" ":vimgrep" etc., you may find the following mappings handy (replace 
the left-hand side by whatever suits you):


:map  :cnext
:map:cprev


Best regards,
Tony.


Re: Can the mailing list owner set "Reply-to" field be [EMAIL PROTECTED]

2006-10-19 Thread A.J.Mechelynck

Kamaraju Kusumanchi wrote:

On Thursday 19 October 2006 15:00, Paul Irofti wrote:

Of course if you're
stuck with Windows then I'd suggest Thunderbird


Thunderbird does not have a reply-to-list facility and is one of the long 
standing bugs (6 years and still going). More details at 
https://bugzilla.mozilla.org/show_bug.cgi?id=45715


raju



It hasn't got that indeed; but it has (like every mailer known to me) a "Reply 
to All" facility; in addition (and like Vim) is is cross-platform software, 
behaving (almost) identically on Windows, Linux and Mac, and possibly on some 
other systems too.



Best regards,
Tony.


Re: BUG: formatoptions+=t makes comments wrap (incorrectly) when they shouldn't

2006-10-19 Thread Peter Hodge

--- Bram Moolenaar <[EMAIL PROTECTED]> wrote:

> 
> Peter Hodge wrote:
> 
> > When I have formatoptions=t, it makes comment lines wrap when they
> > shouldn't, and it also ignores whatever comment leader is defined in
> > 'comments'.  To reproduce:
> > 
> > 
> >   :set formatoptions=roc
> >   :set comments=b:%
> >   :set textwidth=30
> > 
> >   % type these lines of text
> >   % as one line, and notice
> >   % how Vim automatically
> >   % wraps the lines and adds
> >   % '%' at the start of each
> >   % line.
> > 
> > Now remove 'c' from formatoptions and add 't'.
> >   :set formatoptions-=c
> >   :set formatoptions+=t
> > From the help pages (:help fo-table)
> > t   Auto-wrap text using textwidth (does not apply to comments)
> > c   Auto-wrap comments using textwidth, inserting the current
> comment
> > leader automatically.
> > With 'formatoptions' now set to 'rot', Vim should wrap normal text, but not
> > comments.
> > 
> >   % but when you type this
> >   next set of comments, Vim
> >   will wrap them (when it
> >   shouldn't, because they are
> >   comments), and it will also
> >   miss out the comment leader.
> > 
> > I hope it's clear what's going on here.  I'm running Vim 7 with
> > patches 1-101.
> 
> When you remove "c" from 'formatoptions' Vim doesn't recognize comments,
> thus everything is formatted as normal text.
> 
> I don't think there currently is a value for 'formatoptions' to only
> format text that isn't comments.  Mostly because comments is text that
> you normally want to format.

OK, I understand now.  Perhaps the fo-table docs should read:

  t  Auto-wrap all text using textwidth.  Comment leader is not inserted
 automatically unless 'c' is present also.

Otherwise, it appears as though 't' should wrap everything except comments.
"... (does not apply to comments)".

regards,
Peter




 
On Yahoo!7 
Men's Health Radio: Chill out or work out, or just tune in 
http://au.launch.yahoo.com/mens-health-radio/index.html


Re: Can the mailing list owner set "Reply-to" field be [EMAIL PROTECTED]

2006-10-19 Thread Kamaraju Kusumanchi
On Thursday 19 October 2006 15:00, Paul Irofti wrote:
> Of course if you're
> stuck with Windows then I'd suggest Thunderbird

Thunderbird does not have a reply-to-list facility and is one of the long 
standing bugs (6 years and still going). More details at 
https://bugzilla.mozilla.org/show_bug.cgi?id=45715

raju


Re: "change counter" ? -- test that buffer did not change between two calls

2006-10-19 Thread Yegappan Lakshmanan

Hi Yakov,

On 10/19/06, Yakov Lerner <[EMAIL PROTECTED]> wrote:

I'd like to cache some information about file, into
b:variables, and be able to check in my function,
whether buffer changed in any way between 2 calls
to the function. Is there any "change counter" that I can
store and compare later to detect the buffer change (any
change like any insertion, deletion, undo, redo, file was re-read from disk) ?

I though about using  &modified but it does not work. If file
was modified and saved, then &modified is off and I don't detect
anything.



You can try using the b:changedtick variable or the changenr() function.

 :help b:changedtick-variable
 :help changenr()

- Yegappan


filename completion not recognising pdf's

2006-10-19 Thread Eric Smith

Vim does not complete pdf files with C-X C-F.

Is there a place where I can alter this (mis)behavior?

--
Eric Smith


Re: "change counter" ? -- test that buffer did not change between two calls

2006-10-19 Thread Hari Krishna Dara

On Thu, 19 Oct 2006 at 11:25pm, Yakov Lerner wrote:

> I'd like to cache some information about file, into
> b:variables, and be able to check in my function,
> whether buffer changed in any way between 2 calls
> to the function. Is there any "change counter" that I can
> store and compare later to detect the buffer change (any
> change like any insertion, deletion, undo, redo, file was re-read from disk)
?
>
> I though about using  &modified but it does not work. If file
> was modified and saved, then &modified is off and I don't detect
> anything.
>
> Yakov

You can probably monitor InsertEnter and InsertLeave in addition to
:undolist to figure this out, but you can only see what Vim thinks of
the buffer, if you are trying to see if contents really changed, then
you can do that only by comparing the text by saving it at different
points.
- If 'nomodified' at the time of InsertEnter, but 'modified' at the time
  of 'InsertLeave', then Vim thinks user changed something.
- If 'modified' at the time of InsertEnter, save :undolist and compare
  it with that at the time of InsertLeave to see if any new undo points
  have been entered.

-- 
HTH,
Hari

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


checking for &cp in plugins

2006-10-19 Thread Yakov Lerner

I am making a plugin which naturally requires &nocp
because it uses  in lhs and rhs of mappings it defines.
What if that plugin sees &cp, what it shall do ? Shall I
save old value of &cp, then temporarily 'set nocp', define
mappings, then restore &cp ? Is this OK ?

Or it shall check &cp and silently not load if it's &cp!=0 ?
Or it shall not check &cp and define bogus mappings and
to hell with checking &cp ?

Yakov


Re: vim temp files on windows

2006-10-19 Thread Meghdad Azriel

Didn´t work for me...

It gave me an error saying that it could not make the backup file...



Mathias Michaelis wrote:
> 
> Hello Kev
> 
>> Whenever I edit a file in gvim on Windows, a temporary
>> file of the same name but with a tilde (~) on the end
>> is created.
>> 
> This are backup files and are (meaningfully) not deleted after
> closing the corresponding file.
> 
> In my $HOME/vimfiles directory I have created a folder named
> "backup". Then, I putted in my .vimrc or _vimrc file the lines:
> 
> "
> " keep a backup file
> "
> set backup
> set backupdir=$HOME/vimfiles/backup/
> 
> Now, all backup files are kept in this one backup directory. If you
> don't like this at all, you can put the line
> 
> set nobackup
> 
> at the place of the lines above.
> 
> Best regards
> 
> Mathias
> 
> 

-- 
View this message in context: 
http://www.nabble.com/vim-temp-files-on-windows-tf159693.html#a6906290
Sent from the Vim - General mailing list archive at Nabble.com.



"change counter" ? -- test that buffer did not change between two calls

2006-10-19 Thread Yakov Lerner

I'd like to cache some information about file, into
b:variables, and be able to check in my function,
whether buffer changed in any way between 2 calls
to the function. Is there any "change counter" that I can
store and compare later to detect the buffer change (any
change like any insertion, deletion, undo, redo, file was re-read from disk) ?

I though about using  &modified but it does not work. If file
was modified and saved, then &modified is off and I don't detect
anything.

Yakov


Re: Fighting with comments

2006-10-19 Thread Meghdad Azriel

I was just kidding ;)

I know that they are not secret but, they´re not that intuitive... and i´m
still learning how to use that help  effectivelly...


maybe I neet to read those basic files with care...



Gary Johnson wrote:
> 
> On 2006-10-19, eric1235711 <[EMAIL PROTECTED]> wrote:
>> this worked too
>> 
>> I think this is better, help tells that this formatoptions is specific to
>> coments and things...
>> 
>> But I´m getting disgusted of these "secret and magic commands"...
> 
> Secret?  You might find it helpful to look at
> 
> :help user-manual
> 
> and browsing the table of contents for topics that appear related to 
> what you're trying to do.
> 
> Regards,
> Gary
> 
> -- 
> Gary Johnson | Agilent Technologies
> [EMAIL PROTECTED] | Wireless Division
>  | Spokane, Washington, USA
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Fighting-with-comments-tf2467964.html#a6905899
Sent from the Vim - General mailing list archive at Nabble.com.



Re: BUG: formatoptions+=t makes comments wrap (incorrectly) when they shouldn't

2006-10-19 Thread Bram Moolenaar

Peter Hodge wrote:

> When I have formatoptions=t, it makes comment lines wrap when they
> shouldn't, and it also ignores whatever comment leader is defined in
> 'comments'.  To reproduce:
> 
> 
>   :set formatoptions=roc
>   :set comments=b:%
>   :set textwidth=30
> 
>   % type these lines of text
>   % as one line, and notice
>   % how Vim automatically
>   % wraps the lines and adds
>   % '%' at the start of each
>   % line.
> 
> Now remove 'c' from formatoptions and add 't'.
>   :set formatoptions-=c
>   :set formatoptions+=t
> From the help pages (:help fo-table)
> t   Auto-wrap text using textwidth (does not apply to comments)
> c   Auto-wrap comments using textwidth, inserting the current comment
> leader automatically.
> With 'formatoptions' now set to 'rot', Vim should wrap normal text, but not
> comments.
> 
>   % but when you type this
>   next set of comments, Vim
>   will wrap them (when it
>   shouldn't, because they are
>   comments), and it will also
>   miss out the comment leader.
> 
> I hope it's clear what's going on here.  I'm running Vim 7 with
> patches 1-101.

When you remove "c" from 'formatoptions' Vim doesn't recognize comments,
thus everything is formatted as normal text.

I don't think there currently is a value for 'formatoptions' to only
format text that isn't comments.  Mostly because comments is text that
you normally want to format.

-- 
hundred-and-one symptoms of being an internet addict:
74. Your most erotic dreams are about cybersex

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: locked window

2006-10-19 Thread Kim Schulz
On Thu, 19 Oct 2006 12:15:17 -0700
"Yegappan Lakshmanan" <[EMAIL PROTECTED]> wrote:


> You can use the detailed example code under ":help
> CursorHold-example". It uses the ":ptag" command and the cursorhold
> autocmd to jump to the tag under the cursor in the preview window and
> highlight the line.

absolutely perfect. this er very close to what I had in mind. Except
that I would really like this window to be locked (hence the question
which started this thread). 


-- 
Kim Schulz| Private :  http://www.schulz.dk
[EMAIL PROTECTED] | Business:  http://www.devteam.dk
+45 5190 4262 | Sparetime: http://www.fundanemt.com


Re: Fighting with comments

2006-10-19 Thread Gary Johnson
On 2006-10-19, eric1235711 <[EMAIL PROTECTED]> wrote:
> this worked too
> 
> I think this is better, help tells that this formatoptions is specific to
> coments and things...
> 
> But I´m getting disgusted of these "secret and magic commands"...

Secret?  You might find it helpful to look at

:help user-manual

and browsing the table of contents for topics that appear related to 
what you're trying to do.

Regards,
Gary

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


Re: Fighting with comments

2006-10-19 Thread Gary Johnson
On 2006-10-19, eric1235711 <[EMAIL PROTECTED]> wrote:
> here it's in this way:
> C:/Program Files/Vim
> and it contains vim70/ and vimfiles/
> 
> Oh, thanks, Gary! it worked!!!
> 
> But I didn´t like it!!!
> 
> when I changed C:/Program Files/Vim/vimfiles/ftplugin/php.vim it stoped
> 'autowriting' comments in new lines...
> but when I changed C:/Program Files/Vim/vimfiles/after/ftplugin/php.vim it
> worked perfectly... 
> 
> I didn´t undertand... why did it work?

You're welcome.  Take a look at:

:help rtp

When you load a buffer that vim determines to be of filetype php, 
vim searches the runtimepath for filetype plugins to source.  It 
will source your C:/Program Files/Vim/vimfiles/ftplugin/php.vim, 
then the C:/Program Files/Vim/vim70/ftplugin/php.vim that came with 
the vim distribution, then your
C:/Program Files/Vim/vimfiles/after/ftplugin/php.vim.  So, settings 
that you put in C:/Program Files/Vim/vimfiles/ftplugin/php.vim may 
be overridden by the settings in
C:/Program Files/Vim/vim70/ftplugin/php.vim, but since
C:/Program Files/Vim/vimfiles/after/ftplugin/php.vim is sourced 
last, its settings will "win".

I hope that helps explain what you're seeing.

Regards,
Gary

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


Re: www.vim.org

2006-10-19 Thread Preben Randhol
On Thu, 19 Oct 2006 18:29:19 +0200
Preben Randhol <[EMAIL PROTECTED]> wrote:

> Still doesn't work from my ISP, but works from other ISPs, so I guess
> it will take a bit time before it trinkles down to all dns servers...

Works now.


Re: locked window

2006-10-19 Thread Yegappan Lakshmanan

Hi,

On 10/19/06, Kim Schulz <[EMAIL PROTECTED]> wrote:

On Thu, 19 Oct 2006 15:18:12 +0200
"A.J.Mechelynck" <[EMAIL PROTECTED]> wrote:

[snip]
>
> Instead of calling the program "vim", call it "rview". Then you won't
> be able to write anything, nor to use a shell command. Is that safe
> enough? Maybe ":help starting.txt" will give you other ideas.


except that this is not what I want. I would like to have a preview
window that shows the position of decleration whenever I move the
cursor on top of a function name, variable etc. It should ofcause use
tags to find the right place.
Source browsers like Source Insight has a feature like this and I love
the way it gives you a superb overview of the code when reading through
it.



You can use the detailed example code under ":help CursorHold-example".
It uses the ":ptag" command and the cursorhold autocmd to jump
to the tag under the cursor in the preview window and highlight the
line.

- Yegappan


Re: www.vim.org

2006-10-19 Thread Paul Irofti
Works just fine for me. Here's a traceroute for those in doubt:

$ traceroute www.vim.org
traceroute to vhost.sourceforge.net (66.35.250.210), 64 hops max, 40 
byte packets
 1  nautilus (192.168.1.1)  0.173 ms  0.183 ms  0.145 ms
 2  86.106.2.2 (86.106.2.2)  0.456 ms  0.707 ms  0.430 ms
 3  192.168.168.6 (192.168.168.6)  0.893 ms  1.577 ms  3.684 ms
 4  84.234.111.177 (84.234.111.177)  4.277 ms  1.945 ms  5.977 ms
 5  fibernet-gw-bfd.gtstelecom.ro (212.146.78.49)  1.978 ms  2.464 ms  
6.106 ms
 6  r11-Vl3101.buh7.ro.gtsce.net (85.9.9.10)  2.90 ms  3.536 ms  6.652 
ms
 7  r10-Ge2-1-3501.buh7.ro.gtsce.net (85.9.9.5)  9.170 ms  4.835 ms  
3.104 ms
 8  195.39.209.45 (195.39.209.45)  30.962 ms *  40.831 ms
 9  sl-gw10-fra-4-0.sprintlink.net (217.147.111.113)  30.254 ms  38.539 
ms  34.419 ms
10  sl-bb20-fra-8-0.sprintlink.net (217.147.96.37)  31.951 ms  30.927 ms  
31.33 ms
11  acr1-so-3-2-0.Frankfurtfrx.savvis.net (208.174.57.9)  147.192 ms  
149.122 ms  157.313 ms
12  dcr1-so-1-0-0.frankfurtfrx.savvis.net (204.70.194.162)  138.918 ms 
dcr2-so-1-0-0.frankfurtfrx.savvis.net (204.70.192.169)  159.958 ms  
153.618 ms
13  dcr2-so-5-0-0.frankfurtfrx.savvis.net (204.70.194.126)  138.355 ms * 
bcs2-so-4-0-0.parisprx.savvis.net (204.70.194.130)  144.228 ms
14  bcs2-so-3-0-0.Washington.savvis.net (204.70.192.125)  138.130 ms 
bcs2-so-4-0-0.parisprx.savvis.net (204.70.194.130)  149.455 ms  143.350 
ms
15  dcr2-so-7-3-0.Atlanta.savvis.net (204.70.192.65)  153.198 ms 
bcs2-so-3-0-0.Washington.savvis.net (204.70.192.125)  152.465 ms 
dcr2-so-7-3-0.Atlanta.savvis.net (204.70.192.65)  149.814 ms
16  dcr2-so-7-3-0.Atlanta.savvis.net (204.70.192.65)  154.255 ms 
dcr2-so-2-0-0.dallas.savvis.net (204.70.192.70)  187.901 ms 
dcr2-so-7-3-0.Atlanta.savvis.net (204.70.192.65)  147.65 ms
17  dcr2-so-2-0-0.dallas.savvis.net (204.70.192.70)  188.383 ms 
dcr1.lay-so-3-2-0.losangeles.savvis.net (204.70.194.53)  203.453 ms 
dcr2-so-2-0-0.dallas.savvis.net (204.70.192.70)  238.717 ms
18  dcr1.lay-so-3-2-0.losangeles.savvis.net (204.70.194.53)  205.409 ms 
*  203.311 ms
19  bhr1-pos-0-0.SantaClarasc8.savvis.net (208.172.156.198)  210 ms  
217.57 ms  214.995 ms
20  bhr1-pos-0-0.SantaClarasc8.savvis.net (208.172.156.198)  215.606 ms 
csr1-ve240.santaclarasc8.savvis.net (66.35.194.34)  225.386 ms 
bhr1-pos-0-0.SantaClarasc8.savvis.net (208.172.156.198)  216.495 ms
21  66.35.212.174 (66.35.212.174)  223.687 ms  224.398 ms  223.288 ms
22  vhost.sourceforge.net (66.35.250.210)  222.879 ms !C 66.35.212.174 
(66.35.212.174)  227.883 ms vhost.sourceforge.net (66.35.250.210)  
226.879 ms !C
23  vhost.sourceforge.net (66.35.250.210)  242.337 ms !C  212.490 ms !C  
219.345 ms !C


Re: Match something that not in the pattern

2006-10-19 Thread Bill McCarthy
On Thu 19-Oct-06 9:26am -0600, Charles E Campbell Jr wrote:

> So, to do what you ask with LogiPat's result:
>
> :g/^\%(\%(}}$\)[EMAIL PROTECTED])*$/j

Please see my response to Tony Mechelynck.  Your solution
changes the text of Peng Yu's example to 5 lines.  As I
understand his goal, the correct answer has 2 lines.

It is not a problem with your very clever LogiPat, it is the
application within :global.

Here's what I believe is happening during the original first
4 lines:

First you join the first two lines.  Then, since the
original line 2 is no longer present, nothing is done with
line 2.  Next it joins lines 3 and 4.

That's 2 lines so far.  Actually, lines 1 through 4 should
be joined to 1 line.

-- 
Best regards,
Bill



Re: Can the mailing list owner set "Reply-to" field be [EMAIL PROTECTED]

2006-10-19 Thread Paul Irofti
On Thursday 19 October 2006 07:22, Kamaraju Kusumanchi wrote:
> On Wednesday 18 October 2006 22:22, Peng Yu wrote:
> > Hi,
> >
> > Can the mailing list owner set "Reply-to" field in every mail
> > forward from this mailing list be "vim@vim.org"?
> >
> > I replied some mails to the original poster. But sometime I forget
> > to reply the mails to the mailing list.
>
> Use a decent email client like kmail, mutt etc., which are "mailing
> list aware". That way if you hit 'L', the reply will be sent to the
> list.  Of course, the letter 'L' can be configured to other  letters
> if it is a decent email client.
>
> raju

I agree, I use KMail and mutt... they're both a joy. Of course if you're 
stuck with Windows then I'd suggest Thunderbird or maybe a Windows port 
for the above (although I have no ideea if such a thing exists, you 
might be lucky with mutt, KMail is highly improbable without installing 
an X client on your Windows and having an X server forwarding traffic).

Anyways good luck to the OP and please keep it the way it is.


Re: ruby indentation

2006-10-19 Thread Paul Irofti
On Thursday 19 October 2006 18:26, Akbar wrote:
> Hi, I use vim7 ( compiled from source )
>
> This is my situation:
> open bla.rb
>
> def bla  ( type def bla, enter )
>   print "bla"( type two spaces and print "bla", enter )
>   print "bli" ( no need to type two spaces, sweet, type print
> "bli", enter )
>   end ( type end, enter )
>
> I want my vim do this: after I press enter ( after typing end ), the
> word end will indent to left automatically aligning with word def.
> How do I do that?
>
> Thank you.

I had the same issue when I compiled from source via a-a-p on my 
Slackware machine at work.

The thing is that at home I run OpenBSD and building from ports (this 
involves compiling too) returns other result (i.e. indention works like 
a charm).

It might be something that broke along from patch 42 (that I have on 
OpenBSD) through patch 135, or whichever is the latest one, that I have 
at work.

I really don't know, maybe a special configure flag (although I looked 
it up and found nothing). I hope someone can explain this...


Re: Question about listchars

2006-10-19 Thread Jean-Rene David
* Jeff Lanzarotta [2006.10.19 13:13]:
> If there a way to check and see if the listchar
> is actually set or not?

For options I change often, I use the following to
display its value in the statusline. 

function! OptSet(opt, string)
   if(exists("a:opt") && expand(a:opt))
  return a:string
   else
  return ""
   endif
endfunction

Then put the following in the statusline:

set statusline=%<%f\%h%m%r%y%{OptSet(&ic,'[ic]')}[...]
 

So in this specific case, if 'ic' is set, I will
have '[ic]' in my status line.

I use that for 'ic' and 'ws' because I toggle them
quite ofen.

HTH,

-- 
JR


Re: Question about listchars

2006-10-19 Thread Steve Hall
On Thu, 2006-10-19 at 08:59 -0700, Jeff Lanzarotta wrote:
> 
> I have the following in my vimrc,
> 
> 
> " This shows spaces and tabs characters. Visual Whitespace.
> set listchars=tab:»·,trail:·
> set list
> 
> 
> That all work well and good, but I would like to disable this
> display of visual white space temporarily, do something, and then
> reset it back to what I had. Is there a way to do this?

I wrote a plugin that toggles "invisible" characters with F4:

  http://vim.sourceforge.net/scripts/script.php?script_id=363


-- 
Steve Hall  [ digitect dancingpaper com ]




Re: path is changing mysteriously...

2006-10-19 Thread Yakov Lerner

On 10/19/06, Lev Lvovsky <[EMAIL PROTECTED]> wrote:

For some reason, with the many buffers that I have open, the path
that a particular file takes, is instead of the initial directory
where I started from (which is what I want), the directory that the
file resides in.  Trying ":cd", or ":lcd" only temporarily changes
it, and in a few seconds it changes back to the directory that the
file actually resides in - what's going on?


'set acd' ('set autochdir') does it. Try :set noacd
If that doesn't help, this means you have autocmd that
does it.

Yakov


path is changing mysteriously...

2006-10-19 Thread Lev Lvovsky
For some reason, with the many buffers that I have open, the path  
that a particular file takes, is instead of the initial directory  
where I started from (which is what I want), the directory that the  
file resides in.  Trying ":cd", or ":lcd" only temporarily changes  
it, and in a few seconds it changes back to the directory that the  
file actually resides in - what's going on?


thanks!
-lev


Re: Question about listchars

2006-10-19 Thread Jeff Lanzarotta
Awesome. Thanks...

--- Tim Chase <[EMAIL PROTECTED]> wrote:

> > Thanks for all the suggestions. They helped out... If there a way
> to
> > check and see if the listchar is actually set or not?
> > 
> > In my script, I now turn off the display with 'set invlist list?',
> but
> > I do not want to turn it back on if it was not previously set...
> 
> 
> Well, you can use the common idiom
> 
>   let l:old_list = &list
>   set nolist
>   " do stuff
>   let &list = l:old_list
> 
> which will allow you to temporarily disable the 'list' setting, 
> do stuff without it, and then restore it to whatever it was 
> previously...
> 
> -tim
> 
> 
> 
> 
> 
>   
> 



Re: Question about listchars

2006-10-19 Thread Tim Chase

Thanks for all the suggestions. They helped out... If there a way to
check and see if the listchar is actually set or not?

In my script, I now turn off the display with 'set invlist list?', but
I do not want to turn it back on if it was not previously set...



Well, you can use the common idiom

let l:old_list = &list
set nolist
" do stuff
let &list = l:old_list

which will allow you to temporarily disable the 'list' setting, 
do stuff without it, and then restore it to whatever it was 
previously...


-tim








Re: Question about listchars

2006-10-19 Thread Jeff Lanzarotta
Thanks for all the suggestions. They helped out... If there a way to
check and see if the listchar is actually set or not?

In my script, I now turn off the display with 'set invlist list?', but
I do not want to turn it back on if it was not previously set...


--- Bill McCarthy <[EMAIL PROTECTED]> wrote:

> On Thu 19-Oct-06 10:59am -0600, Jeff Lanzarotta wrote:
> 
> > I have the following in my vimrc,
> >
> > 
> > " This shows spaces and tabs characters. Visual Whitespace.
> > set listchars=tab:»·,trail:·
> > set list
> > 
> >
> > That all work well and good, but I would like to disable this
> display
> > of visual white space temporarily, do something, and then reset it
> back
> > to what I had. Is there a way to do this?
> 
> You can toggle back and forth with:
> 
> :se invlist
> 
> This can be placed in a map like this:
> 
> nm  l :se invlist list?
> 
> where "invlist" will toggle the 'list' option and "list?"
> will display the new state.
> 
> For help on ":se {option}?" and ":se inv{option}" see:
> 
> :h set-option
> 
> -- 
> Best regards,
> Bill
> 
> 



Re: Question about listchars

2006-10-19 Thread Karl Guertin

On 10/19/06, Jeff Lanzarotta <[EMAIL PROTECTED]> wrote:

That all work well and good, but I would like to disable this display
of visual white space temporarily, do something, and then reset it back
to what I had. Is there a way to do this?


:map  l :set invlist

Then type \l when you want to toggle ( is \ by default).
Change the binding however you like, but invfoo inverts the foo
setting.


Re: Question about listchars

2006-10-19 Thread Bill McCarthy
On Thu 19-Oct-06 10:59am -0600, Jeff Lanzarotta wrote:

> I have the following in my vimrc,
>
> 
> " This shows spaces and tabs characters. Visual Whitespace.
> set listchars=tab:»·,trail:·
> set list
> 
>
> That all work well and good, but I would like to disable this display
> of visual white space temporarily, do something, and then reset it back
> to what I had. Is there a way to do this?

You can toggle back and forth with:

:se invlist

This can be placed in a map like this:

nm  l :se invlist list?

where "invlist" will toggle the 'list' option and "list?"
will display the new state.

For help on ":se {option}?" and ":se inv{option}" see:

:h set-option

-- 
Best regards,
Bill



Re: Question about listchars

2006-10-19 Thread Marius Roets

On 10/19/06, Jeff Lanzarotta <[EMAIL PROTECTED]> wrote:

Hello,

I have the following in my vimrc,


" This shows spaces and tabs characters. Visual Whitespace.
set listchars=tab:»·,trail:·
set list


That all work well and good, but I would like to disable this display
of visual white space temporarily, do something, and then reset it back
to what I had. Is there a way to do this?

Peace,

How about this in your .vimrc
nmap  :set invlist
imap  :set invlista

and then F5 would toggle list on and off.

HTH
Marius


Re: www.vim.org

2006-10-19 Thread Preben Randhol
On Wed, 18 Oct 2006 23:30:15 +0200
Bram Moolenaar <[EMAIL PROTECTED]> wrote:

> SourceForge has fixed the VHOST service, www.vim.org is back!

Still doesn't work from my ISP, but works from other ISPs, so I guess
it will take a bit time before it trinkles down to all dns servers...

Preben


Re: Question about listchars

2006-10-19 Thread Tim Chase

" This shows spaces and tabs characters. Visual Whitespace.
set listchars=tab:»·,trail:·
set list


That all work well and good, but I would like to disable this
display of visual white space temporarily, do something, and
then reset it back to what I had. Is there a way to do this?


Well, there are a number of possible solutions.  The 'listchars' 
setting only allows for showing trailing whitespace.  If this is 
what you're looking for, you can do something like


set listchars+=trail:_

do your thing, and then

set listchars-=trail:_

to undo it.

If you want to visualize all your whitespace, you can do it with

1) search highlighting (to get cleared on your next search):

:set hls
/\s

and then optionally reset with

:set nohls

or

:noh


2) match highlighting (to optionally be used in complement to 
search highlighting):


:match SpellBad /\s/

and then reset with

:match NONE

3) or you can do it by substituting all of your white-space with 
some visual character:


:%s/\s/#/g

and then just undoing with "u" as usual.

Just a few ideas...

-tkc





Re: locked window

2006-10-19 Thread Kim Schulz
On Thu, 19 Oct 2006 15:18:12 +0200
"A.J.Mechelynck" <[EMAIL PROTECTED]> wrote:

[snip] 
> 
> Instead of calling the program "vim", call it "rview". Then you won't
> be able to write anything, nor to use a shell command. Is that safe
> enough? Maybe ":help starting.txt" will give you other ideas.


except that this is not what I want. I would like to have a preview
window that shows the position of decleration whenever I move the
cursor on top of a function name, variable etc. It should ofcause use
tags to find the right place. 
Source browsers like Source Insight has a feature like this and I love
the way it gives you a superb overview of the code when reading through
it. 



-- 
Kim Schulz| Private :  http://www.schulz.dk
[EMAIL PROTECTED] | Business:  http://www.devteam.dk
+45 5190 4262 | Sparetime: http://www.fundanemt.com


Question about listchars

2006-10-19 Thread Jeff Lanzarotta
Hello,

I have the following in my vimrc,


" This shows spaces and tabs characters. Visual Whitespace.
set listchars=tab:»·,trail:·
set list


That all work well and good, but I would like to disable this display
of visual white space temporarily, do something, and then reset it back
to what I had. Is there a way to do this?

Peace,

-Jeff





-Jeff


ruby indentation

2006-10-19 Thread Akbar

Hi, I use vim7 ( compiled from source )

This is my situation:
open bla.rb

def bla  ( type def bla, enter )
 print "bla"( type two spaces and print "bla", enter )
 print "bli" ( no need to type two spaces, sweet, type print
"bli", enter )
 end ( type end, enter )

I want my vim do this: after I press enter ( after typing end ), the
word end will indent to left automatically aligning with word def. How
do I do that?

Thank you.


Re: Quickfix behaviour

2006-10-19 Thread Yegappan Lakshmanan

Hi,

On 10/19/06, Marius Roets <[EMAIL PROTECTED]> wrote:

On 10/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

>
> > 1) I would like to open a new window/tab, rather than use the one
> > above the quickfix window.
>
> :h 'switchbuf' -> split
>
> > 2) If the buffer is already open in another tab page, I'd like to jump
> > there, instead of opening it in this tab again.
>
> :h 'switchbuf' -> useopen, usetab
>
Thanks, it works great with one exception. When the quickfix is the
only window in the tab (i.e. :tab copen), then it does not respect
usetab (it opens a new split). If I do a :new to have a empty open
window above the quickfix window, and then jump to an error, it works
perfectly. Strange.



The behavior you are seeing is a bug in Vim.

- Yegappan


Re: Match something that not in the pattern

2006-10-19 Thread Charles E Campbell Jr

Peng Yu wrote:


Hi,

I have the following file segments. I want to concatenate all the
lines with their next lines, except that it ends with "}}". I want to
use the pattern "\(}}\)[EMAIL PROTECTED]". It seems not working.

Would you please help me to figure out how to match the lineend 
without "}}"?


This problem is one that LogiPat can help with!

 (see http://vim.sourceforge.net/scripts/script.php?script_id=1290
  or http://mysite.verizon.net/astronaut/vim/index.html#VimFuncs, see 
"LogiPat")


First, let's construct a pattern that matches all lines that don't end 
with }}:


:echo LogiPat('!"}}$"')

^\%(\%(}}$\)[EMAIL PROTECTED])*$

Now, that has a bit more than is necessary, but it does work.  I'm not 
sure what
you want with that trailing '^' -- was that supposed to mean 
beginning-of-line?

It isn't necessary if that's the case.

So, to do what you ask with LogiPat's result:

:g/^\%(\%(}}$\)[EMAIL PROTECTED])*$/j

Regards,
Chip Campbell





Re: redefining * and #

2006-10-19 Thread Tim Chase

I want to redefine * such that if next match is not found, it
does # instead (goes to previous match).

Also, I want to redefine # so that is previoue match is not found,
it does * instead.

How to do do it ? I want it to be independent of 'wrapscan'
option (I have 'nowrapscan' always, anyway).


I think this only makes sense in the case where 'nowrapscan' is 
set.  Otherwise, there will always be a next/previous item to 
find by just wrapping around again.


A first-pass try at such an effort:

nnoremap  * :if !search('\<'.escape(expand(''), 
'~^$\\.*[').'\>', 'Ws') call 
search('\<'.escape(expand(''), '~^$\\.*[').'\>', 
'Wsb')endif


nnoremap  # :if !search('\<'.escape(expand(''), 
'~^$\\.*[').'\>', 'Wsb') call 
search('\<'.escape(expand(''), '~^$\\.*[').'\>', 
'Ws')endif



Seemed to do something fairly close to what you describe.  I 
don't know if I got the whole suite of characters to escape.  One 
really only needs to escape characters that would appear in 
'iskeyword', but as that set is user-modifiable, it would be 
better to escape every possible candidate.  If you have funky 
characters in your iskeyword that trigger hiccups in the search() 
function, just add them to the sets of characters that need to be 
escaped:


~^$\\.*[

-tkc









Re: locked window

2006-10-19 Thread Andy Wokula

Brecht Machiels schrieb:

Hi,


You can clear the 'modifiable' option to disable unintended
modifications to a buffer.

   setlocal nomodifiable


Is is possible to prevent, for example, the project plugin from opening
another file (other than the current) in a window? The nomodifiable
option only applies to the buffer. The window should be locked to the
buffer instead.

Regards,
Brecht




:help :sandbox

may help (vim7 only I think).

Andy





___ 
Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de


Re: locked window

2006-10-19 Thread A.J.Mechelynck

Brecht Machiels wrote:

Hi,


You can clear the 'modifiable' option to disable unintended
modifications to a buffer.

   setlocal nomodifiable


Is is possible to prevent, for example, the project plugin from opening
another file (other than the current) in a window? The nomodifiable
option only applies to the buffer. The window should be locked to the
buffer instead.

Regards,
Brecht




Instead of calling the program "vim", call it "rview". Then you won't be able 
to write anything, nor to use a shell command. Is that safe enough? Maybe 
":help starting.txt" will give you other ideas.



Best regards,
Tony.


Re: redefining * and #

2006-10-19 Thread Yakov Lerner

On 10/19/06, Yakov Lerner <[EMAIL PROTECTED]> wrote:

I want to redefine * such that if next match is not found, it
does # instead (goes to previous match).

Also, I want to redefine # so that is previoue match is not found,
it does * instead.

How to do do it ? I want it to be independent of 'wrapscan'
option (I have 'nowrapscan' always, anyway).


ok, I solved this. please ignore.

Yakov


Re: Fighting with comments

2006-10-19 Thread eric1235711

this worked too

I think this is better, help tells that this formatoptions is specific to
coments and things...

But I´m getting disgusted of these "secret and magic commands"...

thaks


Peter Hodge-2 wrote:
> 
> 
> --- Gary Johnson <[EMAIL PROTECTED]> wrote:
> 
>> On 2006-10-18, eric1235711 <[EMAIL PROTECTED]> wrote:
>> 
>> > Yakov Lerner-3 wrote:
>> > > 
>> > > On 10/18/06, eric1235711 <[EMAIL PROTECTED]> wrote:
>> > >>
>> > >> Hello
>> > >>
>> > >> I´m PHP programmer and I started programming in gVim last weak, and
>> I´m
>> > >> liking it very much
>> > >>
>> > >> But I got a trouble...
>> > >>
>> > >> When I´m commenting (// or /* or #) and I type  it breaks the
>> line
>> > >> automatically. Always I start a comment, i have to go to normal mode
>> and
>> > >> type :set nosta :set noai :set nosi
>> > >>
>> > >> I find that only nosta or nosi is enought to make it stop breaking
>> the
>> > >> line
>> > >> automatically, but I want to configure to it stop doing it
>> forever...
>> > >>
>> > >> I took a look in syntax/php.vim but I just don´t know where correct
>> it...
>> > >>
>> > >> Do you have any idea of how I fix it?
>> > > 
>> > > Does this help:
>> > >:set tw=0
>> > > ?
>> 
>> > I can fix it when I´m programming, i´m doing it... but I´m getting
>> tired of
>> > doing that.
>> > 
>> > I want to alter the syntax file (or what ever else) to fix it
>> permanently.
>> 
>> First of all, don't alter any of the files that are in the
>> $VIMRUNTIME directory.  For Vim-7.0 on Windows, this is commonly
>> 
>> C:\Program Files\Vim\vim70
>> 
>> Doing so will cause you to lose those changes when you upgrade your
>> vim installation.
>> 
>> The way to fix this problem is to create two new directories:
>> 
>> $VIM\vimfiles\after
>> $VIM\vimfiles\after\ftplugin
>> 
>> on Windows or
>> 
>> ~/.vim/after
>> ~/.vim/after/ftplugin
>> 
>> on Unix.  Then create a new file in the after/ftplugin directory
>> named php.vim and put in it those commands that fix the problem,
>> e.g.,
>> 
>> setlocal nosta
>> setlocal noai
>> setlocal nosi
> 
> I wouldn't have thought those options would make a difference? You should
> be
> able to just use (in after/ftplugin/php.vim):
> 
>   " don't auto-wrap text
>   setlocal formatoptions-=t
> 
>   " don't auto-wrap comments either.
>   setlocal formatoptions-=c
> 
> regards,
> Peter
> 
> 
>   
>  
> On Yahoo!7 
> Men's Health Radio: Chill out or work out, or just tune in
> http://au.launch.yahoo.com/mens-health-radio/index.html
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Fighting-with-comments-tf2467964.html#a6896241
Sent from the Vim - General mailing list archive at Nabble.com.



Re: Fighting with comments

2006-10-19 Thread eric1235711

here it's in this way:
C:/Program Files/Vim
and it contains vim70/ and vimfiles/

Oh, thanks, Gary! it worked!!!

But I didn´t like it!!!

when I changed C:/Program Files/Vim/vimfiles/ftplugin/php.vim it stoped
'autowriting' comments in new lines...
but when I changed C:/Program Files/Vim/vimfiles/after/ftplugin/php.vim it
worked perfectly... 

I didn´t undertand... why did it work?


Gary Johnson wrote:
> 
> On 2006-10-18, eric1235711 <[EMAIL PROTECTED]> wrote:
> 
> First of all, don't alter any of the files that are in the
> $VIMRUNTIME directory.  For Vim-7.0 on Windows, this is commonly
> 
> C:\Program Files\Vim\vim70
> 
> Doing so will cause you to lose those changes when you upgrade your
> vim installation.
> 
> The way to fix this problem is to create two new directories:
> 
> $VIM\vimfiles\after
> $VIM\vimfiles\after\ftplugin
> 
> on Windows or
> 
> ~/.vim/after
> ~/.vim/after/ftplugin
> 
> on Unix.  Then create a new file in the after/ftplugin directory
> named php.vim and put in it those commands that fix the problem,
> e.g.,
> 
> setlocal nosta
> setlocal noai
> setlocal nosi
> 
> Note the use of "setlocal" instead of "set".  This will keep those
> changes local to your PHP buffer(s) so that you can use other
> settings in other buffers you might have open at the same time.
> 
> See:
> 
> :help ftplugin-overrule
> :help ftplugin
> 
> HTH,
> Gary
> 
> -- 
> Gary Johnson | Agilent Technologies
> [EMAIL PROTECTED] | Wireless Division
>  | Spokane, Washington, USA
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Fighting-with-comments-tf2467964.html#a6896080
Sent from the Vim - General mailing list archive at Nabble.com.



Re: Fighting with comments

2006-10-19 Thread eric1235711

My gvim version is 7.0


eric1235711 wrote:
> 
> Hello
> 
> I´m PHP programmer and I started programming in gVim last weak, and I´m
> liking it very much
> 
> But I got a trouble...
> 
> When I´m commenting (// or /* or #) and I type  it breaks the line
> automatically. Always I start a comment, i have to go to normal mode and
> type :set nosta :set noai :set nosi
> 
> I find that only nosta or nosi is enought to make it stop breaking the
> line automatically, but I want to configure to it stop doing it forever...
> 
> I took a look in syntax/php.vim but I just don´t know where correct it...
> 
> Do you have any idea of how I fix it?
> 

-- 
View this message in context: 
http://www.nabble.com/Fighting-with-comments-tf2467964.html#a6895768
Sent from the Vim - General mailing list archive at Nabble.com.



Re: Quickfix behaviour

2006-10-19 Thread Marius Roets

On 10/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:



> 1) I would like to open a new window/tab, rather than use the one
> above the quickfix window.

:h 'switchbuf' -> split

> 2) If the buffer is already open in another tab page, I'd like to jump
> there, instead of opening it in this tab again.

:h 'switchbuf' -> useopen, usetab


Thanks, it works great with one exception. When the quickfix is the
only window in the tab (i.e. :tab copen), then it does not respect
usetab (it opens a new split). If I do a :new to have a empty open
window above the quickfix window, and then jump to an error, it works
perfectly. Strange.

Thanks
Marius


redefining * and #

2006-10-19 Thread Yakov Lerner

I want to redefine * such that if next match is not found, it
does # instead (goes to previous match).

Also, I want to redefine # so that is previoue match is not found,
it does * instead.

How to do do it ? I want it to be independent of 'wrapscan'
option (I have 'nowrapscan' always, anyway).

Yakov


Re: Can the mailing list owner set "Reply-to" field be [EMAIL PROTECTED]

2006-10-19 Thread Christian J. Robinson
On Wed, 18 Oct 2006, Peng Yu wrote:

> Can the mailing list owner set "Reply-to" field in every mail
> forward from this mailing list be "vim@vim.org"?
> 
> I replied some mails to the original poster. But sometime I forget
> to reply the mails to the mailing list.

This request comes up from time to time on this and other lists, and
invariably someone points out a document such as this one:

http://www.unicom.com/pw/reply-to-harmful.html

To summarize, unless you're using a badly designed (i.e. broken)
mailer, it doesn't really help you--as other posts have pointed out,
you can just use "reply to all" or the sometimes provided "reply to
list" feature.  It also breaks things (such as the "reply to author"
feature), and frustrates people who /don't/ want a reply-to header to
be set.  In other words, this header was designed for the individual
email sender's use, not for mailing lists.


And before someone mentions the rebuttal to the above document, I want
to point out that there's a rebuttal to the rebuttal:
http://marc.merlins.org/netrants/listreplyto.html

- Christian

-- 
If you continually give you will continually have.
Christian J. Robinson <[EMAIL PROTECTED]> http://infynity.spodzone.com/
   PGP keys: 0x893B0EAF / 0xFB698360   http://infynity.spodzone.com/pgp


Re: Quickfix behaviour

2006-10-19 Thread hermitte
Hello,

Marius Roets <[EMAIL PROTECTED]> wrote:

> In a quickfix window, selecting an error (pressing enter) takes you to
> that error. The way it does this is by opening the file in the window
> above the quickfix window (if it is not open already, in which case it
> jumps to the open buffer, assuming the buffer is in the same tabpage).
> There are 2 problems I have with this situation. I can think of
> solutions to them using a ftplugin and remapping , but I
> thought maybe somebody had solved them already.

> 1) I would like to open a new window/tab, rather than use the one
> above the quickfix window.

:h 'switchbuf' -> split

> 2) If the buffer is already open in another tab page, I'd like to jump
> there, instead of opening it in this tab again.

:h 'switchbuf' -> useopen, usetab

HTH,


--
Luc Hermitte


Quickfix behaviour

2006-10-19 Thread Marius Roets

Hi everybody,
In a quickfix window, selecting an error (pressing enter) takes you to
that error. The way it does this is by opening the file in the window
above the quickfix window (if it is not open already, in which case it
jumps to the open buffer, assuming the buffer is in the same tabpage).
There are 2 problems I have with this situation. I can think of
solutions to them using a ftplugin and remapping , but I
thought maybe somebody had solved them already.
1) I would like to open a new window/tab, rather than use the one
above the quickfix window.
2) If the buffer is already open in another tab page, I'd like to jump
there, instead of opening it in this tab again.

Hope this is understandable.

Regards
Marius


Re: Match something that not in the pattern

2006-10-19 Thread Bill McCarthy
On Thu 19-Oct-06 2:28am -0600, you wrote:

> Bill McCarthy wrote:
>> On Wed 18-Oct-06 10:24pm -0600, A.J.Mechelynck wrote:
>> 
>>> Peng Yu wrote:
 Hi,

 I have the following file segments. I want to concatenate all the
 lines with their next lines, except that it ends with "}}". I want to
 use the pattern "\(}}\)[EMAIL PROTECTED]". It seems not working.

 Would you please help me to figure out how to match the lineend without 
 "}}"?

 Thanks,
 Peng
>>> To join every line not ending in }} with the following line, use the 
>>> ":j[oin]"
>>> command on every line _not_ matching the pattern /}}$/ which means "two
>>> closing braces at end of line". As a cherry on the cake, you can avoid 
>>> joining
>>> the last line in the file (which has no following line):
>>>
>>> :1,$-1v/}}$/j
>>>
>>> See
>>> :help multi-repeat
>>> :help :join
>> 
>> Let's assume those 10 lines in the example were the only
>> lines in the buffer.
>> 
>> vglobal will first mark lines 1-3 and 5-9.  It will next
>> apply the join command to each of those lines.  The line
>> numbers below refer to these original line numbers.
>> 
>> The join on 1 will join lines 1&2, the no longer existing
>> line 2 is skipped, join lines 3&4, join lines 5&6, skip 6,
>> join 7&8, skip 8 and, finally, join 9&10.
>> 
>> You end up with 5 lines.  The goal is to end with 2 lines.
>> 

> Hm, I see what you mean. Let's try a variation:
>
> :1,$-1v/}}$/while getline(".") !~ '}}$' | join | endwhile

That could result in an infinite loop if there were no '}}$'
in either of the last 2 lines - and an incorrect result if
there was no '}}$' in the last line.

It would work by replacing:

getline(".") !~ '}}$'

with:

getline(".") !~ '}}$' && line(".") != line("$")

-- 
Best regards,
Bill



Re: Match something that not in the pattern

2006-10-19 Thread A.J.Mechelynck

Bill McCarthy wrote:

On Thu 19-Oct-06 2:28am -0600, you wrote:


Bill McCarthy wrote:

On Wed 18-Oct-06 10:24pm -0600, A.J.Mechelynck wrote:


Peng Yu wrote:

Hi,

I have the following file segments. I want to concatenate all the
lines with their next lines, except that it ends with "}}". I want to
use the pattern "\(}}\)[EMAIL PROTECTED]". It seems not working.

Would you please help me to figure out how to match the lineend without 
"}}"?


Thanks,
Peng

To join every line not ending in }} with the following line, use the ":j[oin]"
command on every line _not_ matching the pattern /}}$/ which means "two
closing braces at end of line". As a cherry on the cake, you can avoid joining
the last line in the file (which has no following line):

:1,$-1v/}}$/j

See
:help multi-repeat
:help :join

Let's assume those 10 lines in the example were the only
lines in the buffer.

vglobal will first mark lines 1-3 and 5-9.  It will next
apply the join command to each of those lines.  The line
numbers below refer to these original line numbers.

The join on 1 will join lines 1&2, the no longer existing
line 2 is skipped, join lines 3&4, join lines 5&6, skip 6,
join 7&8, skip 8 and, finally, join 9&10.

You end up with 5 lines.  The goal is to end with 2 lines.




Hm, I see what you mean. Let's try a variation:

:1,$-1v/}}$/while getline(".") !~ '}}$' | join | endwhile


That could result in an infinite loop if there were no '}}$'
in either of the last 2 lines - and an incorrect result if
there was no '}}$' in the last line.

It would work by replacing:

getline(".") !~ '}}$'

with:

getline(".") !~ '}}$' && line(".") != line("$")



Hadn't thought of that. So IIUC our final try is

1,$-1v/}}$/
\   while getline(".") !~ '}}$'
\   && line(".") != line ("$")
\ |   join
\ | endwhile

isn't it?


Best regards,
Tony.


Re: Match something that not in the pattern

2006-10-19 Thread Bill McCarthy
On Thu 19-Oct-06 3:08am -0600, you wrote:

> Hadn't thought of that. So IIUC our final try is

> 1,$-1v/}}$/
> \   while getline(".") !~ '}}$'
> \   && line(".") != line ("$")
> \ |   join
> \ | endwhile

> isn't it?

For this vglobal approach, yes.

I still prefer:

%s/\v%(}})@

Re: locked window

2006-10-19 Thread Brecht Machiels

Hi,


You can clear the 'modifiable' option to disable unintended
modifications to a buffer.

   setlocal nomodifiable


Is is possible to prevent, for example, the project plugin from opening
another file (other than the current) in a window? The nomodifiable
option only applies to the buffer. The window should be locked to the
buffer instead.

Regards,
Brecht



Re: Match something that not in the pattern

2006-10-19 Thread A.J.Mechelynck

Bill McCarthy wrote:

On Wed 18-Oct-06 10:24pm -0600, A.J.Mechelynck wrote:


Peng Yu wrote:

Hi,

I have the following file segments. I want to concatenate all the
lines with their next lines, except that it ends with "}}". I want to
use the pattern "\(}}\)[EMAIL PROTECTED]". It seems not working.

Would you please help me to figure out how to match the lineend without 
"}}"?


Thanks,
Peng

To join every line not ending in }} with the following line, use the ":j[oin]"
command on every line _not_ matching the pattern /}}$/ which means "two
closing braces at end of line". As a cherry on the cake, you can avoid joining
the last line in the file (which has no following line):

:1,$-1v/}}$/j

See
:help multi-repeat
:help :join


Let's assume those 10 lines in the example were the only
lines in the buffer.

vglobal will first mark lines 1-3 and 5-9.  It will next
apply the join command to each of those lines.  The line
numbers below refer to these original line numbers.

The join on 1 will join lines 1&2, the no longer existing
line 2 is skipped, join lines 3&4, join lines 5&6, skip 6,
join 7&8, skip 8 and, finally, join 9&10.

You end up with 5 lines.  The goal is to end with 2 lines.



Hm, I see what you mean. Let's try a variation:

:1,$-1v/}}$/while getline(".") !~ '}}$' | join | endwhile


Best regards,
Tony.


Re: Match something that not in the pattern

2006-10-19 Thread Bill McCarthy
On Wed 18-Oct-06 10:24pm -0600, A.J.Mechelynck wrote:

> Peng Yu wrote:
>> Hi,
>> 
>> I have the following file segments. I want to concatenate all the
>> lines with their next lines, except that it ends with "}}". I want to
>> use the pattern "\(}}\)[EMAIL PROTECTED]". It seems not working.
>> 
>> Would you please help me to figure out how to match the lineend without 
>> "}}"?
>> 
>> Thanks,
>> Peng
>
> To join every line not ending in }} with the following line, use the ":j[oin]"
> command on every line _not_ matching the pattern /}}$/ which means "two
> closing braces at end of line". As a cherry on the cake, you can avoid joining
> the last line in the file (which has no following line):
>
> :1,$-1v/}}$/j
>
> See
> :help multi-repeat
> :help :join

Let's assume those 10 lines in the example were the only
lines in the buffer.

vglobal will first mark lines 1-3 and 5-9.  It will next
apply the join command to each of those lines.  The line
numbers below refer to these original line numbers.

The join on 1 will join lines 1&2, the no longer existing
line 2 is skipped, join lines 3&4, join lines 5&6, skip 6,
join 7&8, skip 8 and, finally, join 9&10.

You end up with 5 lines.  The goal is to end with 2 lines.

-- 
Best regards,
Bill