Thursday, June 16, 2022

Re: Cursors

Dominique wrote:

> Bram Moolenaar wrote:
>
> > > Why cursor shape in terminal neovim can change but in vim not? Maybe
> > > something different in here.
> >
> > It very much depends on the terminal. Neovim assumes a very recent
> > terminal, it won't work everywhere. It may mess up on some terminals.
> >
> > What I use myself:
> >
> > " Change the cursor color and shape depending on the mode.
> > if &term =~ "xterm" && $SSH_CLIENT == ''
> > let &t_SI = "\<Esc>]12;purple\x7" . "\<Esc>[5 q"
> > try
> > let &t_SR = "\<Esc>]12;darkred\x7" . "\<Esc>[3 q"
> > catch
> > endtry
> > let &t_EI = "\<Esc>]12;royalblue2\x7" . "\<Esc>[2 q"
> > endif
>
> I use something along those lines too.
> But why the try/catch? I don't have it and did not notice issues.
> Doing :help termcap-cursor-shape also shows how to set colored
> cursor, but that help entry does not have the try / catch either.
> Perhaps it should be added there if it solves something.

If I remember correctly, I wrote this around the time that t_SR was
added. Using an older Vim version would throw an error. It's not
generally useful, unless you might use an old Vim version occasionally.

[Agree with no good terminal found for Mac, but I don't have one now]


--
The chat program is in public domain. This is not the GNU public license.
If it breaks then you get to keep both pieces.
-- Copyright notice for the chat program

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20220616092040.8FD8F1C2341%40moolenaar.net.

No comments: