Tuesday, September 30, 2014

double the columns in vim on vertical split

I use set columns=80 in ~/.gvimrc . This works great when I open a single file in gvim. However, if I do a vertical split to open another file, I want the new gvim window size to be 160 columns so that each file has 80 columns dedicated for it.

Currently, the size of gvim windows stays the same even after vertical split which allocates 40 columns to each file. Since this is too small, I will then have to manually maximize the window.

Any suggestions on how to automatically double the number of columns after a :vs?

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: How to make a local option global?

On 2014-09-30, Cesar Romani wrote:
> On 30/09/2014 09:43 a.m., Bee wrote:
> > On Monday, September 29, 2014 7:36:49 PM UTC-7, andalou wrote:
> >> On 28/09/2014 03:26 p.m., Ben Fritz wrote:
> >>> On Sunday, September 28, 2014 10:53:48 AM UTC-5, andalou wrote:
> >> set again: 'set comments+=n:>'
> >>
> >> How can I have the same setting for all files?
> >
> > Add the line to your .vimrc:
> >
> > set comments+=n:>
> >
>
> But I don't want to modify my .vimrc for only this task.
> Before, I could set 'set comments+=n:>' and it worked fine, but it was
> changed, I don't know why and when!

To find out why and when, the next time you see it mysteriously
change, execute

:verbose set comments?

That will show you where it was last set.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: How to edit remove Linux files on gVim on Windows without 'end of line' character problem?

On Tuesday, September 30, 2014 7:50:19 AM UTC-5, Igor Forca wrote:
> Hi,
> using gVim on Windows 7. I would like to open remote file from Linux on my Windows box and edit it in gVim for Windows.
>
> I did the following:
> 1. From Putty program I have renamed PSCP.exe file to scp.exe and copied it to C:\Windows\System32\ directory.
>
> 2. Started gVim and typed in a command:
> :e scp://username@server//path/to/file
>
> 3. File opens successfully. But like I see there is "end of line" character problem.
>
> 4. On Linux box I opened vim and typed in a text:
> a
> a
> So two letters a with new line.
>
> 5. I executed :%!xxd to get the hexadecimal display of characters and I get:
> 61 0A 61
> So 61 is letter a, and 0A is a "new line" character.
>
> 6. After executing "e scp..." command on gVim for Windows and executing :%!xxd on Windows I get:
> 61 0D 0A 61
> So 61 is letter a, 0D is a carriage return and 0A is new line. So file was automatically converted from Unix EOL file format to Windows EOL format.
>
> 7. But when I save a file on gVim on Windows with :w and check the file on vim for Linux with :%!xxd command I see Windows EOL file format has preserved.
>
>
> How to make this EOL conversion to work without a problem between Windows and Linux using gVim?

Vim doesn't do any automatic conversion between line-ending formats. If you are having problems with an automated conversion, the root cause is probably your SCP tool, not Vim. Check the configuration of that tool for options regarding line endings.

That said, Vim itself should have no problem at all handling either file format.

So what problem are you seeing? What is the "end of line" character problem you're seeing?

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: How to make a local option global?

Il giorno martedì 30 settembre 2014 17:32:59 UTC+2, andalou ha scritto:

> >> How can I have the same setting for all files?
>
> But I don't want to modify my .vimrc for only this task.


how about bufdo?

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

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: How to make a local option global?

On Tuesday, September 30, 2014 10:32:59 AM UTC-5, andalou wrote:
>
> But I don't want to modify my .vimrc for only this task.
>
> Before, I could set 'set comments+=n:>' and it worked fine, but it was
>
> changed, I don't know why and when!
>

Then, you must have either had it in your .vimrc at that time, or you set the option prior to opening all your files, or you had a filetype plugin firing to set it for you. As far as I know 'comments' has always been a buffer-local 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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: How to make a local option global?

On 30/09/2014 09:43 a.m., Bee wrote:
> On Monday, September 29, 2014 7:36:49 PM UTC-7, andalou wrote:
>> On 28/09/2014 03:26 p.m., Ben Fritz wrote:
>>> On Sunday, September 28, 2014 10:53:48 AM UTC-5, andalou wrote:
>> set again: 'set comments+=n:>'
>>
>> How can I have the same setting for all files?
>
> Add the line to your .vimrc:
>
> set comments+=n:>
>

But I don't want to modify my .vimrc for only this task.
Before, I could set 'set comments+=n:>' and it worked fine, but it was
changed, I don't know why and when!

--
Cesar

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: How to make a local option global?

On Monday, September 29, 2014 7:36:49 PM UTC-7, andalou wrote:
> On 28/09/2014 03:26 p.m., Ben Fritz wrote:
> > On Sunday, September 28, 2014 10:53:48 AM UTC-5, andalou wrote:
> set again: 'set comments+=n:>'
>
> How can I have the same setting for all files?

Add the line to your .vimrc:

set comments+=n:>

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

How to edit remove Linux files on gVim on Windows without 'end of line' character problem?

Hi,
using gVim on Windows 7. I would like to open remote file from Linux on my Windows box and edit it in gVim for Windows.

I did the following:
1. From Putty program I have renamed PSCP.exe file to scp.exe and copied it to C:\Windows\System32\ directory.

2. Started gVim and typed in a command:
:e scp://username@server//path/to/file

3. File opens successfully. But like I see there is "end of line" character problem.

4. On Linux box I opened vim and typed in a text:
a
a
So two letters a with new line.

5. I executed :%!xxd to get the hexadecimal display of characters and I get:
61 0A 61
So 61 is letter a, and 0A is a "new line" character.

6. After executing "e scp..." command on gVim for Windows and executing :%!xxd on Windows I get:
61 0D 0A 61
So 61 is letter a, 0D is a carriage return and 0A is new line. So file was automatically converted from Unix EOL file format to Windows EOL format.

7. But when I save a file on gVim on Windows with :w and check the file on vim for Linux with :%!xxd command I see Windows EOL file format has preserved.


How to make this EOL conversion to work without a problem between Windows and Linux using gVim?

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Detecting characters in typeahead buffer

All,

Is there a way to detect whether Vim has input characters
waiting in the typeahead buffer? Internal to Vim, there are a
couple of functions that seem promising (ui_char_avail(),
input_available()), but I don't see how to access them from
Vimscript (or Python).

I'm looking to do something like the following:

if !input_available()
call feedkeys("keys")
endif

My overall goal is to make a dynamically computed snippet body
for use with the UltiSnips plugin. A generic trigger word would
expand to a snippet body that calculates a more specific trigger
word based on conditions. As an example, consider having a set
of "template" snippets based on filetype:

Trigger Body
template_python #!/usr/bin/env python ...
template_shell #!/bin/bash ...
template (delegate to template_&filetype)

The user would type the generic trigger "template", then logic
in that snippet's body would calculate a new trigger word (e.g.,
"template_python") and expand that snippet. It's easy enough to
have the "template" snippet body calculate a new trigger (e.g.,
"template_python") and replace it for the user. It's harder to
cause that computed template trigger to expand. I can place a
call to feedkeys() in the template body, but because UltiSnips
evaluates the template body multiple times during snippet
expansion, the call to feedkeys() is invoked repeatedly (three
times, it appears). Checking for input in the typeahead buffer
would allow the call to feedkeys() to occur just once regardless
of how many times the snippet body were to be expanded.

There might also be a clever way to solve this using UltiSnips
as-is, or to extend UltiSnips in some way to eliminate the need
to check the typeahead buffer. I'm currently using a
work-around that avoids defining "template" as a true snippet.
After a failed attempt to expand a snippet trigger, it performs
a hard-coded check for the word "template" on the current line;
if found, it calls feedkeys() to delegate to the real template.
While this works, I'd prefer a solution that doesn't involve
hooking the input keymaps for UltiSnips and hard-coding a check
for a pseudo-trigger.

Any ideas of suggestions are welcome.

Thanks,
Michael Henry

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Monday, September 29, 2014

Re: How to create blue & white color of status bar for input () function?

Ben,
I was not clear enough. I just wanted to see question to be displayed in blue & white and when Enter is pressed I just don't want to have blue & white color in status bar anymore. I thought that there is some command to define color of status bar to blue & white and after it needs to be reset back to normal black & white color. But like you have now explained there is no need for some kind of status bar coloring, but instead there exists "a color of prompt" and so my blue & white problem is automatically solved after Enter is pressed, because there is no prompt anymore.

I solved the problem with the following code:

function! ReplaceIt()
call inputsave()
echohl DiffAdd
let replacement = input('Type in your name and Enter: ')
echohl None
call inputrestore()
execute '%s/USER_NAME/'.replacement.'/g'
endfunction
:let mapleader = ","
:nnoremap <leader>r :call RepalceIt()

So adding "echohl DiffAdd" before input() function and resetting echo colors to "echohl None" to make sure that any following echo/input() message is not affected by this highlighting.

To see all possible highlight groups to select from, there is a command :highlight

Thanks a lot for help. Problem solved.
Regards

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: word completion inconvenience

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On September 30, 2014 1:46:36 AM GMT+03:00, Boyko Bantchev <boykobb@gmail.com> wrote:
>When using word completion, if the word that is to be chosen is near
>the bottom of the pop-up word list, it is more efficient to walk the
>list in upward direction, starting from the bottom. But moving from
>top to bottom upwards or from bottom to top downwards, there is
>always a blind position between the two, where no list item is being
>selected. I find it annoying to always have to do this superfluous
>keystroke. Moreover, I don't see any use at all of this blind
>position in the menu, or am I missing something? So, I have this
>question: is it possible to have a tighter menu that doesn't include
>the non-selection position?
>
>--
>--
>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 because you are subscribed to the Google
>Groups "vim_use" group.
>To unsubscribe from this group and stop receiving emails from it, send
>an email to vim_use+unsubscribe@googlegroups.com.
>For more options, visit https://groups.google.com/d/optout.

It is here for undoing completion in case you liked none of the variants.
-----BEGIN PGP SIGNATURE-----
Version: APG v1.1.1

iQI1BAEBCgAfBQJUKhtuGBxaeVggPHp5eC52aW1AZ21haWwuY29tPgAKCRCf3UKj
HhHSvsc6D/4sq0Eol348kmsZnrJZx2tt2JqYmjj+lzWL8LB3Cs8z9EqRszOIfcZP
qstq0CAH0M4OnEYm+AHYuBPlssyVziBUAW6J4woX0iSDnK1iIb2N/+MXfp/4q8Ti
Jej0NNpeHhG/kKzD1Ibr9iY80tvCDpdlKEE5WHunh0wR52c0u58r560O7fWTRfoM
RvEu8EG3zQEg1HC/TII/U4cUwFLnt+rJfYFTHPlmSDK7tNVbSMItrokZCFdfDK89
MaljH7zpnCQrHwwMxg5L0/wJ9msGMTZkw1lRq0Eu6yekQWaxPXpiQzzOUiUW450f
hCnhDXT2A81Ke26OMZTIavQLg6v3yqWY4gVb7IJ06idr8SD1VgAAix3wp3HKyriK
17J+P8AvuxaGQOdSYEozzMwg1KlsfAqjkzYXKcChiPZpk8gmyrIBSrNxSEBhBqEm
skSq4z3an09qjI3ViFkr4ufkPqstQC3BvRa8MRZy71yLnYcR78MPgTnUn7XbME/p
pFrZboqjqSt8kjvEIwZp04NIAMfhlsYBRmWdhrvZO1wKI6032t5qCfBRKZzWTOrW
Oo1K7XzspU2PJ5VDPmZyNFN5SSAh53tHfJMkvwJ6N0fRxSda7lQoKYjCaG4zxLCj
u73dr/C68ZzI0L0Rwany3ohmQU5QvIORK1LA80myJABFLCIJ5v4kaw==
=VZ8+
-----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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: How to make a local option global?

On 28/09/2014 03:26 p.m., Ben Fritz wrote:
> On Sunday, September 28, 2014 10:53:48 AM UTC-5, andalou wrote:
>> I'm using vim 7.4.461 on Windows.
>>
>> How can I make an option global for the current session?
>> For example, I notices that comments is set as a local option. How
>> can I make it global when editing a bunch of files?
>
> You can't. Local options only apply to single buffers/windows.
>
> But some local options have a "global" value that is used for any new
> buffers. If you use :set instead of :setlocal you will also set the
> global default value.
>
> Some other options are global-local. Using :set instead of :setlocal
> on these means that unless you override the option with :setlocal, the
> buffer will use the global version.
>
> Some options have their values set to sensible defaults in a filetype
> plugin.
>
> If you have more details on what you're trying to do (what kinds of
> files, which options) maybe there is more help. Most likely you want
> to either set up an autocmd to set the option for a certain filetype,
> or you want to use :bufdo, :windo, or :argdo to set an option on every
> file you already have open, or you need to set some default value in
> your .vimrc to use for all new buffers.

Thanks for the answer. I wanted to edit a bunch of files on the same
window and when I set 'set comments+=n:>' on the first file and go to
the next file with ':n', then the previous setting is lost and I have to
set again: 'set comments+=n:>'
How can I have the same setting for all files?

Many thanks in advance,

--
Cesar

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: command-line commands instead of abbreviations?

On Mon, Sep 29, 2014 at 08:29:58PM +0300, Gevisz wrote:
> On Mon, 29 Sep 2014 08:17:44 -0700 (PDT)
> Ben Fritz <fritzophrenic@gmail.com> wrote:

> > On Monday, September 29, 2014 1:21:57 AM UTC-5, gevisz wrote:
> > >
> > > So, Vim does not fully support utf-8 and thus using commands
> > > instead of abbreviations is not an option for me.
> >
> > But abbreviations don't work in normal mode anyway
> > which is where you wanted to use your command.

> Yes, I would prefer them to work from the insert mode but
> I do not mind pressing one more button before starting
> my mappings/abbreviations/commands.

forgive me if this has already been suggested and discarded, but if you
don't have too many of these things you might write a script to load the
useful ones into named registers for insertion with CTRL-R -- you could
trigger the script with filetype, or on demand, or whatever pleases you

that way you could stay in insert mode and insert them with very few
keystrokes

see

:h i_CTRL-R

for a more detailed description of register insertion

--
_|_ _ __|_|_ ._ o|
|_(_)(_)|_| ||_)||<
|

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

word completion inconvenience

When using word completion, if the word that is to be chosen is near
the bottom of the pop-up word list, it is more efficient to walk the
list in upward direction, starting from the bottom. But moving from
top to bottom upwards or from bottom to top downwards, there is
always a blind position between the two, where no list item is being
selected. I find it annoying to always have to do this superfluous
keystroke. Moreover, I don't see any use at all of this blind
position in the menu, or am I missing something? So, I have this
question: is it possible to have a tighter menu that doesn't include
the non-selection position?

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Some abbreviations work only as imaps

Christian wrote:

> On Mi, 24 Sep 2014, Gevisz wrote:
> > Some abbreviations expand as desired and some do not.
> >
> > > Are there any circumstances different between a working abbreviation
> > > and a not working abbreviation?
> >
> > They may be very similar. For example, abbreviation чкпк expands as
> > desired, whereas abbreviation чкпр does not expand at all unless I
> > redefine it via imaps. (The only difference between чкпк and чкпр is
> > in the last cyrillic letter.)
> >
> > > Have you tried, testing with
> > > vim -u NONE -N (to eliminate the effect of any plugins)?
> >
> > I have just tried that. No abbreviation works after starting vim with
> > such parameters. However, when I define these two abbreviation anew in
> > thus started vim, I get the same picture: чкпк abbreviation works and
> > чкпр one do not.
>
> I can reproduce this. Does this always involve the character 'р'?
>
> Bram, problem is, 'р' is U+0440 (0xD1 0x80). As you may now already
> guess, the 0x80 will be parsed as K_SPECIAL and therefore encoded as
> K_SPECIAL KS_SPECIAL KE_FILLER. Now when checking for an abbreviation,
> Vim does not consider that the len of the mapped keys might differ from
> the len of the input chars.
>
> Attached patch fixes this.

Thanks. This deserves a test.

> @@ -4517,6 +4519,14 @@ check_abbr(c, ptr, col, mincol)
> #else
> mp = first_abbr;
>

Re: command-line commands instead of abbreviations?

On Mon, 29 Sep 2014 08:17:44 -0700 (PDT)
Ben Fritz <fritzophrenic@gmail.com> wrote:

> On Monday, September 29, 2014 1:21:57 AM UTC-5, gevisz wrote:
> >
> > So, Vim does not fully support utf-8 and thus using commands
> > instead of abbreviations is not an option for me.
>
> But abbreviations don't work in normal mode anyway
> which is where you wanted to use your command.

Yes, I would prefer them to work from the insert mode but
I do not mind pressing one more button before starting
my mappings/abbreviations/commands.

For example, I could map <F9> to <Esc>: and use execute with
the normal command and startinsert command at the end.

That way the command could be working just as mapping with only
one extra stroke. Even better!

But not in case if I type in cyrillic. :(

In that case I should switch the keyboard two times, not
counting the inconvenience of transliterating my abbreviation
in roman letters.

So, it is really not the option.

> > > You could use a mapping instead of a command pretty easily.
> >
> > Not so easy as one can think as
> >
> > 1. I just cannot type mapping quick enough for it to work if
> > 1) the mapping is more than 4 characters long,
> > 2) I use it not very often and thus stop in the middle
> > of it to recall the next character.
>
> You could set your 'timeoutlen' to be longer if you like.

The problem is that I do not like to wait too long when I use
shorter mappings...

But, well, I may try to experiment with this...

> > 2. I cannot use for mappings such combination of letters
> > that can be encountered in usual text. That results in
> > a longer and harder to remember mappings and the latter
> > magnifies the reason 1 above.
>
> In normal mode, where you wanted to create your command,
> you will never be inserting text. So this reason doesn't
> apply.

As I have already explained it, I would prefer to do it
in insert mode but do not mind doing one extra stroke...

But if you mean that in the normal mode I am not constrained
with the situation described under item 2, it is not true
as I use set langmap in my .vimrc that, for example, maps
cyrillic letter "В" to "D", and so, any mapping starting
with cyrillic letter "В" could be very dangerous.

> > As to abbreviations, they have their own limitations.
> >
> > First of all, they cannot contain cyrillic letter "р"
> > at least in utf-8 encoding and at least for now. (Well,
> > actually they can but in this case they just do not
> > expand.)
>
> That is a bug. It will be fixed.

I hope so, but nobody have promised that. :(

And even if it will be done, it will take about half
a year to go to my Linux distribution, I think.

Well, I know that I can compile it myself.
Actually, I do. :) But only from the sources
tested and provided by my Linux distribution.

> > Second, they do not expand if typed just after other
> > letter characters.
>
> By this, do you mean that your abbreviation must have
> whitespace preceding? Or something else?

Not only mine but all. And not exactly whitespace but
any word-separating symbol. And even that is not exactly
true.

The true statement is like this: the last stroke before the
start of the abbreviation should not be insertion of any other
letter or number because otherwise the abbreviation will not
expand. (And that is their difference comparing to mappings.)

> > > Does it need to be a command?
> >
> > Yes, this alternative to mappings and abbreviations
> > would be very attractive (if they can work with
> > cyrillic command names, of course) as in addition
> > they could use arguments, for example, to insert
> > some changeable numbers in the middle of a
> > non-changeable text.
>
> That could also be accomplished with a mapping, using getchar() or
> input() or something within the mapping.

Thank you for the hint. I will look into it.

> Especially if you use an <expr> mapping.

I do not know/understand what you mean but will try to find out.
Thank you.

> But all in all...it sounds like maybe you need a snippet plugin
> of some sort. Do a web search, there are several.

I do not believe that somebody had the same needs but, yes, I may try.

> As a different approach, maybe you can look into using insert-mode
> completion instead of mappings or abbreviations. If you're only
> completing single words (separated by "non-keyword" characters) then
> you could potentially use dictionary completion (:help
> 'dictionary', :help compl-dictionary). If you have phrases also to
> complete, then you can define a user-completion (:help
> compl-function) or omni-completion (:help compl-omni) function to
> insert whatever you want based on whatever input you want. If you
> have several similar entries, you can see them all in a list. You
> could even parse "arguments" of sorts in your completion function for
> text that can change.

Another suggestion I may consider. Thank you.


--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: command-line commands instead of abbreviations?

On Monday, September 29, 2014 1:21:57 AM UTC-5, gevisz wrote:
>
>
> So, Vim does not fully support utf-8 and thus using commands instead of
>
> abbreviations is not an option for me.
>
>

Nope I guess not. But abbreviations don't work in normal mode anyway which is where you wanted to use your command.

>
> > You could use a mapping instead of a command pretty easily.
>
>
>
> Not so easy as one can think as
>
>
>
> 1. I just cannot type mapping quick enough for it to work if
>
> 1) the mapping is more than 4 characters long,
>
> 2) I use it not very often and thus stop in the middle
>
> of it to recall the next character.
>

You could set your 'timeoutlen' to be longer if you like.

> 2. I cannot use for mappings such combination of letters
>
> that can be encountered in usual text. That results in
>
> a longer and harder to remember mappings and the latter
>
> magnifies the reason 1 above.
>
>

In normal mode, where you wanted to create your command, you will never be inserting text. So this reason doesn't apply.

>
> As to abbreviations, they have their own limitations.
>
>
>
> First of all, they cannot contain cyrillic letter "р"
>
> at least in utf-8 encoding and at least for now. (Well,
>
> actually they can but in this case they just do not
>
> expand.)
>
>

That is a bug. It will be fixed.

>
> Second, they do not expand if typed just after other
>
> letter characters.
>
>

By this, do you mean that your abbreviation must have whitespace preceding? Or something else?

>
> > Does it need to be a command?
>
>
>
> Yes, this alternative to mappings and abbreviations
>
> would be very attractive (if they can work with
>
> cyrillic command names, of course) as in addition
>
> they could use arguments, for example, to insert
>
> some changeable numbers in the middle of a
>
> non-changeable text.

That could also be accomplished with a mapping, using getchar() or input() or something within the mapping. Especially if you use an <expr> mapping.

But all in all...it sounds like maybe you need a snippet plugin of some sort. Do a web search, there are several.

As a different approach, maybe you can look into using insert-mode completion instead of mappings or abbreviations. If you're only completing single words (separated by "non-keyword" characters) then you could potentially use dictionary completion (:help 'dictionary', :help compl-dictionary). If you have phrases also to complete, then you can define a user-completion (:help compl-function) or omni-completion (:help compl-omni) function to insert whatever you want based on whatever input you want. If you have several similar entries, you can see them all in a list. You could even parse "arguments" of sorts in your completion function for text that can change.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

echohl does not work interactively

Consider these commands:

echo 'hello'
echohl Error
echo 'world'
echohl None

When saved to a script test.vim, and using :source test.vim, I see "hello" printed as normal text, and "world" printed with error highlighting. This is the expected behavior.

If instead, I execute each command interactively by hand, both "hello" and "world" get normal highlighting. The echohl Error seems to be ignored.

Is this supposed to happen?


VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 9 2014 11:16:05)
MS-Windows 64-bit GUI version with OLE support
Included patches: 1-430
Compiled by (myself)
Huge version with GUI. Features included (+) or not (-)

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: How to create blue & white color of status bar for input () function?

On Monday, September 29, 2014 8:08:16 AM UTC-5, Igor Forca wrote:
> Hi,
> using Vim 7.4 on Windows 7.
>
> let replacement = input('Type in your name and Enter: ')
> call inputrestore()
> execute '%s/USER_NAME/'.replacement.'/g'
> endfunction
> :let mapleader = ","
> :nnoremap <leader>r :call RepalceIt()
>
> The above function works excellent. But now the problem is that prompt is not obvious, so user may miss the input question.
>
> Question: How to make input prompt more visible? I would like to make blue background color and white text (the text above "Type in you name and Enter:") for input prompt at the bottom? You know something like if you type in :xxx end Enter you get red background and white color, but I would like to get blue background.
>

You want the :echohl command, which sets the highlight group to use for the following :echo message(s). See :help :echohl for details.

You say in a followup, 'The blue color of "question" should only be blue until Enter is pressed to be more visible, then normal color (black & white).'

It is not possible to change the color of the echo'd message after it has already been displayed. But after you press enter the prompt is no longer visible. Why does it need to be changed?

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Use calculations on sub-expressions

On 2014-09-29 02:05, Axel Bender wrote:
> Given the following file:
>
> abc3
> abc4
> bcd1
> bcd3
>
> I'd like to find the line containing bcd1 having a gap (bcd2)
> between it and the next line.

Vim's regex engine(s) don't support doing arithmetic expressions in
the search side. I've wished for something like this in the past
(particularly when searching for IP addresses).

So you'd have to do a NOP replacement on either those you want or
don't want. Something like

:%s#^\(.\{-}\)\(\d\+\)\ze\n\1#\=submatch(0).(getline(line('.')+1)==submatch(1).(submatch(2)+1)?'':'<-- this')

(all one line)
It will mark the first line where the following line isn't one more
than that line, using "<-- this".

I think that's about the best you can do in raw vim without tapping
actual scripting.

-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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: How to create blue & white color of status bar for input () function?

Just additional info:
1. I am using Gvim and not Vim.
2. The blue color of "question" should only be blue until Enter is pressed to be more visible, then normal color (black & white).

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

How to create blue & white color of status bar for input () function?

Hi,
using Vim 7.4 on Windows 7.

I would like to prompt user to type in the name and then execute s[ubstitute] command to replace USER_NAME with input typed in name.

I stored bellow code in .vimrc file:

function! ReplaceIt()
call inputsave()
let replacement = input('Type in your name and Enter: ')
call inputrestore()
execute '%s/USER_NAME/'.replacement.'/g'
endfunction
:let mapleader = ","
:nnoremap <leader>r :call RepalceIt()

The above function works excellent. But now the problem is that prompt is not obvious, so user may miss the input question.

Question: How to make input prompt more visible? I would like to make blue background color and white text (the text above "Type in you name and Enter:") for input prompt at the bottom? You know something like if you type in :xxx end Enter you get red background and white color, but I would like to get blue background.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Use calculations on sub-expressions

Given the following file:

abc3
abc4
bcd1
bcd3

I'd like to find the line containing bcd1 having a gap (bcd2) between it and the next line.

Searching like this:

/^\(...\)\(\d\)\n\1\=\2+2
/^\(...\)\(\d\)\n\1\=submatch(2)+2
/^\(...\)\(\d\)\n\1\=eval(submatch(2)+2)

seemingly doesn't work. I wonder if there is any way to accomplish this task.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sunday, September 28, 2014

Re: command-line commands instead of abbreviations?

On Sun, 28 Sep 2014 20:25:27 -0700 (PDT)
Ben Fritz <fritzophrenic@gmail.com> wrote:

> On Sunday, September 28, 2014 7:08:47 PM UTC-5, Eric Christopherson
> wrote:
> > On Sun, Sep 28, 2014, Ben Fritz wrote:
> > > Easy solution: use a :normal! command within your command
> > > definition, to insert the text with 'a'.
> >
> > > E.g. :command тл normal! aтру-ля-ля

Thank you for the hint, Ben.

> >
> > That appears to be an invalid command name, as does the capitalized
> > variant Тл. Perhaps non-Roman scripts aren't supported as command
> > names?
>
> Probably. I didn't test the command as written since I can't actually
> enter those keys on my keyboard.

Yes, Eric, you are right. The cyrillic command names are not supported
as Vim types: "Invalid command name" after I try to define such a
command. (I use utf-8 encoding.)

So, Vim does not fully support utf-8 and thus using commands instead of
abbreviations is not an option for me.

> You could use a mapping instead of a command pretty easily.

Not so easy as one can think as

1. I just cannot type mapping quick enough for it to work if
1) the mapping is more than 4 characters long,
2) I use it not very often and thus stop in the middle
of it to recall the next character.
2. I cannot use for mappings such combination of letters
that can be encountered in usual text. That results in
a longer and harder to remember mappings and the latter
magnifies the reason 1 above.

As to abbreviations, they have their own limitations.

First of all, they cannot contain cyrillic letter "р"
at least in utf-8 encoding and at least for now. (Well,
actually they can but in this case they just do not
expand.)

Second, they do not expand if typed just after other
letter characters.

> Does it need to be a command?

Yes, this alternative to mappings and abbreviations
would be very attractive (if they can work with
cyrillic command names, of course) as in addition
they could use arguments, for example, to insert
some changeable numbers in the middle of a
non-changeable text.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: command-line commands instead of abbreviations?

On Sunday, September 28, 2014 7:08:47 PM UTC-5, Eric Christopherson wrote:
> On Sun, Sep 28, 2014, Ben Fritz wrote:
> > Easy solution: use a :normal! command within your command definition, to insert the text with 'a'.
>
> >
>
> > E.g. :command тл normal! aтру-ля-ля
>
>
>
> That appears to be an invalid command name, as does the capitalized
>
> variant Тл. Perhaps non-Roman scripts aren't supported as command names?

Probably. I didn't test the command as written since I can't actually enter those keys on my keyboard.

You could use a mapping instead of a command pretty easily. Does it need to be a command?

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

RE: How to make a local option global?

Cesar Romani wrote:
> How can I make an option global for the current session?
> For example, I notices that comments is set as a local option.
> How can I make it global when editing a bunch of files?

As Ben mentioned, settings like that should be set via filetype.

If you have several open files and you want to change a local
setting in each of them, use :bufdo or one of its variants such
as :argdo.

:bufdo set commentstring=//\ %s

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: command-line commands instead of abbreviations?

On Sun, Sep 28, 2014, Ben Fritz wrote:
> On Sunday, September 28, 2014 1:03:27 AM UTC-5, gevisz wrote:
> > Is it possible to define a command-line command
> > that just inserts some text after the current
> > cursor position and how to do it in an elegant way?
> >
> > For, example, so that typing in normal mode :тл will
> > insert тру-ля-ля after the current position in text.
> >
> > P.S. In my case the command name will always be in
> > cyrillic, so that not to switch the keyboard
> > layout.
>
> Easy solution: use a :normal! command within your command definition, to insert the text with 'a'.
>
> E.g. :command тл normal! aтру-ля-ля

That appears to be an invalid command name, as does the capitalized
variant Тл. Perhaps non-Roman scripts aren't supported as command names?

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Patch 7.4.391 why?

On 28/09/14 22:30, Ben Fritz wrote:
> On Saturday, September 27, 2014 10:34:03 PM UTC-5, Rick Howe wrote:
>> Thank you for your help. I also tried a workaround like this.
>>
>> au WinEnter * call SetCursorLine(1)
>> au WinLeave * call SetCursorLine(0)
>> function! SetCursorLine(n)
>> let &cursorline = a:n
>> au! CursorMoved
>> if a:n && &diff && winnr('$') >= 2
>> au CursorMoved * let &cursorline = diff_hlID('.', 1) != hlID("DiffChange") && diff_hlID('.', 1) != hlID("DiffText")
>> endif
>> endfunction
>>
>
> That is a WAY more complicated workaround than just turning off cursorline on diff windows. I'd rather require a simpler workaround.
>
>>
>> However, my basic question is this patch is really reasonable or not.
>> We can still see the highlitings of hlsearch and matchparen even if cursorline in on.
>
> The difference in these, is:
>
> 1. These items rarely if ever cover an entire screen line, unlike the diff highlighting
> 2. These items can be turned off individually, unlike diff highlighting which is always on in diff mode
> 3. These items are transient, similar to cursorline
> 4. These items are visible in diff mode, unlike cursorline
>
> I think the patch is reasonable. "Show me the cursor where it is right now" is more immediate and higher priority in my mind than "show me statically what lines changed".
>
>> But why DiffChange and DiffText have to be hidden?
>> It looks incompatible.
>> I still want to see Diff highlightings in diff mode.
>>
>
> And you can if you turn off cursorline, or simply move the cursor. But you can't see cursorline unless you turn off diff, making diff mode less useful with cursorline.
>
>> Is it possible to have a new setting option like cursorline's priority?
>
> If we're going to go that far, I'd also like to be able to customize the priority of search, diff highlighting, etc. similar to controlling the priority of matches with matchadd().
>

You could even have the best of both worlds, by writing a colorscheme
where CursorLine and the various Diff* highlightings would affect
different attributes of the highlight. For instance, in either gvim or a
256-color terminal with the CSApprox plugin:

:hi CursorLine guibg=#F4F4F4
:hi clear CursorColumn | hi link CursorColumn CursorLine
:hi DiffWhatever affecting only the foreground


Best regards,
Tony.
--
Birth, copulation and death.
That's all the facts when you come to brass tacks;
Birth, copulation and death.
-- T.S. Elliot, "Sweeney Agonistes"


--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Problem with vim spell (Reverese highlight after adding words)

It seems that it was connected with the plugin manager. Changing to pathogen
seems to return normal.



--
View this message in context: http://vim.1045645.n5.nabble.com/Problem-with-vim-spell-Reverese-highlight-after-adding-words-tp5722768p5722777.html
Sent from the Vim - General mailing list archive at Nabble.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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: command-line commands instead of abbreviations?

On Sunday, September 28, 2014 1:03:27 AM UTC-5, gevisz wrote:
> Is it possible to define a command-line command
>
> that just inserts some text after the current
>
> cursor position and how to do it in an elegant way?
>
>
>
> For, example, so that typing in normal mode :тл will
>
> insert тру-ля-ля after the current position in text.
>
>
>
> P.S. In my case the command name will always be in
>
> cyrillic, so that not to switch the keyboard
>
> layout.

Easy solution: use a :normal! command within your command definition, to insert the text with 'a'.

E.g. :command тл normal! aтру-ля-ля

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Patch 7.4.391 why?

On Saturday, September 27, 2014 10:34:03 PM UTC-5, Rick Howe wrote:
> Thank you for your help. I also tried a workaround like this.
>
> au WinEnter * call SetCursorLine(1)
> au WinLeave * call SetCursorLine(0)
> function! SetCursorLine(n)
> let &cursorline = a:n
> au! CursorMoved
> if a:n && &diff && winnr('$') >= 2
> au CursorMoved * let &cursorline = diff_hlID('.', 1) != hlID("DiffChange") && diff_hlID('.', 1) != hlID("DiffText")
> endif
> endfunction
>

That is a WAY more complicated workaround than just turning off cursorline on diff windows. I'd rather require a simpler workaround.

>
> However, my basic question is this patch is really reasonable or not.
> We can still see the highlitings of hlsearch and matchparen even if cursorline in on.

The difference in these, is:

1. These items rarely if ever cover an entire screen line, unlike the diff highlighting
2. These items can be turned off individually, unlike diff highlighting which is always on in diff mode
3. These items are transient, similar to cursorline
4. These items are visible in diff mode, unlike cursorline

I think the patch is reasonable. "Show me the cursor where it is right now" is more immediate and higher priority in my mind than "show me statically what lines changed".

> But why DiffChange and DiffText have to be hidden?
> It looks incompatible.
> I still want to see Diff highlightings in diff mode.
>

And you can if you turn off cursorline, or simply move the cursor. But you can't see cursorline unless you turn off diff, making diff mode less useful with cursorline.

> Is it possible to have a new setting option like cursorline's priority?

If we're going to go that far, I'd also like to be able to customize the priority of search, diff highlighting, etc. similar to controlling the priority of matches with matchadd().

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: How to make a local option global?

On Sunday, September 28, 2014 10:53:48 AM UTC-5, andalou wrote:
> I'm using vim 7.4.461 on Windows.
>
> How can I make an option global for the current session?
>
> For example, I notices that comments is set as a local option. How can I
>
> make it global when editing a bunch of files?
>
>

You can't. Local options only apply to single buffers/windows.

But some local options have a "global" value that is used for any new buffers. If you use :set instead of :setlocal you will also set the global default value.

Some other options are global-local. Using :set instead of :setlocal on these means that unless you override the option with :setlocal, the buffer will use the global version.

Some options have their values set to sensible defaults in a filetype plugin.

If you have more details on what you're trying to do (what kinds of files, which options) maybe there is more help. Most likely you want to either set up an autocmd to set the option for a certain filetype, or you want to use :bufdo, :windo, or :argdo to set an option on every file you already have open, or you need to set some default value in your .vimrc to use for all new buffers.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

How to make a local option global?

I'm using vim 7.4.461 on Windows.
How can I make an option global for the current session?
For example, I notices that comments is set as a local option. How can I
make it global when editing a bunch of files?

Many thanks in advance,

--
Cesar

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: zsh, solarized: Random typed keys shown on screen with wierd colors.

On So, 28 Sep 2014, Ory Band wrote:
> Doesn't anybody have a clue how to fix this? It's driving me crazy!

Are you using any plugins? I have seen something like this, when Vim is
busy executing e.g. autocommands that take a little while (or when the
system is under heavy load).

Best,
Christian
--
Liebe ist ein Käfig mit Gitterstäben aus Glück.
-- Claudia Cardinale

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: zsh, solarized: Random typed keys shown on screen with wierd colors.

Doesn't anybody have a clue how to fix this? It's driving me crazy!

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Saturday, September 27, 2014

command-line commands instead of abbreviations?

Is it possible to define a command-line command
that just inserts some text after the current
cursor position and how to do it in an elegant way?

For, example, so that typing in normal mode :тл will
insert тру-ля-ля after the current position in text.

P.S. In my case the command name will always be in
cyrillic, so that not to switch the keyboard
layout.


--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Patch 7.4.391 why?

Thank you for your help. I also tried a workaround like this.

au WinEnter * call SetCursorLine(1)
au WinLeave * call SetCursorLine(0)
function! SetCursorLine(n)
let &cursorline = a:n
au! CursorMoved
if a:n && &diff && winnr('$') >= 2
au CursorMoved * let &cursorline = diff_hlID('.', 1) != hlID("DiffChange") && diff_hlID('.', 1) != hlID("DiffText")
endif
endfunction


However, my basic question is this patch is really reasonable or not.
We can still see the highlitings of hlsearch and matchparen even if cursorline in on.
But why DiffChange and DiffText have to be hidden?
It looks incompatible.
I still want to see Diff highlightings in diff mode.

Is it possible to have a new setting option like cursorline's priority?

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Problem with vim spell (Reverese highlight after adding words)

I am having problem with the vim spell. When I add a word to the dictionary and after reopening the file all the words are highlighted in reverse (all the words are highlighted except the 'add' words). Of course the problem is present after loading all plugins. I am asking you if you have faced before the same problem.

Vim 7.4.335
Plugin List:
MacOs

Finished. 0 error(s).
[=================================]

- vim-pandoc-after: OK
- vim-transpose: OK
- vim-table-mode: OK
- vim-pandoc-syntax: OK
- translategoogle.vim: OK
- neomru.vim: OK
- gnupg.vim: OK
- vimproc.vim: OK
- vim-taskwarrior: OK
- perl-support.vim: OK
- vim-airline: OK
- vim-auto-save: OK
- vim-ultimate-colorscheme-utility: OK
- calendar-vim: OK
- colorv.vim: OK
- goyo.vim: OK
- utl.vim: OK
- gundo.vim: OK
- vim-pandoc: OK
- wmgraphviz.vim: OK
- restore_view.vim: OK
- ag.vim: OK
- csv.vim: OK
- vim-colorschemes: OK
- tabular: OK
- Conque-Shell: OK
- VOoM: OK
- riv.vim: OK
- zoomwintab.vim: OK
- syntastic: OK
- unite.vim: OK
- DrawIt: OK
- InstantRst: OK

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Focus returns to Vim's taglist window every time I execute the GDB `next` command in Conque GDB window

I'll walk you through all the steps I used to install required software and setup my Vim with tagist and Conque GDB plugins and then explain my issue.

### What I installed ...

I had Vim installed already.

I installed ctags, Vim's taglist plugin and Vim's Conque GDB plugin.

yum install ctags
wget http://www.vim.org/scripts/download_script.php?src_id=19574 -O taglist.zip
unzip taglist.zip -d ~/.vim
wget "http://www.vim.org/scripts/download_script.php?src_id=22163" -O conque_gdb.vmb
vim +"silent so % | q" conque_gdb.vmb

### Sample C source code to reproduce the issue

I wrote this little C source code file to demonstrate my issue.

#include <stdio.h>

int main()
{
printf("main 1\n");
printf("main 2\n");
printf("main 3\n");
printf("main 4\n");
return 0;
}

I saved this file as `foo.c`.

### Steps to reproduce the issue.

First compile foo.c with debugging information enabled. Then I opened vim.

$ gcc -g foo.c
$ vim foo.c

In Vim, perform the following commands.

1. Open taglist window with this command.

:TlistOpen

2. Then press <kbd>Ctrl</kbd> + <kbd>w</kbd> followed by <kbd>w</kbd> to return to the source code window containing foo.c.
3. Then launch GDB to debug `a.out` compiled from `foo.c` with this command.

:ConqueGdb a.out

4. In the GDB window, execute the following commands to set a breakpoint in `main` function and start debugging.

break main
run
next

5. As soon as I execute the `next` command, I find myself back in the taglist window in insert mode, i.e. the cursor is back in the taglist window.

Now it is a pain to press <kbd>Esc</kbd> to get back to normal mode, then press <kbd>Ctrl</kbd> + <kbd>w</kbd> <kbd>w</kbd>, etc. everytime to return back to the GDB window and then press <kbd>i</kbd> again to enter insert mode and continue debugging in the GDB window.

Is there a way to prevent the cursor from returning to the taglist window every time I execute the `next` command in the GDB window?

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Two new Vim books

Stephen Oualline wrote:

> Two new Vim books
>
> Free: Vim Tutorial and Reference
> http://www.oualline.com/vim-book.html
>
> Covers almost every Vim command and shows you every significant
> command works.
>
> Pay: Wicked Cool Vim
> http://www.amazon.com/Wicked-Cool-Vim-Vi-Improved-ebook/dp/B00LP6MLOG/ref=sr_1_1?ie=UTF8&qid=1411695756&sr=8-1&keywords=wicked+cool+vim
>
> How to do neat things in Vim for those that know the basics.

Great. I'll add links to the vim.org website when I find some time.

If others have a review of the books, let me know (or post to the list).

--
I'm in shape. Round IS a shape.

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Focus returns to Vim's taglist window every time I execute the GDB `next` command in Conque GDB window

I'll walk you through all the steps I used to install required
software and setup my Vim with tagist and Conque GDB plugins and then
explain my issue.


### What I installed ...

I had Vim installed already.

I installed ctags, Vim's taglist plugin and Vim's Conque GDB plugin.

yum install ctags
wget http://www.vim.org/scripts/download_script.php?src_id=19574
-O
taglist.zip
unzip taglist.zip -d ~/.vim
wget "http://www.vim.org/scripts/download_script.php?src_id=22163"
-O conque_gdb.vmb
vim +"silent so % | q" conque_gdb.vmb


### Sample C source code to reproduce the issue

I wrote this little C source code file to demonstrate my issue.

#include <stdio.h>

int main()
{
printf("main 1\n");
printf("main 2\n");
printf("main 3\n");
printf("main 4\n");
return 0;
}

I saved this file as `foo.c`.


### Steps to reproduce the issue.

First compile foo.c with debugging information enabled. Then I opened vim.

$ gcc -g foo.c
$ vim foo.c

In Vim, perform the following commands.

1. Open taglist window with this command.

:TlistOpen

2. Then press <kbd>Ctrl</kbd> + <kbd>w</kbd> followed by <kbd>w</kbd>
to return to the source code window containing foo.c.
3. Then launch GDB to debug `a.out` compiled from `foo.c` with this command.

:ConqueGdb a.out

4. In the GDB window, execute the following commands to set a
breakpoint in `main` function and start debugging.

break main
run
next

5. As soon as I execute the `next` command, I find myself back in the
taglist window in insert mode, i.e. the cursor is back in the taglist
window.

Now it is a pain to press <kbd>Esc</kbd> to get back to normal mode,
then press <kbd>Ctrl</kbd> + <kbd>w</kbd> <kbd>w</kbd>, etc. everytime
to return back to the GDB window and then press <kbd>i</kbd> again to
enter insert mode and continue debugging in the GDB window.

Is there a way to prevent the cursor from returning to the taglist
window every time I execute the `next` command in the GDB window?

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Patch 7.4.391 why?

On Saturday, September 27, 2014 2:20:25 AM UTC-5, Rick Howe wrote:
> I have noticed recently this patch.
> Patch 7.4.391. no 'cul' highlight with cursor on a line with diff highlight.
> It becomes often disturb my job because seeing the differences is much more important than current line in diff mode. Why is this patch reasonable? Is it possible to have an opiton?

Then turn off cursorline in diff mode. You could even make your own commands if it bothers you too much, to do both the diff command and the cursorline together:

command! -bar -nargs=1 -complete=file DiffSplit setl nocursorline | diffsplit <args> | setl nocursorline
command! -bar DiffThis setl nocursorline | diffthis
command! -bang -bar DiffOff call DoDiffOff(<bang>0)

function! DoDiffOff(bang)
if a:bang
diffoff!
windo if &diff | setl cursorline | endif
else
diffoff
setl cursorline
endif
endfun

The point is, there was NO way to show cursorline in a diff window. Now you can see cursorline in a diff window also. You can always turn cursorline off, on the other hand, if you don't want to see it.

In fact the Vim help recommends not keeping it on all the time anyway (well, technically it just says it will slow your Vim down).

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: How to insert line numbers with s[ubstitute] command?

Hi Igor!

On Sa, 27 Sep 2014, Igor Forca wrote:

> Hi,
> using Vim 7.4 I have the following text:
>
> aaa
> bbb
> ccc
> <many more rows>
>
> and I would like to add some text before each of line and number the line, so end result should look like:
>
> AAA1BBBaaa
> AAA2BBBbbb
> AAA3BBBccc
> <many more rows>
>
> I tried doing it with two substitute commands:
> :%s/^/AAA!BBB/g
> First adding some text and adding ! character instead of line number, to get:
>
> AAA!BBBaaa
> AAA!BBBbbb
> AAA!BBBccc
>
> And then replace ! with line number:
> :%s/!/\=line('.')/g
>
> to get final result:
>
> AA1BBBaaa
> AAA2BBBbbb
> AAA3BBBccc
>
> How to do above operations with one command?
>
> I tried with:
> :%s/^/AAA\=line('.')BBB/g
>
> but got:
>
> AAA=line('.')BBBaaa
> AAA=line('.')BBBbbb
> AAA=line('.')BBBccc
>
> So getting text displayed instead of line number. How to get this problem solved with one single command?

You are almost there. The \= needs to be the first char in the
replacement part. So Try this:

:%s/^/\=printf('AAA%dBBB', line('.'))/

Best,
Christian
--
Frage an Radio Eriwan:
"Ist es wahr, daß der liebe Gott Parteigenosse werden kann?"
Antwort:
"Im Prinzip ja, nur müsste er vorher aus der Kirche austreten."

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

How to insert line numbers with s[ubstitute] command?

Hi,
using Vim 7.4 I have the following text:

aaa
bbb
ccc
<many more rows>

and I would like to add some text before each of line and number the line, so end result should look like:

AAA1BBBaaa
AAA2BBBbbb
AAA3BBBccc
<many more rows>

I tried doing it with two substitute commands:
:%s/^/AAA!BBB/g
First adding some text and adding ! character instead of line number, to get:

AAA!BBBaaa
AAA!BBBbbb
AAA!BBBccc

And then replace ! with line number:
:%s/!/\=line('.')/g

to get final result:

AA1BBBaaa
AAA2BBBbbb
AAA3BBBccc

How to do above operations with one command?

I tried with:
:%s/^/AAA\=line('.')BBB/g

but got:

AAA=line('.')BBBaaa
AAA=line('.')BBBbbb
AAA=line('.')BBBccc

So getting text displayed instead of line number. How to get this problem solved with one single command?

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Patch 7.4.391 why?

I have noticed recently this patch.
Patch 7.4.391. no 'cul' highlight with cursor on a line with diff highlight.
It becomes often disturb my job because seeing the differences is much more important than current line in diff mode. Why is this patch reasonable? Is it possible to have an opiton?

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Friday, September 26, 2014

Re: Two new Vim books

On Thu, Sep 25, 2014, Stephen Oualline wrote:
> Two new Vim books
>
> Free: Vim Tutorial and Reference
> http://www.oualline.com/vim-book.html
>
> Covers almost every Vim command and shows you every significant
> command works.
>
> Pay: Wicked Cool Vim
> http://www.amazon.com/Wicked-Cool-Vim-Vi-Improved-ebook/dp/B00LP6MLOG/ref=sr_1_1?ie=UTF8&qid=1411695756&sr=8-1&keywords=wicked+cool+vim
>
> How to do neat things in Vim for those that know the basics.

Thanks, Stephen! The free book at least looks really helpful. Could you
share a table of contents for the Kindle one?

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thursday, September 25, 2014

Two new Vim books

Two new Vim books

Free: Vim Tutorial and Reference
http://www.oualline.com/vim-book.html

Covers almost every Vim command and shows you every significant
command works.

Pay: Wicked Cool Vim
http://www.amazon.com/Wicked-Cool-Vim-Vi-Improved-ebook/dp/B00LP6MLOG/ref=sr_1_1?ie=UTF8&qid=1411695756&sr=8-1&keywords=wicked+cool+vim

How to do neat things in Vim for those that know the basics.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Tell vim not to escape meta chars for coloring

Am 25/09/14 18:44, schrieb Ben Fritz:
> On Thursday, September 25, 2014 10:46:38 AM UTC-5, dapurehate wrote:
>> Hello everyone
>>
>> Has anybody a clue how to achieve this on a simple way? (eg. ESC[31m) If not i just use less -R but i am curious if it is possible in vim 7.3. I dont have internet access on the machine and i am not root, maybe good to know.
>>
>> Thank you for any hints.
>>
>> Greetings
> Vim isn't doing this escaping. Do you mean, you want Vim to PARSE the color escape sequences emitted by your terminal or utilities?
>
> For that, see the AnsiEsc plugin: http://www.vim.org/scripts/script.php?script_id=302
>
Hi

Yes PARSE was exactly the word i was looking for. :)

Thank you for your quick response i will try to get this running.

Greetings

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Tell vim not to escape meta chars for coloring

On Thursday, September 25, 2014 10:46:38 AM UTC-5, dapurehate wrote:
> Hello everyone
>
> Has anybody a clue how to achieve this on a simple way? (eg. ESC[31m) If not i just use less -R but i am curious if it is possible in vim 7.3. I dont have internet access on the machine and i am not root, maybe good to know.
>
> Thank you for any hints.
>
> Greetings

Vim isn't doing this escaping. Do you mean, you want Vim to PARSE the color escape sequences emitted by your terminal or utilities?

For that, see the AnsiEsc plugin: http://www.vim.org/scripts/script.php?script_id=302

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tell vim not to escape meta chars for coloring

Hello everyone

Has anybody a clue how to achieve this on a simple way? (eg. ESC[31m) If not i just use less -R but i am curious if it is possible in vim 7.3. I dont have internet access on the machine and i am not root, maybe good to know.

Thank you for any hints.

Greetings

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Some abbreviations work only as imaps

On Thursday, September 25, 2014 12:48:31 AM UTC-5, Tony Mechelynck wrote:
> 'iskeyword' resends to 'isfame' where the symbols used for both are
>
> defined; but if the {lhs} of your abbreviations is always made up of
>
> only Cyrillic letters, the relevant sentence is "Multi-byte characters
>
> 256 and above are always included, only the characters up to 255 are
>
> specified with this option." which would lead me to conclude that
>
> Cyrillic letters are always regarded as "word" characters.

This would obviously be true for utf-8 encoded text; minus the bug Christian found.

But is it true if the encoding is set to (for example) windows-1251? Nothing would be encoded over 255 in this encoding; I'm not clear from the help whether 'encoding' affects the meaning of 'iskeyword'.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: How to force Vim to reconcider abbreviations?

On Thursday, September 25, 2014 12:10:09 AM UTC-5, Tony Mechelynck wrote:
> On 22/09/14 19:37, Ben Fritz wrote:
>
> > I was actually quite surprised to find that abbreviations don't work if you wait 'updatetime' milliseconds between starting and ending the abbreviation, triggering the CursorHoldI event. That could be due to specific events firing, I don't really know, but it is not documented anywhere I could find.
>
>
>
> What is documented is that mappings expire after 'timoutlen'
>
> milliseconds. Abbreviations are not explicitly mentioned there, but I
>
> imagine that they might share part of the mapping code.
>
>
>
> - Try setting 'timeoutlen' and 'updatetime' to very different valuies so
>
> you can easily tell which of them is relevant;
>
> - If 'updatetime' does trigger abbreviations even when very different
>
> from 'timeoulen', does it make a difference if you remove any CursoHoldI
>
> autocommands that you might have?
>
>

Oh, it's definitely 'updatetime' and CursorHoldI. In my case abbreviations would expand if I waited a few seconds, but if I waited longer the cursor would briefly pause in its flashing as my autocmds processed, and after that abbreviations would not expand. I checked my autocmds and found the culprit.

In my case the behavior is caused by this autocmd, which I did not remember having, and I can probably understand why it would impact abbreviations:

if exists("##CursorHoldI")
autocmd CursorHoldI * call feedkeys("\<C-G>u", "nt")
endif

The autocmd breaks the undo sequence if pausing for a long time in insert mode, since if I pause a long time in insert mode I'm probably making multiple changes. I imagine breaking the undo sequence also breaks the insert so that it no longer looks like I typed the whole abbreviation this insert session.

I'm sure there may be other autocmds or plugins which could cause similar problems; all they must do is break the undo sequence somehow.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.