emacs

Emacs is not just a text editor; it’s a dynamic ecosystem and a philosophy of freedom, automation, adaptability, and community. My .emacs configuration is a reflection of these values, tailored to streamline my workflow, manage my goals, and keep everything synchronized across devices. By looking at the way I handle git automation, use Org-mode files to manage my life, and integrate tools like Treemacs, Company, and Ivy, we can see how Emacs becomes an essential tool for maintaining both personal and professional efficiency.

freedom through customization

Freedom is at the heart of Emacs. Unlike rigid tools with fixed workflows, Emacs empowers users to shape their environment to meet their needs. My .emacs file is more than just a configuration; it’s a personal declaration of independence. I set my home directory to ~/bill, a persistent workspace that travels with me across platforms.

(setq hdir "~/bill")
(setq git-repo-url "git@gitlab.com:billwear/root.git")
(setq default-directory hdir)

This persistent setup ensures that wherever I work — be it on my desktop, laptop, or Termux on Android — I’m always in familiar territory. The freedom to create a consistent environment across devices means I can focus on my work, not on configuring new setups.

My ~/bill directory mirrors the Unix home directory structure I’ve been using for over 50 years. This design keeps things intuitive and organized:

~/bill/etc/org/: For Org-mode files and configurations.
~/bill/usr/projects/: For development work and personal projects.
~/bill/var/www/: For my website files.

This structure reinforces consistency and simplicity, principles that have guided me throughout my life.

automation: the system works for me

Automation is a core value that keeps me efficient and focused. One of the most powerful automations in my workflow is git synchronization. Keeping my configuration and notes synchronized across devices is critical, but I take a careful approach: I always check for changes before committing. This practice ensures that I have full control and awareness of what’s being synchronized.

why check for changes?

Checking for changes before committing prevents unwanted or erroneous updates from propagating through my workflow. It helps me avoid conflicts, identify unintended modifications, and maintain a clean and organized repository. Automation is powerful, but mindful automation — where I’m aware of the system’s actions — is even more effective.

auto-sync function

Here’s the function that handles the process of checking, committing, pulling, and pushing changes:

(defun my/git-auto-sync ()
  "Auto-sync function to pull, merge, and push changes with proper checks."
  (interactive)
  (save-some-buffers t)
  (let ((default-directory hdir))
     ;; Check for uncommitted changes
     (if (not (string-empty-p (shell-command-to-string "git status --porcelain")))
        (progn
          (message "Uncommitted changes detected. Committing changes...")
          (shell-command "git add .")
          (shell-command "git commit -m 'Auto-commit before sync'")
          (message "Changes committed successfully."))
     (message "No changes to commit."))

     ;; Pull latest changes (merge instead of rebase)
     (if (zerop (shell-command "git pull --no-rebase origin main"))
        (progn
          (message "Pulled latest changes successfully.")
          (shell-command "git push origin main")
          (message "Pushed changes successfully."))
     (message "Error during git pull. Resolve conflicts manually."))))

This ensures that my work is always up-to-date and consistent across devices, reducing the mental load of remembering to sync manually.

managing life with org-mode

Emacs becomes even more powerful with Org-mode, a system for organizing tasks, notes, and schedules. Inspired by Tom Limoncelli’s Time Management for System Administrators, I use three primary Org-mode files: life-goals.org, todo.org, and calendar.org. These files help me plan, prioritize, and execute tasks effectively.

the three key files

  • life-goals.org: This file contains my long-term objectives and overarching ambitions. It’s where I break down my goals into manageable steps and track my progress. Having a clear view of my life goals keeps me anchored and ensures that my daily work aligns with what truly matters to me.

  • todo.org: This file is my central hub for day-to-day tasks. It’s a running list of everything I need to do, categorized by priority and context. Whether it’s a simple errand or a complex work project, todo.org helps me stay on top of it all. Tasks are regularly reviewed and updated to keep me productive and focused.

  • calendar.org: This file helps me manage time-sensitive tasks, appointments, and deadlines. It acts as a bridge between my goals and my schedule, ensuring that important commitments are honored. By keeping track of deadlines and events, I can allocate my time wisely.

configuration file for org-agenda

Instead of hardcoding these files directly in my .emacs, I use a separate configuration file to load them. This keeps my main configuration clean and modular. Here’s how I set up the Org-agenda files:

In a separate org-config.el file:

(setq org-agenda-files '("~/bill/etc/org/life-goals.org"
                         "~/bill/etc/org/todo.org"
                         "~/bill/etc/org/calendar.org"))

In my .emacs file, I load this configuration:

(load "~/bill/etc/org-config.el")

This modular approach keeps my configuration organized and makes it easy to update or expand my Org-agenda setup without cluttering the main .emacs file.

efficiency through treemacs, company, and ivy

Emacs thrives on tools that enhance efficiency by reducing cognitive load. Three key tools in my setup are Treemacs, Company, and Ivy.

treemacs

Treemacs is a powerful file and project explorer that keeps my workspace organized and accessible. With Treemacs, I can navigate my projects visually, reducing the need to remember deep directory paths.

(use-package treemacs
   :config
      (setq treemacs-width 30))

company mode

Company mode provides intelligent, context-aware autocompletion. Whether I’m writing code, text, or configuration files, Company helps me type faster and more accurately by suggesting completions, sparing me the effort of remembering exact syntax.

(use-package company
   :config
      (global-company-mode))

ivy and counsel

Ivy and Counsel streamline command and file completion, making it faster to find and open files, run commands, and search through buffers. With these tools, I reduce the mental burden of remembering long command names or file paths.

(use-package ivy :config (ivy-mode 1))
(use-package counsel :config (counsel-mode))

These tools work together to create an environment where the mechanics of work fade into the background, letting me focus on what matters most.

conclusion: emacs as a way of life

Emacs is more than just a tool — it’s a way of life. It represents freedom, automation, adaptability, and continuous improvement. Through thoughtful customization, automated synchronization, and effective planning with Org-mode, Emacs helps me manage both my work and personal life with clarity and efficiency.

By combining git automation, a Unix-inspired directory structure, and powerful tools like Treemacs, Company, and Ivy, Emacs becomes a partner in the pursuit of simplicity, efficiency, and growth. This system isn’t static; it evolves with me. My .emacs file is a living document that reflects my values and adapts to my needs.

In embracing Emacs, I embrace a philosophy of deliberate, thoughtful work — a journey of exploration, resilience, and authenticity that never truly ends.