This is done by adding a function to the completefunc option that returns a list of your registers.

set completefunc=Registers

To make the function you have to return the register contents in a format that completefunc likes:

function! Registers(findstart, base)
if a:findstart == 1
return 0
endif
" Imagine, if you will, this is a full list
" of all your registers...
let l:regs = [ '"', '0', '1', '2', '3', '4', '5', '6', ...]
return {
\'words': map(l:regs,
\{ i, reg -> {
\'key': reg,
\'word': getreginfo(reg).regcontents[0],
\'abbr': '@' . reg,
\'menu': slice(trim(getreginfo(reg).regcontents[0]), 0, 20)
\}
\})
\}
endfunction


Using buffers is a pretty fundamental part of using Vim properly and, to be honest, I avoided using them for a while when I started. They’re a weird concept if you’re used to using any gui program, where it’s more common to think in terms of files and tabs.

But the main problem I had to get over was the :ls command, which I still find cumbersome and un-intuitive. …


React hooks has provided devs with a new way to create components that no longer relies on using Javascript’s dodgy implementation of classes.

Now JS devs can write plain Javascript functions as React components, which is awesome (watch Source Decoded’s video on prototypes for some background info on Javascript classes).

Believe me that this is not an article panning hooks, hooks are super useful and I use them every day at my work, but I think there’s a miscomprehension among many devs about what hooks are for and how they should be used. …


I watched an Emacs video the other day from a dev who moved from Vim and he made a pretty good case for why you might want to make the jump. Plus there’s some things that have been annoying me about Vim lately…

Vim Beefs


Currying allows us to create middleware for Redux that doesn’t interfere with any of its functionality.

I can create a curried function that logs a sentence built by calling that function multiple times with different arguments:

function logger(geeting) {
return function(name) {
console.log(greeting, 'My name is ', name)
}
}

logger('Hi!')('Bob')

// Hi! My name is Bob

It will only log the sentence the second time it’s called.

Using this technique we can pass first the redux store then store.dispatch to a function that logs the state of the store each time dispatch is called:

function logger(store) {
return…

I’ve tried netrw, NERDTree, Vim Ranger, a modified version of fzf.vim and even simply using the command window with path/** . None of these has quite worked for me and I’m forever fighting Vim trying to find a decent way to look at a folder structure and preview files before I commit to opening them.

Netrw

For some reason netrw can’t deal with Vim’s concept of buffers. If you have a netrw buffer open it’s almost impossible to remove it from the buffer list. A netrw buffer won’t even respond to bwipeout (the duke nukem of Vim buffer commands). …


Computer’s are really smart, right?

I would use an operating system like Mac OS and think, why isn’t it that all operating systems are this good?

Things should always be this intuitive and obvious; visual and clean.

We’re spoiled with excellent programs, available for public use for free; and often the more freely available programs are also the best written ones. …

Sean

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store