SpaceVim / SpaceVim

A modular Vim/Neovim configuration
https://spacevim.org/
GNU General Public License v3.0
20.31k stars 1.42k forks source link

vim-highlightedyank doesn't work any more with latest version of SpaceVim #3610

Closed Gabirel closed 4 years ago

Gabirel commented 4 years ago

Expected behavior, english is recommend

Yank highlight should at least work. Obviously, it doesn't work for the lastest SpaceVim.

Environment Information

On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

The reproduce ways from Vim starting (Required!)

  1. Add custom plugins into SpaceVim
let g:spacevim_custom_plugins = [
    \ ['machakann/vim-highlightedyank'],
    \ ]
  1. Check whether yank highlight works or not. It doesn't work in my case.

My full init.vim

" ############## Default Setting Start ########################
set wrap
set guifont=JetBrainsMonoForPowerline-Regular:h20
" ############## Default Setting End   ########################

" ############## SpaceVim Setting Start ########################
" basic defualt SpaceVim settings
let g:spacevim_colorscheme  = 'molokai'
let g:spacevim_max_column   = 80
let g:spacevim_default_indent = 4
let g:spacevim_error_symbol = '✗'
let g:spacevim_warning_symbol =  '!'
let g:spacevim_info_symbol =  'i'
let g:spacevim_buffer_index_type = 4
let g:spacevim_windows_index_type = 1
let g:spacevim_lint_on_the_fly = 0
let g:spacevim_relativenumber = 0
let g:spacevim_filetree_direction = 'left'
let g:spacevim_lint_on_save = 0
let g:spacevim_enable_neomake = 0
let g:spacevim_enable_ale = 1
let g:spacevim_enable_statusline_mode = 1
let g:spacevim_windows_index_type = 3
let g:spacevim_buffer_index_type = 4
let g:spacevim_statusline_separator = 'arrow'
let g:vimtex_quickfix_enabled = 0
let g:spacevim_autocomplete_method = 'coc'

" layers settings
call SpaceVim#layers#load('checkers')
call SpaceVim#layers#load('colorscheme')
call SpaceVim#layers#load('fzf')
"call SpaceVim#layers#load('git')
call SpaceVim#layers#load('VersionControl')
call SpaceVim#layers#load('lang#c')
call SpaceVim#layers#load('lang#javascript')
"call SpaceVim#layers#load('lang#haskell')
call SpaceVim#layers#load('lang#latex')
call SpaceVim#layers#load('lang#lua')
call SpaceVim#layers#load('lang#markdown')
call SpaceVim#layers#load('lang#python')
call SpaceVim#layers#load('lang#swig')
call SpaceVim#layers#load('lang#xml')
" ############## SpaceVim Setting End  ########################

" ############## Embedded Plugins Setting Start ########################
" {{ coc {{
let g:coc_config_home = '~/.SpaceVim.d/'

" Use `[g` and `]g` to navigate diagnostics
" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list.
nmap <silent> [g <Plug>(coc-diagnostic-prev)
nmap <silent> ]g <Plug>(coc-diagnostic-next)

" GoTo code navigation.
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)

" Use K to show documentation in preview window.
nnoremap <silent> K :call <SID>show_documentation()<CR>

function! s:show_documentation()
  if (index(['vim','help'], &filetype) >= 0)
    execute 'h '.expand('<cword>')
  else
    call CocAction('doHover')
  endif
endfunction

" Highlight the symbol and its references when holding the cursor.
autocmd CursorHold * silent call CocActionAsync('highlight')

" Symbol renaming.
nmap <leader>rn <Plug>(coc-rename)

" Formatting selected code.
" `<leader>f` already taken by SpaceVim 
" xmap <leader>f  <Plug>(coc-format-selected)
" nmap <leader>f  <Plug>(coc-format-selected)
" }} coc }}

" {{ vim_markdown {{
let g:mkdp_path_to_chrome = 'google-chrome-stable'
let g:mkdp_auto_start = 0
let vim_markdown_preview_github=1
let vim_markdown_preview_use_xdg_open=1
" }} vim_markdown }}

" {{ Neoformat {{
" Auto format on save
"augroup fmt
"  autocmd!
"  autocmd BufWritePre * undojoin | Neoformat
"augroup END

let g:neoformat_cpp_clangformat = {
            \ 'exe': 'clang-format',
            \ 'args': ['-style=file'],
            \ 'stdin': 1,
            \ }
" }} Neoformat }}

" {{ ale {{
" setting below is not necessary when dag/vim-fish is enabled
au BufRead,BufNewFile *.fish setfiletype sh
" Disable linting for all fish files.
let g:ale_pattern_options = {'\.fish$': {'ale_enabled': 0}}
" Disable not-so-smart chktex
let g:ale_tex_chktex_executable = ''
"autocmd FileType fish let g:ale_sh_shell_default_shell='fish'
" }} ale }}

" {{ vimtex {{
" Special setting for latex files
" Use `gggqG` to format long lines in Latex
" Use `gq11j` to wrap the line you're on with the 11 below it
" Use `gqip` or `gqap` to wrap the paragraph
" gg(go to first line), gq(format) to G(the last line)
autocmd FileType tex setlocal colorcolumn=80 textwidth=79 tabstop=2 shiftwidth=2 expandtab
nnoremap <leader>v gqip
" See: http://vimdoc.sourceforge.net/htmldoc/syntax.html#g:tex_conceal
let g:tex_conceal = "abdg"
" Disable automatic view since I do not use `previewer` for viewing anymore
let g:vimtex_view_automatic = 0
" }} vimtex }}
" ############## Embedded Plugins Setting End   ########################

" ############## Extra Plugins Setting Start ########################
" {{ YouCompleteMe {{
let g:spacevim_enable_ycm = 0
let g:ycm_complete_in_comments = 1
let g:ycm_confirm_extra_conf = 0
let g:ycm_seed_identifiers_with_syntax = 0
let g:ycm_error_symbol = '✗'
let g:ycm_warning_symbol = '!'
let g:ycm_global_ycm_extra_conf = '~/.SpaceVim.d/.ycm_extra_conf.py'
let g:ycm_semantic_triggers =  {
  \   'c' : ['->', '.'],
  \   'cpp,objcpp' : ['->', '.', '::'],
  \   'php' : ['->', '::'],
  \   'cs,java,javascript,typescript,d,python,perl6,scala,vb,elixir,go' : ['.'],
  \   'ruby' : ['.', '::'],
  \   'lua' : ['.', ':'],
  \ }
let g:ycm_filetype_blacklist = { }
" YCM for vimtex
au VimEnter * let g:ycm_semantic_triggers.tex=g:vimtex#re#youcompleteme
" }} YouCompleteMe }}
" ############## Extra Plugins Setting End   ########################

" ############## Custom Plugins in SpaceVim Start ########################
let g:spacevim_custom_plugins = [
    \ ['rdnetto/YCM-Generator'],
    \ ['machakann/vim-highlightedyank'],
    \ ]
" ############## Custom Plugins in SpaceVim End   ########################

" ############## Custom Plugins Setting in SpaceVim Start ########################

" ############## Custom Plugins Setting in SpaceVim End  ########################

Output of the :SPDebugInfo!

SpaceVim debug information ### SpaceVim options : ```toml auto_disable_touchpad = 1 autocomplete_method = 'coc' autocomplete_parens = 1 buffer_index_type = 4 checkinstall = 1 colorscheme = 'molokai' colorscheme_bg = 'dark' colorscheme_default = 'desert' commandline_prompt = '➭' custom_color_palette = [] custom_plugins = [['rdnetto/YCM-Generator'], ['machakann/vim-highlightedyank']] data_dir = '/Users/gabriel/.cache/' debug_level = 1 default_indent = 4 disabled_plugins = [] enable_ale = 1 enable_bepo_layout = 0 enable_cursorcolumn = 0 enable_cursorline = 1 enable_debug = 0 enable_googlesuggest = 0 enable_guicolors = 0 enable_insert_leader = 1 enable_javacomplete2_py = 0 enable_key_frequency = 0 enable_language_specific_leader = 1 enable_neocomplcache = 0 enable_neomake = 0 enable_os_fileformat_icon = 0 enable_powerline_fonts = 1 enable_statusline_bfpath = 0 enable_statusline_mode = 1 enable_statusline_tag = 1 enable_tabline_ft_icon = 0 enable_vimfiler_filetypeicon = 0 enable_vimfiler_gitstatus = 0 enable_vimfiler_welcome = 1 enable_ycm = 0 error_symbol = '✗' expand_tab = 1 filemanager = 'vimfiler' filetree_direction = 'left' filetype_icons = {} force_global_config = 0 gitcommit_issue_icon = '' gitcommit_pr_icon = '' github_username = '' guifont = '' hiddenfileinfo = 1 home_files_number = 6 hosts_url = 'https://raw.githubusercontent.com/racaljk/hosts/master/hosts' info_symbol = 'i' keep_server_alive = 1 language = '' leader_guide_default_group_name = '' leader_guide_flatten = 1 leader_guide_hspace = 5 leader_guide_max_size = 0 leader_guide_position = 'botright' leader_guide_run_map_on_popup = 1 leader_guide_sort_horizontal = 0 leader_guide_submode_mappings = {'': 'win_close'} leader_guide_vertical = 0 lint_on_save = 0 lint_on_the_fly = 0 max_column = 80 plugin_bundle_dir = '/Users/gabriel/.cache/vimfiles/' plugin_manager = 'dein' plugin_manager_processes = 16 plugin_name = 'xmledit' project_rooter_automatically = 1 project_rooter_patterns = ['.git/', '_darcs/', '.hg/', '.bzr/', '.svn/', '.SpaceVim.d/', '.clang', 'package.json'] realtime_leader_guide = 1 relativenumber = 0 search_tools = ['rg', 'ag', 'pt', 'ack', 'grep', 'findstr'] sidebar_direction = '' sidebar_width = 30 smartcloseignoreft = ['tagbar', 'vimfiler', 'defx', 'SpaceVimRunner', 'SpaceVimREPL', 'SpaceVimQuickFix', 'HelpDescribe', 'VebuggerShell', 'VebuggerTerminal', 'SpaceVimTabsManager'] smartcloseignorewin = ['__Tagbar__', 'vimfiler:default'] snippet_engine = 'neosnippet' src_root = 'E:\sources\' statusline_iseparator = 'nil' statusline_left_sections = ['winnr', 'filename', 'major mode', 'search count', 'syntax checking', 'minor mode lighters', 'vcs', 'hunks'] statusline_right_sections = ['fileformat', 'cursorpos', 'percentage'] statusline_separator = 'arrow' statusline_unicode_symbols = 1 terminal_cursor_shape = 2 todo_labels = ['@fixme', '@question', '@todo', '@idea'] update_retry_cnt = 3 version = '1.5.0-dev' vim_help_language = 'en' vimcompatible = 0 warning_symbol = '!' wildignore = '*/tmp/*,*.so,*.swp,*.zip,*.class,tags,*.jpg,*.ttf,*.TTF,*.png,*/target/*,.git,.svn,.hg,.DS_Store,*.svg' windows_index_type = 3 windows_leader = 's' windows_smartclose = 'q' ``` ### SpaceVim layers : ```toml [[layers]] name="autocomplete" [[layers]] name="checkers" [[layers]] name="format" [[layers]] name="edit" [[layers]] name="ui" [[layers]] name="core" [[layers]] name="core#banner" [[layers]] name="core#statusline" [[layers]] name="core#tabline" [[layers]] name="colorscheme" [[layers]] name="fzf" [[layers]] name="VersionControl" [[layers]] name="lang#c" [[layers]] name="lang#javascript" [[layers]] name="lang#latex" [[layers]] name="lang#lua" [[layers]] name="lang#markdown" [[layers]] name="lang#python" [[layers]] name="lang#swig" [[layers]] name="lang#xml" ``` ### SpaceVim Health checking : SpaceVim clipboard support check report: Checking +clipboard: SUCCEED! SpaceVim environment check report: Current progpath: nvim(/usr/local/Cellar/neovim/0.4.3/bin/nvim) version: 800 OS: mac [shell, shellcmdflag, shellslash]: ['/usr/local/bin/bash', '-c', 0] SpaceVim lua support check report: Checking +lua: Failed : Known issue, neovim do not support lua now. SpaceVim python support check report: Checking +python3: SUCCEED! Checking +python: Failed : to support +python, you need run `pip2 install neovim` ### SpaceVim runtime log : ```log [ SpaceVim ] : logger file does not exists, only log for current process will be shown! [ SpaceVim ] [23:26:19] [ Info ] Startup with argv: ['README.md'] [ SpaceVim ] [23:26:19] [ Info ] Can not find project local config, start loading global config [ SpaceVim ] [23:26:19] [ Info ] SpaceVim server startup at:/tmp/spacevim_nvim_server [ SpaceVim ] [23:26:20] [ Info ] Start to find root for: /Users/gabriel/Documents/research/git/wiki/README.md [ SpaceVim ] [23:26:20] [ Info ] (.git/):/Users/gabriel/Documents/research/git/wiki [ SpaceVim ] [23:26:20] [ Info ] buffer name: README.md [ SpaceVim ] [23:26:20] [ Info ] change to root: /Users/gabriel/Documents/research/git/wiki [ SpaceVim ] [23:26:20] [ Info ] buffer name: README.md [ SpaceVim ] [23:26:20] [ Info ] change to root: /Users/gabriel/Documents/research/git/wiki [ SpaceVim ] [23:26:23] [ Info ] Start to find root for: /private/var/folders/g9/yxsb08b577dgqdyj77hvy1ww0000gn/T/nvimkL28tv/5/issue_report.md [ SpaceVim ] [23:26:23] [ Info ] buffer name: /var/folders/g9/yxsb08b577dgqdyj77hvy1ww0000gn/T/nvimkL28tv/5/issue_report.md [ SpaceVim ] [23:26:23] [ Info ] change to root: /Users/gabriel/Documents/research/git/wiki ```

Screenshots

Here's what happens after I yank the whole line. image

PS: Before I use the latest version of SpaceVim, that custom plugin works like a charm. I am pretty sure something has changed in SpaceVim, which makes it behave abnormally.

wsdjeg commented 4 years ago

I have tested it, it works well for me, here is my config:

[[custom_plugins]]
    name = 'machakann/vim-highlightedyank'
    merged = false

you should check following:

  1. :au highlightedyank, it should print:
--- Autocommands ---
highlightedyank  TextYankPost
    *         call highlightedyank#debounce()