Code Monkey home page Code Monkey logo

vim-togglecursor's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

vim-togglecursor's Issues

Mouse appears to be used after Vim exits when running under tmux

Recently I find that after exiting Vim, my mouse is still a pointer instead of the I beam, indicating that the program inside the terminal is controlling the mouse.

Uninstalling this plugin things are back to normal. My tmux is version 2.8 and I only notice this recently. My Vim is the latest and my terminal is xfce4-terminal.

Thank you so much!

After trying all the random configuration snippets floating around the internet this plugin just worked™.

Thank you for making and releasing it 😄

Cursor shape Vim+Tmux

Hi,
I'm using your plugin with Vim (Version 8.0) in Gnome TrueColor terminal and it works fine.
Under Tmux (version 2.6 since today!) however, the behaviour is not correct:

  • On opening a file in Vim, the cursor is a static vertical beam
  • On entering Insert Mode : the vertical beam blinks once, then become static again
  • On returning to Normal mode : a block shape blinks once, then vertical static beam again
  • On entering Replace Mode (R) : underline cursor blinks once, then vertical static beam
    So, it seems the correct shape cannot remain active.
    Do you know of a possible solution for this ?
    Thanks

Doc update - works in MacOS Sierra Terminal now

Hi,

Just noting that since upgrading to MacOS 10.12 Sierra vim-togglecursor now works fine in version 2.7 of the default mac Terminal application, at least in neovim. I haven't tested in vanilla vim.

image

Thanks!

pangoterm supported

Hi,

Can we add pangoterm to the terminal checks as it supports the feature.

Ta

Warning about $NVIM_TUI_ENABLE_CURSOR_SHAPE with latest version of nvim

health#nvim#check
========================================================================
## Configuration
  - WARNING: $NVIM_TUI_ENABLE_CURSOR_SHAPE is ignored in Nvim 0.2+
    - ADVICE:
      - Use the 'guicursor' option to configure cursor shape. :help 'guicursor'
      - https://github.com/neovim/neovim/wiki/Following-HEAD#20170402```

Not working inside Vagrant

What ?

My VIM is inside a vagrant (virtual box) with linux OS having VIM 8.0.134
The cursor is not changing when I change the modes in it.

Possible Issues

I think since this plugin depends on what type of terminal it is, it mightn't be able to detect it.

Other observations

  • Outside the box I have VIM 7.3 & this plugin works perfectly in it.
  • Inside the virtual box I have neovim with which this works as expected.

The plugin does not work with xterm and rxvt-unicode under tmux.

Hi

I just checked with vim:

guake does nothing (OK - the old libvte)
guake with tmux does nothing (Ok too)

konsole - works
konsole under tmux - works

urxvt (rxvt-unicode 9.21) - works
urxvt under tmux does not work (nothing happens).

xterm (297 version) works
xterm under tmux does not work.

I believe that your plugin checks for $KONSOLE_DBUS_SESSION but it does not check for the real terminal emulator under a tmux session. I do not know is it possible at all. Quick search on google didn't help.

Plugin not working when using GNU's screen

Hi,
I'm quite new with vim and programming but this plugin is very helpful.
The problem is that when I use GNU's screen - it doesn't work. Maybe you have a solution?
Thanks!
AsaF

GNU Screen Support

I'm using Konsole on Kubuntu with GNU Screen and this plugin doesn't seem to work with it. I know the documentation mentions issues with Tmux, so I was wondering if the same issue exists in Screen.

Should I just switch to Tmux or do you think this issue is solvable in Screen?

PS: Great job on the plugin. Really digging it.

Plugin in Alacritty doesnt work

As by default only, this plugin doenst cause any effects on vim running in Alacritty.

I've changed vim rc to include the 'togglecursor_force' variable, and still nothing comes out.


if match($TERM, 'xterm') == 0
     let g:togglecursor_force = 'xterm'
endif

I couldn't find much support in general google search. I would appretiate if someone else could help me out.
My $TERM variable currently is xterm-256colors

Overwrites existing values of t_SI, t_EI

vim-togglecursor overwites t_SI and t_EI preventing other settings from being applied (i.e. as shown in https://coderwall.com/p/if9mda/automatically-set-paste-mode-in-vim-when-pasting-in-insert-mode).

Patch to allow additional, external settings to be supplied as option variables:

From 41e441f9d9305448b5cf48421f6b5b723b287a26 Mon Sep 17 00:00:00 2001
From: James Goodall
Date: Fri, 6 Aug 2021 13:58:47 -0700
Subject: [PATCH] Allow existing values of t_SI, t_EI to be preserved

---
 plugin/togglecursor.vim | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/plugin/togglecursor.vim b/plugin/togglecursor.vim
index 07cbdfb..8824642 100644
--- a/plugin/togglecursor.vim
+++ b/plugin/togglecursor.vim
@@ -136,6 +136,14 @@ if !exists("g:togglecursor_disable_tmux")
     let g:togglecursor_disable_tmux = 0
 endif
 
+if !exists("g:togglecursor_t_SI_external")
+    let g:togglecursor_t_SI_external = ''
+endif
+
+if !exists("g:togglecursor_t_EI_external")
+    let g:togglecursor_t_SI_external = ''
+endif
+
 " -------------------------------------------------------------
 " Functions
 " -------------------------------------------------------------
@@ -173,8 +181,8 @@ function! s:ToggleCursorInit()
         return
     endif
 
-    let &t_EI = s:GetEscapeCode(g:togglecursor_default)
-    let &t_SI = s:GetEscapeCode(g:togglecursor_insert)
+    let &t_EI = s:GetEscapeCode(g:togglecursor_default) . g:togglecursor_t_EI_external
+    let &t_SI = g:togglecursor_t_SI_external . s:GetEscapeCode(g:togglecursor_insert)
     if s:sr_supported
         let &t_SR = s:GetEscapeCode(g:togglecursor_replace)
     endif
@@ -189,10 +197,10 @@ endfunction
 
 function! s:ToggleCursorByMode()
     if v:insertmode == 'r' || v:insertmode == 'v'
-        let &t_SI = s:GetEscapeCode(g:togglecursor_replace)
+        let &t_SI = g:togglecursor_t_SI_external . s:GetEscapeCode(g:togglecursor_insert)
     else
         " Default to the insert mode cursor.
-        let &t_SI = s:GetEscapeCode(g:togglecursor_insert)
+        let &t_SI = g:togglecursor_t_SI_external . s:GetEscapeCode(g:togglecursor_insert)
     endif
 endfunction
 
-- 
1.8.3.1

Restore cursor on VimLeave event

First of all, thanks a lot for the plugin! It works great so far.
Until now I defined the shapes manually in my .vimrc, but this plugin comes in handy.

I found out recently when using

autocmd VimLeave * let &t_me="\<Esc>]50;CursorShape=1\x7"

I can revert the cursor to its initial shape before entering vim.
Would be great to see this in your plugin.

Cheers

Using backspace causes flicker when in insert mode.

Using backspace in insert mode causes flicker, see the gif:

animation

$ echo $TERM
screen-256color
$ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov  1 2014 20:27:42)
MacOS X (unix) version
Included patches: 1-488
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl             +farsi           +mouse_netterm   +syntax
+arabic          +file_in_path    +mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
-balloon_eval    +float           +mouse_urxvt     -tag_any_white
-browse          +folding         +mouse_xterm     -tcl
++builtin_terms  -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         -gettext         -mzscheme        +textobjects
-clientserver    -hangul_input    +netbeans_intg   +title
+clipboard       +iconv           +path_extra      -toolbar
+cmdline_compl   +insert_expand   +perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    +keymap          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       +python          +viminfo
+cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con      -lua             +rightleft       +windows
+diff            +menu            +ruby            +writebackup
+digraphs        +mksession       +scrollbind      -X11
-dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     -xim
+emacs_tags      -mouseshape      -sniff           -xsmp
+eval            +mouse_dec       +startuptime     -xterm_clipboard
+ex_extra        -mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop    -xpm
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: /usr/bin/clang -c -I. -Iproto -DHAVE_CONFIG_H   -F/usr/local/Frameworks -DMACOS_X_UNIX  -Os -w -pipe -march=native -mmacosx-version-min=10.10 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
Linking: /usr/bin/clang   -L. -L/Users/jottr/.rbenv/versions/2.0.0-p247/lib  -fstack-protector -L/usr/local/lib -L/usr/local/lib -F/usr/local/Frameworks -Wl,-headerpad_max_install_names -o vim        -lm  -lncurses -liconv -framework Cocoa   -fstack-protector  -L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE -lperl -framework Python   -lruby-static -lobjc -L/Users/jottr/.rbenv/versions/2.0.0-p247/lib   

Restore Cursor When WinLeave Occurs

I noticed that whilst in Insert mode and switching to another pane in tmux that my cursor didn't preserve its normal block state. I'm opening this issue to gauge interest in a patch that'd fix this.

Fontsize reset upon cursor/mode change, on Konsole 16.08.0

First of all thanks for this great plugin.
On urxvt I don't encounter this problem, however on Konsole, whenever I change the font size (using Ctrl- Or Ctrl+), the font size is reset whenever the cursor changes.
My config is simple:

let g:togglecursor_default = "block"
let g:togglecursor_insert  = "line"
let g:togglecursor_leave   = "block"
let g:togglecursor_replace = "underline"

Any idea? Thanks again!

Mouse appears in insert mode when running under tmux

I'm using gnome-terminal inside tmux (I ended up manually setting s:supported_terminal to 'xterm') and when I enter insert mode my mouse cursor appears as the text cursor changes to a vertical bar. When I return to normal mode and begin to navigate, my mouse cursor disappears. When using vim I would prefer my mouse to remain hidden at all times unless I move it, so this is a bit distracting. Why is it appearing and how can I keep it hidden?

[Bug] Vim cursor sometimes (always?) disappears on Vim startup when opening a file

For some reasons my cursor keeps disappearing if I open a file in Vim (using vim /path/to/file command) inside gnome-terminal with tmux and powerline. When I change my mouse focus from gnome-terminal to another window (I am using Vim under terminal), OR replace vim-togglecursor with this snippet of Vimscript inside my .vimrc:

" Toggle cursor between block and ibeam shape in different modes (Insert,
" Normal, Visual, Replace. Also make them blink.
function! ToggleCursorByMode()
    if exists('$TMUX')
        if v:insertmode == 'r' || v:insertmode == 'v'
            let &t_SI = "\<Esc>Ptmux;\<Esc>\e[3 q\<Esc>\\"
        else
            let &t_SI = "\<Esc>Ptmux;\<Esc>\e[5 q\<Esc>\\"
        endif

        let &t_EI = "\<Esc>Ptmux;\<Esc>\e[0 q\<Esc>\\"

    else
        if v:insertmode == 'r' || v:insertmode == 'v'
            let &t_SI = "\e[3 q"
        else
            let &t_SI = "\e[5 q"
        endif

        let &t_EI = "\e[0 q"
    endif
endfunction

call ToggleCursorByMode()

augroup AutoCursor
    autocmd InsertEnter * :call ToggleCursorByMode()
autogroup END

Everything was working as expected. Without the above snippet of codes, sometimes even during cursor moving in Normal mode, my cursor disapearred and I had to move the mouse focus to another window beside gnome-terminal again and then move back.

I believe there is currently a problem of autocmd VimEnter * statement in plugin/togglecursor.vim unable to load <SID>ToggleCursorInit() at Vim startup, because as long as I replaced vim-togglecursor with the above code, OR tried to move focus to another window (which triggered FocusGained & FocusLost), the cursor started working again. So I guess you may want to add an autocmd BufWinEnter * OR invoking ToggleCursorInit() outside of autocmd (so it will be run when Vim sources the .vimrc file).

Here is my version information:
OS: Arch Linux
Shell: zsh 5.0.8
Multiplexor: tmux 2.0
Vim: VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jul 11 2015 08:44:54)
Included patches: 1-778
GNOME: Version 3.16.2

Wrong cursor in 'r' mode

Hi,
When quitting Insert Mode with ESC and hitting 'r' to replace one character, the cursor is rendered as a vertical line, not an underline.
Thanks for this plugin.

nvim issue when using xfce4-terminal

xfce4-terminal doesn't support DECSCUSR.
Even so, the plugin seems to think it does.
Entering insert mode in nvim I get this: -- INSERT --�[5 q

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.