mirror of
https://github.com/amix/vimrc
synced 2025-07-18 17:44:59 +08:00
merge
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
"===============================================================================
|
||||
" File: multiple_cursors.vim
|
||||
" Author: Terry Ma
|
||||
" Description: Emulate Sublime Text's multi selection feature
|
||||
" Description: Emulate Sublime Text's multi selection feature
|
||||
" Potential Features:
|
||||
" - Create a blinking cursor effect? Good place to do it would be instead of
|
||||
" waiting for user input, cycle through the highlight
|
||||
@ -40,26 +40,49 @@ let s:settings_if_default = {
|
||||
\ 'skip_key': '<C-x>',
|
||||
\ }
|
||||
|
||||
let s:default_insert_maps = {}
|
||||
let s:default_normal_maps = {'!':1, '@':1, '=':1, 'q':1, 'r':1, 't':1, 'T':1, 'y':1, '[':1, ']':1, '\':1, 'd':1, 'f':1, 'F':1, 'g':1, '"':1, 'z':1, 'c':1, 'm':1, '<':1, '>':1}
|
||||
let s:default_visual_maps = {'i':1, 'a':1, 'f':1, 'F':1, 't':1, 'T':1}
|
||||
|
||||
let g:multi_cursor_insert_maps =
|
||||
\ get(g:, 'multi_cursor_insert_maps', s:default_insert_maps)
|
||||
let g:multi_cursor_normal_maps =
|
||||
\ get(g:, 'multi_cursor_normal_maps', s:default_normal_maps)
|
||||
let g:multi_cursor_visual_maps =
|
||||
\ get(g:, 'multi_cursor_visual_maps', s:default_visual_maps)
|
||||
|
||||
call s:init_settings(s:settings)
|
||||
|
||||
if g:multi_cursor_use_default_mapping
|
||||
call s:init_settings(s:settings_if_default)
|
||||
endif
|
||||
|
||||
if !exists('g:multi_cursor_start_key') && exists('g:multi_cursor_next_key')
|
||||
let g:multi_cursor_start_key = g:multi_cursor_next_key
|
||||
if !exists('g:multi_cursor_start_word_key')
|
||||
if exists('g:multi_cursor_start_key')
|
||||
let g:multi_cursor_start_word_key = g:multi_cursor_start_key
|
||||
elseif exists('g:multi_cursor_next_key')
|
||||
let g:multi_cursor_start_word_key = g:multi_cursor_next_key
|
||||
endif
|
||||
endif
|
||||
|
||||
" External mappings
|
||||
if exists('g:multi_cursor_start_key')
|
||||
exec 'nnoremap <silent> '.g:multi_cursor_start_key.
|
||||
\' :call multiple_cursors#new("n")<CR>'
|
||||
\' :call multiple_cursors#new("n", 0)<CR>'
|
||||
exec 'xnoremap <silent> '.g:multi_cursor_start_key.
|
||||
\' :<C-u>call multiple_cursors#new("v")<CR>'
|
||||
\' :<C-u>call multiple_cursors#new("v", 0)<CR>'
|
||||
endif
|
||||
|
||||
if exists('g:multi_cursor_start_word_key')
|
||||
exec 'nnoremap <silent> '.g:multi_cursor_start_word_key.
|
||||
\' :call multiple_cursors#new("n", 1)<CR>'
|
||||
" In Visual mode word boundary is not used
|
||||
exec 'xnoremap <silent> '.g:multi_cursor_start_word_key.
|
||||
\' :<C-u>call multiple_cursors#new("v", 0)<CR>'
|
||||
endif
|
||||
|
||||
" Commands
|
||||
command! -nargs=1 -range=% MultipleCursorsFind
|
||||
command! -nargs=1 -range=% MultipleCursorsFind
|
||||
\ call multiple_cursors#find(<line1>, <line2>, <q-args>)
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
|
Reference in New Issue
Block a user