Optional dependency loading in Emacs, a good idea?

Hey guys! I have gotten a sudden motivation to refactor my nixos dotfiles, and I have an idea, don’t know if it’s good or not so here it is:

While developing code, I feel like your system should have 0 development dependencies, all of them should be project dependencies instead. However my text editor has certain configuration files for all languages, so it has packages installed for all of the possible languages and frameworks and tools that i’ll be using.

Read more →

How Emacs taught me programming

I’ve been using emacs for around 4 years now, and as I’m entering the 2nd year of my college, I can feel I’ve grown significanly along with my text editor.

Emacs (and Linux) has taught me a lot about Software Engineering. Reading other people’s configuration files, writing my own unique snippets, and playing with packages has really helped me learn programming. Many programmers advice to make a “project” to really get a grasp of programming and get experience, for me a large part of that was emacs. While I was using emacs to code, I was also learning how to read the manual, refer the web to figure out problems, and gather help from forums(You guys rock).

Read more →

Ricing Org Mode

A majority of emacs users are absolute die-hard fans of org mode, and wouldn’t be able to live without it. And it makes sense too, it’s a tool that you can use in whatever workflow you prefer, which is really powerful. However as a relatively new emacs users (only 2 years!), I couldn’t really get org mode. I never felt satisfied when using it, as for me it seemed like an old technology, especially for a person who’s used to the web apps, which have a totally different UI .

Read more →

Quickly toggle Eshell in emacs

One of my Emacs’ favourite features is Eshell. However recently I wanted to create a function, that automatically toggles eshell, like vscode, and gives priority to the project root (if in project). This little code snippet does exactly that:

(defun binary-eshell/toggle-eshell ()
  (interactive)
  (let ((eshell-buffer-name (binary-eshell/eshell-buffer-name)))
    (if (binary-eshell/eshell-toggled-p)
        (delete-windows-on eshell-buffer-name)
      (progn
        (split-window-below)
        (if (project-current)
            (let ((default-directory (project-root (project-current))))
              (eshell)))
        (eshell)))))

(defun binary-eshell/eshell-toggled-p ()
  "Checks if eshell is toggled."
  (let ((eshell-buffer-name (binary-eshell/eshell-buffer-name))
        (result))
    (dolist (element (window-list) result)
      (if (string= eshell-buffer-name (buffer-name (window-buffer element)))
          (setq result t)))
    result))

(defun binary-eshell/eshell-buffer-name ()
  "Returns the name of the eshell buffer. It works on the basis of the following rule:
If the current buffer is part of a project, then name it on the basis of the project,
else name it on the basis of default-directory."
  (let ((eshell-buffer-name))
    (if (project-current)
        (setq eshell-buffer-name
              (concat "*eshell-" (project-name (project-current)) "*"))
      (setq eshell-buffer-name (concat "*eshell-" default-directory "*")))))

Call binary-eshell/toggle-eshell and voila! It opens an eshell window, for you to work on! With this, I have hopefully shown you how you can incorporate eshell even more into your workflow.

Read more →