Rtodev.tech blog

What I learned lately…

I feel like I want to blog these days, but I have few time to allocate to it.

So, has a kickstart, lets write some useful stuff I learned lately.

Restore automatic rename in Tmux

I use Tmux along with Vim most of the time. Sometimes, I rename windows by mistake, when I type a wrong shortcut. Doing so, I lose the tmux abililty of renaming window with current running process name. To restore that feature, type the command bellow.

set-window-option automatic-rename on

Open url in browser from a Vim buffer

gx in normal mode open a link under the cursor in a web browser. Actually, it can open any file with the default associated application. This is the same command as typing x in a netrw buffer to open a file (Vim embedded file browser).

On my system (Linux Debian 10, with xfce), it uses xdg-open under the hood. Default browser can be configured with xdg-settings:

xdg-settings set default-web-browser your_browser.desktop

.desktop files are found in ~/.local/share/applications (I always forget about this directory). Refer to :help gx to know more about this command and how to configure its behaviour.

Use entr to watch your files and run a command

I tried Entr. It’s a simple file watcher that you can run through a pipe. For instance, following command will run make if a markdown file is modified:

find . -name ".md" | entr make

Its quite lean and unix-y, I like that.

That’s all for today.

Posted on 2020-08-11 at 05:36

Previous Back