Infinitely customizable IDE (?)


07|2020


[code]






Since I started getting more into programming some year and a half ago, I have been trying out different IDEs. I've tried Visual Studio as a first choice, VS Code, Code::Blocks, and a bunch of language-specific IDEs for C/C++, Python, Lua, Racket and assembly. Most of them are feature-rich and competent enough. VS was the most feature rich so far, with a very beginner-friendly debugger out of the bunch. It is also the heaviest, taking up ~10GB of space just for C#, C++ and Python development. In addition it's not on Linux.


After watching some introductory videos in Casey Muratori's Handmade Hero series I got interested in trying out Emacs. I'm not gonna lie, Emacs has no training wheels. You get thrown into the deep end, with the steepest learning curve of all the aforementioned IDEs. I'm probably at 0.5% of my Emacs comprehension, with some rudimentary emacs-lisp knowledge which is enough to cobble together a functional .init file. But the things which make it intimidating also make it a fascinating, infinitely customizable editor. You can pretty much customize it to do anything when it comes to editing text, code and more. You can also break it in trillion different ways with endless tweaking.


spacemacs with a custom doom-emacs theme


Just when my .init was becoming kind of a mess (which i've read is called '.emacs bankruptcy', an accurate term), I found Spacemacs customization framework, which made things more manageable once again. Of course, I still wanted to tweak the heck out of it but it gave me the a starting advantage not present with vanilla. This got me started on a path which I'm sure will spiral into some new .init madness a few years down the line, but hopefully it will be a fun ride.


Here's the breakdown of what I've been using it for -


Compiled languages




So far I've been using it for C/C++ when it comes to compiled languages. You can edit the code with auto formatting, on-the-fly syntactic error checking (using clang back-end), auto-completion, syntax highlighting, snippets expansion, .cpp/.h switching/creation and symbol reference lookup (with GNU Global and universal ctags), to name some major features. Additionally you can compile using any available compiler (I've tried msvc, clang and gcc) with compilation results and error listing displayed in the editor, allowing error lookup in the codebase. I've also tried debugging code with gdb from within the editor and it's fine, but not as beginner friendly as the VS as mentioned earlier in the post.


compiling c++ code in emacs with msvc


Interpreted languages




Emacs comes with emacs-lisp preloaded, and I've set up the editor for Python and Lua in addition. besides having pretty much similar features as compiled languages when it comes to code editing, it can also run interpreters from within the editor, hook up to external documentation, look up docstrings, auto-complete from libraries and from my code, auto-format (adhering to PEP in Python's case) etc.


editing and running python directly from emacs


HTML/CSS + PHP




I've been using Spacemacs to write this blog as well, with all the aforementioned code editing customizations. You can also run a live preview of the page in the browser, edit files directly on the server via ftp, and start a test server from a PHP cli running in a prompt from within the editor.


html and css editing


ORG-MODE




I didn't know what this was. Then I saw this presentation, read the manual and my brain melted a bit. It is a document writing mode, with embedded programmable tables, schedules, reminders, todo lists, task managers etc. It can export to plain text, formatted html, pdf and latex formats among other things. I use it for writing ideas down in a structured way and taking good care of my ocd which I didn't know I had until I found this mode.


org-mode and exported html on the right


There are some other notable Emacs features such as:


I'm probably leaving out a lot of small tweaks that I don't even notice any more, but I'll leave it at that. Nothing's perfect of course. The learning curve isn't getting any less steeper. Any new major mode that I add introduces a new set of custom mini-problems to solve. As a result, the duct tape sometimes shows through. A lot of it is due to my inexperience with the editor. Some of it is inherent. Some of it is due to OS. I've tried it on Linux a lot of things function better out of the box, not to mention that the editor is 50% faster to load and less glitchy. Some tradeoffs are inevitable, but that goes for any IDE that you choose.





< PREVIOUS POST


HOME


NEXT POST >