Ok, I will admit.. this took a while. But I have found a nice way of
doing this.
What is this? Well, let’s say let’s say that you have a command to
start your server in user namespace. With this cool feature, now you
can run this with a emacs command (or shortcut if you bind it).
The cool thing about this is that the command will run with the
namespace from the repl and not the last ns that you loaded with cider
=].
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!
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
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 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: Running repl commands in cider (emacs)