Werden wir Helden für einen Tag

Home | About | Archive

The tool situation 2023 Q4: shell, dirvish, expand-region, iPhone SE

Posted on Dec 24, 2023 by Chung-hong Chan

The original idea was to just give a follow up to all those “Advent of emacs” (aoe) posts an update and say whether I am still using emacs the way described in those posts. But actually I have accumulated quite a bit of posts about tools (all tools, not just emacs). I think it would be nice to review the tool situation regularly. For one, it makes obsolete some previous blogs. For two, I can tell you the little tools I enjoy recently.

Emacs

My current emacs setup is not far away from the time those “Advent of emacs” were written. However, as I said in the ICA paper post, the post on GhostText and Overleaf is now obsolete because of Overleaf’s removal of the so-called legacy interface (basically an HTML <textarea>, I think). I am now using the web interface mostly, which is not ideal.

Other than that, I am still using more or less the same setup: ess, magit, deft, etc. I am still using the same theme (tron-legacy), although not in summer. For the summer, I used the very boomer beige solarized-theme.

The shell situation

I wrote in aoe5 that I don’t use eshell (shell written in elisp). In 2023, I found an important niche of eshell, that is, to run an interactive R session on a remote server. I found that eshell is the a shell I can ssh to a remote server, run R there, and then run (ess-remote) to make it an interactive R session that I can send R code over. Actually, shell can do that too, perhaps more nicely than eshell. Only vterm can’t do that.

The next item is related to remote editing.

dirvish and a crazy feature of magit

I wrote in aoe5 also that I don’t like to use dired. But for remote session (which I needed to do a lot in some part of 2023), it is actually quite nice to use dired to open a remote directory via tramp, e.g (find-file "/sshx:whatever:~/") and then select files from there to edit locally and save it back to its remote location.

But I still don’t like dired for open up too many buffers. Yes, I know there are many fixes for this. But my choice is just to switch to dirvish and override dired with that, i.e. (dirvish-override-dired-mode 1). I also created a function to open a file with xdg-open and mapped it to, well, you know it, C-q.

(use-package dirvish
  :init
  (defun dired-open ()
    "xdg-open the selected file"
    (interactive)
    (let ((selected-file (dired-get-filename)))
	  (async-shell-command (concat "xdg-open " selected-file))) ;
    )
  :config
  (dirvish-override-dired-mode 1)
  :bind (
		 :map dired-mode-map 
			  ("C-q" . 'dired-open))
  )

As I did quite a lot of remote development, I also discovered a crazy feature of magit. Actually, it is possible to use a local magit session to connect to a remote git repository and do all the git things on the remote repository. Mind blowing.

expand-region

Another useful tool that I discovered recently is expand-region. One thing I need to do quite often is to select some quoted text. There are probably some advanced movement commands that I can use. But I think expand-region’s semantic regions are easier to pull off.

(use-package expand-region
  :bind (("C-'" . er/expand-region)
		 ("C-\"" . er/mark-outside-quotes)))

By press C-' repeatedly, I can select from word, sentence, sentence within quotes, Current S Expression, Parent S Expression, Function definition, and then the entire document. I also created C-" which just directly select sentence within quotes. Very handy.

For me, C-' and C-" are probably the last two shortest key combinations that are still available. And I really like this because I usually need to press this repeatedly. So I can just hold Ctrl and press many '. For R code, it is probably the easiest way to select a function definition (probably just press C-' two times), even I know ess-mark-function exists.

Linux

I am still using Ubuntu Linux 22.04 LTS. The tiling WM situation is that I am still using i3. I don’t need to retire from using tiling WM. i3 is super robust and I don’t see a reason to switch to something else, yet.

Mobile Phone

I did not blog about it, but I bought my iPhone 6S Plus in Oct 2016 1. At that time, iPhone 7 was already released but I still got myself an iPhone 6S Plus. I will tell you why.

I have used that iPhone 6S Plus for 7 years. To be honest, I feel that I can probably use it for maybe 1 or 2 years more. But the super robust phone showed its age. Its battery can last for maybe 3 hours without switching on low battery mode and keeping it at the lowest screen brightness. The screen has long been broken due to a 1-meter drop. Both can be fixed by replacing the parts. As of writing Apple still provides security updates for this model; although still in iOS 15 (whilst the latest is iOS 17). I don’t know how long it will still be supported. As I said, I can probably use it for some more years. My wife convinced me that maybe I should change my phone instead.

During my trip back home, I bought an iPhone SE (3rd gen) for a very affordable sum of money. I got the lowest end with only 64G. Why? I just found that I don’t need to use the camera (or cameras) and I use maybe just 7 apps (Duolingo, GMail, Firefox, Signal, Spotify, and Tagesshau) very often. And maybe also authenticators, dictionary, and some Bank apps. For those apps, I don’t need the best CPU/GPU/TPU and a lot of storage; and of course, I don’t need to buy the great and expensive cameras on the mainstream iPhones, even the outdated ones. I don’t mind the screen bezels. I don’t even use my phone to watch videos! Just give me a decent, robust, future-proof phone which I can use for a few years!

There are pros and cons. Pros: It’s a breath of fresh air to revisit the smaller form factor, which is super rare on the market. It’s actually very handy to be able to hold a phone with one hand and use with just one thumb. Other than that, it is effortless to carry and sit nicely in the bottom of my jeans’ pocket. I don’t feel it most of the time. I also love the fact that it is still using Touch ID, not the face recognition thing (I hate that). The phone is very snappy and the battery life is very satisfactory. I charge my phone every two days, a thing unthinkable a few months earlier. The speaker is also significantly louder than my old iPhone 6.

Just one con. Maybe I should tell you why my previous phone was iPhone 6S Plus (not iPhone 7): headphone jack. Now I need to finally confront the 2016-era issue of missing headphone jack. I bought a wired headphone using Lightning (weird and is now obsolete) in Japan. But I still don’t understand why it is a good decision for the consumers to remove headphone jack whilst most wired headphones on market (almost a decade after the removal of headphone jack on most smartphones) are still using the 3.5mm headphone jack. And one can’t listen to music with wired headphone and charging at the same time. I still think that it is only good for the manufacturers. Especially for Apple, which also a manufacturer of wireless headphones, e.g. those Beats headphones and AirPods.


  1. I did blog about my previous Android phone Asus Zenfone 2, which I brought in 2015. 


Powered by Jekyll and profdr theme