Add vim keybindings
Add binding for the substitute command. Add bindings for interacting with the system clipboard with y/p. Change the keybindings header to use the full word.
This commit is contained in:
@@ -43,7 +43,7 @@ else
|
|||||||
nmap cW dWi
|
nmap cW dWi
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Keybinds #####################################################################
|
" Keybindings ##################################################################
|
||||||
" Set leader key
|
" Set leader key
|
||||||
let mapleader = "\<Space>"
|
let mapleader = "\<Space>"
|
||||||
" Stop highlighting search result when pressing Return
|
" Stop highlighting search result when pressing Return
|
||||||
@@ -60,6 +60,27 @@ nnoremap <leader>j <C-w><C-j>
|
|||||||
nnoremap <leader>k <C-w><C-k>
|
nnoremap <leader>k <C-w><C-k>
|
||||||
nnoremap <leader>l <C-w><C-l>
|
nnoremap <leader>l <C-w><C-l>
|
||||||
|
|
||||||
|
" Substitute command
|
||||||
|
if (exists('+inccommand') && &inccommand != '')
|
||||||
|
nnoremap S :%s/
|
||||||
|
else
|
||||||
|
" This does not work with live previewing commands (inccommand) since the
|
||||||
|
" replace pattern is already defined and thus everything matching the search
|
||||||
|
" pattern is just deleted.
|
||||||
|
nnoremap S :%s//gc<Left><Left><Left>
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Interact with the system clipboard
|
||||||
|
if (has('clipboard') || has('nvim'))
|
||||||
|
nnoremap <leader>y "+y
|
||||||
|
nnoremap <leader>p "+p
|
||||||
|
nnoremap <leader>P "+P
|
||||||
|
|
||||||
|
vnoremap <leader>y "+y
|
||||||
|
vnoremap <leader>p "+p
|
||||||
|
vnoremap <leader>P "+P
|
||||||
|
endif
|
||||||
|
|
||||||
" Aesthetics ###################################################################
|
" Aesthetics ###################################################################
|
||||||
" Use 24-bit (true-color) mode
|
" Use 24-bit (true-color) mode
|
||||||
if (has('termguicolors'))
|
if (has('termguicolors'))
|
||||||
|
|||||||
Reference in New Issue
Block a user