Skip to content

Function name can start with '_' #9

@xieshiyao

Description

@xieshiyao

I got the error shown in the picture in my .vimrc, but actually, this function works fine with either vim or neovim. I know that (neo)vim's document eval.txt says that a function name must start with a capital, but I think it's just a problem with that document.

Screenshot from 2019-07-21 11-14-41

I start the function name with _ for two reasons:

  1. This way, it will never conflict with functions defined by plugins I installed

  2. I map it to some keys, so will never need to call it by name and I don't want to see any autocompletion about it when I type :call V<Tab>


After readinginit.vim written by someone else, I realize that what I should do is to apply :s/_/s:/to my function name. But I still consider this as inconsistency between implementaion and document. What do you think about it?
@justinmk

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions