Why isn't a triangle called a triagon? And why isn't a hexagon called a hexangle?

I recommend putting your vimrc, and other config files in a git repo.

This gives you a handy backup, and allows you to share your evolving preferences between machines.

Here is mine:

I don't like the look of for several reasons.

1. has a built-in file browser called netrw.

2. Text-UI file browsers are inherantly slow, because you have to tap tap tap tap through the list of items. I find is >10x faster .

3. A lot of nerdtree users seem to have it set up in a side-panel. That seems like a horrible waste of screen-space

Learning all these key features and key sequences has taken me so many years.

However, I think my work rate is the now fastest ever." Faster than the speed of thought" as one blogger said.

- mainly because my hands are always hovering over the middle part of my keyboard. Never need to touch the mouse.

But it has taken a long time to get here.

If you find vim intimidating, my advice would be to stick with it. In the end you'll find it hard to go back to anything else.

If you're using the 8 terminal, you can open it with `:term` for a horizontal split windows, or `:vert term` for a vertical split.

If you want to copy-paste text, you enter "normal mode" with Ctrl+N. Then you can page through the backlog, and yank text like a normal buffer.

Press i to jump back into normal terminal operation.

I used to use for a while, but these days I've gone back to vanilla . I don't really see any benefit in since all it's features (the ones I cared about) got implemented in vim 8.

I'm talking a lot about plugins. If you want to install them, the easiest way is with a package manager.

I use vim Plug: github.com/junegunn/vim-plug

Install it as per the instructions.

Any time you change the list of plugins in your vimrc, run :PlugInstall when you next load vim to install your selections.

Too easy.

Doing `set makeprg` for your project is cumbersome, because it won't persist between sessions.

I like to use the localvimrc plugin so that I can have per-project settings for the build system, tabs/spaces, colorcolumn etc.

can integrate with your build system.

Set the command with:
set makeprg=my\ command\ here

Then type :make to run the build.

You can then quickly jump through errors using the QuickFix window with :copen and :cn .

The only problem is that the make job is modal and fills the whole screen.

Recently I started using vim-makejob: git.danielmoch.com/vim-makejob , which does the build a little panel at the bottom.

Much better.

If you use in , make sure you have the vim-rooter plugin, so that the working directory is automatically set to the root of your project.

A lot of people are raving about in , and they're right. It's by far the fastest way I've found to navigate a large project.

This fzf plugin comes with a bunch of useful presents: github.com/junegunn/fzf.vim

I tried a few key mappings. These are the ones I find myself using all day:

nmap <leader>ff :Files<CR>
nmap <leader>fa :Ag<CR>

I go so fast now:

\ff <some crudely typed file name> ↵
\fa <some piece of code I'm wanting to jump to> ↵

It has a bunch of preset tinykeymaps: github.com/tomtom/tinykeymap_v

Basically it helps any time you want to flip through a list of items: windows, window-resizing, tabs, buffers, folds etc.

Rather than having to input a lengthy key sequence every time you want advance one item

I used to use multiple sessions inside .

The problem is that copy-paste via tmux doesn't work well. And now vim has a built-in terminal emulator, there's no reason to use tmux.

EXCEPT that tmux's window navigation flows a lot better.

The solution? tinykeymap-vim: github.com/tomtom/tinykeymap_v

With this plugin, you can do Ctrl+W h h h to move through windows in the same way you do Ctrl+B ← ← ← in tmux.

If you use , and you havn't learned to use hjkl for movement. Do it. Do it today.

Why? Because arrow keys only do movement - not modifiers. For example you can do 8h to go left 8 places. You can't do that with arrow keys. There's also various places in vim where arrow keys are ignored - only hjkl.

The quickest way to break the arrow key muscle memory is to map them to NOP:

noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>

I have so many bad habits when it comes to my usage of vim.

Recently I've been trying to figure out how I can speed up my work-flows across the board. It's so easy to accumulate ways of doing things that are slightly cumbersome, but not enough to make you take the time to improve your process.

With the right key mappings you can make your process go faster than the speed of thought.

Feels quite liberating.


Hugh Hardie's new album is something really special for the Liquid fans out there

Hugh Hardie - Footsteps

Ok I *love* msgpack. It's like JSON, but with binary data.


I've been using it to log data, which I can analyse very simply in python.

A int32_t is written as:
{0xd2, a, b, c, d}

A string (up to 31-bytes):
{0xa0 | length, ...bytes...}

Binary blobs are handled similarly. Longer strings can be stored very simply:

{0xd9, l1, ...}
{0xda, l1, l2, ...}
{0xdb, l1, l2, l3, l4, ...}

And then more complex objects can be build out of maps and arrays with a couple of bytes.

Show more

mstdn.io is one of the instance in the fediverse. We're an open-minded generalistic instance. Learn more here!