November 18, 2024

CrossroadsCrossroads

Different Path

It occurs to me that the usual content of the blog has changed significantly in the previous few months. I don’t write about the newest Markdown based text editor that has been released. I write about some macOS stuff. But mainly I write about Emacs.

I don’t see that changing much in the near future. I have moved on from Obsidian, VSCode and the others into Emacs. I have BBEdit and iA Writer installed. I use them for specific things. BBEdit is my comfort blanket. It is there to remind me that if I get overwhelmed by Emacs, there is a tool which I can use to solve my current problem. iA Writer is there to provide me with its syntax checker and easy syncing with my iPhone.

I am not interested in the newest addition to the plethora of text editors which deal with Markdown. I use Emacs for that. Completely immersed in Emacs, I don’t have the energy to check some new editor out. Thus the content of the blog is going to change to focus on what I am working on and using. Sorry if you miss the previous focus.

macosxguru at the gmail thingie.

Thanks to: Photo by Emiel Vansteenbrugge

macOS writing emacs
November 12, 2024

completely unnecessary cat picturecompletely unnecessary cat picture

Links of Note 2024-11-11

macosxguru at the gmail thingie.

Note: Thanks to Photo by Tranmautritam

macOS emacs bbedit
October 29, 2024

EmacsEmacs

Much Ado about Emacs 001

This is going to be a recurrent series on my working in Emacs. I will write about what I am trying, adopting, and discarding. The rationale or the benefits behind the decisions. The goal is two pronged:

  1. It might help people going through the same process.
  2. It will help me understand the changes I am making to the configuration of Emacs and my workflow in it.

god-mode

god-mode is a major change to the way I interact with Emacs.

I am using the ZSA Moonlander as my keyboard and was having trouble with the continual mashing of the Ctrl key and the Alt key while using Emacs. I tried to change the location of those keys to get rid of the fatigue that comes from contorting my hands to reach them. Didn’t help. God-mode solves that problem.

Not interested in switching to evil-mode, or doom yet, it made sense to try out god-mode as an alternative. I specially liked this feature in god-mode:

All existing key bindings will work in God mode. It’s only there to reduce your usage of modifier keys.

Using it for a week now. Still getting used to it, but I must point out that not reaching for the Ctrl key and the Alt key makes the process of using Emacs easier on my wrists. Will use this for a couple of months before I decide on continuing to use this or switching to evil-mode. Have to give it a reasonable amount of time to embed itself in my muscle memory.

This is my setup for god-mode.1

#+begin_src emacs-lisp
(use-package god-mode)
  (god-mode)
    (global-set-key (kbd "<escape>") #'god-mode-all)
    (setq god-exempt-major-modes nil)
    (setq god-exempt-predicates nil)
    (global-set-key (kbd "C-x C-1") #'delete-other-windows)
    (global-set-key (kbd "C-x C-2") #'vsplit-last-buffer)
    (global-set-key (kbd "C-x C-3") #'hsplit-last-buffer)
    (global-set-key (kbd "C-x C-0") #'delete-window)
    (defun my-god-mode-update-cursor-type ()
    (setq cursor-type (if (or god-local-mode buffer-read-only) 'box 'bar)))
    (add-hook 'post-command-hook #'my-god-mode-update-cursor-type)
#+end_src

A New Mode line

I was using the mode line from Sophie Bosio. It was impressively minimal. I wanted some more information displayed. Being slightly familiar with doom-modeline. I decided to switch to it. The result is still minimal but it does contain the information I want.

This is what I am using:

#+begin_src emacs-lisp
(use-package doom-modeline
  :ensure t
  :init (doom-modeline-mode 1)
(setq doom-modeline-height 25)
(setq doom-modeline-bar-width 4)
(setq doom-modeline-hud nil)
(setq doom-modeline-window-width-limit 85)
(setq doom-modeline-project-detection 'auto)
(setq doom-modeline-buffer-file-name-style 'truncate-nil)
(setq doom-modeline-icon t)
(setq doom-modeline-major-mode-icon t)
(setq doom-modeline-major-mode-color-icon t)
(setq doom-modeline-buffer-state-icon t)
(setq doom-modeline-buffer-modification-icon t)
(setq doom-modeline-buffer-name t)
(setq doom-modeline-highlight-modified-buffer-name t)
(setq doom-modeline-column-zero-based t)
(setq doom-modeline-percent-position '(-3 "%p"))
(setq doom-modeline-position-line-format '("L%l"))
(setq doom-modeline-position-column-format '("C%c"))
(setq doom-modeline-position-column-line-format '("%l:%c"))
(setq doom-modeline-minor-modes nil)
(setq doom-modeline-enable-word-count 1)
(setq doom-modeline-continuous-word-count-modes '(markdown-mode gfm-mode org-mode))
(setq doom-modeline-buffer-encoding nil)
(setq doom-modeline-indent-info nil)
(setq doom-modeline-total-line-number 1)
(setq doom-modeline-vcs-icon nil)
(setq doom-modeline-check-icon t)
(setq doom-modeline-check-simple-format nil)
(setq doom-modeline-number-limit 99)
(setq doom-modeline-workspace-name nil)
(setq doom-modeline-persp-name nil)
(setq doom-modeline-display-default-persp-name nil)
(setq doom-modeline-persp-icon nil)
(setq doom-modeline-lsp nil)
(setq doom-modeline-github nil)
(setq doom-modeline-modal t)
(setq doom-modeline-modal-icon t)
(setq doom-modeline-modal-modern-icon t)
(setq doom-modeline-always-show-macro-register nil)
(setq doom-modeline-mu4e nil)
(setq doom-modeline-gnus nil)
(setq doom-modeline-buffer-file-name-function #'identity)
(setq doom-modeline-buffer-file-truename-function #'identity))

(use-package nerd-icons
  :custom
  (nerd-icons-font-family "Symbols Nerd Font Mono"))
  
#+end_src

Turning Off M-Ret From Splitting the Line

M-return continues a list in org-mode. You have to get to the end of the line and press it to get a new list item. That was a pain. This code makes it possible to press the keyboard command wherever you are in the line and it gives a new list item after the one you were on.

I did not write this. Unfortunately I don’t remember where I got it from. Sorry. Need to do a better job of documenting the source of ideas. The code is:

#+begin_src emacs-lisp
(setq org-M-RET-may-split-line '((item . nil)))
#+end_src

macosxguru at the gmail thingie.


  1. I will write about vsplit-last-buffer and hsplit-last-buffer in the next edition.↩︎

emacs
October 23, 2024

Lexend on ScreenLexend on Screen

Lexend

I have always used monospaced fonts in my text editors. For the last few years, I have been using:

  1. Recursive Sans & Mono
  2. protesilaosiosevka-comfy Custom build of Iosevka with different style and metrics than the default.
  3. iosevka-output A custom Iosevka build modeled after the lovely Input Mono font wide (extended) characters, legible glyphs, and tightened line spacing
  4. Input Fonts for Code

Lexend configLexend config

Emacs lets me use variable-pitch fonts in my text editor and I have been using Lexend — Change the way the world reads..

Don’t know the science behind it. They have some on their site. Like reading and writing with it.

Using the font in Emacs and every other text editor installed on the machine.

It is free. You can try it out for yourself. I love the Lexend Deca variation of the font.

macosxguru at the gmail thingie.

font text editor macOS emacs
October 19, 2024

ToolsTools

Why Emacs and Not BBEdit and TaskPaper

A reader asked. “You seemed happy with the combination of TaskPaper and BBEdit. Why the switch to Emacs?” This is my attempt to answer that question.

BBEdit and TaskPaper are Great

There was no good reason to stop using BBEdit or TaskPaper. I did not move from them because they were deficient in any way. I was curious about Emacs and got a push to try it out again from pprevosemacs-writing-studio Emacs configuration for authors who research, write and publish articles, books and websites..

There was some residual angst from my previous failed attempts to switch to Emacs. It made sense to give it another shot. The following makes me happy with the switch to Emacs.

One program

I don’t have to switch between TaskPaper and BBEdit all day to keep writing. Outlines in TaskPaper and the rest in BBEdit. Emacs with org-mode handles everything.

Org-mode Is Life-Changing

You can manage your life in org-mode. My life is simple, I am taking baby-steps into letting Emacs and org-mode manage my schedule and tasks.

It has a capture system which is helpful. You can pause in the middle of any document and invoke the capture system to add stuff to particular regions of a predetermined set of files. It is an absolute essential part of the org-mode workflow.

Besides the task management function, org-mode lets you write. I love outlines and I am drawn to that feature of org-mode. It has no problem managing large files and lets me move easily between sections of large documents. I can see why people are enthralled by org-mode. You can do everything through the keyboard. I don’t find myself reaching for the trackpad. (BTW, this same feature is a part of markdown-mode in Emacs.)

Barely scratching the surface of org-mode and it is adding joy to my life.

Markdown-mode

I was comfortable writing Markdown in BBEdit. It required the help of a mix of Keyboard Maestro macros, Services, some AppleScripts, and some text-expansion snippets. It worked. Sublime Text has a Markdown-package which is great. The Markdown package in Emacs is fantastic. It makes writing Markdown in Emacs painless. There is a manual which is written by Jason R. Blevins, the creator of the Markdown package. Extensive support for keyboard commands is a feature of the package and it makes writing Markdown a breeze. I write Markdown for the blog and Emacs is doing well in that task. I have switched to org-mode for everything else.

Caveats

Emacs is hard. There is much to learn. It is not only a question of opening a buffer and writing in it. That is the easy part. Almost all the actions you do on a regular basis can have keyboard commands associated with it. Remembering them all takes time. I am getting familiar with it but it is a slog.

The ability to access any command through M-x (⌥x), makes the act of living in Emacs easier. It is like the Sublime Text or VSCode command pallette. Gives you access to all the commands with the keyboard commands next to it. Helps you learn them.

Taking things slowly. There are a bunch of commands which I get to use regularly, I know those at this stage. Steadily increasing the tool-set of keyboard commands in my muscle-memory. This is going to take a while, but I am not in a hurry.

The part which is harder is to realize that Emacs can do almost everything you want it to do. It has been under continuous use for the last 40 odd years. Whatever you want to do, someone in the past has wanted to do that exact thing and they have written a little package or a little code to make Emacs do just that. You have to find that relevant resource. That involves searching on the Net and also reading through other people’s configuration files looking for the salve to ease that itch. All of this takes time.

I have started reading a book on lisp. I am not a programmer. It is a journey.

Prot on Switching to Emacs was categorical. You can’t be an “Emacs tourist.” This is not a program where you use the product over a weekend and you know everything about it. Not that kind of beast at all. “It requires commitment,” he says. No shit.

Taking Prot’s advice, I am committing to it completely. I am ditching my old workflows and creating new ones. Emacs requires immersion and that is the only way I am going to get comfortable in it. I see 20-year-veterans learning new things about it. This is a journey of a lifetime. I just wish that I had started earlier. Can’t go back in time. I am accepting the fact that I am coming to it late. But I will use it, to the best of my ability, for hopefully, the rest of my life.

macosxguru at the gmail thingie.

Thanks: Photo by Pixabay: https://www.pexels.com/photo/set-of-tool-wrench-162553/

emacs bbedit taskpaper