a ridiculously fun alternative neovim keymap for the workman keyboard layout
- When possible, commands are positioned according to the workman layout heatmap. So frequent use will not strain your hands.
- When possible, commands are arranged onto a semantic key. This makes it possible for the keymap to be remembered with mnemonic phrases.
- When possible, keys behavior, or behavior substitute, should stay in the same position as the original-keymap, so that there is no need for experienced vim users to unlearn there years of muscle memory.
- default features
- Easily Opt-Out of specific unruly mappings
- Navigate vim like normal using
yneo - Close to vanilla vim motion experience
- A nice way to navigate the jumplist
- A healthcheck to ensure your setup is correct
- basic opt-in features
- A nice way to trigger LSPs behavior
- A nice way to navigate diagnostics
- A nice way to focus and manipulate splits
- A nice way to work with hlsearch
- A nice way to swap lines
- A nice way to spellcheck
- A nice way to create an incrementing column of numbers
- A nice way to source lua/vim files
- A companion unruly workman keyboard layout tmux config
- unruly opt-in features
- Yank, Delete, and Macros use register preselection
- Yank and Delete have history
- Keys to lock macro recording and pretty print the macro register
- Easily paste edit and load macros
- A nice way to step through the quickfix list, loclist, and buffers
- A blazingly fast way to save and quit
- A blazingly fast way to work with marks
- A status bar text generator that creates a HUD for unruly-worker's state
- plugin support opt-in features
- Workman keyboard layout for nvim-cmp auto completion
- Workman keyboard layout for telescope.nvim fuzzy search with preview
- Workman keyboard layout for Comment.nvim comment toggling toggling
- Workman keyboard layout for Navigator.nvim to navigate tmux or wez-term
- Workman keyboard layout for LuaSnip to navigate snipits
- Workman keyboard layout for nvim-treesitter with nvim-treesitter-textobject for syntax navigation
With unruly_kopy and unruly_macro when you select a register, it stays selected until you change it.
This means you don't select a register for a specific motion, instead you set
the yank or macro register, and then all future yank/paste or record/play
actions will use the selected register until you select a new register.
- Install with your favorite neovim package manager
- Add the following lua code to your vim config
-- Use this setup config if you want to follow the keymap above
local unruly_worker = require('unruly-worker')
-- to setup with the defaults you can simply put
-- unruly_worker.setup()
-- example setup with the default settings
unruly_worker.setup({
-- you can use the skip_list = {} to stop unruly from creating certain mappings
-- skip_list = { "z", "Z", "<C-z>"}, skip z related mappings
skip_list = {},
unruly_options = {
-- set default unruly kopy register must be [a-z] [A-Z] 0 +
kopy_reg = "+",
-- set default unruly macro register must be [a-z] [A-Z]
macro_reg = "q",
-- set default unruly seek mode, must be unruly_worker.seek_mode.(buffer|loclist|quickfix)
seek_mode = unruly_worker.seek_mode.buffer,
-- set unruly mark mode to global or local
mark_mode_is_global = false
},
-- boosters allow you to op-in to extra keymaps
-- or opt-out of the default keymaps if you want that for some reason
booster = {
default = true,
-- easy stuff are just additional opt in keymaps
easy_swap = false,
easy_search = false,
easy_line = false,
easy_spellcheck = false,
easy_incrament = false,
easy_hlsearch = false,
easy_focus = false,
easy_window = false,
easy_jumplist = false,
easy_scroll = false,
easy_source = false,
easy_lsp = false,
easy_lsp_leader = false,
easy_diagnostic = false,
easy_diagnostic_leader = false,
-- unruly stuff change neovim's normal behavior
unruly_seek = false,
unruly_mark = false,
unruly_macro = false,
unruly_kopy = false,
unruly_quit = false,
-- plugin stuff have external dependencies
plugin_navigator = false,
plugin_comment = false,
plugin_luasnip = false,
plugin_textobject = false,
plugin_telescope_leader = false,
plugin_telescope_lsp_leader = false,
plugin_telescope_easy_jump = false,
plugin_telescope_easy_paste = false,
plugin_telescope_diagnostic_leader = false,
},
})nvim-cmp MAPPING SETUP (optional)
-- NOTE: its recommended that you require cmp before unruly_worker.external.nvim-cmp
local cmp = require("cmp")
local unruly_cmp = require('unruly-worker.external.nvim-cmp')
cmp.setup({
mapping = unruly_cmp.create_insert_mapping(),
-- optionally you can pass a config with a skip_list and mappings
-- mapping = unruly_cmp.create_insert_mapping({
-- skip_list = { "<Right>" }, -- opt out of the <Right> keymap
-- you can add your own mappings here
-- your mappings will allways overwrite the unruly_cmp default mappings
-- mapping = {
-- ["<C-u>"] = cmp.mapping.complete() -- use <c-u> to complete
-- },
-- }),
-- rest of config...
})
cmp.setup.cmdline({ "/", "?" }, {
-- you can also pass the optional config into create_cmdline_mapping
mapping = unruly_cmp.create_cmdline_mapping(),
-- rest of config...
})
cmp.setup.cmdline(":", {
mapping = unruly_cmp.create_cmdline_mapping(),
-- rest of config...
})
-- my personal nvim-cmp config file: https://github.com/slugbyte/config/blob/main/conf/config/nvim/lua/slugbyte/plugin/cmp-and-luasnip.lua<CR>- confirm select<C-g> or <Right>- confirm continue<Tab> or <Down>- next suggestion<S-Tab> or <Up>- prev suggestion<C-x>- abort
<C-g> or <Right>- confirm continue<Tab>- next suggestion<S-Tab>- prev suggestion<Up>- prev history<Down>- next history<CR>- execute<C-x>- abort
telescope.nvim MAPPING SETUP (optional)
-- NOTE: its recommended that you require telescope before unruly_worker.external.telescope
local telescope = require("telescope")
local telescope_action = require("telescope.action")
local unruly_telescope = require("unruly-worker.external.telescope")
telescope.setup({
defaults = {
mappings = unruly_telescope.create_mappings(),
-- -- optionally you can pass a config with skip_list, insert_mapping, and normal_mapping
-- mappings = unruly_telescope.create_mappings({
-- skip_list = {"<Tab>"}, -- disable <tab> map
-- -- insert_mapping will overwrite any default unruly_telescope insert mappings
-- insert_mapping = {
-- "<c-u>" = telescope_action.select_default(), -- <c-u> select default
-- },
-- -- normal_mapping will overwrite any default unruly_telescope normal mappings
-- normal_mapping = {
-- "<c-u>" = telescope_action.select_default(), -- <c-u> select default
-- },
-- }),
},
-- rest of config...
})
-- my personal telescope setup: https://github.com/slugbyte/config/blob/main/conf/config/nvim/lua/slugbyte/plugin/telescope.lua<CR>- select default<C-h>- select into horizontal split<C-s>- select into vertical split<Down> or <C-n>- move selection down<Up> or <C-e>- move selection up<C-k>- telescope which key<C-x>- abort<PageUp>- scroll preview up<PageDown>- scroll preview down<Tab>- toggle selection<C-a>- select all<C-d>- deselect all<C-q>- add selected to quickfix list<C-l>- add selected to loclist list
includes everything in insert mode ^
e- move selection upn- move selection downN- move to top of selection listE- move to bottom of selection list<Esc>- abort
nvim-treesitter-textobject MAPPING SETUP
local unruly_textobjects = require("unruly-worker.external.textobjects")
require("nvim-treesitter.configs").setup({
textobjects = {
select = {
keymaps = unruly_textobjects.select_keymaps,
-- rest of config...
},
move = {
goto_next_start = unruly_textobjects.move_goto_next_start,
goto_previous_start = unruly_textobjects.move_goto_previous_start,
goto_next_end = unruly_textobjects.move_goto_next_end,
goto_previous_end = unruly_textobjects.move_goto_previous_end,
-- rest of config...
},
},
})go{object}goto next outer objectgi{object}goto next inner objectge{object}goto prev end objectGo{object}goto prev outer objectGi{object}goto prev inner objectGe{object}goto prev end objectvo{object}visual outer objectvi{object}visual inner objectdo{object}delete outer objectdi{object}delete inner object{object}aassigmentbblockccalldcomment (doc)ffunctioniconditional (if)llooppparameterrreturnsstruct or class
This project includes a tmux config file with tmux unruly-worker style keybindings, See the unruly tmux README for installation instructions and overview.
yneo_______ are mapped to left, down, up, rightgn_________ visual downge_________ visual upY__________ goes to beginning of lineO__________ goes to end of linew__________ next wordW__________ prev wordb__________ jump to matching braceB__________ jump cursor to the last place a change was made (back change)gg_________ goto top of fileGG_________ goto end of filet{char}____ go to the [count]'th occurrence of char to the rightT{char}____ go to the [count]'th occurrence of char to the lefth__________ repeat the last t/T (hop)H__________ repeat the last t/T reverse (hop reverse)(__________ prev sentence)__________ next sentence{__________ prev paragraph}__________ next paragraph
i__________ InsertI__________ Insert at beginning of linea__________ Appenda__________ Append to end of liner__________ replaceR__________ replace model__________ insert Line belowL__________ insert Line above
k__________ kopy (yank)K__________ kopy line (yank line)
p__________ pasteP__________ paste line
d__________ deleteD__________ delete to end of linedd_________ delete linesx__________ delete under cursorX__________ delete before cursor
c__________ changeC__________ change to end of linecc_________ change lines__________ substituteS__________ substitute line
q{reg}_____ record a macroQ{reg}_____ play a macro
m{mark}____ goto a markM{mark}____ set a mark[__________ goto previous jumplist location]__________ goto next jumplist location
v__________ visual modeV__________ visual line mode<c-v>______ visual block modeE__________ select paragraph (envelope paragraphvip)
/__________ search down?__________ search upf__________ repeat search (find)F__________ repeat search reverse (find reverse)
:or'___ command mode~__________ toggle case"__________ select register!__________ repeat change(repeat a vim motion)&__________ repeat substitute(repeat a :s/thing/new)u__________ undoU__________ redo<<_________ shift indent left>>_________ shift indent rightg__________ g commandG__________ G commandz__________ z commandZ__________ Z command- command mode
<c-a>____ goto beginning of line<c-e>____ goto end of line<c-u>____ delete to beginning of line
@__________ align top$__________ align middle#__________ align bottom
<ctrl>wy___ focus left<ctrl>wn___ focus down<ctrl>we___ focus up<ctrl>wo___ focus right<ctrl>wx___ close<ctrl>wf___ fullscreen current split<ctrl>wh___ horizontal split<ctrl>ws___ vertical split<ctrl>ws___ vertical split
j J % ^ = * - _ + , . | ;
easy boosters don't dramatically alter anything, they are just additional keymaps that I didn't include in the basic setup, in order to keep it as vanilla as possible.
<C-Up>___________ swap line/lines up<C-Down>_________ swap line/lines down
<c-y>____________ focus left (vim)<c-n>____________ focus down (vim)<c-e>____________ focus up (vim)<c-o>____________ focus right (vim)
<c-x>____________ close vim split<c-f>____________ fullscreen current split<c-s>____________ split verticle<c-h>____________ split horizontal
NOTE: this will auto enable the vim
hlsearchoption
<Esc>____________ will disable the current hlsearch highlighting
NOTE: this will disable the builtin
matchitplugin
%save and source the current lua or vimscript file
<PageUp>_________ scroll up<Home>___________ scroll up fast<PageDown>_______ scroll down<End>____________ scroll down fast
<c-j>show the jumplist
-_______________ prev diagnostic________________ next diagnostic
<leader>dp______ prev diagnostic<leader>dn______ next diagnostic
<C-d>__________ lsp goto definition<C-r>__________ lsp rename;______________ lsp hover=______________ lsp code action
<leader>la______ lsp code action<leader>lh______ lsp hover<leader>ld______ lsp goto definition<leader>lD______ lsp goto Declaration<leader>lf______ lsp format<leader>lr______ lsp rename
<leader><leader>c________ check spelling suggestions for word
<leader><leader>l________ add blank line blow (stay in normal mode)<leader><leader>L________ add blank line above (stay in normal mode)
<leader><leader>/________ find word under cursor<leader><leader>?________ find word under cursor reverse
<leader><leader>i________ create a column of incrementing numbers
# select the colomn of 0s and then <leader><leader>i
0 -(will become)-> 1
0 -(will become)-> 2
0 -(will become)-> 3
0 -(will become)-> 4
0 -(will become)-> 5
unruly boosters change the way that neovim typically works, they are probably not most vim users cup of tea
- kopy and paste use the preselected register
kopy_reg(default:+) - delete, change, substitute, and paste always use register
0 - kopy, delete, change, and substitute share registers 1-9 to track history
k______________ kopy (yank)K______________ kopy line (yank line)p______________ paste kopy belowP______________ paste kopy above"______________ will prompt you to select a newkopy_register- valid registers are:
[a-z][A-X] and 0 + - you can press
<enter>or<space>reset to the default+register
- valid registers are:
the kopy prompt does not limit register selection or track history
<C-k>__________ prompt to kopy selected text into any register<C-p>__________ prompt to paste from any register
d______________ deletedd_____________ delete lineD______________ delete to end of lines______________ substituteS______________ substitute linex______________ delete under cursorX______________ delete before cursorc______________ delete then enter insert modecc_____________ delete line then enter insert modeC______________ delete to end of line then enter insert mode.______________ paste register 0 below,______________ paste register 0 above
The unruly idea behind marks is that you only need two marks, for everything else just use telescope. Unruly marks can be in local buffer mode or global mode, by default it will be in local mode.
<leader>a_____ set mark a<leader>b_____ set mark b<C-a>_________ goto mark a<C-b>_________ goto mark bm_____________ toggle between local and global mark modeM_____________ clear current mark mode marks
unruly seek allows you to quickly navigate through quickfix list, loclist, and currently open buffers. Seek keymaps only target one type of seekable list at a time, by default the seek type will be buffers.
<leader>sn_____ goto next seek item<leader>sp____ goto prev seek item<leader>ss____ goto first item in seek list (start)<leader>se____ goto last item in seek list (end)<leader>sq____ seek the quickfix list<leader>sl____ seek the loclist<leader>sb____ seek open buffers
unruly macros use the preselected register macro_reg (default: z)
q______________ record macroQ______________ play macro<C-q>__________ select the macro register- valid registers:
[a-z][A-Z]
- valid registers:
<leader>qv_____ pretty print the current macro content (view)<leader>qp_____ pretty paste the current macro content into the current buffer<leader>qi_____ import select text as a macro- this will convert special keys in the selected text like
<cr><esc>into the register correctly
- this will convert special keys in the selected text like
<leader>ql_____ toggle macro recording/import lock- this is useful if you want to make sure you don't accidentally overwrite the current macro register
this is maby a bad idea, but I love it
z_____________ write all buffers, and print a random emoticon (:wall)- the random emoticon is useful as visual feedback that the write occurred
(づ ◕‿◕ )づ
- the random emoticon is useful as visual feedback that the write occurred
Z_____________ write the current buffer<C-z>_________ prompt to quit (yfor yes,ffor force quit)
plugin boosters have other plugin dependencies
depends on telescope.nvim
jtelescope find files (jump)Jtelescope live grep (grep jump)<C-j>telescope jumplist (jumplist jump)
depends on telescope.nvim
<leader>/telescope fuzzy find in current buffer<leader>tftelescope files<leader>tgtelescope grep<leader>tbtelescope buffers<leader>totelescope old files (recent files)<leader>tqtelescope quickfix<leader>tltelescope loclist<leader>tjtelescope jumplist<leader>tmtelescope man pages<leader>thtelescope help tags<leader>tttelescope tags<leader>tctelescope keymaps<leader>tCtelescope colorschemes<leader>tHtelescope highlights<leader>tptelescope paste from any register<leader>trtelescope repeat last search
depends on telescope.nvim
<leader>lctelescope lsp incoming calls<leader>lCtelescope lsp outgoing calls<leader>litelescope lsp goto implementation<leader>lrtelescope lsp references<leader>lstelescope lsp document symbols<leader>lStelescope lsp workspace symbols<leader>l$telescope lsp dynamic workspace symbols<leader>lttelescope lsp types
depends on telescope.nvim
<leader>d?telescope lsp diagnostics
depends on any plugin that uses
gcandgccmappings to comment toggle, like Comment.nvim
<c-c>toggle comment
depends on Navigator.nvim
<c-y>focus left (vim or terminal multiplexer)<c-n>focus down (vim or terminal multiplexer)<c-e>focus up (vim or terminal multiplexer)<c-o>focus right (vim or terminal multiplexer)
depends on nvim-treesitter and nvim-treesitter-textobject
plugin_textobject will whatever s and S where previously (for example
unruly_kopy's s)
sskip to next textobjectSskip to prev textobject
depends on LuaSnip powerful snipits
<C-k> or <C-Left>luasnip jump prev<C-l> or <C-Right>luasnip jump next
Being dyslexic has taught me its often easier for me to build a system for myself than it is to learn a system that works well for everyone else. This reinventing the wheel usually ends up being a bit of an accident. I usually start off trying to learn something the way it is, but when I struggle to grasp whats going on I inevitably decide to dig in and see how things work under the hood. My process for exploring the "under the hood of a thing" is kind of caveman style, I just poke and prod and modify and delete things until I have a feeling for what does what. By the time I'm done with all that I usually have my own opinions about what things should be like, and I decide its time to reinvent the wheel or at least swap out the tires. I think the creation of this keymap is a good example of how my learning style tends to unfold.
Unrelated to vim, I decided to learn the workman layout
in an attempt to address issues I was having with typing causing pain.
This decision forced me to consider how to remap a few vim keybinds, but one thing lead
to another and eventually I had created an entirely new layout, the
unruly-worker layout. The original process of creating this keymap lead to me spending about
a year reading :help and scouring the internet for vim config gems. Which
probably seems ridiculous for many people, but for me its just how I've had to
do most things in life. The time felt well used because I had already spent a decade
writing code and I don't plan to stop for many decades to come. Unlike
my first 7 years struggling with vim, I can now remember the entire keymap well enough to
experience the sensation of manipulating text without noticing that my hands, or
keyboard keys, or even that vim itself has anything to do with it. I always felt vim
was the right tool for job, unruly-worker is just a jig
that makes the tool fit perfectly into my workflow.
Dyslexia may or may not have been what made it so hard for me to learn vim, but it has normalized the process of reinventing wheels as a way to learn for me. The unruly-worker layout, is a classic example of the type of outcomes that my somewhat accidental process of learning produces. unruly-worker is a tool that may not be useful for anyone else, but it makes a tool that is useful to many other people accessible to me.
Suggestions and Spellcheck are always appreciated :)
See the Contributing Guide
If you like this project star the GitHub repository :)
I referenced the source code in these projcects when trying to figure out how to use the nvim apis
- marks.nvim - A better user experience for interacting with and manipulating Vim marks.
- nvim-macros - Easy way to save and load Macros!
- karen-yank - Make use of registers more intentional while remaining intuitive for experienced and novice VIM users.
- kickstart.nvim - A launch point for your personal nvim configuration
- nvim-cmp - A completion plugin for neovim coded in Lua.
- nvim-treesitter - Nvim Treesitter configurations and abstraction layer
- telescope - Find, Filter, Preview, Pick. All lua, all the time.
- luasnip - Snippet Engine for Neovim written in Lua.
- Navigator.nvim - Smoothly navigate between neovim and terminal multiplexer(s)


