ducky-one-two-mini-customized.png

Using the Ducky One 2 Mini with Vim

Published on February 01, 2021, 00:00 UTC 2 minutes 3745 views

I recently bought the Ducky one 2 mini and got constantly confused due to the arrow key setup. Due to the keyboard being 60% they’ve moved the arrow keys to I,J,K,L which seems logical, however if your using Vim this gets confusing as you are using H,J,K,L as arrow keys. The Up arrow key is K in Vim but the K key is also representing the down arrow key when paired with FN. Look at the below picture for the standard Ducky One 2 Mini setup, specifically the blue rectangle with the I,J,K,L keys.

Ducky One 2 Mini

I find this too confusing and visually disturbing, luckily the Ducky One 2 Mini comes with extra keys - four of these are the arrow keys. So you can swap the H,J,K,L Keys with the arrow keys and remap the keys for the proper Vim functionality. FN + H,J,K,L becomes the arrow keys. Specifically for the Ducky One 2 Mini you can use the following commands in e.g your i3/window manager config startup:

exec --no-startup-id xmodmap -e "keycode 116 = Up"
exec --no-startup-id xmodmap -e "keycode 113 = Down"
exec --no-startup-id xmodmap -e "keycode 78 = Left"
exec --no-startup-id xmodmap -e "keycode 111 = Scroll_Lock"

Now your keyboard should be looking like the one below, take note of the updated arrow keys matching the default movement keys for Vim.

Ducky One 2 Mini Vim

The only caveat now is that the up arrow key is visually presented below the I key which should instead be the scroll lock key. However, this is much better for me at the least!

Related Posts

Automating OS Go Binary Installation and Management with Ansible

I use Ansible to manage my entire OS setup, with a playbook that installs all necessary software, sets up my dotfiles, and configures my system. This playbook can be run on a fresh installation of my OS and have my system set up exactly how I like it. Recently, I shifted from the Linux Arch AUR to go install for Go binaries, as it felt simpler and ensured up-to-date dependencies - without having to depend on the authors creating Arch AUR packaging for it. However, I still couldn’t find a way to pin packages to specific GitHub tags/releases. To solve this, I created a simple Ansible playbook to install Go binaries directly from GitHub releases, allowing me to pin and auto update the version of the Go binaries I want to install.

Shynet