Created
December 23, 2020 04:08
-
-
Save ak4bento/0717cc71bad49f3ecf9e15d80fdf6197 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" shift+arrow selection | |
nmap <S-Up> v<Up> | |
nmap <S-Down> v<Down> | |
nmap <S-Left> v<Left> | |
nmap <S-Right> v<Right> | |
vmap <S-Up> <Up> | |
vmap <S-Down> <Down> | |
vmap <S-Left> <Left> | |
vmap <S-Right> <Right> | |
imap <S-Up> <Esc>v<Up> | |
imap <S-Down> <Esc>v<Down> | |
imap <S-Left> <Esc>v<Left> | |
imap <S-Right> <Esc>v<Right> | |
" Replace global character selection | |
vnoremap ; :call Get_visual_selection()<cr> | |
function! Get_visual_selection() | |
" Why is this not a built-in Vim script function?! | |
let [lnum1, col1] = getpos("'<")[1:2] | |
let [lnum2, col2] = getpos("'>")[1:2] | |
let lines = getline(lnum1, lnum2) | |
let lines[-1] = lines[-1][: col2 - (&selection == 'inclusive' ? 1 : 2)] | |
let lines[0] = lines[0][col1 - 1:] | |
let selection = join(lines,'\n') | |
let change = input('Change the selection with: ') | |
execute ":%s/".selection."/".change."/g" | |
endfunction | |
" Mapping Selection for next occourance | |
let g:multi_cursor_use_default_mapping=0 | |
" Default mapping | |
let g:multi_cursor_start_word_key = '<C-n>' | |
let g:multi_cursor_select_all_word_key = '<A-n>' | |
let g:multi_cursor_start_key = 'g<C-n>' | |
let g:multi_cursor_select_all_key = 'g<A-n>' | |
let g:multi_cursor_next_key = '<C-n>' | |
let g:multi_cursor_prev_key = '<C-p>' | |
let g:multi_cursor_skip_key = '<C-x>' | |
let g:multi_cursor_quit_key = '<Esc>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment