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

Fading Issue

Open j5shi opened this issue 11 years ago • 12 comments

When you perform easymotion-sn command, the content of a file will be faded (highlighted as comment), which is desired, and then as you type the keywords to search, the matched charaters will be highlighted to green and bold, which is also desired, my problem is that, at the very begining it works very well, but then later as I re-sourced my vimrc using so % (to make some changes effective), the highlighting (as mentioned before) will totally be disabled, so would you tell me any ways to find exactly what caused this issue? Thanks.

j5shi avatar Dec 14 '14 13:12 j5shi

Hmm, I cannot reproduce this. Maybe there are unreloadable lines in your vimrc?

Please make minimal reproduction steps with tiny vimrc.

haya14busa avatar Dec 14 '14 13:12 haya14busa

I'm having this problem too I'll look into it when I get some free time.

arecarn avatar Mar 03 '15 18:03 arecarn

It seems to be connected to colour customisations in the vimrc. I even remember looking into the easymotion source when I first stumbled upon this, but I don't remember if I found something :(. The workaround I have been resorting to is to reapply the current colour scheme using the following function (mapped to a command):

function! ResetColors()
  if exists("g:colors_name")
    execute 'colorscheme '.g:colors_name
  endif
endfunction
command! ResetColors call ResetColors()

This solves it every time. Since it only occurs infrequently (mostly -- or only? -- on sourcing vimrc), that was good enough for me. Maybe this helps pinpointing the problem?

eboth avatar Mar 11 '15 08:03 eboth

I use this workaround:

    autocmd BufWritePost * call EasyMotion#highlight#init()

j5shi avatar Mar 11 '15 12:03 j5shi

Please make minimal vimrc to solve this without workaround.

haya14busa avatar Mar 29 '15 11:03 haya14busa

I didn't solve it without this workaround.

j5shi avatar Mar 30 '15 00:03 j5shi

I didn't solve it without this workaround.

I know. That's because I said please make minimal vimrc to produce this problem

haya14busa avatar Apr 02 '15 07:04 haya14busa

No, what you said is as follows

Please make minimal vimrc to solve this without workaround.

and I can't solve it. The minimal vimrc to produce this problem is an empty vimrc, since this problem comes out of box.

j5shi avatar Apr 02 '15 13:04 j5shi

I'll solve it with your vimrc. You don't have to solve it.

The minimal vimrc to produce this problem is an empty vimrc

I guess I hear it first time. Do you report this problem is produced with empty vimrc? And is it really???

haya14busa avatar Apr 02 '15 13:04 haya14busa

Ok, my English is bad.

I want to solve this problem and I need the vimrc to reproduce this problem to solve it.

haya14busa avatar Apr 02 '15 13:04 haya14busa

function! VimEasymotion()
    " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    " https://github.com/Lokaltog/vim-easymotion
    " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    nmap <leader><leader>  <Plug>(easymotion-prefix)
    nmap <leader><leader>s <Plug>(easymotion-sn)
    nmap <leader><leader>a <Plug>(easymotion-jumptoanywhere)
    nmap <leader><leader>f <Plug>(easymotion-bd-f)
    nmap <leader><leader>t <Plug>(easymotion-bd-t)
    nmap <leader><leader>. <Plug>(easymotion-repeat)
    let g:EasyMotion_enter_jump_first  = 1
    let g:EasyMotion_off_screen_search = 1
    let g:EasyMotion_keys              = 'abcdefghijklmnopqrstuvwxyz'
    autocmd BufWritePost * call EasyMotion#highlight#init()
endfunction
execute VimEasymotion()

well, here's my configuration of easymotion in my vimrc, for your reference. I have this problem with this configuration unless I have this line:

autocmd BufWritePost * call EasyMotion#highlight#init()

j5shi avatar Apr 02 '15 13:04 j5shi

easymotion_highlight.vimrc

set nocompatible
set runtimepath+=~/.vim/bundle/vim-easymotion
syntax enable

function! VimEasymotion()
    " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    " https://github.com/Lokaltog/vim-easymotion
    " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    nmap <leader><leader>  <Plug>(easymotion-prefix)
    nmap <leader><leader>s <Plug>(easymotion-sn)
    nmap <leader><leader>a <Plug>(easymotion-jumptoanywhere)
    nmap <leader><leader>f <Plug>(easymotion-bd-f)
    nmap <leader><leader>t <Plug>(easymotion-bd-t)
    nmap <leader><leader>. <Plug>(easymotion-repeat)
    let g:EasyMotion_enter_jump_first  = 1
    let g:EasyMotion_off_screen_search = 1
    let g:EasyMotion_keys              = 'abcdefghijklmnopqrstuvwxyz'
    " autocmd BufWritePost * call EasyMotion#highlight#init()
endfunction
execute VimEasymotion()

How to (not) reproduce

  1. $ vim -i -N -u easymotion_highlight.vimrc easymotion_highlight.vimrc
  2. Type <leader><leader>s and confirm the easymotion works.
  3. :source %
  4. Type <leader><leader>s, but I cannot see the reported problem at least in my environment.

Ok, I assume the problem is not your easymotion settings or easymotion itself.

I guess there are some bad lines in your vimrc like autocmd! or something and re-applying colorscheme.

Applying colorscheme disable lots of config for highlight, so highlight related plugins including EasyMotion re-applying color setting with autocmd ColorScheme, but if you somehow disable this autocmd by autocmd! or something, it doesn't work well.

haya14busa avatar Apr 02 '15 15:04 haya14busa