Geekices

Trying out Emacs again

A few days ago, I decided to give Emacs another try. I’ve previously attempted to use this text-editor / operating system — probably about 10 years ago or maybe a bit more — but never got the hang of it.

A few years after my first try at Emacs, I discovered Markdown. Since then, I’ve used text editors with a GUI to write in this markup language. That was until two years ago when I encountered a Vim mode for Markdown and adapted it to my specific needs. It has been one of my main tools to write, but I don’t really like the Vim keybindings.

After a bit of pondering, I thought about giving Emacs another go, mainly because the shortcuts are similar to the ones used by Tmux and I felt this would make my adaptation to the editor easier. But to do that, I would need to read about this software, given its complexity. That’s how I got to an amazing reading resource: “Emacs Mini Manual (PART 1) – THE BASICS”. If you want to learn how to use Emacs, give it a go; it’s really useful.

One thing about Emacs is that it feels bare-bone when compared to some editors. This is not true, of course, but for a newbie like me, it might as well be because most of the options are “hidden” and you need to know how to get to them.

After reading the “Emacs Mini Manual” and some other resources sent to my by folks at Twitter and at Fosshost’s IRC channel, I decided to try an Emacs distribution to help me use this software. That’s how I got to Prelude.

Prelude is an enhanced Emacs 25.1+ distribution that should make your experience with Emacs both more pleasant and more powerful.

And it really does. It has some themes, avoiding the eye-hurting default white background, and includes several plugins to ease your life. Also, you can configure it as you like, just like vanilla Emacs.

To try this distribution, I decided to write this blog post after setting it up. So far, so good.

PS: It’s almost time for EmacsConf.


Geekices

My tools of trade in a Linux system

With no special order:

Desktop environments and/or window managers

  • plasma (to me, the best desktop environment for any free software operating system)
  • i3wm (paired with picom [https://github.com/ibhagwan/picom] for transparency, blur and rounded corners)

Terminal emulators

  • konsole (I’ve grown very fond if this terminal emulator since I switched to the plasma desktop, and it has blur for the blings ;))
  • urxvt-unicode (with tabbedex, so I can have tabs with it)

Text editors

  • micro (my favorite and because it supports gui keybinds, although it’s a cli text editor)
  • nano (simple and super useful, available by default in a lot of linux distributions)
  • vim (I have a custom mode for writing markdown text)
  • gedit (for when I need a text editor with a gui)

Note taking

  • qownnotes

Browsers

  • firefox (my favorite for around a decade and an half. I actually used the 0.x versions)
  • chromium
  • brave
  • falkon

Multimedia

  • gimp (and a fork named glimpse)
  • darktable
  • lightzone (like darktable)
  • jpegoptim
  • optipng
  • oxipng
  • youtube-dl

System tools

  • htop
  • gotop
  • cat
  • scat (for when I need to ‘cat’ a file with syntax highlight)
  • less
  • watch (I like to keep a pane opened on tmux with the hardware temperature [watch -n1 ‘sensors -A | egrep “edge|temp”‘])
  • openssh
  • dotdrop (for the dotfiles backup)
  • tmux (I love this terminal multiplexer)
  • tmuxinator (useful if you want to open tmux with any number of panes by default)
  • broot (a cli file manager with vim-like keybinds and commands)
  • fzf integrated with bash (because fuzzy search rocks)
  • pacman (because I use EndeavourOS, basically Arch with a graphical installer)

What about you? What are your tools of trade in a Linux system?


Geekices

Managing dotfiles

I’ve been looking for a simple but powerful solution for managing my dotfiles, either the ones on my personal computer or the ones I use on virtual machines. After taking a look at a few options, I think I’ll give dotdrop a try and publish a new post as soon as I feel I’ve evaluated it enough.


Geekices

Bash: how-to improve history manipulation

By default, up and down keys allow you to navigate your bash history. Another option is the history built-in command and bash expansions (ex.: !2 runs the second command, oldest to newest, from your bash history).

There are also tools, like bash-it, that allow for better history manipulation, but this also adds a lot of other stuff, so it might make your .bashrc load slower. It will make your bash look good as hell too.

Another option for an awesome way to access your bash history is the following snippet, based on bash-it‘s history plugin:

if [ -t 1 ]
then
    bind '"\e[A": history-search-backward'
    bind '"\e[B": history-search-forward'
fi

With this, you only need to write part of a command, press the up arrow and it will complete it with the commands in bash history file that match to what you’ve written.

I’ve add it to the end of my .bashrc. Together with bash completion, it improves my workflow by a lot.