wookayin / vim-autoimport

A vim plugin for adding import statements (for python and more) without LSP
https://work.in.progress
25 stars 5 forks source link

Allow definition of a custom database in vim config #7

Open gburger11 opened 1 year ago

gburger11 commented 1 year ago

In my company, we have some custom conventions of import … as …, so it was very convenient for me to be able to add in my vim config a custom database. I did this change on my computer and I can propose to integrate it in the main project.

With this change, a user can define in their vim config a custom usage such as :

let g:autoimport#python#db_import_as = {
            \ 'typing': 'tp',
            \ 'nevergrad': 'ng'
            \ }

let g:autoimport#python#db_import = {
            \ 'tiger': v:null,
            \ 'pinocchio': ['Quaternion', 'SE3']
            \ }

I have chosen the name to make it easier to extend the package to other languages if need be.

In the same time, I have added __pycache__ in the .gitignore because it was polluting my git diff output, but I can remove this change as it is not related with the PR.