serhii.net

In the middle of the desert you can say anything you want

02 Jan 2021

Day 732

Markdown newline inside quote

Couldn’t understand why there are newlinen in my yearly review blog post from last year. So - in markdown, two spaces and then a line break create a line break.

So, like this:
One
two

Three
Four
Fine, no spaces Six, no spaces

Highlight to see spaces:

So, like this:  
One  
*two*  

> Three  
> Four  
> Fine, no spaces
> Six, no spaces

vim show trailing whitespaces

In connection to the above, yes. Updated ~/.vimrc with the following:

set listchars=tab:\:\ 
set listchars+=trail:◦

Looks like this:
screenshot

vim CONVERSION ERROR - convert file to different encoding / save with other encoding.

For the above had to convert my ~/.vimrc to utf-8, not the default latin-1:
:w ++enc=utf-8

vim insert utf-8 characters

i3 keybinding to make a screenshot and put it into jekyll assets directory

This makes a screenshot as usual, opens it, opens the jekyll dtb assets folder, and puts the screenhsot name in the primary clipboard. I look at the screenshot, if I like it - I drag it directly to the folder, then use the vim/jekyll binding to insert it in the markdown.

bindsym Mod3+Shift+s --release exec scrot -s -e 'mv $f ~/s/screenshots && nomacs ~/s/screenshots/$f & echo -n $f | xclip -selection c && thunar ~/o/dtb/assets/pics/screenshots/'

echo -n is echo without newline (otherwise it gets fed to xc with newline appended). Added to ~/.config/i3/config.

Feels incredibly ugly and unstable but works for me I guess. Ideally it’s long enough to be replaced with a bash script, but not sure it’s worth it. But if I end up doing more of these, I’ll create a one custom big parametrized bash script that I’ll call like ./big-script.sh screenshot.

vim jekyll binding to insert screenshot picture

map <leader>p i![](/assets/pics/screenshots/<esc>pa)<esc>0lli in ~/.vimrc

Inserts a picture with filename from primary selection, then goes back to the description. Used with new i3 screenshot keybinding from above. a in vim is “insert from next character”, so like A but with words.

I really do need to use a/e etc in vim more often.

camel / snake / kebab notation, note to self.

I seem to use more of-this-notation lately, instead of this_notation. Formalize this, not just for consistency, but to use this to my advantage - vim and company see these-words as separate, and this_word as one.

bash echo without newline at the end

echo -n doesn’t add a newline. Especially useful combined with xclip.

Nel mezzo del deserto posso dire tutto quello che voglio.