plugin best practice/vim-python debug

48 views
Skip to first unread message

Ernie Rael

unread,
Feb 28, 2022, 3:29:43 PM2/28/22
to vim...@googlegroups.com
Greetings all,

I recently picked up a new DirDiff, went to modify the source to install
my preferred keybindings/mapping. I saw a new scheme in DirDiff so I
don't have to modify the source code. One part is that it doesn't do
mappings by default. It says "preferable to not change people's mappings
by default"

I'm going to modify Splice to use a similar scheme so I can set mappings
from vimrc file. Splice is a vim-python plugin. I've never done
vimscript (other than my simple vimrc files) Given this context, I'm asking:

Should there be an "enable setting up mappings" flag and false by
default? Since Splice is usually invoke from SCM, e.g. hg/git, there's
nothing for it's mappings to compete with, AFAICT. Splice changes a few
mappings back and forth in normal operation, it doesn't seem to make
sense to have that disabled.

For debugging, at least for now, I think print to a file would be
sufficient for me. Any problems mixing vim/python print to file
statements? I'll have to learn how to print variables... to a file from
vim script.  Need unbuffered, append mode.

Python interface is nice; magic variable/lists/ to affect behavior. Does
vim have anything like that? Is there a good intro to vim scripting, I
know there's tons of functions and saw as chaining became pervasive. For
this project I have few needs: call a function from python (maybe pass
some arguments, but maybe not), do some nnoremap commands. But I would
like to know more than I need to know.

Since I'm getting my toes wet, might as well do some vim9 as well.

TLDR,
but thanks for any feedback,
-ernie

Reply all
Reply to author
Forward
0 new messages