I will show you how to create any number of fields with yasnippet. The source code can be found on github. (Please refer to the link above for how to use yasnippet in the first place)
yasnippet can write emacs lisp directly in snippet by writing # type: command
in header, which enables automatic generation of snippet.
A docstring based on the coding conventions adopted by numpy (based on PEP8, PEP257) in this way. I made a snippet about the argument part.
First of all, please have a demo video. !!
def
docstring, parse its argument, and if it is a class
docstring, parse the argument of def __init __
.You should be able to make more complicated and convenient snippets by working hard on emacs lisp. We look forward to your hot snippets.
I will also introduce another continuous expansion that combines the above snippet and snippet that creates a function with a docstring.
Also, to achieve this, use .emacs
.emacs
(setq yas-triggers-in-field t)
It is necessary to write.
As before, please watch the demo video first.
that's all.
Recommended Posts