Compare commits
2 Commits
eb6cda3025
...
a60623b44c
Author | SHA1 | Date | |
---|---|---|---|
|
a60623b44c | ||
|
85d644c68a |
@ -3853,7 +3853,7 @@ mode independent [[https://github.com/joaotavora/eglot][Eglot]] configuration:
|
||||
;; Replace `nil' with `t' for debugging.
|
||||
(when nil
|
||||
(defvar eglot-server-programs
|
||||
`((python-mode . ("pylsp" "-vvv")))
|
||||
`(((python-ts-mod python-mode) . ("pylsp" "-vv")))
|
||||
"Shadow the definition of `eglot-server-programs' in `eglot'."))
|
||||
|
||||
(with-eval-after-load 'eglot
|
||||
@ -4653,7 +4653,7 @@ or to increase the verbosity of [[https://github.com/python-lsp/python-lsp-serve
|
||||
(with-eval-after-load 'eglot
|
||||
(setq-default
|
||||
eglot-workspace-configuration
|
||||
;; Enable the `:pyls_ruff' plugin and ensure to disable the
|
||||
;; Enable the `:pylsp_ruff' plugin and ensure to disable the
|
||||
;; `:flake8', `:mccabe', and `:pycodestye' plugins.
|
||||
'(:pylsp (:plugins
|
||||
(:pylsp_ruff
|
||||
@ -4708,7 +4708,7 @@ or to increase the verbosity of [[https://github.com/python-lsp/python-lsp-serve
|
||||
;; to launch eglot automatically.
|
||||
((nil ;; nil, since Emacs-29.1 filters out irrelevant variable names.
|
||||
. ((eglot-workspace-configuration
|
||||
;; Enable the `:pyls_ruff' plugin and ensure to disable the
|
||||
;; Enable the `:pylsp_ruff' plugin and ensure to disable the
|
||||
;; `:flake8', `:mccabe', and `:pycodestye' plugins.
|
||||
. (:pylsp (:plugins
|
||||
(:pylsp_ruff
|
||||
|
12
etc/yasnippet/snippets/python-mode/base_class
Normal file
12
etc/yasnippet/snippets/python-mode/base_class
Normal file
@ -0,0 +1,12 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Uses .yas-setup.el.
|
||||
# name : base class
|
||||
# key : bcls
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# --
|
||||
class ${1:ClassName}:
|
||||
"""${2:XXX}.${3:$(python-arguments-to-doc-string)}"""
|
||||
|
||||
def __init__(self, $3):
|
||||
${3:$(python-arguments-to-self-init-string)}$0pass
|
||||
|
8
etc/yasnippet/snippets/python-mode/def_function
Normal file
8
etc/yasnippet/snippets/python-mode/def_function
Normal file
@ -0,0 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Uses .yas-setup.el.
|
||||
# name : def function
|
||||
# key : deff
|
||||
# --
|
||||
def ${1:name}($2):
|
||||
"""${3:XXX.}${2:$(python-arguments-to-doc-string)}"""
|
||||
$0pass
|
9
etc/yasnippet/snippets/python-mode/def_method
Normal file
9
etc/yasnippet/snippets/python-mode/def_method
Normal file
@ -0,0 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Uses .yas-setup.el.
|
||||
# name : def method
|
||||
# key : defm
|
||||
# --
|
||||
def ${1:name}(self$2):
|
||||
"""${3:XXX.}${2:$(python-arguments-to-doc-string)}"""
|
||||
$0pass
|
||||
|
12
etc/yasnippet/snippets/python-mode/derived_class
Normal file
12
etc/yasnippet/snippets/python-mode/derived_class
Normal file
@ -0,0 +1,12 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Uses .yas-setup.el.
|
||||
# name : derived class
|
||||
# key : dcls
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# --
|
||||
class ${1:ClassName}(${2:object}):
|
||||
"""${3:XXX}.${4:$(python-arguments-to-doc-string)}"""
|
||||
|
||||
def __init__(self, $4):
|
||||
${4:$(python-arguments-to-self-init-string)}$0pass
|
||||
|
23
etc/yasnippet/snippets/python-mode/program
Normal file
23
etc/yasnippet/snippets/python-mode/program
Normal file
@ -0,0 +1,23 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# name : program
|
||||
# key : program
|
||||
# expand-env : ((yas-indent-line 'fixed))
|
||||
# --
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""${1:XXX}."""
|
||||
|
||||
import numpy
|
||||
|
||||
|
||||
def main():
|
||||
"""${2:XXX}."""
|
||||
$0pass
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
# Local Variables:
|
||||
# mode: python
|
||||
# End:
|
2
etc/yasnippet/snippets/python-ts-mode/.yas-parents
Normal file
2
etc/yasnippet/snippets/python-ts-mode/.yas-parents
Normal file
@ -0,0 +1,2 @@
|
||||
python-mode
|
||||
|
Loading…
Reference in New Issue
Block a user