Saturday, July 31, 2010

Re: How could I show the line by indent as in notepad++?

On 08/01/2010 04:54 AM, Maxim Kim wrote:
>> 'colorcolumn' option depends on the value of textwidth, and can only
>> highlight one
>> column. Is there any other method? Thank you.
>>
> try
> :set colorcolumn=4,8,12,16
>
Hello,

However, this highlight a whole column not part of the column. Is that
possible to
highlight part of the column?

Regards,
H Xu
08/01/2010

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: How could I show the line by indent as in notepad++?

> 'colorcolumn' option depends on the value of textwidth, and can only
> highlight one
> column. Is there any other method? Thank you.
>
try
:set colorcolumn=4,8,12,16

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: How could I show the line by indent as in notepad++?

On 07/20/2010 12:24 PM, Tony Mechelynck wrote:
> On 20/07/10 05:32, H Xu wrote:
>> Hello everyone,
>>
>> In notepad++, when editing c/c++ or java source files, there are
>> vertical lines clearly shows the indent of the file.
>>
>>
>>
>> How could I show the lines in vim?
>>
>> Regards,
>> Hong Xu
>> 2010/7/20
>>
>> --
>> You received this message from the "vim_use" maillist.
>> Do not top-post! Type your reply below the text you are replying to.
>> For more information, visit http://www.vim.org/maillist.php
>
> Install Vim 7.3b and use the 'colorcolumn' option. Or do it the hard
> way, see
> :help :match
> :help :2match
> :help matchadd()
> :help /ordinary-atom
>
>
> Best regards,
> Tony.
Hello Tony Mechelynck,

'colorcolumn' option depends on the value of textwidth, and can only
highlight one
column. Is there any other method? Thank you.

Regards,
Hong Xu
08/01/2010

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: What key is bound to Something?

On Sat, Jul 31, 2010 at 2:32 AM, Tony Mechelynck
<antoine.mechelynck@gmail.com> wrote:
> On 31/07/10 02:32, Jakson A. Aquino wrote:
>>
>> On Fri, Jul 30, 2010 at 8:37 PM, Tony Mechelynck
>> <antoine.mechelynck@gmail.com>  wrote:
>>>
>>> On 31/07/10 00:12, Jakson A. Aquino wrote:
>>>>
>>>> Hi,
>>>>
>>>> I maintain a filetype plugin to R and the user can change the default
>>>> key bindings by putting in the vimrc commands like:
>>>>
>>>> map<F2>    <Plug>RStart
>>>>
>>>> How can I know in the ftplugin/r.vim what key is bound to
>>>> <Plug>RStart? The plugin adds a menu to gui versions of Vim and I
>>>> would like to tell in the menu all the key bindings, even the
>>>> customized ones.
>>>>
>>>> Thanks,
>>>>
>>>> Jakson Aquino
>>>>
>>>> Note: the plugin is here:
>>>> http://www.vim.org/scripts/script.php?script_id=2628
>>>>
>>>
>>> It is possible to get a list of all mappings i.e. all user-defined key
>>> bindings, see the thread "Writing :map and :map! to text file or
>>> something"
>>> started 2010-07-26 09:42 -0700 by someone named "Gary".
>>>
>>> For default bindings it's harder: you would have to compile a list from
>>> the
>>> various lists at ":help index.txt", write that statically that into your
>>> script (and update it whenever that helpfile changes), and, at runtime,
>>> *remove* from the list the keybindings which also have a user-defined
>>> mapping in the same mode.
>>
>> Thanks for answering! This was rather a wish than an important thing
>> to my plugin. I think it's overly complex to write the output of :map
>> to a file and then search the file for all<Plug>Something that my
>> plugin has just to know if there are a few custom key bindings. The
>> goal was to help users of GVim to remember the key binds by looking at
>> the menu, but I will assume that users who customize key bindings are
>> advanced enough to either remember them or do ':map' if any was
>> forgotten. i have already put in the plugin's documentation:
>>
>>    Custom key bindings are not shown in Vim's menu, but you can
>>    type :map to see the list of current mappings.
>>
>> Best regards,
>>
>> Jakson Aquino
>>
>
> You can easily know _if_ there is a map to <Plug>something:
>
>    if hasmapto("\<Plug>",'nvoilc') || hasmapto("\<Plug>",'nvoilc',1)
>        echo 'there is a mapping or abbrev to ''<Plug>something'''
>    endif
>
> see :help hasmapto()
>
> Similarly, to know if some particular {lhs} (let's say <F2> has ben used,
>
>        :map <F2>
> and/or
>        :map! <F2>
>
> will show you any mappings beginning with <F2>; you can capture the output
> even if using :silent, see :help :redir

Thanks! I ended up with this (which solves the problem to me):

nmap <F2> <Plug>RStart

redir => b:kblist
silent imap
silent vmap
silent nmap
redir END
let b:kblist2 = split(b:kblist, "\n")
unlet b:kblist
let b:imaplist = []
let b:vmaplist = []
let b:nmaplist = []
for i in b:kblist2
if i =~ "<Plug>R"
let si = split(i)
if len(si) == 3
if si[0] =~ "v"
call add(b:vmaplist, si)
endif
if si[0] =~ "i"
call add(b:imaplist, si)
endif
if si[0] =~ "n"
call add(b:nmaplist, si)
endif
else
if len(si) == 2
call add(b:nmaplist, si)
endif
endif
endif
endfor
unlet b:kblist2

function! RNMapCmd(plug)
for [el1, el2] in b:nmaplist
if el2 == a:plug
return el1
endif
endfor
endfunction

function! RIMapCmd(plug)
for [el1, el2, el3] in b:imaplist
if el3 == a:plug
return el2
endif
endfor
endfunction

function! RVMapCmd(plug)
for [el1, el2, el3] in b:vmaplist
if el3 == a:plug
return el2
endif
endfor
endfunction

" Example of usage:
echo "The key bounded to <Plug>RStart is " . RNMapCmd("<Plug>RStart")

Best regards,

Jakson Aquino

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Searching for single character without anything around it , possible ?

On 31/07/10 10:34, Aaron Lewis wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
> I've remembered that some implementations of RegExp has a '\b' sign ,
> e.g \bi\b means an character `i' without anything around it , does vim
> support it ?
>
> :help regular-expression seems to have that expression , but no much
> documents about it.
>
> Consider this: int i = 0 ; i< numOfServ ; i ++
> And i'd like to replace the single `i' with j , so i tried s/\bi\b/j/g
> , not working ? Or maybe something else , anyone could help ?
>
> Thanks in advance !

In Vim regexps, \b means a backspace character: probably not what you
want; but \< means start-of-word and \> means end-of-word so /\<i\>/
would find the letter i (which is in 'iskeyword') with no other
'iskeyword' character next to it. Before it could be the start of the
line, or a space, a tab, a comma, a parenthesis, etc., or anything not
in 'iskeyword'; after it could be the end of the line, a space, etc.

If you want i alone on its line, then /^i$/ would match it ( ^ is
begin-of-line and $ is end-of-line). If you want either a space, tab, or
begin-of-line before, and a space, tab, or end-of-line after, then you
could match with /\%(^\|\s\)\zsi\ze\%(\s\|$)/ The latter can be
simplified to /\_s\zsi\ze\_s/ if your "lone i" can be neither the first
character of the file nor the last character on a file with no
end-of-line on its last line.

See :help pattern-overview -- the list continues until the next line of
equal signs across the page.


Best regards,
Tony.
--
It is illegal to rob a bank and then shoot at the bank teller with a water
pistol.
[real standing law in Louisana, United States of America]

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

[SOLVE] Searching for single character without anything around it , possible ?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/31/2010 04:45 PM, EdwardXu wrote:
> vim regex is a little different.Try \<i\>

Exactly what i'm looking for , thanks !

>
> 在 2010 年 7 31 日,4:34 下午,"Aaron Lewis" <aaron.lewis1989@gmail.com>编写:
>
> Hi,
> I've remembered that some implementations of RegExp has a '\b' sign ,
> e.g \bi\b means an character `i' without anything around it , does vim
> support it ?
>
> :help regular-expression seems to have that expression , but no much
> documents about it.
>
> Consider this: int i = 0 ; i < numOfServ ; i ++
> And i'd like to replace the single `i' with j , so i tried
> s/\bi\b/j/g
> , not working ? Or maybe something else , anyone could help ?
>
> Thanks in advance !
>

- --
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

- --
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4R0NL3WI5 on freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxT838ACgkQvf41sEptMqCXHACgnkerdE93VHKkRRnJsupf8dA5
1IkAoMAaTnlLVIX5KTUVDGVIB5/BTKc5
=CH+Z
-----END PGP SIGNATURE-----

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

回复: Searching for single character without anything around it , possible ?

vim regex is a little different.Try \<i\>

在 2010 年 7 31 日,4:34 下午,"Aaron Lewis" <aaron.lewis1989@gmail.com>编写:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,
       I've remembered that some implementations of RegExp has a '\b' sign ,
e.g \bi\b means an character `i' without anything around it ,  does vim
support it ?

       :help regular-expression seems to have that expression , but no much
documents about it.

       Consider this:  int i = 0 ; i < numOfServ ; i ++
       And i'd like to replace the single `i' with j , so i tried s/\bi\b/j/g
, not working ? Or maybe something else , anyone could help ?

       Thanks in advance !

- --
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4R0NL3WI5 on freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxT3/wACgkQvf41sEptMqB/zACgw5o+ddyrH9so31APTpkm6z/5
nmoAoKY1g8RJiqnscx/Gd9cMfWGFJnWr
=UsVU
-----END PGP SIGNATURE-----

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Searching for single character without anything around it , possible ?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,
I've remembered that some implementations of RegExp has a '\b' sign ,
e.g \bi\b means an character `i' without anything around it , does vim
support it ?

:help regular-expression seems to have that expression , but no much
documents about it.

Consider this: int i = 0 ; i < numOfServ ; i ++
And i'd like to replace the single `i' with j , so i tried s/\bi\b/j/g
, not working ? Or maybe something else , anyone could help ?

Thanks in advance !

- --
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4R0NL3WI5 on freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxT3/wACgkQvf41sEptMqB/zACgw5o+ddyrH9so31APTpkm6z/5
nmoAoKY1g8RJiqnscx/Gd9cMfWGFJnWr
=UsVU
-----END PGP SIGNATURE-----

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

[SOLVE] Re: Enter a directory automatically when opening files with gvim , possible ?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/31/2010 03:13 PM, Xell Liu wrote:
>
> Just read ":help filename-modifiers". In a nutshell, % is the file,
> and :p:h modifiers generate the path, and :gs substitutes all the
> blanks with an escape slash.
>

Yep , will do , thanks.


- --
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4R0NL3WI5 on freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxTzgYACgkQvf41sEptMqDKRACfZNri+l8PSH8nymwg9ZX93zj2
ROcAnjV4rHTyvWVxuYloygxZv5aoT2oe
=b2fj
-----END PGP SIGNATURE-----

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: [SOLVED] Re: Enter a directory automatically when opening files with gvim , possible ?

On Sat, Jul 31, 2010 at 3:01 PM, Aaron Lewis <aaron.lewis1989@gmail.com> wrote:
> @Xell:  I checked `help autocmd' , just could you do a small explanation
> on this part `%:p:h:gs/ /\\ /' ?
>        Thanks !
>

Just read ":help filename-modifiers". In a nutshell, % is the file,
and :p:h modifiers generate the path, and :gs substitutes all the
blanks with an escape slash.

BTW, I use gvim under Windows, so I don't know if it needs this
operation in KDE.

Regards.
Xell

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

[SOLVED] Re: Enter a directory automatically when opening files with gvim , possible ?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

@Ben: Nice , it works with `set autochdir'

@Xell: I checked `help autocmd' , just could you do a small explanation
on this part `%:p:h:gs/ /\\ /' ?
Thanks !

@Tony:
> Does the internal :pwd command return the same value as the external
:!pwd ?

Exactly the same.

> AFAICT, there is no specific autocommand to detect when a file is
dropped on the gvim icon, or edited by file association.

Havn't tried , looks like BufNewFile plus BufEnter could help. (see
help autocmd) Doesn't matter for now ;-)

Thanks for all of your help !

- --
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4R0NL3WI5 on freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxTymAACgkQvf41sEptMqDJ/ACfYcw7e61gY1e8LlJnuGvXD9c2
YTYAni083Pvp1kaBzvMG3kM0vJszoy+V
=+1/D
-----END PGP SIGNATURE-----

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Friday, July 30, 2010

Re: move cursor

On 30/07/10 12:39, Mostafa S.Ari wrote:
> Hi
> How can I move the cursor to an active buffer using buffer's name?
> Thanks
> Mostafa
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php

EUREKA!!!

:drop /foo/bar/baz/filename.ext

see :help :drop

Note that the :drop command sets the argument list.


Best regards,
Tony.
--
Ink, n.:
A villainous compound of tannogallate of iron, gum-arabic, and
water, chiefly used to facilitate the infection of idiocy and promote
intellectual crime.
-- Ambrose Bierce, "The Devil's Dictionary"

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Enter a directory automatically when opening files with gvim , possible ?

On 31/07/10 04:49, Aaron Lewis wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
> I'm on KDE session , when single-clicking on files , it would execute
> gVim and open the file , but the problem is , gVIM doesn't change it's
> CWD by default.
>
> e.g on clicking on /Library/code/my.cpp , and !pwd command returns
> /home/my_USERNAME , and i want it to be /Library/code
>
> Many thanks !
>

Does the internal :pwd command return the same value as the external :!pwd ?

You might set 'autochdir' but that would _always_ set the current
directory to the directory of the current file, even when opened by :new
or :sview, and there are problems with that.

AFAICT, there is no specific autocommand to detect when a file is
dropped on the gvim icon, or edited by file association.


Best regards,
Tony.
--
Sure he's sharp as a razor ... he's a two-dimensional pinhead!

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: move cursor

On Jul 30, 11:42 am, "Mostafa S.Ari" <mostafa....@gmail.com> wrote:
> Thank you for your replies but what do I really want is something like this:
> Imagine dave bob and tim are three buffers already active in different
> windows.
> I want a command like:
> :sendCursorTo dave
> and after that the cursor go to the dave's window without any change to
> other windows.
>

The :drop command, perhaps?

:help :drop
http://vim.wikia.com/wiki/Edit_a_file_or_jump_to_it_if_already_open

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Enter a directory automatically when opening files with gvim , possible ?

On Jul 30, 9:49 pm, Aaron Lewis <aaron.lewis1...@gmail.com> wrote:
>         I'm on KDE session , when single-clicking on files , it would execute
> gVim and open the file , but the problem is , gVIM doesn't change it's
> CWD by default.
>
>         e.g on clicking on /Library/code/my.cpp , and !pwd command returns
> /home/my_USERNAME , and i want it to be /Library/code
>

It sounds like you want the 'autochdir' option.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: What key is bound to Something?

On 31/07/10 02:32, Jakson A. Aquino wrote:
> On Fri, Jul 30, 2010 at 8:37 PM, Tony Mechelynck
> <antoine.mechelynck@gmail.com> wrote:
>> On 31/07/10 00:12, Jakson A. Aquino wrote:
>>>
>>> Hi,
>>>
>>> I maintain a filetype plugin to R and the user can change the default
>>> key bindings by putting in the vimrc commands like:
>>>
>>> map<F2> <Plug>RStart
>>>
>>> How can I know in the ftplugin/r.vim what key is bound to
>>> <Plug>RStart? The plugin adds a menu to gui versions of Vim and I
>>> would like to tell in the menu all the key bindings, even the
>>> customized ones.
>>>
>>> Thanks,
>>>
>>> Jakson Aquino
>>>
>>> Note: the plugin is here:
>>> http://www.vim.org/scripts/script.php?script_id=2628
>>>
>>
>> It is possible to get a list of all mappings i.e. all user-defined key
>> bindings, see the thread "Writing :map and :map! to text file or something"
>> started 2010-07-26 09:42 -0700 by someone named "Gary".
>>
>> For default bindings it's harder: you would have to compile a list from the
>> various lists at ":help index.txt", write that statically that into your
>> script (and update it whenever that helpfile changes), and, at runtime,
>> *remove* from the list the keybindings which also have a user-defined
>> mapping in the same mode.
>
> Thanks for answering! This was rather a wish than an important thing
> to my plugin. I think it's overly complex to write the output of :map
> to a file and then search the file for all<Plug>Something that my
> plugin has just to know if there are a few custom key bindings. The
> goal was to help users of GVim to remember the key binds by looking at
> the menu, but I will assume that users who customize key bindings are
> advanced enough to either remember them or do ':map' if any was
> forgotten. i have already put in the plugin's documentation:
>
> Custom key bindings are not shown in Vim's menu, but you can
> type :map to see the list of current mappings.
>
> Best regards,
>
> Jakson Aquino
>

You can easily know _if_ there is a map to <Plug>something:

if hasmapto("\<Plug>",'nvoilc') || hasmapto("\<Plug>",'nvoilc',1)
echo 'there is a mapping or abbrev to ''<Plug>something'''
endif

see :help hasmapto()

Similarly, to know if some particular {lhs} (let's say <F2> has ben used,

:map <F2>
and/or
:map! <F2>

will show you any mappings beginning with <F2>; you can capture the
output even if using :silent, see :help :redir


Best regards,
Tony.
--
Electricity is actually made up of extremely tiny particles,
called electrons, that you cannot see with the naked eye unless you
have been drinking. Electrons travel at the speed of light, which in
most American homes is 110 volts per hour. This is very fast. In the
time it has taken you to read this sentence so far, an electron could
have traveled all the way from San Francisco to Hackensack, New Jersey,
although God alone knows why it would want to.
The five main kinds of electricity are alternating current,
direct current, lightning, static, and European. Most American homes
have alternating current, which means that the electricity goes in one
direction for a while, then goes in the other direction. This prevents
harmful electron buildup in the wires.
-- Dave Barry, "The Taming of the Screw"

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Enter a directory automatically when opening files with gvim , possible ?

Hi Aaron,

You should try this:

if exists('+autochdir')
set autochdir
else
autocmd BufEnter * silent! lcd %:p:h:gs/ /\\ /
endif

Hope this will help you.

Regards.

On Sat, Jul 31, 2010 at 10:49 AM, Aaron Lewis <aaron.lewis1989@gmail.com> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>        I'm on KDE session , when single-clicking on files , it would execute
> gVim and open the file , but the problem is , gVIM doesn't change it's
> CWD by default.
>
>        e.g on clicking on /Library/code/my.cpp , and !pwd command returns
> /home/my_USERNAME , and i want it to be /Library/code
>
>        Many thanks !
>
>
> - --
> Best Regards,
> Aaron Lewis - PGP: 0x4A6D32A0
> FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
> irc: A4R0NL3WI5 on freenode
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.16 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkxTj0EACgkQvf41sEptMqDA8wCeLv4gGCQqeybtwOTaviVgzohD
> jDYAoJ/arTxekT+M6W0gHZ3D5Q7l2ZmU
> =+V8V
> -----END PGP SIGNATURE-----
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: How could I know that whether a buffer has been modified in a vim script?

Excerpts from H Xu's message of Sat Jul 31 05:14:16 +0200 2010:
> How could I know that whether a buffer has been modified in a vim script?
> Thank you.
:echo &modified
Also see getbufvar.

Marc Weber

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

How could I know that whether a buffer has been modified in a vim script?

Hello Everyone,

How could I know that whether a buffer has been modified in a vim script?
Thank you.

Regards,
H Xu
2010/7/31

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Enter a directory automatically when opening files with gvim , possible ?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,
I'm on KDE session , when single-clicking on files , it would execute
gVim and open the file , but the problem is , gVIM doesn't change it's
CWD by default.

e.g on clicking on /Library/code/my.cpp , and !pwd command returns
/home/my_USERNAME , and i want it to be /Library/code

Many thanks !


- --
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4R0NL3WI5 on freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxTj0EACgkQvf41sEptMqDA8wCeLv4gGCQqeybtwOTaviVgzohD
jDYAoJ/arTxekT+M6W0gHZ3D5Q7l2ZmU
=+V8V
-----END PGP SIGNATURE-----

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: open new tab at the end

Christian Brabandt wrote:

> :Tab <filename>
>
> You can use tab completion to navigate to your file. So it should
> basically work the same as :tabe
>
> regards,
> Christian
>

:Tabe works great!

thanks
raju
--
Kamaraju S Kusumanchi
http://malayamaarutham.blogspot.com/

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: need help with tags

On 30/07/10 22:24, dud wrote:
> Hi,
>
> I'm running version 7.2.245 on an Ubuntu server.
>
> I've been a vi user since the 1980's and use the tags feature
> extensively.
>
> My coworker cannot get tags to work in vim. Any tag he tries returns:
>
> E426: tag not found:<subroutine name here>
>
> I can reproduce this by logging in as a different user than myself.
> Something
> is magical about my environment that allows tags to work for me but no
> one
> else.
>
> The conditions are:
>
> I'm "in" the directory where the source is, as well as where the tags
> file is.
>
> The tags file is 644, read by world.
>
> The source files are 644, read by world.
>
> How can I debug what the problem is?
>
> Why can't vim find the tag even though it's right there in the tags
> file?
>
> How can I ask vim what it's "path" is for finding the tags file? I
> can't find that in the help.
> :set all doesn't show anything like a list of locations to search for
> tags.
> If I set verbose to 99, I see vim trying all kinds of stupid places
> for the tags file,
> except the current directory.
>
> I do not have a .vimrc or .exrc, just this in my .profile:
>
> EXINIT="set ai sm magic ic sw=4 cedit= export EXINIT
>
> Thanks,
> Bill Dudley
>

I suppose you mean C tags. For them to work, the tags file must have
been created (preferably by Exuberant ctags) and Vim must be able to
find it.

By default, Vim looks for the tags file in the current directory (which
will be shown in answer to the :pwd command) and in the directory of the
current file. If you want to search other locations (such as the parent
directories of the current file's directory) you will have to tweak the
'tags' option yourself.

Note also that if your coworker has 'autochdir' set (which I don't
recommend) the current directory will always be changed to the directory
of the current file, which means that only one of the two "typical"
locations of the tags file will be searched.

With only an EXINIT environment variable, there are many nice features
of Vim which you won't see. In particular, it will put you in
'compatible' mode, some plugins will simply not work, and with the
values you have set, you won't even get filetype-specific behaviour. I
recommend to remove that EXINIT variable and to write the following into
a file named ~/.vimrc

runtime vimrc_example.vim
set autoindent
set ignorecase showmatch
set magic
set shiftwidth=4

If later you want more customizations, you will add them to this file,
usually after the call to vimrc_example.vim (but if you want to change
the menu and messages language, you must do it before instead). For
instance, to be able to edit files containing any kind of weird
characters you might add

if has('multi_byte')
" if the required capabilities are not available,
" we cannot use them
" is the OS locale already Unicode?
" if not, prepare to change
if &encoding !~? '^u'
" but first, avoid jamming keyboard input
if &termencoding == ""
let &termencoding = &encoding
endif
set encoding=utf-8
endif
" set a «reasonable» heuristic to determine
" the 'fileencoding of existing files
set fileencodings=ucs-bom,utf-8,default,latin1
" the following two settings are optional
" create new files in UTF-8
setglobal fileencoding=utf-8
" create new Unicode files with Byte-Order mark
setglobal bomb
" Note: certain files, including anything starting #!
" must have 'nobomb' instead (using :setlocal),
" or be created in some non-Unicode 'fileencoding'
" such as e.g. Latin1.
endif

or to use a font of your choice in gvim (the GUI version of Vim) you
would add something like what is shown under :help setting-guifont


Best regards,
Tony.
--
Proposed Additions to the PDP-11 Instruction Set:

PI Punch Invalid
POPI Punch Operator Immediately
PVLC Punch Variable Length Card
RASC Read And Shred Card
RPM Read Programmers Mind
RSSC reduce speed, step carefully (for improved accuracy)
RTAB Rewind tape and break
RWDSK rewind disk
RWOC Read Writing On Card
SCRBL scribble to disk - faster than a write
SLC Search for Lost Chord
SPSW Scramble Program Status Word
SRSD Seek Record and Scar Disk
STROM Store in Read Only Memory
TDB Transfer and Drop Bit
WBT Water Binary Tree

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: What key is bound to Something?

On 31/07/10 00:12, Jakson A. Aquino wrote:
> Hi,
>
> I maintain a filetype plugin to R and the user can change the default
> key bindings by putting in the vimrc commands like:
>
> map<F2> <Plug>RStart
>
> How can I know in the ftplugin/r.vim what key is bound to
> <Plug>RStart? The plugin adds a menu to gui versions of Vim and I
> would like to tell in the menu all the key bindings, even the
> customized ones.
>
> Thanks,
>
> Jakson Aquino
>
> Note: the plugin is here: http://www.vim.org/scripts/script.php?script_id=2628
>

It is possible to get a list of all mappings i.e. all user-defined key
bindings, see the thread "Writing :map and :map! to text file or
something" started 2010-07-26 09:42 -0700 by someone named "Gary".

For default bindings it's harder: you would have to compile a list from
the various lists at ":help index.txt", write that statically that into
your script (and update it whenever that helpfile changes), and, at
runtime, *remove* from the list the keybindings which also have a
user-defined mapping in the same mode.


Best regards,
Tony.
--
Kisses may last for as much as, but no more than, five minutes.
[real standing law in Iowa, United States of America]

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

What key is bound to Something?

Hi,

I maintain a filetype plugin to R and the user can change the default
key bindings by putting in the vimrc commands like:

map <F2> <Plug>RStart

How can I know in the ftplugin/r.vim what key is bound to
<Plug>RStart? The plugin adds a menu to gui versions of Vim and I
would like to tell in the menu all the key bindings, even the
customized ones.

Thanks,

Jakson Aquino

Note: the plugin is here: http://www.vim.org/scripts/script.php?script_id=2628

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: (Local)Leader

On 30/07/10 20:16, Jeri Raye wrote:
> Hi,
>
> Can you echo your Leader?
> And our LocalLeader?
>
> Rgds,
> Jeri
>

Of course you can:

echo 'Map leader is' (exists('g:mapleader')? g:mapleader : '\')
echo 'Local leader is' (exists('g:maplocalleader')?
\ g:maplocalleader : '\')

I've put in the g: namespace specifiers so it will still work if you put
it inside a function.

See
:help <Leader>
:help <LocalLeader>

Beware that the above will give you the values which would be used for
any new mappings defined now. Changing these Leaders has no effect on
any mappings already defined before the change.


Best regards,
Tony.
--
Tell me, O Octopus, I begs,
Is those things arms, or is they legs?
I marvel at thee, Octopus;
If I were thou, I'd call me us.
-- Ogden Nash

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Questions on c.vim plugin

On 30/07/10 19:58, Jeri Raye wrote:
> Hi,
>
> I'm trying to use the c.vim plugin
> And I see some errors when I use it (on gVim, Vista)
>
> When I have line like this:
> This is a comment line
>
> And then I press trough the cut-off menu the button: code -> comment /* */ \c*
> Then I get this
>
> /* This is a comment line
> :nohlsearch
> j*/
>
> Why is that?
>
> I would expect this:
>
> /*
> * This is a comment line
> */
>
>
> And another question:
> How should I use the suggested shorcut keys?
> Like \c*
> In normal mode says the document, but how do I see when I'm in normal mode?
>
> Sorry for being such a newbie on this.
>
> Rgds,
> Jeri
>

If 'showmode' is on (the 'nocompatible' default) when you're NOT in
Normal mode the mode is displayed at bottom left of the Vim screen:

-- INSERT --
-- REPLACE --
etc.

When nothing is displayed there, then you're either in Normal mode (and
the cursor is in some edit file, h j k l etc. move it) or in
Command-line mode (and the cursor is at the very bottom, typing letters
adds them to some search, ex, debug etc. command which will be executed
if you hit Enter.

-- (insert) --

or similar means you've just hit Ctrl-O in Insert mode, you're executing
just ONE normal mode command, but as soon as that one command will have
run you'll be back again in Insert mode.

See
:help vim-modes
:help wrap-off
then scroll down:
/Command-line
:help 02.2
then scroll down
/WHAT IS THE MODE

Best regards,
Tony.
--
Q: How many IBM cpu's does it take to do a logical right shift?
A: 33. 1 to hold the bits and 32 to push the register.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: move cursor

On 30/07/10 18:42, Mostafa S.Ari wrote:
> Thank you for your replies but what do I really want is something like this:
> Imagine dave bob and tim are three buffers already active in different
> windows.
> I want a command like:
> :sendCursorTo dave
> and after that the cursor go to the dave's window without any change to
> other windows.
>
> best
> Mostafa

Check the help pages I gave you in my previous answer: with a proper
'switchbuf' setting, :sbuffer /foo/bar/baz/filename.ext will go to the
window (if there is one) containinng that buffer. You can either limit
the search to windows in the current tab, or go to windows in any tab page.


Best regards,
Tony.
--
Citizens are not allowed to attend a movie house or theater nor ride in a
public streetcar within at least four hours after eating garlic.
[real standing law in Indiana, United States of America]

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

need help with tags

Hi,

I'm running version 7.2.245 on an Ubuntu server.

I've been a vi user since the 1980's and use the tags feature
extensively.

My coworker cannot get tags to work in vim. Any tag he tries returns:

E426: tag not found: <subroutine name here>

I can reproduce this by logging in as a different user than myself.
Something
is magical about my environment that allows tags to work for me but no
one
else.

The conditions are:

I'm "in" the directory where the source is, as well as where the tags
file is.

The tags file is 644, read by world.

The source files are 644, read by world.

How can I debug what the problem is?

Why can't vim find the tag even though it's right there in the tags
file?

How can I ask vim what it's "path" is for finding the tags file? I
can't find that in the help.
:set all doesn't show anything like a list of locations to search for
tags.
If I set verbose to 99, I see vim trying all kinds of stupid places
for the tags file,
except the current directory.

I do not have a .vimrc or .exrc, just this in my .profile:

EXINIT="set ai sm magic ic sw=4 cedit= export EXINIT

Thanks,
Bill Dudley

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Questions on c.vim plugin

On Fri, Jul 30, 2010 at 2:58 PM, Jeri Raye <jeri.raye@gmail.com> wrote:
> Hi,
>
> I'm trying to use the c.vim plugin
> And I see some errors when I use it (on gVim, Vista)
>
> When I have line like this:
> This is a comment line
>
> And then I press trough the cut-off menu the button: code -> comment /* */  \c*
> Then I get this
>
> /* This is a comment line
>  :nohlsearch
>  j*/
>
> Why is that?

Probably is the way the script uses to generate comments (put a '/*'
in the beggining and a '*/' at the end).
>
> I would expect this:
>
> /*
>  * This is a comment line
>  */
>

I've never seen any script doing that, AFAICT is very dificult to do
that using vimscript only.


> In normal mode says the document, but how do I see when I'm in normal mode?

Look in the place where apears "INSERT" when ou type 'i'. If it's
empty, then you are in the normal mode (just hitting esc will leave
you in this mode).

--
==============================================
Ivan Sichmann Freitas
Engenharia de Computação 2009
UNICAMP
http://identi.ca/ivansichmann
Grupo Pró Software Livre UNICAMP - GPSL
==============================================

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

(Local)Leader

Hi,

Can you echo your Leader?
And our LocalLeader?

Rgds,
Jeri

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: move cursor

thank you Charles

Mostafa

On Fri, Jul 30, 2010 at 9:26 PM, Charles Campbell <Charles.E.Campbell@nasa.gov> wrote:
Mostafa S.Ari wrote:
Thank you for your replies but what do I really want is something like this:
Imagine dave bob and tim are three buffers already active in different windows.
I want a command like:
:sendCursorTo dave
and after that the cursor go to the dave's window without any change to other windows.
:help bufname()
:help winbufnr()
:help wincmd
:help CTRL-W_w

then wrap this up in a command (yes, its  :help command).

Regards,
Chip Campbell


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Questions on c.vim plugin

Hi,

I'm trying to use the c.vim plugin
And I see some errors when I use it (on gVim, Vista)

When I have line like this:
This is a comment line

And then I press trough the cut-off menu the button: code -> comment /* */ \c*
Then I get this

/* This is a comment line
:nohlsearch
j*/

Why is that?

I would expect this:

/*
* This is a comment line
*/


And another question:
How should I use the suggested shorcut keys?
Like \c*
In normal mode says the document, but how do I see when I'm in normal mode?

Sorry for being such a newbie on this.

Rgds,
Jeri

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: language-specific indenting?

On Fri, 30 Jul 2010, Tony Mechelynck wrote:

> On 30/07/10 03:55, Lev Lvovsky wrote:
> > So an emacs-using co-worker was surprised when he found out that *I*
> > didn't know how to do this (taking it to mean that vim didn't):
> >
> > If I'm given a perl script (I'm using this as an example since it's
> > an especially tricky thing to parse from what I understand), and
> > it's not at all indented, can perl automatically indent it for me?
> > Ideally, this would include things like datastructures, but it seems
> > in my attempts, that that's where parsing/indenting fails.
> >
> > I'm using the '=' command for indentation.
> >
> > Thank you!
> > -lev
> >
>
> Well, if you're using = for indentation, then what about gg=G (gg:move
> to line 1; ={motion}: indent whatever the cursor moves over; G:move to
> last line)?
>
> I don't use Perl, but I suppose that you have "filetype plugin indent
> on" in your vimrc (or that it sources the vimrc_example.vim), and that
> the Perl indent script sets the right options for = to work.
>

Until they get updated in Vim proper, it's probably also worth your time
to download the updated Perl syntax/ftplugin/indent scripts from:

http://github.com/petdance/vim-perl

With those versions, Perl indenting is reasonable. Without them, stock
Vim 7.2's ft=perl doesn't even handle simple conditionals very well.

--
Best,
Ben

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: move cursor

Mostafa S.Ari wrote:
> Thank you for your replies but what do I really want is something like
> this:
> Imagine dave bob and tim are three buffers already active in different
> windows.
> I want a command like:
> :sendCursorTo dave
> and after that the cursor go to the dave's window without any change
> to other windows.
:help bufname()
:help winbufnr()
:help wincmd
:help CTRL-W_w

then wrap this up in a command (yes, its :help command).

Regards,
Chip Campbell

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: move cursor

Thank you for your replies but what do I really want is something like this:
Imagine dave bob and tim are three buffers already active in different windows.
I want a command like:
:sendCursorTo dave
and after that the cursor go to the dave's window without any change to other windows.

best
Mostafa

On Fri, Jul 30, 2010 at 5:50 PM, David Fishburn <dfishburn.vim@gmail.com> wrote:
On 7/30/2010 9:54 AM, Tony Mechelynck wrote:
On 30/07/10 12:39, Mostafa S.Ari wrote:
Hi
How can I move the cursor to an active buffer using buffer's name?
I usually do something like this:

:e dave.txt
:e bob.txt
:e tim.txt

:b bob<tab>
:b im<tab>
:b e<tab>

You can provide partial names to :buffer and the tab will cycle through your choices. 
Saves me an enormous amount of typing.

HTH,
Dave

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: move cursor

On 7/30/2010 9:54 AM, Tony Mechelynck wrote:
On 30/07/10 12:39, Mostafa S.Ari wrote:
Hi
How can I move the cursor to an active buffer using buffer's name?
I usually do something like this:

:e dave.txt
:e bob.txt
:e tim.txt

:b bob<tab>
:b im<tab>
:b e<tab>

You can provide partial names to :buffer and the tab will cycle through your choices. 
Saves me an enormous amount of typing.

HTH,
Dave

Re: move cursor

On 30/07/10 12:39, Mostafa S.Ari wrote:
> Hi
> How can I move the cursor to an active buffer using buffer's name?
> Thanks
> Mostafa
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php

see
:help :sbuffer
:help 'switchbuf'

HTH,
Tony.
--
Bacchus, n.:
A convenient deity invented by the ancients as an excuse for
getting drunk.
-- Ambrose Bierce, "The Devil's Dictionary"

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: [SOLVED] Re: Simple Html2Txt function , doesn't work for `&' symbol ?

On 30/07/10 10:58, Aaron Lewis wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 07/30/2010 04:55 PM, John Beckett wrote:
>> Aaron Lewis wrote:
>>> Consider following function , i tried to do a simple
>>> html conversation, not working for the third one ?
>>>
>>> function HtmlToText()
>>> exec "%s/&lt;/</g"
>>> exec "%s/&gt;/>/g"
>>> exec "%s/&amp;/\&/g"
>>> endfunc
>>
>> Probably something to do with using a double-quoted string
>> (try :echo "a\&b").
>>
>> You do not need to "execute" a command, so just omit all the
>> "exec" and quotes. The tip with the polished product is:
>
> Exactly working after remove all exec statements.
>
>> http://vim.wikia.com/wiki/HTML_entities
>>
>> John
>>
>
> They're much more cool , and thanks !

Within double quotes, backslashes should be doubled. If you don't want
the backslash to have any special meaning, use single quotes instead.

See
:help expr-string
:help literal-string


Best regards,
Tony.
--
Magnocartic, adj.:
Any automobile that, when left unattended, attracts shopping
carts.
-- Sniglets, "Rich Hall & Friends"

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Replace except enclosed by delimiters (")

Dear All

I couldn't let this problem go while I didn't understand it. I think I got an alternative solution using \zs, which is faster and is recommended by VIM's documentation.

:%s/\("[^"]*"\)*\zs[^"]*/\L&/gc

It seems to work and is based on the principles that Tim laid down. Anyone agree?

Best
Felipe


On 28/07/2010, at 9:29 PM, Tim Chase wrote:

> On 07/27/10 22:43, fd wrote:
>> Well, I'm starting to use Vim and still getting the hang of it. I have
>> a problem where I need to replace a text to lowercase, except if the
>> text is enclosed by double quotes and I'm not quite getting it.
>>
>> As an example give the input text
>>
>> FOO, FOO, fooO, "foOO"
>>
>> I want it to become
>>
>> foo, foo, fooo, "foOO"
>
> If you're just getting started with Vim, this is a rather tricky problem. However, you've come to the right mailing list. :)
>
> You can use the following:
>
> :%s/\%(^\%([^"]\+\|"[^"]*"\)*\)\@<=[^"]\+/\L&/g
>
> which roughly translates as
>
> \%(...\)\@<= assert that there are an even (including 0)
> number of quote-marks before this text
> [^"]\+ one or more non-quote characters comprising
> the actual match (the stuff we'll lower-case)
>
> replaced with
>
> \L& the lowercase version of the match
>
> The tricky part is the assertion:
>
> ^ looking back to the beginning of the line
> \(...\|...\)* you can have one of these two things
> zero or more times (the "*"):
> [^"] either characters that aren't quotes (on
> the left side of the "\|"; or (on the
> right-side of the "\|")
> " an opening quote
> [^"] followed by stuff that isn't a quote
> " followed by a closing quote
>
> The assertion is then made with the "\@<=" which requires that vim look backwards (even before the match's start) to ensure this condition is met.
>
> The only place it would break is if you expect to have embedded newlines crossing quotes:
>
> ABC, DEF, "GH
> IJK", LMN, OPQ
>
> being treated as one line. But if you do that, you get what you deserve for having such pathological input ;-) Though if you have this case, I'd use the "decorate, transform, undecorate" pattern: (1) join lines with odd numbers of quotes until you don't have any more, joining with some unused character; (2) then perform the above transformation; (3) then replace all my placeholder characters with new-lines to get the line-breaks restored. Then (4) I'd go smack the head of the person who created the file-format that allowed line-breaks in quoted text ;-)
>
> -tim
>
>
>
>
>
>
>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

move cursor

 
Hi
 
How can I move the cursor to an active buffer using buffer's name?
 
Thanks
Mostafa

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: open new tab at the end

Hi Kamaraju!

On Fr, 30 Jul 2010, Kamaraju S Kusumanchi wrote:

> Christian Brabandt wrote:
>
> > On Fri, July 30, 2010 6:07 am, Kamaraju S Kusumanchi wrote:
> >> Whenever I do :tabe it opens a new tab right after the current tab. But
> >> I'd
> >> like this new tab to be opened at the end (regardless of where I initiate
> >> the :tabe command. Is it possible?
> >
> > :com! -nargs=1 -complete=file Tabe :9999tab split <args>
> >
>
> How do I use this command?

:Tab <filename>

You can use tab completion to navigate to your file. So it should
basically work the same as :tabe

regards,
Christian

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: open new tab at the end

Christian Brabandt wrote:

> On Fri, July 30, 2010 6:07 am, Kamaraju S Kusumanchi wrote:
>> Whenever I do :tabe it opens a new tab right after the current tab. But
>> I'd
>> like this new tab to be opened at the end (regardless of where I initiate
>> the :tabe command. Is it possible?
>
> :com! -nargs=1 -complete=file Tabe :9999tab split <args>
>

How do I use this command?

raju

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: language-specific indenting?

On 30/07/10 03:55, Lev Lvovsky wrote:
> So an emacs-using co-worker was surprised when he found out that *I* didn't know how to do this (taking it to mean that vim didn't):
>
> If I'm given a perl script (I'm using this as an example since it's an especially tricky thing to parse from what I understand), and it's not at all indented, can perl automatically indent it for me? Ideally, this would include things like datastructures, but it seems in my attempts, that that's where parsing/indenting fails.
>
> I'm using the '=' command for indentation.
>
> Thank you!
> -lev
>

Well, if you're using = for indentation, then what about gg=G (gg:move
to line 1; ={motion}: indent whatever the cursor moves over; G:move to
last line)?

I don't use Perl, but I suppose that you have "filetype plugin indent
on" in your vimrc (or that it sources the vimrc_example.vim), and that
the Perl indent script sets the right options for = to work.


Best regards,
Tony.
--
A well adjusted person is one who makes the same mistake twice without
getting nervous.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

[SOLVED] Re: Simple Html2Txt function , doesn't work for `&' symbol ?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/30/2010 04:55 PM, John Beckett wrote:
> Aaron Lewis wrote:
>> Consider following function , i tried to do a simple
>> html conversation, not working for the third one ?
>>
>> function HtmlToText()
>> exec "%s/&lt;/</g"
>> exec "%s/&gt;/>/g"
>> exec "%s/&amp;/\&/g"
>> endfunc
>
> Probably something to do with using a double-quoted string
> (try :echo "a\&b").
>
> You do not need to "execute" a command, so just omit all the
> "exec" and quotes. The tip with the polished product is:

Exactly working after remove all exec statements.

> http://vim.wikia.com/wiki/HTML_entities
>
> John
>

They're much more cool , and thanks !

function HtmlEscape()
silent s/&/\&amp;/eg
silent s/</\&lt;/eg
silent s/>/\&gt;/eg
endfunction

- --
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4R0NL3WI5 on freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxSlDMACgkQvf41sEptMqAYHgCdHK1yyc4Ggzbix6O7T696L4sx
mEkAnAnl7PzNKznM7r4agfd5Tt51PK4c
=aqYm
-----END PGP SIGNATURE-----

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

RE: Simple Html2Txt function , doesn't work for `&' symbol ?

Aaron Lewis wrote:
> Consider following function , i tried to do a simple
> html conversation, not working for the third one ?
>
> function HtmlToText()
> exec "%s/&lt;/</g"
> exec "%s/&gt;/>/g"
> exec "%s/&amp;/\&/g"
> endfunc

Probably something to do with using a double-quoted string
(try :echo "a\&b").

You do not need to "execute" a command, so just omit all the
"exec" and quotes. The tip with the polished product is:
http://vim.wikia.com/wiki/HTML_entities

John

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Simple Html2Txt function , doesn't work for `&' symbol ?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,
Consider following function , i tried to do a simple html conversation,
not working for the third one ?


function HtmlToText()
exec "%s/&lt;/</g"
exec "%s/&gt;/>/g"
exec "%s/&amp;/\&/g"
endfunc

Many thanks !

- --
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4R0NL3WI5 on freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxShQAACgkQvf41sEptMqBONQCgt1ihXLFpk+7A7wgldCToCnk8
6uIAnRwbfqienQPWncu9A//Md8vqRiet
=AfzG
-----END PGP SIGNATURE-----

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Use visually selected text in commands

On 28/07/10 14:46, Daniel Corrêa wrote:
> Hi,
>
> I wonder if there is something like <cword>, but for visually selected text?
>
> Cheers,
>
> Daniel Corrêa
> (45) 9938.3993
> http://www.meadiciona.com.br/dnlcorrea
> 

Well, for ex-commands, if you hit : while in Visual (not Select) mode,
Vim will beef it up as

:'<,'>

while clearing Visual mode. That range means: from the first to the last
line of the latest Visual area. This is always linewise and can only be
used with commands that accept a range.

OTOH, for characterwise visual, you could yank first, then hit Ctrl-R
followed by " at the right point of your command-line entry.

See
:help v_:
:help [range]
:help c_CTRL-R


Best regards,
Tony.
--
Ask Not for whom the Bell Tolls, and You will Pay only the
Station-to-Station rate.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Thursday, July 29, 2010

Re: open new tab at the end

On Fri, July 30, 2010 6:07 am, Kamaraju S Kusumanchi wrote:
> Whenever I do :tabe it opens a new tab right after the current tab. But
> I'd
> like this new tab to be opened at the end (regardless of where I initiate
> the :tabe command. Is it possible?

:com! -nargs=1 -complete=file Tabe :9999tab split <args>

regards,
Christian

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: language-specific indenting?

On Jul 29, 2010, at 6:55 PM, Lev Lvovsky wrote:

> So an emacs-using co-worker was surprised when he found out that *I* didn't know how to do this (taking it to mean that vim didn't):
>
> If I'm given a perl script (I'm using this as an example since it's an especially tricky thing to parse from what I understand), and it's not at all indented, can perl automatically indent it for me? Ideally, this would include things
^^^^

s/perl/vim.

thanks,
-lev


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

open new tab at the end

Whenever I do :tabe it opens a new tab right after the current tab. But I'd
like this new tab to be opened at the end (regardless of where I initiate
the :tabe command. Is it possible?

thanks
raju
--
Kamaraju S Kusumanchi
http://malayamaarutham.blogspot.com/

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

language-specific indenting?

So an emacs-using co-worker was surprised when he found out that *I* didn't know how to do this (taking it to mean that vim didn't):

If I'm given a perl script (I'm using this as an example since it's an especially tricky thing to parse from what I understand), and it's not at all indented, can perl automatically indent it for me? Ideally, this would include things like datastructures, but it seems in my attempts, that that's where parsing/indenting fails.

I'm using the '=' command for indentation.

Thank you!
-lev

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

RE: Vim scripting: splitting long string onto multiple lines?

> When scripting in vim, is it possible to put a long string
> into multiple lines for better readability?

Use the '.' concatenation operator:
let a = "long string" .
\ "continue the string"

John

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Vim scripting: splitting long string onto multiple lines?

When scripting in vim, is it possible to put a long string into multiple lines for better readability?

 

e.g., can I do things like:

 

let a = “long string\

continue the string”

 

or

 

let a = “long string”

“continue the string”

 

Re: Should 2html generate valid CSS by default?

Benjamin Fritz wrote:

> On Wed, Jul 28, 2010 at 3:39 PM, Bram Moolenaar <Bram@moolenaar.net> wrote:
> >
> > The documentation clearly says:
> >
> > By default, HTML optimized for old browsers is generated. If you prefer using
> > cascading style sheets (CSS1) for the attributes (resulting in considerably
> > shorter and valid HTML 4 file), use: >
> > :let g:html_use_css = 1
> >
> > We can change that to default to using CSS when the variable isn't set
> > and tell users to use this to disable that:
> >
> > :let g:html_use_css = 0
> >
> > Any problems with that?
> >
>
> Well...it would be inconsistent with the other options, which will
> remain enabled even if you :let them to zero. If I change this one, I
> will want to change all options to work the same way. Each would do as
> one might expect when :let to either zero or 1, with a default
> behavior noted in the :help when they are not defined at all.

We also don't want to make it incompatible from previous versions
without a good reason.

Using "unlet g:html_use_css" to disable using CSS is certainly a bad
idea. It conflicts with the previous meaning.

Having both a g:html_use_css and g:html_no_css variable gets confusing.
A user may set one and forget about the other, then needs to read
documentation to find out which one prevails.

We should require a variable not only to exist but also be not zero.
I think the documentation already explains it that way. Some code may
not check the value, there is no real need to change that.

--
DENNIS: You can't expect to wield supreme executive power just 'cause some
watery tart threw a sword at you!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Bram@Moolenaar.net -- 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 ///

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Editing files full of NUL characters

On 29/07/10 21:18, Teemu Likonen wrote:
> * 2010-07-29 09:50 (-0700), Bob Weissman wrote:
>
>> Often, the files look like they ought to be text files but are full of
>> NULs. Instead of "Hello", I will see "H^@e^@l^@l^@o^@". Or maybe it's
>> "^@H^@e^@l^@l^@o". I haven't figured out the byte order.
>
> Looks like an UTF-16 encoded file.
>
>> Is there a way to edit these files in gvim such that the ^@'s don't
>> appear onscreen but get written properly when I write the files back?
>
> You could try opening the file with
>
> :e ++enc=utf-16be file.txt
>
> or with ++enc=utf-16le if the byte order wasn't correct.
>
> But Vim should detect the encoding correctly if (1) the file has byte
> order mark (U+FFFE or U+FEFF) in the beginning and (2) you have ucs-bom
> in 'fileencodings' option.
>
> :set fileencodings=ucs-bom,utf-8,default,latin1
>

Yeah:

^@H^@e^@l^@l^@o
is utf-16be aka utf-16 aka unicode
H^@e^@l^@l^@o^@
is utf-16le
şÿ^@H^@e^@l^@l^@o
is utf-16be with BOM and Vim should see Hello
ÿşH^@e^@l^@l^@o^@
is utf-16le with BOM and Vim should see Hello

see ":help ++opt" -- the first example should be read correctly by just
rereading it by means of ":e ++enc=utf-16be" (without quotes and with no
filename). Similarly for the second example with utf-16le. The last two
should be detected automatically if 'fileencodings' (plural) *starts*
with ucs-bom

The (misnamed) byte order mark is always U+FEFF (the Unicode codepoint
0xFEFF, or decimal 65279); its representation varies depending on which
UTF is in use:
UTF-16be 0xFE 0xFF (one 16-bit big-endian word)
UTF-16le 0xFF 0xFE (one 16-bit little-endian word)
UTF-8 0xEF 0xBB 0xBF (three 8-bit bytes)
UTF-32be 0x00 0x00 0xFE 0xFF (one 32-bit big-endian doubleword)
UTF-32le 0xFF 0xFE 0x00 0x00 (one 32-bit little-endian doubleword)


Best regards,
Tony.
--
What we need in this country, instead of Daylight Savings Time, which
nobody really understands anyway, is a new concept called Weekday
Morning Time, whereby at 7 a.m. every weekday we go into a space-
launch-style "hold" for two to three hours, during which it just
remains 7 a.m. This way we could all wake up via a civilized gradual
process of stretching and belching and scratching, and it would still
be only 7 a.m. when we were ready to actually emerge from bed.
-- Dave Barry, "$#$%#^%!^%&@%@!"

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Editing files full of NUL characters

* 2010-07-29 09:50 (-0700), Bob Weissman wrote:

> Often, the files look like they ought to be text files but are full of
> NULs. Instead of "Hello", I will see "H^@e^@l^@l^@o^@". Or maybe it's
> "^@H^@e^@l^@l^@o". I haven't figured out the byte order.

Looks like an UTF-16 encoded file.

> Is there a way to edit these files in gvim such that the ^@'s don't
> appear onscreen but get written properly when I write the files back?

You could try opening the file with

:e ++enc=utf-16be file.txt

or with ++enc=utf-16le if the byte order wasn't correct.

But Vim should detect the encoding correctly if (1) the file has byte
order mark (U+FFFE or U+FEFF) in the beginning and (2) you have ucs-bom
in 'fileencodings' option.

:set fileencodings=ucs-bom,utf-8,default,latin1

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Editing files full of NUL characters

Hi Bob!

On Do, 29 Jul 2010, Bob Weissman wrote:

> I've used (g)vim for many years, but don't often exercise its
> more exotic functions. I work on a Windcows PC, but lately I find
> myself wanting to edit files from other sources, like the iPhone.
>
> Often, the files look like they ought to be text files but are
> full of NULs. Instead of "Hello", I will see "H^@e^@l^@l^@o^@".
> Or maybe it's "^@H^@e^@l^@l^@o". I haven't figured out the byte
> order.
>
> Is there a way to edit these files in gvim such that the ^@'s
> don't appear onscreen but get written properly when I write the
> files back?

That looks like UTF-16 or UCS2. Try to reload the file using:

:e ++enc=utf-16 your_file

You might need to try several encodings (like utf-16be or utf-16le ( Big
endian versus little endian byte order). May be there are more
alternatives, I have only seen these kind of files very rarely and
utf-16 usually worked for me.

See the help :h ++enc and :help 'fileencoding'

regards,
Christian

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Search on multiple strings at the same time?

Hi Ernie!

On Do, 29 Jul 2010, Ernie wrote:

> Is it possible to search (with / or ?) on multiple (separate) strings
> at the same time.
> So that all search separate strings are hilighted and "n" and "p" will
> go to each string.

Yes separate them with \|

e.g.
If you want to search for cats and dogs, use
/cats\|dogs

See the help :h /\|

regards,
Christian

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Search on multiple strings at the same time?

Is it possible to search (with / or ?) on multiple (separate) strings
at the same time.
So that all search separate strings are hilighted and "n" and "p" will
go to each string.

Thanks.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Editing files full of NUL characters

I've used (g)vim for many years, but don't often exercise its
more exotic functions. I work on a Windcows PC, but lately I find
myself wanting to edit files from other sources, like the iPhone.

Often, the files look like they ought to be text files but are
full of NULs. Instead of "Hello", I will see "H^@e^@l^@l^@o^@".
Or maybe it's "^@H^@e^@l^@l^@o". I haven't figured out the byte
order.

Is there a way to edit these files in gvim such that the ^@'s
don't appear onscreen but get written properly when I write the
files back?

Thanks,
- Bob

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: gvim project plugin

On Sun, Jul 25, 2010 at 2:31 AM, packet <fasteliteprogrammer@gmail.com> wrote:
>
> I get this error when i do that \C
>
> here the error:
>
>
> E10: \ should be followed by /, ? or &

E10 usually means you're running in compatible mode. Do you have a
~/.vimrc (or a ~/_vimrc on windows)? If not, create one and add "set
nocompatible" to it; that will probably fix your problem.

~Matt

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: ksh93 Syntax highlighting

On 2010-07-29, jayemce wrote:

> On Jun 8, 6:29 pm, Gary Johnson <garyj...@spocom.com> wrote:
> > On 2010-06-08, jayemce wrote:
> > > Hello,
> >
> > > I would like to make syntax highlighting work with ksh93.
> > > The syntax highlighting works fine for ksh88, bash, C, perl, etc, but
> > > I am unable to make it work with ksh93.
> > > Does anyone have an idea.
> >
> > No, since no one knows what you mean by "unable to make it work".
> > Do you see no syntax highlighting at all with one or more of your
> > ksh93 files or does the highlighting appear to be incorrect for some
> > ksh syntax that is valid in ksh93 but not in ksh88?
> >
> > > These are the installed packages:
> > > # rpm -qa | grep ^vim
> > > vim-common-6.3-1
> > > vim-enhanced-6.3-1
> >
> > This is a very old version of vim.  The current version is 7.2.442
> > and 7.3 is about to be released.  You should try to obtain a more
> > recent version.  That may even solve the problem you are seeing.

> Hello Gary,
>
> I installed the latest version of VIM. The problem persists. To test,
> please create a ksh93 script with the following content:
>
> #!/bin/ksh93
> [[ 0 == 0 ]] && print -- OK
> exit 0
>
> Then use vim with syntax highlighting.
> As you'll see, syntax highlighting is not working.
>
> Now, how can I use syntax highlighting with ksh93?
> That is my question.
>
> I managed to use the ksh88 syntax highlighting, but it is not 100%
> correct with ksh93 since the shell language syntax has undergone
> several changes.
>
> Thank you for your help.

Thank you for the example. Syntax coloring is "working" for me in
the sense that I see colors, but the color of "[[" and "]]" seems
odd, the arguments to "print" aren't colored as they are if you
change "print" to "echo", and I would have expected "&&" to have
some color, but that seems inconsistent in the little bit of
experimenting that I did.

In any case, the top of $VIMRUNTIME/syntax/sh.vim shows that this
syntax highlighting script is maintained by Chip Campbell, who reads
this list regularly. I would expect some comment on this thread
from him by the end of today. If he doesn't see and reply to this,
then I would send your question to him directly at the address in
that file.

Regards,
Gary

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: ksh93 Syntax highlighting

Hello Gary,

I installed the latest version of VIM. The problem persists. To test,
please create a ksh93 script with the following content:

#!/bin/ksh93
[[ 0 == 0 ]] && print -- OK
exit 0

Then use vim with syntax highlighting.
As you'll see, syntax highlighting is not working.

Now, how can I use syntax highlighting with ksh93?
That is my question.

I managed to use the ksh88 syntax highlighting, but it is not 100%
correct with ksh93 since the shell language syntax has undergone
several changes.

Thank you for your help.

Best regards,
Jay

On Jun 8, 6:29 pm, Gary Johnson <garyj...@spocom.com> wrote:
> On 2010-06-08, jayemce wrote:
> > Hello,
>
> > I would like to make syntax highlighting work with ksh93.
> > The syntax highlighting works fine for ksh88, bash, C, perl, etc, but
> > I am unable to make it work with ksh93.
> > Does anyone have an idea.
>
> No, since no one knows what you mean by "unable to make it work".
> Do you see no syntax highlighting at all with one or more of your
> ksh93 files or does the highlighting appear to be incorrect for some
> ksh syntax that is valid in ksh93 but not in ksh88?
>
> > These are the installed packages:
> > # rpm -qa | grep ^vim
> > vim-common-6.3-1
> > vim-enhanced-6.3-1
>
> This is a very old version of vim.  The current version is 7.2.442
> and 7.3 is about to be released.  You should try to obtain a more
> recent version.  That may even solve the problem you are seeing.
>
> Regards,
> Gary

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: Omni completion for mysql dialect


On 7/28/2010 8:18 PM, GAS wrote:
When I set sql dialect as :h sql.txt recommends: let g:sql_type_default = 'mysql' Omni completion fails to do any sql completion. Removing this settings fix problem and omni properly functioning. 

Since the SQL completion contains many different maps, can I assume you use <CTRL-C>a (for all syntax items).

When setting the dialog to mysql as you did above it found no items to complete.
Where as if you had done:
	let g:sql_type_default = 'sqloracle' 
It does show the syntax items in the OMNI list.


The difference between the two seems to be how the syntax writers format their syntax files.
The 2 I predominant formats I see are:
    syn keyword {filetype}Keyword         values ...
and
    syn keyword {syntax_filename}Keyword  values ...

The syntax items are pulled from the autoload/syntaxcomplete.vim and only looks for format #1.
I have extended it to also look for format #2, if format #1 fails to find any matches.

I have sent an updated autoload/syntaxcomplete.vim to Bram for inclusion in Vim.

I have also created this as a script on www.vim.org if you wish to try it out now:
SyntaxComplete : OMNI Completion based on the current syntax highlights
http://www.vim.org/scripts/script.php?script_id=3172

If you could test this out we may be able to get it released with Vim 7.3.

Thanks,
Dave



Re: some bugs

On 28 July 2010 20:49, Tony Mechelynck <antoine.mechelynck@gmail.com> wrote:
> Works for me. The 'keymap' option is still present, but it's (always ben) a
> compile-time feature.

I know it is a compile-time feature, but I never compiled Vim myself so far,
and I thought it is included by default. I'd be worried if, say, the ready-to-
download-and-use Windows executable does not include it. (I happen to use
Vim on both Linux and Windows.)

> See at
> http://users.skynet.be/antoine.mechelynck/vim/compunix.htm how I set my
> configure options — and BTW I never call configure directly: I let make do
> it, by running "make config" (for configure only) or "make reconfig" (for
> configure + compile) if something has changed in my configuration settings
> or in my software install.

Thank you for sharing this information. So far I only did what src/INSTALL
in Vim's source distribution suggests. So I didn't even read Makefile and
was not (and stll am not) aware of all its possible targets.

> -- Hm, you didn't specify which featureset, which means that you want
> "Normal" features. For keymaps you need "Big" features.

> ...ah yes, the last byte of U+0300 is 0x80 in UTF-8, the last byte of U+0301
> is 0x81, and IIRC Vim had problems with that in some circumstances; but
> didn't Bram fix it?

Not in 7.3b that I tried.

>> http://groups.google.com/group/vim_use/browse_thread/thread/d58fbb0715160835?fwc=1
>> and
>> http://groups.google.com/group/vim_use/browse_thread/thread/84bebe4fa57a7618?fwc=1
> Well, have you tried applying Ben's patch? And does it work?

I haven't. It might work alright, but in any case, it'd be better to
patch the official
distribution, that is why I wanted to remind of the problem.

Best regards,
Boyko

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

dict in commandline

Hi,

I like the automatic dictionary completion feature.
Can I use this in the command line, too?

E.G.
:%s/Table_1/Ta<Enter some key here to show my dict entrys>

Joachim

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Wednesday, July 28, 2010

Re: Should 2html generate valid CSS by default?

On Thu, July 29, 2010 3:24 am, Benjamin Fritz wrote:
> On Wed, Jul 28, 2010 at 3:39 PM, Bram Moolenaar <Bram@moolenaar.net>
> wrote:
>>
>> The documentation clearly says:
>>
>> By default, HTML optimized for old browsers is generated. If you prefer
>> using
>> cascading style sheets (CSS1) for the attributes (resulting in
>> considerably
>> shorter and valid HTML 4 file), use: >
>> :let g:html_use_css = 1
>>
>> We can change that to default to using CSS when the variable isn't set
>> and tell users to use this to disable that:
>>
>> :let g:html_use_css = 0
>>
>> Any problems with that?
>>
>
> Well...it would be inconsistent with the other options, which will
> remain enabled even if you :let them to zero. If I change this one, I
> will want to change all options to work the same way. Each would do as
> one might expect when :let to either zero or 1, with a default
> behavior noted in the :help when they are not defined at all.

I don't think this is a problem, as long as this is mentioned in the help.
Definitely I wouldn't introduce a second variable, as this makes the
script more complicated and would only confuse users.

regards,
Christian

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Re: new language command completion

On Thu, July 29, 2010 7:27 am, srikanth d wrote:
> Hi,
>
> I am trying to use a language which is not supported by vim yet.
> So, how do i incorporate this language into vim to enable auto command
> completion and probably to enable showing of syntax?
> Do we have any tutorial for this kind of thing?

For syntax highlighting, take a look at :h usr_44.txt and for
omni-completion, you need to write a filetype plugin for your language
or if you have written your own syntax highlighting, you can try to
use the syntax omni completion (see :h ft-syntax-omni).

If you decide to write your own omni completion script, that may get
complicated. Take a look at $VIMRUNTIME/autoload/*complete.vim files
to see, what these scripts may look like. But you should have a basic
understanding of the vim scripting language (:h eval.txt explains the
scripting language).

See also the help at :h compl-omni and possibly :h complete-functions,
which explains how to write completion scripts.

regards,
Christian

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php