vim - 如何在自制软件的 vim 中启用 mouseshape?

标签 vim mouse-cursor

我正在使用带有基于终端的 vim(不是 gvim)的鼠标以及 set mouse=a

我想更改鼠标光标形状,但自制 vim 中未启用 mouseshape。如何使用自制软件安装支持 mouseshape 的 vim?

这是我的 vim --version 输出的一部分:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jul  8 2016 21:15:30)
MacOS X (unix) version
Included patches: 1-2000
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl             +file_in_path    -mouse_sysmouse  -tag_any_white
+arabic          +find_in_path    +mouse_urxvt     -tcl
+autocmd         +float           +mouse_xterm     +termguicolors
-balloon_eval    +folding         +multi_byte      +terminfo
-browse          -footer          +multi_lang      +termresponse
++builtin_terms  +fork()          -mzscheme        +textobjects
+byte_offset     -gettext         +netbeans_intg   +timers
+channel         -hangul_input    +num64           +title
+cindent         +iconv           +packages        -toolbar
-clientserver    +insert_expand   +path_extra      +user_commands
+clipboard       +job             +perl            +vertsplit
+cmdline_compl   +jumplist        +persistent_undo +virtualedit
+cmdline_hist    +keymap          +postscript      +visual
+cmdline_info    +langmap         +printer         +visualextra
+comments        +libcall         +profile         +viminfo
+conceal         +linebreak       -python          +vreplace
+cryptv          +lispindent      +python3         +wildignore
+cscope          +listcmds        +quickfix        +wildmenu
+cursorbind      +localmap        +reltime         +windows
+cursorshape     +lua             +rightleft       +writebackup
+dialog_con      +menu            +ruby            -X11
+diff            +mksession       +scrollbind      -xfontset
+digraphs        +modify_fname    +signs           -xim
-dnd             +mouse           +smartindent     -xsmp
-ebcdic          -mouseshape      +startuptime     -xterm_clipboard
+emacs_tags      +mouse_dec       +statusline      -xterm_save
+eval            -mouse_gpm       -sun_workshop    -xpm
+ex_extra        -mouse_jsbterm   +syntax          
+extra_search    +mouse_netterm   +tag_binary      
+farsi           +mouse_sgr       +tag_old_static  

最佳答案

这是不可能的。 mouseshape 功能仅在 Windows 或 X11 版本中可用,如文档中所暗示的,其中讨论了哪些形状在哪些模式下可用。只有 Win32 和 X11 出现在该列表中。

鼠标模式处于事件状态时,鼠标光标确实会在终端 Vim 中改变形状,但您无法按照您询问的方式控制每个模式。

来自 :help 'mouseshape:

The shape is one of the following:
avail   name            looks like
w x     arrow           Normal mouse pointer
w x     blank           no pointer at all (use with care!)
w x     beam            I-beam
w x     updown          up-down sizing arrows
w x     leftright       left-right sizing arrows
w x     busy            The system's usual busy pointer
w x     no              The system's usual 'no input' pointer
  x     udsizing        indicates up-down resizing
  x     lrsizing        indicates left-right resizing
  x     crosshair       like a big thin +
  x     hand1           black hand
  x     hand2           white hand
  x     pencil          what you write with
  x     question        big ?
  x     rightup-arrow   arrow pointing right-up
w x     up-arrow        arrow pointing up
  x     <number>        any X11 pointer number (see X11/cursorfont.h)

The "avail" column contains a 'w' if the shape is available for Win32,
x for X11.

Any modes not specified or shapes not available use the normal mouse
pointer.

关于vim - 如何在自制软件的 vim 中启用 mouseshape?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38277361/

相关文章:

德尔福。反转光标颜色

linux - 用于嵌入式 Linux 的 Qt : Hide cursor on startup

c# - 从 C# 应用程序在空闲时隐藏系统范围内的鼠标,在移动时显示

objective-c - 检测光标是否在 Mac OS X 上隐藏

vim - 映射到 vimrc 中的 XF86 键

vim - 是否可以将外部命令的输出传递给 `:tabnew` ?

ubuntu - 当我处于插入模式时,Vim 没有 `--INSERT--`?

search - 如何在 vi 搜索和替换中包含正斜杠

c - 综合C配置文件

javascript - 如何使弹出窗口出现在我的鼠标进入悬停目标的位置?