Thursday, August 31, 2017

Re: Sorry to use the `e' word but does vim have similar to cperl

>I think UltiSnips can do what you want: https://github.com/sirver/UltiSnips .
>There are similar alternative to it as well.

I recently abandoned snippet plugins for leader mappings and now wonder how I ever justified entire plugins in the first place. In my case, after/ftplugin/c.vim, for example, has a total of eight mappings and two abbreviations. I do not feel short-changed.

nnoremap <leader>s iswitch ()<CR>{<CR>case :<CR>break;<CR><BS>case :<CR>break;<CR><BS>case :<CR>break;<CR><BS><BS>}<ESC>8k/:<CR>02kf(a

How to Do 90% of What Plugins Do (With Just Vim)
https://www.youtube.com/watch?v=XA2WjJbmmoM&t=2300s

--
--
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: Splits and resizing

On 08/31/2017 07:33 AM, Robert wrote:
> I almost always do a vertical split to the left of my main window. I would like the main window I started with not to resize when the split is added (widening the window to accommodate the split) and when closing the split I am back to the original window size.

Are you talking about terminal and / or GUI?

It sounds like you're talking about GUI and wanting the vim window to
widen to accommodate the new split.



--
Grant. . . .
unix || die

--
--
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: vim74 cannot see selected line number in ubuntu desktop

On Wednesday, August 30, 2017 at 7:25:03 PM UTC-5, Sand Glass wrote:
> I use vim74, In windows, or redhat,I can see current cursor (row,column) number and selected lines number in right-bottom default.
> But I only can see current cursor (row,column) number in ubuntu, how can I see the selected lines number?

Someone already suggested the statusline option.

If you only have one window open, by default no status line (where the other information is usually shown) is displayed. The 'laststatus' option controls this, set it to 2 to always display it.

--
--
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: vim74 cannot see selected line number in ubuntu desktop

I have something similar which shows as a construct of my statusline.

help statusline
especially the values vV c lL P

The relevant part of mine includes:

col:%c%V\ lin:%l\/%L\ %P

which shows like this:   col:5 lin:10/20 50%
meaning column 5, line 10 of 20, 50% file lines.

On Thu, Aug 31, 2017 at 10:46 AM, Sand Glass <youngluoyang@gmail.com> wrote:
On Thursday, August 31, 2017 at 9:30:28 PM UTC+8, Pete wrote:
> Hi,
>
> Did you mean :set showcmd ?
>
> --
> Gua Chung Lim
>
> If you desire knowledges, learn one thing everyday.
> If you desire wisdom, leave one thing everyday.
>
> -- Lao Tzu
>
> * Sand Glass (youngluoyang@gmail.com) wrote:
> > I use vim74, In windows? or redhat?I can see current cursor (row,column) number and selected lines number in right-bottom default.
> > But I only can see current cursor (row,column) number in ubuntu, how can I see the selected lines number?
> >
> > --
> > --
> > 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.

not showcmd.

--
--
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: vim74 cannot see selected line number in ubuntu desktop

On Thursday, August 31, 2017 at 9:30:28 PM UTC+8, Pete wrote:
> Hi,
>
> Did you mean :set showcmd ?
>
> --
> Gua Chung Lim
>
> If you desire knowledges, learn one thing everyday.
> If you desire wisdom, leave one thing everyday.
>
> -- Lao Tzu
>
> * Sand Glass (youngluoyang@gmail.com) wrote:
> > I use vim74, In windows? or redhat?I can see current cursor (row,column) number and selected lines number in right-bottom default.
> > But I only can see current cursor (row,column) number in ubuntu, how can I see the selected lines number?
> >
> > --
> > --
> > 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.

not showcmd.

--
--
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: Splits and resizing

On Thu, 31 Aug 2017 06:33:29 -0700 (PDT)
Robert <sigzero@gmail.com> wrote:

> I almost always do a vertical split to the left of my main window. I
> would like the main window I started with not to resize when the
> split is added (widening the window to accommodate the split) and
> when closing the split I am back to the original window size.
>
> Help?
>
> Bob
>

I set up some key maps to change the size and position. After you
change the width, you can split.


" --------------------------------------
" keymap to change window position & size
" <C-M-S> single width
" <C-M-D> double width
" <C-M-W> wider than single
noremap <C-M-S> :set lines=60 columns=100<CR>:winpos 500 0<CR>
noremap <C-M-D> :set lines=60 columns=201<CR>:winpos 100 0<CR>
noremap <C-M-W> :set lines=60 columns=151<CR>:winpos 250 0<CR>


--
Don't stop where the ink does.

Shawn H Corey

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

Splits and resizing

I almost always do a vertical split to the left of my main window. I would like the main window I started with not to resize when the split is added (widening the window to accommodate the split) and when closing the split I am back to the original window size.

Help?

Bob

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

---
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: vim74 cannot see selected line number in ubuntu desktop

Hi,

Did you mean :set showcmd ?

--
Gua Chung Lim

If you desire knowledges, learn one thing everyday.
If you desire wisdom, leave one thing everyday.

-- Lao Tzu

* Sand Glass (youngluoyang@gmail.com) wrote:
> I use vim74, In windows? or redhat?I can see current cursor (row,column) number and selected lines number in right-bottom default.
> But I only can see current cursor (row,column) number in ubuntu, how can I see the selected lines number?
>
> --
> --
> 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.

Wednesday, August 30, 2017

vim74 cannot see selected line number in ubuntu desktop

I use vim74, In windows, or redhat,I can see current cursor (row,column) number and selected lines number in right-bottom default.
But I only can see current cursor (row,column) number in ubuntu, how can I see the selected lines number?

--
--
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: Does the ".cl" extension have any special meaning to vim?

On Tue, 29 Aug 2017 18:17:16 -0700
Barry Gold <barrydgold@ca.rr.com> wrote:

> I've seen ".cl" used a few times for PHP classes, but I'm not sure
> how common it is outside the place I worked in the 2000s.

.cl would be Common Lisp https://en.wikipedia.org/wiki/Common_Lisp


--
Don't stop where the ink does.

Shawn H Corey

--
--
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: Does the ".cl" extension have any special meaning to vim?

On 8/29/2017 11:45 PM, Christian Brabandt wrote:
> Try using putting explicitly `:filetype off` into your .vimrc and see if
> that helps.
>
> Other than that, you can of course run vim as a vi compatible version
> using `vim -u NONE` or running it as `vi` should usually also get you a
> close enough approximation of the original vi.

Thanks, that did it!

--
On Beta, we'd have earrings for that. You could buy them in any jewelry store.
http://www.conchord.org/xeno/bdgsig.html

--
--
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, August 29, 2017

Re: Does the ".cl" extension have any special meaning to vim?

On Di, 29 Aug 2017, Barry Gold wrote:

> On 8/28/2017 11:40 PM, Christian Brabandt wrote:
> >On Mo, 28 Aug 2017, Barry Gold wrote:
> >
> >>What does vim think an extension of ".cl" means?
> >:verbose set filetype?
> >
> >according to $VIMRUNTIME/filetype.vim .cl extensions seems to suggest
> >common lisp files. So Vim sets the lisp filetype.
> >
> >Now you didn't answer the question in the other thread you created, so
> >let me ask you again, is .cl a common php file extensions?
>
> I've seen ".cl" used a few times for PHP classes, but I'm not sure how
> common it is outside the place I worked in the 2000s.
>
> Let's try a different approach.
>
> Is there something I can set that tells vim "forget 'improved', just behave
> like the 4.2bsd version of vi" (or any other "classic" vi).
>
> Not that I'm against the improvements, I'm especially fond of the fact that
> when you edit a file you've edited before, it starts at the current line
> from the last time, even if a long time ago. I also like the fact that vim
> will detect if you previously edited this file and the session ended without
> closing the vi (e.g., power failure or system crash) and gives you options
> to "restore" "edit anyway" "read only" etc.
>
> But if I can just use it as a simple text editor without getting lost in its
> guesses about my file type, I'm willing to give that up and just use it like
> plain old vi that I've used since 1976.

Try using putting explicitly `:filetype off` into your .vimrc and see if
that helps.

Other than that, you can of course run vim as a vi compatible version
using `vim -u NONE` or running it as `vi` should usually also get you a
close enough approximation of the original vi.

Best,
Christian
--
Sagt eine Dame 'Nein', so bedeutet das 'Vielleicht'; sagt sie
'Vielleicht', dann denkt sie dabei 'Ja', sagt sie 'Ja' - ist sie keine
Dame.
-- Charles Maurice de Talleyrand

--
--
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: Does the ".cl" extension have any special meaning to vim?

On 8/28/2017 11:40 PM, Christian Brabandt wrote:
> On Mo, 28 Aug 2017, Barry Gold wrote:
>
>> What does vim think an extension of ".cl" means?
> :verbose set filetype?
>
> according to $VIMRUNTIME/filetype.vim .cl extensions seems to suggest
> common lisp files. So Vim sets the lisp filetype.
>
> Now you didn't answer the question in the other thread you created, so
> let me ask you again, is .cl a common php file extensions?

I've seen ".cl" used a few times for PHP classes, but I'm not sure how
common it is outside the place I worked in the 2000s.

Let's try a different approach.

Is there something I can set that tells vim "forget 'improved', just
behave like the 4.2bsd version of vi" (or any other "classic" vi).

Not that I'm against the improvements, I'm especially fond of the fact
that when you edit a file you've edited before, it starts at the current
line from the last time, even if a long time ago. I also like the fact
that vim will detect if you previously edited this file and the session
ended without closing the vi (e.g., power failure or system crash) and
gives you options to "restore" "edit anyway" "read only" etc.

But if I can just use it as a simple text editor without getting lost in
its guesses about my file type, I'm willing to give that up and just use
it like plain old vi that I've used since 1976.

--
On Beta, we'd have earrings for that. You could buy them in any jewelry store.
http://www.conchord.org/xeno/bdgsig.html

--
--
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: Controlling the display of a syntax highlighting group

One more addendum:

In the external file, I changed the line:

highlight NONASCII ctermbg=13

to:

highlight NONASCII ctermbg=13 guibg=Magenta

so that the command would work in gvim as well as 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.

Re: Evoking the option for :help in a mapping

On Monday, August 28, 2017 at 1:32:32 PM UTC-7, Tony Mechelynck wrote:
> On Mon, Aug 28, 2017 at 7:02 PM, Graham Lawrence <gl00637@gmail.com> wrote:
> > I have the customary mappings for :help,
> >
> > nmap <F1> :exec "help " . expand("<cword>")<CR>
> > nmap <S-F1> :exec "help " . expand("<cWORD>")<CR>
> >
> > and have been trying to develop similar do the <Tab> option on the cursor
> > word, something like
> >
> > nmap \\ yiw:h ^R"^[
> >
> > but to no avail. Although the mapping does not terminate with a <CR>, vim
> > treats the ^[ as if it were <CR> rather than <Tab> and goes straight to the
> > specific help for the cursor-word.
> >
> > Is it possible to have vim act on the <Tab> as it does in the command line?
> >
> > --
> > Graham Lawrence
>
> See :help 'wildcharm'
>
> For instance:
>
> if has('wildmenu')
> set wildmenu wildmode=longest:full,full wildcharm=<C-Z>
> map <F1> <expr> ':help ' . expand('cword') . "\<C-Z>"
> map <S-F1> <expr> ':help ' . expand('cWORD') . "\<C-Z>"
> endif
>
> See also
> :help map-<expr>
> :help expr-quote
>
> Best regards,
> Tony.


Thank you both, Andy and Tony, for referring me to wildcharm/wildmenu. Just the ticket.

--
--
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: Controlling the display of a syntax highlighting group

I wrote:

> [P.S.:  I originally sent this to <vim@vim.org> which is the address listed
> on the official Vim mailing list page, but it never showed up.  Is that still
> valid, or must vim_use@googlegroups.com now be used?]


As you can see above, after a long delay (3 days), the original message
(duplicte)to vim@vim.org did eventually get posted.

--
--
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: Controlling the display of a syntax highlighting group


I previously asked how I could set up a toggle for syntax highlighting
of non-ASCII characters.  I was having problems clearing a
highlighting group and then never being able to reactivate it.

Ben Fritz suggested using the matchadd()/matchdelete() functions
for the job. That looks like a good idea and would probably be cleaner
than what I did, but I solved the problem another way before seeing his comments.

Tony Mechelynck suggested using some functions (see above).
I tried these and they exhibit the same problem I was finding:  they
work exactly once and then not again.  There is some strange
interaction happening with the highlight group that I have not yet been able to identify.

I did manage to resolve the problem and integrate it into other syntax highlighting with some work.  Here is my solution.


First, I assigned a command to the L9 key that would toggle basic
syntax highlighting on/off:

" L9 Key                                       [Toggle syntax hilight on/off]
nnoremap  <Esc>[55~ :if exists("g:syntax_on") <Bar>
                                   \     syntax off <Bar>
                                   \     endif <Bar>
                                   \ else <Bar>
                                   \     syntax enable <Bar>
                                   \ endif<CR><CR>


Next, I assigned the shifted L9 key a command to toggle non-ASCII highlighting on/off.  The trick here was to clear the syntax but NOT
the highlighting group.

" L9 (Shifted)                             [Toggle nonascii highlighting]
nnoremap  <Esc>[55;2~ :source /u/jeff/lib/vi/vimrc.nonascii<CR>

Where the vimrc.nonascii file contains:

if (nonascii == "on")
    syntax clear NONASCII
    let nonascii = "off"
else
    syntax match NONASCII "[^\x00-\x7F]"
    highlight NONASCII ctermbg=13
    let nonascii = "on"
endif


Now you ask, why is this in an external file rather than directly
mapped as in the previous case.  Well, I tried that and found that
while it sort of worked, not only did all non-ASCII characters get
highlighted, but so did all white space (space and tabs) between
them!  This does not happen when the command is read from the
external file.  [I'd be happy to hear any ideas as to why that is
happening and what to do about it!]

OK so far.  However, if non-ASCII highlighting was active and syntax
highlighting was toggled, it forced the non-ASCII highlight off too and
left the "nonascii" variable in the wrong state.

I wanted these to operate independently, so I modified the previous
L9 Key mapping as follows, to force non-ASCII highlight back on if
it was currently on.

" L9 Key                                       [Toggle syntax hilight on/off]
nnoremap  <Esc>[55~ :if exists("g:syntax_on") <Bar>
                   \     syntax off <Bar>
                   \     if (nonascii == "on") <Bar>
                   \         let nonascii = "off" <Bar>
                   \         :source /u/jeff/lib/vi/vimrc.nonascii <Bar>
                   \     endif <Bar>
                   \ else <Bar>
                   \     syntax enable <Bar>
                   \     if (nonascii == "on") <Bar>
                   \         let nonascii = "off" <Bar>
                   \         :source /u/jeff/lib/vi/vimrc.nonascii <Bar>
                   \     endif <Bar>
                   \ endif<CR><CR>

Why two <CR> are required here is another minor mystery.  It's
probably because of the :source command which gobbles one
<CR> leaving the second for the overall command.  However,
adding a <CR> to the end of the :source lines and removing one
from the end does not work!

I hope someone finds this instructive.  Continue the discussion if
there are more insights as to what is going on with these perceived
glitches I was experiencing.

Much thanks to Ben and Tony for their very helpful feedback.  I
learned a few things and got pushed in the right direction.

--
--
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 set background color for vim terminal

On 16:15 Mon 28 Aug , Bram Moolenaar wrote:
>
> Lifepillar wrote:
>
> > On 28/08/2017 00:13, Bram Moolenaar wrote:
> > >
> > > Marcin Szamotulski wrote:
> > >
> > >> I was looking how to set up background color for the `:termainal` (on
> > >> linux). I cannot find proper documentation on how to adjust libvterm.
> > >
> > > The program you run in the terminal can change the background.
> > > Otherwise the same background as Vim is used.
> > >
> > > Note that on Mac it appears to be impossible to set the background color
> > > to white. That's a problem with Terminal.app.
> >
> > In both Terminal.app and iTerm2 with notermguicolors, the terminal
> > background is set to Vim's background, as you say. Not all of the 256
> > colors look right, though. Attached you find a screenshot: the
> > colorscheme is Solarized 8, although the particular colorscheme should
> > not matter. See how a few of the 256 colors are out of place, and also
> > a shade of gray is wrong. Of the system colors, Normal White (color 7)
> > and Bright Black (color 8) are grey instead of Solarized white
> > (#EEE8D5) and Solarized black (#333344), respectively. Note that this
> > is what I see also in iTerm2, so this does not appear to be
> > a terminal-specific problem (or, both terminals have the same issue).
>
> Color 7 is supposed to be grey, but color 15 is supposed to be white.
> You can try this with:
> :hi Normal ctermbg=15
>
> Has nothing to do with the terminal feature. This is with t_Co set to
> 256, which should be correct for Terminal.app.
>
> > In iTerm2 with termguicolors, the terminal does not seem to inherit
> > the colorscheme's colors, but it appears to always use default colors
> > (the 256 color palette looks right in this case). In particular, the
> > background is always white or black, depending on the value of
> > 'background' at the moment the terminal is started. See the other two
> > attachments. This is also what I see in MacVim.
> >
> > Finally, I have tried NeoVim's terminal for comparison, and colors
> > appear to look right under all circumstances. So, it is definitely not
> > "impossible" to correctly set all the 16 system colors (but, maybe,
> > NeoVim is doing something hackish?).

I can confirm that with the guitermcolors option indeed the only
background colour I see is black or white.

Best regards,
Marcin

--
--
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: Does the ".cl" extension have any special meaning to vim?

On Di, 29 Aug 2017, Barry Gold wrote:

>
> On 8/28/2017 11:40 PM, Christian Brabandt wrote:
> >On Mo, 28 Aug 2017, Barry Gold wrote:
> >
> >>What does vim think an extension of ".cl" means?
> >:verbose set filetype?
> >
> >according to $VIMRUNTIME/filetype.vim .cl extensions seems to suggest
> >common lisp files. So Vim sets the lisp filetype.
> >
> >Now you didn't answer the question in the other thread you created, so
> >let me ask you again, is .cl a common php file extensions? If yes, we
> >might need to tweak filetype.vim to detect this, if not, please go with
> >the suggestions from the mentioned faq articles.
>
> I went to the faq articles, which is why I added noloadplugins to my .vimrc
> file.

But you don't want to disable loading plugins altogether, but rather
apply settings to a particular filetype/extension, right?
So you should rather go with those articles:
https://vimhelp.appspot.com/vim_faq.txt.html#faq-26.6
https://vimhelp.appspot.com/vim_faq.txt.html#faq-26.8

Please also check the links to the documentation in Vim.

Best,
Christian
--
Hundert graue Pferde machen nicht einen einzigen Schimmel.
-- Goethe, Maximen und Reflektionen, Nr. 1019

--
--
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: Does the ".cl" extension have any special meaning to vim?


On 8/28/2017 11:40 PM, Christian Brabandt wrote:
On Mo, 28 Aug 2017, Barry Gold wrote:    
What does vim think an extension of ".cl" means?  
:verbose set filetype?    according to $VIMRUNTIME/filetype.vim .cl extensions seems to suggest   common lisp files. So Vim sets the lisp filetype.    Now you didn't answer the question in the other thread you created, so   let me ask you again, is .cl a common php file extensions? If yes, we   might need to tweak filetype.vim to detect this, if not, please go with   the suggestions from the mentioned faq articles.

I went to the faq articles, which is why I added noloadplugins to my .vimrc file.


--   On Beta, we'd have earrings for that. You could buy them in any jewelry store.  http://www.conchord.org/xeno/bdgsig.html

Monday, August 28, 2017

Re: Does the ".cl" extension have any special meaning to vim?

On Mo, 28 Aug 2017, Barry Gold wrote:

> What does vim think an extension of ".cl" means?

:verbose set filetype?

according to $VIMRUNTIME/filetype.vim .cl extensions seems to suggest
common lisp files. So Vim sets the lisp filetype.

Now you didn't answer the question in the other thread you created, so
let me ask you again, is .cl a common php file extensions? If yes, we
might need to tweak filetype.vim to detect this, if not, please go with
the suggestions from the mentioned faq articles.

Best,
Christian
--
Liegt der Bauer unterm Tisch, war das Essen nimmer frisch.

--
--
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: .cl file type?

On Mo, 28 Aug 2017, Barry Gold wrote:

> I have set noloadplugins, but I'm still getting the same strange
> behavior. I guess I should just use a different extension.

I am not sure what you are trying to say here and you didn't really go
into any of the suggested solutions.

Best,
Christian
--
Mittlerweise besteht das Internet zu 90% aus Homepage-Inhabern, die
andere Homepage-Inhaber besuchen, um beruhigt festzustellen, daß die
anderen auch keine Ahnung haben.
-- Lindemann, se0088@aixrs1.hrz.uni-essen.de in de.comm.internet.software

--
--
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: .cl file type?

On Sunday, August 27, 2017 at 11:59:54 PM UTC-7, Christian Brabandt wrote:
> On So, 27 Aug 2017, Barry Gold wrote:
>
> > What does vim think an extension of ".cl" means?
> >
> > I've been writing a program that will take a list of input HTML files (some
> > written using an editor like vim, some generated by MS Word) and convert
> > them to legal (and reasonably clean) XHTML. The program is written in PHP,
> > and I've been following the convention of putting each class in a separate
> > file. So I have one top-level file (an "executable" using the #!
> > convention), a few "include" files with the extension ".inc", and my classes
> > in files with the extension ".cl".
> >
> > But when I try editing the .cl files with vim, auto-formatting doesn't work.
> > I have autoindent set, but every new line starts in column 1, regardless of
> > the indention of the previous line. Also linewrapping doesn't work (set
> > fo+=tcroqj)
> >
> > I had various ideas of what was wrong, and I think I have eliminated all the
> > others. But as far as I can see, vim does what I expect *unless* the
> > extension is ".cl". In a file named *.cl, autoformatting just doesn't work.
> > Period.
> >
> > What's up with the .cl extension? Is there a way to get .vim to treat it
> > like .php? Or should I just live with it and change my naming convention to
> > match whatever assumptions are built into .vim?
> >
> > Btw, this occurs in the vim that is downloaded with cygwin
> > VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jan 27 2017 13:34:58)
> >
> > and also when I right click on a file and choose "Edit with Vim".
>
> Your php files have probably special settings in the corresponding
> filetype plugins. And possibly, if you enabled indent plugins, there
> exists special logic there as well. If you want to have your .cl files
> be handled like php files, check e.g. the faq:
> https://vimhelp.appspot.com/vim_faq.txt.html#faq-26
> (there are several questions in the 26 block, that might be of interest
> to you). And follow the links to the documentation in Vim.
>
> Also, if .cl is kind of a official extensions for Vim, we might need to
> extend our logic to detect php like files.
>
> Best,
> Christian

I have set noloadplugins, but I'm still getting the same strange behavior. I guess I should just use a different extension.

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

Does the ".cl" extension have any special meaning to vim?

What does vim think an extension of ".cl" means?

I've been writing a program that will take a list of input HTML files (some written using an editor like vim, some generated by MS Word) and convert them to legal (and reasonably clean) XHTML. The program is written in PHP, and I've been following the convention of putting each class in a separate file. So I have one top-level file (an "executable" using the #! convention), a few "include" files with the extension ".inc", and my classes in files with the extension ".cl".

But when I try editing the .cl files with vim, auto-formatting doesn't work. I have autoindent set, but every new line starts in column 1, regardless of the indention of the previous line. Also linewrapping doesn't work (set fo+=tcroqj)

I had various ideas of what was wrong, and I think I have eliminated all the others. But as far as I can see, vim does what I expect *unless* the extension is ".cl". In a file named *.cl, autoformatting just doesn't work. Period.

What's up with the .cl extension? Is there a way to get .vim to treat it like .php? Or should I just live with it and change my naming convention to match whatever assumptions are built into .vim?

Btw, this occurs in the vim that is downloaded with cygwin
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jan 27 2017 13:34:58)

and also when I right click on a file and choose "Edit with Vim".

Here is my .vimrc file, FWIW:
~ % cat .vimrc
set autoindent
set nohls
syntax off
set tw=72
set ws
set ic
set ts=8
set sw=4
map :n
map :w
map
:e # :w
map v k$hjl
map q F r
map g f r
map = 3k$h3jl
map @ k$hjl
map gx ,
unmap gx
set background=light
set ff=unix
let loaded_matchparen=1
set fo+=tcroqj

--
On Beta, we'd have earrings for that. You could buy them in any jewelry store.
http://www.conchord.org/xeno/bdgsig.html

--
--
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: Controlling the display of a syntax highlighting group

On Monday, August 28, 2017 at 8:52:16 PM UTC-5, cjsmall wrote:
> To find non-ascii characters in a file, I have defined the following:
>
>
>     syntax match nonascii "[^\x00-\x7F]"
>     highlight nonascii ctermbg=13
>
>
>
> I can disable this with the command:
>
>
>     syntax off
>
>
> I would like to create a command that toggles this highlight group on/off and
> hopefully do so without affecting the current state of the remainder of the
> syntax highlight groups. 

I suggest using the matchadd()/matchdelete() functions for this purpose, unless there is a specific reason you need to use syntax matching. Those are more "temporary" and easy to toggle.

--
--
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: Controlling the display of a syntax highlighting group

On Tue, Aug 29, 2017 at 3:51 AM, Jeffery Small <jefferysmall@gmail.com> wrote:
> To find non-ascii characters in a file, I have defined the following:
>
> syntax match nonascii "[^\x00-\x7F]"
> highlight nonascii ctermbg=13
>
> I can disable this with the command:
>
> syntax off
>
> I would like to create a command that toggles this highlight group on/off
> and
> hopefully do so without affecting the current state of the remainder of the
> syntax highlight groups. I have not found a way to test the state of this
> group, and once activated, I cannot seem to clear or edit the highlight
> definition non-destructively.
>
> Any pointers?

Try the following (untested):

function ASCII_on()
syn match NonAscii "[^\x00-\x7F]"
hi clear NonAscii
hi NonAscii term=reverse ctermbg=Magenta guibg=Magenta
endfunction
function ASCII_off()
syn clear NonAscii
hi clear NonAscii
endfunction
function ASCII_toggle()
if hlexists('NonAscii')
call ASCII_off()
else
call ASCII_on()
endif
endfunction
map <F12> :call ASCII_toggle()<CR>
imap <F12> <C-O>:call ASCII_toggle()<CR>
" but Select mode would use the Normal-mode mapping
" and replace the selection — we don't want that
sunmap <F12>

>
> [P.S.: I originally sent this to <vim@vim.org> which is the address listed
> on the official Vim mailing list page, but it never showed up. Is that
> still
> valid, or must vim_use@googlegroups.com now be used?]

I think that vim@vim.org is still acceptable, but I'm not sure: it
used to be a robot on a computer somewhere in an out-of-the-way place
in the Math faculty of some German university (Uni-Erlangen IIRC), and
no one knew anymore how to fix anything that went wrong with it. IMHO
the Google Group is more reliable.

Best regards,
Tony.

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

Controlling the display of a syntax highlighting group

To find non-ascii characters in a file, I have defined the following:

    syntax match nonascii "[^\x00-\x7F]"
    highlight nonascii ctermbg=13

I can disable this with the command:

    syntax off

I would like to create a command that toggles this highlight group on/off and
hopefully do so without affecting the current state of the remainder of the
syntax highlight groups.  I have not found a way to test the state of this
group, and once activated, I cannot seem to clear or edit the highlight
definition non-destructively.

Any pointers?

[P.S.:  I originally sent this to <vim@vim.org> which is the address listed
on the official Vim mailing list page, but it never showed up.  Is that still
valid, or must vim_use@googlegroups.com now be used?]

--
--
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: Evoking the option for :help in a mapping

On Mon, Aug 28, 2017 at 7:02 PM, Graham Lawrence <gl00637@gmail.com> wrote:
> I have the customary mappings for :help,
>
> nmap <F1> :exec "help " . expand("<cword>")<CR>
> nmap <S-F1> :exec "help " . expand("<cWORD>")<CR>
>
> and have been trying to develop similar do the <Tab> option on the cursor
> word, something like
>
> nmap \\ yiw:h ^R"^[
>
> but to no avail. Although the mapping does not terminate with a <CR>, vim
> treats the ^[ as if it were <CR> rather than <Tab> and goes straight to the
> specific help for the cursor-word.
>
> Is it possible to have vim act on the <Tab> as it does in the command line?
>
> --
> Graham Lawrence

See :help 'wildcharm'

For instance:

if has('wildmenu')
set wildmenu wildmode=longest:full,full wildcharm=<C-Z>
map <F1> <expr> ':help ' . expand('cword') . "\<C-Z>"
map <S-F1> <expr> ':help ' . expand('cWORD') . "\<C-Z>"
endif

See also
:help map-<expr>
:help expr-quote

Best regards,
Tony.

--
--
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 copy/paste in terminal on Windows

Hi forum,

I'm using gvim on Windows, checking the new :terminal feature.
How can I copy/paste text inside the terminal window? The usual DOS way of marking with the mouse and right-clicking does not seem to work. The only way I found is going to Terminal-Normal mode with CTRL-W N , yanking the text with vim commands, returning to Terminal-Job mode and pasting with CTRL-W "". Is there a better, easier, way?

Thanks,
-- Massimo

--
--
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: Evoking the option for :help in a mapping

Am 28.08.2017 um 19:02 schrieb Graham Lawrence:
> I have the customary mappings for :help,
>
> nmap <F1> :exec "help " . expand("<cword>")<CR>
> nmap <S-F1> :exec "help " . expand("<cWORD>")<CR>
>
> and have been trying to develop similar do the <Tab> option on the cursor
> word, something like
>
> nmap \\ yiw:h ^R"^[

But ^[ means Escape, not Tab,
and Escape, when used in a mapping, works like Enter (usually):
:h c_Esc

So you want <Tab> (right?) which looks more like ^I, but anyway in a mapping you can't use <Tab>,
instead you need to use the key defined with
:h 'wildcharm
(:set wcm=<C-_> works for me).

> but to no avail. Although the mapping does not terminate with a <CR>, vim
> treats the ^[ as if it were <CR> rather than <Tab> and goes straight to the
> specific help for the cursor-word.
>
> Is it possible to have vim act on the <Tab> as it does in the command line?

Your mapping becomes (with above 'wcm' setting):
:nnoremap \\ yiw:h <C-R>"<C-_>

or
:nnoremap \\ :<C-U>h <C-R><C-W><C-_>

or (I think I'd use)
:nnoremap <Leader><Tab> :<C-U>h <C-R><C-W><C-_>

--
Andy

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

---
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: vim opening *.html files in readonly mode (and yes, the file does NOT have readonly attribute set)

On Mon, Aug 28, 2017 at 6:18 PM, hackware <hackware@gmail.com> wrote:
> Over the years, I've installed many .vim files to customize vim for various uses/projects...
>
> After upgrading to winbloz-10 and vim to 7.4, I get errors in the LH vim lib, and editing any .html file will open in readonly mode.
>
> Could I get some pointers on tracing vim script execution, and/or the readonly problem?
>
> thanx...
>
> william...

Vim 7.4 is already somewhat out-of-date. Vim 8.0 was released on
12-Sep-2016, and since then it has seen more than a thousand
enhancements and bugfixes. Have you tried it?

I am on Linux64, and I've never had the case of HTML files opening in
readonly mode, except of course when using "view", or when the file
either had the readonly attribute, or was on a readonly medium such as
a CD-ROM.

Have you got "user" or "sysadmin" customizations, setting readonly
when an HTML file is opened? Try the following:

1. Start Vim or gvim (not view or gview) with an HTML file located on
your hard disk, and neither in a readonly directory nor with the
readonly attribute set on the file itself.
2. That file being the current editfile, type

:verbose setlocal readonly? modifiable?

followed by <Enter>. The answer should tell you not only how these two
options are set on the file, but where they were set. The question
marks are important here, because without them you would be setting
these Boolean options to TRUE rather than asking how they are
currently set.


Best regards,
Tony.

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

Evoking the option for :help in a mapping

I have the customary mappings for :help,

    nmap <F1> :exec "help " . expand("<cword>")<CR>
    nmap <S-F1> :exec "help " . expand("<cWORD>")<CR>

and have been trying to develop similar do the <Tab> option on the cursor word, something like

    nmap \\ yiw:h ^R"^[

but to no avail.  Although the mapping does not terminate with a <CR>, vim treats the ^[ as if it were <CR> rather than <Tab> and goes straight to the specific help for the cursor-word.

Is it possible to have vim act on the <Tab> as it does in the command line?

--
Graham Lawrence

--
--
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: vim opening *.html files in readonly mode (and yes, the file does NOT have readonly attribute set)

On Mon, Aug 28, 2017 at 12:18 PM, hackware <hackware@gmail.com> wrote:
Over the years, I've installed many .vim files to customize vim for various uses/projects...

After upgrading to winbloz-10 and vim to 7.4, I get errors in the LH vim lib, and editing any .html file will open in readonly mode.

Could I get some pointers on tracing vim script execution, and/or the readonly problem?

thanx...

william...

:help debug-scripts
:verbose set readonly?

HTH
-- 
Benji Fisher

--
--
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 opening *.html files in readonly mode (and yes, the file does NOT have readonly attribute set)

Over the years, I've installed many .vim files to customize vim for various uses/projects...

After upgrading to winbloz-10 and vim to 7.4, I get errors in the LH vim lib, and editing any .html file will open in readonly mode.

Could I get some pointers on tracing vim script execution, and/or the readonly problem?

thanx...

william...

--
--
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 set background color for vim terminal

Lifepillar wrote:

> On 28/08/2017 00:13, Bram Moolenaar wrote:
> >
> > Marcin Szamotulski wrote:
> >
> >> I was looking how to set up background color for the `:termainal` (on
> >> linux). I cannot find proper documentation on how to adjust libvterm.
> >
> > The program you run in the terminal can change the background.
> > Otherwise the same background as Vim is used.
> >
> > Note that on Mac it appears to be impossible to set the background color
> > to white. That's a problem with Terminal.app.
>
> In both Terminal.app and iTerm2 with notermguicolors, the terminal
> background is set to Vim's background, as you say. Not all of the 256
> colors look right, though. Attached you find a screenshot: the
> colorscheme is Solarized 8, although the particular colorscheme should
> not matter. See how a few of the 256 colors are out of place, and also
> a shade of gray is wrong. Of the system colors, Normal White (color 7)
> and Bright Black (color 8) are grey instead of Solarized white
> (#EEE8D5) and Solarized black (#333344), respectively. Note that this
> is what I see also in iTerm2, so this does not appear to be
> a terminal-specific problem (or, both terminals have the same issue).

Color 7 is supposed to be grey, but color 15 is supposed to be white.
You can try this with:
:hi Normal ctermbg=15

Has nothing to do with the terminal feature. This is with t_Co set to
256, which should be correct for Terminal.app.

> In iTerm2 with termguicolors, the terminal does not seem to inherit
> the colorscheme's colors, but it appears to always use default colors
> (the 256 color palette looks right in this case). In particular, the
> background is always white or black, depending on the value of
> 'background' at the moment the terminal is started. See the other two
> attachments. This is also what I see in MacVim.
>
> Finally, I have tried NeoVim's terminal for comparison, and colors
> appear to look right under all circumstances. So, it is definitely not
> "impossible" to correctly set all the 16 system colors (but, maybe,
> NeoVim is doing something hackish?).


--
In many of the more relaxed civilizations on the Outer Eastern Rim of the
Galaxy, "The Hitchhiker's Guide to the Galaxy" has already supplanted the
great "Encyclopedia Galactica" as the standard repository of all knowledge
and wisdom, for though it has many omissions and contains much that is
apocryphal, or at least wildly inaccurate, it scores over the older, more
pedestrian work in two important respects.
First, it is slightly cheaper; and second, it has the words "DON'T PANIC"
inscribed in large friendly letters on its cover.
-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

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

Problem with :argdo and :vimgrep on latest Windows build

I'm using VIM 8.0.586 on Windows 10. Recently, I've experienced strange and unexpected behavior when using ":argdo" and ":vimgrep".

When I use either of these commands, the text being operated on or searched seems to "fly by" on the screen. This is almost as if VIM is playing out the operations for me as the text is scanned. This is certainly new behavior.

I checked and made sure that "lazyredraw" was set. What could be the issue?

--
--
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 set background color for vim terminal

On 10:24 Mon 28 Aug , Lifepillar wrote:
> On 28/08/2017 00:13, Bram Moolenaar wrote:
> >
> > Marcin Szamotulski wrote:
> >
> >> I was looking how to set up background color for the `:termainal` (on
> >> linux). I cannot find proper documentation on how to adjust libvterm.
> >
> > The program you run in the terminal can change the background.
> > Otherwise the same background as Vim is used.
> >
> > Note that on Mac it appears to be impossible to set the background color
> > to white. That's a problem with Terminal.app.
>
> In both Terminal.app and iTerm2 with notermguicolors, the terminal
> background is set to Vim's background, as you say. Not all of the 256
> colors look right, though. Attached you find a screenshot: the
> colorscheme is Solarized 8, although the particular colorscheme should
> not matter. See how a few of the 256 colors are out of place, and also
> a shade of gray is wrong. Of the system colors, Normal White (color 7)
> and Bright Black (color 8) are grey instead of Solarized white
> (#EEE8D5) and Solarized black (#333344), respectively. Note that this
> is what I see also in iTerm2, so this does not appear to be
> a terminal-specific problem (or, both terminals have the same issue).
>
> In iTerm2 with termguicolors, the terminal does not seem to inherit
> the colorscheme's colors, but it appears to always use default colors
> (the 256 color palette looks right in this case). In particular, the
> background is always white or black, depending on the value of
> 'background' at the moment the terminal is started. See the other two
> attachments. This is also what I see in MacVim.
>
> Finally, I have tried NeoVim's terminal for comparison, and colors
> appear to look right under all circumstances. So, it is definitely not
> "impossible" to correctly set all the 16 system colors (but, maybe,
> NeoVim is doing something hackish?).
>
> Life.
>
> --
> --
> 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.

I am on Linux though. And I can set background background through bash or
zsh escape sequences but that's not very reliable. When using ls or man
it will break in one way or the other (ls will often show patches of the
original background color, man will just use the default terminal
background color). When running an xterm I just use the `-bg` flag
which works perfectly fine (or just set up things in .Xresources file).
Is there a such a way with libvterm?

I see very similar behaviour that Lifepillar has. The background is
white or black rather than what is in `:hi Normal`.

Best regards,
Marcin

--
--
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 set background color for vim terminal

On 28/08/2017 00:13, Bram Moolenaar wrote:
>
> Marcin Szamotulski wrote:
>
>> I was looking how to set up background color for the `:termainal` (on
>> linux). I cannot find proper documentation on how to adjust libvterm.
>
> The program you run in the terminal can change the background.
> Otherwise the same background as Vim is used.
>
> Note that on Mac it appears to be impossible to set the background color
> to white. That's a problem with Terminal.app.

In both Terminal.app and iTerm2 with notermguicolors, the terminal
background is set to Vim's background, as you say. Not all of the 256
colors look right, though. Attached you find a screenshot: the
colorscheme is Solarized 8, although the particular colorscheme should
not matter. See how a few of the 256 colors are out of place, and also
a shade of gray is wrong. Of the system colors, Normal White (color 7)
and Bright Black (color 8) are grey instead of Solarized white
(#EEE8D5) and Solarized black (#333344), respectively. Note that this
is what I see also in iTerm2, so this does not appear to be
a terminal-specific problem (or, both terminals have the same issue).

In iTerm2 with termguicolors, the terminal does not seem to inherit
the colorscheme's colors, but it appears to always use default colors
(the 256 color palette looks right in this case). In particular, the
background is always white or black, depending on the value of
'background' at the moment the terminal is started. See the other two
attachments. This is also what I see in MacVim.

Finally, I have tried NeoVim's terminal for comparison, and colors
appear to look right under all circumstances. So, it is definitely not
"impossible" to correctly set all the 16 system colors (but, maybe,
NeoVim is doing something hackish?).

Life.

--
--
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, August 27, 2017

Re: .cl file type?

On So, 27 Aug 2017, Barry Gold wrote:

> What does vim think an extension of ".cl" means?
>
> I've been writing a program that will take a list of input HTML files (some
> written using an editor like vim, some generated by MS Word) and convert
> them to legal (and reasonably clean) XHTML. The program is written in PHP,
> and I've been following the convention of putting each class in a separate
> file. So I have one top-level file (an "executable" using the #!
> convention), a few "include" files with the extension ".inc", and my classes
> in files with the extension ".cl".
>
> But when I try editing the .cl files with vim, auto-formatting doesn't work.
> I have autoindent set, but every new line starts in column 1, regardless of
> the indention of the previous line. Also linewrapping doesn't work (set
> fo+=tcroqj)
>
> I had various ideas of what was wrong, and I think I have eliminated all the
> others. But as far as I can see, vim does what I expect *unless* the
> extension is ".cl". In a file named *.cl, autoformatting just doesn't work.
> Period.
>
> What's up with the .cl extension? Is there a way to get .vim to treat it
> like .php? Or should I just live with it and change my naming convention to
> match whatever assumptions are built into .vim?
>
> Btw, this occurs in the vim that is downloaded with cygwin
> VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jan 27 2017 13:34:58)
>
> and also when I right click on a file and choose "Edit with Vim".

Your php files have probably special settings in the corresponding
filetype plugins. And possibly, if you enabled indent plugins, there
exists special logic there as well. If you want to have your .cl files
be handled like php files, check e.g. the faq:
https://vimhelp.appspot.com/vim_faq.txt.html#faq-26
(there are several questions in the 26 block, that might be of interest
to you). And follow the links to the documentation in Vim.

Also, if .cl is kind of a official extensions for Vim, we might need to
extend our logic to detect php like files.

Best,
Christian
--
Es ist komisch, daß kein Mensch mit Esprit ein Glück möchte, das auf
Dummheit gegründet ist, und doch ist es klar, daß man dabei einen
guten Tausch machen würde.
-- François Marie Voltaire

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

.cl file type?

What does vim think an extension of ".cl" means?

I've been writing a program that will take a list of input HTML files
(some written using an editor like vim, some generated by MS Word) and
convert them to legal (and reasonably clean) XHTML. The program is
written in PHP, and I've been following the convention of putting each
class in a separate file. So I have one top-level file (an "executable"
using the #! convention), a few "include" files with the extension
".inc", and my classes in files with the extension ".cl".

But when I try editing the .cl files with vim, auto-formatting doesn't
work. I have autoindent set, but every new line starts in column 1,
regardless of the indention of the previous line. Also linewrapping
doesn't work (set fo+=tcroqj)

I had various ideas of what was wrong, and I think I have eliminated all
the others. But as far as I can see, vim does what I expect *unless* the
extension is ".cl". In a file named *.cl, autoformatting just doesn't
work. Period.

What's up with the .cl extension? Is there a way to get .vim to treat it
like .php? Or should I just live with it and change my naming convention
to match whatever assumptions are built into .vim?

Btw, this occurs in the vim that is downloaded with cygwin
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jan 27 2017 13:34:58)

and also when I right click on a file and choose "Edit with Vim".

Here is my .vimrc file, FWIW:
~ % cat .vimrc
set autoindent
set nohls
syntax off
set tw=72
set ws
set ic
set ts=8
set sw=4
map :n
map :w
map
:e # :w
map v k$hjl
map q F r
map g f r
map = 3k$h3jl
map @ k$hjl
map gx ,
unmap gx
set background=light
set ff=unix
let loaded_matchparen=1
set fo+=tcroqj

--
On Beta, we'd have earrings for that. You could buy them in any jewelry store.
http://www.conchord.org/xeno/bdgsig.html

--
--
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 set background color for vim terminal

Marcin Szamotulski wrote:

> I was looking how to set up background color for the `:termainal` (on
> linux). I cannot find proper documentation on how to adjust libvterm.

The program you run in the terminal can change the background.
Otherwise the same background as Vim is used.

Note that on Mac it appears to be impossible to set the background color
to white. That's a problem with Terminal.app.

--
How To Keep A Healthy Level Of Insanity:
18. When leaving the zoo, start running towards the parking lot,
yelling "run for your lives, they're loose!!"

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

how to set background color for vim terminal

Hi Vim_Use,

I was looking how to set up background color for the `:termainal` (on
linux). I cannot find proper documentation on how to adjust libvterm.

Best regards,
Marcin Szamotulski

--
--
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: Can I write an abbreviation that only works at the beginning of the line?

On Sun, Aug 27, Jose Caballero wrote:
>Let's say, and this is not my real need but a very clear example, I
>want to write an abbreviation that converts, when writing python code:
>
>class
>
>into
>
>class (object):
>
>But I only want that to works when string "class" is being printed at
>the beginning of a line.
>I don't want the replacement to happen when I am writing the docstring
>like "This is a class that does this and that".
>
>Is it possible?

You can use something like this

iabbrev <expr> class getline('.') ==# 'class' ? 'class (object):' : 'class'

The key moment here is "<expr>". The expression

getline('.') ==# 'class' ? 'class (object):' : 'class'

will be evaluated to obtain replacement string. You can make it more
accurate by comparison only with the part before the cursor position.

-Dmitri

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

Can I write an abbreviation that only works at the beginning of the line?

Hi,

I am asking here because I am not sure myself how to google it.
I tried with something similar to the subject of this email, but no
luck. That, or I didn't actually understand what I found.

Let's say, and this is not my real need but a very clear example, I
want to write an abbreviation that converts, when writing python code:

class

into

class (object):

But I only want that to works when string "class" is being printed at
the beginning of a line.
I don't want the replacement to happen when I am writing the docstring
like "This is a class that does this and that".

Is it possible?

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

Controlling the display of a syntax highlighting group

To find non-ascii characters in a file, I have defined the following:

    syntax match nonascii "[^\x00-\x7F]"
    highlight nonascii ctermbg=13

I can disable this with the command:

    syntax off

I would like to create a command that toggles this highlight group on/off and
hopefully do so without affecting the current state of the remainder of the
syntax highlight groups.  I have not found a way to test the state of this
group, and once activated, I cannot seem to clear or edit the highlight
definition non-destructively.

Any pointers?

Thanks,
--
Jeff

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

---
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, August 26, 2017

Re: Sorry to use the `e' word but does vim have similar to cperl

On 26/08/2017 03:30, Harry Putnam wrote:
> Any one here familiar with emacs cperl mode, that can tell me how to
> get something similar when using vim?
>
> If not familiar, `cperl-mode' trys to offer a host of short cuts that insert
> quite a bit of standard code for you... a simple example is; if you
> type `if<spc>' `cperl-mode' inserts:
>
> if (_) {
> }
>
> With the underscore indicating where the cursor is left.
>
> I vaguely remember using something with vim, years ago, that did
> something similar, but no longer remember how to load that sort of
> thing.

If you want to use a built-in feature, you may use abbreviations (`:help
abbreviations`). In the simplest form:

iab <buffer> if if () {<cr>}<c-o>2gE

You may want to put this in ~/.vim/after/ftplugin/perl.vim to make it
filetype-specific.

The above also inserts the space you type after `if`. You most likely
won't wanto that. You may type if<c-]> to expand the snippet without
inserting a space, or use the `Eatchar()` function described in Vim's
help.

If the cases in which you do *not* want `if` to be expanded, you may
type if<c-v><spc> to insert a literal space. Alternatively, give the
snippet a different name, like `if…` (… is <alt>-. in my keyboard).

Enjoy,
Life.


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