Skip to content

Instantly share code, notes, and snippets.

@nelstrom
nelstrom / plover-nkro-on-ergodox.md
Last active April 2, 2024 20:18
Instructions on how to get a Plover keymap working with NKRO on ErgoDox keyboard.

[Plover][] is an awesome open source stenography program, but to run the software [you need an NKRO keyboard][nkro]. The [ErgoDox keyboard][ergodox] can be made to run in NKRO mode by following these steps.

Install dependencies

These instructions are based on this document, which assumes you're using Windows. I'm using a mac, and I had to download and install the [CrossPack for AVR Development][crosspack] before the build process worked.

Download the source

The NKRO firmware and Plover keymap can be found in the simon_layout branch of @shayneholmes fork of tmk_keyboard. Get the source:

@nelstrom
nelstrom / vim-plugin-directories
Created June 30, 2011 11:32
An overview of what belongs in each directory of a Vim plugin.
plugin
naming convention: name_of_plugin.vim
these files are sourced for all file types
doc
naming convention: name_of_plugin.txt
these files document the functionality of a plugin
color
naming convention: name_of_colorscheme.vim
@nelstrom
nelstrom / access-control-lists-on-osx.md
Last active December 9, 2023 23:29
Setting ACL on OS X

I have two user accounts set up on my mac. User drew I use for most things, but if I'm making a screencast I'll switch to the demo user. I know that the demo user has a clean desktop, and the font size is larger than usual in my terminal and text editors, making everything a bit more legible when capturing the screen. When I record a screencast as the demo user, I save the file to /Users/Shared/screencasts. As I understand it, the /Users/Shared directory is supposed to be accessible to all user accounts on the mac. If I created and saved a screenflow document as the demo user, I should be able to read and write that file when logged in as user drew.

That was the theory, but it didn't always work out that well in practice. I would occasionally find that a directory was only writable by one user or the other. Perhaps I'd open a screenflow document as user drew and attempt to export the video to the same directory, only to find that the directory was owned by demo, meaning that I couldn't cr

$ vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled May 4 2012 04:10:13)
Included patches: 1-429
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by buildd@
Huge version with GTK2 GUI. Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con_gui +diff
+digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi

Download the inspect-registers.vim file from this gist. Open the file in Vim, launching with no vimrc:

vim -Nu NONE inspect-registers.vim

Source the file:

:source %

Insert text on line one:

@nelstrom
nelstrom / getting-vim-with-clipboard-support.md
Created November 14, 2013 23:04
Original draft of [Getting Vim with `+clipboard` support](http://vimcasts.org/blog/2013/11/getting-vim-with-clipboard-support/). Shows what I know!

On OS X

On OS X Mavericks, Apple ships Vim version 7.3 with -clipboard. Here's the gist from running [/usr/bin/vim --version on Mavericks][10.9] (and [the same on Mountain Lion][10.8]). Shame on you Apple!

If you [use Homebrew][brew.sh], you can get Vim with +clipboard by running:

brew install vim

Here's a gist from running [/usr/local/bin/vim --version][brew].

augroup startup
autocmd!
autocmd VimEnter * call PreventNestedNeovim()
augroup END
function! PreventNestedNeovim()
if !empty($NVIM_LISTEN_ADDRESS) && $NVIM_LISTEN_ADDRESS !=# v:servername
let g:r=sockconnect('pipe', $NVIM_LISTEN_ADDRESS, {'rpc':v:true})
let g:f=fnameescape(expand('%:p'))
noautocmd bwipe
$ vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled May 4 2012 04:10:17)
Included patches: 1-429
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by buildd@
Huge version with X11-Athena GUI. Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con_gui +diff
+digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi
@nelstrom
nelstrom / controllers.application.js
Last active September 24, 2018 13:07
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
if exists(':terminal')
" Readline cheatsheet:
" ctrl-a - jump to start of line
" ctrl-e - jump to end of line
" ctrl-k - kill forwards to the end of line
" ctrl-u - kill backwards to the start of line
autocmd TermOpen * nnoremap <buffer> I I<C-a>
autocmd TermOpen * nnoremap <buffer> A A<C-e>
autocmd TermOpen * nnoremap <buffer> C A<C-k>
autocmd TermOpen * nnoremap <buffer> D A<C-k><C-\><C-n>