Some useful custom text objects for vim
Numbers
Put it into your .vimrc
:
Vim has built-in gx
mapping to open an URL under the cursor defined in the
bundled netrw
plugin. It is limited to barebone urls and quite often that is
not enough.
I have come up with a better gx
mapping (for me of course) that is able to open:
markdown links [Hacker news](https://news.ycombinator.com 'link to Hacker news website')
;
asciidoc links https://news.ycombinator.com[Hacker news]
;
" Author: Maxim Kim <habamax@gmail.com> | |
" Desc: Sync current buffer with the github gist having the same file name. | |
" | |
" Prereqs: | |
" 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 |
Vim has :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:
:r ~/.vim/asciidoctor/template_for_entity_relation_diagram
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 /klsdf<CR>
do :nohl
command or
So how would you use your text editor to make a daily notes?
For vim I end up using simple approach:
have a ~/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.
Install 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: