diff --git a/home/modules/nvf.nix b/home/modules/nvf.nix index aa573f7..5044a28 100644 --- a/home/modules/nvf.nix +++ b/home/modules/nvf.nix @@ -15,19 +15,17 @@ pydocstring ]; - extraConfigLua = '' - -- Python-only keybinding - vim.api.nvim_create_autocmd("FileType", { - pattern = "python", - callback = function() - vim.keymap.set( - "n", - "ds", - "silent !pydocstring --style google", - { buffer = true, desc = "Generate Python docstring" } - ) - end, - }) + extraConfig = '' + " Python-only keybinding for pydocstring + augroup NVFPythonDoc + autocmd! + autocmd FileType python lua vim.keymap.set( + "n", + "ds", + "silent !pydocstring --style google", + { buffer = true, desc = "Generate Python docstring" } + ) + augroup END ''; settings.vim = {