How to remove file name from VIM menu?

I installed the pydiction dictionary in vim so that I can get a list of python commands when I click the tab after the partially entered command. Everything works fine, but every time the menu appears, there is a file name, except for each command in the list. How to remove this name from the menu?

plz, look at the image: http://www.uzbozor.com/uploads/vim.png (copy and paste the link if the click doesn’t work)

thanks

+3
source share
1 answer

I have not been able to solve this very elegantly, but there is a workaround by writing a special completion function that simply adjusts the dictionary file for matches:

function! MyCompleteFunction( findstart, base )
  if a:findstart
    let line = getline('.')
    let start = col('.') - 1
    while start > 0 && line[start - 1] =~ '[A-Za-z_]'
        let start -= 1
    endwhile
    return start
  else
    silent call DictGrep( a:base, 'path\to\dictionary\file' )
    let matches = []
    for thismatch in getqflist()
        call add(matches, thismatch.text)
    endfor
    return matches
  endif
endfunction

, DictGrep(), vimgrep. , :

function! DictGrep( leader, file )
    try
        exe "vimgrep /^" . a:leader . ".*/j " . a:file
    catch /.*/
        echo "no matches"
    endtry
endfunction

set fullfunc:

setlocal completefunc=MyCompleteFunction()

( , ).

vimgrep , , .

, .

+1

Source: https://habr.com/ru/post/1724453/


All Articles