PT-BR GUI menu translations

2006-09-18 Thread José de Paula Rodrigues

Here is the menu_pt_br.vim (Brazilian Portuguese), updated to Vim 7.0
new features (Spell Checking and Sponsor/Register :D ). The file
wasn't updated since 2003, and I've changed e-mail since then. Sorry
for not releasing it in time for 7.0.000 release.

The CCed fellow maintained the menu_pt_pt.vim (Portuguese Portuguese),
based on this menu_pt_br, and I think he should know about this
(slight) change.


menu_pt_br.vim
Description: Binary data


How does vim recognize file type?

2006-09-18 Thread Andrea Spadaccini
Hello,
I am using tablatex.vim, ftplugin for LaTeX files, and I have a main
latex file and several included .tex files.

Well, vim loads the plugin (and the syntax file) when I'm editing the
main file, while it doesn't when I'm editing the included files.

How can I tell vim that I'm editing a .tex file? And how do I make vim
recognize .tex files without me setting the filetype?

TIA,

-- 
[ Andrea Spadaccini - a.k.a. Lupino - from Catania - ICQ #: 91528290 ]
[ GPG ID: 5D41ABF0 - key on keyservers - Gentoo GNU / Linux - 2.6.17 ]
[ Linux Registered User 313388 - @: a.spadaccini(at)catania.linux.it ]


signature.asc
Description: PGP signature


Re: How does vim recognize file type?

2006-09-18 Thread Samuel Wright

In your vim folder you probably have a filetype.vim which has a couple
of lines per file type to detect when an extension is opened or
created, and set the filetype automatically.

Sam

On 18/09/06, Andrea Spadaccini [EMAIL PROTECTED] wrote:

Hello,
I am using tablatex.vim, ftplugin for LaTeX files, and I have a main
latex file and several included .tex files.

Well, vim loads the plugin (and the syntax file) when I'm editing the
main file, while it doesn't when I'm editing the included files.

How can I tell vim that I'm editing a .tex file? And how do I make vim
recognize .tex files without me setting the filetype?

TIA,

--
[ Andrea Spadaccini - a.k.a. Lupino - from Catania - ICQ #: 91528290 ]
[ GPG ID: 5D41ABF0 - key on keyservers - Gentoo GNU / Linux - 2.6.17 ]
[ Linux Registered User 313388 - @: a.spadaccini(at)catania.linux.it ]





Re: How does vim recognize file type?

2006-09-18 Thread Andrea Spadaccini
Ciao Samuel,

 In your vim folder you probably have a filetype.vim which has a couple
 of lines per file type to detect when an extension is opened or
 created, and set the filetype automatically.

Thanks, I modified it and it works like a charm! :)

-- 
[ Andrea Spadaccini - a.k.a. Lupino - from Catania - ICQ #: 91528290 ]
[ GPG ID: 5D41ABF0 - key on keyservers - Gentoo GNU / Linux - 2.6.17 ]
[ Linux Registered User 313388 - @: a.spadaccini(at)catania.linux.it ]


signature.asc
Description: PGP signature


Re: How does vim recognize file type?

2006-09-18 Thread Benji Fisher
On Mon, Sep 18, 2006 at 12:50:59PM +0200, Andrea Spadaccini wrote:
 Ciao Samuel,
 
  In your vim folder you probably have a filetype.vim which has a couple
  of lines per file type to detect when an extension is opened or
  created, and set the filetype automatically.
 
 Thanks, I modified it and it works like a charm! :)

 The standard advice is *not* to modify any files under $VIMRUNTIME,
including the filetype.vim that comes with the standard vim
distribution.  One reason is that any changes you make will be lost when
you upgrade to a new version of vim.

 If your files end in .tex and are not being recognized as LaTeX
(i.e., the 'filetype' option is not being set to tex) then the
simplest solution is probably to add the line

let tex_flavor = latex

to your vimrc file.  See

:help ft-tex-plugin

HTH --Benji Fisher


Re: How does vim recognize file type?

2006-09-18 Thread Charles E Campbell Jr

Andrea Spadaccini wrote:


I am using tablatex.vim, ftplugin for LaTeX files, and I have a main
latex file and several included .tex files.

Well, vim loads the plugin (and the syntax file) when I'm editing the
main file, while it doesn't when I'm editing the included files.

How can I tell vim that I'm editing a .tex file? And how do I make vim
recognize .tex files without me setting the filetype?
 


Vim recognizes file types using two files:  (assuming 7.0)

  vim70/filetype.vim
  vim70/scripts.vim

The filetype.vim file recognizes filetypes based on the files' 
extension (ie.  .c is a C file, .lsp is a Lisp file, etc).
The scripts.vim file recognizes filetypes based on the files' contents 
(ie. the first line is /bin/ksh, so its a shell file, etc).


If you wish to customize this process to recognize personal extensions 
as some filetype or to recognize file contents as indicating some 
filetype, make a personal   (wherever)/.vim/filetype.vim  -or-  
(wherever)/.vim/scripts.vim  with appropriate recognition code.  Look at 
the vim70 versions for ideas about how to accomplish this.   Caveat: 
*don't* change the distributed vim70/filetype.vim or 
vim70/scripts.vim.   If you do, your emendations will no longer be 
working and you'll make yourself a lot of irritating work trying to find 
out why.


Regards,
Chip Campbell



Selective line deletion

2006-09-18 Thread Fabien Meghazi

Hi all,

This is a stupid question about a basic feature but I don't have yet
enough knowledge with vim.

How can I delete all lines of a buffer where at least one instance of
foobar is found ?

eg the output of:

grep -v file.txt foobar

--
Fabien Meghazi

Website: http://www.amigrave.com
Email: [EMAIL PROTECTED]
IM: [EMAIL PROTECTED]


Re: Selective line deletion

2006-09-18 Thread Jürgen Krämer

Hi,

Fabien Meghazi wrote:
 
 This is a stupid question about a basic feature but I don't have yet
 enough knowledge with vim.
 
 How can I delete all lines of a buffer where at least one instance of
 foobar is found ?
 
 eg the output of:
 
 grep -v file.txt foobar

  :g/foobar/d

Regards,
Jürgen

-- 
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)



Re: Selective line deletion

2006-09-18 Thread striker

:g/foobar/d

check :help :g
Kevin


On Sep 18, 2006, at 10:42 AM, Fabien Meghazi wrote:


Hi all,

This is a stupid question about a basic feature but I don't have yet
enough knowledge with vim.

How can I delete all lines of a buffer where at least one instance of
foobar is found ?

eg the output of:

grep -v file.txt foobar

--
Fabien Meghazi

Website: http://www.amigrave.com
Email: [EMAIL PROTECTED]
IM: [EMAIL PROTECTED]





Re: Selective line deletion

2006-09-18 Thread Tim Chase

This is a stupid question about a basic feature but I don't have yet
enough knowledge with vim.

How can I delete all lines of a buffer where at least one instance of
foobar is found ?

eg the output of:

grep -v file.txt foobar


You'll want the :g command:

:g/foobar/d

It's inverse (delete lines that *don't* match foobar) is

:v/foobar/d

or

:g!/foobar/d

You can use any Ex command...you're not limited to [d]elete. 
Thus, you can indent all lines matching a pattern:


:g/foobar/

or only change blah to baz on lines containing foobar:

:g/foobar/s/blah/baz/g

or even operate on ranges of lines found by the :g/:v commands:

:g/foobar/.,+3 fold

will fold all lines containing foobar and the following three 
lines.


You can read more than anybody should ever have to know at

:help :g
:help ex-cmd-index
:help range

HTH,

-tim





cusor movement

2006-09-18 Thread J.Hofmann
Hello,

is it possible to tell vim(7) *not* to jump to the next line
when using object motion (w,b..) such as vim behaves when using l or h ?

Thank You

Joachim
###

This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange.
For more information, connect to http://www.f-secure.com/



Re: How does vim recognize file type?

2006-09-18 Thread Tim Chase
Caveat: *don't* change the distributed vim70/filetype.vim or 
vim70/scripts.vim.   If you do, your emendations will no 
longer be working and you'll make yourself a lot of irritating

 work trying to find out why.


I can speak from experience on this matter...In my naive early 
days of using Vim6.0, I modified these files.  It held me back 
from upgrading for a couple years because all of my changes would 
be lost.  I finally bit the bullet and upgraded to a more recent 
version (gotta love reformatting to make Windows happy).  By now 
adhering to the standards Dr. Chip suggests, I've been able to 
automatically upgrade several times with no impact in my personal 
preferences.


-tim




Re: Selective line deletion

2006-09-18 Thread Fabien Meghazi

  :g/foobar/d


Thanks all !


Re: E488 - Trailing characters

2006-09-18 Thread Bill McCarthy
On Mon 18-Sep-06 1:51am -0600, Yakov Lerner wrote:

 You cannot just put bar-separate sequence of commands
 under :silent. In the bar-separated sequence of commands,
 you need to prepend :silent to every command.

Yes, however when Tony suggested defining the command with
-bar (just what I needed), he also suggested that :silent
may apply beyond the command it proceeded.  As you note and
as I have noted in the post to which you are replying, this
is not the case.

 I suggest that you stick to sil cmd1|sil cmd2 |sil cmd3

I was and am using:  sil cmd1 | cmd2 | sil cmd3

This at first wasn't working (nothing to do with :silent)
because without a -bar in the definition of cmd1, I was
getting the E488.  After Tony's comments, I read over the
help section on -bar and added it to my two commands (cmd1
and cmd3 - cmd2 is the :helpgrep which I didn't want to
silence).

It all works fine.  Now I can use helpgrep on only the paths
of help files I choose to include.  In particular, my :HG
command now becomes :helpgrep applied to only the
$vimruntime help files (instead of full 'rtp' help files.

Thanks for your comments.

-- 
Best regards,
Bill



How pair g /g

2006-09-18 Thread Peng Yu

Hi,

I'm writing some xml code in vim. In xml, there are some pair like g
/g. Would you please let me know how to pair them as { and }
such that I can us % to visit them?

Thanks,
Peng


Help with errorformat

2006-09-18 Thread Jack Donohue

I've got errors that look like:

[cpp.bll/mail/javac] 
L:\PCC601\impl\fes.02\pcc.impl\lwp\cpp.bll\mail\src\com\ibm\pcc\bll\mail\components\MailPreferences.java:354: 
warning: createWmmDelegate() in 
com.ibm.workplace.people.wmm.workspace.WmmDelegateFactory has been 
deprecated
[cpp.bll/mail/javac] WmmDelegate wmmd = 
WmmDelegateFactory.INSTANCE.createWmmDelegate();
[cpp.bll/mail/javac] 
^


(three lines starting with [cpp.bll/mail/javac])

I'm not too concerned about the multiline syntax, I just want to be able to 
parse the first line containing file and line number info.  I played around 
with this a bit and came up with:


set efm=[cpp.bll/mail/javac]\ %f:%l:\ %m

which works but only for the package cpp.bll/mail.  What I really wanted was 
something like:


set efm=[%s]\ %f:%l:\ %m

where it would just gobble up an arbitrary string between the braces, but 
this doesn't work.  So how should one do this?


Thanks,


Jack



Re: How pair g /g

2006-09-18 Thread Thomas Holder
Peng Yu wrote:
 I'm writing some xml code in vim. In xml, there are some pair like
 g /g. Would you please let me know how to pair them as { and
 } such that I can us % to visit them?

source $VIMRUNTIME/macros/matchit.vim
let b:match_words = 'g:/g'

see $VIMRUNTIME/macros/matchit.txt for help.

Regards,
  Thomas


Re: Hiding lines

2006-09-18 Thread Meino Christian Cramer
From: Hari Krishna Dara [EMAIL PROTECTED]
Subject: Re: Hiding lines
Date: Sun, 17 Sep 2006 14:05:38 -0700 (PDT)

 
 On Sun, 17 Sep 2006 at 7:17pm, Meino Christian Cramer wrote:
 
  From: Tim Chase [EMAIL PROTECTED]
  Subject: Re: Hiding lines
  Date: Sun, 17 Sep 2006 11:15:13 -0500
 
 One could hide lines matching or !matching a certain pattern. Any
 further edit actions were only executed with the visible lines as
 target. Regardless what you were doing -- only the visible lines were
 affected. You had to give the unhide command explicitely to return
 to full text mode.
   
 There is a script snipped in the VimTips (#77) which does something
 like this, but the hidden lines are not protected or really
 invisible until unhide...
   
 Is there a way to mimic this feature with vim in any way ?
  
   Well, while it sounds like you may have already uncovered folding
   (which will collapse/hide a bunch of lines into one), but as you
   describe, it doesn't really protect those lines.  However, there
   are some things you can do do make them a little more protected.
 If you're doing :s commands (or other Ex commands), you can
   have them operate only over things that aren't currently folded
   away by modifying your Ex statement to be:
  
 :foldd s/foo/bar/g
  
   You can read all about folding at
  
 :help fold.txt
  
   wherein you'll find
  
 :help folddoopen
 :help folddoclosed
  
   which allow you to perform operations over sections of the file
   that are/aren't folded.
  
   You don't really describe what protected means...so perhaps if
   there are particular things that stymie you, you can mention them
   and perhaps a solution can be found for the particular problems.
  
   If you just want to extract certain lines, you can make use of a
   :g command, something like
  
 :let @a=''
 :g/pattern/y A
  
   will gather all the lines matching pattern into the a
   register.  This can be dumped in another buffer if needed.
  
   Or, I often find myself doing something like
  
 :g/pattern/#
  
   which will show me all the line numbers in the current file for
   lines matching pattern (after which I can just jump to that
   line by typing the line-number followed by G).
  
   Just a couple ideas...
  
   -tim
  
 
  Hi Tim,
 
   thank you for your explanations ! :O)
 
   With protected I mean the effect of doing as follows (but I mean
   the result only ... not the way which leads to it...)
 
   There is a text with some lines containing the word gold.
   Those lines should never be changed/edited.
   Therefore I will do a :g/gold/d
   Then I will do all commands, mistakes or whatever, which I will
   do -- all gold lines will not be affected.
   After all that I will do a undo delete of all lines containing
   'gold' -- and that's it.
 
   In reality an undo delete all lines containing /pattern/ is not
   pratical, impossible, irritationg or whatelse. This is only as an
   example for being protected.
 
   An Unix chmod a-w on all lines matching /pattern/ cames a little
   closer to it -- unless you are root, hehehehe
 
   But in the last example those lines were not hidden.
 
   Examples are only ...examples, therefore...
 
   Hope my german English is english enough... ;)
 
   Keep hacking!
   mcc
 
 Tim's :foldd and :foldo suggestions are actually very good in deed
 (didn't know about them), especially with the help of tools to create
 folds and operate commands on them. I would like to suggest you take a
 look at my foldutil.vim (http://www.vim.org/script.php?script_id=158).
 The benefit for you is that you can execute a single command to create
 folds that include/exclude all the lines that are matching or
 not-matching your specified pattern. You can then use :foldo or :foldd
 commands to issue commands on them.
 
 Also configure the 'foldopen' setting such that the folds will not be
 automatically opened by Vim when you move cursor around. I think,
 setting an empty value will help keep them closed as much as possible.
 
 You might also be interested in my multiselect.vim plugin
 (http://www.vim.org/script.php?script_id=953). It provides commands that
 are similar in nature to :foldo and :foldd to restrict normal mode and
 ex mode commands to selected regions. You can also use mouse to create
 selections.
 
 -- 
 HTH,
 Hari
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around 
 http://mail.yahoo.com 
 

Hi,

 I have downloaded your script and genutils but got some problems...
 
 It displays:

 Folds created: 0
 line   75:
 E117: Unknown function: RestoreHardPosition

 There is another message, which appears for a very short time -- too
 short for me to read it.

 What did I wrong here ?

 Keep hacking!
 mcc


Re: How pair g /g

2006-09-18 Thread Yakov Lerner

On 9/18/06, Thomas Holder [EMAIL PROTECTED] wrote:

Peng Yu wrote:
 I'm writing some xml code in vim. In xml, there are some pair like
 g /g. Would you please let me know how to pair them as { and
 } such that I can us % to visit them?

source $VIMRUNTIME/macros/matchit.vim
let b:match_words = 'g:/g'


Hmm, the set of xml tags that I have is large and
basically open-ended. Do you mean, there is no method
to let plugin handle *any* ... tag, automatically ?
Isn't it unproductive to add manually each and every tag
to b:match_words ?

Yakov


Re: ole in eclipse

2006-09-18 Thread Mark Palmer

I am mainly interested in getting eclipse to work with OLE, as I am
required to use Windows
at work.

Was just interested in bonobo out of interest. :-)

Does anyone know how to get vim to work as ole component in eclipse?

-Mark

On 9/9/06, A.J.Mechelynck [EMAIL PROTECTED] wrote:

Mark Palmer wrote:
 Does any one know how to open vim (any version) from eclipse as a ole
 component, or bonobo?

 -mark


Hmmm... Does it answer your question if I say that the OLE interface can
only be included in native-Windows versions of gvim ?

If it doesn't, see :help if_ole.txt and/or wait for an answer from
someone more competent than I am.


Best regards,
Tony.



Re: ole in eclipse

2006-09-18 Thread Manu Anand

On 9/18/06, Mark Palmer [EMAIL PROTECTED] wrote:

I am mainly interested in getting eclipse to work with OLE, as I am
required to use Windows
at work.

Was just interested in bonobo out of interest. :-)

Does anyone know how to get vim to work as ole component in eclipse?


Hi Mark:

You may like to try following steps

1. Go to GeneralEditorsFile Association menu
2. Click on Add and add the extension of file you want VIM to open.
For ex  *.java
3. Select VIM by selecting External Programs and browsing to VIM installation.

Alternatively if that extension is already present, select the same
and add VIM from the Add button in the bottom column.

HTH
Manu




-Mark

On 9/9/06, A.J.Mechelynck [EMAIL PROTECTED] wrote:
 Mark Palmer wrote:
  Does any one know how to open vim (any version) from eclipse as a ole
  component, or bonobo?
 
  -mark
 

 Hmmm... Does it answer your question if I say that the OLE interface can
 only be included in native-Windows versions of gvim ?

 If it doesn't, see :help if_ole.txt and/or wait for an answer from
 someone more competent than I am.


 Best regards,
 Tony.




Re: Text edit versus vi on some files

2006-09-18 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 18-Sep-06, at 11:56 AM, David Morel wrote:


Brian McKee a écrit :

file Localizable.strings
Localizable.strings: Big-endian UTF-16 Unicode C program  
character data

If I open that file in vim I get
??^@/[EMAIL PROTECTED]@ [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@ 
[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
PROTECTED]
but Text Edit displays it correctly.
Can vi handle this type of file?  If so, how?

in vim, type :h multibyte
that should get you started :)


Eeeek - started right around the bend I think :-)
Biggest issue from my current point of view is it studiously ignores  
Mac OS...


Chris Eidhof suggested

set encoding=utf8
set fileencoding=utf8


which works if you set it before you open the file in question.
Interestingly =utf16 'works' too... or at least it shows plain ASCII  
type lettering ok.


Between those ideas I've decided to leave things alone and just do a
   :e ++enc=utf16
whenever I see lots of alternating @ signs and letters :-)
I think I'd prefer leaving my standard encoding at latin1 to match  
the linux

boxes I'm often working on at the same time.

Am I right in understanding that Apple's TextEdit must be automatically
detecting UTF16 files and changing it's base encoding to match?

And is there some way that vi could do the same?

Brian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFFDuvUGnOmb9xIQHQRAi6hAJ9858onQRWXR+kByXCcm/Cpk631bACg2cbB
e2JH8drOIyERomjI7zpPTn0=
=Wa4n
-END PGP SIGNATURE-


Re: cusor movement

2006-09-18 Thread Tim Chase

is it possible to tell vim(7) *not* to jump to the next line
when using object motion (w,b..) such as vim behaves when
using l or h ?


Please give specific example of what you type in normal mode 
involving w or b that jumps to the next line, please.


When I use w or yw vim does not jump to the next line.


If I understand the OP correctly, given the following text

this is line one
this is line two

with the cursor on the l of line #1, pressing w goes to the 
o in one.  Pressing w a second time jumps to the t in 
this on the 2nd line as observed here...if it's not happening 
for you, the difference between your settings, Yakov, and our 
settings is the answer to the OP's question.


However, if you are on the e in one, and press ell to go 
right, it does not end up on the t in this on the 2nd line.


It sounds like the OP wants the behavior of w (and its kin) to 
mimic the behavior of ell, such that it doesn't jump to the next 
line.  I run with a fairly stock vimrc, as I suspect the OP does. 
 Do you have any funky settings in your vimrc, Yakov, that might 
trigger this behavior for you and not for us?


-tim





Re: Text edit versus vi on some files

2006-09-18 Thread Yakov Lerner

On 9/18/06, Brian McKee [EMAIL PROTECTED] wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 18-Sep-06, at 11:56 AM, David Morel wrote:

 Brian McKee a écrit :
 file Localizable.strings
 Localizable.strings: Big-endian UTF-16 Unicode C program
 character data
 If I open that file in vim I get
 ??^@/[EMAIL PROTECTED]@ [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
PROTECTED]@ [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
PROTECTED]@[EMAIL PROTECTED]
 but Text Edit displays it correctly.
 Can vi handle this type of file?  If so, how?
 in vim, type :h multibyte
 that should get you started :)

Eeeek - started right around the bend I think :-)
Biggest issue from my current point of view is it studiously ignores
Mac OS...

Chris Eidhof suggested
 set encoding=utf8
 set fileencoding=utf8

which works if you set it before you open the file in question.
Interestingly =utf16 'works' too... or at least it shows plain ASCII
type lettering ok.

Between those ideas I've decided to leave things alone and just do a
:e ++enc=utf16
whenever I see lots of alternating @ signs and letters :-)
I think I'd prefer leaving my standard encoding at latin1 to match
the linux
boxes I'm often working on at the same time.

Am I right in understanding that Apple's TextEdit must be automatically
detecting UTF16 files and changing it's base encoding to match?

And is there some way that vi could do the same?


The folowing autodetects utf-16 from latin1
for me I put it into my ~/.vimrc:

  au BufRead * if getline(1) =~ \n | e ++enc=utf16 | endi

... Does it following work for you ?

Yakov


Re: cusor movement

2006-09-18 Thread Charles E Campbell Jr

Tim Chase wrote:


is it possible to tell vim(7) *not* to jump to the next line
when using object motion (w,b..) such as vim behaves when
using l or h ?



Please give specific example of what you type in normal mode 
involving w or b that jumps to the next line, please.


When I use w or yw vim does not jump to the next line.



If I understand the OP correctly, given the following text

this is line one
this is line two

with the cursor on the l of line #1, pressing w goes to the o in 
one.  Pressing w a second time jumps to the t in this on the 
2nd line as observed here...if it's not happening for you, the 
difference between your settings, Yakov, and our settings is the 
answer to the OP's question.


However, if you are on the e in one, and press ell to go right, it 
does not end up on the t in this on the 2nd line.


It sounds like the OP wants the behavior of w (and its kin) to mimic 
the behavior of ell, such that it doesn't jump to the next line.  I 
run with a fairly stock vimrc, as I suspect the OP does.  Do you have 
any funky settings in your vimrc, Yakov, that might trigger this 
behavior for you and not for us?


I wouldn't know how to easily do what the OP asked; the opposite, that 
of making vim change lines with h or l *is* possible
(see   :help 'ww'  ).  I'm sure that some smart mapping could do the 
trick.  As an example: (untested)


nnoremap b :let curline= line(.)barexe norm! bbarif curline != 
line(.)|exe norm! w|endif


Should be easy to re-write for handling w.

Regards,
Chip Campbell



accents and tex

2006-09-18 Thread Matias Grana
hi;
I regularly use LaTeX and accented characters. I used to have commands
like
:ino 'a \'a
in order to write accents in TeX. The first problem is that it is not so
nice to read a file full of these tex commands. The second, and main,
problem, is that vim's dictionary does not see, say, aqu\'{\i} as
aquí, and therefore it hilights it as mispelled. So I thought on using
autocmd's to change the text. Basically, I have these commands in my
.vimrc

 excerpt of .vimrc -
augroup acentos
autocmd!
autocmd BufReadPost *.tex call Acentua()
autocmd BufWritePre *.tex exe normal mm | call Desacentua()
autocmd BufWritePost *.tex call Acentua() | exe normal `m
augroup END

fun! Acentua()
silent exe %s/'a/á/ge
silent exe %s/'e/é/ge
 etc 
endfun

fun! Desacentua()
silent exe %s/á/'a/ge
silent exe %s/é/'e/ge
 etc 
endfun
 end of excerpt 

Basically, under a saving it converts everything to TeX's way, saves it,
and then converts everything back to normal.
I know there are ways to use utf-8 or latin1 characters in TeX files,
but I prefer to stick to these mappings for portability reasons.

So far, so good. Now I have two problems:

1) the substitutions in the functions Acentua and Desacentua are saved
as changings. So undo commands mess with them. I'd like those changings
not to be seen by undo/redo commands. Is it possible?

2) Although I put a mark on the line I am at, and then go back to it in
BufWritePost, sometimes the window scrolls a few lines, which is not
very nice. Is it possible to save the first line appearing in the
window, and, at the end of the saving process, end up seeing exactly the
same lines I was seeing before?

Thanks in advance,
-- 
Matías Graña
[EMAIL PROTECTED]


Re: Text edit versus vi on some files

2006-09-18 Thread Brian McKee

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 18-Sep-06, at 3:24 PM, Yakov Lerner wrote:


On 9/18/06, Brian McKee [EMAIL PROTECTED] wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 18-Sep-06, at 11:56 AM, David Morel wrote:

 Brian McKee a écrit :
 file Localizable.strings
 Localizable.strings: Big-endian UTF-16 Unicode C program
 character data
 If I open that file in vim I get
 ??^@/[EMAIL PROTECTED]@ [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
PROTECTED]@ [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
PROTECTED]@[EMAIL PROTECTED]
 but Text Edit displays it correctly.
 Can vi handle this type of file?  If so, how?
 in vim, type :h multibyte
 that should get you started :)
{snippage}
Am I right in understanding that Apple's TextEdit must be  
automatically

detecting UTF16 files and changing it's base encoding to match?

And is there some way that vi could do the same?


The folowing autodetects utf-16 from latin1
for me I put it into my ~/.vimrc:

  au BufRead * if getline(1) =~ \n | e ++enc=utf16 | endi

... Does it following work for you ?


Nope.  With my original test file
the output looks reasonable, but it shows
 CONVERSION ERROR in line 391
at the bottom of the screen.

I then tried the Japanese version
/Applications/iTunes.app/Contents/Resources/Japanese.lproj/ 
Localizable.strings

and got a similar CONVERSION ERROR message, and lots of question marks.
If I start vi, and do
:set encoding=utf16
:set fileencoding=utf16
then reopen the file, I get what looks *to me* like Japanese  
characters  (I'm pretty much unilingual unfortunately)


Brian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFFDvf/GnOmb9xIQHQRAupWAJwOGYCxwJjUn1oMzcOaFqVggzBo2QCg4IJt
yQS7zG/rRCnsonFu1qvcCks=
=2NJG
-END PGP SIGNATURE-


backreferences with expression-syntax?

2006-09-18 Thread Thomas Holder
Hi,

when matching regular expressions with perl, backreferences will be
stored in $1 to $9. Does vim do anything similar? I have a script with
several lines like this

  if cline =~ '^\s*[._a-z0-9]\+\s\+\([-._a-z0-9]\+\)\s\+'
 ...
  endif

and I'd like to have the part which is in parantheses just like in perl.
  I could not find anything about backreferences in the vim manual.

Thanks in advance,
  Thomas


Re: backreferences with expression-syntax?

2006-09-18 Thread Yakov Lerner

On 9/19/06, Thomas Holder [EMAIL PROTECTED] wrote:

Hi,

when matching regular expressions with perl, backreferences will be
stored in $1 to $9. Does vim do anything similar? I have a script with
several lines like this

  if cline =~ '^\s*[._a-z0-9]\+\s\+\([-._a-z0-9]\+\)\s\+'
 ...
  endif

and I'd like to have the part which is in parantheses just like in perl.
  I could not find anything about backreferences in the vim manual.


You can use substitute as follows:
let patt='^\s*[._a-z0-9]\+\s\+\([-._a-z0-9]\+\)\s\+'
if cline =~ patt
 let _1 = substitute(cline, patt, '\1', '')
 let _2 = substitute(cline, patt, '\2', '')
 let _3 = substitute(cline, patt, '\2', '')

Yakov
P.S.
\1,\2,\1 are avaibale at the to-part of substitution
(:help submatch, :help sub-replace-special). But AFAIK,
these \1,\2,etc are not kept around after substitution or
after match.


Re: ole in eclipse

2006-09-18 Thread Mark Palmer

I gave that a whirl (again) but that simply opens vim as an external
editor rather than as an ole component. The Eclipse manual suggests
that 'if the application is properly registered as an ole application
it should be available in the list of external applications when you
select external editors' so either the vim ole does meet all the
requirement of a what eclipse deems proper 'ole component' or I doing
something wrong.

-Mark

On 9/18/06, Manu Anand [EMAIL PROTECTED] wrote:

On 9/18/06, Mark Palmer [EMAIL PROTECTED] wrote:
 I am mainly interested in getting eclipse to work with OLE, as I am
 required to use Windows
 at work.

 Was just interested in bonobo out of interest. :-)

 Does anyone know how to get vim to work as ole component in eclipse?

Hi Mark:

You may like to try following steps

1. Go to GeneralEditorsFile Association menu
2. Click on Add and add the extension of file you want VIM to open.
For ex  *.java
3. Select VIM by selecting External Programs and browsing to VIM installation.

Alternatively if that extension is already present, select the same
and add VIM from the Add button in the bottom column.

HTH
Manu



 -Mark

 On 9/9/06, A.J.Mechelynck [EMAIL PROTECTED] wrote:
  Mark Palmer wrote:
   Does any one know how to open vim (any version) from eclipse as a ole
   component, or bonobo?
  
   -mark
  
 
  Hmmm... Does it answer your question if I say that the OLE interface can
  only be included in native-Windows versions of gvim ?
 
  If it doesn't, see :help if_ole.txt and/or wait for an answer from
  someone more competent than I am.
 
 
  Best regards,
  Tony.
 




Re: backreferences with expression-syntax?

2006-09-18 Thread Yegappan Lakshmanan

Hi,

On 9/18/06, Yakov Lerner [EMAIL PROTECTED] wrote:

On 9/19/06, Thomas Holder [EMAIL PROTECTED] wrote:
 Hi,

 when matching regular expressions with perl, backreferences will be
 stored in $1 to $9. Does vim do anything similar? I have a script with
 several lines like this

   if cline =~ '^\s*[._a-z0-9]\+\s\+\([-._a-z0-9]\+\)\s\+'
  ...
   endif

 and I'd like to have the part which is in parantheses just like in perl.
   I could not find anything about backreferences in the vim manual.

You can use substitute as follows:
let patt='^\s*[._a-z0-9]\+\s\+\([-._a-z0-9]\+\)\s\+'
if cline =~ patt
  let _1 = substitute(cline, patt, '\1', '')
  let _2 = substitute(cline, patt, '\2', '')
  let _3 = substitute(cline, patt, '\2', '')



In Vim7, you can use the matchlist() function.

 let mlist = matchlist(cline, patt)

Now, mlist[0] contains the entire match, mlist[1] contains the
first submatch, mlist[2] contains the second submatch, etc.

  :help matchlist()

- Yegappan



Yakov
P.S.
\1,\2,\1 are avaibale at the to-part of substitution
(:help submatch, :help sub-replace-special). But AFAIK,
these \1,\2,etc are not kept around after substitution or
after match.



Re: Text edit versus vi on some files

2006-09-18 Thread Elliot Shank
Brian McKee wrote:
 On 18-Sep-06, at 11:56 AM, David Morel wrote:
 Brian McKee a écrit :
 file Localizable.strings
 Localizable.strings: Big-endian UTF-16 Unicode C program character
 data
 If I open that file in vim I get
 ??^@/[EMAIL PROTECTED]@ [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
 PROTECTED]@ [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
 PROTECTED]@[EMAIL PROTECTED]
 but Text Edit displays it correctly.
 Can vi handle this type of file?  If so, how?
 in vim, type :h multibyte
 that should get you started :)
 
 Eeeek - started right around the bend I think :-)
 Biggest issue from my current point of view is it studiously ignores Mac
 OS...
 
 Chris Eidhof suggested
 set encoding=utf8
 set fileencoding=utf8
 
 which works if you set it before you open the file in question.
 Interestingly =utf16 'works' too... or at least it shows plain ASCII
 type lettering ok.
 
 Between those ideas I've decided to leave things alone and just do a
:e ++enc=utf16
 whenever I see lots of alternating @ signs and letters :-)
 I think I'd prefer leaving my standard encoding at latin1 to match the
 linux
 boxes I'm often working on at the same time.
 
 Am I right in understanding that Apple's TextEdit must be automatically
 detecting UTF16 files and changing it's base encoding to match?
 
 And is there some way that vi could do the same?

I'm not seeing this problem (but see below).  I can open that file fine, and it 
shows everything correctly.

MacOS X 10.4.7
Vim 7.0 with patches 1-76
iTunes 7

I'm getting fileencoding=ucs-2 and encoding=utf-8.  I don't touch either option 
in ~/.vimrc.  However, in ~/.MacOSX/environment.plist, I am setting LANG to 
en_US.UTF-8, so I assume that Vim is picking the value of encoding based upon 
that.

Assuming that may be involved in things, I tried the following:

LANG=C gvim -RM Localizable.strings

Presto!  I see all your @ signs.

Therefore, change your LANG environment variable to include unicode in it.


Re: How pair g /g

2006-09-18 Thread A.J.Mechelynck

Peng Yu wrote:

Hi,

I'm writing some xml code in vim. In xml, there are some pair like g
/g. Would you please let me know how to pair them as { and }
such that I can us % to visit them?

Thanks,
Peng



- Install and use the matchit plugin (e.g., add a file 
$VIM/vimfiles/plugin/matchit.vim with the single line


runtime macros/matchit.vim

)

- I don't know how the xml.vim ftplugin does it; but HTML has similar 
paired tags, and my HTML files have the b:match_words variable set to 
':,\@=[ou]l\[^]*\%(\|$\):\@=li\:\@=/[ou]l,\@=dl\[^]*\%(\|$\):\@=d[td]\:\@=/dl,\@=\([^/][^ 
\t]*\)[^]*\%(\|$\):\@=/\1' (I don't do it, ftplugin/html.vim does it).


This pairs  with , most tags with the corresponding /tag, and ol 
or ul with any number of li with /ol or /ul (the cursor jumps 
from  to  or vice-versa when on  or , from the openiung tag to the 
closing tag when on the tag name itself).



Best regards,
Tony.


Re: ole in eclipse

2006-09-18 Thread A.J.Mechelynck

[ text blocks reordered to reflect chronology ]
Mark Palmer wrote:

On 9/18/06, Manu Anand [EMAIL PROTECTED] wrote:

On 9/18/06, Mark Palmer [EMAIL PROTECTED] wrote:
 On 9/9/06, A.J.Mechelynck [EMAIL PROTECTED] wrote:
  Mark Palmer wrote:
   Does any one know how to open vim (any version) from eclipse as 
a ole

   component, or bonobo?
  
   -mark
  
 
  Hmmm... Does it answer your question if I say that the OLE 
interface can

  only be included in native-Windows versions of gvim ?
 
  If it doesn't, see :help if_ole.txt and/or wait for an answer from
  someone more competent than I am.
 
 
  Best regards,
  Tony.
 

 I am mainly interested in getting eclipse to work with OLE, as I am
 required to use Windows
 at work.

 Was just interested in bonobo out of interest. :-)

 Does anyone know how to get vim to work as ole component in eclipse?

 -Mark


Hi Mark:

You may like to try following steps

1. Go to GeneralEditorsFile Association menu
2. Click on Add and add the extension of file you want VIM to open.
For ex  *.java
3. Select VIM by selecting External Programs and browsing to VIM 
installation.


Alternatively if that extension is already present, select the same
and add VIM from the Add button in the bottom column.

HTH
Manu







 I gave that a whirl (again) but that simply opens vim as an external
 editor rather than as an ole component. The Eclipse manual suggests
 that 'if the application is properly registered as an ole application
 it should be available in the list of external applications when you
 select external editors' so either the vim ole does meet all the
 requirement of a what eclipse deems proper 'ole component' or I doing
 something wrong.

 -Mark


1. You should use gvim.exe, not vim.exe

2. Your gvim version should have OLE support compiled-in (e.g., with 
OLE support should appear on one of the first five lines in the output 
of the :version command).


3. Your gvim program should be registered with Windows as an OLE server. 
It normally does that (with a yes/no prompt) the first time it is run; 
or you can run gvim -register to make sure that it does register 
itself. You may need to log in to Windows on an administrator account to 
do that.


See
:help -register
:help -unregister

4. I don't know Eclipse. You may have to tell it that gvim is available 
as an OLE server.


5. Please read :help if_ole.txt (the whole help file) attentively. If 
you have Visual Basic, Python, or Perl, you may try the examples given 
there to see how the result resembles, or differs from, what you see 
under Eclipse.



Best regards,
Tony.


Re: Text edit versus vi on some files

2006-09-18 Thread A.J.Mechelynck

Brian McKee wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 18-Sep-06, at 11:56 AM, David Morel wrote:


Brian McKee a écrit :

file Localizable.strings
Localizable.strings: Big-endian UTF-16 Unicode C program character 
data

If I open that file in vim I get
??^@/[EMAIL PROTECTED]@ [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@ 
[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL 
PROTECTED]
but Text Edit displays it correctly.
Can vi handle this type of file?  If so, how?

in vim, type :h multibyte
that should get you started :)


Eeeek - started right around the bend I think :-)
Biggest issue from my current point of view is it studiously ignores Mac 
OS...


Chris Eidhof suggested

set encoding=utf8
set fileencoding=utf8


which works if you set it before you open the file in question.
Interestingly =utf16 'works' too... or at least it shows plain ASCII 
type lettering ok.


Between those ideas I've decided to leave things alone and just do a
   :e ++enc=utf16
whenever I see lots of alternating @ signs and letters :-)
I think I'd prefer leaving my standard encoding at latin1 to match the 
linux

boxes I'm often working on at the same time.

Am I right in understanding that Apple's TextEdit must be automatically
detecting UTF16 files and changing it's base encoding to match?

And is there some way that vi could do the same?

Brian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFFDuvUGnOmb9xIQHQRAi6hAJ9858onQRWXR+kByXCcm/Cpk631bACg2cbB
e2JH8drOIyERomjI7zpPTn0=
=Wa4n
-END PGP SIGNATURE-




Your example looks like UTF-16 (or UCS-2) text, i.e. Unicode encoded at 
two bytes per character for most characters. Such text may contain 
characters (Chinese, Russian, Hebrew, Greek, Arabic, whatever) which 
canot be represented in latin1. I suggest the following (in gvim):


if termencoding == 
let termencoding = encoding
endif
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,latin1

Here's an explanation:

'termencoding' defines how your keyboard encodes the data. The default 
is empty, which means fallback to 'encoding'. If you change 
'encoding', you should keep 'termencoding' at the _old_ value of 
'encoding', the one which was set according to your OS locale.


'encoding' defines how Vim represents the data in memory. For all 
Unicode encodings, Vim actually uses UTF-8 internally, because other 
Unicode encodings uses null bytes within the data, and that is 
incompatible with the way the C language encodes strings.


'fileencodings' (plural) defines which heuristics Vim will use to 
guess the 'fileencoding' (singular) of an editfile when opening it. 
ucs-bom means check for a BOM at the start of the file. The BOM is 
the codepoint U+FEFF ZERO-WIDTH NO-BREAK SPACE (which is deprecated 
except as an encoding marker). It looks like your file has one; each 
Unicode encoding has a different disk representation for it (here in hex):


UTF-8:   EF BB BF
UTF-16be:FE FF
UTF-16le:FF FE
UTF-32be:00 00 FE FF
UTF-32le:FF FE 00 00

The encodings mentioned in 'fileencodings' are tested from left to 
right. 'ucs-bom', if present, should be first; and since 8-bit encodings 
never give an error signal (every byte is valid in an 8-bit encoding), 
there should be at most one 8-bit encoding (such as latin1) and, if 
present, it should come last.


After setting the above settings, Vim should open correctly any Unicode 
file with BOM (like yours seems to be) and any UTF-8 file. 7-bit 
US-ASCII files will be seen as UTF-8 (which is compatible in the 
0x00-0x7F range) and Latin1 files which include accented characters or 
other bytes in the range 0x80-0xFF, will be opened as latin1.



Best regards,
Tony.


Re: Hiding lines

2006-09-18 Thread Hari Krishna Dara

On Mon, 18 Sep 2006 at 8:01pm, Meino Christian Cramer wrote:
 
  Tim's :foldd and :foldo suggestions are actually very good in deed
  (didn't know about them), especially with the help of tools to create
  folds and operate commands on them. I would like to suggest you take a
  look at my foldutil.vim (http://www.vim.org/script.php?script_id=158).
  The benefit for you is that you can execute a single command to create
  folds that include/exclude all the lines that are matching or
  not-matching your specified pattern. You can then use :foldo or :foldd
  commands to issue commands on them.
 
  Also configure the 'foldopen' setting such that the folds will not be
  automatically opened by Vim when you move cursor around. I think,
  setting an empty value will help keep them closed as much as possible.
 
  You might also be interested in my multiselect.vim plugin
  (http://www.vim.org/script.php?script_id=953). It provides commands that
  are similar in nature to :foldo and :foldd to restrict normal mode and
  ex mode commands to selected regions. You can also use mouse to create
  selections.

 Hi,

  I have downloaded your script and genutils but got some problems...

  It displays:

  Folds created: 0
  line   75:
  E117: Unknown function: RestoreHardPosition

  There is another message, which appears for a very short time -- too
  short for me to read it.

  What did I wrong here ?

  Keep hacking!
  mcc

Looks like I haven't uploaded the one which uses the autoload version of
genutils yet. I will update it soon, but meanwhile please try the below
version:

http://haridara.googlepages.com/foldutil.vim

-- 
Thanks,
Hari

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


Re: Hiding lines

2006-09-18 Thread Meino Christian Cramer
From: Hari Krishna Dara [EMAIL PROTECTED]
Subject: Re: Hiding lines
Date: Mon, 18 Sep 2006 17:48:42 -0700 (PDT)

 
 On Mon, 18 Sep 2006 at 8:01pm, Meino Christian Cramer wrote:
  
   Tim's :foldd and :foldo suggestions are actually very good in deed
   (didn't know about them), especially with the help of tools to create
   folds and operate commands on them. I would like to suggest you take a
   look at my foldutil.vim (http://www.vim.org/script.php?script_id=158).
   The benefit for you is that you can execute a single command to create
   folds that include/exclude all the lines that are matching or
   not-matching your specified pattern. You can then use :foldo or :foldd
   commands to issue commands on them.
  
   Also configure the 'foldopen' setting such that the folds will not be
   automatically opened by Vim when you move cursor around. I think,
   setting an empty value will help keep them closed as much as possible.
  
   You might also be interested in my multiselect.vim plugin
   (http://www.vim.org/script.php?script_id=953). It provides commands that
   are similar in nature to :foldo and :foldd to restrict normal mode and
   ex mode commands to selected regions. You can also use mouse to create
   selections.
 
  Hi,
 
   I have downloaded your script and genutils but got some problems...
 
   It displays:
 
   Folds created: 0
   line   75:
   E117: Unknown function: RestoreHardPosition
 
   There is another message, which appears for a very short time -- too
   short for me to read it.
 
   What did I wrong here ?
 
   Keep hacking!
   mcc
 
 Looks like I haven't uploaded the one which uses the autoload version of
 genutils yet. I will update it soon, but meanwhile please try the below
 version:
 
 http://haridara.googlepages.com/foldutil.vim
 
 -- 
 Thanks,
 Hari
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around 
 http://mail.yahoo.com 
 

Hi Hari !

 thanks a lot for your reply! :)

 I installed the foldutils.vim from the above link.
 But this one complains foldutil: You need a newer version of
 multvals.vim plugin -- but I have already installed the newest
 version available.

 How can I help to solve the problem?

 Have a nice day! :)
 Meino




[ANN] vim 7 ruby omni-complete 0.7

2006-09-18 Thread Mark Guzman
It's happened again, I've got a piping hot new version of rubycomplete 
availible. 

If you missed the original announcement, rubycomplete provides a vim7
omni-completion function (code completion) for vim. It is based on 
complete.rb, pycomplete.vim and ccomplete.vim. Any input is welcome.

I've joined up with the vim-ruby team, so you'll find rubycomplete.vim in cvs at
http://vim-ruby.rubyforge.org in addition to my site (listed below) which will 
only carry my full
releases.



Whats New:

 * Bug fixes 

 * Much improved handling of syntax problems in code

 * Rails views are now supported

 * Inclusion of rails helpers where possible/necessary

 * Kernel/system methods are now included in completions

 * In-buffer modules are now completed

 * Improved error handling

Todo:

  * prototype display?
  * faster rails framework loading
  * camping support
  * nitro+og support
  * html completion in views
  * completion for singletons

http://blog.hasno.info/blog/segfault/dev/2006/04/10/vim-7-ruby-omni-completion.html
  --mark

-- 
sic transit gloria et adulescentia 
blog | http://blog.hasno.info/blog
wiki | http://wiki.hasno.info