summaryrefslogtreecommitdiff
path: root/lisp/python-custom.el
diff options
context:
space:
mode:
authorMatthew Kosarek <matthew@matthewkosarek.xyz>2023-10-18 09:55:54 -0400
committerMatthew Kosarek <matthew@matthewkosarek.xyz>2023-10-18 09:55:54 -0400
commit12668c7677e70abf2f9e336f5c2e35d253faa671 (patch)
treec12039dc8f83304dc2718a29600ab3f5b3bc3919 /lisp/python-custom.el
parentda17f67c5950de25b6399fd08718730acb9be422 (diff)
Functionalitiy for removing unused imports in python and small c++ styles
Diffstat (limited to 'lisp/python-custom.el')
-rw-r--r--lisp/python-custom.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/lisp/python-custom.el b/lisp/python-custom.el
index 3d076cb..1d48a6f 100644
--- a/lisp/python-custom.el
+++ b/lisp/python-custom.el
@@ -44,5 +44,14 @@
(setq python-indent-guess-indent-offset nil)
+(defun mk/python/remove_unused ()
+ "Removes unused imports"
+ (interactive)
+ (setq command (concat "autoflake --in-place --remove-unused-variables " buffer-file-name))
+ (shell-command command)
+ ;; Reload the modified file
+ (revert-buffer t t)
+ )
+
(provide 'python-custom)
;;; python-custom.el ends here