Some useful custom text objects for vim
Put it into your
Vim has built-in
gx mapping to open an URL under the cursor defined in the
netrw plugin. It is limited to barebone urls and quite often that is
I have come up with a better
gx mapping (for me of course) that is able to open:
[Hacker news](https://news.ycombinator.com 'link to Hacker news website');
|" Author: Maxim Kim <firstname.lastname@example.org>|
|" Desc: Sync current buffer with the github gist having the same file name.|
|" 1. Install and setup https://cli.github.com/|
|" 2. Put this file to ~/.vim/autoload/gist.vim|
|" Usage: Open file and :call gist#sync()|
|" Create helper command if needed|
:h skeleton help topic for when you want to read a skeleton
(template) file into a new file.
For me the idea of automatic templates is not that appealing, instead I would rather insert a template when I need it:
You have turned on
hlsearch for some reason in your vim config (well
obviously to highlight your searches) but it gets in your way, right?
Now you try to find a solution to this problem, like
spam random searches
:nohl command or
So how would you use your text editor to make a daily notes?
For vim I end up using simple approach:
~/docs/journal/ directory where I keep yearly journals in asciidoc format (one can use markdown of course).
have a mapping to quickly open a journal ready to enter you thoughts, notes or a todos for a day.
VcXsrv (if it starts after installing, stop it).
Start it using the newly installed program
XLaunch (search in the start
Quite a common task to swap words on a single line might be really cumbersome.
Consider following text transormation: