2011-03-28 04:18:00 -04:00
|
|
|
" EasyMotion - Vim motions on speed!
|
2011-03-27 18:08:06 -04:00
|
|
|
"
|
2011-03-29 08:10:00 -04:00
|
|
|
" Author: Kim Silkebækken <kim.silkebaekken+vim@gmail.com>
|
|
|
|
" Source repository: https://github.com/Lokaltog/vim-easymotion
|
2011-03-27 18:08:06 -04:00
|
|
|
|
2011-03-30 08:18:39 -04:00
|
|
|
" Script initialization {{{
|
|
|
|
if exists('g:EasyMotion_loaded') || &compatible || version < 702
|
2011-03-27 18:08:06 -04:00
|
|
|
finish
|
|
|
|
endif
|
|
|
|
|
|
|
|
let g:EasyMotion_loaded = 1
|
|
|
|
" }}}
|
2013-12-18 07:32:27 -05:00
|
|
|
" Saving 'cpoptions' {{{
|
|
|
|
let s:save_cpo = &cpo
|
|
|
|
set cpo&vim
|
|
|
|
" }}}
|
2011-03-27 18:08:06 -04:00
|
|
|
" Default configuration {{{
|
2011-04-01 02:48:12 -04:00
|
|
|
" Default options {{{
|
2013-12-18 08:41:31 -05:00
|
|
|
call EasyMotion#init#InitOptions({
|
2013-10-04 10:32:09 -04:00
|
|
|
\ 'leader_key' : '<Leader><Leader>'
|
|
|
|
\ , 'keys' : 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
|
|
|
\ , 'do_shade' : 1
|
|
|
|
\ , 'do_mapping' : 1
|
|
|
|
\ , 'grouping' : 1
|
|
|
|
\ , 'startofline' : 1
|
|
|
|
\ , 'smartcase' : 0
|
2013-10-04 23:58:51 -04:00
|
|
|
\ , 'skipfoldedline' : 1
|
2013-10-23 11:20:16 -04:00
|
|
|
\ , 'use_migemo' : 0
|
2011-11-07 08:33:20 -05:00
|
|
|
\
|
2013-05-15 17:05:02 -04:00
|
|
|
\ , 'hl_group_target' : 'EasyMotionTarget'
|
|
|
|
\ , 'hl2_first_group_target' : 'EasyMotionTarget2First'
|
|
|
|
\ , 'hl2_second_group_target' : 'EasyMotionTarget2Second'
|
|
|
|
\ , 'hl_group_shade' : 'EasyMotionShade'
|
2013-10-04 09:45:06 -04:00
|
|
|
\ , 'hl_line_group_shade' : 'EasyMotionShadeLine'
|
2011-04-01 02:48:12 -04:00
|
|
|
\ })
|
|
|
|
" }}}
|
|
|
|
" Default highlighting {{{
|
2011-03-31 07:29:07 -04:00
|
|
|
let s:target_hl_defaults = {
|
2011-03-31 09:39:58 -04:00
|
|
|
\ 'gui' : ['NONE', '#ff0000' , 'bold']
|
2011-03-31 07:29:07 -04:00
|
|
|
\ , 'cterm256': ['NONE', '196' , 'bold']
|
|
|
|
\ , 'cterm' : ['NONE', 'red' , 'bold']
|
|
|
|
\ }
|
|
|
|
|
2013-05-15 17:05:02 -04:00
|
|
|
let s:target_hl2_first_defaults = {
|
2013-05-14 00:43:58 -04:00
|
|
|
\ 'gui' : ['NONE', '#ffb400' , 'bold']
|
2013-05-31 14:12:34 -04:00
|
|
|
\ , 'cterm256': ['NONE', '11' , 'bold']
|
|
|
|
\ , 'cterm' : ['NONE', '11' , 'bold']
|
2013-05-14 00:43:58 -04:00
|
|
|
\ }
|
|
|
|
|
2013-05-15 17:05:02 -04:00
|
|
|
let s:target_hl2_second_defaults = {
|
|
|
|
\ 'gui' : ['NONE', '#b98300' , 'bold']
|
2013-05-31 14:12:34 -04:00
|
|
|
\ , 'cterm256': ['NONE', '3' , 'bold']
|
|
|
|
\ , 'cterm' : ['NONE', '3' , 'bold']
|
2013-10-04 07:35:22 -04:00
|
|
|
\ }
|
2013-05-14 01:53:51 -04:00
|
|
|
|
2011-03-31 07:29:07 -04:00
|
|
|
let s:shade_hl_defaults = {
|
2011-06-01 04:11:13 -04:00
|
|
|
\ 'gui' : ['NONE', '#777777' , 'NONE']
|
|
|
|
\ , 'cterm256': ['NONE', '242' , 'NONE']
|
|
|
|
\ , 'cterm' : ['NONE', 'grey' , 'NONE']
|
2011-03-31 07:29:07 -04:00
|
|
|
\ }
|
|
|
|
|
2013-05-15 22:32:47 -04:00
|
|
|
let s:shade_hl_line_defaults = {
|
2013-05-31 14:12:11 -04:00
|
|
|
\ 'gui' : ['red' , '#FFFFFF' , 'NONE']
|
|
|
|
\ , 'cterm256': ['red' , '242' , 'NONE']
|
|
|
|
\ , 'cterm' : ['red' , 'grey' , 'NONE']
|
2013-05-15 22:32:47 -04:00
|
|
|
\ }
|
|
|
|
|
2013-12-18 08:41:31 -05:00
|
|
|
call EasyMotion#init#InitHL(g:EasyMotion_hl_group_target, s:target_hl_defaults)
|
|
|
|
call EasyMotion#init#InitHL(g:EasyMotion_hl2_first_group_target, s:target_hl2_first_defaults)
|
|
|
|
call EasyMotion#init#InitHL(g:EasyMotion_hl2_second_group_target, s:target_hl2_second_defaults)
|
|
|
|
call EasyMotion#init#InitHL(g:EasyMotion_hl_group_shade, s:shade_hl_defaults)
|
|
|
|
call EasyMotion#init#InitHL(g:EasyMotion_hl_line_group_shade, s:shade_hl_line_defaults)
|
2011-03-31 07:29:07 -04:00
|
|
|
|
|
|
|
" Reset highlighting after loading a new color scheme {{{
|
|
|
|
augroup EasyMotionInitHL
|
|
|
|
autocmd!
|
|
|
|
|
2013-12-18 08:41:31 -05:00
|
|
|
autocmd ColorScheme * call EasyMotion#init#InitHL(g:EasyMotion_hl_group_target, s:target_hl_defaults)
|
|
|
|
autocmd ColorScheme * call EasyMotion#init#InitHL(g:EasyMotion_hl2_first_group_target, s:target_hl2_first_defaults)
|
|
|
|
autocmd ColorScheme * call EasyMotion#init#InitHL(g:EasyMotion_hl2_second_group_target, s:target_hl2_second_defaults)
|
|
|
|
autocmd ColorScheme * call EasyMotion#init#InitHL(g:EasyMotion_hl_group_shade, s:shade_hl_defaults)
|
|
|
|
autocmd ColorScheme * call EasyMotion#init#InitHL(g:EasyMotion_hl_line_group_shade, s:shade_hl_line_defaults)
|
2011-03-31 07:29:07 -04:00
|
|
|
augroup end
|
|
|
|
" }}}
|
|
|
|
" }}}
|
2011-04-01 01:46:42 -04:00
|
|
|
" Default key mapping {{{
|
2013-12-18 08:41:31 -05:00
|
|
|
call EasyMotion#init#InitMappings({
|
2011-04-02 16:34:29 -04:00
|
|
|
\ 'f' : { 'name': 'F' , 'dir': 0 }
|
|
|
|
\ , 'F' : { 'name': 'F' , 'dir': 1 }
|
2013-05-15 17:05:02 -04:00
|
|
|
\ , 's' : { 'name': 'S' , 'dir': 2 }
|
2013-10-03 07:34:50 -04:00
|
|
|
\ , 'S' : { 'name': 'WB' , 'dir': 2 }
|
2011-04-02 16:34:29 -04:00
|
|
|
\ , 't' : { 'name': 'T' , 'dir': 0 }
|
|
|
|
\ , 'T' : { 'name': 'T' , 'dir': 1 }
|
|
|
|
\ , 'w' : { 'name': 'WB' , 'dir': 0 }
|
|
|
|
\ , 'W' : { 'name': 'WBW', 'dir': 0 }
|
|
|
|
\ , 'b' : { 'name': 'WB' , 'dir': 1 }
|
|
|
|
\ , 'B' : { 'name': 'WBW', 'dir': 1 }
|
|
|
|
\ , 'e' : { 'name': 'E' , 'dir': 0 }
|
|
|
|
\ , 'E' : { 'name': 'EW' , 'dir': 0 }
|
|
|
|
\ , 'ge': { 'name': 'E' , 'dir': 1 }
|
|
|
|
\ , 'gE': { 'name': 'EW' , 'dir': 1 }
|
|
|
|
\ , 'j' : { 'name': 'JK' , 'dir': 0 }
|
|
|
|
\ , 'k' : { 'name': 'JK' , 'dir': 1 }
|
2011-04-20 09:50:02 -04:00
|
|
|
\ , 'n' : { 'name': 'Search' , 'dir': 0 }
|
|
|
|
\ , 'N' : { 'name': 'Search' , 'dir': 1 }
|
2013-12-20 02:47:05 -05:00
|
|
|
\ }, g:EasyMotion_do_mapping)
|
2011-04-01 01:46:42 -04:00
|
|
|
" }}}
|
2013-06-03 20:26:16 -04:00
|
|
|
" Special mapping for other functions {{{
|
2013-12-18 08:41:31 -05:00
|
|
|
call EasyMotion#init#InitSpecialMappings({
|
2013-12-18 12:58:07 -05:00
|
|
|
\ 'l' : { 'name': 'SelectLines'}
|
|
|
|
\ , 'p' : { 'name': 'SelectPhrase'}
|
2013-10-04 12:06:34 -04:00
|
|
|
\ })
|
2013-06-03 17:24:44 -04:00
|
|
|
" }}}
|
2013-12-20 02:47:05 -05:00
|
|
|
" Prepare more key mapping {{{
|
|
|
|
call EasyMotion#init#InitMappings({
|
|
|
|
\ 'bd-w' : { 'name': 'WB' , 'dir': 2 }
|
|
|
|
\ , 'bd-e' : { 'name': 'E' , 'dir': 2 }
|
|
|
|
\ , 'bd-n' : { 'name': 'Search' , 'dir': 2 }
|
|
|
|
\ , 'bd-jk' : { 'name': 'JK' , 'dir': 2 }
|
|
|
|
\ }, 0) " Prepare <Plug> but don't map by default.
|
2013-12-19 01:55:31 -05:00
|
|
|
" }}}
|
2013-12-18 07:32:27 -05:00
|
|
|
" }}}
|
|
|
|
" Restore 'cpoptions' {{{
|
|
|
|
let &cpo = s:save_cpo
|
|
|
|
unlet s:save_cpo
|
2011-03-27 18:08:06 -04:00
|
|
|
" }}}
|
2011-06-17 16:27:23 -04:00
|
|
|
|
|
|
|
" vim: fdm=marker:noet:ts=4:sw=4:sts=4
|