HACKER Q&A
📣 xrd

How do you customize Emacs for Python?


I've been using emacs, happily, for over twenty years.

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.


  👤 david-j-vujic Accepted Answer ✓
I’m using Elpy because it comes with great code evaluating features (sending expressions to the REPL and such). In this config there’s also auto discovery of virtual environments. Adding to that: black, flake8 (not yet added ruff).

In the docs, you will find more about this setup with IPython integration, if the code evaluation things is something you look for too.

https://github.com/DavidVujic/my-emacs-config


👤 timonoko
What is wrong with "apt install python-mode"? I dont get it.

My only remarkable addition is

  (global-set-key (kbd "M-+")  'hippie-expand)
which helps the use of long self-explanatory variable names.