Not working with all maps
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
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 = '
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
" 任务结束时候响铃提醒 let g:asyncrun_bell = 1
" 设置 F10 打开/关闭 Quickfix 窗口
nnoremap <F10> :call asyncrun#quickfix_toggle(6)
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
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
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()
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 .