The productivity as a vimmer can be greatly increased by mapping the
space key to do common tasks since
space is easily accessible and it’s the largest key on the keyboard. The credit for the idea goes to Sheerun’s blog.
I’ve added some handy
space key bindings to .vimrc, the vim’s configuration file found hidden in the logged in user’s home directory.
space as the
Write, Write & Quit and Quit
With the following bindings I can keyboard
<Space>w to write,
<Space>ww to write and quit, and
<Space>q to quit without saving the file.
nnoremap <Leader>w :w<CR> nnoremap <Leader>ww :wq<CR> nnoremap <Leader>q :q!<CR>
Copy and paste to system clipboard with
vmap y "+y vmap d "+d nmap p "+p nmap P "+P vmap p "+p vmap P "+P
Enter visual mode with
nmap <Leader><Leader> V