Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6025

EasyMotion plugin doesn't load automatically on Vim startup in WSL Ubuntu

$
0
0

I am using Windows with WSL (Windows Subsystem for Linux) running Ubuntu. In my Vim setup, I have the EasyMotion plugin installed. However, the plugin does not load automatically when I start Vim. I have to manually run :PlugUpdate each time to get it working.

Here is my .vimrc file:

" Disable compatibility with vi, requiredset nocompatible" Required for pluginsfiletype off" Set leader keylet mapleader = " "" Initialize Vim-Plugcall plug#begin('~/.vim/plugged')" PluginsPlug 'mileszs/ack.vim'Plug 'dense-analysis/ale'Plug 'ctrlpvim/ctrlp.vim'Plug 'sjl/gundo.vim'Plug 'haya14busa/incsearch.vim'Plug 'preservim/nerdtree'Plug 'FooSoft/vim-argwrap'Plug 'jeetsukumaran/vim-buffergator'Plug 'easymotion/vim-easymotion'Plug 'haya14busa/incsearch.vim'Plug 'haya14busa/incsearch-easymotion.vim'Plug 'tpope/vim-fugitive'Plug 'jiangmiao/auto-pairs'" 自动补全括号Plug 'crusoexia/vim-monokai'Plug 'vim-airline/vim-airline'" 状态栏显示Plug 'junegunn/vim-easy-align'" 快速对齐" Initialize Vim-Plugcall plug#end()" Enable file type detection and pluginsfiletype plugin indent on" Syntax highlightingsyntax on" CtrlP configurationlet g:ctrlp_map = '<c-p>'let g:ctrlp_cmd = 'CtrlP'" Syntax and indentset showmatch " Show matching braces when text indicator is over them" Highlight current line, but only in active windowaugroup CursorLineOnlyInActiveWindow    autocmd!    autocmd VimEnter,WinEnter,BufWinEnter * setlocal cursorline    autocmd WinLeave * setlocal nocursorlineaugroup END" 256 colors configurationif has('gui_running')    colorscheme monokai    let g:lightline = {'colorscheme': 'monokai'}elseif &t_Co < 256    colorscheme monokai    set nocursorline " Looks bad in this modeendifset background=darkcolorscheme monokai" Basic editing configset shortmess+=I " Disable startup messageset nu " Number linesset rnu " Relative line numberingset numberwidth=5set virtualedit=onemoreset incsearch " Incremental search (as string is being typed)set hls " Highlight searchset listchars=tab:>>,nbsp:~ " Set list to see tabs and non-breakable spacesset lbr " Line breakset scrolloff=5 " Show lines above and below cursor (when possible)set noshowmode " Hide modeset laststatus=2set backspace=indent,eol,start " Allow backspacing over everythingset timeout timeoutlen=1000 ttimeoutlen=100 " Fix slow O insertsset lazyredraw " Skip redrawing screen in some casesset autochdir " Automatically set current directory to directory of last opened fileset hidden " Allow auto-hiding of edited buffersset history=8192 " More historyset nojoinspaces " Suppress inserting two spaces between sentencesset expandtabset tabstop=4set shiftwidth=4set softtabstop=4set ignorecaseset smartcaseset wildmode=longest,listset wildmenuset mouse+=a " Enable mouse mode (scrolling, selection, etc)if &term =~ '^screen'    set ttymouse=xterm2endifset nofoldenable " Disable folding by default" Misc configurationsmap <C-a> <Nop>map <C-x> <Nop>nmap Q <Nop>set noerrorbells visualbell t_vb=set splitbelowset splitrightnnoremap <C-j> <C-w>jnnoremap <C-k> <C-w>knnoremap <C-h> <C-w>hnnoremap <C-l> <C-w>lnnoremap <silent> <Leader>d :call ToggleMovementByDisplayLines()<CR>function SetMovementByDisplayLines()    noremap <buffer> <silent> <expr> k v:count ? 'k' : 'gk'    noremap <buffer> <silent> <expr> j v:count ? 'j' : 'gj'    noremap <buffer> 0 g0    noremap <buffer> $ g$endfunctionfunction ToggleMovementByDisplayLines()    if !exists('b:movement_by_display_lines')        let b:movement_by_display_lines = 0    endif    if b:movement_by_display_lines        let b:movement_by_display_lines = 0        silent! nunmap <buffer> k        silent! nunmap <buffer> j        silent! nunmap <buffer> 0        silent! nunmap <buffer> $    else        let b:movement_by_display_lines = 1        call SetMovementByDisplayLines()    endifendfunctionnnoremap <C-n> :set rnu!<CR>command -nargs=0 Sudow w !sudo tee % >/dev/null" Plugin configurationnnoremap <Leader>n :NERDTreeToggle<CR>nnoremap <Leader>f :NERDTreeFind<CR>let g:buffergator_suppress_keymaps = 1nnoremap <Leader>b :BuffergatorToggle<CR>nnoremap <Leader>u :GundoToggle<CR>if has('python3')    let g:gundo_prefer_python3 = 1endifnnoremap ; :CtrlPBuffer<CR>let g:ctrlp_switch_buffer = 0let g:ctrlp_show_hidden = 1command -nargs=+ Gag Gcd | Ack! <args>nnoremap K :Gag "\b<C-R><C-W>\b"<CR>:cw<CR>if executable('ag')    let g:ctrlp_user_command = 'ag %s -l --nocolor --hidden -g ""'    let g:ackprg = 'ag --vimgrep'endiflet g:syntastic_always_populate_loc_list = 1let g:syntastic_auto_loc_list = 1let g:syntastic_check_on_wq = 0let g:syntastic_mode_map = {    \ 'mode': 'passive',    \ 'active_filetypes': [],    \ 'passive_filetypes': []\}nnoremap <Leader>s :SyntasticCheck<CR>nnoremap <Leader>r :SyntasticReset<CR>nnoremap <Leader>i :SyntasticInfo<CR>nnoremap <Leader>m :SyntasticToggleMode<CR>nnoremap <Leader>w :ArgWrap<CR>noremap <Leader>x :OverCommandLine<CR>let g:markdown_fenced_languages = [    \ 'asm',    \ 'bash=sh',    \ 'c',    \ 'coffee',    \ 'erb=eruby',    \ 'javascript',    \ 'json',    \ 'perl',    \ 'python',    \ 'ruby',    \ 'yaml',    \ 'go',    \ 'racket',    \ 'haskell',    \ 'rust',\]let g:markdown_syntax_conceal = 0let g:markdown_folding = 1set tags^=.git/tags;~" Local customizationslet $LOCALFILE=expand("~/.vimrc_local")if filereadable($LOCALFILE)    source $LOCALFILEendifset laststatus=2set statusline=%f\ %y\ %mset statusline+=%{mode()}let g:EasyMotion_do_mapping = 1map <Leader>f <Plug>(easymotion-bd-f)nmap <Leader>f <Plug>(easymotion-overwin-f)nmap s <Plug>(easymotion-overwin-f2)nmap ss <Plug>(easymotion-s2)map <Leader>L <Plug>(easymotion-bd-jk)nmap <Leader>L <Plug>(easymotion-overwin-line)map <Leader>w <Plug>(easymotion-bd-w)nmap <Leader>w <Plug>(easymotion-overwin-w)autocmd cursorhold * set nohlsearchnoremap n :set hlsearch<cr>nnoremap N :set hlsearch<cr>Nnoremap / :set hlsearch<cr>/noremap ? :set hlsearch<cr>?noremap * *:set hlsearch<cr>Nmap z/ <Plug>(incsearch-easymotion-/)map z? <Plug>(incsearch-easymotion-?)map zg/ <Plug>(incsearch-easymotion-stay)

It will cause an error if I try to use some motions.

enter image description here

I am new to Linux and Vim, and find it quite difficult to deal with it.Thanks in advance!


Viewing all articles
Browse latest Browse all 6025

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>