Emacs

Restclient is dead… Now we have verb!

emacs rest tools

Recently I found an interesting mode in emacs to manage and run http requests!

enjoy! heheh

/comments ~lucasemmoreira/opinions@lists.sr.ht?Subject=Re: Restclient is dead… Now we have verb!

Emacs code navigation? TAAAGS!

emacs tools

Do you know when you open a code file and you want to navigate it but you have to fire up a whole enviroment just to do it? In clojure, would be cider, in python it would be elpy and so on…

Well, get ready feel free! All you need is a command line and vanilla emacs!!

The command is etags. What this command does is look for all the definitions you made in the files you pass as an argument with the language and it will create a TAGS file in the current directory.

find . -type f -name "*.clj" | xargs etags --language=lisp

Once that is done, use you xref-find-definitions and xref-pop-marker-stack command (alias in vanilla as M-. and M-,, respectively) and it will ask you where is the TAGS table.

You can reset the table with tags-reset-tags-table. If it feel very UNIX like, you would be right. It is! Enjoy!

Oh, not sure what languages are supported? Fear not!

etags --help

  1. emacs tags
  2. elpy
  3. cider

/comments ~lucasemmoreira/opinions@lists.sr.ht?Subject=Re: Emacs code navigation? TAAAGS!

Emacs? No, emacsclient!

emacs terminal

This is a shoutout for all of you who are tired of waiting emacs to load on startup or annoyed to feel forced to leave an instance open.

emacsclient can save you from that. All you have to do is to leave an daemon open. Don’t use (server-start) because that will force you to have an GUI or terminal open at all time. The solution? A command.

On your terminal (or .xsession file):

emacs --daemon

After that, you can invoke emacs GUI with emacsclient -c and emacsclient -t to open directly in the terminal. The colors probably will not match, so you can take a look here =].

Now, to make life a little bit better, you can create alias/binary

alias emt='emacsclient -t'
#!/bin/sh
emacsclient -c -F '((font . "Hack 12"))'

The latter I use as a binary in $PATH to be invoked with rofi or as a shortcut in the dwm.

Thanks Pedro for the post idea hehe.

/comments ~lucasemmoreira/opinions@lists.sr.ht?Subject=Re: Emacs? No, emacsclient!

A first (not bad) emacs experience

emacs config

Well, not for me. I have been using emacs for almost a decade now and I have used bad configs and good ones. In the past few years that I am feeling more comfortable with lisp, I have been enjoying to tweak the configuration more and more.

My girlfriend has recently come to the good side of workplace and could drop Windows and its tools. In this new world, she tried to go into the Linux and emacs was something that I was more than eager to show her!

The problem

Well, emacs has quite of an interesting learning curve source

and I totally agree with it! So I created what it could be a first step to use it.

What is FirstEmacs?

What I looked for was a way to drop the two most troublesome keys in emacs (in my opinion) and its consequences. Which are Ctrl+x, Ctrl+c and Ctrl+v for cutting, copying and pasting. And emacs has most of its hotkeys attached to Ctrl+x and Ctrl+c.

It took me some time, but then I found wakib-keys. Which was pretty much the solution I was looking for. Basically, remaps the standart Ctrl+x and Ctrl+c to Ctrl+e and Ctrl+d.

Last note

Writing this assured the usefulness in the notation C-c and C-x for Ctrl-c and Ctrl-x (and so on) =].

/comments ~lucasemmoreira/opinions@lists.sr.ht?Subject=Re: A first (not bad) emacs experience