vim-easymotion icon indicating copy to clipboard operation
vim-easymotion copied to clipboard

Not working with all maps

Open TillLindemann opened this issue 7 years ago • 1 comments
trafficstars

Recently,I came across with weird things,I can not use easy motion,moreexactly,sometimes the maps can be correctly triggered,but most of cases,maps can not be triggered. I checked out the maps by :echo mapleader, it shows ; that's no problem,and I check the easymotion maps by :verbose map ;;w ,it shows correctly. Now I can only trigger it by chance! the probability is almost 1/10,and I get same problem with other plugins,and even the self defined maps,such as I mapped the ;w to save file in insert mode,and this map also works by chance. I don't know why. If I type command ,it works,but everything that associated with leaderkey,it all went wrong.here is my vimrc file: let mapleader=";" let maplocalleader=";" set splitbelow set number set expandtab set shiftwidth=4 set softtabstop=4 set autoindent

noremap ccl :ccl noremap s :bn noremap <Down> <NOP> noremap <Left> <NOP> noremap <Right> <NOP> call plug#begin('/home/zyh/.vim/plugged') Plug 'w0rp/ale' Plug 'vimlab/split-term.vim' Plug 'wsdjeg/vim-chat' Plug 'kassio/neoterm' Plug 'ludovicchabant/vim-gutentags' Plug 'tpope/vim-repeat' Plug 'iamcco/mathjax-support-for-mkdp' Plug 'iamcco/markdown-preview.vim' Plug 'junegunn/vim-easy-align' Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } Plug 'majutsushi/tagbar' Plug 'tpope/vim-surround' Plug 'mhinz/vim-signify' Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' } Plug 'sillybun/autoformatpythonstatement' Plug 'kana/vim-textobj-user' Plug 'kana/vim-textobj-indent' Plug 'kana/vim-textobj-syntax' Plug 'kana/vim-textobj-function', { 'for':['c', 'cpp', 'vim', 'java'] } Plug 'sgur/vim-textobj-parameter' Plug 'octol/vim-cpp-enhanced-highlight' Plug 'Valloric/YouCompleteMe' Plug 'Yggdroot/LeaderF' Plug 'Chiel92/vim-autoformat' Plug 'python-mode/python-mode', { 'branch': 'develop' } Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' Plug 'ryanoasis/vim-devicons' Plug 'tiagofumo/vim-nerdtree-syntax-highlight' Plug 'Yggdroot/indentLine' Plug 'mhinz/vim-startify' Plug 'xuhdev/vim-latex-live-preview', { 'for': 'tex' } Plug 'tpope/vim-fugitive' Plug 'morhetz/gruvbox' Plug 'skywind3000/asyncrun.vim' Plug 'lervag/vimtex' Plug 'jiangmiao/auto-pairs' Plug 'luochen1990/rainbow' Plug 'easymotion/vim-easymotion' Plug 'wakatime/vim-wakatime' Plug 'aperezdc/vim-template' call plug#end() " Trigger configuration. Do not use if you use https://github.com/Valloric/YouCompleteMe. let g:email = '[email protected]' let g:rainbow_conf = { \ 'guifgs': ['royalblue3', 'darkorange3', 'seagreen3', 'firebrick'], \ 'ctermfgs': ['lightblue', 'lightyellow', 'lightcyan', 'lightmagenta'], \ 'operators': ',', \ 'parentheses': ['start=/(/ end=/)/ fold', 'start=/[/ end=/]/ fold', 'start=/{/ end=/}/ fold'], \ 'separately': { \ '': {}, \ 'tex': { \ 'parentheses': ['start=/(/ end=/)/', 'start=/[/ end=/]/'], \ }, \ 'lisp': { \ 'guifgs': ['royalblue3', 'darkorange3', 'seagreen3', 'firebrick', 'darkorchid3'], \ }, \ 'vim': { \ 'parentheses': ['start=/(/ end=/)/', 'start=/[/ end=/]/', 'start=/{/ end=/}/ fold', 'start=/(/ end=/)/ containedin=vimFuncBody', 'start=/[/ end=/]/ containedin=vimFuncBody', 'start=/{/ end=/}/ fold containedin=vimFuncBody'], \ }, \ 'html': { \ 'parentheses': ['start=/\v<((area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)[ >])@!\z([-:a-zA-Z0-9]+)(\s+[-:a-zA-Z0-9]+(=("[^"]"|'."'".'[^'."'".']'."'".'|[^ '."'".'"><=`]))?)*>/ end=#</\z1># fold'], \ }, \ 'css': 0, \ } } let g:rainbow_active = 1 "0 if you want to enable it later via :RainbowToggle let g:UltiSnipsExpandTrigger="" let g:UltiSnipsJumpForwardTrigger="" let g:UltiSnipsJumpBackwardTrigger="" " If you want :UltiSnipsEdit to split your window. let g:UltiSnipsSnippetDirectories = ['/home/zyh/.vim/UltiSnips', 'UltiSnips'] let g:UltiSnipsEditSplit="vertical" let g:livepreview_engine = 'latexmk -xelatex' set nocompatible
set number set encoding=utf-8

filetype indent on filetype plugin on syntax on syntax enable set background=dark colorscheme gruvbox "ale "始终开启标志列 let g:syntastic_python_checkers=['pyflakes'] let g:syntastic_javascript_checkers=['jsl', 'jshint'] let g:syntastic_html_checkers=['tidy', 'jshint'] let g:syntastic_aggregate_errors=1

let g:ale_set_highlights =0 "自定义error和warning图标 let g:ale_sign_error = '✗' let g:ale_sign_warning = '⚡' "在vim自带的状态栏中整合ale let g:ale_statusline_format = ['✗ %d', '⚡ %d', '✔ OK'] "显示Linter名称,出错或警告等相关信息 let g:ale_echo_msg_error_str = 'E' let g:ale_echo_msg_warning_str = 'W' let g:ale_echo_msg_format = '[%linter%] %s [%severity%]' "普通模式下,sp前往上一个错误或警告,sn前往下一个错误或警告 "<Leader>s触发/关闭语法检查 "<Leader>d查看错误或警告的详细信息

let g:ale_fixers = { \ 'javascript': ['eslint'],'python':['autopep8'], }

" Set this setting in vimrc if you want to fix files automatically on save. " This is off by default. let g:ale_fix_on_save = 1

let g:cpp_class_scope_highlight = 1 let g:cpp_class_decl_highlight = 1 let g:cpp_member_variable_highlight = 1 let g:cpp_experimental_simple_template_highlight = 1 let g:cpp_experimental_template_highlight = 1 let g:cpp_concepts_highlight = 1 let g:cpp_no_function_highlight = 1

let g:ycm_add_preview_to_completeopt = 0 let g:ycm_show_diagnostics_ui = 0 let g:ycm_global_ycm_extra_conf='~/.vim/plugged/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py' let g:ycm_server_log_level = 'info' let g:ycm_min_num_identifier_candidate_chars = 2 let g:ycm_collect_identifiers_from_comments_and_strings = 1 let g:ycm_complete_in_strings=1 let g:ycm_key_invoke_completion = '' set completeopt=menu,menuone

let g:ycm_semantic_triggers = { \ 'c,cpp,python,java,go,erlang,perl': ['re!\w{2}'], \ 'cs,lua,javascript': ['re!\w{2}'], \ }

autocmd FileType vim,tex let b:autoformat_autoindent=0 let g:autoformat_autoindent = 0 let g:autoformat_retab = 0 let g:autoformat_remove_trailing_spaces = 0

let g:airline#extensions#tabline#enabled = 1 let g:airline_symbols = {}

" NERDTress File highlighting function! NERDTreeHighlightFile(extension, fg, bg, guifg, guibg) exec 'autocmd filetype nerdtree highlight ' . a:extension .' ctermbg='. a:bg .' ctermfg='. a:fg .' guibg='. a:guibg .' guifg='. a:guifg exec 'autocmd filetype nerdtree syn match ' . a:extension .' #^\s+.*'. a:extension .'$#' endfunction

call NERDTreeHighlightFile('jade', 'green', 'none', 'green', '#151515') call NERDTreeHighlightFile('ini', 'yellow', 'none', 'yellow', '#151515') call NERDTreeHighlightFile('md', 'blue', 'none', '#3366FF', '#151515') call NERDTreeHighlightFile('yml', 'yellow', 'none', 'yellow', '#151515') call NERDTreeHighlightFile('config', 'yellow', 'none', 'yellow', '#151515') call NERDTreeHighlightFile('conf', 'yellow', 'none', 'yellow', '#151515') call NERDTreeHighlightFile('json', 'yellow', 'none', 'yellow', '#151515') call NERDTreeHighlightFile('html', 'yellow', 'none', 'yellow', '#151515') call NERDTreeHighlightFile('styl', 'cyan', 'none', 'cyan', '#151515') call NERDTreeHighlightFile('css', 'cyan', 'none', 'cyan', '#151515') call NERDTreeHighlightFile('coffee', 'Red', 'none', 'red', '#151515') call NERDTreeHighlightFile('js', 'Red', 'none', '#ffa500', '#151515') call NERDTreeHighlightFile('php', 'Magenta', 'none', '#ff00ff', '#151515') map <C-n> :NERDTreeToggle<CR>

let g:NERDTreeFileExtensionHighlightFullName = 1 let g:NERDTreeExactMatchHighlightFullName = 1 let g:NERDTreePatternMatchHighlightFullName = 1 let g:NERDTreeHighlightFolders = 1 " enables folder icon highlighting using exact match let g:NERDTreeHighlightFoldersFullName = 1 " highlights the folder name let s:brown = "905532" let s:aqua = "3AFFDB" let s:blue = "689FB6" let s:darkBlue = "44788E" let s:purple = "834F79" let s:lightPurple = "834F79" let s:red = "AE403F" let s:beige = "F5C06F" let s:yellow = "F09F17" let s:orange = "D4843E" let s:darkOrange = "F16529" let s:pink = "CB6F6F" let s:salmon = "EE6E73" let s:green = "8FAA54" let s:lightGreen = "31B53E" let s:white = "FFFFFF" let s:rspec_red = 'FE405F' let s:git_orange = 'F54D27'

let g:NERDTreeExtensionHighlightColor = {} " this line is needed to avoid error let g:NERDTreeExtensionHighlightColor['css'] = s:blue " sets the color of css files to blue

let g:NERDTreeExactMatchHighlightColor = {} " this line is needed to avoid error let g:NERDTreeExactMatchHighlightColor['.gitignore'] = s:git_orange " sets the color for .gitignore files

let g:NERDTreePatternMatchHighlightColor = {} " this line is needed to avoid error let g:NERDTreePatternMatchHighlightColor['.*_spec.rb$'] = s:rspec_red " sets the color for files ending with _spec.r let g:indentLine_setColors = 0 let g:indentLine_char = '┆' let t:is_transparent = 0 function! Toggle_transparent() if t:is_transparent == 0 hi Normal guibg=NONE ctermbg=NONE let t:is_transparent = 1 else set background=dark let t:is_tranparent = 0 endif endfunction nnoremap <C-t> : call Toggle_transparent()<CR> inoremap jj <Esc>`^ inoremap w <Esc>:w noremap w :w noremap p :Autoformat set ignorecase set smartcase " Quick run via <F5> let g:asyncrun_open = 6

" 任务结束时候响铃提醒 let g:asyncrun_bell = 1

" 设置 F10 打开/关闭 Quickfix 窗口 nnoremap <F10> :call asyncrun#quickfix_toggle(6) nnoremap <F9> :lcl nnoremap <F5> :call <SID>compile_and_run()<CR> let $PYTHONUNBUFFERED=1 augroup SPACEVIM_ASYNCRUN autocmd! " Automatically open the quickfix window autocmd User AsyncRunStart call asyncrun#quickfix_toggle(5, 1) augroup END

function! s:compile_and_run() exec 'w' if &filetype == 'c' exec "AsyncRun! gcc % -o %<; time ./%<" elseif &filetype == 'cpp' exec "AsyncRun! g++ -std=c++11 % -o %<; time ./%<" elseif &filetype == 'java' exec "AsyncRun! javac %; time java %<" elseif &filetype == 'sh' exec "AsyncRun! time bash %" elseif &filetype == 'python' exec "AsyncRun! time python %" endif endfunction let g:EclimCompletionMethod = 'omnifunc' autocmd FileType python let g:autoformatpython_enabled = 1

nnoremap :m .+1<CR>== nnoremap :m .-2<CR>== vnoremap :m '>+1<CR>gv=gv vnoremap :m '<-2<CR>gv=gv noremap m :LeaderfMru noremap fc :LeaderfFunction! noremap bf :LeaderfBuffer noremap t :LeaderfTag let g:Lf_StlSeparator = { 'left': '', 'right': '', 'font': '' }

let g:Lf_RootMarkers = ['.project', '.root', '.svn', '.git'] let g:Lf_WorkingDirectoryMode = 'Ac' let g:Lf_WindowHeight = 0.30 let g:Lf_CacheDirectory = expand('~/.vim/cache') let g:Lf_ShowRelativePath = 0 let g:Lf_HideHelp = 1 let g:Lf_StlColorscheme = 'powerline' let g:Lf_PreviewResult = {'Function':0, 'BufTag':0}

" gutentags 搜索工程目录的标志,碰到这些文件/目录名就停止向上一级目录递归 let g:gutentags_project_root = ['.root', '.svn', '.git', '.hg', '.project']

" 所生成的数据文件的名称 let g:gutentags_ctags_tagfile = '.tags'

" 将自动生成的 tags 文件全部放入 ~/.cache/tags 目录中,避免污染工程目录 let s:vim_tags = expand('~/.cache/tags') let g:gutentags_cache_dir = s:vim_tags

" 配置 ctags 的参数 let g:gutentags_ctags_extra_args = ['--fields=+niazS', '--extra=+q'] let g:gutentags_ctags_extra_args += ['--c++-kinds=+px'] let g:gutentags_ctags_extra_args += ['--c-kinds=+px']

" 检测 ~/.cache/tags 不存在就新建 if !isdirectory(s:vim_tags) silent! call mkdir(s:vim_tags, 'p') endif nmap <F8> :TagbarToggle<CR> nmap md <Plug>MarkdownPreview " for normal mode imap md <Plug>MarkdownPreview " for insert mode nmap mdc <Plug>StopMarkdownPreview " for normal mode imap mdc <Plug>StopMarkdownPreview " for insert mode let g:input_toggle = 1 function! Fcitx2en() let s:input_status = system("fcitx-remote") if s:input_status == 2 let g:input_toggle = 1 let l:a = system("fcitx-remote -c") endif endfunction

function! Fcitx2zh() let s:input_status = system("fcitx-remote") if s:input_status != 2 && g:input_toggle == 1 let l:a = system("fcitx-remote -o") let g:input_toggle = 0 endif endfunction

set timeoutlen=150 autocmd InsertLeave * call Fcitx2en() "autocmd InsertEnter * call Fcitx2zh()

TillLindemann avatar Jun 07 '18 16:06 TillLindemann

Update! after I reinstalled the neovim and reconfigured it ,the bugs disappeared, maybe this is the problem of neovim, i got both neovim and vim installed in my pc, and init.vim is linked to .vimrc .

TillLindemann avatar Jun 08 '18 17:06 TillLindemann