Sunday, October 31, 2010

Re: A new style of c++ code indenting

> I just tried tabular. It is just as powerful, just as flexible, ...
> but with such a clean, lightweight and intuitive interface! It stays
> out of your way till you need it, and when you need it, it is a simple
> command and reg-ex away. No muss, no fuss: it "just works". Within
> minutes I was using it as if I had been using it for years. I highly
> recommend it!

+1 same reason for me

--
Best Regards,
Aaron Lewis - PGP: 0xDFE6C29E
Key Server: http://keyserver.veridis.com
Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E

--
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: A new style of c++ code indenting

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

On 10/31/2010 09:21 PM, Javier Rojas wrote:
>
> godlygeek's tabular: http://github.com/godlygeek/tabular

This looks to be the best solution for me ;-)

Thanks !


- --
Best Regards,
Aaron Lewis - PGP: 0xDFE6C29E
Key Server: http://keyserver.veridis.com
Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJMzkzXAAoJECSSp9Df5sKePvkQAJ8iPrCv0xiNuPx7vrg2+O/u
uO08/sUbpFGy/Hxjsr7SFReJYkGYczoxqZbgKJhJM81a+M5H7IRBn4DavY/NDfOB
rhS7SKWj0SYcG8X9IaNMCUcu8gMqaupJstZXbiF0GREAJz9E1u5Xw1Vy7kcfy3cc
jIzBykGphE6E8K0G30UbTxzXvsnPWy7gz07CysxiJfRJxLproLNEx+di859+gfqH
+UJ2osL0rAOukQ1EO0yvaZ1iYg8RQ3lj6HHs6ZaiePvoTgtcxHFfVHcxEXqrVDqt
8jJdQcXMyBvgXmhfvSH10GEiSB68eLvTZzzO9DlS2NOowxTXdBqLFXk1Wzh6PHnx
VfUkvmxgnlX4y6vSrRSwLhMo0FUUJHrNTOI1SNOB4XABkReRCJlb2wTWdGWFqTCF
EIbEIeBOmpWDyo4bS/O1CeTnzmb9G13w8koX+8tIE0opqBkG/0+65qFXc8+tsMFv
AhmuIref2BCbDMoebGS6n0EiUZoEUdo4yWqO+PkuPIwjJsEMZ1ZDycLDtZMM9Uuk
AGlBWBaziRA2ZbUh32hqQQapnx2VZHttpzUqOu+q/JMANUGFRpNExsQwpPNAbof2
BYTbnf5guOIG1YP3D0RLr+q8hPlryZrVLKxvdJFkhEfUSEkS9lIu2oVZq0NIyLKf
r1vu/whRQi9F+l4z89wu
=qeBw
-----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: delete only the short sentences

2010/11/1 AMDx64BT <amdx64bt@gmail.com>:
> And to keep only the sentences in the range 40-60 characters long and
> delete the rest?

:g/^.\{,39\}$/d

and

:g/\(^.\{,39\}$\)\|\(^.\{61,\}$\)/d

should work.

>
> On Nov 1, 4:32 am, AMDx64BT <amdx6...@gmail.com> wrote:
>> I want to delete all the lines with long < 40 characters (including
>> white-spaces) and keep the others. Is there any command to do that?
>
> --
> 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
>

--
Joan Miquel Torres__________________________________
Linux Registered User #164872
http://www.mallorcaweb.net/joanmiquel
BULMA: http://bulma.net http://breu.bulma.net/?l2301

--
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: a question about softtabstop

Thanks for your help.
get the meaning of "TAB"

On 10月31日, 下午10时54分, ZyX <zyx....@gmail.com> wrote:>
> `softabstop' is ``pretend to insert a tab, but really insert spaces'' that is
> ``fill line with spaces till next virtual column that has 0 as a remainder in
> division by a value of tabstop''. So, it does not insert a four spaces, it
> inserts a spaces till fourth column.

--
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: delete only the short sentences

And to keep only the sentences in the range 40-60 characters long and
delete the rest?

On Nov 1, 4:32 am, AMDx64BT <amdx6...@gmail.com> wrote:
> I want to delete all the lines with long < 40 characters (including
> white-spaces) and keep the others. Is there any command to do that?

--
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

delete only the short sentences

I want to delete all the lines with long < 40 characters (including
white-spaces) and keep the others. Is there any command to do that?

--
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: A new style of c++ code indenting

Thanks for pointing on tabular!

I've been a long-time user of Align. It works well, and is powerful
and flexible. But it injects dozens and dozens of key mappings into
your key map space. Most of which I do not use, and even more that I
can never remember. And many of which, in some way, interfere with
existing key maps that I *do* use, not so much by overriding them as
much as by forcing me to wait for the timeout due to common prefixes.
I have always found that very annoying.

I just tried tabular. It is just as powerful, just as flexible, ...
but with such a clean, lightweight and intuitive interface! It stays
out of your way till you need it, and when you need it, it is a simple
command and reg-ex away. No muss, no fuss: it "just works". Within
minutes I was using it as if I had been using it for years. I highly
recommend it!

On Oct 31, 8:21 am, Javier Rojas <jeroja...@devnull.li> wrote:
> On Sun, Oct 31, 2010 at 05:36:41PM +0800, Aaron Lewis wrote:
> > Hi,
> >    For different types of variables in c++ , i would prefer such indentings:
>
> >    const QString           mystr;
> >    const QSystemTrayIcon   *icon;
>
> There are 2 plugins for doing this:
>
> DrChip's Align:http://www.vim.org/scripts/script.php?script_id=294
>
> godlygeek's tabular:http://github.com/godlygeek/tabular
>
> Most of the people at #vim prefer godlygeek's. I haven't used any of
> them, so I can't say anything about them.
>
> --
> Javier Rojas
>
> GPG Key ID: 0x24E00D68
>
>  signature.asc
> < 1KViewDownload

--
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: a question about softtabstop

Reply to message «a question about softtabstop»,
sent 17:12:58 31 October 2010, Sunday
by itx:

> but i found that when i type a TAB after a non-blank character it
> didn't insert softtabstop spaces
>
> for example
>
> 1. i\t
> 2. in\t
> 3. \t
>
> the end colum of these three lines are just the same ,why?
`softabstop' is ``pretend to insert a tab, but really insert spaces'' that is
``fill line with spaces till next virtual column that has 0 as a remainder in
division by a value of tabstop''. So, it does not insert a four spaces, it
inserts a spaces till fourth column.

Original message:
> I am using gvim 7.2
>
> my vimrc settings
>
> set tabstop=8
> set softtabstop=4
> set noexpandtab
>
> but i found that when i type a TAB after a non-blank character it
> didn't insert softtabstop spaces
>
> for example
>
> 1. i\t
> 2. in\t
> 3. \t
>
> the end colum of these three lines are just the same ,why?

a question about softtabstop

I am using gvim 7.2

my vimrc settings

set tabstop=8
set softtabstop=4
set noexpandtab

but i found that when i type a TAB after a non-blank character it
didn't insert softtabstop spaces

for example

1. i\t
2. in\t
3. \t

the end colum of these three lines are just the same ,why?

--
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: A new style of c++ code indenting

On Sun, Oct 31, 2010 at 05:36:41PM +0800, Aaron Lewis wrote:
> Hi,
> For different types of variables in c++ , i would prefer such indentings:
>
> const QString mystr;
> const QSystemTrayIcon *icon;

There are 2 plugins for doing this:

DrChip's Align: http://www.vim.org/scripts/script.php?script_id=294

godlygeek's tabular: http://github.com/godlygeek/tabular

Most of the people at #vim prefer godlygeek's. I haven't used any of
them, so I can't say anything about them.

--
Javier Rojas

GPG Key ID: 0x24E00D68

A new style of c++ code indenting

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

Hi,
For different types of variables in c++ , i would prefer such indentings:

const QString mystr;
const QSystemTrayIcon *icon;


Was it already implemented for this right-hand align style ?

Anyone give a try on this ?

Thanks !

- --
Best Regards,
Aaron Lewis - PGP: 0xDFE6C29E
Key Server: http://keyserver.veridis.com
Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJMzTipAAoJECSSp9Df5sKepEQP/1uxCKHiehoYoDyX99FSldhO
5F4HLLoh0Sq/PueLutVHvTqAvgyTjVgFEPIcQoRwhCcA/YrccVG9HYAwEi3S1rRt
U6HlUKYhF/SUH9syL2rwTYD1NSvcmazVSwUzIEeARtNOE27/REFX1rqwJ32Utk15
qcjjL8L0ebR4Q1VkmRO6hLIxTQsmqk/4viaZ984INTy1VZW9cR7cpsnGWz4pQG5b
qPam3qIQv17mYCzjS2EtGHoDwfEz1e+zCRSJdaRjIawF+LIu8gwifqHF8aM2kcqr
OScWpaN0nhb6rz3xPKDXvwdDmXwq98qMInEPBwHagjQRDYVO5QeHJ0tRi+7Cvevi
K6GMepkYG0foaFBWd8kMke7ZOfnyzGYzSmqiaFuCrjKs1BIeEFf7kTxpmxd4LhD4
+wsLbTIXr+aaRab/eHwGcAxly7RurZrwf6s+QXfzSjHW5gFoTdy1tlb6sYxOMAkn
b3omTcOqtg3lNyWQ+4GYJr9oLUT+F7+rvP4M3aINhhJWYlc+zXsEVH4QaGVLVZ6O
kXWGMKRhtoBjQ1YHQQrYuG+Ae0ACErpSJKqKFFZFlZmCUVH0kNGcDkEtIh/SfWYk
VlzUxthymbRq52mjPMV/oEAFnZySAV4hB95UBH+PhZUypW6biVXF0lEiSlJr/72h
yXVspmjs/fk9PnICStIz
=Szpg
-----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

Saturday, October 30, 2010

Re: vim - save password while editing remote files using scp

Aman Jain wrote:
> I'm trying to edit remote files using gvim in this manner:
>
> $ gvim scp://username@server.edu//home/username/new.txt
> But everytime I do a save, I have to enter password.
> I looked up on the internet to see if there's a way by which vim
> remembers remote
> passwords.
>
> So I found that creating a file called ~/.netrc does this for ftp
> transfer (http://vim.wikia.com/wiki/
> Editing_remote_files_via_scp_in_vim)
>
> I've also changed the permission of the file to 600, but still I'm
> being prompted for passwd.
>
> Am I missing something?
>
>
.netrc is for ftp; ssh/scp pays no attention to it.

In reading :help netrw-password , you'll find a reference to reading
:help netrw-ssh-hack . You may find it helpful.

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: Deleting buffer and going to next

On Sat, Oct 30, 2010 at 11:21 AM, Scott Bronson <bronson@rinspin.com> wrote:
> On Wed, Oct 27, 2010 at 3:44 AM, Martin Braun <martin.braun@kit.edu> wrote:
>> I was wondering if there's a way to concoct a command to
>> - Delete the current buffer and
>> - Move to the next
>> without destroying my split layout.
>
> I use this: http://github.com/bronson/vim-closebuffer
>
> Copy into your vimrc (or use pathogen), then hit ^W ^E to close the
> buffer without affecting your splits.

I should have mentioned that this is just the script on the wikia page
updated slightly and with (IMO) a better keybinding. I'd love to see it
integrated into vim one day -- it seems an obvious missing feature!

- Scott

--
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: Deleting buffer and going to next

On Wed, Oct 27, 2010 at 3:44 AM, Martin Braun <martin.braun@kit.edu> wrote:
> Hi vim-list,
>
> I was wondering if there's a way to concoct a command to
>
> - Delete the current buffer and
> - Move to the next
>
> without destroying my split layout.


I use this: http://github.com/bronson/vim-closebuffer

Copy into your vimrc (or use pathogen), then hit ^W ^E to close the
buffer without affecting your splits.

- Scott

--
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: selection to upper case or lower case

>> With gUU you can change a line to all upper case words.
>> With guu you can change a line to all lower case.
>>
>> How can you apply this to a selection?
>> Meaning:
>> When I have a piece of code selected to status line shows --SELECT--

This seems to work for the text selected when your in select mode
vmap <S-F3> <esc>gv~

<esc> stops the select-mode
gv selects the last selection, but then in visual mode
~ does then the toggling

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

Why does smap and vmap behave different then imap and map

Hi

I have mapping like

:map <F9> :w<CR>:make<CR>:clist<CR>


With set makeprog set correctly
(which is ":set makeprg=vcom\ -work\
C:\\projects\\iic_slave_pa_top_a0\\modelsim\\work\
-2002\ -explicit\ %")

this show my compiler output, and at the end vim says:
Press Enter to continue (in green colors)

This is the way I want it in normal mode.
When I'm in insert mode I have the mapping:
:imap <F9> <esc><F9>
Same correct behaviour.

Now I want to make this also work when I'm in select-mode or visual-mode.
I thouht that this would then work, but it doesn't
:smap <F9> <esc><F9>
:vmap <F9> <esc><F9>

The compiler output is then shown very quickly in the clist window, it
show the "Press enter to continue" message but it doens't wait on a
Enter. In stead, the clist window is closed again.

Removing the last <CR> on the original mapping after the clist is also
not correct, because then it waits on a enter to start clist.

Why?

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: selection to upper case or lower case

Reply to message «Re: selection to upper case or lower case»,
sent 17:49:57 30 October 2010, Saturday
by Javier Rojas:

> If I remember correctly, keybindings like Shift-Fn are recognized only
> by gvim, not by terminal vim (because of limitations of the terminal
> emulator, e.g., xterm or konsole)
No, sometimes <S-FN> works fine. Sometimes it requires a bunch of
...
set <S-F3>=^[[13;2~
...
placed in the vimrc. But they can be recognized in a terminal. There can be some
problems when terminal takes <S-FN> key as its own shortcut... but this can
apply to any <C-, <A- and others as well.

Re: selection to upper case or lower case

On Sat, Oct 30, 2010 at 02:38:21PM +0400, ZyX wrote:
> Reply to message «selection to upper case or lower case»,
> > What I want is to:
> > 1) Select a piece of code.
> > 2) Press <Shift-F3> and make it upper case.
> > 3) Press <Shift-F3> again to change it to lower case. (So a toggle
> > function)
> If you want to toggle upper/lower (so that `Ul' becomes `uL'), use
> vnoremap <special> <S-F3> ~
> if you want to toggle upper/lower based on character under cursor, use
> vnoremap <expr> <special> <S-F3> ((matchstr(getline('.'), '^.', col('.')-1)=~#'\u')?
> ('gu'):('gU'))

If I remember correctly, keybindings like Shift-Fn are recognized only
by gvim, not by terminal vim (because of limitations of the terminal
emulator, e.g., xterm or konsole)

Using ~ to toggle the case of text seems more simple to type for me.

--
Javier Rojas

GPG Key ID: 0x24E00D68

Re: Coloring a line by keystroke: TODO file in vim

Gareth Oakes wrote:
> On Oct 14, 10:18 am, Stahlman Family <brettstahl...@comcast.net>
> wrote:
>> Christian Brabandt wrote:
>>> Hi Rahul!
>>> On Mi, 13 Okt 2010, Rahul wrote:
>>>> I maintain a simple Todo file using vim. Each line has a task.
>>>> Sometimes for an important task it would be nice if I had a keystroke
>>>> that would make the whole line (or visually selected set of lines) a
>>>> particular color, say "Red".
>>>> Is there a way of setting this up? I've colored before but it is via a
>>>> Syntax File looking for keywords. That might also work in this case
>>>> but I was wondering if people have a way to dot this.
>>> I have never used it, but this sounds like you want the txtfmt plugin.
>>> http://www.vim.org/scripts/script.php?script_id=2208
>
> Very cool! I was using a much simpler method for my TODO files:
>
> nmap <A-v> :2match IncSearch /.*\%'<\_.*\%'>.*/<CR>
>
> Select line(s) using visual mode then Alt-V once finished to highlight
> the lines. Txtfmt sounds way better though!

Gareth,
If you find yourself performing the same highlighting operations often
in your TODO files, you might want to check out the "user-maps" feature
in the Txtfmt help. The basic idea is that you can build Vim maps from
both Vim commands (e.g., motion/delete commands) and Txtfmt primitives
(e.g., insert red-bold tokens, jump to next format token, etc...) to
automate common highlighting operations (e.g., make the current line
bold-red on a blue background). The following example was copied from
the help file to illustrate the concept...

" Map <LocalLeader>rb in normal mode to make the current line bold with
" a red background.
let g:txtfmtUsermap1 =
\'nnoremap <LocalLeader>rb <<n\vI:kr,fb>><<n\vA:f-,k->>'

:help txtfmt-user-maps
:help txtfmt-user-map-examples

You might also wish to create maps for common operations such as making
the current word bold, italic, red, yellow, etc... The odd-looking
syntax of the user-maps seems to frighten some new users away, but it
actually looks worse than it is, and the examples can serve as a
pattern. Also, I'm happy to provide more tailored examples as necessary...

Sincerely,
Brett Stahlman

>
> -Gareth
>

--
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: AIX

Also, the only parameter that I gave configure was to disable the GUI.  Plain old vi works just fine.  I tried installing 6.4, and that does the same thing.  I have been using vim for around four years on HP-UX without any problems.

John

On 10/29/2010 8:14 PM, JC wrote:
I installed 7.3 tonight on AIX, and whenever I use the 'o' key to insert a new line below the current line it doesn't shift the lines down until I <ESC>, and Ctrl-L.  I've used dtterm, vt100, and xterm.  I'm using putty.  Any ideas?
 
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
 
No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.864 / Virus Database: 271.1.1/3226 - Release Date: 10/29/10 13:34:00

Re: Coloring a line by keystroke: TODO file in vim

On Oct 14, 10:18 am, Stahlman Family <brettstahl...@comcast.net>
wrote:
> Christian Brabandt wrote:
> > Hi Rahul!
>
> > On Mi, 13 Okt 2010, Rahul wrote:
>
> >> I maintain a simple Todo file using vim. Each line has a task.
> >> Sometimes for an important task it would be nice if I had a keystroke
> >> that would make the whole line (or visually selected set of lines) a
> >> particular color, say "Red".
>
> >> Is there a way of setting this up? I've colored before but it is via a
> >> Syntax File looking for keywords. That might also work in this case
> >> but I was wondering if people have a way to dot this.
>
> > I have never used it, but this sounds like you want the txtfmt plugin.
> >http://www.vim.org/scripts/script.php?script_id=2208

Very cool! I was using a much simpler method for my TODO files:

nmap <A-v> :2match IncSearch /.*\%'<\_.*\%'>.*/<CR>

Select line(s) using visual mode then Alt-V once finished to highlight
the lines. Txtfmt sounds way better though!

-Gareth

--
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: selection to upper case or lower case

Reply to message «selection to upper case or lower case»,
sent 14:16:44 30 October 2010, Saturday
by Jeri Raye:

> With gUU you can change a line to all upper case words.
> With guu you can change a line to all lower case.
>
> How can you apply this to a selection?
> Meaning:
> When I have a piece of code selected to status line shows --SELECT--
> When I then press gUU, it removes my selection and give me the text gUU.
> That's not what I want.
You should not be using select mode instead of visual mode. If you press `gU'
(not `gUU` since second `U' is a motion) in visual mode, it will do what you
want. Try doing `set selectmode=' and then repeat what you do. If you do not
want to use visual mode, use `<C-o>gU' instead of `gU'.

> What I want is to:
> 1) Select a piece of code.
> 2) Press <Shift-F3> and make it upper case.
> 3) Press <Shift-F3> again to change it to lower case. (So a toggle
> function)
If you want to toggle upper/lower (so that `Ul' becomes `uL'), use
vnoremap <special> <S-F3> ~
if you want to toggle upper/lower based on character under cursor, use
vnoremap <expr> <special> <S-F3> ((matchstr(getline('.'), '^.', col('.')-1)=~#'\u')?
('gu'):('gU'))

selection to upper case or lower case

Hi,

With gUU you can change a line to all upper case words.
With guu you can change a line to all lower case.

How can you apply this to a selection?
Meaning:
When I have a piece of code selected to status line shows --SELECT--
When I then press gUU, it removes my selection and give me the text gUU.
That's not what I want.

What I want is to:
1) Select a piece of code.
2) Press <Shift-F3> and make it upper case.
3) Press <Shift-F3> again to change it to lower case. (So a toggle function)


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

Friday, October 29, 2010

vim - save password while editing remote files using scp

I'm trying to edit remote files using gvim in this manner:

$ gvim scp://username@server.edu//home/username/new.txt
But everytime I do a save, I have to enter password.
I looked up on the internet to see if there's a way by which vim
remembers remote
passwords.

So I found that creating a file called ~/.netrc does this for ftp
transfer (http://vim.wikia.com/wiki/
Editing_remote_files_via_scp_in_vim)

I've also changed the permission of the file to 600, but still I'm
being prompted for passwd.

Am I missing something?

--
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: Coloring a line by keystroke: TODO file in vim

Rahul wrote:
...
>> Worked like a charm! ;-) Yes,Rahul, you could certainly use Txtfmt for
>> this purpose. Txtfmt gives you a sort of rich text highlighting
>> capability in any sort of text file: you can apply foreground and
>> background colors, as well as all combinations of bold, underline,
>> italic, etc... You can even nest Txtfmt regions within other file types.
>> So, for example, if you had a syntax named "todo" for your TODO lists,
>> you could do...
>
> Works perfectly for my use! Thanks a lot Brett and Christian! Sorry
> for the delay in getting back; I got distracted in between.
>
> Excellent plugin!!!

No problem. Glad you find it useful.
Brett Stahlman

>
> --
> Rahul
>

--
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

AIX

I installed 7.3 tonight on AIX, and whenever I use the 'o' key to insert a new line below the current line it doesn't shift the lines down until I <ESC>, and Ctrl-L.  I've used dtterm, vt100, and xterm.  I'm using putty.  Any ideas?
 
John

Re: Problem sourcing .vimrc file

Erik Falor <ewfalor@gmail.com> writes:

>At any rate, if it is possible to do so, I recommend that you upgrade
>to 7.3.

Thanks Erik. I am using the copy of vim from the openCSW group, and this is
their latest version. I'll see if I can goose someone to build/release the
current version.

Regards,
--
Jeff

--
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: Coloring a line by keystroke: TODO file in vim

On Oct 13, 7:18 pm, Stahlman Family <brettstahl...@comcast.net> wrote:
> Christian Brabandt wrote:
> > HiRahul!
>
>
> Worked like a charm! ;-) Yes,Rahul, you could certainly use Txtfmt for
> this purpose. Txtfmt gives you a sort of rich text highlighting
> capability in any sort of text file: you can apply foreground and
> background colors, as well as all combinations of bold, underline,
> italic, etc... You can even nest Txtfmt regions within other file types.
> So, for example, if you had a syntax named "todo" for your TODO lists,
> you could do...

Works perfectly for my use! Thanks a lot Brett and Christian! Sorry
for the delay in getting back; I got distracted in between.

Excellent plugin!!!

--
Rahul

--
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: Problem sourcing .vimrc file

On Fri, Oct 29, 2010 at 06:29:26PM +0000, Jeffery Small wrote:
> I am on a Solaris 10 system using vim version 7.2.148.
>
> I have my master vimrc file identified by the environment variable VIMINIT
> and I also have a local .vimrc file in the current directory. When I begin
> editing a file in this directory, the custom commands in the local .vimrc
> file are read. However, if I edit the .vimrc file in another window and
> then source the file from my editing session with:
>
> :source .vimrc
>
> the changes are not read! Now, I have been doing this for many years and it
> always worked fine, so what is the problem now? I tried specifying:
>
> :source ./.vimrc

Neither of these will work unless the Vim process's CWD is the
directory where your .vimrc is stored. That, of course, should be
$HOME, and you can query the CWD with the :pwd command. It could be
the case that you have 'autochdir' set to true. See :help 'autochdir'
for more details.

That said,

> :source <full_directory_path>/.vimrc

should work, provided that you spelled <full_directory_path>
correctly.

> and neither of these worked. However, if I exit the editing session and
> restart vim, then the changes are seen upon startup!
>
> It appears as though the source command is not working. Is this a bug in
> this version of vim? Is there a new "feature" that I need to properly set
> that might be denying source from working? Is there a workaround for this?
> Thanks for any help you can offer.

The version of Vim that you're running is probably two years old. The
current version is 7.3.47. I don't know this off the top of my head,
but it could be a bug that has subsequently been fixed. You could
look at the patches section on www.vim.org to see if a patch was
submitted that fixes your problem.

At any rate, if it is possible to do so, I recommend that you upgrade
to 7.3.

--
Erik Falor
Registered Linux User #445632 http://counter.li.org

Problem sourcing .vimrc file

I am on a Solaris 10 system using vim version 7.2.148.

I have my master vimrc file identified by the environment variable VIMINIT
and I also have a local .vimrc file in the current directory. When I begin
editing a file in this directory, the custom commands in the local .vimrc
file are read. However, if I edit the .vimrc file in another window and
then source the file from my editing session with:

:source .vimrc

the changes are not read! Now, I have been doing this for many years and it
always worked fine, so what is the problem now? I tried specifying:

:source ./.vimrc
:source <full_directory_path>/.vimrc

and neither of these worked. However, if I exit the editing session and
restart vim, then the changes are seen upon startup!

It appears as though the source command is not working. Is this a bug in
this version of vim? Is there a new "feature" that I need to properly set
that might be denying source from working? Is there a workaround for this?
Thanks for any help you can offer.

Regards,
--
Jeff

C. Jeffery Small
jeff@cjsa.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: matchit for oracle plsql


Which version of Vim are you using?
:ver

The ftplugin/sql.vim has been included with the Vim runtime as of version 7.0 of Vim.

So, if you happen to have a local copy of vimfiles/ftplugin/sql.vim or .vim/ftplugin/sql.vim,  it is very old and should be deleted.

Vim 7.3 ships with version 7.0 of that file.

Having said all of that, it still does not work with the code you have provided.

I will add that to my TODO list, as I am the maintainer of that file.

Dave


On 10/29/2010 10:35 AM, talek wrote:
I have the following oracle plsql block:  begin   if true then     if 1=1 then     	null;     end if;     null;   end if;   for i in 1..100 loop     for i in 1..100 loop       null     end loop;     null;   end loop;   while true loop     null;     exit when false;   end loop; end;  Whiles matchit plugin works without problems for "begin:end, if:end if" pairs, it fails for statements like "for" or "while". I use version 0.08 of sql.vim ftplugin.  


matchit for oracle plsql

I have the following oracle plsql block:

begin
if true then
if 1=1 then
null;
end if;
null;
end if;
for i in 1..100 loop
for i in 1..100 loop
null
end loop;
null;
end loop;
while true loop
null;
exit when false;
end loop;
end;

Whiles matchit plugin works without problems for "begin:end, if:end
if" pairs, it fails for statements like "for" or "while". I use
version 0.08 of sql.vim ftplugin.

--
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, October 28, 2010

Re: Any command to format C source in a nice way?

thank you, nice tool. I will take a try.

On 5/28/10, Kazuo Teramoto <kaz.rag@gmail.com> wrote:
> On Fri, May 28, 2010 at 7:26 AM, robert song <robertsong.japan@gmail.com>
> wrote:
>> Is there any command to format the specified line directly?
>>
>
> You can try uncrustify http://uncrustify.sourceforge.net/
>
> But you example is a hard one, how can you decide what is "nice way"?
> Can you post it formated?

In fact, it's genereated by the gcc -save-temps option which expands
the macro in the intermediate file and really hard to read.

Best Regards,
robert

--
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: thesaurus questions

Am 28.10.2010 17:15, schrieb rameo:
> Hi,
>
> I can't find out how to add double words in the thesaurus file
>
> p.e. my thesaurus file:
> thanks,thank you,thanksgiving
>
> This is the popup menu using<c-x><c-t>
>
> thanks
> thank
> you
> thanksgiving
>
> How can I resolve this problem?

You can't have words with spaces in the thesaurus file.

> I noted that the thesaurus add all other synonyms it found in other
> lines p.e.
> thanks,thanksgiving
> thanksgiving,holiday
>
> This is the popup menu using<c-x><c-t>
>
> thanks
> thanksgiving
> holiday
>
> Is it possible to let vim use only the line in thesaurus where the
> search word is the first word?

No.
You could reorganize the file, ending up with two words per line.

--
Andy

--
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

thesaurus questions

Hi,

I can't find out how to add double words in the thesaurus file

p.e. my thesaurus file:
thanks,thank you,thanksgiving

This is the popup menu using <c-x><c-t>

thanks
thank
you
thanksgiving

How can I resolve this problem?

-------------------------------------------

I noted that the thesaurus add all other synonyms it found in other
lines p.e.
thanks,thanksgiving
thanksgiving,holiday

This is the popup menu using <c-x><c-t>

thanks
thanksgiving
holiday

Is it possible to let vim use only the line in thesaurus where the
search word is the first word?

--
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: Deleting buffer and going to next

On Thu, Oct 28, 2010 at 11:15:56AM +1100, John Beckett wrote:
> Martin Braun wrote:
> > I was wondering if there's a way to concoct a command to
> >
> > - Delete the current buffer and
> > - Move to the next
> >
> > without destroying my split layout.
>
> If you use ':set hidden', and you do not actually need to delete
> the current buffer (just close its window), you could use:
>
> http://vim.wikia.com/wiki/Deleting_a_buffer_without_closing_the_window

Hi John,

thanks a lot--that was what I needed and I can't believe I missed it my
search.

Cheers,
MB

--
Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin Braun
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-3790
Fax: +49 721 608-6071
www.cel.kit.edu

KIT -- University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association

Re: difference command line and menu?

On Oct 28, 12:26 am, John Little <john.b.lit...@gmail.com> wrote:
>
> This shows there is indeed a difference between the menu entry and the
> mapping, to do with the range given with the '< and '> marks; using
> the mapping as above fails if the visual selection is still displayed,
> because the marks are entered twice.  You'd need another mapping for
> visual mode:
>
> vmap <F4> :s/^\([-*]\\|\d*\.\)\s*\l/\U&/gc<CR>
>

If I'm not mistaken, you could also use :<C-U>'<,'> instead of
just :'<,'>. I don't think it matters in menus, but in mappings this
will also solve any problems with the user entering a count first.

--
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

Fwd: bashide



-------- Original Message --------
Subject: bashide
Date: Thu, 28 Oct 2010 10:42:03 +0800
From: aijieqiang <niejieqiang@gmail.com>
To: vim-subscribe@vim.org


is any one use bashide? i downloaded the plugin bashsupport.vim and installed it according the manual yesterday, but it didn't work correctly now. 
     the official site says i should add these lines to the .vimrc:
let g:BASH_AuthorName   = 'njq' let g:BASH_Email        = 'niejieqiang@gmail.com' let g:BASH_Company      = 'kakasoft' 
and then create a example.sh file ,   bash ide will insert the comment automatically .for example:
#!/bin/bash #=============================================================================== # #          FILE:  test.sh # #         USAGE:  ./test.sh # #   DESCRIPTION: # #       OPTIONS:  --- #  REQUIREMENTS:  --- #          BUGS:  --- #         NOTES:  --- #        AUTHOR:  Joe Brockmeier, jzb@zonker.net #       COMPANY:  Dissociated Press #       VERSION:  1.0 #       CREATED:  05/25/2007 10:31:01 PM MDT #      REVISION:  --- #===============================================================================

but it can't get the value of  my BASH_Authorname, BASH_Email and BASH_Company when i done all the operations. it inserts the content like this:

#!/bin/bash -
#===============================================================================
#
#          FILE:  test.sh
#
#         USAGE:  ./test.sh
#
#   DESCRIPTION: 
#
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  ---
#         NOTES:  ---
#        AUTHOR: YOUR NAME (),                    
#       COMPANY:                                           
#       CREATED: 10/28/2010 10:33:26 AM CST
#      REVISION:  ---
#===============================================================================

set -o nounset                              # Treat unset variables as an error

as you see , the AUTHOR, COMPANY and  the MAIL doesn't display correctly . what should i do ?
thanks in advance, sorry for my english  :)




Fedora 13 Gvim popup pops down unless you hold right mouse down?

Hi there --

I'm using the standard yum installed Gvim on a normal Fedora 13 system
running Gnome.

For whatever reason I quite like the Windows Gvim arrangement where
clicking the right mouse button brings up the paste and select popup
menu - so I have "behave mswin".

However on my latest system this menu pops down unless I keep the
right mouse button held down, i.e. I have to hold, drag and release to
choose a menu option. This is contrary to the normal UI behavior in
Gnome (and I think most modern Windowing systems), where selecting a
menu item can be accompanied by two separate clicks (and releases),
one to popup the menu and one to select the desired menu item.

Is this something I can control via my vimrc? I looked through the
documentation but didn't find anything obvious. Or is it the result of
the build time options of whoever built the gvim install for Fedora
13?

I did gvim --version on an older Fedora system where I don't have this
issue and compared the output with that on my current system and the
only difference in features is that the newer one has +ruby and
+startuptime and the only difference in defined marcos is that the
newer one has -DPERL_USE_SAFE_PUTENV and -DRUBY_VERSION=18.

So can anyone explain the behavior I see?

For reference I include the version info below.

Thanks for your time and help,

/George

VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Mar 25 2010 23:22:32)
Included patches: 1-411
Modified by <bugzilla@redhat.com>
Compiled by <bugzilla@redhat.com>
Huge version with GTK2 GUI. Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset
+cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info
+comments
+cryptv +cscope +cursorshape +dialog_con_gui +diff +digraphs +dnd -
ebcdic
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path
+find_in_path
+float +folding -footer +fork() +gettext -hangul_input +iconv
+insert_expand
+jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds
+localmap
+menu +mksession +modify_fname +mouse +mouseshape +mouse_dec
+mouse_gpm
-mouse_jsbterm +mouse_netterm -mouse_sysmouse +mouse_xterm
+multi_byte
+multi_lang -mzscheme +netbeans_intg -osfiletype +path_extra +perl
+postscript
+printer +profile +python +quickfix +reltime +rightleft +ruby
+scrollbind
+signs +smartindent -sniff +startuptime +statusline -sun_workshop
+syntax
+tag_binary +tag_old_static -tag_any_white -tcl +terminfo
+termresponse
+textobjects +title +toolbar +user_commands +vertsplit +virtualedit
+visual
+visualextra +viminfo +vreplace +wildignore +wildmenu +windows
+writebackup
+X11 -xfontset +xim +xsmp_interact +xterm_clipboard -xterm_save
system vimrc file: "/etc/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "/etc/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/etc"
f-b for $VIMRUNTIME: "/usr/share/vim/vim72"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -
pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/
include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/
include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1
-I/usr/include/freetype2 -I/usr/include/libpng12 -O2 -g -pipe -
Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -
mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -
D_FORTIFY_SOURCE=1 -D_REENTRANT -D_GNU_SOURCE -
DPERL_USE_SAFE_PUTENV -fstack-protector -I/usr/local/include -
D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib64/perl5/CORE -I/
usr/include/python2.6 -pthread -I/usr/lib64/ruby/1.8/x86_64-linux -
DRUBY_VERSION=18
Linking: gcc -L. -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/
usr/lib64/perl5/CORE -L/usr/local/lib -o vim -pthread -lgtk-
x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -
lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -
lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -
lglib-2.0 -lXt -lX11 -lSM -lICE -lselinux -lncurses -lacl -lgpm -
Wl,-E -Wl,-rpath,/usr/lib64/perl5/CORE -fstack-protector -L/usr/
lib64/perl5/CORE -lperl -lresolv -lutil -lc -L/usr/lib64/python2.6/
config -lpython2.6 -lutil -Xlinker -export-dynamic -lruby -lrt -ldl -
lm

--
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, October 27, 2010

Re: difference command line and menu?

On Oct 26, 7:11 am, rameo <rai...@gmail.com> wrote:

> John exactly the same command as in the vimrc file.
>
> :'<,'>s/^\([-*]\|\d*\.\)\s*\l/\U&/gc<CR>

We're at cross purposes here. menu.vim is run a part of gui
initialization, before the file being edited is loaded. If I put
exactly

:'<,'>s/^\([-*]\|\d*\.\)\s*\l/\U&/gc<CR>

in menu.vim, I get an error dialogue box saying:

Error detected while processing /home/john/.vim/menu.vim:
line 18:
E20: Mark not set

Indeed, the same applies to the .vimrc.
I assumed that you'd put in menu.vim something to get a menu entry
that would do the search and replace, something like (split over two
lines because google groups will split it anyway):

anoremenu 20.305 &Edit.Capitalize\ &List
\ :'<,'>s/^\([-*]\\|\d*\.\)\s*\l/\U&/gc<CR>

Now, doing this, I found that the backslash before the | had to be
doubled. However, for a mapping in the vimrc file, the same applies:

map <F4> :'<,'>s/^\([-*]\\|\d*\.\)\s*\l/\U&/gc<CR>

This shows there is indeed a difference between the menu entry and the
mapping, to do with the range given with the '< and '> marks; using
the mapping as above fails if the visual selection is still displayed,
because the marks are entered twice. You'd need another mapping for
visual mode:

vmap <F4> :s/^\([-*]\\|\d*\.\)\s*\l/\U&/gc<CR>

However, I'm not sure I understand what you've done, or are trying to
do. Is the problem with the | the incompatibility you're referring
to? That occurs because | is used to have multiple commands on the
command line, see :help map_bar, and there's various vi-compatible
kludges.

Regards, 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

Fwd: bashide



-------- Original Message --------
Subject: bashide
Date: Thu, 28 Oct 2010 10:42:03 +0800
From: aijieqiang <niejieqiang@gmail.com>
To: vim-subscribe@vim.org


hi, is any one use bashide? i downloaded the plugin bashsupport.vim and installed it according the manual yesterday, but it didn't work correctly now. 
     the official site says i should add these lines to the .vimrc:
let g:BASH_AuthorName   = 'njq' let g:BASH_Email        = 'niejieqiang@gmail.com' let g:BASH_Company      = 'kakasoft' 
and then create a example.sh file ,   bash ide will insert the comment automatically .for example:
#!/bin/bash #=============================================================================== # #          FILE:  test.sh # #         USAGE:  ./test.sh # #   DESCRIPTION: # #       OPTIONS:  --- #  REQUIREMENTS:  --- #          BUGS:  --- #         NOTES:  --- #        AUTHOR:  Joe Brockmeier, jzb@zonker.net #       COMPANY:  Dissociated Press #       VERSION:  1.0 #       CREATED:  05/25/2007 10:31:01 PM MDT #      REVISION:  --- #===============================================================================

but it can't get the value of  my BASH_Authorname, BASH_Email and BASH_Company when i done all the operations. it inserts the content like this:

#!/bin/bash -
#===============================================================================
#
#          FILE:  test.sh
#
#         USAGE:  ./test.sh
#
#   DESCRIPTION: 
#
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  ---
#         NOTES:  ---
#        AUTHOR: YOUR NAME (),                    
#       COMPANY:                                           
#       CREATED: 10/28/2010 10:33:26 AM CST
#      REVISION:  ---
#===============================================================================

set -o nounset                              # Treat unset variables as an error



as you see , the AUTHOR, COMPANY and  the MAIL doesn't display correctly . what should i do ?
thanks in advance, sorry for my english  :)

btw, i use gvim73 in ubuntu 10.10




Re: Toggle off "end-id" type of abbreviation in Vim (insert mode)

On Mon, Oct 25, 2010 at 12:36 AM, Scott Steele <scottlsteele@gmail.com> wrote:
> Because of how the "end-id" type of abbreviation is defined, this
> problem doesn't exist for two-letter abbreviations, and I can still
> use them (e.g. aa for always, bc for because). The single letter
> abbreviations offer some of the greatest advantage in typing speed,
> though, since many frequently used words are very short. (And I think
> it would slow my typing down if I had to be constantly going back and
> correcting whenever I noticed that I had preceded a single-letter
> abbreviation with punctuation.) And I think I could get by without
> having to use any end-id abbreviations.

Since there are limited number of single-letter abbreviations, maybe you
can have work-around similar to the following for those problematic cases:

ia ``T ``The

nazri

--
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: problem with map in custom vimrc

On Mon, Oct 25, 2010 at 10:43 PM, A Chaudhuri <acarchau@gmail.com> wrote:
> I have a custom vimrc file with exactly this line:
>
> map <F11> :call libcallnr("gvimfullscreen.dll", "ToggleFullScreen", 0)
> <cr>
>
> When I call vim with -u pointed to the path of the custom vimrc,
> pressing <F11> does not work.
>
> Output of first four lines of :map
>
> v  <C-X>         "*d
> n  <Leader>ihn   :IHN<CR>
> n  <Leader>is    :IHS<CR>:A<CR>
> n  <Leader>ih    :IHS<CR>
>   <F11>         :call libcallnr("gvimfullscreen.dll",
> "ToggleFullScreen", 0) <cr>
>
> which shows that <F11> did get mapped.
>
> gvimfullscreen.dll  is in C:\Program Files\Vim\vim73 folder, which
> also contains gvim.exe.
> I copied gvimfullscreen.dll to
>
>
> I have the same line in the default _vimrc in my $HOME, and it works.
>
> How can I debug this?

Change the definition of your <F11> mapping to do, say, ":echo 'hello'<CR>",
and see if the problem is due to the mapping definition.

nazri

--
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, TCL, and TAG

On Wed, Oct 27, 2010 at 12:59 AM, a b <pppbigppp@gmail.com> wrote:
>   Hi,
>
> I'm having trouble using tag on tcl files in VIM. I have created the
> tag
> file in the base directory and it's there. I can do :tag tagname. But
> I
> can't use the ctrl-] shortcut to jump into tcl proc
>
> The problem is that in the files I'm working with, many proc are
> defined
> using namespace, so they have this format:  ::ns_name::proc_name
>
> The tag file defines path for ::ns_name::proc_name, so it works
>
> but the ctrl-] shortcut, depending on the cursor placement, would only
> search ns_name or proc_name, and so I get the tag not found error
> message.
>
> Anyway around this?

:help iskeyword

nazri.

--
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: Deleting buffer and going to next

Martin Braun wrote:
> I was wondering if there's a way to concoct a command to
>
> - Delete the current buffer and
> - Move to the next
>
> without destroying my split layout.

If you use ':set hidden', and you do not actually need to delete
the current buffer (just close its window), you could use:

http://vim.wikia.com/wiki/Deleting_a_buffer_without_closing_the_window

> I guess what I really want to do is first move to the next
> buffer, and then delete the previous one (which is no longer
> displayed). However, I can't figure out a way to reference
> the previous buffer.

You can delete the alternate buffer with

:bd #

but the "alternate" won't always be what you want.

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

Re: Resizing window not working in my plugin

On Wed, 27 Oct 2010, Martin Lundberg wrote:

> I'm on MacVim Version 7.3 (53)
>
> I'm creating the buffer here:
> http://github.com/marlun/vim-gotobuffer/blob/master/plugin/gotobuffer.vim#L80
> creating it with
>
> execute "botright " . a:height . "new __GOTOBUFFER__"
>
> setting buftype=nofile. Not sure if that answers your question?

Yeah, it answers the question, but I don't know what's going wrong.
Just some simple tests: ({1..N} expands to the numbers 1 through N, in
case your shell doesn't support it)

vim -u NONE -N -c 'runtime plugin/gotobuffer.vim' -o 1
vim -u NONE -N -c 'runtime plugin/gotobuffer.vim' -o {1..3}
vim -u NONE -N -c 'runtime plugin/gotobuffer.vim' -o {1..6}
vim -u NONE -N -c 'runtime plugin/gotobuffer.vim' -o {1..10}

Then pressing \f seems to work. I get __GOTOBUFFER__'s of 1, 3, 6, and
10 lines.

My tests just now were with Vim 7.3c BETA w/o GUI. Not sure what the
'(53)' you mention is. 7.3 is only up to patch #47.

--
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: Resizing window not working in my plugin

I'm on MacVim Version 7.3 (53)

I'm creating the buffer here:
http://github.com/marlun/vim-gotobuffer/blob/master/plugin/gotobuffer.vim#L80
creating it with

execute "botright " . a:height . "new __GOTOBUFFER__"

setting buftype=nofile. Not sure if that answers your question?

On Wed, Oct 27, 2010 at 10:56 PM, Benjamin R. Haskell <vim@benizi.com> wrote:
> On Wed, 27 Oct 2010, Benjamin R. Haskell wrote:
>
>> On Wed, 27 Oct 2010, Martin Lundberg wrote:
>>
>>> Hi,
>>>
>>> I'm trying to write a buffer navigator plugin and it is somewhat working
>>> but I'm having problems with the resize command. In my script I fetch all
>>> the open buffers, and then I resize the window to the same size as the
>>> number of buffers.
>>>
>>>
>>> http://github.com/marlun/vim-gotobuffer/blob/master/plugin/gotobuffer.vim#L48
>>> is a link to the line which calls the method which runs resize and
>>>
>>> http://github.com/marlun/vim-gotobuffer/blob/master/plugin/gotobuffer.vim#L95
>>> is the resize call.
>>>
>>> For some reason the window is allways resized to 1 line even though the
>>> argument sent to the s:set_window_height method is a bigger number like 3.
>>>
>>> Would really appreciate an explenation of what I am doing wrong. As a
>>> bonus if someone could also tell me why the buffer I create in my plugin has
>>> a extra line added at the top that would be great too :)
>>
>> Guesing that it's 'winminheight' coming into play:
>>
>> :help 'winminheight'
>
> Oy.  Not my week.  Read your initial email with '1' and '3' reversed.
>
> What kind of buffer is in the window you're trying to resize?  Quickfix and
> preview windows have different sizing rules.  Also, what version? (My patch
> for preview windows not opening at the size of 'pvh' if 'pvh' is less than 3
> was just added in 7.3.044 -- guessing unrelated, but timely.)
>
> --
> 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
>

--
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: Resizing window not working in my plugin

On Wed, 27 Oct 2010, Benjamin R. Haskell wrote:

> On Wed, 27 Oct 2010, Martin Lundberg wrote:
>
>> Hi,
>>
>> I'm trying to write a buffer navigator plugin and it is somewhat
>> working but I'm having problems with the resize command. In my script
>> I fetch all the open buffers, and then I resize the window to the
>> same size as the number of buffers.
>>
>> http://github.com/marlun/vim-gotobuffer/blob/master/plugin/gotobuffer.vim#L48
>> is a link to the line which calls the method which runs resize and
>> http://github.com/marlun/vim-gotobuffer/blob/master/plugin/gotobuffer.vim#L95
>> is the resize call.
>>
>> For some reason the window is allways resized to 1 line even though
>> the argument sent to the s:set_window_height method is a bigger
>> number like 3.
>>
>> Would really appreciate an explenation of what I am doing wrong. As a
>> bonus if someone could also tell me why the buffer I create in my
>> plugin has a extra line added at the top that would be great too :)
>
> Guesing that it's 'winminheight' coming into play:
>
> :help 'winminheight'

Oy. Not my week. Read your initial email with '1' and '3' reversed.

What kind of buffer is in the window you're trying to resize? Quickfix
and preview windows have different sizing rules. Also, what version?
(My patch for preview windows not opening at the size of 'pvh' if 'pvh'
is less than 3 was just added in 7.3.044 -- guessing unrelated, but
timely.)

--
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: Resizing window not working in my plugin

On Wed, 27 Oct 2010, Martin Lundberg wrote:

> Hi,
>
> I'm trying to write a buffer navigator plugin and it is somewhat
> working but I'm having problems with the resize command. In my script
> I fetch all the open buffers, and then I resize the window to the same
> size as the number of buffers.
>
> http://github.com/marlun/vim-gotobuffer/blob/master/plugin/gotobuffer.vim#L48
> is a link to the line which calls the method which runs resize and
> http://github.com/marlun/vim-gotobuffer/blob/master/plugin/gotobuffer.vim#L95
> is the resize call.
>
> For some reason the window is allways resized to 1 line even though
> the argument sent to the s:set_window_height method is a bigger number
> like 3.
>
> Would really appreciate an explenation of what I am doing wrong. As a
> bonus if someone could also tell me why the buffer I create in my
> plugin has a extra line added at the top that would be great too :)

Guesing that it's 'winminheight' coming into play:

:help 'winminheight'

--
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

Resizing window not working in my plugin

Hi,

I'm trying to write a buffer navigator plugin and it is somewhat
working but I'm having problems with the resize command. In my script
I fetch all the open buffers, and then I resize the window to the same
size as the number of buffers.

http://github.com/marlun/vim-gotobuffer/blob/master/plugin/gotobuffer.vim#L48
is a link to the line which calls the method which runs resize and
http://github.com/marlun/vim-gotobuffer/blob/master/plugin/gotobuffer.vim#L95
is the resize call.

For some reason the window is allways resized to 1 line even though
the argument sent to the s:set_window_height method is a bigger number
like 3.

Would really appreciate an explenation of what I am doing wrong. As a
bonus if someone could also tell me why the buffer I create in my
plugin has a extra line added at the top that would be great too :)

Thanks,

-Martin Lundberg

--
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 7.3.046 binaries available

Hello Vim users,

I decided to make an update of the MS-Windows binaries, with all the 46
patches applied.

A list with a short explanation of the patches is on the ftp server:
ftp://ftp.vim.org/pub/vim/patches/7.3/README

These are the available files under ftp://ftp.vim.org/pub/vim/pc :

pc/gvim73_46.exe installer for GUI and console executables,
includes all runtime files, many features

pc/vim73_46rt.zip runtime files
pc/gvim73_46.zip GUI binary for Windows 95/98/NT/2000/XP
pc/gvim73_46ole.zip GUI binary with OLE support
pc/gvim73_46_s.zip GUI binary for Windows 3.1 (untested)
pc/vim73_46d32.zip console version for MS-DOS/Windows 95/98
pc/vim73_46w32.zip console version for Windows NT/2000/XP
pc/vim73_46src.zip sources for PC (with CR-LF)

If you don't know what file to download, go here:
http://www.vim.org/download.php#pc

Happy Vimming!

--
-rwxr-xr-x 1 root 24 Oct 29 1929 /bin/ed
-rwxr-xr-t 4 root 131720 Jan 1 1970 /usr/ucb/vi
-rwxr-xr-x 1 root 5.89824e37 Oct 22 1990 /usr/bin/emacs

/// 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: Deleting buffer and going to next

Martin Braun wrote:
> Hi vim-list,
>
> I was wondering if there's a way to concoct a command to
>
> - Delete the current buffer and
> - Move to the next
>
> without destroying my split layout.
>
> I guess what I really want to do is first move to the next buffer, and
> then delete the previous one (which is no longer displayed). However,
> I can't figure out a way to reference the previous buffer.
>
> Does anyone have a solution for this?
>
Why not just use

:n!

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: [PATCH] Protect read of g:Perl_PerlTags with exists()

On Wed, 27 Oct 2010, Bram Moolenaar wrote:

>
> Benjamin Haskell wrote:
>
>> There's an unprotected check of one of the configuration variables.
>> It's only triggered when you set ft=perl from .vimrc because the
>> plugin hasn't been loaded yet.
>>
>> [...]
>>
>> Pushed to http://github.com/benizi/perl-support.vim
>>
>> [...patch to ftplugin/perl.vim...]
>
> My ftplugin/perl.vim doesn't look anything like this. The header is:

Sorry, should have clarified, since that was most of my confusion
initially: mine doesn't look like that either. The perl-support script
has its own ftplugin/perl.vim. Patch is against the script, not Vim
proper.

Under Gentoo, perl-support.vim's ftplugin/perl.vim gets installed into
/usr/share/vim/vimfiles/ftplugin/perl.vim (rather than
/usr/share/vim/vim73/ftplugin/perl.vim)

--
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: For languages that end statements with semicolons: d$-1

On Wed, October 27, 2010 11:42 am, Dotan Cohen wrote:
> Does VIM have an easy way to delete up to the last character of a
> line, not inclusive?
>
> How about not including the last N characters? For instance, in C#
> there may be a statement in which I wish to delete all but the last 3
> characters, such as:
> Console.WriteLine("Lots of text here that I want to delete");
>
> Something like d$N where N is the amount of characters to keep (d$1
> for the first case and d$3 for the second case) would be great. Thanks
> for any ideas.

Interessting challenge. Here we go:

fun! s:GetOffset()
let offset=''
let char=nr2char(getchar())
while char =~? '[-0-9]'
let offset .= char
let char=nr2char(getchar())
endwhile
return [ abs(offset+0)*-1, char ]
endfun

fun! s:LastChar(offset)
if a:offset[0] < 0
echomsg a:offset[0] . '|' . a:offset[1]
return string(virtcol('$') + a:offset[0]) . '|' . a:offset[1]
else
return '$' . a:offset[1]
endif
endfun

onoremap <silent> <expr> $ <sid>LastChar(<sid>GetOffset())

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: For languages that end statements with semicolons: d$-1

On 10/27/10 04:42, Dotan Cohen wrote:
> Does VIM have an easy way to delete up to the last character of a
> line, not inclusive?

In addition to John's suggestions about text-objects (something I
use regularly and sets vim apart from many other editors I've
used), based on your Subject line, you can use the f/F/t/T
commands as your motion, so if you want to keep the semi-colon
(assuming you don't have compound statements or
semi-colons-in-strings) you can just issue

dt;

to delete from the cursor up-to-but-not-including the next
semi-colon. If you do have compound statements or ";" in
strings, you can take a visual tally and prefix with a count:

d3t;

(to delete to the 3rd semi-colon) if your line is something like

foo(X);bar("text;text");

with the cursor on "X" to transform it into

foo(;

Hope this helps too,

-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

Deleting buffer and going to next

Hi vim-list,

I was wondering if there's a way to concoct a command to

- Delete the current buffer and
- Move to the next

without destroying my split layout.

I guess what I really want to do is first move to the next buffer, and
then delete the previous one (which is no longer displayed). However,
I can't figure out a way to reference the previous buffer.

Does anyone have a solution for this?

Thanks a lot in advance,
Martin

--
Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin Braun
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-3790
Fax: +49 721 608-6071
www.cel.kit.edu

KIT -- University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association

Re: [PATCH] Protect read of g:Perl_PerlTags with exists()

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

>
> My ftplugin/perl.vim doesn't look anything like this. The header is:
>
> " Vim filetype plugin file
> " Language: Perl
> " Maintainer: Andy Lester <andy@petdance.com>
> " URL: http://github.com/petdance/vim-perl
> " Last Change: 2009-08-14
>

Mine isn't same either.

app-vim/perl-support-4.8


" Vim filetype plugin file
"
" Language : Perl
" Plugin : perl-support.vim
" Maintainer : Fritz Mehner <mehner@fh-swf.de>
" Revision : $Id: perl.vim,v 1.65 2010/04/28 19:10:13 mehner Exp $
"
"
-
----------------------------------------------------------------------------
"
" Only do this when not done yet for this buffer


- --
Best Regards,
Aaron Lewis - PGP: 0xDFE6C29E
Key Server: http://keyserver.veridis.com
Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJMx/0NAAoJECSSp9Df5sKeWOMP/1gyduRZpXkTV7pZC/ikt9KJ
K1UXpTGwE1SgtJxAk3t/qFmlPl8P8E+9lzhtMp5YSoSZfoqI4fiCEnBK69h9Fv/A
aio+hxs8Akpq/6xMnXr+wNsaANTFwxcdrHWsYkZfIzR3cqwxYqEkzPXoDQQ04uH9
D2MGg5aTFL5DfPBGLLdJ6Ft6/BsNFf1fbJhAx/xxcHd8/C25ZySFs8a56NgQKSox
9N0CO95nZ1QsX6jKlwzM42Nd+BlFgG2eHJOeC53fSVpdS7k71D94Q+mVbtryq1YK
OXwgxZpImy8AU/+QHivxos+yGFNqEdUhAb8sns2dheX+gGD7T6VyjtJUB6khTJ1w
SxT9WyHaDVUrjTfDlwku0xG+GV63H+uXLQU67zjExvy377UEZDh0CAwakmCnI58r
5lanMauC88sYp3WMI1XYIvBna7Ub6XkVDhwtL/wsS88AuW2nwvhUYsDZF1c3C8Gh
5pJsaM6vA/sVUgP5vTXEWvMUJBpNvnElSM2sn6rWLwcyAqTLHR+eixXEtj5Z/Gr0
hhOVcGdUHShImjtJjICpVFO46Ll7OV8jteDHcsRD9MS5Hv8nsFySWEXc1zXahHjy
og8+N+J7niR3rdIBMge2OWDok7kGv+Hlv6VORpVA8qNk1r0906ov6XfDOUzpMLdE
dQNqMYKs4Gijm9ElMxpN
=qTzC
-----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: [PATCH] Protect read of g:Perl_PerlTags with exists()

Benjamin Haskell wrote:

> There's an unprotected check of one of the configuration variables.
> It's only triggered when you set ft=perl from .vimrc because the
> plugin hasn't been loaded yet.
>
> You shouldn't do that. Let the ftplugin system detect your files as
> Perl files, or if they have non-standard extensions (something other
> than .pl/.perl) set up an autocmd, e.g.:
>
> au BufNewFile,BufRead *.not-perl setf perl
>
> Patch below. BCC:'ed Dr. Fritz Mehner (maintainer)
>
> Pushed to http://github.com/benizi/perl-support.vim
>
> ================================================== commit message
>
> Most tests of global variables in conditionals have the form:
>
> if exists("g:variable") && g:variable == 'somevalue'
>
> This one didn't, and caused errors when unitialized.
> ---
> ftplugin/perl.vim | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/ftplugin/perl.vim b/ftplugin/perl.vim
> index e34accc..82f949d 100644
> --- a/ftplugin/perl.vim
> +++ b/ftplugin/perl.vim
> @@ -411,7 +411,7 @@ endif
> " Generate (possibly exuberant) Ctags style tags for Perl sourcecode.
> " Controlled by g:Perl_PerlTags, enabled by default.
> " ----------------------------------------------------------------------------
> -if has('perl') && g:Perl_PerlTags == 'enabled'
> +if has('perl') && ( exists("g:Perl_PerlTags") && g:Perl_PerlTags == 'enabled' )
> let g:Perl_PerlTagsTempfile = tempname()
> if getfsize( expand('%') ) > 0
> call Perl_do_tags( expand('%'), g:Perl_PerlTagsTempfile )

My ftplugin/perl.vim doesn't look anything like this. The header is:

" Vim filetype plugin file
" Language: Perl
" Maintainer: Andy Lester <andy@petdance.com>
" URL: http://github.com/petdance/vim-perl
" Last Change: 2009-08-14

--
Seen on the back of a biker's vest: If you can read this, my wife fell off.

/// 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: For languages that end statements with semicolons: d$-1

On Wed, Oct 27, 2010 at 11:54, John Beckett <johnb.beckett@gmail.com> wrote:
> Before looking at your request, are you aware of text objects?
>

No, but from reading the rest o fyour message it seems to be what I
want! Thanks!

--
Dotan Cohen

http://gibberish.co.il
http://what-is-what.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: For languages that end statements with semicolons: d$-1

Dotan Cohen wrote:
> How about not including the last N characters? For instance,
> in C# there may be a statement in which I wish to delete all
> but the last 3 characters, such as:
> Console.WriteLine("Lots of text here that I want to delete");

Before looking at your request, are you aware of text objects?

Say the cursor is on the 'x' in "Lots of text..." in the above,
and you want to change the message. You type ci" (change inner
quotes) then type the new message.

Or, if wanting to change everything in the parentheses: ci(

Or, by movement, to change everything upto the next quote: ct"

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

For languages that end statements with semicolons: d$-1

Does VIM have an easy way to delete up to the last character of a
line, not inclusive?

How about not including the last N characters? For instance, in C#
there may be a statement in which I wish to delete all but the last 3
characters, such as:
Console.WriteLine("Lots of text here that I want to delete");

Something like d$N where N is the amount of characters to keep (d$1
for the first case and d$3 for the second case) would be great. Thanks
for any ideas.

--
Dotan Cohen

http://gibberish.co.il
http://what-is-what.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: execute command in [vim]grep-results ?

Hi Christian!


Thanx, this is just what the doctor ordered...

Asis

2010/10/26 Christian Brabandt <cblists@256bit.org>
Hi Asis!

On Di, 26 Okt 2010, Asis Hallab wrote:

> I recently discovered and used vim's
> args and argdo commands.
>
> Now I wonder if there's a way to execute a command over all search-results
> in the quickfix or location-list?
> E.g.
> vimgrep 'define' **/*.rb
> and then on all files in the quickfix, or location list
> *quickfix_do* %s/define/def/g
>
> Your help is very much appreciated.

This one here works with the quickfixlist / locationlist (the bang
form):

fun! QFDo(bang, command)
    let qflist={}
    if a:bang
        let tlist=map(getloclist(0), 'get(v:val, ''bufnr'')')
    else
        let tlist=map(getqflist(), 'get(v:val, ''bufnr'')')
    endif
    if empty(tlist)
       echomsg "Empty Quickfixlist. Aborting"
       return
    endif
    for nr in tlist
    let item=fnameescape(bufname(nr))
    if !get(qflist, item,0)
        let qflist[item]=1
    endif
    endfor
    :exe 'argl ' .join(keys(qflist))
    :exe 'argdo ' . a:command
endfunc

com! -nargs=1 -bang Qfdo :call QFDo(<bang>0,<q-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



--
Asis Hallab
Rothehausstr. 6 - 12
50823 Köln

Skype: asis.hallab.cgn
Fest (Köln) 42346046
Mobil  (O2) 0176 63370211
Fax 01212 - 5 - 30697106

--
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

Tuesday, October 26, 2010

Re: Copying and replacing chars of a line through a regex

On Oct 26, 4:29 pm, Fernando Basso <fernandobasso...@gmail.com> wrote:
> Again, you guys were amazing! Thanks a lot. I am now able to do
> that operation in a few different ways, above or below the line
> I want. Thanks a lot.

And another:

YpVr=

Y -- yank line
p -- paste after
V -- visual line mode
r -- replace
= -- with "="

-Bill

--
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: [PATCH] Protect read of Perl_PerlTags with exists() , was "what to do with perl-support when set ft=perl is set"

Great , you've worked it out.

On 10/27/2010 10:25 AM, Benjamin R. Haskell wrote:
> There's an unprotected check of one of the configuration variables. It's only
> triggered when you set ft=perl from .vimrc because the plugin hasn't been
> loaded yet.
>
> You shouldn't do that. Let the ftplugin system detect your files as Perl
> files, or if they have non-standard extensions (something other than .pl/.perl)
> set up an autocmd, e.g.:
>
> au BufNewFile,BufRead *.not-perl setf perl
>
> Patch below. BCC:'ed Dr. Fritz Mehner (maintainer)
>
> Pushed to http://github.com/benizi/perl-support.vim
>
> ================================================== commit message
>
> Most tests of global variables in conditionals have the form:
>
> if exists("g:variable") && g:variable == 'somevalue'
>
> This one didn't, and caused errors when unitialized.
> ---
> ftplugin/perl.vim | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/ftplugin/perl.vim b/ftplugin/perl.vim
> index e34accc..82f949d 100644
> --- a/ftplugin/perl.vim
> +++ b/ftplugin/perl.vim
> @@ -411,7 +411,7 @@ endif
> " Generate (possibly exuberant) Ctags style tags for Perl sourcecode.
> " Controlled by g:Perl_PerlTags, enabled by default.
> " ----------------------------------------------------------------------------
> -if has('perl') && g:Perl_PerlTags == 'enabled'
> +if has('perl') && ( exists("g:Perl_PerlTags") && g:Perl_PerlTags == 'enabled' )
> let g:Perl_PerlTagsTempfile = tempname()
> if getfsize( expand('%') ) > 0
> call Perl_do_tags( expand('%'), g:Perl_PerlTagsTempfile )


--
Aaron

--
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

[PATCH] Protect read of g:Perl_PerlTags with exists()

There's an unprotected check of one of the configuration variables. It's only
triggered when you set ft=perl from .vimrc because the plugin hasn't been
loaded yet.

You shouldn't do that. Let the ftplugin system detect your files as Perl
files, or if they have non-standard extensions (something other than .pl/.perl)
set up an autocmd, e.g.:

au BufNewFile,BufRead *.not-perl setf perl

Patch below. BCC:'ed Dr. Fritz Mehner (maintainer)

Pushed to http://github.com/benizi/perl-support.vim

================================================== commit message

Most tests of global variables in conditionals have the form:

if exists("g:variable") && g:variable == 'somevalue'

This one didn't, and caused errors when unitialized.
---
ftplugin/perl.vim | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ftplugin/perl.vim b/ftplugin/perl.vim
index e34accc..82f949d 100644
--- a/ftplugin/perl.vim
+++ b/ftplugin/perl.vim
@@ -411,7 +411,7 @@ endif
" Generate (possibly exuberant) Ctags style tags for Perl sourcecode.
" Controlled by g:Perl_PerlTags, enabled by default.
" ----------------------------------------------------------------------------
-if has('perl') && g:Perl_PerlTags == 'enabled'
+if has('perl') && ( exists("g:Perl_PerlTags") && g:Perl_PerlTags == 'enabled' )
let g:Perl_PerlTagsTempfile = tempname()
if getfsize( expand('%') ) > 0
call Perl_do_tags( expand('%'), g:Perl_PerlTagsTempfile )
--
1.7.3.1

--
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 to do with perl-support when set ft=perl set in vimrc

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

On 10/26/2010 11:17 PM, Benjamin R. Haskell wrote:
> On Tue, 26 Oct 2010, Benjamin R. Haskell wrote:
>
>> On Tue, 26 Oct 2010, Aaron Lewis wrote:
>>
>>> Hi,
>>> Just activated perl-support plugin , if i do set ft=perl inside
>>> my ~/.vimrc , thus i'll receive a warning:
>>>
>>> Error detected while processing
>>> /usr/share/vim/vimfiles/ftplugin/perl.vim:
>>> line 414:
>>> E121: Undefined variable: g:Perl_PerlTags
>>> E15: Invalid expression: has('perl') && g:Perl_PerlTags == 'enabled'
>>> Press ENTER or type command to continue
>>>
>>>
>>> But if i start vim , and type in "set ft=perl" manually , all goes well.
>>>
>>> Am i missing sth. here ?
>>
>> g:Perl_PerlTags isn't part of any recent (7.0+) ftplugin/perl.vim.
>> Googling it, I found:
>>
>> http://www.vim.org/scripts/script.php?script_id=556
>>
>> which has a changelog from 2008-01-02:
>>
>> + Global variable g:Perl_PerlTags is no longer needed.
>>
>> So, perhaps you're using that and updating that script might help?
>> Are you using a particularly old version of Vim?
>
> Oy. Feels like Monday. I suppose I could have read your message, which
> mentions you're using that script. Nonetheless the changelog seems
> relevant: probably the script is written for a newer version of Vim
> than you're using?

Guess everything on my system is newest here:

app-editors/vim-7.3
app-editors/vim-core-7.3
app-vim/perl-support-4.8

And also vim was compiled flags come here:

app-editors/vim-7.3 USE="X acl bash-completion cscope gpm nls perl
python ruby vim-pager -debug -minimal" 0 kB


>


- --
Best Regards,
Aaron Lewis - PGP: 0xDFE6C29E
Key Server: http://keyserver.veridis.com
Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E

No HTML shits , thanks.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJMx22wAAoJECSSp9Df5sKe3sYP/2ZU2J58KrapRHL+ibZbhxmz
cRJI5Oc8APMRt6ICzeF/v+ARJ87ZfvwRWoxoMzsuqJgBP5rUV0mZXbGBLdd+c2GI
XS3RBm6Vtfuvi9W8xaatfrB0oHaswvKhFuxjEHZ76ojZPhSkgVwV8/kjTEaYBMEL
Is4/HQ5n0kzx6aCat16IJT4cUI0A/CImN8/PuTa/MlUoXYNImmES6bQy873migJI
dP8P0R3g37rYgKFXYkS6cYGthUh129VlF7h5Q4i+whjRXP+WsU7o9zrQvgFkz1nS
wEYJQwF17FrvWXFJWa3fX4+ZWI+ac5qcr9pYntWuMyGuPXp4tvkKLzz40oFfdlou
lNVsF8edGXnSReTQCgx2pDIM8g+V6Met+paJl44/87sz5dHzwFXGtJsJMf1MTXxe
oOfV7wrRmmPaF/0Au+zYoimIgqlmv79sN9hVA1YiJKdes1I0/IqKJSf6Mzk708PD
RBV3vIZlp0eZqi+Dz4wmQ2KZGn3oh8b6t6XeXcENguWaKcuh71wHF92PPV63cjaU
7+w/tlqLZ1VPuDMiSWXiu2iZzYjDVUQ1iSuTN8jEGv9DjOLDwAOKJrdKcvDU5CNx
pIDF0mUh++0u9PTyWeatmLaqBcKI20eMzAQ49Z5pS3i+t1SM3DslD3Izhfiukb3D
XcTgGHVC9/rsRK9cwy0a
=GNZe
-----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