GithubHelp home page GithubHelp logo

vim-colemak's Introduction

vim-colemak

Colemak key mappings for Vim. Trimmed and modified version of Shai Coleman's configuration.

Install

  1. Use vim-plug.

  2. Add to .vimrc: Plug 'jooize/vim-colemak'

  3. Run vim +PlugInstall

  4. You probably want to load vim-colemak last. Reload the plugin at the bottom of your Vim configuration.

    " Reload vim-colemak to remap any overridden keys
    silent! source "$HOME/.vim/bundle/vim-colemak/plugin/colemak.vim"
    

    Note: You might be using ~/.vim/plugged.

  5. See issues for conflicts with other plugins.

Key mappings

Colemak layout:                  |                 QWERTY layout:
`12345 67890-=     Move around:  |  (instead of)   `12345 67890-=
 qwfpg jluy;[]\         e        |       k          qwert yuiop[]\
 arstd HNEIo'         h   i      |     h   l        asdfg HJKL;'
 zxcvb km,./            n        |       j          zxcvb nm,./

(  novx)  h = h (Left)     i = l (Right)     e = k (Up)     n = j (Down)

(  novx)  l = b (Back word)            L = B (Back WORD)
(  novx)  y = w (Forward word)         Y = W (Forward WORD)
(  novx)  u = e (Forward end of word)  U = E (Forward end of WORD)

(c     )  <C-L> = <C-Left> (Back WORD)
(c     )  <C-Y> = <C-Right> (Seems to equal forward WORD minus 1 character)

(  n  x)  a = v (Visual)   A = V (Visual line)
(  n   )  r = r (Replace)  R = R (Replace)
(  n   )  s = i (Insert)   S = I (Insert before first non-blank of line)
(  n   )  t = a (Append)   T = A (Append at end of line)
(  n   )  w = c (Change)   W = C (Change to end of line)  ww = cc (Change line)

(  n  x)  z = u (Undo)    Z = <C-R> (Redo)  gz = U (Undo all latest changes on line)
(  n  x)  x = x (Cut)     X = dd (Cut line)
(  n  x)  c = y (Copy)    C = yy (Copy line)
(  n  x)  v = p (Paste)   V = P (Paste)
(  n  x)  gv = gp (Paste) gV = gP (Paste)

(   o  )  r = i (Example: dip -> drp (Delete inner paragraph))

(  no x)  p = t{char} (Before next {char})  P = T{char} (After previous {char})
(  no x)  b = ; (Repeat latest f or t)  B = , (Repeat latest f or t reversed)
(  no x)  k = n (Repeat latest / or ?)  K = N (Repeat latest / or ? reversed)

(  n  x)  j = z
(  n  x)  jn = zj (Next fold) [Also jj = zj]
(  n  x)  je = zk (Previous fold) [Also jk = zk]

(  n   )  ga = gv (Reselect last visual selection)
(  n  x)  gK = K (Lookup)
(  n  x)  gL = L (To line [count] from bottom of window)

(  n  x)  <C-W>h = <C-W>h (Window left)
(  n  x)  <C-W>n = <C-W>j (Window down)
(  n  x)  <C-W>e = <C-W>k (Window up)
(  n  x)  <C-W>i = <C-W>l (Window right)

Lost:
(  n  x)  H (To line [count] from top of window)
(  n  x)  s (Substitute [count] characters) [Use wi = cl]
(  n  x)  S (Substitute [count] lines) [Use ww = cc]
(  n  x)  X (Cut [count] characters backwards) [Use dh = dh]
(  n   )  Z (Quit)
(  n  x)  <C-W>n (Window down) [Use <C-W><C-N> = <C-W><C-N>]
(  n  x)  <C-W>i (Window down) [Use <C-W><C-I> = <C-W><C-I>]

Legend:
<C-X>     Ctrl-X
(c     )  Command-line mode
( i    )  Insert mode
(  n   )  Normal mode
(   o  )  Operator pending
(    v )  Visual+Select mode
(     x)  Visual mode

Issues

tpope/vim-fugitive keymap collision

" Fix for colemak.vim keymap collision. tpope/vim-fugitive's maps y<C-G>
" and colemak.vim maps 'y' to 'w' (word). In combination this stalls 'y'
" because Vim must wait to see if the user wants to press <C-G> as well.
augroup RemoveFugitiveMappingForColemak
    autocmd!
    autocmd BufEnter * silent! execute "nunmap <buffer> <silent> y<C-G>"
augroup END

Changes

2016–03–06

Restore turbo navigation

Add the following to your .vimrc:

" Turbo navigation (Colemak) {{{
    " Works with counts, see ":help complex-repeat"
    nnoremap <silent> H @='5h'<CR>|xnoremap <silent> H @='5h'<CR>|onoremap <silent> H @='5h'<CR>|
    nnoremap <silent> N @='5gj'<CR>|xnoremap <silent> N @='5gj'<CR>|onoremap <silent> N @='5gj'<CR>|
    nnoremap <silent> E @='5gk'<CR>|xnoremap <silent> E @='5gk'<CR>|onoremap <silent> E @='5gk'<CR>|
    nnoremap <silent> I @='5l'<CR>|xnoremap <silent> I @='5l'<CR>|onoremap <silent> I @='5l'<CR>|
" }}}

I removed turbo navigation since I felt it doesn't suit as default Vim mappings, which also frees up the keys for custom uses. I'm considering making it an option. Discuss!

vim-colemak's People

Contributors

jooize avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-colemak's Issues

Turbo navigation

Turbo navigation (HNEI=5*hjkl) was removed in c057ed0. I felt it didn't make sense as default mappings in Vim, and I would rather free up the keys for custom uses.

I considered adding an option, but decided not to because I didn't want to commit to having it in forever. Please write any arguments for and against.

You can add the following to your .vimrc to use turbo navigation again.

" Turbo navigation (Colemak) {{{
    " Works with counts, see ":help complex-repeat"
    nnoremap <silent> H @='5h'<CR>|xnoremap <silent> H @='5h'<CR>|onoremap <silent> H @='5h'<CR>|
    nnoremap <silent> N @='5gj'<CR>|xnoremap <silent> N @='5gj'<CR>|onoremap <silent> N @='5gj'<CR>|
    nnoremap <silent> E @='5gk'<CR>|xnoremap <silent> E @='5gk'<CR>|onoremap <silent> E @='5gk'<CR>|
    nnoremap <silent> I @='5l'<CR>|xnoremap <silent> I @='5l'<CR>|onoremap <silent> I @='5l'<CR>|
" }}}

I found myself abusing turbo navigation instead of learning to move using long-term more useful ways, but that doesn't feel like a strong argument against the feature.

Shortcut for Visual Block mode

Hi, I like your configuration and am using it since I started to use colemak.

I don't usually use visual block mode, but I once tried it by pressing as I expected, finding it doesn't work. is the only shortcut I found to get into visual block mode. Is it the only way for it or does shortcut causes any conflict with other keys?

NerdTree collision

Error when pressing 'e' in nerdtree. performed
e.......Edit the current dir.....................................NERDTree-e
instead of
K.......Jump up inside directories at the current tree depth.....NERDTree-K

Help getting vim-colemak to work on my machine :)

Hi @jooize,

thanks so much for the plugin.

I'm brand new to vim.

Tried installing the plugin, but apparently no luck yet in it running.

Was able to run vim +PlugInstall, and the output said things were installed.

Added these lines to the bottom of .vimrc, not sure it's the right place:

" Reload vim-colemak to remap any overridden keys
silent! source "$HOME/.vim/bundle/vim-colemak/plugin/colemak.vim"

As it is, j still moves the cursor down etc.

Appreciate any suggestions.
Below is my .vimrc.

Thanks again!

" Specify a directory for plugins (for Neovim: ~/.local/share/nvim/plugged)
call plug#begin('~/.vim/plugged')

" Make sure you use single quotes

" Shorthand notation; fetches https://github.com/junegunn/vim-easy-align
Plug 'junegunn/vim-easy-align'

" Any valid git URL is allowed
Plug 'https://github.com/junegunn/vim-github-dashboard.git'

" Multiple Plug commands can be written in a single line using | separators
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'

" On-demand loading
Plug 'scrooloose/nerdtree', { 'on':  'NERDTreeToggle' }
Plug 'tpope/vim-fireplace', { 'for': 'clojure' }

" Using a non-master branch
Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' }

" Using a tagged release; wildcard allowed (requires git 1.9.2 or above)
Plug 'fatih/vim-go', { 'tag': '*' }

" Plugin options
Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' }

" Plugin outside ~/.vim/plugged with post-update hook
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }

" Unmanaged plugin (manually installed and updated)
Plug '~/my-prototype-plugin'

Plug 'jooize/vim-colemak'
" Initialize plugin system

call plug#end()

" Reload vim-colemak to remap any overridden keys
silent! source "$HOME/.vim/bundle/vim-colemak/plugin/colemak.vim"

Keymap collision with surround.vim

I've noticed that surround.vim presents the same issue as fugitive.vim in terms of keymap collisions with y.

surround.vim makes use of things like y s s. Any ideas on a fix for this?

Canonical mode – map QWERTY to Colemak

I push my two cents here.

TLDR; A key mapping based on purely QWERTY to Colemak key placement position.
e.g. hjkl into hnei, qwerty into qwfpg, so insert mode i will be u

Vim tutorial already lots out there. And in Vim, keys are fundamental. This plugin actually works great. But, the plugin mapping actually makes more pain when learning new shortcut based on a tutorial. Additionally, when we switch to vim without plugin or computer without Colemak, the keys messed up (actually, it's my brain which does messed up).

It's great to see a colemak mapping which maps directly it's key placement from QWERTY origin into Colemak. Well, I call it canonical mode ;)

use the home row for moving around

The reason why Vim moves the home row one key to the left is that on qwerty the rightmost key in the home row is the semi-column. That's not the case in Colemak though, so why not fix it?

I use Kinesis keyboard, so it makes much more sense for me to use the home row as it's intended, so a while back I forked this repo and move the keys. Is this something you'd consider?

My fork is located at https://github.com/kalbasit/vim-colemak (see README).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.