]> git.madduck.net Git - etc/lazyvim.git/blobdiff - .config/lazyvim/after/ftplugin/python.lua

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Enable signature popups from blink
[etc/lazyvim.git] / .config / lazyvim / after / ftplugin / python.lua
index bae33814ebe6b70ef6939a30c563997938a1db25..4cc925f6524a6e12b5a4486ca6bb8afedaa7cf8e 100644 (file)
@@ -7,21 +7,22 @@ vim.opt_local.sw = 4
 vim.opt_local.sts = 4
 vim.opt_local.autoindent = true
 
-vim.opt_local.formatoptions = vim.opt.formatoptions + "bl"
+vim.opt_local.formatoptions:append("b")
+vim.opt_local.formatoptions:append("l")
 
 vim.b.ale_linters = { "mypy", "ruff" }
 vim.b.ale_fixers = {
   "add_blank_lines_for_python_control_statements",
   "ruff",
-  "ruff_format"
+  "ruff_format",
 }
 
-vim.keymap.set('i', '<localleader>t', [[import ipdb; ipdb.set_trace()  # noqa: E402 E702 I001 # fmt: skip]])
+vim.keymap.set("i", "<localleader>t", [[import ipdb; ipdb.set_trace()  # noqa: E402 E702 I001 # fmt: skip]])
 
-vim.keymap.set('i', '<localleader>m', [[if __name__ == "__main__":<CR>import sys<CR>sys.exit()<ESC>i]])
+vim.keymap.set("i", "<localleader>m", [[if __name__ == "__main__":<CR>import sys<CR>sys.exit()<ESC>i]])
 
 vim.keymap.set(
   "i",
   "<localleader>a",
-  [[# needed < 3.14 so that annotations aren't evaluated<CR>from __future__ import annotations]]
+  [[# needed < 3.14 so that annotations aren't evaluated<CR><BS><BS>from __future__ import annotations<CR><CR>from typing import TYPE_CHECKING<CR><CR>if TYPE_CHECKING:<CR>pass<CR>]]
 )