LeaderF icon indicating copy to clipboard operation
LeaderF copied to clipboard

LeaderF paste error in remote ssh terminal, help want.

Open wlt-cortex opened this issue 2 years ago • 3 comments

  • vim or neovim?
    • [x] vim
    • [ ] neovim
  • Output of vim --version or nvim --version:
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Sep 28 2021 11:18:09)
Included patches: 1-3458
Modified by [email protected]
Compiled by [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           +virtualedit
+cmdline_hist      +langmap           -python            +visual
+cmdline_info      +libcall           +python3           +visualextra
+comments          +linebreak         +quickfix          +viminfo
+conceal           +lispindent        +reltime           +vreplace
+cryptv            +listcmds          +rightleft         +wildignore
+cscope            +localmap          -ruby              +wildmenu
+cursorbind        -lua               +scrollbind        +windows
+cursorshape       +menu              +signs             +writebackup
+dialog_con        +mksession         +smartindent       -X11
+diff              +modify_fname      -sodium            -xfontset
+digraphs          +mouse             +sound             -xim
-dnd               -mouseshape        +spell             -xpm
-ebcdic            +mouse_dec         +startuptime       -xsmp
+emacs_tags        +mouse_gpm         +statusline        -xterm_clipboard
+eval              -mouse_jsbterm     -sun_workshop      -xterm_save
+ex_extra          +mouse_netterm     +syntax
+extra_search      +mouse_sgr         +tag_binary
-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/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -Wdate-time -g -O2 -fdebug-prefix-map=/build/vim-gvpQvt/vim-8.2.3458=. -fstack-protector-strong -Wformat -Werror=format-security -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim -lm -ltinfo -lselinux -lcanberra -lacl -lattr -lgpm -ldl -L/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu -lpython3.6m -lpthread -ldl -lutil -lm
  • Output of :echo has("python"): 0
  • Output of :echo has("python3"): 1
  • Output of :echo &pythondll(only vim, not neovim):
  • Output of :echo &pythonthreedll(only vim, not neovim):
  • Output of :py print(sys.version):
  • Output of :py3 print(sys.version):
3.6.9 (default, Dec  8 2021, 21:08:43)
[GCC 8.4.0]
  • Output of :echo g:Lf_Debug_Cmd:
  • Output of :echo g:Lf_FilesFromCache:
  • Operating system:
    • [x] Linux
    • [ ] Mac OS X
    • [ ] Windows
    • [ ] Etc.
  • Configurations related to LeaderF in vimrc:
let g:Lf_CommandMap = {
  \ '<C-R>': [],
  \ '<F5>': ['<C-R>'],
  \ '<C-V>': []
  \ }
let g:Lf_HideHelp = 1
let g:Lf_CursorBlink = 1
let g:Lf_UseVersionControlTool = 0
let g:Lf_RgConfig = [
  \ "--hidden --follow",
  \ "-g '!*.git' -g '!*build*'",
  \ "-g '!*.o' -g '!*.so'",
  \ "-g '!*.deb' -g '!*.gz' -g '!*.zip'",
\ ]

let g:Lf_ShowHidden = 1
let g:Lf_RecurseSubmodules = 1
let g:Lf_ShowDevIcons = 0
let g:Lf_PreviewResult = { 'File': 1, 'Rg': 1 }
let g:Lf_FollowLinks = 1
let g:Lf_RememberLastSearch = 0
let g:Lf_DisableStl = 0

let g:Lf_WindowPosition = 'popup'
let g:Lf_PreviewInPopup = 1
let g:Lf_PopupShowStatusline = 0
let g:Lf_PopupShowBorder = 1
let g:Lf_PopupBorders = ["─","│","─","│","╭","╮","╯","╰"]

" " let Lf_PopupColorscheme = 'gruvbox_material'
" " Lf_hl_popup_inputText is the wincolor of input window
hi Lf_hl_popup_inputText ctermfg=15 ctermbg=4
" " Lf_hl_popup_window is the wincolor of content window
hi Lf_hl_popup_window ctermfg=255 ctermbg=NONE
hi Lf_hl_popupBorder term=none ctermfg=15 ctermbg=NONE

" search in current file
noremap ss :<C-U><C-R>=printf("Leaderf line %s", "")<CR><CR>
" search file
let g:Lf_ShortcutF = "sf"
" search doc
noremap sd :Leaderf rg -i

" " noremap s: <Nop>
noremap <leader>b <Nop>
noremap sb :<C-U><C-R>=printf("Leaderf buffer %s", "")<CR><CR>
noremap sc :<C-U><C-R>=printf("Leaderf cmdHistory %s", "")<CR><CR>
noremap sm :<C-U><C-R>=printf("Leaderf mru %s", "")<CR><CR>
" depends on ctag, which should be install with universal tag
noremap st :<C-U><C-R>=printf("Leaderf bufTag %s", "")<CR><CR>
noremap sn :<C-U><C-R>=printf("Leaderf function %s", "")<CR><CR>
" " search visually selected text literally
xnoremap sv :<C-U><C-R>=printf("Leaderf! rg -F -e %s ", leaderf#Rg#visual())<CR><CR>

" noremap sw :<C-U><C-R>=printf("Leaderf! rg --current-buffer -e %s ", expand("<cword>"))<CR><CR>
noremap sw :<C-U><C-R>=printf("Leaderf! rg -e %s ", expand("<cword>"))<CR><CR>
noremap sW :<C-U><C-R>=printf("Leaderf! rg -e %s ", expand("<cWORD>"))<CR><CR>
" " search last history
noremap sl :<C-U>Leaderf --recall<CR>
" noremap sj :<C-U>Leaderf --next<CR>
" noremap sk :<C-U>Leaderf --previous<CR>
let g:Lf_NormalMap = {
  \ "_": [
  \   ["<C-j>", "j"],
  \   ["<C-k>", "k"]
  \ ]
  \}

Describe your question, feature request, or bug.

My work scenario is in the mac, open the iTerm2 terminal and connect the remote Linux machine via ssh. When opening the vim with plugin LeaderF, everything works fine except the paste function. Here are two questions that bother me:

  1. The default key bind for pasting from the official doc is <C-V> or <S-Insert>, but there are unuseful in my terminal. <C-V> does nothing, but I found it will move my cursor to the top of the search result view if I moved down. <S-Insert> includes the Insert key that does not exist on my computer, so I ignore it.
  2. My last experience about copying into a terminal is by <cmd+v>, it's no use and exactly freezes my vim every time! I cannot input anything except <C-C> to quit. And that multi-continual <C-C> leads to an error in vim console, logs are here:
Error detected while processing function leaderf#Any#start[4]..leaderf#LfPy:
line    1:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/serving/.vim/bundle/LeaderF/autoload/leaderf/python/leaderf/anyExpl.py", line 815, in start
    the_args.start(arguments, *args, **kwargs)
  File "/home/serving/.vim/bundle/LeaderF/autoload/leaderf/python/leaderf/anyExpl.py", line 747, in _default_action
    manager.startExplorer(win_pos[2:], *args, **kwargs)
  File "/home/serving/.vim/bundle/LeaderF/autoload/leaderf/python/leaderf/fileExpl.py", line 852, in startExplorer
    super(FileExplManager, self).startExplorer(win_pos, *args, **kwargs)
  File "/home/serving/.vim/bundle/LeaderF/autoload/leaderf/python/leaderf/manager.py", line 2420, in startExplorer
    self.input()
  File "/home/serving/.vim/bundle/LeaderF/autoload/leaderf/python/leaderf/manager.py", line 63, in deco
    self._getInstance().buffer.options['modifiable'] = False
vim.error: Vim:vim.error: Vim(let):E684: list index out of range: -1

Steps to reproduce

  1. vim
  2. :Leaderf file
  3. cmd + v

Actual behaviour

And the vim will freeze, only the key <Ctrl+C> will terminate LeaderF with the error introduced above.

Expected behaviour

paste into the command line of LeaderF

wlt-cortex avatar Jun 17 '22 11:06 wlt-cortex

<cmd+v>, it's no use and exactly freezes my vim every time!

It's known issue: https://github.com/Yggdroot/LeaderF/issues/427

I think ctrl-v should work if you remove \ '<C-V>': [] from

let g:Lf_CommandMap = {
  \ '<C-R>': [],
  \ '<F5>': ['<C-R>'],
  \ '<C-V>': []
  \ }

Yggdroot avatar Jun 21 '22 07:06 Yggdroot

<cmd+v>, it's no use and exactly freezes my vim every time!

It's known issue: #427

I think ctrl-v should work if you remove \ '<C-V>': [] from

let g:Lf_CommandMap = {
  \ '<C-R>': [],
  \ '<F5>': ['<C-R>'],
  \ '<C-V>': []
  \ }

Sorry to paste the wrong configuration, I have removed the '<C-V>': [] in my config, but nothing happened after input.

I don't know what's wrong, and I change to some handy solutions:

  1. remove the suffix <CR> in the shortcut for each Leaderf command
  2. edit the query in vim's command line for full editor key bindings enabled

And command + V problem I will query in that issue.

wlt-cortex avatar Jun 21 '22 08:06 wlt-cortex

It's because your vim feature is -clipboard. Ctrl-v can paste the words from the * register.

Yggdroot avatar Jun 25 '22 09:06 Yggdroot