Tuesday, September 24, 2013

Emacs for Python Development aka as an IDE Part 1

I have been using Emacs for Python development for about 3 months now and I must say that it's not so bad even rivaling PyCharm in a few departments especially how it handles text around in a few ways is superior IMO.

I use Emacs with ergoemacs and I have elpa and melpa enabled for installing packages. What is ergoemacs ? For those of you who feel that Emacs uses too much of the CTRL plus other keys combination, ergoemacs will prove to be a respite as it remaps the default keys of Emacs to what the author felt to be keys more friendly to those having RSI hence the name ergo-emacs.

What I found initially like any hardened VI user is moving around is a real hassle and kept on pounding on the wrong keys. After a while though, I began to get proficient at it and now the tables have flipped and I feel totally inadequate in vim, pressing the wrong keys all the time. I appreciate a few things about Emacs. One is that when I run it I am already inside of insert/edit mode.... no need to press one more key for me to be in edit mode. The other thing is, out of the box, I found that I had less to install to the editor up to snuff to use as an everyday editor. Of course, I also love alt-x or in ergo's case alt-a. All I had to do was get flycheck, which is an on the fly pep8 error checking for Emacs to work. Another thing is the speed in which emacs can start up using the "--daemon" argument. The only thing is I still could not figure out how to the daemon as an init script on my box. How I do it now is I will tuck the daemon away in a tmux session during start up.

Below, is a screenie with my terminal running emacs in it's full glory ...

The majority of the time I spent was not tinkering on my editor (which I sometimes felt using Vim) rather I spent it mostly learning up the new keymaps. I am still no emacs expert by any stretch of the imagination, but I feel myself improving faster compared to Vim. Currently believe it or not my only problem using emacs seems to be moving to a line number (it takes a few more key strokes) and copy and deleting lines, it just takes a little too much work. Here is the link to my dotemacs file which is equivalent to .vimrc, though I suspect some of the lines in there are not necessary and can be trimmed down.


Vince said...

Hey, have you played around with evil-mode and what is your feeling about it ? http://wikemacs.org/index.php/Evil

I'm a «native» emacs user but I kept thinking dealing with lines (deleting, joining,…) was too much an hassle, and I still developped RSI symptoms despite lots of tweaks and massive use of key-chord-mode.

Finally I tried evil-mode out and… what a relief ! Navigation and precise editing is much easier while I still evolve in my beloved emacs environment. Got used to it in a couple of days.

lowkster said...

Vince, really did not try that before, I was of the thinking ... "If it emulates Vim ... why not just use vim ?". I might just be wrong. What advantages does it have over vim ?