fzf.vim
fzf.vim copied to clipboard
cursor shape changed from underscore to block in iTerm2
- [x] I have fzf 0.30.0 or above
- [x] I have read through https://github.com/junegunn/fzf.vim/blob/master/README.md
- [x] I have read through https://github.com/junegunn/fzf/blob/master/README-VIM.md
- [x] I have read through the manual page of fzf (
man fzf
) - [x] I have searched through the existing issues
I'm using specific cursor shape settings in my vimrc
if $TERM_PROGRAM =~ "iTerm"
let &t_SI = "\<Esc>]50;CursorShape=4\x7" " INSERT MODE : solid underscore
let &t_SR = "\<Esc>]50;CursorShape=2\x7" " REPLACE MODE : solid block
let &t_EI = "\<Esc>]50;CursorShape=3\x7" " NORMAL MODE : blinking underscore
else
let &t_SI .= "\e[4 q" " SI = INSERT mode
let &t_SR .= "\e[4 q" " SR = REPLACE mode
let &t_EI .= "\e[3 q" " EI = NORMAL mode (ELSE)
endif
it should be the underscore normally. However it changed automatically to block after fzf.vim commands ( i.e.: :Files
). What's interesting is cursor shape back normal when press r
( why ? ).
Exact same result by using self-build vim and latest release vim from macvim-dev/macvim details:
I've checked with a minimal configuration, there's no abnormal since &t_SI
, &t_EI
and &t_SR
are all unset:
here are detail info:
fzf and fzf.vim
- fzf:
$ fzf --version 0.44.1 (brew)
- fzf.vim:
$ git -C ~/.vim/plugged/fzf.vim/ show -s commit 1e054c1d075d87903647db9320116d360eb8b024 (HEAD -> master, origin/master, origin/HEAD) Author: Junegunn Choi <[email protected]> Date: Fri Oct 27 11:43:42 2023 +0900 [History] Fix error when there are no entries Fix #1512
vimrc
set runtimepath+=/usr/local/opt/fzf
Plug '/usr/local/opt/fzf'
Plug 'junegunn/fzf.vim'
" junegunn/fzf.vim
nnoremap <C-p> :Files<CR>
nnoremap <C-g> :GFiles<CR>
nnoremap <C-s> :Ag<CR>
nnoremap <silent><leader>l :Buffers<CR>
nnoremap <silent> <Leader>H :Helptags<CR>
nnoremap <silent> <Leader>g :Commits<CR>
inoremap <expr> <c-x><c-l> fzf#vim#complete(fzf#wrap({
\ 'prefix': '^.*$',
\ 'source': 'rg -n ^ --color always',
\ 'options': '--ansi --delimiter : --nth 3..',
\ 'reducer': { lines -> join(split(lines[0], ':\zs')[2:], '') }
\ }))
let g:fzf_vim = {}
let g:fzf_vim.preview_window = [ 'right,50%', 'ctrl-\' ]
let g:fzf_vim.tags_command = 'ctags -R'
let g:fzf_vim.commits_log_options = '--graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr"'
command! -bang -nargs=? -complete=dir Files
\ call fzf#vim#files(<q-args>, {'options': ['--layout=reverse', '--info=inline', '--preview', 'bat --color=always {}']}, <bang>0)
command! -bang -complete=dir -nargs=? LS
\ call fzf#run(fzf#wrap('ls', {'source': 'ls', 'dir': <q-args>}, <bang>0))
let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6, 'relative': v:true } }
let g:fzf_history_dir = '~/.vim/cache/fzf-history'
let g:fzf_action = {
\ 'ctrl-t': 'tab split',
\ 'ctrl-x': 'split',
\ 'ctrl-v': 'vsplit'
\ }
let g:fzf_colors = {
\ 'fg': ['fg', 'Normal' ] ,
\ 'bg': ['bg', 'Normal' ] ,
\ 'preview-bg': ['bg', 'NormalFloat' ] ,
\ 'hl': ['fg', 'Comment' ] ,
\ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal' ] ,
\ 'bg+': ['bg', 'CursorLine', 'CursorColumn' ] ,
\ 'hl+': ['fg', 'Statement' ] ,
\ 'info': ['fg', 'PreProc' ] ,
\ 'border': ['fg', 'Ignore' ] ,
\ 'prompt': ['fg', 'Conditional' ] ,
\ 'pointer': ['fg', 'Exception' ] ,
\ 'marker': ['fg', 'Keyword' ] ,
\ 'spinner': ['fg', 'Label' ] ,
\ 'header': ['fg', 'Comment' ]
\ }
os
$ sw_vers
ProductName: macOS
ProductVersion: 14.2.1
BuildVersion: 23C71
iTerm2
- version:
Build 3.5.0beta18
- cursor settings:
vim --version
$ $(type -P vim) --version
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Dec 28 2023 15:48:16)
macOS version - x86_64
Included patches: 1-2189
Compiled by marslo <[email protected]>
Huge version without GUI. Features included (+) or not (-):
+acl +file_in_path +mouse_urxvt -tag_any_white
+arabic +find_in_path +mouse_xterm -tcl
+autocmd +float +multi_byte +termguicolors
+autochdir +folding +multi_lang +terminal
+autoservername -footer -mzscheme +terminfo
-balloon_eval +fork() +netbeans_intg +termresponse
+balloon_eval_term +gettext +num64 +textobjects
-browse -hangul_input +packages +textprop
++builtin_terms +iconv +path_extra +timers
+byte_offset +insert_expand -perl +title
+channel +ipv6 +persistent_undo -toolbar
+cindent +job +popupwin +user_commands
-clientserver +jumplist +postscript +vartabs
+clipboard +keymap +printer +vertsplit
+cmdline_compl +lambda +profile +vim9script
+cmdline_hist +langmap -python +viminfo
+cmdline_info +libcall +python3/dyn +virtualedit
+comments +linebreak +quickfix +visual
+conceal +lispindent +reltime +visualextra
+cryptv +listcmds +rightleft +vreplace
+cscope +localmap +ruby/dyn +wildignore
+cursorbind +lua/dyn +scrollbind +wildmenu
+cursorshape +menu +signs +windows
+dialog_con +mksession +smartindent +writebackup
+diff +modify_fname +sodium -X11
+digraphs +mouse +sound -xattr
-dnd -mouseshape +spell -xfontset
-ebcdic +mouse_dec +startuptime -xim
+emacs_tags -mouse_gpm +statusline -xpm
+eval -mouse_jsbterm -sun_workshop -xsmp
+ex_extra +mouse_netterm +syntax -xterm_clipboard
+extra_search +mouse_sgr +tag_binary -xterm_save
-farsi -mouse_sysmouse -tag_old_static
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/local/vim/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -I/usr/local/include -I/usr/local/Cellar/openjdk/21.0.1/libexec/openjdk.jdk/Contents/Home/include -I/usr/local/opt/openldap/include -I/usr/local/opt/curl/include -I/usr/local/opt/binutils/include -I/usr/local/opt/sqlite/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -I/usr/local/opt/node@20/include -I/usr/local/opt/tcl-tk/include -I/usr/local/Cellar/[email protected]/71.1/include -I/usr/local/opt/llvm/include -I/usr/local/opt/libiconv/include -I/usr/local/opt/ncurses/include -DMACOS_X -DMACOS_X_DARWIN -I/usr/local/include -I/usr/local/opt/tcl-tk/include -I/usr/local/Cellar/libsodium/1.0.19/include -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L/usr/local/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/openldap/lib -L/usr/local/opt/curl/lib -L/usr/local/opt/binutils/lib -L/usr/local/opt/[email protected]/lib -L/usr/local/opt/tcl-tk/lib -L/usr/local/opt/sqlite/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/node@20/lib -L/usr/local/Cellar/[email protected]/71.1/lib -L/usr/local/opt/ncurses/lib -L/usr/local/opt/libiconv/lib -L/usr/local/opt/llvm/lib -L/usr/local/opt/llvm/lib/c++ -Wl,-rpath,/usr/local/opt/llvm/lib/c++ -o vim -lm -lncurses -L/usr/local/Cellar/libsodium/1.0.19/lib -lsodium -liconv -lintl -framework AppKit