3 points · by xrd · 2y ago · 11 comments
At one point I used VSCode. I didn't hate it, and for JavaScript it can be great. But I'm unhappy with the MS telemetry and it feels bloated when you use too many extensions.
I have been playing with Zed. It's great. But, I can't get a firm answer on how to use venv and asdf together and usage has stalled for me.
Can people share their emacs .emacs configs? I really would love to use type hinting, lsp and code completion inside emacs. But, I keep running into configurations that want to switch to vi key bindings, and I get demoralized.
In the docs, you will find more about this setup with IPython integration, if the code evaluation things is something you look for too.
It’s definitely not as advanced as Elpy, but it’s worth noting that the built-in Python-mode also has basic support for this: C-c C-p to start an interpreter (can be reconfigured to run IPython), C-c C-e to send one statement to the interpreter, and C-c C-c to send the entire file to the interpreter.
If you install code-cells.el you can get another keybinding to send one “code cell” (delimited by “# %%” comments like VSCode does) to the interpreter. There’s also the “comint-mime” package that enables Matplotlib support in the interpreter so you can see inline plots.
An alternative to all this, is the emacs-jupyter package which integrates a Jupyter kernel as the Python REPL in Emacs.
> not yet added ruff
This was pretty plug-and-play for me if you’re interested: https://github.com/erickgnavar/flymake-ruff
My only remarkable addition is
(global-set-key (kbd "M-+") 'hippie-expand)
which helps the use of long self-explanatory variable names. (setq auto-mode-alist ; trigger python mode automatically
(cons '("\\.py$" . python-mode) auto-mode-alist))
(setq interpreter-mode-alist
(cons '("python" . python-mode)
interpreter-mode-alist))
(autoload 'python-mode "python-mode" "Python editing mode." t)