Skip to content

Instantly share code, notes, and snippets.

@expez
Created October 23, 2022 20:39
Show Gist options
  • Select an option

  • Save expez/bed71ea4bc0a66a3ece709780b00b87c to your computer and use it in GitHub Desktop.

Select an option

Save expez/bed71ea4bc0a66a3ece709780b00b87c to your computer and use it in GitHub Desktop.
(use-package which-key
:config
(which-key-mode))
(use-package lsp-mode
:init (setq lsp-keymap-prefix "C-c C-m")
:hook ((python-mode . lsp)
(lsp-mode . lsp-enable-which-key-integration))
:commands lsp)
(use-package lsp-ui
:ensure t
:defer t
:config
(setq lsp-ui-sideline-enable nil
lsp-ui-doc-delay 2)
:hook (lsp-mode . lsp-ui-mode)
:bind (:map lsp-ui-mode-map
("C-c i" . lsp-ui-imenu)))
(use-package inferior-python-mode
:ensure nil
:hook (inferior-python-mode . hide-mode-line-mode))
;; pip install pyright
(use-package lsp-pyright
:ensure t
:config
(setq lsp-pyright-auto-import-completions t)
:hook (python-mode . (lambda ()
(require 'lsp-pyright)
(lsp-deferred))))
(use-package python
:ensure t
:config
(setq python-indent-guess-indent-offset-verbose nil)
(cond
((executable-find "ipython")
(progn
(setq python-shell-buffer-name "IPython")
(setq python-shell-interpreter "ipython")
(setq python-shell-interpreter-args "-i --simple-prompt")))
((executable-find "python3")
(setq python-shell-interpreter "python3"))
((executable-find "python2")
(setq python-shell-interpreter "python2"))
(t
(setq python-shell-interpreter "python"))))
;; pip install yapf
(use-package yapfify
:ensure t
:defer t
:hook (python-mode . yapf-mode))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment