繁体   English   中英

如何修复Vim中的Leader Key Beep?

[英]How to fix Leader Key Beep in Vim?

我无法在Vim中使用引导键。 我已经进行了一段时间的故障排除。

我已经做过的事情:

  • 将领导者钥匙映射到另一个钥匙
  • 没有插件/ _vimrc文件就启动了vim

_vimrc

let mapleader = ';'
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim

set diffexpr=MyDiff()
function MyDiff()
  let opt = '-a --binary '
  if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  let arg1 = v:fname_in
  if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
  let arg1 = substitute(arg1, '!', '\!', 'g')
  let arg2 = v:fname_new
  if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
  let arg2 = substitute(arg2, '!', '\!', 'g')
  let arg3 = v:fname_out
  if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
  let arg3 = substitute(arg3, '!', '\!', 'g')
  if $VIMRUNTIME =~ ' '
    if &sh =~ '\<cmd'
      if empty(&shellxquote)
        let l:shxq_sav = ''
        set shellxquote&
      endif
      let cmd = '"' . $VIMRUNTIME . '\diff"'
    else
      let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
    endif
  else
    let cmd = $VIMRUNTIME . '\diff'
  endif
  let cmd = substitute(cmd, '!', '\!', 'g')
  silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3
  if exists('l:shxq_sav')
    let &shellxquote=l:shxq_sav
  endif
endfunction

set nocompatible
syntax on
filetype plugin indent on
set hidden

"let pythonthreedll = 'C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\python36.dll'

call plug#begin('~/.vim/plugged')
Plug 'lervag/vimtex'
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
call plug#end()

" Trigger configuration. Do not use <tab> if you use
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
"let g:UltiSnipsJumpBackwardTrigger="<c-tab>"
"If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"

:let mapleader

mapleader              ;

:地图

x  <C-A>       * <C-C>ggVG
s  <C-A>       * <C-C>gggH<C-O>G
o  <C-A>       * <C-C>gggH<C-O>G
n  <C-A>       * gggH<C-O>G
v  <C-C>       * "+y
s  <C-H>       * <C-G>c
x  <Tab>       * :call UltiSnips#SaveLastVisualSelection()<CR>gvs
s  <Tab>       * <Esc>:call UltiSnips#ExpandSnippetOrJump()<CR>
   <C-Q>       * <C-V>
s  <C-R>       * <C-G>"_c<C-R>
v  <C-S>       * <C-C>:update<CR>
no <C-S>       * :update<CR>
v  <C-V>       & "-c<Esc>:call paste#Paste()<CR>
no <C-V>         "+gP
v  <C-X>       * "+x
   <C-Y>       * <C-R>
   <C-Z>       * u
o  %             <Plug>(MatchitOperationForward)
x  %             <Plug>(MatchitVisualForward)
n  %             <Plug>(MatchitNormalForward)
   Q             gq
o  [%            <Plug>(MatchitOperationMultiBackward)
x  [%            <Plug>(MatchitVisualMultiBackward)
n  [%            <Plug>(MatchitNormalMultiBackward)
o  ]%            <Plug>(MatchitOperationMultiForward)
x  ]%            <Plug>(MatchitVisualMultiForward)
n  ]%            <Plug>(MatchitNormalMultiForward)
x  a%            <Plug>(MatchitVisualTextObject)
o  g%            <Plug>(MatchitOperationBackward)
x  g%            <Plug>(MatchitVisualBackward)
n  g%            <Plug>(MatchitNormalBackward)
v  gx            <Plug>NetrwBrowseXVis
n  gx            <Plug>NetrwBrowseX
v  <Plug>(MatchitVisualTextObject)   <Plug>(MatchitVisualMultiBackward)o<Plug>(MatchitVisualMultiForward)
o  <Plug>(MatchitOperationMultiForward) * :<C-U>call matchit#MultiMatch("W",  "o")<CR>
o  <Plug>(MatchitOperationMultiBackward) * :<C-U>call matchit#MultiMatch("bW", "o")<CR>
v  <Plug>(MatchitVisualMultiForward) * :<C-U>call matchit#MultiMatch("W",  "n")<CR>m'gv``
v  <Plug>(MatchitVisualMultiBackward) * :<C-U>call matchit#MultiMatch("bW", "n")<CR>m'gv``
n  <Plug>(MatchitNormalMultiForward) * :<C-U>call matchit#MultiMatch("W",  "n")<CR>
n  <Plug>(MatchitNormalMultiBackward) * :<C-U>call matchit#MultiMatch("bW", "n")<CR>
o  <Plug>(MatchitOperationBackward) * :<C-U>call matchit#Match_wrapper('',0,'o')<CR>
o  <Plug>(MatchitOperationForward) * :<C-U>call matchit#Match_wrapper('',1,'o')<CR>
v  <Plug>(MatchitVisualBackward) * :<C-U>call matchit#Match_wrapper('',0,'v')<CR>m'gv``
v  <Plug>(MatchitVisualForward) * :<C-U>call matchit#Match_wrapper('',1,'v')<CR>m'gv``
n  <Plug>(MatchitNormalBackward) * :<C-U>call matchit#Match_wrapper('',0,'n')<CR>
n  <Plug>(MatchitNormalForward) * :<C-U>call matchit#Match_wrapper('',1,'n')<CR>
v  <Plug>NetrwBrowseXVis * :<C-U>call netrw#BrowseXVis()<CR>
n  <Plug>NetrwBrowseX * :call netrw#BrowseX(expand((exists("g:netrw_gx")? g:netrw_gx : '<cfile>')),netrw#CheckIfRemote())<CR>
s  <Del>       * <C-G>c
s  <BS>        * <C-G>c
s  <C-Tab>     * <Esc>:call UltiSnips#ListSnippets()<CR>
o  <C-F4>      * <C-C><C-W>c
nv <C-F4>      * <C-W>c
o  <C-Tab>     * <C-C><C-W>w
nx <C-Tab>     * <C-W>w
v  <S-Insert>    <C-V>
no <S-Insert>    "+gP
v  <C-Insert>  * "+y
v  <S-Del>     * "+x
x  <BS>        * d
v  ÎØ            "*d
v  Î×            "*d
v  ÎÕ            "*y
v  ÎÔ            "-d"*P
n  ÎÔ            "*P
nv Îu            <C-End>
nv Îw            <C-Home>

:imap

i  <C-F4>      * <C-O><C-W>c
i  <C-Tab>     * <C-R>=UltiSnips#ListSnippets()<CR>
i  <S-Insert>    <C-V>
i  ÎÔ            <C-R><C-O>*
!  Îu            <C-End>
!  Îw            <C-Home>
i  <C-A>       * <C-O>gg<C-O>gH<C-O>G
i  <Tab>       * <C-R>=UltiSnips#ExpandSnippetOrJump()<CR>
i  <C-S>       * <Esc>:update<CR>gi
i  <C-U>       * <C-G>u<C-U>
i  <C-V>       & <C-G>u<C-\><C-O>"+gP
i  <C-Y>       * <C-O><C-R>
i  <C-Z>       * <C-O>u

预期行为

在右下角的vim屏幕上应该有一个\\(想在vimtex中使用\\ ll),但是它只是发出哔声。 我可以在CMD-Window或vim插入模式下使用\\,但不能在“普通” -vim窗口(ESC,ESC)中使用它

尝试像以前尝试的那样将前导键映射到另一个键,但是将let mapleader = ';' _vimrc的第一行(而不是在最后一行),因为在定义map / noremap时, <Leader><LocalLeader>被展开。 通过在最后设置领导者,将导致以前完成的所有映射(在插件中以及在mswin.vim和vimrc_example.vim中)都无法与新领导者一起使用。

所以_vimrc将是:

let mapleader = ';'
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim

set diffexpr=MyDiff()
function MyDiff()
  let opt = '-a --binary '
...
...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM