benatkin-vimilicious 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +661 -0
- data/LICENSE +22 -0
- data/README.rdoc +26 -0
- data/Rakefile +40 -0
- data/examples/vikir.rb +110 -0
- data/examples/vikir.vim +32 -0
- data/lib/vimilicious.rb +330 -0
- data/spec/mapping_spec.rb +51 -0
- data/spec/spec.opts +3 -0
- data/spec/spec_helper.rb +12 -0
- data/spec/vimilicious_spec.rb +7 -0
- data/vimilicious.gemspec +16 -0
- metadata +69 -0
@@ -0,0 +1,51 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper'
|
2
|
+
|
3
|
+
describe Vimilicious, '#map' do
|
4
|
+
|
5
|
+
# #map_commands_for will do whatever it can to get your
|
6
|
+
# mapping(s) working, even if it had to map too additional modes.
|
7
|
+
#
|
8
|
+
# first, it should look for one that contains all of the
|
9
|
+
# modes we want (*only* those modes).
|
10
|
+
#
|
11
|
+
# after that, it should see if it can find a way to *just*
|
12
|
+
# include the modes you want.
|
13
|
+
#
|
14
|
+
# if it can't find a way to *just* include the modes you want,
|
15
|
+
# it will select whichever alternative includes the least other modes.
|
16
|
+
#
|
17
|
+
# map:: Normal, Visual, Operator-pending
|
18
|
+
# map!:: Insert, Command-line
|
19
|
+
# nmap:: Normal
|
20
|
+
# vmap:: Visual
|
21
|
+
# omap:: Operator-pending
|
22
|
+
# cmap:: Command-line
|
23
|
+
# imap:: Insert
|
24
|
+
# lmap:: Insert, Command-line, Lang-Arg
|
25
|
+
#
|
26
|
+
it 'should be able to figure out which vim mapping command to use' do
|
27
|
+
map_commands_for('visual').should == [:vmap]
|
28
|
+
map_commands_for('ViSuaL').should == [:vmap]
|
29
|
+
map_commands_for(:visual).should == [:vmap]
|
30
|
+
|
31
|
+
map_commands_for(:command).should == [:cmap]
|
32
|
+
map_commands_for(:lang).should == [:lmap] # it has to, because it's the only option with lmap
|
33
|
+
map_commands_for(:insert).should == [:imap]
|
34
|
+
map_commands_for(:operator).should == [:omap]
|
35
|
+
map_commands_for(:normal).should == [:nmap]
|
36
|
+
|
37
|
+
# ok, now multiple ...
|
38
|
+
map_commands_for(:normal, :visual, :operator).should == [:map]
|
39
|
+
map_commands_for(:insert, :command).should == [:map!]
|
40
|
+
map_commands_for(:normal, :visual).should == [:nmap, :vmap]
|
41
|
+
|
42
|
+
map_commands_for(:normal, :command).length.should == 2
|
43
|
+
map_commands_for(:normal, :command).should include(:nmap)
|
44
|
+
map_commands_for(:normal, :command).should include(:cmap)
|
45
|
+
|
46
|
+
map_commands_for(:normal, :operator).length.should == 2
|
47
|
+
map_commands_for(:normal, :operator).should include(:nmap)
|
48
|
+
map_commands_for(:normal, :operator).should include(:omap)
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
data/spec/spec.opts
ADDED
data/spec/spec_helper.rb
ADDED
data/vimilicious.gemspec
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = "vimilicious"
|
3
|
+
s.version = "0.1.5"
|
4
|
+
s.date = "2009-05-31"
|
5
|
+
s.summary = "vim-ruby library for making vim easy"
|
6
|
+
s.email = "remi@remitaylor.com"
|
7
|
+
s.homepage = "http://github.com/remi/vimilicious"
|
8
|
+
s.description = "vim-ruby library making it easier to work with vim via ruby"
|
9
|
+
s.has_rdoc = true
|
10
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Sinatra", "--main", "README.rdoc"]
|
11
|
+
s.extra_rdoc_files = ['README.rdoc']
|
12
|
+
s.authors = ["remi Taylor"]
|
13
|
+
|
14
|
+
# generate using: $ ruby -e "puts Dir['**/**'].select{|x| File.file?x}.inspect"
|
15
|
+
s.files = ["COPYING", "examples/vikir.rb", "examples/vikir.vim", "lib/vimilicious.rb", "LICENSE", "Rakefile", "README.rdoc", "spec/mapping_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "spec/vimilicious_spec.rb", "vimilicious.gemspec"]
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: benatkin-vimilicious
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.5
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- remi Taylor
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-05-31 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: vim-ruby library making it easier to work with vim via ruby
|
17
|
+
email: remi@remitaylor.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- README.rdoc
|
24
|
+
files:
|
25
|
+
- COPYING
|
26
|
+
- examples/vikir.rb
|
27
|
+
- examples/vikir.vim
|
28
|
+
- lib/vimilicious.rb
|
29
|
+
- LICENSE
|
30
|
+
- Rakefile
|
31
|
+
- README.rdoc
|
32
|
+
- spec/mapping_spec.rb
|
33
|
+
- spec/spec.opts
|
34
|
+
- spec/spec_helper.rb
|
35
|
+
- spec/vimilicious_spec.rb
|
36
|
+
- vimilicious.gemspec
|
37
|
+
has_rdoc: true
|
38
|
+
homepage: http://github.com/remi/vimilicious
|
39
|
+
post_install_message:
|
40
|
+
rdoc_options:
|
41
|
+
- --line-numbers
|
42
|
+
- --inline-source
|
43
|
+
- --title
|
44
|
+
- Sinatra
|
45
|
+
- --main
|
46
|
+
- README.rdoc
|
47
|
+
require_paths:
|
48
|
+
- lib
|
49
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: "0"
|
54
|
+
version:
|
55
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: "0"
|
60
|
+
version:
|
61
|
+
requirements: []
|
62
|
+
|
63
|
+
rubyforge_project:
|
64
|
+
rubygems_version: 1.2.0
|
65
|
+
signing_key:
|
66
|
+
specification_version: 2
|
67
|
+
summary: vim-ruby library for making vim easy
|
68
|
+
test_files: []
|
69
|
+
|