Merge branch 'modify/cmdline' into master
This commit is contained in:
commit
67eab2c5c7
@ -2,7 +2,7 @@
|
|||||||
" FILE: autoload/EasyMotion/command_line.vim
|
" FILE: autoload/EasyMotion/command_line.vim
|
||||||
" AUTHOR: haya14busa
|
" AUTHOR: haya14busa
|
||||||
" Reference: https://github.com/osyo-manga/vim-over
|
" Reference: https://github.com/osyo-manga/vim-over
|
||||||
" Last Change: 09 Feb 2014.
|
" Last Change: 16 Feb 2014.
|
||||||
" License: MIT license {{{
|
" License: MIT license {{{
|
||||||
" Permission is hereby granted, free of charge, to any person obtaining
|
" Permission is hereby granted, free of charge, to any person obtaining
|
||||||
" a copy of this software and associated documentation files (the
|
" a copy of this software and associated documentation files (the
|
||||||
@ -31,20 +31,25 @@ set cpo&vim
|
|||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" CommandLine:
|
" CommandLine:
|
||||||
let s:cmdline = vital#of("easymotion").import("Over.Commandline")
|
let s:V = vital#of('easymotion')
|
||||||
let s:search = s:cmdline.make_plain("/")
|
let s:cmdline = s:V.import('Over.Commandline.Base')
|
||||||
let s:search.highlights.prompt = "Question"
|
let s:modules = s:V.import("Over.Commandline.Modules")
|
||||||
|
let s:search = s:cmdline.make()
|
||||||
|
let s:search.highlights.prompt = 'Question'
|
||||||
|
|
||||||
" Add Module: {{{
|
" Add Module: {{{
|
||||||
|
call s:search.connect(s:modules.get("Execute").make_no_execute())
|
||||||
|
call s:search.connect('Cancel')
|
||||||
|
call s:search.connect('Redraw')
|
||||||
call s:search.connect('Delete')
|
call s:search.connect('Delete')
|
||||||
call s:search.connect('CursorMove')
|
call s:search.connect('CursorMove')
|
||||||
call s:search.connect('Paste')
|
call s:search.connect('Paste')
|
||||||
call s:search.connect('BufferComplete')
|
call s:search.connect('BufferComplete')
|
||||||
call s:search.connect('InsertRegister')
|
call s:search.connect('InsertRegister')
|
||||||
call s:search.connect(s:cmdline.get_module('History').make('/'))
|
call s:search.connect(s:modules.get('History').make('/'))
|
||||||
call s:search.connect(s:cmdline.get_module('NoInsert').make_special_chars())
|
call s:search.connect(s:modules.get('NoInsert').make_special_chars())
|
||||||
call s:search.connect(s:cmdline.get_module('KeyMapping').make_emacs())
|
call s:search.connect(s:modules.get('KeyMapping').make_emacs())
|
||||||
call s:search.connect(s:cmdline.get_module('Doautocmd').make('EMCommandLine'))
|
call s:search.connect(s:modules.get('Doautocmd').make('EMCommandLine'))
|
||||||
|
|
||||||
let s:module = {
|
let s:module = {
|
||||||
\ "name" : "EasyMotion",
|
\ "name" : "EasyMotion",
|
||||||
@ -154,6 +159,7 @@ function! s:search.on_char(cmdline) "{{{
|
|||||||
call s:search.exit()
|
call s:search.exit()
|
||||||
endif
|
endif
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
"}}}
|
||||||
|
|
||||||
" Main:
|
" Main:
|
||||||
function! EasyMotion#command_line#GetInput(num_strokes, prev, direction) "{{{
|
function! EasyMotion#command_line#GetInput(num_strokes, prev, direction) "{{{
|
||||||
|
@ -3,26 +3,11 @@ let s:save_cpo = &cpo
|
|||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
|
|
||||||
let s:modules = [
|
|
||||||
\ "Scroll",
|
|
||||||
\ "CursorMove",
|
|
||||||
\ "Delete",
|
|
||||||
\ "HistAdd",
|
|
||||||
\ "History",
|
|
||||||
\ "Cancel",
|
|
||||||
\ "Enter",
|
|
||||||
\ "NoInsert",
|
|
||||||
\ "InsertRegister",
|
|
||||||
\]
|
|
||||||
|
|
||||||
|
|
||||||
function! s:_vital_loaded(V)
|
function! s:_vital_loaded(V)
|
||||||
let s:V = a:V
|
let s:V = a:V
|
||||||
for module in s:modules
|
|
||||||
let s:{module} = s:V.import('Over.Commandline.Modules.' . module)
|
|
||||||
endfor
|
|
||||||
let s:String = s:V.import("Over.String")
|
let s:String = s:V.import("Over.String")
|
||||||
let s:Signals = s:V.import("Over.Signals")
|
let s:Signals = s:V.import("Over.Signals")
|
||||||
|
let s:Module = s:V.import("Over.Commandline.Modules")
|
||||||
let s:base.variables.modules = s:Signals.make()
|
let s:base.variables.modules = s:Signals.make()
|
||||||
function! s:base.variables.modules.get_slot(val)
|
function! s:base.variables.modules.get_slot(val)
|
||||||
return a:val.slot.module
|
return a:val.slot.module
|
||||||
@ -34,43 +19,22 @@ function! s:_vital_depends()
|
|||||||
return [
|
return [
|
||||||
\ "Over.String",
|
\ "Over.String",
|
||||||
\ "Over.Signals",
|
\ "Over.Signals",
|
||||||
\ ] + map(copy(s:modules), "'Over.Commandline.Modules.' . v:val")
|
\ "Over.Commandline.Modules",
|
||||||
|
\ ]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! s:get_module(name)
|
function! s:make(...)
|
||||||
if exists("s:" . a:name)
|
let prompt = get(a:, 1, ":")
|
||||||
return s:{a:name}
|
let result = deepcopy(s:base)
|
||||||
endif
|
let result.prompt = prompt
|
||||||
let s:{a:name} = s:V.import('Over.Commandline.Modules.' . a:name)
|
|
||||||
return s:{a:name}
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
|
|
||||||
function! s:make_plain(prompt)
|
|
||||||
let result = s:make(a:prompt)
|
|
||||||
let result.prompt = a:prompt
|
|
||||||
call result.connect("Enter")
|
|
||||||
call result.connect("Cancel")
|
|
||||||
call result.connect(result, "_")
|
call result.connect(result, "_")
|
||||||
return result
|
return result
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! s:make_standard(prompt)
|
function! s:make_plain()
|
||||||
let result = s:make_plain(a:prompt)
|
return deepcpy(s:base)
|
||||||
call result.connect("Delete")
|
|
||||||
call result.connect("CursorMove")
|
|
||||||
call result.connect("HistAdd")
|
|
||||||
call result.connect("History")
|
|
||||||
call result.connect("InsertRegister")
|
|
||||||
call result.connect(s:get_module("NoInsert").make_special_chars())
|
|
||||||
return result
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
|
|
||||||
function! s:make(prompt)
|
|
||||||
return deepcopy(s:base)
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
@ -86,9 +50,9 @@ let s:base = {
|
|||||||
\ },
|
\ },
|
||||||
\ "highlights" : {
|
\ "highlights" : {
|
||||||
\ "prompt" : "NONE",
|
\ "prompt" : "NONE",
|
||||||
\ "cursor" : "OverCommandLineDefaultCursor",
|
\ "cursor" : "VitalOverCommandLineCursor",
|
||||||
\ "cursor_on" : "OverCommandLineDefaultCursorOn",
|
\ "cursor_on" : "VitalOverCommandLineCursorOn",
|
||||||
\ "cursor_insert" : "OverCommandLineDefaultOnCursor",
|
\ "cursor_insert" : "VitalOverCommandLineOnCursor",
|
||||||
\ },
|
\ },
|
||||||
\}
|
\}
|
||||||
|
|
||||||
@ -100,7 +64,6 @@ if exists("s:Signals")
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function! s:base.getline()
|
function! s:base.getline()
|
||||||
return self.line.str()
|
return self.line.str()
|
||||||
endfunction
|
endfunction
|
||||||
@ -116,8 +79,13 @@ function! s:base.char()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! s:base.setchar(char)
|
function! s:base.setchar(char, ...)
|
||||||
let self.variables.input = a:char
|
" 1 の場合は既に設定されていても上書きする
|
||||||
|
" 0 の場合は既に設定されていれば上書きしない
|
||||||
|
let overwrite = get(a:, 1, 1)
|
||||||
|
if overwrite || self.variables.input == self.char()
|
||||||
|
let self.variables.input = a:char
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
@ -180,7 +148,10 @@ endfunction
|
|||||||
|
|
||||||
function! s:base.connect(module, ...)
|
function! s:base.connect(module, ...)
|
||||||
if type(a:module) == type("")
|
if type(a:module) == type("")
|
||||||
return call(self.connect, [s:get_module(a:module).make()] + a:000, self)
|
return call(self.connect, [s:Module.make(a:module)] + a:000, self)
|
||||||
|
endif
|
||||||
|
if empty(a:module)
|
||||||
|
return
|
||||||
endif
|
endif
|
||||||
let name = a:0 > 0 ? a:1 : a:module.name
|
let name = a:0 > 0 ? a:1 : a:module.name
|
||||||
let slot = self.variables.modules.find_first_by("get(v:val.slot, 'name', '') == " . string(name))
|
let slot = self.variables.modules.find_first_by("get(v:val.slot, 'name', '') == " . string(name))
|
||||||
@ -201,6 +172,12 @@ function! s:base.disconnect(name)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
function! s:base.get_module(name)
|
||||||
|
let slot = self.variables.modules.find_first_by("get(v:val.slot, 'name', '') == " . string(a:name))
|
||||||
|
return empty(slot) ? {} : slot.slot.module
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! s:base.callevent(event)
|
function! s:base.callevent(event)
|
||||||
call self.variables.modules.sort_by("has_key(v:val.slot.module, 'priority') ? v:val.slot.module.priority('" . a:event . "') : 0")
|
call self.variables.modules.sort_by("has_key(v:val.slot.module, 'priority') ? v:val.slot.module.priority('" . a:event . "') : 0")
|
||||||
return self.variables.modules.call(a:event, [self])
|
return self.variables.modules.call(a:event, [self])
|
||||||
@ -231,8 +208,10 @@ function! s:base.keymapping()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! s:base.execute()
|
function! s:base.execute(...)
|
||||||
execute self.getline()
|
let command = get(a:, 1, self.getline())
|
||||||
|
call self._execute(command)
|
||||||
|
" execute self.getline()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
@ -271,8 +250,9 @@ function! s:base.hl_cursor_off()
|
|||||||
if exists("self.variables.old_t_ve")
|
if exists("self.variables.old_t_ve")
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let self.variables.old_guicursor = &guicursor
|
let self.variables.old_guicursor = &guicursor
|
||||||
set guicursor=a:-NONE
|
set guicursor=n:block-NONE
|
||||||
let self.variables.old_t_ve = &t_ve
|
let self.variables.old_t_ve = &t_ve
|
||||||
set t_ve=
|
set t_ve=
|
||||||
endfunction
|
endfunction
|
||||||
@ -280,17 +260,25 @@ endfunction
|
|||||||
|
|
||||||
function! s:base.start(...)
|
function! s:base.start(...)
|
||||||
let exit_code = call(self._main, a:000, self)
|
let exit_code = call(self._main, a:000, self)
|
||||||
if exit_code == 0
|
return exit_code
|
||||||
call self._execute()
|
endfunction
|
||||||
endif
|
|
||||||
|
|
||||||
|
function! s:base.__empty(...)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! s:base.get(...)
|
function! s:base.get(...)
|
||||||
let exit_code = call(self._main, a:000, self)
|
let Old_execute = self.execute
|
||||||
if exit_code == 0
|
let self.execute = self.__empty
|
||||||
return self.getline()
|
try
|
||||||
endif
|
let exit_code = self.start()
|
||||||
|
if exit_code == 0
|
||||||
|
return self.getline()
|
||||||
|
endif
|
||||||
|
finally
|
||||||
|
let self.execute = Old_execute
|
||||||
|
endtry
|
||||||
return ""
|
return ""
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@ -302,23 +290,22 @@ function! s:base._init()
|
|||||||
let self.variables.exit = 0
|
let self.variables.exit = 0
|
||||||
let self.variables.exit_code = 1
|
let self.variables.exit_code = 1
|
||||||
call self.hl_cursor_off()
|
call self.hl_cursor_off()
|
||||||
if !hlexists("OverCommandLineDefaultCursor")
|
if !hlexists(self.highlights.cursor)
|
||||||
highlight link OverCommandLineDefaultCursor Cursor
|
execute "highlight link " . self.highlights.cursor . " Cursor"
|
||||||
endif
|
endif
|
||||||
if !hlexists("OverCommandLineDefaultCursorOn")
|
if !hlexists(self.highlights.cursor_on)
|
||||||
highlight link OverCommandLineDefaultCursorOn OverCommandLineDefaultCursor
|
execute "highlight link " . self.highlights.cursor_on . " " . self.highlights.cursor
|
||||||
endif
|
endif
|
||||||
if !hlexists("OverCommandLineDefaultCursorInsert")
|
if !hlexists(self.highlights.cursor_insert)
|
||||||
highlight OverCommandLineDefaultCursorInsert cterm=underline term=underline gui=underline
|
execute "highlight " . self.highlights.cursor_insert . " cterm=underline term=underline gui=underline"
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! s:base._execute()
|
function! s:base._execute(command)
|
||||||
call s:redraw()
|
|
||||||
call self.callevent("on_execute_pre")
|
call self.callevent("on_execute_pre")
|
||||||
try
|
try
|
||||||
call self.execute()
|
execute a:command
|
||||||
catch
|
catch
|
||||||
echohl ErrorMsg
|
echohl ErrorMsg
|
||||||
echo matchstr(v:exception, 'Vim\((\w*)\)\?:\zs.*\ze')
|
echo matchstr(v:exception, 'Vim\((\w*)\)\?:\zs.*\ze')
|
||||||
@ -354,7 +341,6 @@ function! s:base._main(...)
|
|||||||
return -1
|
return -1
|
||||||
finally
|
finally
|
||||||
call self._finish()
|
call self._finish()
|
||||||
call s:redraw()
|
|
||||||
call self.callevent("on_leave")
|
call self.callevent("on_leave")
|
||||||
endtry
|
endtry
|
||||||
return self.exit_code()
|
return self.exit_code()
|
27
autoload/vital/_easymotion/Over/Commandline/Modules.vim
Normal file
27
autoload/vital/_easymotion/Over/Commandline/Modules.vim
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
scriptencoding utf-8
|
||||||
|
let s:save_cpo = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
|
||||||
|
function! s:_vital_loaded(V)
|
||||||
|
let s:V = a:V
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
function! s:get(name)
|
||||||
|
if exists("s:" . a:name)
|
||||||
|
return s:{a:name}
|
||||||
|
endif
|
||||||
|
let s:{a:name} = s:V.import('Over.Commandline.Modules.' . a:name)
|
||||||
|
return s:{a:name}
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
function! s:make(name, ...)
|
||||||
|
let module = s:get(a:name)
|
||||||
|
return call(module.make, a:000, module)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
let &cpo = s:save_cpo
|
||||||
|
unlet s:save_cpo
|
@ -1,25 +0,0 @@
|
|||||||
scriptencoding utf-8
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
let s:module = {
|
|
||||||
\ "name" : "Enter"
|
|
||||||
\}
|
|
||||||
|
|
||||||
function! s:module.on_char_pre(cmdline)
|
|
||||||
if a:cmdline.is_input("\<CR>")
|
|
||||||
\ || a:cmdline.is_input("\<NL>")
|
|
||||||
\ || a:cmdline.is_input("\<C-j>")
|
|
||||||
call a:cmdline.exit(0)
|
|
||||||
call a:cmdline.setchar("")
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
|
|
||||||
function! s:make()
|
|
||||||
return deepcopy(s:module)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
@ -0,0 +1,73 @@
|
|||||||
|
scriptencoding utf-8
|
||||||
|
let s:save_cpo = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
|
||||||
|
function! s:_is_input_enter(cmdline)
|
||||||
|
return a:cmdline.is_input("\<CR>")
|
||||||
|
\ || a:cmdline.is_input("\<NL>")
|
||||||
|
\ || a:cmdline.is_input("\<C-j>")
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
let s:module = {
|
||||||
|
\ "name" : "Execute"
|
||||||
|
\}
|
||||||
|
|
||||||
|
function! s:module.on_char_pre(cmdline)
|
||||||
|
if s:_is_input_enter(a:cmdline)
|
||||||
|
call self.execute(a:cmdline)
|
||||||
|
call a:cmdline.setchar("")
|
||||||
|
call a:cmdline.exit(0)
|
||||||
|
endif
|
||||||
|
if a:cmdline.is_input("<Over>(execute-no-exit)")
|
||||||
|
call self.execute(a:cmdline)
|
||||||
|
call a:cmdline.setchar("")
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:module.execute(cmdline)
|
||||||
|
return a:cmdline.execute()
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
function! s:make()
|
||||||
|
return deepcopy(s:module)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
let s:empty = deepcopy(s:module)
|
||||||
|
|
||||||
|
function! s:empty.execute(...)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
function! s:make_no_execute()
|
||||||
|
return deepcopy(s:empty)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
let s:search = deepcopy(s:module)
|
||||||
|
let s:search.prefix = "/"
|
||||||
|
|
||||||
|
|
||||||
|
function! s:search.execute(cmdline)
|
||||||
|
" let cmd = printf("call feedkeys(\"%s%s\<CR>\", 'n')", self.prefix, a:cmdline.getline())
|
||||||
|
let cmd = printf("call search('%s')", a:cmdline.getline())
|
||||||
|
call a:cmdline.execute(cmd)
|
||||||
|
let @/ = a:cmdline.getline()
|
||||||
|
let &hlsearch = &hlsearch
|
||||||
|
call feedkeys(":set hlsearch | set incsearch\<CR>", 'n')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function! s:make_search(...)
|
||||||
|
let result = deepcopy(s:search)
|
||||||
|
let result.prefix = get(a:, 1, "/")
|
||||||
|
return result
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
let &cpo = s:save_cpo
|
||||||
|
unlet s:save_cpo
|
@ -1,23 +0,0 @@
|
|||||||
scriptencoding utf-8
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
|
|
||||||
let s:module = {
|
|
||||||
\ "name" : "HistAdd",
|
|
||||||
\ "mode" : "cmd"
|
|
||||||
\}
|
|
||||||
|
|
||||||
function! s:module.on_leave(cmdline)
|
|
||||||
call histadd(self.mode, a:cmdline.getline())
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
|
|
||||||
function! s:make(...)
|
|
||||||
let module = deepcopy(s:module)
|
|
||||||
let module.mode = get(a:, 1, "cmd")
|
|
||||||
return module
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
@ -15,7 +15,8 @@ endfunction
|
|||||||
|
|
||||||
function! s:module.on_char_pre(cmdline)
|
function! s:module.on_char_pre(cmdline)
|
||||||
if self.is_insert(a:cmdline.char())
|
if self.is_insert(a:cmdline.char())
|
||||||
call a:cmdline.setchar("")
|
\ && a:cmdline.char() == a:cmdline.variables.input
|
||||||
|
call a:cmdline.setchar("", 0)
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -0,0 +1,43 @@
|
|||||||
|
scriptencoding utf-8
|
||||||
|
let s:save_cpo = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
|
||||||
|
let s:module = {
|
||||||
|
\ "name" : "Redraw",
|
||||||
|
\}
|
||||||
|
|
||||||
|
function! s:module.on_execute_pre(cmdline)
|
||||||
|
call self.redraw(a:cmdline)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:module.on_enter(...)
|
||||||
|
let self.is_execute = 0
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:module.on_execute(...)
|
||||||
|
let self.is_execute = 1
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:module.on_execute_failed(...)
|
||||||
|
let self.is_execute = 0
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:module.on_leave(cmdline)
|
||||||
|
if self.is_execute == 0
|
||||||
|
call self.redraw(a:cmdline)
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:module.redraw(...)
|
||||||
|
redraw
|
||||||
|
echo ""
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:make()
|
||||||
|
return deepcopy(s:module)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
let &cpo = s:save_cpo
|
||||||
|
unlet s:save_cpo
|
@ -1,37 +0,0 @@
|
|||||||
scriptencoding utf-8
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
|
|
||||||
let s:module = {
|
|
||||||
\ "name" : "Scroll"
|
|
||||||
\}
|
|
||||||
function! s:module.on_char_pre(cmdline)
|
|
||||||
if a:cmdline.is_input("<Over>(scroll-y)")
|
|
||||||
execute "normal! \<C-y>"
|
|
||||||
call a:cmdline.setchar('')
|
|
||||||
elseif a:cmdline.is_input("<Over>(scroll-u)")
|
|
||||||
execute "normal! \<C-u>"
|
|
||||||
call a:cmdline.setchar('')
|
|
||||||
elseif a:cmdline.is_input("<Over>(scroll-f)")
|
|
||||||
execute "normal! \<C-f>"
|
|
||||||
call a:cmdline.setchar('')
|
|
||||||
elseif a:cmdline.is_input("<Over>(scroll-e)")
|
|
||||||
execute "normal! \<C-e>"
|
|
||||||
call a:cmdline.setchar('')
|
|
||||||
elseif a:cmdline.is_input("<Over>(scroll-d)")
|
|
||||||
execute "normal! \<C-d>"
|
|
||||||
call a:cmdline.setchar('')
|
|
||||||
elseif a:cmdline.is_input("<Over>(scroll-b)")
|
|
||||||
execute "normal! \<C-b>"
|
|
||||||
call a:cmdline.setchar('')
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
|
|
||||||
function! s:make()
|
|
||||||
return deepcopy(s:module)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
@ -1,8 +1,16 @@
|
|||||||
easymotion
|
easymotion
|
||||||
39d8e9c
|
39d8e9c
|
||||||
|
|
||||||
Over.Commandline
|
Over.Commandline.Base
|
||||||
|
Over.Commandline.Modules.Cancel
|
||||||
|
Over.Commandline.Modules.Execute
|
||||||
Over.Commandline.Modules.BufferComplete
|
Over.Commandline.Modules.BufferComplete
|
||||||
Over.Commandline.Modules.Paste
|
Over.Commandline.Modules.Paste
|
||||||
Over.Commandline.Modules.KeyMapping
|
Over.Commandline.Modules.KeyMapping
|
||||||
Over.Commandline.Modules.Doautocmd
|
Over.Commandline.Modules.Doautocmd
|
||||||
|
Over.Commandline.Modules.CursorMove
|
||||||
|
Over.Commandline.Modules.Delete
|
||||||
|
Over.Commandline.Modules.Redraw
|
||||||
|
Over.Commandline.Modules.InsertRegister
|
||||||
|
Over.Commandline.Modules.History
|
||||||
|
Over.Commandline.Modules.NoInsert
|
||||||
|
Loading…
x
Reference in New Issue
Block a user