Wednesday, November 30, 2016

Re: English and Russian layouts vs mappings

2016-11-30 8:45 GMT+03:00 RingoRangoRongo <9876200@gmail.com>:
> Hi!
>
>
> Sicne I use both Russian and English keyboard layouts, obviously, I face the usual problem that pressing a Russian letter in Normal mode doesn't produce a command. Luckily, Vim has the `langmap` setting, which allows to tie my Russian keyboard layout with the English one. This makes default commands (like `G` or `yy`) working in Normal mode without switching layouts.
>
> However, _remapped_ commands (like `Y` for `y$`) or Leader-mappings (like `<Leader>b`) still do not work (pressing the latter, for example, results in `word back`, as per `b` command).
>
> Is it possible somehow to make this work? Trying `langremap` or `nolangremap` doesn't affect the situation, too.

I once chose not to learn Russian touch typing, instead relying on
https://bitbucket.org/ZyX_I/translit3. This has an upside that I do
not learn how to touch type twice. Downside is that I cannot touch
type Russian text without using Vim with my plugin. Depending on how
often you have to type Russian text on machines you don't own and how
often you happen to type short Russian messages fast (I type in Vim
and copy message over, this adds O(1) time to typing Russian text)
this option may be (in)appropriate for you.

This plugin may also be configured to emulate langmap to some extent,
but I never tried doing something like this and can't say pros/cons
compared to langmap and whether it is good enough idea to bother.

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

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

Tuesday, November 29, 2016

English and Russian layouts vs mappings

Hi!


Sicne I use both Russian and English keyboard layouts, obviously, I face the usual problem that pressing a Russian letter in Normal mode doesn't produce a command. Luckily, Vim has the `langmap` setting, which allows to tie my Russian keyboard layout with the English one. This makes default commands (like `G` or `yy`) working in Normal mode without switching layouts.

However, _remapped_ commands (like `Y` for `y$`) or Leader-mappings (like `<Leader>b`) still do not work (pressing the latter, for example, results in `word back`, as per `b` command).

Is it possible somehow to make this work? Trying `langremap` or `nolangremap` doesn't affect the situation, too.


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.

Capturing the exit status of 'makeprg'

I was working on a plugin in which I wanted to capture the exit
status of my 'makeprg', preferably using v:shell_error. The trouble
was that on Unix, 'shellpipe' is "2>&1| tee", so that following
:make, v:shell_error contained the exit status of tee and not of
'makeprg'.

I solved the problem by using bash's PIPESTATUS array variable to
access the exit status of the first command in the :make pipeline
and modifying 'shellpipe' to exit with that status.

let l:save_sp = &shellpipe
let &shellpipe .= " %s; exit ${PIPESTATUS[0]}"
make
" v:shell_error now contains the exit status of 'makeprg'.
let &shellpipe = l:save_sp

Let me know if there's a better way to do that. In the meantime,
I hope someone finds that useful.

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.

What is gained by the extra level of map indirection recommended in help?

The 'write-plugin' section of the help recommends the following
3-level map approach:

map ,c <Plug>TypecorrAdd
noremap <unique> <script> <Plug>TypecorrAdd <SID>Add
noremap <SID>Add :call <SID>Add(expand("<cword>"), 1)<CR>

I understand how it works, but it wasn't immediately clear to me what
was being gained by the middle level of indirection: specifically the
map to <SID>Add. What is the advantage of this strategy over the
following 2-level approach?

map ,c <Plug>TypecorrAdd
noremap <unique> <script> <Plug>TypecorrAdd
\ :call <SID>Add(expand("<cword>"), 1)<CR>

The help says...
"If another script would also map <SID>Add, it would get another
script ID and thus define another mapping."

While this is true, isn't this sort of script-uniqueness already
guaranteed by the use of <SID> in the rhs of the 3rd mapping? I.e.,
:call <SID>Add(...)<CR>

Thanks,
Brett S.

--
--
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: List is quiet

All of us in the USA are recuperating from the Thanksgiving meals and
the shopping we did over the weekend...


> -----Original Message-----
> From: vim_use@googlegroups.com [mailto:vim_use@googlegroups.com] On Behalf Of Sven Guckes
> Sent: Tuesday, November 29, 2016 7:56 AM
> To: vim@vim.org
> Subject: Re: List is quiet
>
> * Efraim Yawitz <efraim.yawitz@gmail.com> [2016-11-29 14:52]:
> > Is there some problem with this mailing list? I haven't gotten
> > any messages for a few days, and a message I wrote last week about
> > a folding-related bug hasn't been answered or acknowledged.
> > I sent it to vim_use@googlegroups.com if that matters.
>
> "it' quiet... *too* quiet!" ;-)
>
> yeah.. quiet it was.
>
> Sven
>
> 65279 N L 2016-Nov-03 Bram Moolenaar |1,9K|Re: Can I count on buffer numbers never being re-us
> 65395 ! 2016-Nov-06 Bram Moolenaar |3,3K|Updated Vim 8.0 available with 69 patches
> 65503 N L 2016-Nov-10 kamaraju kusumanchi |0,7K|print full file name
> 65505 N L 2016-Nov-09 JohnBeckett |0,9K|Re: print full file name
> 65506 N L 2016-Nov-09 JohnBeckett |0,9K|Re: print full file name
> 65546 N L 2016-Nov-10 kamaraju kusumanchi |1,1K|Re: print full file name
> 65547 N L 2016-Nov-10 kamaraju kusumanchi |1,1K|Re: print full file name
> 65548 N L 2016-Nov-10 h_east |1,4K|Re: print full file name
> 65549 N L 2016-Nov-10 h_east |1,4K|Re: print full file name
> 65551 N L 2016-Nov-11 kamaraju kusumanchi |0,7K|Re: print full file name
> 65552 N L 2016-Nov-11 kamaraju kusumanchi |0,7K|Re: print full file name
> 65783 N L 2016-Nov-20 Severin Weingarten |1,1K|system() slow in Win10 Pro, but not Home
> 66002 L 2016-Nov-29 Efraim Yawitz |2,0K|List is quiet
> 66003 L 2016-Nov-29 Paolo Bolzoni |1,4K|Re: List is quiet
> 66004 L 2016-Nov-29 Paolo Bolzoni |1,4K|Re: List is quiet
>
> --
> --
> 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.

--
--
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: Fold-related bug and pointer to fix



On Tue, Nov 29, 2016 at 7:02 PM, Ben Fritz <fritzophrenic@gmail.com> wrote:
On Wednesday, November 23, 2016 at 4:39:24 AM UTC-6, Efraim Yawitz wrote:
> I had the following problem and I think it is a bug in some fold-related code:
>
> I was trying to use the NarrowRegion plugin to do diffs between two functions in the same file by creating narrowed buffers for each function and calling :diffthis on them.  When I tried to do this using folds, i.e. :.,+2NarrowRegion to create a buffer for a folded-up function which looked like this:
>
> int FuncName() {
> .....folded........
> }
>
> I got everything but the final brace in the narrowed buffer.  Eventually I discovered that this has nothing to do with NarrowRegion, but just a yank such as:
>
> :.,+2y
>
> over a fold gives only the folded lines but not the line after the fold.
>
> A normal command of y2j works just fine and gets the line after the fold. 

I can confirm this looks like a bug, seeing the same behavior in 64-bit Vim 8.0.95 on Windows 7.

It gets worse actually. I tried several yanks from code that looks like this in Vim:

  else
  { ---3 lines folded--- }

Re: Fold-related bug and pointer to fix

On Wednesday, November 23, 2016 at 4:39:24 AM UTC-6, Efraim Yawitz wrote:
> I had the following problem and I think it is a bug in some fold-related code:
>
> I was trying to use the NarrowRegion plugin to do diffs between two functions in the same file by creating narrowed buffers for each function and calling :diffthis on them.  When I tried to do this using folds, i.e. :.,+2NarrowRegion to create a buffer for a folded-up function which looked like this:
>
> int FuncName() {
> .....folded........
> }
>
> I got everything but the final brace in the narrowed buffer.  Eventually I discovered that this has nothing to do with NarrowRegion, but just a yank such as:
>
> :.,+2y
>
> over a fold gives only the folded lines but not the line after the fold.
>
> A normal command of y2j works just fine and gets the line after the fold. 

I can confirm this looks like a bug, seeing the same behavior in 64-bit Vim 8.0.95 on Windows 7.

It gets worse actually. I tried several yanks from code that looks like this in Vim:

else
{ ---3 lines folded--- }

Re: List is quiet

* Efraim Yawitz <efraim.yawitz@gmail.com> [2016-11-29 14:52]:
> Is there some problem with this mailing list? I haven't gotten
> any messages for a few days, and a message I wrote last week about
> a folding-related bug hasn't been answered or acknowledged.
> I sent it to vim_use@googlegroups.com if that matters.

"it' quiet... *too* quiet!" ;-)

yeah.. quiet it was.

Sven

65279 N L 2016-Nov-03 Bram Moolenaar |1,9K|Re: Can I count on buffer numbers never being re-us
65395 ! 2016-Nov-06 Bram Moolenaar |3,3K|Updated Vim 8.0 available with 69 patches
65503 N L 2016-Nov-10 kamaraju kusumanchi |0,7K|print full file name
65505 N L 2016-Nov-09 JohnBeckett |0,9K|Re: print full file name
65506 N L 2016-Nov-09 JohnBeckett |0,9K|Re: print full file name
65546 N L 2016-Nov-10 kamaraju kusumanchi |1,1K|Re: print full file name
65547 N L 2016-Nov-10 kamaraju kusumanchi |1,1K|Re: print full file name
65548 N L 2016-Nov-10 h_east |1,4K|Re: print full file name
65549 N L 2016-Nov-10 h_east |1,4K|Re: print full file name
65551 N L 2016-Nov-11 kamaraju kusumanchi |0,7K|Re: print full file name
65552 N L 2016-Nov-11 kamaraju kusumanchi |0,7K|Re: print full file name
65783 N L 2016-Nov-20 Severin Weingarten |1,1K|system() slow in Win10 Pro, but not Home
66002 L 2016-Nov-29 Efraim Yawitz |2,0K|List is quiet
66003 L 2016-Nov-29 Paolo Bolzoni |1,4K|Re: List is quiet
66004 L 2016-Nov-29 Paolo Bolzoni |1,4K|Re: List is quiet

--
--
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: List is quiet

I can read you. Perhaps is just a quiet moment. (I see this email from
vim@vim.org though)

On Tue, Nov 29, 2016 at 2:21 PM, Efraim Yawitz <efraim.yawitz@gmail.com> wrote:
> Is there some problem with this mailing list? I haven't gotten any messages
> for a few days, and a message I wrote last week about a folding-related bug
> hasn't been answered or acknowledged. I sent it to vim_use@googlegroups.com
> if that matters.
>
> Thanks,
>
> Ephraim
>
> --
> --
> 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.

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

List is quiet

Is there some problem with this mailing list?  I haven't gotten any messages for a few days, and a message I wrote last week about a folding-related bug hasn't been answered or acknowledged.  I sent it to vim_use@googlegroups.com if that matters.

Thanks,

Ephraim

--
--
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, November 25, 2016

Re: Problem with macro and defaults.vim

On 24/11/2016 02:11 a.m., Christian Brabandt wrote:
> Am 2016-11-22 21:31, schrieb Cesar Romani:
>> I'm using Vim 8.0.94 on Windows.
>> Suppose I have the following line
>> 111 bbb aaa ccc
>>
>> and I delete the first word with 'dw', the second with '.', go the end
>> of line with $, go the previous space with 'F' followed by space, and do
>> 'p'. Summing up, I'm doing 'dw.$F p' (without the quotes). If I directly
>> run these commands, I get:
>> aaa bbb ccc
>>
>> but if I use a macro, say @a, it doesn't work. I get
>> bbb aaa 111 111 ccc
>>
>> If I disable defaults.vim it works.
>
> I cannot replicate this problem. Please check the following:
> - What is the content of your register?
> - Where is the cursor located when you run the macro?
> - How can we reproduce this problem?
>
> Also defaults.vim does not set that many options. If nothing helps you
> might want to
> check each option individually if it has an influence.

Thanks, now it works. Perhaps, the problem was that I needed to empty
the register "a" before, with qaq. Sorry for the noise.

Regards,

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

Wednesday, November 23, 2016

python search regex

A time ago, I asked if it possible to add python regex to vim.
No one answered that question.

VIM is a great editor and the use of Vimscript makes it even better.
Then I started to learn Python and noted that Bram has integrated Python in Vim.
I transformed many scripts from Vimscript to Python.
I noted that the things you want to do in vimscript, you can do the same thing in Python with 30/40% less lines.

There is much more info on line about python and much more people who can help you to resolve a problem.
Many things that you can do easier in Python.
Number manipulations, range with float step (using Numpy) etc.
And what about list manipulations? It is so easy in Python.
Putting all your buffer lines in a python list and you can do magic with your text in the buffer.

But what I miss and why I have to mix my functions with vimscript, is the python regex to search things in the buffer.
If I want to catch certain things in the text I have to search it using vimscript. It would be much easier if I could use also the python regex.

Would this be possible in a future vim release?

--
--
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 macro and defaults.vim

Am 2016-11-22 21:31, schrieb Cesar Romani:
> I'm using Vim 8.0.94 on Windows.
> Suppose I have the following line
> 111 bbb aaa ccc
>
> and I delete the first word with 'dw', the second with '.', go the end
> of line with $, go the previous space with 'F' followed by space, and
> do
> 'p'. Summing up, I'm doing 'dw.$F p' (without the quotes). If I
> directly
> run these commands, I get:
> aaa bbb ccc
>
> but if I use a macro, say @a, it doesn't work. I get
> bbb aaa 111 111 ccc
>
> If I disable defaults.vim it works.

I cannot replicate this problem. Please check the following:
- What is the content of your register?
- Where is the cursor located when you run the macro?
- How can we reproduce this problem?

Also defaults.vim does not set that many options. If nothing helps you
might want to
check each option individually if it has an influence.

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

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

Write a buffer other than the current one?

I haven't been able to find a way to write a buffer other than the current one, i.e. something like a command :writebuf <bufnum> or a similar function.  It seems like this would be something useful to do, say after listing buffers and seeing which ones were changed.  I know one can do :wall, but that does not allow choosing which ones to save.

Thanks,

Ephraim

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

Fold-related bug and pointer to fix

I had the following problem and I think it is a bug in some fold-related code:

I was trying to use the NarrowRegion plugin to do diffs between two functions in the same file by creating narrowed buffers for each function and calling :diffthis on them.  When I tried to do this using folds, i.e. :.,+2NarrowRegion to create a buffer for a folded-up function which looked like this:

int FuncName() {
.....folded........
}

I got everything but the final brace in the narrowed buffer.  Eventually I discovered that this has nothing to do with NarrowRegion, but just a yank such as:

:.,+2y

over a fold gives only the folded lines but not the line after the fold.

A normal command of y2j works just fine and gets the line after the fold.  Similarly, in a file where multiple folds are right after one another (a nice example is in fold.c of the vim code), a normal command of y2j yanks two folds, but :.,+2y yanks only one.

A little debugging led me to believe that the problem is in this code in ex_docmd.c, lines 2548-2549 in the latest git code:

    /* Put the first line at the start of a closed fold, put the last line
     * at the end of a closed fold. */
    (void)hasFolding(ea.line1, &ea.line1, NULL);
    (void)hasFolding(ea.line2, NULL, &ea.line2);

This seems to use the side effect of the hasFolding call to set the value of ea.line2 which is passed to the actual yank command.

I hope this will be helpful to fix the bug.

Ephraim

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

Tuesday, November 22, 2016

Problem with macro and defaults.vim

I'm using Vim 8.0.94 on Windows.
Suppose I have the following line
111 bbb aaa ccc

and I delete the first word with 'dw', the second with '.', go the end
of line with $, go the previous space with 'F' followed by space, and do
'p'. Summing up, I'm doing 'dw.$F p' (without the quotes). If I directly
run these commands, I get:
aaa bbb ccc

but if I use a macro, say @a, it doesn't work. I get
bbb aaa 111 111 ccc

If I disable defaults.vim it works.

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.

Monday, November 21, 2016

Re: Wrong vim color syntax

Chip,

Sorry for the very late answer, having an extremely busy time here. But good news, I just downloaded the latest version 165 of sh.vim and the syntax coloring issue I was created this thread for is solved.
People can now vim my FireMotD (https://github.com/willemdh/FireMotD) with full color syntax. :)

Thanks a lot.

Willem
https://outsideit.net

--
--
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, November 20, 2016

system() slow in Win10 Pro, but not Home

I have two machines with fresh gVim 8.0.2 32-bit installations on Windows 10 Pro and Home, respectively. A call to `system()` (e.g. `echom system('whoami')`) takes about a full second on Win10 Pro; a shell window opens and closes before the result appears. On Win10 Home the result of the call appears instantly and no window is opened.

I would expect the result to appear instantly in both cases.

On IRC, somebody suggested looking at shell and shellcmdflag, but those variables have identical values on both systems:

shell=C:\WINDOWS\system32\cmd.exe
shellcmdflag=/c

How can I go about diagnosing the difference between the two systems?

Best,
Severin

--
--
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: Hiding cursor with t_ve in terminal

On Sun, Nov 20, 2016 at 6:52 AM, Bram Moolenaar <Bram@moolenaar.net> wrote:
>
> Brett Stahlman wrote:
>
>> Vim's documentation lists 't_vi' as "cursor invisible" and 't_ve' as
>> "cursor visible", but provides no hints on usage. Naively, I would
>> have guessed that Vim would send the 't_vi' sequence when you somehow
>> indicated that the cursor should be hidden (e.g., using something
>> analogous to 'guicursor' for terminals), but there doesn't appear to
>> be any such mechanism. The only way I've been able to hide the cursor
>> in a terminal is to make the "cursor visible" option empty: e.g.,
>>
>> set t_ve=
>>
>> I interpret this behavior as follows: when you tell Vim there's no way
>> to make the cursor visible, it immediately uses the 't_vi' option
>> value to make it *invisible*. This was less than intuitive to me, and
>> I didn't see it documented in the Vim help. Is the behavior
>> well-defined? Can anyone give a better explanation of what's happening
>> and perhaps the rationale behind it? Have I simply missed the
>> pertinent documenation?
>
> Traditionally terminals show the cursor even when drawing text. So on
> your 300 baud modem you could see the cursor move ahead of the text that
> was displayed. Now that text is drawn instantly, updating the cursor
> just becomes flickering. So Vim disables the cursor before drawing
> text, and switches it back on when done.
>
> The setting is termcap thing, telling Vim what escape sequence to use.

Makes sense, but out of curiosity, why is the cursor hidden
*immediately* when I clear t_ve, even when no text is being drawn?
Even if I do the `set t_ve=' in a silent mapping (to ensure no text is
being changed), the cursor disappears immediately. I'm actually glad
it works this way - I just want to be sure it's intended behavior,
and not likely to change...

Thanks,
Brett Stahlman

>
> --
> A day without sunshine is like, well, night.
>
> /// 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.

Re: Hiding cursor with t_ve in terminal

Brett Stahlman wrote:

> Vim's documentation lists 't_vi' as "cursor invisible" and 't_ve' as
> "cursor visible", but provides no hints on usage. Naively, I would
> have guessed that Vim would send the 't_vi' sequence when you somehow
> indicated that the cursor should be hidden (e.g., using something
> analogous to 'guicursor' for terminals), but there doesn't appear to
> be any such mechanism. The only way I've been able to hide the cursor
> in a terminal is to make the "cursor visible" option empty: e.g.,
>
> set t_ve=
>
> I interpret this behavior as follows: when you tell Vim there's no way
> to make the cursor visible, it immediately uses the 't_vi' option
> value to make it *invisible*. This was less than intuitive to me, and
> I didn't see it documented in the Vim help. Is the behavior
> well-defined? Can anyone give a better explanation of what's happening
> and perhaps the rationale behind it? Have I simply missed the
> pertinent documenation?

Traditionally terminals show the cursor even when drawing text. So on
your 300 baud modem you could see the cursor move ahead of the text that
was displayed. Now that text is drawn instantly, updating the cursor
just becomes flickering. So Vim disables the cursor before drawing
text, and switches it back on when done.

The setting is termcap thing, telling Vim what escape sequence to use.

--
A day without sunshine is like, well, night.

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

Saturday, November 19, 2016

Hiding cursor with t_ve in terminal

Vim's documentation lists 't_vi' as "cursor invisible" and 't_ve' as
"cursor visible", but provides no hints on usage. Naively, I would
have guessed that Vim would send the 't_vi' sequence when you somehow
indicated that the cursor should be hidden (e.g., using something
analogous to 'guicursor' for terminals), but there doesn't appear to
be any such mechanism. The only way I've been able to hide the cursor
in a terminal is to make the "cursor visible" option empty: e.g.,

set t_ve=

I interpret this behavior as follows: when you tell Vim there's no way
to make the cursor visible, it immediately uses the 't_vi' option
value to make it *invisible*. This was less than intuitive to me, and
I didn't see it documented in the Vim help. Is the behavior
well-defined? Can anyone give a better explanation of what's happening
and perhaps the rationale behind it? Have I simply missed the
pertinent documenation?

Thanks,
Brett Stahlman

--
--
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, November 18, 2016

Re: How to load updated syntax files using native packages?

> Is that related to your symbolic link you mentioned? I wonder if it actually does cause an impact.

It... looks like that might actually be the case. I tried again with ~/.vim/pack as a normal directory and not as a symbolic link. Now, ~/.vim/pack was second in the runtimepath after ~/.vim.

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

testing

I'm testing receipt by this group. I have problems with another
google group, so if this is received by this ML, then I could guess
that my issue is not global.

Please disregard and keep on vimin'
--
Tim
http://www.akwebsoft.com, http://www.tj49.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.

libiconv - Vim 8 - entry point not found

I just compiled the latest of Vim 8 (8.0.92).

My previous version was 8.0.46 (also compiled by my machine).

When I start it up (gvim) I get a message box:

"The procedure entry point libiconv could not be located in the dynamic link library c:\vim\vim80\libintl-8.dll"

Has something (very) recently changed around this?

Thanks,
David

--
--
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 load updated syntax files using native packages?

On Thursday, November 17, 2016 at 10:54:22 PM UTC-6, Dugan Chen wrote:
>
> If I clone it as ~/.vim/pack/me/start/python-syntax and then start vim without a .vimrc, then I get this as the output for "set rtp":
>
> runtimepath=~/.vim,/usr/share/vim/vimfiles,/usr/share/vim/vim80,/usr/share/vim/vim80/pack/dist/opt/matchit,/usr/share/vim/vim
> files/after,~/.vim/after,~/Documents/dotfiles/.vim/pack/dugan/start/python-syntax
>
> It's definitely being appended, not inserted. And needless to say, it doesn't get seen.

That's weird. I would have expected it to get inserted right after ~/.vim. Where did the "~/Documents/dotfiles" come from? Is that related to your symbolic link you mentioned? I wonder if it actually does cause an impact.

When I download the python-syntax plugin you linked to, :scriptnames shows it being sourced before the built-in syntax files for python buffers:

88: ~/vimfiles/ftplugin/python.vim
89: C:/Program Files/vim/vim74/ftplugin/python.vim
90: C:/Program Files/vim/vim74/indent/python.vim
91: ~/vimfiles/pack/test/start/python-syntax-master/syntax/python.vim
92: C:/Program Files/vim/vim74/syntax/python.vim
93: ~/vimfiles/pack/thirdparty/start/tagbar/autoload/tagbar.vim

And my 'runtimepath' option places the package files prior to the distributed files as well, just after my ~/vimfiles directory (I'm on Windows).

This reminds me, I should really pull and rebuild, apparently it's been a while.

--
--
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, November 17, 2016

Re: How to load updated syntax files using native packages?

Before you ask about the paths: ~/.vim/pack is a symbolic link. I assume that's not a problem.

--
--
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 load updated syntax files using native packages?

On Thursday, November 17, 2016 at 8:39:39 AM UTC-8, Ben Fritz wrote:

> Vim *inserts* the package directories prior to the distributed runtime files. So it *should* find your package syntax files first.

> Posting your actual 'runtimepath' may help. Also see the output of the :scriptnames command after loading your python file to see which scripts got sourced and in which order.

Well, this is what I see (vim 8.0.0081)...

One syntax plugin where I can instantly tell if it's working, is this one, because it adds highlighting to Python's "self" keyword.

https://github.com/kh3phr3n/python-syntax

If I clone it as ~/.vim/pack/me/start/python-syntax and then start vim without a .vimrc, then I get this as the output for "set rtp":

runtimepath=~/.vim,/usr/share/vim/vimfiles,/usr/share/vim/vim80,/usr/share/vim/vim80/pack/dist/opt/matchit,/usr/share/vim/vim
files/after,~/.vim/after,~/Documents/dotfiles/.vim/pack/dugan/start/python-syntax

It's definitely being appended, not inserted. And needless to say, it doesn't get seen.

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

Updated Vim 8.0 available with 69 patches

Does this include fixes for my last post: "after vim 8 installation, yanking (yy) doesn't work in global command and macros"? I couldn't see anything related on this in the history.

Bryce

--
--
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 load updated syntax files using native packages?

On Wednesday, November 16, 2016 at 11:57:57 AM UTC-6, Dugan Chen wrote:
> I've been experimenting with native packages (~/.vim/pack/me/start/{repo1,repo2}, and I've noticed that they don't seem to support plugins that include syntax files that are meant to override the ones included with vim. An example would be most of vim-polyglot.
>
> If I add a package containing an updated syntax file for, say, Python, then vim will not see the updated syntax file and will always use the one that it shipped with.
>
> What I think is happening is this. Vim starts with the directories containing its shipped syntax files in the runtime path. When it loads each package, it appends that package to the runtime path. When you load a Python file, it searches the runtime path from start to end for a Python syntax file, finds its stock syntax file first, and uses that.
>

That's not how it works, though.

Vim *inserts* the package directories prior to the distributed runtime files. So it *should* find your package syntax files first.

Are you sure vim-polyglot is actually coming after your distribution files? Are you sure you don't have a syntax file in your ~/.vim directory (which IS before the package files)? Are you sure vim-polyglot sets the appropriate flag to prevent itself from being overridden by the built-in files?

Posting your actual 'runtimepath' may help. Also see the output of the :scriptnames command after loading your python file to see which scripts got sourced and in which order.

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

Wednesday, November 16, 2016

How to load updated syntax files using native packages?

I've been experimenting with native packages (~/.vim/pack/me/start/{repo1,repo2}, and I've noticed that they don't seem to support plugins that include syntax files that are meant to override the ones included with vim. An example would be most of vim-polyglot.

If I add a package containing an updated syntax file for, say, Python, then vim will not see the updated syntax file and will always use the one that it shipped with.

What I think is happening is this. Vim starts with the directories containing its shipped syntax files in the runtime path. When it loads each package, it appends that package to the runtime path. When you load a Python file, it searches the runtime path from start to end for a Python syntax file, finds its stock syntax file first, and uses that.

How should I set up vim-polyglot if I'm using native packages?

--
--
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 z doesn't work

Le mardi 15 novembre 2016 01:03:16 UTC+1, Gary Johnson a écrit :
> On 2016-11-14, Bryan Richter wrote:
>
> > Aha, now I can agree there is room for improvement. The docs should be
> > updated to mention that z<CR> is impacted by 'scrolloff'.
> >
> > That probably should have happened a long time ago, in fact.
> >
> > I would submit a patch, but I'm not set up to be a vim contributor, and
> > I don't have the time to do so right now. Maybe someone else?
> >
> > P.S. I don't use 'scrolloff', so I do not know if there is any other
> > general solution to the mutually incompatible goals of z<CR> and
> > 'scrolloff'.
>
> I don't use 'scrolloff' either. I tried it for a short while and
> not being able to put the cursor in the offset region when I wanted
> to drove me crazy.
>
> However, I do like having some context when jumping. For example,
> when I'm searching for a pattern and I hit 'n' and the cursor jumps
> to the bottom of the window, I like having some idea of the context
> of that line, i.e., what are the following few lines. So I now have
> mappings for n, N and a few other keys so that when jumping around
> in a file using those keys, I always have at least two lines of
> context around the matched line.
>
> Here is the function and some of the mappings that use it, in case
> anyone is interested.
>
> " Leave a little space at the top or bottom of the screen for context when
> " executing 'n' or 'N'.
> "
> nnoremap <silent> n nzv:call AdjCursor()<CR>
> nnoremap <silent> N Nzv:call AdjCursor()<CR>
> function! AdjCursor()
> let l:wh = winheight(0)
> if l:wh <= 2
> return
> elseif l:wh <= 4
> let l:vmargin = 1
> else
> let l:vmargin = 2
> endif
>
> " The algorithm at the bottom of this function has a problem when the
> " match is found on a really long line that wraps many times in the
> " display. I don't know what the correct solution is, so for now we'll
> " just bail if the line wraps.
> "
> if virtcol("$") > &columns
> return
> endif
>
> " When positive, l:scrollup is the number of lines that need to be
> " scrolled up to leave l:vmargin lines between the cursor and the top of
> " the window. Similarly, when positive, l:scrolldown is the number of
> " lines that need to be scrolled down to leave l:vmargin lines between the
> " cursor and the bottom of the window.
>
> let l:scrollup = (l:vmargin + 1) - winline()
> let l:scrolldown = winline() - (l:wh - l:vmargin)
> if l:scrolldown > 0
> exe "normal ".l:scrolldown."\<C-E>"
> elseif l:scrollup > 0
> " Scrolling will have no effect when the first line of the buffer is
> " at the top of the window, but it doesn't cause an error, either, so
> " we won't test for that condition.
> exe "normal ".l:scrollup."\<C-Y>"
> endif
> endfunction
>
> It doesn't address all the cases I'd like it to, such as after an
> initial search with '/' or '?', and it has the side-effect of
> clearing the "search hit BOTTOM, continuing at TOP" message, but it
> addresses the behaviors that annoy me most. It would be nice if
> this behavior could be made part of Vim, say as a 'jumpoff' option,
> but I'm not in a good position to code that, at least not at the
> moment.
>
> Regards,
> Gary

I discovered 'scrolloff' not long ago and liked it. But I was also bothered by the z<CR> behavior.

Since I wanted the line to be really on top of window, but didn't mind if the cursor move, I use the following mapping:

:nnoremap z<CR> :exec line('.')+&scrolloff<CR>z<CR>

Works fine for me, although it doesn't work for the last lines of the buffer.

Regards,
Eric

--
--
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, November 14, 2016

Re: Command z doesn't work

On 2016-11-14, Bryan Richter wrote:

> Aha, now I can agree there is room for improvement. The docs should be
> updated to mention that z<CR> is impacted by 'scrolloff'.
>
> That probably should have happened a long time ago, in fact.
>
> I would submit a patch, but I'm not set up to be a vim contributor, and
> I don't have the time to do so right now. Maybe someone else?
>
> P.S. I don't use 'scrolloff', so I do not know if there is any other
> general solution to the mutually incompatible goals of z<CR> and
> 'scrolloff'.

I don't use 'scrolloff' either. I tried it for a short while and
not being able to put the cursor in the offset region when I wanted
to drove me crazy.

However, I do like having some context when jumping. For example,
when I'm searching for a pattern and I hit 'n' and the cursor jumps
to the bottom of the window, I like having some idea of the context
of that line, i.e., what are the following few lines. So I now have
mappings for n, N and a few other keys so that when jumping around
in a file using those keys, I always have at least two lines of
context around the matched line.

Here is the function and some of the mappings that use it, in case
anyone is interested.

" Leave a little space at the top or bottom of the screen for context when
" executing 'n' or 'N'.
"
nnoremap <silent> n nzv:call AdjCursor()<CR>
nnoremap <silent> N Nzv:call AdjCursor()<CR>
function! AdjCursor()
let l:wh = winheight(0)
if l:wh <= 2
return
elseif l:wh <= 4
let l:vmargin = 1
else
let l:vmargin = 2
endif

" The algorithm at the bottom of this function has a problem when the
" match is found on a really long line that wraps many times in the
" display. I don't know what the correct solution is, so for now we'll
" just bail if the line wraps.
"
if virtcol("$") > &columns
return
endif

" When positive, l:scrollup is the number of lines that need to be
" scrolled up to leave l:vmargin lines between the cursor and the top of
" the window. Similarly, when positive, l:scrolldown is the number of
" lines that need to be scrolled down to leave l:vmargin lines between the
" cursor and the bottom of the window.

let l:scrollup = (l:vmargin + 1) - winline()
let l:scrolldown = winline() - (l:wh - l:vmargin)
if l:scrolldown > 0
exe "normal ".l:scrolldown."\<C-E>"
elseif l:scrollup > 0
" Scrolling will have no effect when the first line of the buffer is
" at the top of the window, but it doesn't cause an error, either, so
" we won't test for that condition.
exe "normal ".l:scrollup."\<C-Y>"
endif
endfunction

It doesn't address all the cases I'd like it to, such as after an
initial search with '/' or '?', and it has the side-effect of
clearing the "search hit BOTTOM, continuing at TOP" message, but it
addresses the behaviors that annoy me most. It would be nice if
this behavior could be made part of Vim, say as a 'jumpoff' option,
but I'm not in a good position to code that, at least not at the
moment.

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.

Vim/Vi and powershell in Docker causes scrolling anomalies

Having deployed a Fedora (FC24) docker image and a separate python (python 3.2) docker image. Both experience the same problem if I connect a terminal to the image e.g. "
docker exec -it fedora bash
If I open a file say /etc/bashrc or /etc/bash.bashrc with vi or vim I and then I start to scroll down with the cursor block the cursor at random points stops scrolling and vi command line (at the bottom of the terminal) shows:
?o
If I scroll away and then back again over those lines it stops again at the same point. That point seems to vary, so there may be 3-4 locations in the file where it will stop when scrolling and all appear to be normal bash code or comments, I can't see tell what is going on. Has this behaviour been seen before?

--
--
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 z doesn't work

On Mon, Nov 14, 2016 at 01:38:11PM -0500, Cesar Romani wrote:
> On 14/11/2016 12:56 p.m., Bryan Richter wrote:
>
> > On Sat, Nov 12, 2016 at 01:22:31PM -0800, lylez wrote:
> >
> >> On Tuesday, November 8, 2016 at 9:51:05 AM UTC-8, andalou wrote:
> >>
> >>> I'm using vim 80.069 on Windows with defaults.vim enabled.
> >>>
> >>> When pressing z<CR>, the cursor line is supposed to get to top of
> >>> window, but is placed 5 lines below the top.
> >>>
> >> Folks, this is a classic example of a bug masquerading as a
> >> feature. Not only does the z-<CR> functionality not work, but I
> >> can't even move the cursor above the fifth line being displayed by
> >> pressing the k key, unless the file is scrolled all the way to the
> >> top.
> >
> > To respectfully offer the counter position, this is a feature that
> > ensures the cursor line is surrounded by lines of context whenever
> > possible.
> >
> > What has changed between vim 7 and 8 is that the maintainers have
> > switched from one point of view to the other.
> >
> > I don't see any way to reconcile the two points of view other than
> > to provide an option to allow either position. Thankfully, that is
> > already done.
> >
>
> What do you read if you do ':help z'?
> You get:
>
> --------------------
> |z<CR>| z<CR> redraw, cursor line to top of window,
> cursor on first non-blank
> --------------------
>
> Where is top of window?
> Is it five lines after the top?

Aha, now I can agree there is room for improvement. The docs should be
updated to mention that z<CR> is impacted by 'scrolloff'.

That probably should have happened a long time ago, in fact.

I would submit a patch, but I'm not set up to be a vim contributor, and
I don't have the time to do so right now. Maybe someone else?

P.S. I don't use 'scrolloff', so I do not know if there is any other
general solution to the mutually incompatible goals of z<CR> and
'scrolloff'.

--
--
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 z doesn't work

On 14/11/2016 12:56 p.m., Bryan Richter wrote:
> On Sat, Nov 12, 2016 at 01:22:31PM -0800, lylez wrote:
>> On Tuesday, November 8, 2016 at 9:51:05 AM UTC-8, andalou wrote:
>>
>>> I'm using vim 80.069 on Windows with defaults.vim enabled.
>>>
>>> When pressing z<CR>, the cursor line is supposed to get to top of
>>> window, but is placed 5 lines below the top.
>>>
>>> Many thanks in advance,
>>>
>>> -- Cesar
>>
>> Folks, this is a classic example of a bug masquerading as a
>> feature. Not only does the z-<CR> functionality not work, but I can't
>> even move the cursor above the fifth line being displayed by pressing
>> the k key, unless the file is scrolled all the way to the top.
>
> To respectfully offer the counter position, this is a feature that
> ensures the cursor line is surrounded by lines of context whenever
> possible.
>
> What has changed between vim 7 and 8 is that the maintainers have
> switched from one point of view to the other.
>
> I don't see any way to reconcile the two points of view other than to
> provide an option to allow either position. Thankfully, that is already
> done.
>

What do you read if you do ':help z'?
You get:

--------------------
|z<CR>| z<CR> redraw, cursor line to top of window,
cursor on first non-blank
--------------------

Where is top of window?
Is it five lines after the top?

--
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 z doesn't work

On Sat, Nov 12, 2016 at 01:22:31PM -0800, lylez wrote:
> On Tuesday, November 8, 2016 at 9:51:05 AM UTC-8, andalou wrote:
>
> > I'm using vim 80.069 on Windows with defaults.vim enabled.
> >
> > When pressing z<CR>, the cursor line is supposed to get to top of
> > window, but is placed 5 lines below the top.
> >
> > Many thanks in advance,
> >
> > -- Cesar
>
> Folks, this is a classic example of a bug masquerading as a
> feature. Not only does the z-<CR> functionality not work, but I can't
> even move the cursor above the fifth line being displayed by pressing
> the k key, unless the file is scrolled all the way to the top.

To respectfully offer the counter position, this is a feature that
ensures the cursor line is surrounded by lines of context whenever
possible.

What has changed between vim 7 and 8 is that the maintainers have
switched from one point of view to the other.

I don't see any way to reconcile the two points of view other than to
provide an option to allow either position. Thankfully, that is already
done.

--
--
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, November 12, 2016

Re: Command z doesn't work

Yes,I did see that, but I respectfully maintain that basic functionality should not depend upon .vimrc entries.

--
--
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 z doesn't work



On Sat, Nov 12, 2016 at 4:22 PM lylez <lyle.ziegelmiller@gmail.com> wrote:
On Tuesday, November 8, 2016 at 9:51:05 AM UTC-8, andalou wrote:
> I'm using vim 80.069 on Windows with defaults.vim enabled.
>
> When pressing z<CR>, the cursor line is supposed to get to top of
> window, but is placed 5 lines below the top.
>
> Many thanks in advance,
>
> --
> Cesar

Folks, this is a classic example of a bug masquerading as a feature. Not only does the z-<CR> functionality not work, but I can't even move the cursor above the fifth line being displayed by pressing the k key, unless the file is scrolled all the way to the top.

This is like if a car company sold a car that, every few hundred miles, suddenly lurched hard left, causing it to collide at high speed with oncoming traffic. When alerted to this, the car company responds by saying, "Oh yeah, that's the default behavior, but not to worry, all you have to do is press the stereo volume button, AC button, and radio station tuner buttons, all at the same time, and then turn the station to 99.0 FM, and the problem will be gone".

It wasn't like this in Vim 7.4, but it is in Vim 8. Please fix.

Lyle,

Did you miss the posts earlier about the 'scrolloff' option? :help scrolloff explains this option. Do you have a custom .vimrc file? :help defaults.vim (mentioned at :help scrolloff) says that if you do not have a user .vimrc, defaults.vim will be sourced and it will set the scrolloff option to 5 which explains what you are seeing. This is not a bug.

Cheers,

Ethan Alan
 

Regards

Lyle

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

--
--
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 z doesn't work

On Tuesday, November 8, 2016 at 9:51:05 AM UTC-8, andalou wrote:
> I'm using vim 80.069 on Windows with defaults.vim enabled.
>
> When pressing z<CR>, the cursor line is supposed to get to top of
> window, but is placed 5 lines below the top.
>
> Many thanks in advance,
>
> --
> Cesar

Folks, this is a classic example of a bug masquerading as a feature. Not only does the z-<CR> functionality not work, but I can't even move the cursor above the fifth line being displayed by pressing the k key, unless the file is scrolled all the way to the top.

This is like if a car company sold a car that, every few hundred miles, suddenly lurched hard left, causing it to collide at high speed with oncoming traffic. When alerted to this, the car company responds by saying, "Oh yeah, that's the default behavior, but not to worry, all you have to do is press the stereo volume button, AC button, and radio station tuner buttons, all at the same time, and then turn the station to 99.0 FM, and the problem will be gone".

It wasn't like this in Vim 7.4, but it is in Vim 8. Please fix.

Regards

Lyle

--
--
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, November 11, 2016

Re: :bdelete and :bwipeout no longer close the last buffer ([No Name])

I would like to let everyone know that this issue is closed. I found an autocmd buried in a script I had written months ago that closed Vim if the NERDTree was the last window open. That was the cause of my confusion.


--
--
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: print full file name

On Thu, Nov 10, 2016 at 11:45 PM, h_east <h.east.727@gmail.com> wrote:
>
> How about this one?
>
> :echo expand("%:p")

Thanks. That will do.

raju
--
Kamaraju S Kusumanchi | http://raju.shoutwiki.com/wiki/Blog

--
--
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, November 10, 2016

Re: print full file name

Hi Kamaraju,

2016-11-11(Fri) 13:21:46 UTC+9 kamaraju kusumanchi:
> On Thu, Nov 10, 2016 at 1:06 AM, JohnBeckett wrote:
> > On Thursday, November 10, 2016 at 4:28:05 PM UTC+11, kamaraju kusumanchi wrote:
> >> When I do <CTRL-g>, vim prints the filename as "foo" . Is it possible
> >> to print the full path of the file (ex:- /home/user/foo ) instead?
> >
> > Press 1 then Ctrl-g. It shows the user home directory as "~", but apart from that, it shows the full path.
> >
>
> Thanks. Ideally, I want the '~' to be expanded as well. But if that is
> the best we can do, I will take it. I can do it by using external
> programs such as
>
> :!realpath %
>
> But was hoping if it can be done with pure vim.

How about this one?

:echo expand("%:p")

--
Best regards,
Hirohito Higashi (a.k.a. h_east)

--
--
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: print full file name

On Thu, Nov 10, 2016 at 1:06 AM, JohnBeckett <johnb.beckett@gmail.com> wrote:
> On Thursday, November 10, 2016 at 4:28:05 PM UTC+11, kamaraju kusumanchi wrote:
>> When I do <CTRL-g>, vim prints the filename as "foo" . Is it possible
>> to print the full path of the file (ex:- /home/user/foo ) instead?
>
> Press 1 then Ctrl-g. It shows the user home directory as "~", but apart from that, it shows the full path.
>

Thanks. Ideally, I want the '~' to be expanded as well. But if that is
the best we can do, I will take it. I can do it by using external
programs such as

:!realpath %

But was hoping if it can be done with pure vim.

--
Kamaraju S Kusumanchi | http://raju.shoutwiki.com/wiki/Blog

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

Wednesday, November 9, 2016

Re: print full file name

On Thursday, November 10, 2016 at 4:28:05 PM UTC+11, kamaraju kusumanchi wrote:
> When I do <CTRL-g>, vim prints the filename as "foo" . Is it possible
> to print the full path of the file (ex:- /home/user/foo ) instead?

Press 1 then Ctrl-g. It shows the user home directory as "~", but apart from that, it shows the full path.

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.

print full file name

When I do <CTRL-g>, vim prints the filename as "foo" . Is it possible
to print the full path of the file (ex:- /home/user/foo ) instead?

thanks
raju

--
Kamaraju S Kusumanchi | http://raju.shoutwiki.com/wiki/Blog

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

:bdelete and :bwipeout no longer close the last buffer ([No Name])

I've been learning quite a lot about Vim recently. I've notice that sometimes the :bd and :bw commands will delete the last buffer and exit Vim and that sometimes they won't.

I seem to remember that running :bd or :bw upon entering Vim would delete the [No Name] buffer and exit the editor. However, lately when I try this, it fails to exit.

Is this normal? Could some specific option be causing this?

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

Tuesday, November 8, 2016

Re: default.vim getting sourced even when vimrc is present

On Tue, Nov 8, 2016 at 8:34 AM, Ken Takata <ktakata65536@gmail.com> wrote:
>
> Hi Karthick,
>
> 2016/11/7 Mon 22:24:03 UTC+9 Karthick wrote:
> > Hello all,
> >
> >
> > I just installed the 80-069 version of the MS-Windows Vim installer. I see the scrolloff option is being set to "5" due to defaults.vim getting sourced.
>
> (snip)
>
> > In my case, $VIM/_vimrc file *is* present, still defaults.vim is getting sourced.
> >
> >
> > Maybe even more strangely, defaults.vim is getting sourced even if I do a,
> >
> > :let skip_defaults_vim=1
> > In the last line of my $VIM/_vimrc file
>
> Don't you source vimrc_example.vim from your _vimrc file?
> If so it might happen, because vimrc_example.vim sources defaults.vim.
> In that case, setting skip_defaults_vim in the last line has no meaning,
> because it is already sourced.

Thanks - that was the problem. I ran scriptnames as Bram suggested and
it showed _vimrc followed by vimrc_example.vim and then defaults.vim.

I moved from Vim 7.4 to Vim 8.0 and then soon to the 80-069 version. I
see now from documentation that defaults.vim was introduced in Vim
8.0, which explains why I didn't face this problem earlier.

Just to clarify, most of the defaults work fine for me, except the
value of scrolloff. I have reverted it back to zero in my vimrc now.

--
--
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 z doesn't work

On 08/11/2016 12:57 p.m., Ben Fritz wrote:
> On Tuesday, November 8, 2016 at 11:51:05 AM UTC-6, andalou wrote:
>> I'm using vim 80.069 on Windows with defaults.vim enabled.
>>
>> When pressing z<CR>, the cursor line is supposed to get to top of
>> window, but is placed 5 lines below the top.
>>
>
> This is due to the 'scrolloff' option which defaults.vim sets, you
> will need to override it with a plugin or VimEnter command, or avoid
> sourcing defaults.vim, if you don't like the behavior.
>
> 'scrolloff' is useful for always keeping some lines of context
> above/below your cursor at the window edges.

Thanks Christian and Ben. So z<CR> depends on scrolloff. I think, this
should be indicated on :help z.

Best regards,

--
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: Mapping to search for current line

> In your first attempt, <ctrl-r> should be <C-r>. See :help key-notation.

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 z doesn't work

On Tuesday, November 8, 2016 at 11:51:05 AM UTC-6, andalou wrote:
> I'm using vim 80.069 on Windows with defaults.vim enabled.
>
> When pressing z<CR>, the cursor line is supposed to get to top of
> window, but is placed 5 lines below the top.
>

This is due to the 'scrolloff' option which defaults.vim sets, you will need to override it with a plugin or VimEnter command, or avoid sourcing defaults.vim, if you don't like the behavior.

'scrolloff' is useful for always keeping some lines of context above/below your cursor at the window edges.

--
--
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 z doesn't work

Hi Cesar!

On Di, 08 Nov 2016, Cesar Romani wrote:

> I'm using vim 80.069 on Windows with defaults.vim enabled.
>
> When pressing z<CR>, the cursor line is supposed to get to top of
> window, but is placed 5 lines below the top.

:h 'scrolloff'

Best,
Christian
--
Stilblüten aus Schreiben von Versicherungsnehmern:
Als ich an die Kreuzung kam, erhob sich ein Zaun, um meine freie Sicht
zu hindern.

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

Command z doesn't work

I'm using vim 80.069 on Windows with defaults.vim enabled.

When pressing z<CR>, the cursor line is supposed to get to top of
window, but is placed 5 lines below the top.

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: What is the blank char in my file?

Am 2016-11-08 13:55, schrieb A. S. Budden:

> Ah, yes, good point - whoops! I was thinking of "ga", which I think
> you can use in this situation as it shows a four-digit hex value that
> can then be used with \%u.

Shameless self-plug:
Or you can use my plugin https://github.com/chrisbra/unicode.vim
Put cursor on the character and enter :UnicodeName
(You can even directly store the regex for that character in the search
register.
Something like this :UnicodeName / regex and then keep on pressing 'n'
to jump
to the next occurence).

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

---
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: What is the blank char in my file?

On 8 November 2016 at 12:44, Tony Mechelynck
<antoine.mechelynck@gmail.com> wrote:
> On Tue, Nov 8, 2016 at 1:22 PM, A. S. Budden <abudden@gmail.com> wrote:
>>> On 1 November 2016 at 17:00, 李哲 <imlegendlzz@gmail.com> wrote:
>>>> As the pic say~
>>>>
>>>> I find a blank char in my file but I can't match it by \s+, I want to delete it, what should I do?
>> On 8 November 2016 at 10:01, Yongwei Wu <wuyongwei@gmail.com> wrote:
>>> Put the cursor over the character and type "g8".
>>>
>>> :help g8
>>>
>>> 8 Print the hex values of the bytes used in the
>>> character under the cursor, assuming it is in |UTF-8|
>>> encoding. This also shows composing characters. The
>>> value of 'maxcombine' doesn't matter.
>>> Example of a character with two composing characters:
>>> e0 b8 81 + e0 b8 b9 + e0 b9 89 ~
>>> {not in Vi} {only when compiled with the |+multi_byte|
>>> feature}
>>
>> The above is probably the best way to find out what it is; if you want
>> to delete all instances of it, one way that has worked for me in the
>> past is:
>>
>> * Put the cursor on the character
>> * Press y<space> to "yank" it into the unnamed register
>> * Type :%s/<C-R>"//g (where <C-R>" means press Ctrl & R together and
>> then press shift-2 or whatever combination on your keyboard gives a
>> double-quote) - this pulls the unnamed register content into the
>> command line
>>
>> You can also use the output of g8 with:
>>
>> %s/\%uXXXX//g (where XXXX is the hex code shown by g8) - see :help \%u
>> for more info
>>
>> Al
>
> For %u you need the Unicode codepoint (the hex part of the output of
> ga) not the individual byte values (as shown by g8). They are
> different for every codepoint above U+007F, and if it were ASCII (i.e.
> lower than U+0080) the OP wouldn't asking "What is that strange blank
> character?"

Ah, yes, good point - whoops! I was thinking of "ga", which I think
you can use in this situation as it shows a four-digit hex value that
can then be used with \%u.

Al

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