summaryrefslogtreecommitdiff
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
parentda17f67c5950de25b6399fd08718730acb9be422 (diff)
Functionalitiy for removing unused imports in python and small c++ styles
-rw-r--r--init.el2
-rw-r--r--lisp/cpp.el1
-rw-r--r--lisp/mk.el1
-rw-r--r--lisp/python-custom.el9
4 files changed, 11 insertions, 2 deletions
diff --git a/init.el b/init.el
index ea6dadc..d080226 100644
--- a/init.el
+++ b/init.el
@@ -75,7 +75,7 @@
'(custom-safe-themes
'("a6f9dd4844bfbfaf1162f04ae3c52070154ef28d18b5d482566015cf429492b0" "f149d9986497e8877e0bd1981d1bef8c8a6d35be7d82cba193ad7e46f0989f6a" "3c83b3676d796422704082049fc38b6966bcad960f896669dfc21a7a37a748fa" "a27c00821ccfd5a78b01e4f35dc056706dd9ede09a8b90c6955ae6a390eb1c1e" default))
'(package-selected-packages
- '(autothemer pyenv-mode pyvenv plantuml-mode ledger-mode eglot centered-window perfect-margin-mode org-download helm-rg htmlize mood-line org-super-agenda material-theme esup glsl-mode fast-scroll yasnippet-snippets jsdoc helm-slack slack smart-mode-line magit rust-mode xref-js2 web-mode vterm-toggle vscode-dark-plus-theme treemacs-projectile tree-sitter-langs tide tern smartparens rtags req-package rainbow-mode pythonic python-mode perfect-margin org-roam org-notify org-modern org-bullets org-alert minimap markdown-mode json-mode js2-refactor js2-highlight-vars js-doc ido-vertical-mode hl-todo highlight-thing highlight-indent-guides helm-projectile helm-posframe helm-ag good-scroll go-mode git-gutter-fringe git-commit flycheck-irony evil eslint-fix emojify eldoc-box drag-stuff doom-themes dashboard css-eldoc counsel company-quickhelp company-irony cmake-mode cmake-ide auctex all-the-icons ac-js2))
+ '(meson-mode eglot autothemer pyenv-mode pyvenv plantuml-mode ledger-mode centered-window perfect-margin-mode org-download helm-rg htmlize mood-line org-super-agenda material-theme esup glsl-mode fast-scroll yasnippet-snippets jsdoc helm-slack slack smart-mode-line magit rust-mode xref-js2 web-mode vterm-toggle vscode-dark-plus-theme treemacs-projectile tree-sitter-langs tide tern smartparens rtags req-package rainbow-mode pythonic python-mode perfect-margin org-roam org-notify org-modern org-bullets org-alert minimap markdown-mode json-mode js2-refactor js2-highlight-vars js-doc ido-vertical-mode hl-todo highlight-thing highlight-indent-guides helm-projectile helm-posframe helm-ag good-scroll go-mode git-gutter-fringe git-commit flycheck-irony evil eslint-fix emojify eldoc-box drag-stuff doom-themes dashboard css-eldoc counsel company-quickhelp company-irony cmake-mode cmake-ide auctex all-the-icons ac-js2))
'(safe-local-variable-values '((js-indent-level . 4)))
'(warning-suppress-types '((comp))))
(custom-set-faces
diff --git a/lisp/cpp.el b/lisp/cpp.el
index 6dad38b..5bb04a8 100644
--- a/lisp/cpp.el
+++ b/lisp/cpp.el
@@ -12,6 +12,7 @@
(c-set-offset 'substatement-open 0)
(c-set-offset 'arglist-intro '+)
(c-set-offset 'arglist-cont-non-empty '+)
+ (c-set-offset 'argslist-close '+)
)
(add-hook 'c-mode-common-hook 'setup-c)
diff --git a/lisp/mk.el b/lisp/mk.el
index 634f09a..28de3ed 100644
--- a/lisp/mk.el
+++ b/lisp/mk.el
@@ -69,6 +69,5 @@
(other-window -1))))))
(bind-key* (kbd "C-c f r") 'mk/rename-file)
-
(provide 'mk)
;;; mk.el ends here
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