Playing around with the plugins I wanted to use, I figured out why many of the features I needed were not working. An hour and a half of fiddling with my
~/.vimrc I'm able to do have a somewhat working first iteration of a setup.
For syntax highlighting, one has to specifically enable it with
Markdown files are defined as having the
.markdownextension as to avoid confusion with other files using
.md, so if I want Vim to interpret
.mdas a Markdown file, I need to specifically set that as the filetype with
autocmd BufRead,BufNew *.md set filetype=markdown
Word counts are surprisingly not straightforward! There are many ways I could go about it, including calling a shell command for counting words by first writing the file and then running
:w !wc). A somewhat nicer alternative is using the
wordcount()value available in newer versions of Vim, that can be used in the statusline, but that doesn't work with Goyo - so I decided to use a custom command:
command Wrd :echo wordcount().words(apparently, custom commands need to start with a capital letter). It's not exactly the user experience I was looking for, i.e. a live count, but it's good enough for me to have a rough estimate of the number of words (as it does count every word-char between word boundaries, including
#), at least until I can figure out something more suitable for my writing needs.
Limelight was properly installed and working, but because of my custom terminal colors, it couldn't figure out how to dim the paragraphs I'm not currently editing. Adding a global variable for the plugin fixed the issue
let g:limelight_conceal_ctermfg = 'DarkGray'(also! I can inspect variable values with
:echo, which makes it way easier to debug issues). The plugin itself sometimes behaves differently than I would expect, but most of the time it gives me a nice focused environment with the current text highlighted. I wanted to make it prettier and spent ~20 minutes wildly searching for a custom foreground font color until I realized the screenshot I saw in someone's blog post is showing their actual color scheme and not some additional plugin-specific setting. That was a tad embarrassing, but at least I know what's up now.
Adding leader key shortcuts is pretty neat! I can now enable Goyo with
nnoremap <Leader>gy :Goyo<CR>. I also automatically enable Limelight when entering the focused Goyo mode with
autocmd! User GoyoEnter Limelight(I also have the reverse for disabling both).
#. This bit me more times than I care to admit.
To navigate in the Goyo mode, it's better to use
gkfor navigating, as the lines get automagically wrapped and regular
kno longer work. I may consider remapping the regular keys, as it would be the behaviour I want most of the time. Or, at least remapping them for writing longer-form text.
On one hand, it feels awkward setting it up took me about 1.5h of research, trial and error. On the other, I shouldn't really be surprised. Vim is pretty old and powerful, there are multiple ways of doing the same thing and the interwebs is full of people's opinions on what's the right way (usually, their way).
I'm happy that I showed up for another experiment and I'm slowly getting used to working in Vim. It's going to help me be way more comfy with it and improve my day-to-day work experience.