Shougo / dein.vim

:zap: Dark powered Vim/Neovim plugin manager
MIT License
3.42k stars 197 forks source link

Error in dein lua script #516

Closed zdm closed 4 months ago

zdm commented 4 months ago

Description

⚠️ All issues without an minimal init.vim or instructions to reproduce can be automatically closed.

In newly released neovim 0.10.0 I get this error.

Error executing vim.schedule lua callback: ...re/nvim/bundle/.cache/init.vim/.dein/lua/compe/float.lua:99: attempt to call field '_trim' (a nil value)
stack traceback:
        ...re/nvim/bundle/.cache/init.vim/.dein/lua/compe/float.lua:99: in function 'show'
        ...e/nvim/bundle/.cache/init.vim/.dein/lua/compe/source.lua:229: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

This error happens when LSP suggestions window opened and I press CTRL+PAGE_DOWN to select suggestion from the list.

In previous major neovim release 0.9.x everything works fine.

To Reproduce

Steps to reproduce the behavior:

  1. Type "p"
  2. See suggestions window opened
  3. Press CTRL+PAGE_DOWN
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

image

Desktop:

Please complete the following information, when reporting bugs related to the Dein.vim.

Minimal Config

⚠️ Required when reporting bugs about plugins or the plugin manager.

See the minimal config example at README#Config Example, you can remove comments unrelated to the issue.

" vim:foldmethod=marker

if !$XDG_CONFIG_HOME | let $XDG_CONFIG_HOME = fnamemodify( stdpath("config"), ":h" ) | endif
if !$XDG_DATA_HOME | let $XDG_DATA_HOME = fnamemodify( stdpath("data"), ":h" ) | endif

" language, encoding {{{
let $LANG = 'en'

if has('win16') || has('win32') || has('win64')
    language English
else
    " language C.UTF-8
    " language en_GB.UTF-8
endif

set langmenu=none
set encoding=utf-8
" }}}

" terminal, gui {{{
autocmd GUIEnter * simalt ~X
set guifont=Liberation\ Mono:h10:cRUSSIAN
set guioptions=ceMgt

set nocompatible

set guicursor=n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50,a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor,sm:block-blinkwait175-blinkoff150-blinkon175

set termguicolors

if has('win16') || has('win32') || has('win64')
    source $VIMRUNTIME/mswin.vim
endif
" }}}

" init dein
" {{{
let g:bundle_path = stdpath("data") . "/bundle"

" clone dein if not extists
if !isdirectory(g:bundle_path . "/repos/github.com/Shougo/dein.vim")
    silent exec "!git clone https://github.com/Shougo/dein.vim " . g:bundle_path . "/repos/github.com/Shougo/dein.vim"
endif

if has('win16') || has('win32') || has('win64')
    let g:dein#types#git#command_path="git.exe"
endif

exec "set rtp+=" . g:bundle_path . "/repos/github.com/Shougo/dein.vim"
" }}}

" add plugins
if dein#load_state(expand(g:bundle_path)) " {{{
    call dein#begin(expand(g:bundle_path))

    call dein#add(g:bundle_path . "/repos/github.com/Shougo/dein.vim")

    " call dein#add("Shougo/vimproc.vim", {"build": "gmake"})
    call dein#add("Shougo/unite.vim")
    call dein#add("Shougo/unite-dein")
    call dein#add("Shougo/neomru.vim")
    " call dein#add("easymotion/vim-easymotion")
    call dein#add("Shougo/unite-outline")
    call dein#add("mbbill/undotree")
    call dein#add("powerman/vim-plugin-viewdoc")
    call dein#add("tomtom/tcomment_vim")
    " call dein#add("nathanaelkane/vim-indent-guides.git")
    call dein#add("mhinz/vim-signify")
    call dein#add("Konfekt/FastFold")
    call dein#add("Yggdroot/indentLine")

    " airline
    call dein#add("vim-airline/vim-airline")
    call dein#add("vim-airline/vim-airline-themes")

    " xkbd
    call dein#add("lyokha/vim-xkbswitch", {"depends": "DeXP/xkb-switch-win"})
    call dein#add("DeXP/xkb-switch-win")

    " perl
    call dein#add("zdm/vim-perl")
    " call dein#add("vim-perl/vim-perl")

    " javascript
    call dein#add("zdm/vim-javascript", {"autoload":{"filetypes":["javascript"]}})
    " call dein#add("pangloss/vim-javascript", {"autoload":{"filetypes":["javascript"]}})

    " c
    call dein#add("justinmk/vim-syntax-extra")

    " nginx
    call dein#add("zdm/vim-nginx")

    " other plugins
    " call dein#add("arecarn/vim-crunch")
    call dein#add("tpope/vim-fugitive")
    call dein#add("chrisyip/Better-CSS-Syntax-for-Vim", {"autoload":{"filetypes":["css"]}})
    " call dein#add("vim-scripts/autocorrect.vim")
    call dein#add("uguu-org/vim-matrix-screensaver")
    call dein#add("vim-scripts/forth.vim")
    call dein#add("vim-scripts/DirDiff.vim")
    " call dein#add("chrisbra/NrrwRgn")
    call dein#add("joelfrederico/vim-HiLinkTrace")
    call dein#add("zhimsel/vim-stay")

    call dein#add("pedrohdz/vim-yaml-folds")

    " postgresql syntax
    call dein#add("lifepillar/pgsql.vim")

    call dein#add("editorconfig/editorconfig-vim")

    " markdown
    call dein#add("foalford/vim-markdown-folding")

    " completion
    call dein#add("hrsh7th/nvim-compe")
    call dein#add("hrsh7th/vim-vsnip")
    " call dein#add("rafamadriz/friendly-snippets")

    " XXX disabled, because syntax/javascript.vim conflicted when used with dein
    " call dein#add("mattn/emmet-vim")

    " call dein#add("vim-scripts/Marks-Browser")
    " call dein#add("w0rp/ale")
    " call dein#add("hexman.vim")
    " call dein#add("motemen/xslate-vim")
    " call dein#add(highlight.vim")
    " call dein#add("tpope/vim-surround")

    " add vsnip
    exec "set rtp=" . stdpath("config") . "/vsnip," . &rtp

    call dein#end()
    call dein#save_state()
endif " }}}

" plugins settings
" unite {{{
let g:unite_data_directory = stdpath("data") . "/unite"
let g:unite_source_bookmark_directory = stdpath("config") . "/unite/bookmark"
let g:unite_force_overwrite_statusline = 0
let g:unite_cursor_line_highlight = 'CursorLine'
let g:unite_source_menu_menus = {}
let g:unite_winheight = 20
let g:unite_winwidth = 40
let g:unite_split_rule = 'botright'

autocmd FileType unite call s:uniteCustomization()
function! s:uniteCustomization()
    nmap <silent><buffer> <ESC> <Plug>(unite_exit)

    nnoremap <silent><buffer><expr> <C-t> unite#do_action('tabopen')
    inoremap <silent><buffer><expr> <C-t> unite#do_action('tabopen')

    nnoremap <silent><buffer><expr> <C-s> unite#do_action('split')
    inoremap <silent><buffer><expr> <C-s> unite#do_action('split')

    nnoremap <silent><buffer><expr> <C-v> unite#do_action('vsplit')
    inoremap <silent><buffer><expr> <C-v> unite#do_action('vsplit')

    nnoremap <silent><buffer><expr> <C-d> unite#do_action('delete')
    inoremap <silent><buffer><expr> <C-d> unite#do_action('delete')

    nnoremap <silent><buffer><expr> <C-CR> unite#do_action('tabswitch')
    inoremap <silent><buffer><expr> <C-CR> unite#do_action('tabswitch')
endfunction

nnoremap <silent> <F4> :Unite -buffer-name=buffers -toggle -prompt-direction=top -start-insert -no-restore buffer<CR>
inoremap <silent> <F4> <C-o>:Unite -buffer-name=buffers -toggle -prompt-direction=top -start-insert -no-restore buffer<CR>
vnoremap <silent> <F4> <ESC>:Unite -buffer-name=buffers -toggle -prompt-direction=top -start-insert -no-restore buffer<CR>

if has('win16') || has('win32') || has('win64')
    nnoremap <silent> <F3> :Unite -buffer-name=MRU -toggle -prompt-direction=top -start-insert -no-restore bookmark:default.windows neomru/file<CR>
    inoremap <silent> <F3> <C-o>:Unite -buffer-name=MRU -toggle -prompt-direction=top -start-insert -no-restore bookmark:default.windows neomru/file<CR>
    vnoremap <silent> <F3> <ESC>:Unite -buffer-name=MRU -toggle -prompt-direction=top -start-insert -no-restore bookmark:default.windows neomru/file<CR>
else
    nnoremap <silent> <F3> :Unite -buffer-name=MRU -toggle -prompt-direction=top -start-insert -no-restore bookmark:default.linux neomru/file<CR>
    inoremap <silent> <F3> <C-o>:Unite -buffer-name=MRU -toggle -prompt-direction=top -start-insert -no-restore bookmark:default.linux neomru/file<CR>
    vnoremap <silent> <F3> <ESC>:Unite -buffer-name=MRU -toggle -prompt-direction=top -start-insert -no-restore bookmark:default.linux neomru/file<CR>
endif
" }}}

" Shougo/neomru.vim {{{
let g:neomru#file_mru_path = g:unite_data_directory . "/neomru/file"
let g:neomru#directory_mru_path = g:unite_data_directory . "/neomru/directory"
" }}}

" vim-scripts/Marks-Browser {{{
" nnoremap <silent> <F7> :MarksBrowser<CR>
" inoremap <silent> <F7> <C-o>:MarksBrowser<CR>
" vnoremap <silent> <F7> <ESC>:MarksBrowser<CR>
" }}}

" Shougo/unite-outline {{{
nnoremap <silent> <F8> :Unite -buffer-name=outline -toggle -vertical -direction=botright -winwidth=60 -start-insert -no-restore outline<CR>
inoremap <silent> <F8> <C-o>:Unite -buffer-name=outline -toggle -vertical -direction=botright -winwidth=60 -start-insert -no-restore outline<CR>
vnoremap <silent> <F8> <ESC>:Unite -buffer-name=outline -toggle -vertical -direction=botright -winwidth=60 -start-insert -no-restore outline<CR>
" }}}

" mbbill/undotree {{{
let g:undotree_WindowLayout = 2
let g:undotree_SplitWidth = 40
let g:undotree_SetFocusWhenToggle = 1
let g:undotree_DiffAutoOpen = 0

nnoremap <silent> <F10> :UndotreeToggle<CR>
inoremap <silent> <F10> <C-o>:UndotreeToggle<CR>
vnoremap <silent> <F10> <ESC>:UndotreeToggle<CR>
" }}}

" vim-airline/vim-airline {{{
let g:airline_theme = 'wombat'
let g:airline_symbols_ascii = 1

" extensions
let g:airline#extensions#whitespace#enabled = 0
let g:airline#extensions#coc#enabled = 0

set guioptions-=e " disable gvim tabbar, comment this if tabline is not enabled
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#show_buffers = 0
let g:airline#extensions#tabline#show_splits = 0
let g:airline#extensions#tabline#show_tabs = 1
let g:airline#extensions#tabline#show_tab_nr = 0
let g:airline#extensions#tabline#show_tab_type = 0
let g:airline#extensions#tabline#close_symbol = '×'
let g:airline#extensions#tabline#show_close_button = 0
let g:airline#extensions#xkblayout#enabled = 0

" default formatter
" let g:airline#extensions#tabline#fnamecollapse = 0
let g:airline#extensions#tabline#fnamemod = ':t'

let g:airline#extensions#tabline#formatter = 'short_path'

" " customize airline sections
" function! AirlineInit()
    " let g:airline_section_x = airline#section#create_left(['session'])
" endf
" autocmd VimEnter * call AirlineInit()
" }}}

" lyokha/vim-xkbswitch {{{
let g:XkbSwitchEnabled = 1
let g:XkbSwitchIMappings = ['ru']
let g:XkbSwitchIMappingsSkipFt = ['tex']
let g:XkbSwitchNLayout = 'US'
let g:XkbSwitchILayout = 'US'
if has('unix')
    let g:XkbSwitchLib = ""
elseif has('win64')
    let g:XkbSwitchLib = g:bundle_path . "/.cache/init.vim/.dein/bin/libxkbswitch64.dll"
elseif has('win32')
    let g:XkbSwitchLib = g:bundle_path . "/.cache/init.vim/.dein/bin/libxkbswitch32.dll"
endif
" }}}

" zdm/vim-perl {{{
let perl_sync_dist = 250
let perl_fold = 1
let perl_fold_anonymous_subs = 1
let perl_fold_do_blocks = 1
let perl_nofold_packages = 1
let perl_include_pod = 1
let perl_sub_signatures = 1
" let perl_no_sync_on_sub = 1 " TODO maybe this prevent unfold on new block create
" }}}

" powerman/vim-plugin-viewdoc {{{
let g:viewdoc_openempty = 1
" if !exists('g:no_plugin_abbrev') && !exists('g:no_viewdoc_abbrev')
"     cnoreabbrev <expr> h  getcmdtype()==':' && getcmdline()=='h'  ? 'ViewDocHelp'  : 'h'
"     cnoreabbrev <expr> h! getcmdtype()==':' && getcmdline()=='h!' ? 'ViewDocHelp'  : 'h!'

"     cnoreabbrev <expr> pd  getcmdtype()==':' && getcmdline()=='pd'  ? 'ViewDocPerl'  : 'pd'
"     cnoreabbrev <expr> pd! getcmdtype()==':' && getcmdline()=='pd!' ? 'ViewDocPerl'  : 'pd!'
" endif
" }}}

" tomtom/tcomment_vim {{{
let g:tcomment_maps = 0
let g:tcomment#blank_lines = 0
let g:tcomment#filetype#guess_perl = 1
let g:tcomment#filetype#syntax_map = {
\   'perlHereDocSQL': 'sql',
\   'perlHereDocJS': 'javascript',
\   'perlHereDocC': 'c',
\   'perlHereDocCPP': 'cpp'
\ }

let g:tcomment#replacements_xml = {
\   '<!--': '<!-&#45;',
\   '-->': '&#45;->'
\ }

call tcomment#type#Define('dosbatch', ':: %s')

nnoremap <silent> <Leader>c :TComment<CR>j
inoremap <silent> <Leader>c <C-o>:TComment<CR><C-o>j
vnoremap <silent> <Leader>c :TComment<CR>
vnoremap <silent> <Leader>C :TCommentBlock<CR>
" }}}

" nathanaelkane/vim-indent-guides.git {{{
let g:indent_guides_auto_colors = 1
let g:indent_guides_start_level = 2
let g:indent_guides_guide_size = 1
" }}}

" mhinz/vim-signify {{{
let g:signify_vcs_list = [ 'git' ]
let g:signify_realtime = 1

autocmd ColorScheme * highlight DiffAdd    term=bold cterm=bold ctermbg=22  ctermfg=Green gui=bold guibg=DarkGreen guifg=Green
autocmd ColorScheme * highlight DiffChange term=bold cterm=bold ctermbg=24  ctermfg=Cyan  gui=bold guibg=DarkCyan  guifg=Cyan
autocmd ColorScheme * highlight DiffDelete term=bold cterm=bold ctermbg=124 ctermfg=Red   gui=bold guibg=DarkRed   guifg=Red
" }}}

" pangloss/vim-javascript {{{
let g:javascript_plugin_jsdoc = 1
" }}}

" Konfekt/FastFold {{{
let g:fastfold_savehook = 0
" }}}

" Yggdroot/indentLine {{{
let g:indentLine_enabled = 1 " enabled by default
" let g:indentLine_char = '│'
" let g:indentLine_showFirstIndentLevel = 1
" let g:indentLine_fileType = ['pl', 'pm', 'perl', 'js']
let g:indentLine_fileTypeExclude = ['json', 'markdown']
let g:indentLine_faster = 1 " works faster, but issues are possible

nnoremap <silent> <Leader>ii :IndentLinesToggle<CR>
inoremap <silent> <Leader>ii <ESC>:IndentLinesToggle<CR>a
vnoremap <silent> <Leader>ii <ESC>:IndentLinesToggle<CR>gv
" }}}

" completion {{{
set omnifunc=syntaxcomplete#Complete
set complete-=i
set iskeyword+=:
set completeopt=menuone,noselect

let g:compe = {}
let g:compe.enabled = v:true
let g:compe.documentation = v:true

let g:compe.source = {}
let g:compe.source.calc = v:true
let g:compe.source.vsnip = v:true
" let g:compe.source.buffer = v:true
" let g:compe.source.tags = v:true
" let g:compe.source.spell = v:true

inoremap <silent><expr> <C-Space> compe#complete()
inoremap <silent><expr> <CR>      compe#confirm("<CR>")
inoremap <silent><expr> <C-e>     compe#close("<C-e>")
inoremap <silent><expr> <C-f>     compe#scroll({ "delta": +4 })
inoremap <silent><expr> <C-d>     compe#scroll({ "delta": -4 })

let g:vsnip_snippet_dir = stdpath("config") . "/vsnip"
" }}}

" foalford/vim-markdown-folding {{{
if has("autocmd")
    filetype plugin indent on

    " autocmd FileType markdown set foldexpr=NestedMarkdownFolds()
endif
" }}}

" postgresql
let g:sql_type_default = "pgsql"
let g:pgsql_fold_functions_only = 1

" disable highlight for html comments
let html_wrong_comments=1

" disable redefining tab width for yaml in default fs plugin
" let g:yaml_recommended_style=0

" for .sh files highlight (make compatible with .bash)
let g:is_posix=1

" configure folding for .sh scripts
let g:sh_fold_enabled = 3

" prevent create .netrwhist
let g:netrw_dirhistmax=0

" disable hide of double quotes in json syntax
let g:vim_json_conceal=0

" install missed plugins
if dein#check_install() | call dein#install() | endif

filetype plugin indent on
set modeline

" colors {{{
set background=dark

autocmd ColorScheme * highlight CursorLine term=NONE cterm=bold ctermbg=NONE ctermfg=NONE gui=bold guibg=Grey10 guifg=NONE
autocmd ColorScheme * highlight SignColumn term=NONE cterm=bold ctermbg=NONE ctermfg=NONE gui=bold guibg=NONE   guifg=NONE
autocmd ColorScheme * highlight Folded     term=NONE cterm=bold ctermbg=NONE ctermfg=NONE gui=bold guibg=NONE   guifg=Gold

colorscheme default

set cursorline
set nocursorcolumn
set hlsearch

syntax on

hi Pmenu guifg=#c0c0c0 guibg=#404080
hi PmenuSel gui=bold guifg=#c0c0c0 guibg=#2050d0
hi PmenuSbar guifg=blue guibg=darkgray
hi PmenuThumb guifg=#c0c0c0
" }}}

" backspace and cursor keys wrap to previous/next line
set backspace=indent,eol,start whichwrap+=<,>,[,]

set history=50   " keep 50 lines of command line history
set ruler        " show the cursor position all the time
set showcmd      " display incomplete commands
set incsearch    " you will see results while you type
set ignorecase   " ignore case when searching
set smartcase    " use smartcase

set nobackup

" swap
if !isdirectory(stdpath("data") . "/swap") | call mkdir(stdpath("data") . "/swap", "p", 0700) | endif
exec "set dir=" . stdpath("data") . "/swap//"
" swap is disabled
set noswapfile

" undo
set undofile
if !isdirectory(stdpath("data") . "/undo") | call mkdir(stdpath("data") . "/undo", "p", 0700) | endif
exec "set undodir=" . stdpath("data") . "/undo"

" set cryptmethod=blowfish2 " not supported in nvim

set scrolloff=2
set wrap         " включаем перенос строк
" set linebreak    " перенос строк по словам, а не по буквам
set tabstop=4    " размер табуляции
set shiftwidth=4 " размер сдвига при нажатии на клавиши << и >>
set autoindent   " копирует отступ от предыдущей строки
set smartindent  " включаем 'умную' автоматическую расстановку отступов

set number " show line numbers
set mouse=a

" spelling && keyboard layout {{{
if !isdirectory(stdpath("data") . "/spell") | call mkdir(stdpath("data") . "/spell", "p", 0700) | endif
exec "set spellfile=" . stdpath("data") . "/spell/default.add"
set mousemodel=popup_setpos
set imsearch=-1
" }}}

" file settings {{{
set fileencodings=ucs-bom,utf-8,cp1251
set fileformats=unix,dos
set fileformat=unix
set nobomb
" }}}

" folding {{{
" set nofoldenable
" set foldlevelstart=99
set foldmethod=marker
" set foldcolumn=0
" }}}

" session
set sessionoptions=buffers,curdir,folds,slash,tabpages,unix,winsize

" views
" exec "set viminfo='50,<100,s100,!,n" . stdpath("data") . "/.viminfo"

set viewoptions=cursor,folds,options,slash,unix
exec "set viewdir=" . stdpath("data") . "/view"

" tabline
set laststatus=2
set showtabline=2

" disable bell
set noerrorbells visualbell t_vb=
autocmd GUIEnter * set visualbell t_vb=

set noautoread " don't reload modified file automatically
autocmd FocusGained * :checktime " notify on file modified

" open new tab with <C-t> {{{
nnoremap <silent> <C-t> :tabnew<CR>
inoremap <silent> <C-t> <ESC>:tabnew<CR>a
vnoremap <silent> <C-t> <ESC>:<C-o>tabnew<CR>gv
" }}}

" switch tabs with <C-PageUp>, <C-PageDown> {{{
nnoremap <silent> <C-PageUp> :tabprevious<CR>
inoremap <silent> <C-PageUp> <ESC>:tabprevious<CR>a
vnoremap <silent> <C-PageUp> <ESC>:tabprevious<CR>gv

nnoremap <silent> <C-PageDown> :tabnext<CR>
inoremap <silent> <C-PageDown> <ESC>:tabnext<CR>a
vnoremap <silent> <C-PageDown> <ESC>:tabnext<CR>gv
" }}}

" switch tabs with <C-TAB>, <C-S-TAB> {{{
nnoremap <silent> <C-S-TAB> :tabprevious<CR>
inoremap <silent> <C-S-TAB> <ESC>:tabprevious<CR>a
vnoremap <silent> <C-S-TAB> <ESC>:tabprevious<CR>gv

nnoremap <silent> <C-TAB> :tabnext<CR>
inoremap <silent> <C-TAB> <ESC>:tabnext<CR>a
vnoremap <silent> <C-TAB> <ESC>:tabnext<CR>gv
" }}}

" move tabs with <C-S-PageUp>, <C-S-PageDown> {{{
nnoremap <silent> <C-S-PageUp> :-tabm<CR>
inoremap <silent> <C-S-PageUp> <ESC>:-tabm<CR>a
vnoremap <silent> <C-S-PageUp> <ESC>:-tabm<CR>gv

nnoremap <silent> <C-S-PageDown> :+tabm<CR>
inoremap <silent> <C-S-PageDown> <ESC>:+tabm<CR>a
vnoremap <silent> <C-S-PageDown> <ESC>:+tabm<CR>gv
" }}}

" move tabs with <C-S-J>, <C-S-K> {{{
nnoremap <silent> <C-S-J> :-tabm<CR>
inoremap <silent> <C-S-J> <ESC>:-tabm<CR>a
vnoremap <silent> <C-S-J> <ESC>:-tabm<CR>gv

nnoremap <silent> <C-S-K> :+tabm<CR>
inoremap <silent> <C-S-K> <ESC>:+tabm<CR>a
vnoremap <silent> <C-S-K> <ESC>:+tabm<CR>gv
" }}}

" make <TAB> ident code {{{
nnoremap <TAB>   I<TAB><ESC>
nnoremap <S-TAB> ^i<BS><ESC>
vnoremap <TAB>   >gv
vnoremap <S-TAB> <gv
" }}}

" * - highlites word under cursor {{{
nnoremap <silent> * *N
" }}}

" <SPACE> - cleanup search highlight in NORMAL mode {{{
nnoremap <silent> <Space> :noh<CR>
" }}}

" <CR> - switch VIM to INSERT mode {{{
nnoremap <CR> a
" }}}

" <C-W><C-ARROW> - move windows (not work in console) {{{
nnoremap <C-W><C-Left> <C-W>H
nnoremap <C-W><C-Right> <C-W>L
nnoremap <C-W><C-Up> <C-W>K
nnoremap <C-W><C-Down> <C-W>J
" }}}

" open current buffer in the new tab {{{
nnoremap <C-W>t <C-W>T
" }}}

" remap Up and Down {{{
nnoremap <Up>     gk
nnoremap <Down>   gj
nnoremap <S-Up>   gh<C-o>gk
nnoremap <S-Down> gh<C-o>gj
inoremap <Up>     <C-o>gk
inoremap <Down>   <C-o>gj
inoremap <S-Up>   <C-o>gh<C-o>gk
inoremap <S-Down> <C-o>gh<C-o>gj
xnoremap <Up>     gk
xnoremap <Down>   gj
xnoremap <S-Up>   k
xnoremap <S-Down> j
xnoremap <Left>   h
xnoremap <Right>  l
snoremap <S-Up>   <C-o>gk
snoremap <S-Down> <C-o>gj
" }}}

" \ss - syntax refresh {{{
func! SyntaxRefresh()
    let l:cursor_pos = getpos(".")

    set syntax=off

    set syntax=on

    syn sync fromstart

    call setpos(".", l:cursor_pos)

    normal zv " unfold lines under cursor
    normal zz " center cursor on screen

    return
endfunc

nnoremap <silent> <Leader>ss :call SyntaxRefresh()<CR>
inoremap <silent> <Leader>ss <ESC>:call SyntaxRefresh()<CR>a
vnoremap <silent> <Leader>ss <ESC>:call SyntaxRefresh()<CR>gv
" }}}

" sessions - unite F5 menu {{{
let g:unite_source_session_enable_auto_save = 1

nnoremap <silent> <F5> :Unite -buffer-name=session -toggle -prompt-direction=top -hide-source-names session session/new<CR>
inoremap <silent> <F5> <C-o>:Unite -buffer-name=session -toggle -prompt-direction=top -hide-source-names session session/new<CR>
vnoremap <silent> <F5> <ESC>:Unite -buffer-name=session -toggle -prompt-direction=top -hide-source-names session session/new<CR>
" }}}

" helper - unite F2 menu {{{
nnoremap <silent> <F2> :Unite -buffer-name=helper -toggle -prompt-direction=top -start-insert -no-restore menu:helper<CR>
inoremap <silent> <F2> <C-o>:Unite -buffer-name=helper -toggle -prompt-direction=top -start-insert -no-restore menu:helper<CR>
vnoremap <silent> <F2> <ESC>:Unite -buffer-name=helper -toggle -prompt-direction=top -start-insert -no-restore menu:helper<CR>
" }}}

" rpc lint mappings {{{
nnoremap <silent> <Leader>sd :SrcLint<CR>
inoremap <silent> <Leader>sd <ESC>:SrcLint<CR>
vnoremap <silent> <Leader>sd <ESC>:SrcLint<CR>

nnoremap <silent> <Leader>sc :SrcCompress<CR>
inoremap <silent> <Leader>sc <ESC>:SrcCompress<CR>
vnoremap <silent> <Leader>sc <ESC>:SrcCompress<CR>

nnoremap <silent> <Leader>so :SrcObfuscate<CR>
inoremap <silent> <Leader>so <ESC>:SrcObfuscate<CR>
vnoremap <silent> <Leader>so <ESC>:SrcObfuscate<CR>
" }}}

" set titlestring {{{
function! SetTitleString()
    let _ = ''

    let name = expand('%F')

    if empty(name)
        let _ .= '[No Name]'

        if &mod | let _ .= '+' | endif
    else
        if name =~ 'term://'
            " Neovim Terminal
            let _ = substitute(name, '\(term:\)//.*:\(.*\)', '\1 \2', '')

            if &mod | let _ .= '+' | endif
        else
            let _ .= fnamemodify(name, ':p:h:t') . '/' . fnamemodify(name, ':t')

            if &mod | let _ .= '+' | endif

            let _ .= ' (' . fnamemodify(name, ':p:h:h') . ')'
        endif
    endif

    return _
endfunction

" set titlestring=%{SetTitleString()}

set title " mandatory for neovim-qt
" }}}

Additional context

Add any other context about the problem here.

zdm commented 4 months ago

Please, tell me if you will need any additional info. If my config and error description will not be enough to find the error - please tell me, I will try to create minimal config, but this may take some time.

Shougo commented 4 months ago

Sorry. It means nvim-compe does not support the latest neovim API. Please see it is already archived. https://github.com/hrsh7th/nvim-compe

You should use nvim-cmp instead. https://github.com/hrsh7th/nvim-cmp