Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Rename the plugin from "smartpunc" to "smartinput"

  • Loading branch information...
commit 6974c67e34b2d3b6c5e9f32049c2ae178efd3ccb 1 parent 547e467
Kana Natsuno authored
32 autoload/smartpunc.vim → autoload/smartinput.vim
View
@@ -1,4 +1,4 @@
-" smartpunc - Smart input assistant for punctuations
+" smartinput - Smart input assistant for punctuations
" Version: 0.0.0
" Copyright (C) 2012 Kana Natsuno <http://whileimautomaton.net/>
" License: So-called MIT/X license {{{
@@ -55,14 +55,14 @@ let s:available_nrules = [] "{{{2
" Interface "{{{1
-function! smartpunc#clear_rules() "{{{2
+function! smartinput#clear_rules() "{{{2
let s:available_nrules = []
endfunction
-function! smartpunc#define_default_rules() "{{{2
+function! smartinput#define_default_rules() "{{{2
" urules "{{{
let urules = {}
let urules.names = []
@@ -147,7 +147,7 @@ function! smartpunc#define_default_rules() "{{{2
for urule_set in ft_urule_sets_table['*']
for urule in urule_set
- call smartpunc#define_rule(urule)
+ call smartinput#define_rule(urule)
endfor
endfor
@@ -172,7 +172,7 @@ function! smartpunc#define_default_rules() "{{{2
for [urule, fts] in overlaied_urules.pairs
let completed_urule = copy(urule)
let completed_urule.filetype = fts
- call smartpunc#define_rule(completed_urule)
+ call smartinput#define_rule(completed_urule)
endfor
" Add more useful rules?
@@ -193,7 +193,7 @@ endfunction
-function! smartpunc#define_rule(urule) "{{{2
+function! smartinput#define_rule(urule) "{{{2
let nrule = s:normalize_rule(a:urule)
call s:insert_or_replace_a_rule(s:available_nrules, nrule)
endfunction
@@ -201,7 +201,7 @@ endfunction
-function! smartpunc#map_to_trigger(mode, lhs, rhs_char, rhs_fallback) "{{{2
+function! smartinput#map_to_trigger(mode, lhs, rhs_char, rhs_fallback) "{{{2
" According to :help 'autoindent' --
"
" > Copy indent from current line when starting a new line
@@ -254,7 +254,7 @@ endfunction
-function! smartpunc#map_trigger_keys(...) "{{{2
+function! smartinput#map_trigger_keys(...) "{{{2
let overridep = 1 <= a:0 ? a:1 : 0
let d = {'i': {}, 'c': {}}
@@ -268,7 +268,7 @@ function! smartpunc#map_trigger_keys(...) "{{{2
endif
endfor
- let M = function('smartpunc#map_to_trigger')
+ let M = function('smartinput#map_to_trigger')
let map_modifier = overridep ? '' : '<unique>'
for mode in keys(d)
let unique_chars = keys(d[mode])
@@ -297,7 +297,7 @@ endfunction
" Misc. "{{{1
-function! smartpunc#invoke_the_initial_setup_if_necessary() "{{{2
+function! smartinput#invoke_the_initial_setup_if_necessary() "{{{2
" The initial setup is invoked implicitly by :source'ing the autoload file.
" So that this function does nothing explicitly.
endfunction
@@ -305,14 +305,14 @@ endfunction
-function! smartpunc#scope() "{{{2
+function! smartinput#scope() "{{{2
return s:
endfunction
-function! smartpunc#sid() "{{{2
+function! smartinput#sid() "{{{2
return maparg('<SID>', 'n')
endfunction
nnoremap <SID> <SID>
@@ -492,7 +492,7 @@ endfunction
function! s:sid_value() "{{{2
- return substitute(smartpunc#sid(), '<SNR>', "\<SNR>", 'g')
+ return substitute(smartinput#sid(), '<SNR>', "\<SNR>", 'g')
endfunction
@@ -505,10 +505,10 @@ endfunction
" The initial setup "{{{1
function! s:do_initial_setup() "{{{2
- call smartpunc#define_default_rules()
+ call smartinput#define_default_rules()
- if !exists('g:smartpunc_no_default_key_mappings')
- call smartpunc#map_trigger_keys()
+ if !exists('g:smartinput_no_default_key_mappings')
+ call smartinput#map_trigger_keys()
endif
endfunction
102 doc/smartpunc.txt → doc/smartinput.txt
View
@@ -1,4 +1,4 @@
-*smartpunc.txt* Smart input assistant for punctuations
+*smartinput.txt* Smart input assistant for punctuations
Version 0.0.0
Script ID: ****
@@ -24,24 +24,24 @@ License: So-called MIT/X license {{{
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
}}}
-CONTENTS *smartpunc-contents*
+CONTENTS *smartinput-contents*
-Introduction |smartpunc-introduction|
-Interface |smartpunc-interface|
- Functions |smartpunc-functions|
- Key Mappings |smartpunc-key-mappings|
-Rules |smartpunc-rules|
-Customization |smartpunc-customization|
-Bugs |smartpunc-bugs|
-Changelog |smartpunc-changelog|
+Introduction |smartinput-introduction|
+Interface |smartinput-interface|
+ Functions |smartinput-functions|
+ Key Mappings |smartinput-key-mappings|
+Rules |smartinput-rules|
+Customization |smartinput-customization|
+Bugs |smartinput-bugs|
+Changelog |smartinput-changelog|
==============================================================================
-INTRODUCTION *smartpunc-introduction*
+INTRODUCTION *smartinput-introduction*
-*smartpunc* is a Vim plugin to provide a smart input assistant for
+*smartinput* is a Vim plugin to provide a smart input assistant for
punctuations. Whenever you write a text, especially source code, you have to
input and deal with a pair of punctuations such as (), [], {}, and so on.
This plugin provides various input assistants according to the current context
@@ -108,32 +108,32 @@ Requirements:
- Vim 7.3 or later
Latest version:
-https://github.com/kana/vim-smartpunc
+https://github.com/kana/vim-smartinput
Document in HTML format:
-http://vim-doc.heroku.com/view?https://github.com/kana/vim-smartpunc/blob/master/doc/smartpunc.txt
+http://vim-doc.heroku.com/view?https://github.com/kana/vim-smartinput/blob/master/doc/smartinput.txt
==============================================================================
-INTERFACE *smartpunc-interface*
+INTERFACE *smartinput-interface*
------------------------------------------------------------------------------
-FUNCTIONS *smartpunc-functions*
+FUNCTIONS *smartinput-functions*
-smartpunc#clear_rules() *smartpunc#clear_rules()*
+smartinput#clear_rules() *smartinput#clear_rules()*
Clear all defined rules.
-smartpunc#define_default_rules() *smartpunc#define_default_rules()*
- Define |smartpunc-default-rules|.
+smartinput#define_default_rules() *smartinput#define_default_rules()*
+ Define |smartinput-default-rules|.
-smartpunc#define_rule({rule}) *smartpunc#define_rule()*
+smartinput#define_rule({rule}) *smartinput#define_rule()*
Define a rule for the smart input assistant.
- See |smartpunc-rules| for the details of {rule}.
+ See |smartinput-rules| for the details of {rule}.
- *smartpunc#map_to_trigger()*
-smartpunc#map_to_trigger({mode}, {lhs}, {rhs-char}, {rhs-fallback})
+ *smartinput#map_to_trigger()*
+smartinput#map_to_trigger({mode}, {lhs}, {rhs-char}, {rhs-fallback})
Map {lhs} to trigger the smart input assistant for
{rhs-char} in {mode}. If there is no proper rule
for the current context, {rhs-fallback} will be
@@ -145,9 +145,9 @@ smartpunc#map_to_trigger({mode}, {lhs}, {rhs-char}, {rhs-fallback})
{lhs} is mapped in Insert mode if {mode} is 'i'.
{lhs} is mapped in Command-line mode if {mode} is 'c'.
- See also |smartpunc-exampels| for the details.
+ See also |smartinput-exampels| for the details.
-smartpunc#map_trigger_keys([{overridep}]) *smartpunc#map_trigger_keys()*
+smartinput#map_trigger_keys([{overridep}]) *smartinput#map_trigger_keys()*
Map keys to trigger smart input assistant according to
rules which are currently defined.
Existing key mappings are overridden if {overridep} is
@@ -157,13 +157,13 @@ smartpunc#map_trigger_keys([{overridep}]) *smartpunc#map_trigger_keys()*
------------------------------------------------------------------------------
-KEY MAPPINGS *smartpunc-key-mappings*
+KEY MAPPINGS *smartinput-key-mappings*
Several characters in Insert mode and Command-line mode are mapped by default
-with |smartpunc#map_to_trigger()| to trigger the smart input assistant.
-See |smartpunc-default-rules| for the details.
+with |smartinput#map_to_trigger()| to trigger the smart input assistant.
+See |smartinput-default-rules| for the details.
-Set any value to *g:smartpunc_no_default_key_mappings*
+Set any value to *g:smartinput_no_default_key_mappings*
if you don't want to define the default key mappings.
Each default key mapping will not be defined if the {lhs} is already mapped to
@@ -174,10 +174,10 @@ you map "(" to something in your vimrc.
==============================================================================
-RULES *smartpunc-rules*
+RULES *smartinput-rules*
------------------------------------------------------------------------------
-RULE DEFINITION *smartpunc-rule-definition*
+RULE DEFINITION *smartinput-rule-definition*
Smart input assistants are defined by "rules". Each "rule" is represented as
a |Dictionary| which contains the following items:
@@ -257,19 +257,19 @@ a |Dictionary| which contains the following items:
------------------------------------------------------------------------------
-DEFAULT RULES *smartpunc-default-rules*
+DEFAULT RULES *smartinput-default-rules*
For convenience, there are many rules defined by default.
If you read this document in Vim,
-see ../autoload/smartpunc.vim for the details (type |gf| at the file name).
+see ../autoload/smartinput.vim for the details (type |gf| at the file name).
If you read this document with a Web browser, see the following instead:
-https://github.com/kana/vim-smartpunc/blob/master/autoload/smartpunc.vim
+https://github.com/kana/vim-smartinput/blob/master/autoload/smartinput.vim
------------------------------------------------------------------------------
-PRIORITIES *smartpunc-rule-priorities*
+PRIORITIES *smartinput-rule-priorities*
Rules have priorities. It is used to select the best rule for the smart input
assistant.
@@ -313,10 +313,10 @@ For example:
------------------------------------------------------------------------------
-RULE SELECTION ALGORITHM *smartpunc-rule-selection-algorithm*
+RULE SELECTION ALGORITHM *smartinput-rule-selection-algorithm*
-Whenever you type a key in Insert mode or Command-line mode, smartpunc selects
-the best rule for the current context with the following steps:
+Whenever you type a key in Insert mode or Command-line mode, the plugin
+selects the best rule for the current context with the following steps:
(1) Select available rules which satisfy all the following conditions:
@@ -331,7 +331,7 @@ the best rule for the current context with the following steps:
(m) The current mode matches to "mode" value.
(2) If two or more rules are selected at the step (1),
- select the rule with the highest |smartpunc-rule-priority|.
+ select the rule with the highest |smartinput-rule-priority|.
(3) If two or more rules are selected at the step (2),
select the rule with the greatest "at".
@@ -339,7 +339,7 @@ the best rule for the current context with the following steps:
------------------------------------------------------------------------------
-RULE CONVENTIONS *smartpunc-rule-conventions*
+RULE CONVENTIONS *smartinput-rule-conventions*
Like |i_<BS>| and |i_CTRL-H|, there are several keys which does the same
effects. If you want to define rules for such keys,
@@ -352,7 +352,7 @@ For example, if you want to define rules on both |i_<BS>| and |i_CTRL-H|,
* Define rules only for <BS>.
* Map <C-h> to trigger rules for <BS>, with the following command:
>
- smartpunc#map_to_trigger('<C-h>', '<BS>', '<C-h>')
+ smartinput#map_to_trigger('<C-h>', '<BS>', '<C-h>')
<
This convention is to avoid rule duplication. See also the following table:
@@ -367,34 +367,34 @@ This convention is to avoid rule duplication. See also the following table:
==============================================================================
-CUSTOMIZATION *smartpunc-customization*
+CUSTOMIZATION *smartinput-customization*
(A) To define your own |smartpunk-rules| for the smart input assistant,
- use |smartpunc#define_rule()|. See also |smartpunc-default-rules| for the
- real world examples.
+ use |smartinput#define_rule()|. See also |smartinput-default-rules| for
+ the real world examples.
-(B) If you define your own |smartpunc-rules| which "char" values are different
- from ones of |smartpunc-default-rules|, you have to define trigger keys
- for your own rules with |smartpunc#map_to_trigger()|.
+(B) If you define your own |smartinput-rules| which "char" values are
+ different from ones of |smartinput-default-rules|, you have to define
+ trigger keys for your own rules with |smartinput#map_to_trigger()|.
==============================================================================
-BUGS *smartpunc-bugs*
+BUGS *smartinput-bugs*
- Currently there is no known issue.
- If you find any problem or have any suggestion, please give your feedback to
- the author by: https://github.com/kana/vim-smartpunc/issues
+ the author by: https://github.com/kana/vim-smartinput/issues
==============================================================================
-CHANGELOG *smartpunc-changelog*
+CHANGELOG *smartinput-changelog*
-0.0.0 2012-02-09T22:35:02+09:00 *smartpunc-changelog-0.0.0*
+0.0.0 2012-02-09T22:35:02+09:00 *smartinput-changelog-0.0.0*
- Initial version.
8 plugin/smartpunc.vim → plugin/smartinput.vim
View
@@ -1,4 +1,4 @@
-" smartpunc - Smart input assistant for punctuations
+" smartinput - Smart input assistant for punctuations
" Version: 0.0.0
" Copyright (C) 2012 Kana Natsuno <http://whileimautomaton.net/>
" License: So-called MIT/X license {{{
@@ -22,19 +22,19 @@
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
-if exists('g:loaded_smartpunc')
+if exists('g:loaded_smartinput')
finish
endif
-call smartpunc#invoke_the_initial_setup_if_necessary()
+call smartinput#invoke_the_initial_setup_if_necessary()
-let g:loaded_smartpunc = 1
+let g:loaded_smartinput = 1
" __END__
" vim: foldmethod=marker
76 t/api.vim
View
@@ -5,14 +5,14 @@
" mappings, because some tests in this file assume such state.
imapclear
-runtime! plugin/smartpunc.vim
+runtime! plugin/smartinput.vim
-call vspec#hint({'scope': 'smartpunc#scope()', 'sid': 'smartpunc#sid()'})
+call vspec#hint({'scope': 'smartinput#scope()', 'sid': 'smartinput#sid()'})
set backspace=indent,eol,start
filetype plugin indent on
syntax enable
-describe 'smartpunc#clear_rules'
+describe 'smartinput#clear_rules'
before
SaveContext
new
@@ -43,21 +43,21 @@ describe 'smartpunc#clear_rules'
" Because of the default configuration.
Expect Ref('s:available_nrules') !=# []
- call smartpunc#clear_rules()
+ call smartinput#clear_rules()
Expect Ref('s:available_nrules') ==# []
- call smartpunc#define_rule(b:uruleA)
+ call smartinput#define_rule(b:uruleA)
Expect Ref('s:available_nrules') ==# [b:nruleA]
- call smartpunc#define_rule(b:uruleB)
+ call smartinput#define_rule(b:uruleB)
Expect Ref('s:available_nrules') ==# [b:nruleB, b:nruleA]
- call smartpunc#clear_rules()
+ call smartinput#clear_rules()
Expect Ref('s:available_nrules') ==# []
end
end
-describe 'smartpunc#define_default_rules'
+describe 'smartinput#define_default_rules'
before
SaveContext
end
@@ -67,19 +67,19 @@ describe 'smartpunc#define_default_rules'
end
it 'should define many rules'
- call smartpunc#clear_rules()
+ call smartinput#clear_rules()
Expect Ref('s:available_nrules') ==# []
- call smartpunc#define_default_rules()
+ call smartinput#define_default_rules()
Expect Ref('s:available_nrules') !=# []
end
it 'should override existing rules if conflicted'
- call smartpunc#clear_rules()
+ call smartinput#clear_rules()
Expect Ref('s:available_nrules') ==# []
- call smartpunc#define_rule({'at': 'x\%#', 'char': '(', 'input': '---'})
- call smartpunc#define_rule({'at': '\%#', 'char': '(', 'input': '---'})
+ call smartinput#define_rule({'at': 'x\%#', 'char': '(', 'input': '---'})
+ call smartinput#define_rule({'at': '\%#', 'char': '(', 'input': '---'})
Expect len(Ref('s:available_nrules')) == 2
let unconflicted_nrule = Ref('s:available_nrules')[0]
@@ -87,7 +87,7 @@ describe 'smartpunc#define_default_rules'
Expect unconflicted_nrule.at ==# 'x\%#'
Expect conflicted_nrule.at ==# '\%#'
- call smartpunc#define_default_rules()
+ call smartinput#define_default_rules()
Expect Ref('s:available_nrules') !=# []
Expect index(Ref('s:available_nrules'), unconflicted_nrule) != -1
Expect index(Ref('s:available_nrules'), conflicted_nrule) == -1
@@ -97,7 +97,7 @@ describe 'smartpunc#define_default_rules'
" in 'The default configuration' block.
end
-describe 'smartpunc#define_rule'
+describe 'smartinput#define_rule'
before
SaveContext
new
@@ -151,10 +151,10 @@ describe 'smartpunc#define_rule'
call Set('s:available_nrules', [])
Expect Ref('s:available_nrules') ==# []
- call smartpunc#define_rule(b:uruleA)
+ call smartinput#define_rule(b:uruleA)
Expect Ref('s:available_nrules') ==# [b:nruleA]
- call smartpunc#define_rule(b:uruleB)
+ call smartinput#define_rule(b:uruleB)
Expect Ref('s:available_nrules') ==# [b:nruleB, b:nruleA]
end
@@ -165,16 +165,16 @@ describe 'smartpunc#define_rule'
call Set('s:available_nrules', [])
Expect Ref('s:available_nrules') ==# []
- call smartpunc#define_rule(b:uruleA)
+ call smartinput#define_rule(b:uruleA)
Expect Ref('s:available_nrules') ==# [b:nruleA]
- call smartpunc#define_rule(b:uruleA)
+ call smartinput#define_rule(b:uruleA)
Expect Ref('s:available_nrules') ==# [b:nruleA]
- call smartpunc#define_rule(b:uruleB)
+ call smartinput#define_rule(b:uruleB)
Expect Ref('s:available_nrules') ==# [b:nruleB, b:nruleA]
- call smartpunc#define_rule(b:uruleBd)
+ call smartinput#define_rule(b:uruleBd)
Expect Ref('s:available_nrules') ==# [b:nruleBd, b:nruleA]
end
@@ -187,8 +187,8 @@ describe 'smartpunc#define_rule'
call Set('s:available_nrules', [])
Expect Ref('s:available_nrules') ==# []
- call smartpunc#define_rule(b:uruleA)
- call smartpunc#define_rule(b:uruleB)
+ call smartinput#define_rule(b:uruleA)
+ call smartinput#define_rule(b:uruleB)
Expect Ref('s:available_nrules') ==# [b:nruleB, b:nruleA]
end
@@ -202,8 +202,8 @@ describe 'smartpunc#define_rule'
call Set('s:available_nrules', [])
Expect Ref('s:available_nrules') ==# []
- call smartpunc#define_rule(b:uruleB)
- call smartpunc#define_rule(b:uruleA)
+ call smartinput#define_rule(b:uruleB)
+ call smartinput#define_rule(b:uruleA)
Expect Ref('s:available_nrules') ==# [b:nruleB, b:nruleA]
end
@@ -217,8 +217,8 @@ describe 'smartpunc#define_rule'
call Set('s:available_nrules', [])
Expect Ref('s:available_nrules') ==# []
- call smartpunc#define_rule(b:uruleC1)
- call smartpunc#define_rule(b:uruleC2)
+ call smartinput#define_rule(b:uruleC1)
+ call smartinput#define_rule(b:uruleC2)
Expect Ref('s:available_nrules') ==# [b:nruleC2, b:nruleC1]
end
@@ -232,21 +232,21 @@ describe 'smartpunc#define_rule'
call Set('s:available_nrules', [])
Expect Ref('s:available_nrules') ==# []
- call smartpunc#define_rule(b:uruleC2)
- call smartpunc#define_rule(b:uruleC1)
+ call smartinput#define_rule(b:uruleC2)
+ call smartinput#define_rule(b:uruleC1)
Expect Ref('s:available_nrules') ==# [b:nruleC2, b:nruleC1]
end
end
-describe 'smartpunc#map_to_trigger'
+describe 'smartinput#map_to_trigger'
before
SaveContext
new
- let M = function('smartpunc#map_to_trigger')
+ let M = function('smartinput#map_to_trigger')
" With a cursor adjustment.
- call smartpunc#define_rule({
+ call smartinput#define_rule({
\ 'at': '\%#',
\ 'char': '(',
\ 'input': '()<Left>',
@@ -254,7 +254,7 @@ describe 'smartpunc#map_to_trigger'
call M('i', '<buffer> (', '(', '(')
" Without any cursor adjustment.
- call smartpunc#define_rule({
+ call smartinput#define_rule({
\ 'at': '\%#',
\ 'char': '1',
\ 'input': '123',
@@ -270,7 +270,7 @@ describe 'smartpunc#map_to_trigger'
call M('i', '<buffer> F2', 'x', 'y')
" With a special "char".
- call smartpunc#define_rule({
+ call smartinput#define_rule({
\ 'at': '(\%#)',
\ 'char': '<BS>',
\ 'input': '<BS><Del>',
@@ -278,7 +278,7 @@ describe 'smartpunc#map_to_trigger'
call M('i', '<buffer> <BS>', '<BS>', '<BS>')
" With a problematic "char" - ``"''.
- call smartpunc#define_rule({
+ call smartinput#define_rule({
\ 'at': '\%#',
\ 'char': '"',
\ 'input': '""<Left>',
@@ -286,7 +286,7 @@ describe 'smartpunc#map_to_trigger'
call M('i', '<buffer> "', '"', '"')
" With a problematic "char" - ``\''.
- call smartpunc#define_rule({
+ call smartinput#define_rule({
\ 'at': '\%#',
\ 'char': '<Bslash>',
\ 'input': '<Bslash><Bslash><Left>',
@@ -294,7 +294,7 @@ describe 'smartpunc#map_to_trigger'
call M('i', '<buffer> <Bslash>', '<Bslash>', '<Bslash>')
" With automatic indentation.
- call smartpunc#define_rule({
+ call smartinput#define_rule({
\ 'at': '{\%#}',
\ 'char': '<Return>',
\ 'input': '<Return>*<Return>}<BS><Up><C-o>$<BS>',
@@ -302,7 +302,7 @@ describe 'smartpunc#map_to_trigger'
call M('i', '<buffer> <Return>', '<Return>', '<Return>')
" In Command-line mode.
- call smartpunc#define_rule({
+ call smartinput#define_rule({
\ 'at': '\[\%#]',
\ 'char': '<BS>',
\ 'input': '<BS><Del>',
2  t/beep-on-empty-line.t
View
@@ -3,7 +3,7 @@
example_count=0
example_count=$((example_count + 1))
-subject='smartpunc#map_to_trigger'
+subject='smartinput#map_to_trigger'
example='should not beep if the cursor will be moved to an empty line'
if make TEST_TARGETS="${0%.t}.vim" test | grep --quiet --invert-match $'\a'
then
10 t/beep-on-empty-line.vim
View
@@ -1,20 +1,20 @@
-runtime! plugin/smartpunc.vim
+runtime! plugin/smartinput.vim
-call vspec#hint({'scope': 'smartpunc#scope()', 'sid': 'smartpunc#sid()'})
+call vspec#hint({'scope': 'smartinput#scope()', 'sid': 'smartinput#sid()'})
set backspace=indent,eol,start
-describe 'smartpunc#map_to_trigger'
+describe 'smartinput#map_to_trigger'
before
SaveContext
new
" If the cursor will be moved to an empty line...
- call smartpunc#define_rule({
+ call smartinput#define_rule({
\ 'at': '(\%#)',
\ 'char': '<Return>',
\ 'input': '<Return>X<Return>)<BS><Up><C-o>$<BS>',
\ })
- call smartpunc#map_to_trigger('i', '<buffer> <Return>', '<Return>')
+ call smartinput#map_to_trigger('i', '<buffer> <Return>', '<Return>')
end
after
32 t/map_trigger_keys.vim
View
@@ -1,10 +1,10 @@
-let g:smartpunc_no_default_key_mappings = !0
+let g:smartinput_no_default_key_mappings = !0
-runtime! plugin/smartpunc.vim
+runtime! plugin/smartinput.vim
-call vspec#hint({'scope': 'smartpunc#scope()', 'sid': 'smartpunc#sid()'})
+call vspec#hint({'scope': 'smartinput#scope()', 'sid': 'smartinput#sid()'})
-describe 'smartpunc#map_trigger_keys'
+describe 'smartinput#map_trigger_keys'
before
new
@@ -13,14 +13,14 @@ describe 'smartpunc#map_trigger_keys'
execute '0 verbose' a:map_command
redir END
let lhss = split(s, '\n')
- call map(lhss, 'substitute(v:val, ''\v\S+\s+(\S+)\s+.*'', ''\1'',''g'')')
+ call map(lhss, 'substitute(v:val, ''\v\S+\s+(\S+)\s+.*'', ''\1'', "g")')
call sort(lhss)
return lhss
endfunction
imapclear
cmapclear
- call smartpunc#clear_rules()
+ call smartinput#clear_rules()
end
after
@@ -28,7 +28,7 @@ describe 'smartpunc#map_trigger_keys'
end
it 'should not map anything but "alias" ones if there is no rule'
- call smartpunc#map_trigger_keys()
+ call smartinput#map_trigger_keys()
Expect b:get_lhss('imap') ==# [
\ '<C-H>',
@@ -44,12 +44,12 @@ describe 'smartpunc#map_trigger_keys'
it 'should not override existing key mappings if overridep is omitted'
inoremap x FOO
- call smartpunc#define_rule({'at': '', 'char': 'x', 'input': 'BAR',
+ call smartinput#define_rule({'at': '', 'char': 'x', 'input': 'BAR',
\ 'mode': 'i'})
cnoremap y foo
- call smartpunc#define_rule({'at': '', 'char': 'y', 'input': 'bar',
+ call smartinput#define_rule({'at': '', 'char': 'y', 'input': 'bar',
\ 'mode': ':'})
- call smartpunc#map_trigger_keys()
+ call smartinput#map_trigger_keys()
Expect b:get_lhss('imap') ==# [
\ '<C-H>',
@@ -69,12 +69,12 @@ describe 'smartpunc#map_trigger_keys'
it 'should not override existing key mappings if overridep is false'
inoremap x FOO
- call smartpunc#define_rule({'at': '', 'char': 'x', 'input': 'BAR',
+ call smartinput#define_rule({'at': '', 'char': 'x', 'input': 'BAR',
\ 'mode': 'i'})
cnoremap y foo
- call smartpunc#define_rule({'at': '', 'char': 'y', 'input': 'bar',
+ call smartinput#define_rule({'at': '', 'char': 'y', 'input': 'bar',
\ 'mode': ':'})
- call smartpunc#map_trigger_keys(!!0)
+ call smartinput#map_trigger_keys(!!0)
Expect b:get_lhss('imap') ==# [
\ '<C-H>',
@@ -94,12 +94,12 @@ describe 'smartpunc#map_trigger_keys'
it 'should override existing key mappings if overridep is true'
inoremap x FOO
- call smartpunc#define_rule({'at': '', 'char': 'x', 'input': 'BAR',
+ call smartinput#define_rule({'at': '', 'char': 'x', 'input': 'BAR',
\ 'mode': 'i'})
cnoremap y foo
- call smartpunc#define_rule({'at': '', 'char': 'y', 'input': 'bar',
+ call smartinput#define_rule({'at': '', 'char': 'y', 'input': 'bar',
\ 'mode': ':'})
- call smartpunc#map_trigger_keys(!0)
+ call smartinput#map_trigger_keys(!0)
Expect b:get_lhss('imap') ==# [
\ '<C-H>',
4 t/misc.vim
View
@@ -1,6 +1,6 @@
-runtime! plugin/smartpunc.vim
+runtime! plugin/smartinput.vim
-call vspec#hint({'scope': 'smartpunc#scope()', 'sid': 'smartpunc#sid()'})
+call vspec#hint({'scope': 'smartinput#scope()', 'sid': 'smartinput#sid()'})
syntax enable
set backspace=indent,eol,start
10 t/proper-initialization.vim
View
@@ -1,12 +1,12 @@
describe 'the initialization steps'
it 'should define the default rules fisrt, then user-defined rules'
" Emulate stuffs in user's vimrc.
- call smartpunc#define_rule({'at': '\%#', 'char': '(', 'input': 'BAR'})
- call smartpunc#define_rule({'at': '', 'char': 'x', 'input': 'FOO'})
- call vspec#hint({'scope': 'smartpunc#scope()', 'sid': 'smartpunc#sid()'})
+ call smartinput#define_rule({'at': '\%#', 'char': '(', 'input': 'BAR'})
+ call smartinput#define_rule({'at': '', 'char': 'x', 'input': 'FOO'})
+ call vspec#hint({'scope': 'smartinput#scope()', 'sid': 'smartinput#sid()'})
" Emulate loading plugins.
- runtime! plugin/smartpunc.vim
+ runtime! plugin/smartinput.vim
Expect Ref('s:loaded_count') == 1
@@ -22,7 +22,7 @@ describe 'the initialization steps'
Expect overridden_nrules[0].input ==# 'BAR'
Expect maparg('x', 'i') ==# ''
- call smartpunc#map_trigger_keys()
+ call smartinput#map_trigger_keys()
Expect maparg('x', 'i') !=# ''
end
end
8 t/startup-no-default-key-mappings.vim
View
@@ -6,13 +6,13 @@
imapclear
cmapclear
-let g:smartpunc_no_default_key_mappings = !0
+let g:smartinput_no_default_key_mappings = !0
-runtime! plugin/smartpunc.vim
+runtime! plugin/smartinput.vim
-call vspec#hint({'scope': 'smartpunc#scope()', 'sid': 'smartpunc#sid()'})
+call vspec#hint({'scope': 'smartinput#scope()', 'sid': 'smartinput#sid()'})
-describe 'g:smartpunc_no_default_key_mappings'
+describe 'g:smartinput_no_default_key_mappings'
it 'should suppress to define the default key mappings'
redir => si
0 verbose imap
4 t/startup-preserving-existing-key-mappings.vim
View
@@ -9,9 +9,9 @@ cmapclear
inoremap ( (((
cnoremap <BS> Backspace!!!
-runtime! plugin/smartpunc.vim
+runtime! plugin/smartinput.vim
-call vspec#hint({'scope': 'smartpunc#scope()', 'sid': 'smartpunc#sid()'})
+call vspec#hint({'scope': 'smartinput#scope()', 'sid': 'smartinput#sid()'})
describe 'Start-up'
it 'should preverse existing key mappings prior to the default key mappings'
Please sign in to comment.
Something went wrong with that request. Please try again.