Git Product home page Git Product logo

neocomplete.vim's Introduction

neocomplete

Note: This plugin is not compatible with above Vim 8.2.1066! https://github.com/vim/vim/commit/bd84617d1a6766efd59c94aabebb044bef805b99

Note: The development of this plugin is finished. Accepts minor patches and issues but no new features. ddc.vim is the next generation auto completion plugin. Consider migrating to it.

neocomplete is the abbreviation of "neo-completion with cache". It provides keyword completion system by maintaining a cache of keywords in the current buffer. neocomplete can be customized easily and has many more features than Vim's built-in completion.

Note: If you use neovim or Vim8+, you should use deoplete instead. https://github.com/Shougo/deoplete.nvim

Installation

Note: neocomplete requires Vim 7.3.885+ with Lua enabled. See requirements if you aren't sure whether you have this.

  1. Extract the files and put them in your Vim directory (usually ~/.vim/ or Program Files/Vim/vimfiles on Windows).
  2. Execute the :NeoCompleteEnable command or set let g:neocomplete#enable_at_startup = 1 in your .vimrc (not in .gvimrc or _gvimrc!)

Requirements

neocomplete requires Vim 7.3.885+ compiled with if_lua. If :echo has("lua") returns 1, then you're done; otherwise, see below.

Vim builds for Windows

github release

Note: the Vim build may not include the Lua DLL. In that case, download Lua and put the lua52.dll file in the same directory as gvim.exe.

Vim for Mac OS X:

MacVim with if\_lua

Or, you can install MacVim with homebrew: (Make sure you have Xcode fully installed)

brew cask install macvim --with-cscope --with-lua

To install Vim (as opposed to MacVim) with homebrew:

brew install vim --with-luajit

Vim for Linux:

Debian (or Ubuntu)

Make sure you have any of these packages:

  • vim-nox
  • vim-gtk3

Which package depends on your graphical environment (except vim-nox which is for vim with no GUI).

Fedora

The latest version of vim includes lua. As of 2014-04-16 you need to download the rpm.

Misc

Be aware, your distribution's package manager may have a fairly outdated Vim build (for example, Ubuntu 12.04 ships Vim 7.3.429). However, building Vim on Linux is not difficult. Remember to specify --with-lua (or --with-features=huge).

Vim for Cygwin:

In a cygwin environment, the Lua interface is supported by default.

If you want to make manually, you also need gcc and make.

When everything is prepared, execute these commands.

cd /usr/src
tar jxf vim-7.4.tar.bz2
tar xvfz lua-5.1.5.tar.gz
cd vim74/
./configure --enable-luainterp --enable-gui=no \
--without-x --enable-multibyte --prefix=/usr
make && make install

To check if everything was successfull enter the following vim --version. You should see +lua in the list of features.

Snippets

The Snippets feature of neocomplete was split into a separate plugin.

A migration guide for existing users of neocomplcache is available: Migration guide

Screenshots

Original filename completion

Original filename completion. Include filename completion.

Omni completion

Omni completion.

Completion with vimshell

Completion with vimshell(http://github.com/Shougo/vimshell).

Vim completion (provided by neco-vim)

Vim completion. Vim completion with animation.

Configuration Examples

"Note: This option must be set in .vimrc(_vimrc).  NOT IN .gvimrc(_gvimrc)!
" Disable AutoComplPop.
let g:acp_enableAtStartup = 0
" Use neocomplete.
let g:neocomplete#enable_at_startup = 1
" Use smartcase.
let g:neocomplete#enable_smart_case = 1
" Set minimum syntax keyword length.
let g:neocomplete#sources#syntax#min_keyword_length = 3

" Define dictionary.
let g:neocomplete#sources#dictionary#dictionaries = {
    \ 'default' : '',
    \ 'vimshell' : $HOME.'/.vimshell_hist',
    \ 'scheme' : $HOME.'/.gosh_completions'
        \ }

" Define keyword.
if !exists('g:neocomplete#keyword_patterns')
    let g:neocomplete#keyword_patterns = {}
endif
let g:neocomplete#keyword_patterns['default'] = '\h\w*'

" Plugin key-mappings.
inoremap <expr><C-g>     neocomplete#undo_completion()
inoremap <expr><C-l>     neocomplete#complete_common_string()

" Recommended key-mappings.
" <CR>: close popup and save indent.
inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
function! s:my_cr_function()
  return (pumvisible() ? "\<C-y>" : "" ) . "\<CR>"
  " For no inserting <CR> key.
  "return pumvisible() ? "\<C-y>" : "\<CR>"
endfunction
" <TAB>: completion.
inoremap <expr><TAB>  pumvisible() ? "\<C-n>" : "\<TAB>"
" <C-h>, <BS>: close popup and delete backword char.
inoremap <expr><C-h> neocomplete#smart_close_popup()."\<C-h>"
inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
" Close popup by <Space>.
"inoremap <expr><Space> pumvisible() ? "\<C-y>" : "\<Space>"

" AutoComplPop like behavior.
"let g:neocomplete#enable_auto_select = 1

" Shell like behavior(not recommended).
"set completeopt+=longest
"let g:neocomplete#enable_auto_select = 1
"let g:neocomplete#disable_auto_complete = 1
"inoremap <expr><TAB>  pumvisible() ? "\<Down>" : "\<C-x>\<C-u>"

" Enable omni completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags

" Enable heavy omni completion.
if !exists('g:neocomplete#sources#omni#input_patterns')
  let g:neocomplete#sources#omni#input_patterns = {}
endif
"let g:neocomplete#sources#omni#input_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
"let g:neocomplete#sources#omni#input_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)'
"let g:neocomplete#sources#omni#input_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'

" For perlomni.vim setting.
" https://github.com/c9s/perlomni.vim
let g:neocomplete#sources#omni#input_patterns.perl = '\h\w*->\h\w*\|\h\w*::'

neocomplete.vim's People

Contributors

afifsohaili avatar andresilveirah avatar bluehavana avatar cpfaff avatar crazymaster avatar dusans avatar e7h4n avatar harciga avatar ichizok avatar itchyny avatar jsit avatar juggernaut- avatar justinmk avatar laxtiz avatar mixmix avatar nigorojr avatar nikolai-b avatar osyo-manga avatar petobens avatar rhysd avatar shougo avatar skeept avatar syngan avatar tonimaru avatar trevors avatar ujihisa avatar wilywampa avatar wor avatar yama-ver2 avatar zimbatm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neocomplete.vim's Issues

& 付きの変数を補完しようとすると、&& になる

2013-08-14 23 21 22

画像のとおりです。ソースコードは覗いていません (`д´;)
popupmenu の中身が && なだけで、実際に補完された結果は大丈夫です。

VIM - Vi IMproved 7.4a BETA (2013 Jul 6, compiled Jul 12 2013 11:26:33)
MacOS X (unix) version
Included patches: 1-9

バージョン/パッチレベルだったらごめんなさい。

adding dictionary

i have a question about adding /usr/share/dict/words to it. my attempts so far has been to append this (when mutt calls vim for editing mail):

let g:neocomplcache_dictionary_filetype_lists = {
\ 'dict' : '/usr/share/dict'
\ }

to .vimrc but i've had not luck getting neocomplete to query 'words' file
under dict/

unite command completion issue with neocomplete

After vim started,

Step 1

:echo exists('*unite#version')
This output 0.

Step 2

when I executed code like the line below:

:Unite <press a tab key here>

vim will give me auto command argument completion, but there're some error message:

Error detected while processing function unite#complete#source..unite#init#_sources..unite#init#_default_scripts..unite#sources#neocomplete#define:
line 2:
Your unite.vim is too old.

Step 3

And the next time I run ":Unite ", this problem is gone.

:echo exists('*unite#version')

This time , it outputs 1.

I've the latest neocomplete and unite from the their git repo.

Question/Idea: Neocomplcache migration guide

Hello Shougo.

I've been using neocomplcache and I have some configurations options in my .vimrc of course...

So, in order to migrate to neocomplete, do we have to do anything? or just doing something like %s/neocomplache/neocomplete/g would be enough?

Finally, if there's anything we need to do for this migration, it might be a good idea to include it in the README somewhere?

Thanks for the great plugin(s)!

neocomplete don't work

set viminfo+=! " Save and restore global variables.
set sessionoptions=sesdir,help,tabpages,winsize,winpos,folds,resize
let $VIMSESSION = '~/PluginConfig/session.vim'
autocmd VimLeave * mksession! $VIMSESSION
nmap :so $VIMSESSION

when open several tabs together, only tab that the first enter insert mode can be complemented

*fill-in* the first candidate (google chrome's style)

is it possible to have an autocompletion like the way google's chrome autcompletes URL's?

my first impression, btw, was that this would accomplish what i'm looking for:
inoremap neocomplete#complete_common_string()

a gift animated would perhaps expalin this best but while i'm looking for an git-animation editor (suggstions are welcomed).

Erlang support question

Hi iwas attempting to use neocomplete for erlang omni completion on functions
(of the form
module:function
or in regex style
module:function is
[^\s]+:[^\s]+
)
when i use the following it doesnt show the autocomplete popup after :

let g:neocomplete#sources#omni#input_patterns.erlang = '[^. *\t]:\w*'

instead I need to press ctrl+space to show it.
I have also tried

        let g:neocomplete#delimiter_patterns.erlang = [':', '#']

and
let g:neocomplete#keyword_patterns.erlang = '[^\s]+:\w*'

When i use the following it does show it continuously, but fuzzy matching stops working.

let g:neocomplete#force_omni_input_patterns.erlang = '[^. *\t]:\w*'

I have tried many different input_patters / delimiter patterns and keyword patterns.
This behaviour seems a little bit odd.
as an example with YouCompleteMe the following works

let g:ycm_semantic_triggers =  {
    \   'erlang' : [':']
\ }

Is there something else I should do.
Thanks for the help and great plugin.

I understand erlang syntax so if you can lead me down the right path i may be able to fix it.

Undo history cluttered

With neocomplete disabled, open an empty file, go into insert mode, type "123456" and leave insert mode.

The undo history now has one entry "+123456" as expected. Undo will reverse this insertion in one go.

Now, with neocomplete enabled, open an empty file, go into insert mode, type "123456" and leave insert mode.

The undo history is now longer than before listing three changes.

First:

+1234

Second:

-1234
+12345

Third:

-12345
+123456

With neocomplete enabled, one therefore has to undo three changes instead of one to undo the insertion of "123456".

(Vim 7.3.1287, neocomplete default configuration)

Index out of range on completing common string

"neocomplete.txt" [RO] 1822L, 62797C
search hit BOTTOM, continuing at TOP
search hit BOTTOM, continuing at TOP
Error detected while processing function neocomplete#complete_common_string..neocomplete#mappings#complete_commo
n_string:
line   25:
E684: list index out of range: 0
Error detected while processing function neocomplete#complete_common_string..neocomplete#mappings#complete_commo
n_string:
line   25:
E15: Invalid expression: candidates[0].word
Error detected while processing function neocomplete#complete_common_string..neocomplete#mappings#complete_commo
n_string:
line   34:
E121: Undefined variable: common_str
Error detected while processing function neocomplete#complete_common_string..neocomplete#mappings#complete_commo
n_string:
line   34:
E116: Invalid arguments for function tolower(common_str)
Error detected while processing function neocomplete#complete_common_string..neocomplete#mappings#complete_commo
n_string:
line   34:
E15: Invalid expression: tolower(common_str)

Programming language support?

Hi Shougo,

I'm a huge fan of your Unite.vim and really want to switch to neocompete from youcompleteme. I'm wondering if it support objective-c language???.
If not, how would I modify to make a certain language compatable with neocomplete?

filetype=cpp 時にシンタックス補完が行われない

次のような vimrc を使用した場合に C++ のシンタックス補完が行われない場合があります。

scriptencoding utf-8


set nocompatible
filetype off

set rtp+=$VIM/dotfiles/neobundle.vim/

if has('vim_starting')
    call neobundle#rc(expand($VIM."/.vim/neobundle"))
endif

NeoBundle "Shougo/neocomplete.vim"

filetype plugin indent on

let g:neocomple#enable_at_startup=1

NeoCompleteSyntaxMakeCacheを行うと補完が行われるようになります。

neocomplete and Vim 7.4 on Windows 7

Hi

I installed vim 7.4 on Windows 7 yesterday and copied over lua51.dll and luajit.exe. This is what I'd done in the 7.4a beta. However, in the 7.4 release neocomplete gives the message that it "does not work [in] this version of Vim. It requires Vim 7.3.885 or above and "if_lua" enabled Vim". When I look at :version it has "-lua". Is there something I need to do extra?

I've run neobundle update.

In the past, I have downloaded kaoriya Win32 but that has non-English characters and is unusable. As it happens, currently that version is 7.3 anyway.

Thanks in advance.

Praful

initial input speed

when I first open a file and input the first few characters, neocomplet speed is slow.

if the file is large, the speed is rather slow.

why is it so?

auto select

let g:neocomplete#enable_auto_select = 1
qq20130701205707

it don't auto select!

python import problem

When i type
import or from
i get the following error (also noticed that u have to have unite go get a good error message)

import
function neocomplete#complete#auto_complete..neocomplete#complete#manual_complete..neocomplete#complete#_get_words..neocomplete#helper#call_filters..198, line 1
Vim(let):E716: Key not present in Dictionary: action__is_directory
[unite.vim] Error occured in calling filter sorter_filename!
[unite.vim] Source name is file/include

env:

Windows 7 64 bit
Vim 7.4 64bit with python2.7 and lua5.2
latest neocomplete from github

Having trouble compiling vim with lua in Linux

Cannot use homebrew option in linux. Tried recompiling vim with Lua and got no luck. Google didn't help either because seemed nobody is using this compilation option. Is there any tutorial that would help this process?

neocomplete screenshots

I want to replace the screenshots in README.

If you have good screenshots for neocomplete README, can you add it in this issue?

NeoBundleUpdate throwing an error

[neobundle/install] ( 1/36): |vim-flake8| git pull --rebase && git submodule update --init --recursive                                                                                                               
Error detected while processing function neobundle#installer#install..<SNR>163_install..neobundle#installer#sync:                                                                                                    
line   74:                                                                                                                                                                                                           
E480: No match: `=cwd`

I'm not sure if this is related, but I also have Fugative installed, and when I try and run :Gdiff I'm getting this:

Error detected while processing function <SNR>46_Diff..<SNR>46_repo_git_chomp_in_tree:                                                                                                                               
line    7:                                                                                                                                                                                                           
E480: No match: `=dir`                                                                                                                                                                                               
Error detected while processing function <SNR>46_Diff:                                                                                                                                                               
line    4:                                                                                                                                                                                                           
E171: Missing :endif

Enable omnicomplete with tex-files

Hi,

I am trying to enable omni completion for neocomplete with LaTeX and tex-files. I am using LaTeX-Box which provides an omnicomplete function, and I have the following in my vimrc file:

let g:neocomplete#sources#omni#input_patterns.tex = '\\\h\w*{'
inoremap <expr><C-o> neocomplete#start_manual_complete('omni')

If I in some tex-file write \cite{, then I get the error "Pattern not found". If I next use <C-o>, it seems to work, except it seems the list of candidates becomes too short.

The same happens also for \ref{ and similar commands.

7.3.1200以降だとundoがおかしくなる

NeoComplCacheでも同様の症状は再現しました
文字で説明できる気がしないのでgifアニメで

最小の.vimrc

set nocompatible
filetype plugin indent on
let g:neocomplete#enable_at_startup = 1

7.3.1189+kaoriya(正常)

1189

7.3.1220+kaoriya(2回目の入力後のundoで入力した物が消えない)

1220

確認環境

7.3.969+kaoriya + NeoComplete
7.3.1189+kaoriya + NeoComplete
7.3.1203+kaoriya + NeoComplete
7.3.1220+kaoriya + NeoComplete
7.3.1199(独自ビルド) + NeoComplCache
7.3.1200(独自ビルド) + NeoComplCache
7.3.1223(独自ビルド) + NeoComplCache


更に色々弄ってる自分の.vimrcだとまた違う症状だったりします
何故か1回のインサートモードなのにブツ切れのundo履歴、そして最後に1文字残る
(そちらの最小限はまだ調べきれてません)
1220_2

Completion of hidden files

Hidden files are not included in the filename completion list. Typing ~/. closes the completion list.

neocomplete could display hidden files after a period is entered.

An option to always include hidden files in filename completions even before a period is entered might be useful, too.

(If this functionality already exists and I missed it, I'd like to suggest changing the default behavior. A filename completion should by default complete filenames and filenames are allowed to start with periods.)

Requirements conflicts

Shougo,

On the README you state that NeoComplete requires: Vim 7.3.885 or above with if_lua feature.

And you give some commands to install MacVim with if_lua, the issue is:

The latest available version for MacVim is: 7.3.754

That's a bit confusing.

Neocomplete doesn't know my filetype

I have combined filetype like php.laravel and php.symfony, it seems neocomplete only recognize php not php.* ...

How can I configure neocomplete to work to my all php.* filetype?

Errors when editing Python files

If I edit a python file and do not trigger the neocomplete popup I can save it fine.

If I do trigger the popup and try to save then I get these errors:

Error detected while processing /home/[me]/[myconf]/vim/bundle/neocomplete.vim/autoload/neocomplete.vim:                                                                                                           
line  148:                                                                                                                                                                                                           
E127: Cannot redefine function neocomplete#system: It is in use                                                                                                                                                      
Error detected while processing function <SNR>94_check_buffer..<SNR>94_get_buffer_include_files..neocomplete#system:                                                                                                 
line    1:                                                                                                                                                                                                           
E117: Unknown function: neocomplete#get_vital                                                                                                                                                                        
E116: Invalid arguments for function call(neocomplete#get_vital().system, a:000)                                                                                                                                     
E15: Invalid expression: call(neocomplete#get_vital().system, a:000)                                                                                                                                                 
Error detected while processing /home/[me]/[myconf]/vim/bundle/neocomplete.vim/autoload/neocomplete.vim:                                                                                                           
line  148:                                                                                                                                                                                                           
E127: Cannot redefine function neocomplete#system: It is in use                                                                                                                                                      
Error detected while processing function <SNR>94_check_buffer..<SNR>94_get_buffer_include_files..neocomplete#system:                                                                                                 
line    1:                                                                                                                                                                                                           
E117: Unknown function: neocomplete#get_vital                                                                                                                                                                        
E116: Invalid arguments for function call(neocomplete#get_vital().system, a:000)                                                                                                                                     
E15: Invalid expression: call(neocomplete#get_vital().system, a:000)

Completion works pretty much fine despite this, but these errors appear every time I :w

I was running PythonMode and figured there must be a conflict, but I uninstalled it and the issue persists. I also disabled every-python specific thing I could find in my vimrc, and tried it with and without the line autocmd FileType python setlocal omnifunc=pythoncomplete#Complete.

Everything works beautifully while editing anything else I can find (javascript, vimrc, etc)

selecting is too "auto"

neocomplete automaticly select the only match and add to docuement

for example, I type dd in a new buffer and get date_day ( a global snippet ) added to the buffer. you can't never insert dd.

and df => date_full, etc

My settings are followed guide in the README

Neocomplete & Eclime

Using Eclime when editing java files I get auto-completion when pressing "". untitled1
With Neocomplete installed this no longer happens. Instead I get this
untitled2
Is there any to add those results to neocompletes?

Error occured in source's gather_candidates()!

function neocomplete#handler#_do_auto_complete..neocomplete#complete#_get_results..neocomplete#complete#_set_results_words..336..neocomplete#within_comment, line 2
Vim(return):E61: Nested *
Source name is tag
Error occured in source's gather_candidates()!

It's the master branch( 6ffee98)

And it is OK in HEAD~ 945cb28

neosnippet's markers make complete menu wrong offset

like this snippet:
when there is another marker unfinish marker before the working one

snippet     for
abbr        for loop
options     head
    for (var ${2:i} = 0; $1 < ${1:counter}; ++$1) {
        ${3}
    }

both the cursor and the menu move

image

very slow when neosnippet is loaded

neocomplete is very fast by itself, but it becomes very very slow when i source neosnippet.

here is my configuration for both plugins:

NeoBundle 'Shougo/neocomplete.vim' "{{{
  let g:neocomplete#enable_at_startup=1
  let g:neocomplete#data_directory='~/.vim/.cache/neocomplete'
  let g:neocomplete#enable_auto_delimiter=1
"}}}
NeoBundle 'Shougo/neosnippet' "{{{
  let g:neosnippet#snippets_directory='~/.vim/bundle/vim-snippets/snippets,~/.vim/snippets'
  let g:neosnippet#enable_snipmate_compatibility=1
  imap <expr><TAB> neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : (pumvisible() ? "\<C-n>" : "\<TAB>")
  smap <expr><TAB> neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
  imap <expr><S-TAB> pumvisible() ? "\<C-p>" : ""
  smap <expr><S-TAB> pumvisible() ? "\<C-p>" : ""
"}}}

i'm using the latest neocomplete/neosnippet, on linux and vim patch 1111.

候補を自動選択しない補完オプション対応

現在、neocompleteに以下のIssueで開発している機能への対応を行なっています。
ここは neocompleteを上記機能に対応させるためのスレッドです。

vim-jp/issues#385

上記にあるパッチを適用し、

let g:neocomplete#enable_complete_select = 1

と.vimrc内部で設定すると試すことができます。

include complete

I install vimproc, and use ":NeoCompleteIncludeMakeCache" to generate cache file
and set like this:
let g:neocomplete#sources = {}
let g:neocomplete#sources._ = ['buffer']
let g:neocomplete#sources.c = ['buffer', 'include']

it don't work

Customizations don't load

Hi, I have the customizations described in README.md on the front page in a file ~/.vim/neocomplete-custom. This being sourced from .vimrc like this

source $HOME/.vim/neocomplete-custom.vim

However, after loading vim, neocomplete tab completion doesn't work till I once again do

 :so $HOME/.vim/neocomplete-custom.vim

What am I missing? Also, I've tried pasting the whole contents of neocomplete-custom.vim inside .vimrc itself - but that doesn't help either.

Configuration for Go language

I'm having some trouble configuring neocomplete for use with Go. I think I do not fully understand the differences between some configuration variables (such as g:neocomplete#keyword_patterns, g:neocomplete#force_omni_input_patterns, g:neocomplete#sources#member#prefix_patterns, g:neocomplete#sources#member#input_patterns, g:neocomplete#sources#omni#input_patterns...)

I want neocomplete to use gocode to display attributes, methods and exported values of packages when I type a dot '.'
After some experiment, I got the following configuration:

if !exists('g:neocomplete#sources#omni#input_patterns')
        let g:neocomplete#sources#omni#input_patterns = {}
    endif
    let g:neocomplete#sources#omni#input_patterns.go = '[^.[:digit:] *\t]\.'

It kind of works. When I type the dot, it displays only the results returned by the omnifunc. But as soon as I type the first letter after the dot to filter the results, the popup is filled with all the symbols neocomplete can encounter in the code.

So, for instance, if I have the following excerpt:

type AStruct struct {
  Attr1 int
  Attr2 string
}

var AVariable = "some string"

func function() {
  x := new(AStruct)
  x. // At this point, it displays only the fields of the struct AStruct: Attr1 and Attr2
}

When I type the dot in the line with the comment, I see:

  x.[ Attr1 int     [O]  ]
     [Attr2 string [O] ]

But, if I then type the letter 'A' to begin filtering the results, the popup becomes:

  x.A[ Attr1        [B] ]
        [Attr2         [B] ]
        [AStruct     [B] ]
        [AVariable [B] ]

What I want is that it continues displaying only results from omnifunc, filtering them as I type. How can I achieve that?

non-ascii chars were "filtered

Seems neocomplete abandons non-ascii candidates.

For example, I have a snippet describing in Chinese, non-ascii characters

snippet test-ch
abbr    中文描述
options word
    test test

since that, neocomplete won't add it to the menu
It's ok in neocomplcache

and my plugin neco-stardict (one provides candidates in Chinese) works fine in neocomplcache but fails in neocomplete

I test (L27) it and only get how_are_you

dictionary complete

I set dictionary complete like below, when I used neocomplcache, it works well
" let g:neocomplcache_dictionary_filetype_lists = {
" \ 'default' : '',
" \ 'c' : $HOME.'/PluginConfig/neocomplcache/c.dict',
" \ 'txt' : $HOME.'/PluginConfig/neocomplcache/verilog.dict',
" \ 'verilog' : $HOME.'/PluginConfig/neocomplcache/verilog.dict',
" \ }

I set dictionary complete like below, when I used neocomplete, it don't work
let g:neocomplete#sources#dictionary#dictionaries = {
\ 'default' : '',
\ 'c' : $HOME.'/PluginConfig/neocomplete/c.dict',
\ 'txt' : $HOME.'/PluginConfig/neocomplete/verilog.dict',
\ 'verilog' : $HOME.'/PluginConfig/neocomplete/verilog.dict',
\ }

what happend

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.