From 905be3d7a63c384485252a1f1cdf14287b79a159 Mon Sep 17 00:00:00 2001 From: mattkae Date: Mon, 7 Nov 2022 20:01:07 -0500 Subject: Halfway decent python mode --- README.md | 5 +++++ init.el | 5 +++-- lisp/cpp.el | 5 +++++ lisp/python-custom.el | 12 ++++++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 lisp/python-custom.el diff --git a/README.md b/README.md index 1831351..da44461 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,11 @@ Emacs configuration file ### JavaScript/TypeScript Must have installed the Typescript language server: https://github.com/typescript-language-server/typescript-language-server +### Python +``` +sudo pip install python-lsp-server +``` + ### Text `hunspell` is used to provide spell check on `.txt` files. Make sure to have install the hunspell package for your language. In my instance, I had to do: ```sh diff --git a/init.el b/init.el index 9d63a14..6308196 100644 --- a/init.el +++ b/init.el @@ -14,7 +14,7 @@ (setq package-list - '(org-bullets good-scroll counsel smartparens xref-js2 eglot json-mode markdown-mode emojify tern rtags cmake-ide cmake-mode tide auctex evil js2-highlight-vars ac-js2 js2-refactor js2-mode flycheck-irony company-irony all-the-icons req-package projectile irony org neotree minimap vterm vterm-toggle drag-stuff)) + '(python-mode org-bullets good-scroll counsel smartparens xref-js2 eglot json-mode markdown-mode emojify tern rtags cmake-ide cmake-mode tide auctex evil js2-highlight-vars ac-js2 js2-refactor js2-mode flycheck-irony company-irony all-the-icons req-package projectile irony org neotree minimap vterm vterm-toggle drag-stuff)) ;; Fetch the list of packages available (unless package-archive-contents @@ -52,6 +52,7 @@ (require 'markdown) (require 'lisp) (require 'json) +(require 'python-custom) (custom-set-variables ;; custom-set-variables was added by Custom. @@ -66,7 +67,7 @@ '(org-agenda-files (list org-directory)) '(org-directory "~/Documents/org") '(package-selected-packages - '(drag-stuff org-bullets git-gutter-fringe git-gutter vterm-toggle vterm minimap neotree good-scroll counsel ## smartparens xref-js2 eglot json-mode markdown-mode emojify tern rtags cmake-ide cmake-mode tide auctex evil js2-highlight-vars ac-js2 js2-refactor js2-mode flycheck-irony company-irony all-the-icons req-package projectile irony org))) + '(python-mode drag-stuff org-bullets git-gutter-fringe git-gutter vterm-toggle vterm minimap neotree good-scroll counsel ## smartparens xref-js2 eglot json-mode markdown-mode emojify tern rtags cmake-ide cmake-mode tide auctex evil js2-highlight-vars ac-js2 js2-refactor js2-mode flycheck-irony company-irony all-the-icons req-package projectile irony org))) ;;; init.el ends here (custom-set-faces diff --git a/lisp/cpp.el b/lisp/cpp.el index b7f5242..79d31fa 100644 --- a/lisp/cpp.el +++ b/lisp/cpp.el @@ -20,5 +20,10 @@ (add-hook 'c-mode-common-hook 'setup-c) (add-hook 'c-mode-common-hook 'eglot-ensure) +(defun create-cpp-class() + "Create a cpp class." + (interactive "Enter the name of the class: ") + ) + (provide 'cpp) ;;; cpp.el ends here diff --git a/lisp/python-custom.el b/lisp/python-custom.el new file mode 100644 index 0000000..ebb2b81 --- /dev/null +++ b/lisp/python-custom.el @@ -0,0 +1,12 @@ + +;;; Code: +(require 'python) +(use-package eglot + :ensure t + :config + (add-to-list 'eglot-server-programs '(python-mode . ("pylsp"))) + :hook + ((python-mode . eglot-ensure))) + +(provide 'python-custom) +;;; python-custom.el ends here -- cgit v1.2.1