ver 2009.10.14 → 2009.11.28
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +1094 -0
- data/MANIFEST +227 -25
- data/README.textile +185 -0
- data/bin/ver +96 -12
- data/config/detect.rb +73 -21
- data/config/keymap/emacs.rb +66 -0
- data/config/keymap/vim.rb +250 -140
- data/config/preferences/ANTLR.json +10 -0
- data/config/preferences/ASP vb.NET.json +3 -0
- data/config/preferences/ASP.json +15 -0
- data/config/preferences/ActionScript.json +755 -0
- data/config/preferences/Active4D.json +89 -0
- data/config/preferences/Ada.json +23 -0
- data/config/preferences/Ant.json +356 -0
- data/config/preferences/Apache.json +644 -0
- data/config/preferences/AppleScript.json +92 -0
- data/config/preferences/Bison.json +3 -0
- data/config/preferences/Blogging.json +3 -0
- data/config/preferences/C.json +127 -0
- data/config/preferences/CMake.json +41 -0
- data/config/preferences/CSS.json +461 -0
- data/config/preferences/CTags.json +3 -0
- data/config/preferences/CVS.json +3 -0
- data/config/preferences/ColdFusion.json +32 -0
- data/config/preferences/D.json +58 -0
- data/config/preferences/Darcs.json +3 -0
- data/config/preferences/Diff.json +67 -0
- data/config/preferences/DokuWiki.json +19 -0
- data/config/preferences/Doxygen.json +3 -0
- data/config/preferences/Dylan.json +3 -0
- data/config/preferences/Eiffel.json +59 -0
- data/config/preferences/Erlang.json +72 -0
- data/config/preferences/Experimental.json +1356 -0
- data/config/preferences/F-Script.json +87 -0
- data/config/preferences/FXScript.json +78 -0
- data/config/preferences/FileMerge.json +3 -0
- data/config/preferences/Fortran.json +158 -0
- data/config/preferences/GTD2.json +11 -0
- data/config/preferences/GTDAlt.json +20 -0
- data/config/preferences/GetBundle.json +3 -0
- data/config/preferences/Gettext.json +24 -0
- data/config/preferences/Graphviz.json +42 -0
- data/config/preferences/Greasemonkey.json +3 -0
- data/config/preferences/Gri.json +34 -0
- data/config/preferences/HTML.json +492 -0
- data/config/preferences/Haskell.json +72 -0
- data/config/preferences/Hotkey.json +3 -0
- data/config/preferences/ImageBrowser.json +3 -0
- data/config/preferences/Inform.json +3 -0
- data/config/preferences/Ini.json +60 -0
- data/config/preferences/Installer.json +3 -0
- data/config/preferences/Io.json +64 -0
- data/config/preferences/JSON.json +3 -0
- data/config/preferences/Java.json +86 -0
- data/config/preferences/JavaDoc.json +3 -0
- data/config/preferences/JavaScript.json +76 -0
- data/config/preferences/LaTeX.json +267 -0
- data/config/preferences/Lex/Flex.json +3 -0
- data/config/preferences/Lighttpd.json +3 -0
- data/config/preferences/LilyPond.json +77 -0
- data/config/preferences/Lisp.json +63 -0
- data/config/preferences/Logo.json +58 -0
- data/config/preferences/Logtalk.json +236 -0
- data/config/preferences/Lua.json +24 -0
- data/config/preferences/MEL.json +19 -0
- data/config/preferences/MIPS Assembler.json +26 -0
- data/config/preferences/MacPorts.json +3 -0
- data/config/preferences/Mail.json +3 -0
- data/config/preferences/Make.json +16 -0
- data/config/preferences/Markdown.json +102 -0
- data/config/preferences/Math.json +3 -0
- data/config/preferences/Matlab.json +128 -0
- data/config/preferences/Maven.json +308 -0
- data/config/preferences/Mediawiki.json +73 -0
- data/config/preferences/Mercurial.json +3 -0
- data/config/preferences/Modula.json +37 -0
- data/config/preferences/MoinMoin.json +52 -0
- data/config/preferences/Navigation.json +3 -0
- data/config/preferences/Nemerle.json +3 -0
- data/config/preferences/OCaml Code Completion.json +3 -0
- data/config/preferences/OCaml.json +163 -0
- data/config/preferences/ODCompletion.json +3 -0
- data/config/preferences/Objective-C.json +84 -0
- data/config/preferences/OpenGL.json +3331 -0
- data/config/preferences/Outlines.json +3 -0
- data/config/preferences/Pascal.json +60 -0
- data/config/preferences/Perforce.json +3 -0
- data/config/preferences/Perl.json +15 -0
- data/config/preferences/PmWiki.json +27 -0
- data/config/preferences/Postscript.json +15 -0
- data/config/preferences/Processing.json +32 -0
- data/config/preferences/Prolog.json +3 -0
- data/config/preferences/Propel.json +3 -0
- data/config/preferences/Python.json +38 -0
- data/config/preferences/Quake.json +15 -0
- data/config/preferences/R.json +33 -0
- data/config/preferences/Ragel.json +15 -0
- data/config/preferences/Regular Expressions.json +3 -0
- data/config/preferences/Remind.json +15 -0
- data/config/preferences/Rez.json +46 -0
- data/config/preferences/Ruby.json +98 -0
- data/config/preferences/S5 Slide Show.json +20 -0
- data/config/preferences/SCons.json +3 -0
- data/config/preferences/SQL.json +32 -0
- data/config/preferences/SSH Config.json +15 -0
- data/config/preferences/SVK.json +3 -0
- data/config/preferences/SWIG.json +3 -0
- data/config/preferences/SWeave.json +32 -0
- data/config/preferences/Scheme.json +35 -0
- data/config/preferences/Scilab.json +15 -0
- data/config/preferences/Setext.json +3 -0
- data/config/preferences/Shell Script.json +25 -0
- data/config/preferences/Slate.json +113 -0
- data/config/preferences/Source.json +132 -0
- data/config/preferences/Subversion.json +10 -0
- data/config/preferences/TODO.json +3 -0
- data/config/preferences/Tabular.json +3 -0
- data/config/preferences/Tcl.json +82 -0
- data/config/preferences/TerminalMate.json +112 -0
- data/config/preferences/Text.json +89 -0
- data/config/preferences/TextMate.json +38 -0
- data/config/preferences/Textile.json +76 -0
- data/config/preferences/Thrift.json +56 -0
- data/config/preferences/Transmit.json +3 -0
- data/config/preferences/Twiki.json +51 -0
- data/config/preferences/Txt2tags.json +81 -0
- data/config/preferences/Vectorscript.json +1280 -0
- data/config/preferences/XML.json +60 -0
- data/config/preferences/Xcode.json +3 -0
- data/config/preferences/YAML.json +24 -0
- data/config/preferences/iCalendar.json +10 -0
- data/config/preferences/iTerm.json +36 -0
- data/config/preferences/reStructuredText.json +48 -0
- data/config/rc.rb +49 -0
- data/config/syntax/ANTLR.json +5 -5
- data/config/syntax/{ASP VB.net.json → ASP vb.NET.json } +3 -3
- data/config/syntax/ASP.json +1 -1
- data/config/syntax/ActionScript.json +6 -6
- data/config/syntax/Active4D Config.json +86 -0
- data/config/syntax/Active4D Library.json +20 -0
- data/config/syntax/Active4D.json +418 -0
- data/config/syntax/Ada.json +3 -3
- data/config/syntax/Ant.json +196 -0
- data/config/syntax/Apache.json +7 -7
- data/config/syntax/AppleScript.json +3 -3
- data/config/syntax/{Bibtex.json → BibTeX.json} +1 -1
- data/config/syntax/Bison.json +59 -0
- data/config/syntax/{Blog (HTML).json → Blog - HTML.json } +2 -2
- data/config/syntax/{Blog (Markdown).json → Blog - Markdown.json } +2 -2
- data/config/syntax/Blog (Text).json b/data/config/syntax/Blog - → Text.json +0 -0
- data/config/syntax/Blog (Textile).json b/data/config/syntax/Blog - → Textile.json +0 -0
- data/config/syntax/C++.json +3 -3
- data/config/syntax/C.json +13 -13
- data/config/syntax/CMake Listfile.json +171 -0
- data/config/syntax/CSS.json +6 -6
- data/config/syntax/CSV.json +108 -0
- data/config/syntax/ColdFusion.json +204 -0
- data/config/syntax/D.json +560 -0
- data/config/syntax/Diff.json +1 -1
- data/config/syntax/DokuWiki.json +412 -0
- data/config/syntax/Doxygen.json +80 -0
- data/config/syntax/Dylan.json +4 -4
- data/config/syntax/Erlang.json +5 -5
- data/config/syntax/F-Script.json +1 -1
- data/config/syntax/FXScript.json +5 -5
- data/config/syntax/Fortran - Modern.json +221 -0
- data/config/syntax/Fortran - Punchcard.json +468 -0
- data/config/syntax/GTD.json +39 -0
- data/config/syntax/GTDalt.json +233 -0
- data/config/syntax/Gettext.json +118 -0
- data/config/syntax/Go.json +555 -0
- data/config/syntax/{DOT.json → Graphviz (DOT).json } +3 -3
- data/config/syntax/Greasemonkey.json +56 -0
- data/config/syntax/Gri.json +4 -4
- data/config/syntax/{HTML-ASP.json → HTML (ASP).json } +1 -1
- data/config/syntax/{HTML for ASP.net.json → HTML (ASP.net).json } +19 -19
- data/config/syntax/HTML (Active4D).json +540 -0
- data/config/syntax/HTML (Erlang).json +31 -0
- data/config/syntax/HTML (Tcl).json +1 -1
- data/config/syntax/HTML.json +20 -20
- data/config/syntax/Haskell.json +3 -3
- data/config/syntax/Installer Distribution Script.json +135 -0
- data/config/syntax/Io.json +6 -6
- data/config/syntax/JSON.json +151 -0
- data/config/syntax/{JavaProperties.json → Java Properties.json } +2 -2
- data/config/syntax/Java Server Page (JSP).json +163 -0
- data/config/syntax/Java.json +7 -7
- data/config/syntax/JavaDoc.json +435 -0
- data/config/syntax/JavaScript.json +8 -8
- data/config/syntax/LaTeX Log.json +3 -3
- data/config/syntax/LaTeX Memoir.json +101 -0
- data/config/syntax/LaTeX.json +2 -2
- data/config/syntax/Lex-Flex.json +396 -0
- data/config/syntax/LilyPond.json +608 -0
- data/config/syntax/Logo.json +48 -0
- data/config/syntax/Logtalk.json +6 -6
- data/config/syntax/Lua.json +1 -1
- data/config/syntax/{M.json → MATLAB.json} +3 -3
- data/config/syntax/MEL.json +7 -7
- data/config/syntax/MIPS.json b/data/config/syntax/MIPS → Assembler.json +0 -0
- data/config/syntax/MacPorts Portfile.json +298 -0
- data/config/syntax/Mail.json +1 -1
- data/config/syntax/Markdown.json +6 -6
- data/config/syntax/Maven POM.json +774 -0
- data/config/syntax/Mediawiki.json +736 -0
- data/config/syntax/MoinMoin.json +335 -0
- data/config/syntax/MultiMarkdown.json +41 -0
- data/config/syntax/Nemerle.json +128 -0
- data/config/syntax/OCaml.json +4 -4
- data/config/syntax/OCamllex.json +307 -0
- data/config/syntax/OCamlyacc.json +346 -0
- data/config/syntax/Objective-C++.json +2 -2
- data/config/syntax/Objective-C.json +979 -0
- data/config/syntax/Octave.json +417 -0
- data/config/syntax/PHP.json +32 -32
- data/config/syntax/Pascal.json +1 -1
- data/config/syntax/Perl.json +8 -8
- data/config/syntax/{Plain text.json → Plain Text.json } +1 -1
- data/config/syntax/PmWiki.json +241 -0
- data/config/syntax/Postscript.json +206 -0
- data/config/syntax/Processing.json +8 -8
- data/config/syntax/Prolog.json +70 -0
- data/config/syntax/Python.json +1934 -0
- data/config/syntax/{Quake3 Config.json → Quake Style .cfg.json } +1 -1
- data/config/syntax/R.json +2 -2
- data/config/syntax/Ragel.json +362 -0
- data/config/syntax/Rd (R Documentation).json +119 -0
- data/config/syntax/Regular Expressions (Oniguruma).json +186 -0
- data/config/syntax/Regular Expressions (Python).json +188 -0
- data/config/syntax/Release Notes.json +78 -0
- data/config/syntax/Remind.json +461 -0
- data/config/syntax/Rez.json +5 -5
- data/config/syntax/Ruby Sass.json +497 -0
- data/config/syntax/Ruby.json +13 -13
- data/config/syntax/S5 Slide Show.json +85 -0
- data/config/syntax/SQL.json +11 -11
- data/config/syntax/SSH Config.json +55 -0
- data/config/syntax/SWIG.json +2 -2
- data/config/syntax/SWeave.json +139 -0
- data/config/syntax/Scheme.json +8 -8
- data/config/syntax/Scilab.json +69 -0
- data/config/syntax/Setext.json +247 -0
- data/config/syntax/{Shell-Unix-Generic.json → Shell Script (Bash).json } +4 -4
- data/config/syntax/Slate.json +5 -5
- data/config/syntax/Strings File.json +53 -0
- data/config/syntax/TSV.json +83 -0
- data/config/syntax/Tcl.json +1 -1
- data/config/syntax/TeX Math.json +2 -2
- data/config/syntax/TeX.json +2 -2
- data/config/syntax/Textile.json +9 -9
- data/config/syntax/Thrift.json +641 -0
- data/config/syntax/Twiki.json +1 -1
- data/config/syntax/Txt2tags.json +154 -0
- data/config/syntax/XML strict.json +4 -4
- data/config/syntax/XML.json +6 -6
- data/config/syntax/XSL.json +2 -2
- data/config/syntax/camlp4.json +63 -0
- data/config/syntax/mod_perl.json +72 -0
- data/config/syntax/reStructuredText.json +1 -1
- data/config/syntax/{Subversion commit message.json → svn-commit.tmp.json} +0 -0
- data/config/tutorial +23 -19
- data/config/welcome +3 -3
- data/lib/ver.rb +273 -62
- data/lib/ver/entry.rb +142 -26
- data/lib/ver/font.rb +51 -0
- data/lib/ver/help.rb +16 -0
- data/lib/ver/help/describe_key.rb +82 -0
- data/lib/ver/help/help_for_help.rb +39 -0
- data/lib/ver/hover_completion.rb +129 -0
- data/lib/ver/keymap.rb +95 -24
- data/lib/ver/layout.rb +107 -43
- data/lib/ver/methods.rb +24 -8
- data/lib/ver/methods/clipboard.rb +91 -0
- data/lib/ver/methods/completion.rb +146 -71
- data/lib/ver/methods/control.rb +203 -222
- data/lib/ver/methods/ctags.rb +55 -0
- data/lib/ver/methods/delete.rb +30 -0
- data/lib/ver/methods/help.rb +7 -0
- data/lib/ver/methods/insert.rb +233 -1
- data/lib/ver/methods/move.rb +181 -32
- data/lib/ver/methods/open.rb +208 -0
- data/lib/ver/methods/preview.rb +14 -0
- data/lib/ver/methods/save.rb +111 -0
- data/lib/ver/methods/search.rb +57 -7
- data/lib/ver/methods/select.rb +97 -17
- data/lib/ver/methods/shortcuts.rb +21 -0
- data/lib/ver/methods/views.rb +56 -1
- data/lib/ver/mode.rb +60 -14
- data/lib/ver/status.rb +97 -19
- data/lib/ver/syntax.rb +14 -6
- data/lib/ver/syntax/detector.rb +16 -5
- data/lib/ver/syntax/processor.rb +9 -3
- data/lib/ver/text.rb +258 -199
- data/lib/ver/text/index.rb +103 -0
- data/lib/ver/theme.rb +27 -16
- data/lib/ver/tooltip.rb +59 -0
- data/lib/ver/vendor/binary_search.rb +61 -0
- data/lib/ver/vendor/levenshtein.rb +57 -0
- data/lib/ver/{textpow.rb → vendor/textpow.rb} +31 -29
- data/lib/ver/view.rb +65 -41
- data/lib/ver/view/console.rb +171 -0
- data/lib/ver/view/entry.rb +9 -5
- data/lib/ver/view/list.rb +44 -29
- data/lib/ver/view/list/ex.rb +71 -0
- data/lib/ver/view/list/grep.rb +42 -0
- data/lib/ver/view/list/methods.rb +159 -0
- data/lib/ver/view/term.rb +249 -0
- data/tasks/syntax_list.rake +3 -2
- data/ver.gemspec +4 -4
- metadata +230 -28
- data/config/syntax/Bulletin Board.json +0 -428
- data/config/syntax/HTML (Mason).json +0 -207
- data/config/syntax/HTML (Rails).json +0 -52
- data/config/syntax/Movable Type.json +0 -348
- data/config/syntax/Ruby on Rails.json +0 -170
- data/config/syntax/SQL (Rails).json +0 -31
- data/config/syntax/Smarty.json +0 -110
- data/config/syntax/Standard ML.json +0 -322
data/bin/ver
CHANGED
@@ -1,19 +1,103 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
require 'pathname'
|
4
|
+
require 'optparse'
|
5
|
+
|
6
|
+
# annoying fixes
|
7
|
+
class Pathname
|
8
|
+
alias / join
|
9
|
+
|
10
|
+
def cp(dest)
|
11
|
+
FileUtils.copy_file(expand_path.to_s, dest.to_s, preserve = true)
|
12
|
+
end
|
13
|
+
|
14
|
+
def =~(regexp)
|
15
|
+
to_s =~ regexp
|
16
|
+
end
|
7
17
|
end
|
8
18
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
19
|
+
module VER
|
20
|
+
file = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
|
21
|
+
ROOT = File.expand_path('../../lib', file).encode(Encoding::UTF_8)
|
22
|
+
|
23
|
+
module_function
|
24
|
+
|
25
|
+
def require_and_run(options = {})
|
26
|
+
# TODO: remove before release
|
27
|
+
$LOAD_PATH.unshift(ROOT)
|
28
|
+
|
29
|
+
if options[:fork]
|
30
|
+
fork do
|
31
|
+
trap(:HUP){ 'terminal disconnected' }
|
32
|
+
require 'ver'
|
33
|
+
run(options)
|
34
|
+
end
|
35
|
+
else
|
36
|
+
require 'ver'
|
37
|
+
run(options)
|
17
38
|
end
|
18
39
|
end
|
40
|
+
|
41
|
+
def install_tm_bundle(path)
|
42
|
+
require File.join(ROOT, 'ver/plist')
|
43
|
+
require 'json'
|
44
|
+
require 'fileutils'
|
45
|
+
|
46
|
+
glob = File.expand_path('Syntaxes/*.{plist,tmLanguage}', path)
|
47
|
+
|
48
|
+
Dir.glob(glob, File::FNM_CASEFOLD) do |syntax|
|
49
|
+
plist = VER::Plist.parse_xml(syntax)
|
50
|
+
name = plist['name'].to_s.gsub(/[\/\u2014]/, '-')
|
51
|
+
puts "Installing #{name}"
|
52
|
+
target = File.expand_path("../config/syntax/#{name}.json", ROOT)
|
53
|
+
json = JSON.pretty_unparse(plist)
|
54
|
+
json.gsub!(/\\x\{(\h+)\}/, '\\\\x\1')
|
55
|
+
|
56
|
+
FileUtils.mkdir_p(File.dirname(target))
|
57
|
+
File.open(target, 'w+'){|io| io.write(json) }
|
58
|
+
end
|
59
|
+
|
60
|
+
info = Plist.parse_xml(File.join(path, 'info.plist'))
|
61
|
+
info_name = info['name']
|
62
|
+
|
63
|
+
glob = File.expand_path('Preferences/*.{plist,tmPreferences}', path)
|
64
|
+
preferences = {}
|
65
|
+
|
66
|
+
Dir.glob(glob, File::FNM_CASEFOLD) do |preference|
|
67
|
+
plist = Plist.parse_xml(preference)
|
68
|
+
name = plist['name'].to_s.gsub(/[\/\u2014]/, '-')
|
69
|
+
puts "Adding #{name}"
|
70
|
+
preferences[plist['uuid']] = plist
|
71
|
+
end
|
72
|
+
|
73
|
+
pref = File.expand_path("../config/preferences/#{info_name}.json", ROOT)
|
74
|
+
pref.gsub!(/[\/\u2014]/, '-')
|
75
|
+
FileUtils.mkdir_p(File.dirname(pref))
|
76
|
+
json = JSON.pretty_unparse(preferences)
|
77
|
+
puts "Writing to #{pref}"
|
78
|
+
File.open(pref, 'w+'){|io| io.write(json) }
|
79
|
+
|
80
|
+
exit
|
81
|
+
end
|
19
82
|
end
|
83
|
+
|
84
|
+
options = { fork: true }
|
85
|
+
|
86
|
+
op = OptionParser.new{|o|
|
87
|
+
o.on('-Eex[:in]', '--encoding EXTERNAL[:INTERNAL]', 'used encoding'){|enc|
|
88
|
+
options[:encoding] = enc }
|
89
|
+
o.on('--font-family NAME', 'font family'){|fn| options[:font_family] = fn }
|
90
|
+
o.on('--font-size INT', 'font size'){|fs| options[:font_size] = fs }
|
91
|
+
o.on('-f', '--nofork', 'stay attached to terminal'){ options[:fork] = false }
|
92
|
+
o.on('-k', '--keymap NAME', 'vim or emacs'){|k| options[:keymap] = k }
|
93
|
+
o.separator ' '
|
94
|
+
o.on('--install-tm-bundle PATH',
|
95
|
+
'Install textmate bundle for use with VER',
|
96
|
+
&VER.method(:install_tm_bundle))
|
97
|
+
o.separator ' '
|
98
|
+
o.on('-h', '--help', 'Show this help'){ puts o; exit }
|
99
|
+
o.on('--debug', 'turn $DEBUG on'){ $DEBUG = true }
|
100
|
+
}
|
101
|
+
op.parse!(ARGV)
|
102
|
+
|
103
|
+
VER.require_and_run(options)
|
data/config/detect.rb
CHANGED
@@ -5,26 +5,34 @@ module VER::Syntax::Detector
|
|
5
5
|
exts "ASP vb.NET", ["vb"]
|
6
6
|
exts "ASP", ["asa"]
|
7
7
|
exts "ActionScript", ["as"]
|
8
|
+
exts "Active4D Config", ["ini"]
|
9
|
+
exts "Active4D Library", ["a4l"]
|
8
10
|
exts "Ada", ["adb", "ads"]
|
11
|
+
exts "Ant", ["ant.xml", "build.xml"]
|
12
|
+
head "Ant", /<\!--\s*ant\s*-->/
|
9
13
|
exts "Apache", ["conf", "htaccess"]
|
10
14
|
exts "AppleScript", ["applescript", "script editor"]
|
11
15
|
head "AppleScript", /^#!.*(osascript)/
|
12
16
|
exts "BibTeX", ["bib"]
|
13
|
-
exts "
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
exts "Bison", ["y"]
|
18
|
+
exts "Blog - HTML", ["blog.html"]
|
19
|
+
head "Blog - HTML", /^Type: Blog Post \(HTML\)/
|
20
|
+
exts "Blog - Markdown", ["blog.markdown", "blog.mdown", "blog.mkdn", "blog.md"]
|
21
|
+
head "Blog - Markdown", /^Type: Blog Post \(Markdown\)/
|
22
|
+
exts "Blog - Text", ["blog.txt"]
|
23
|
+
head "Blog - Text", /^Type: Blog Post \(Text\)/
|
24
|
+
exts "Blog - Textile", ["blog.textile"]
|
25
|
+
head "Blog - Textile", /^Type: Blog Post \(Textile\)/
|
22
26
|
exts "C++", ["cc", "cpp", "cp", "cxx", "c++", "C", "h", "hh", "hpp", "h++"]
|
23
27
|
head "C++", /-\*- C\+\+ -\*-/
|
24
28
|
exts "C", ["c", "h"]
|
25
29
|
head "C", /-[*]-( Mode:)? C -[*]-/
|
30
|
+
exts "CMake Listfile", ["CMakeLists.txt", "cmake"]
|
26
31
|
exts "CSS", ["css", "css.erb"]
|
27
|
-
exts "
|
32
|
+
exts "CSV", ["csv"]
|
33
|
+
exts "ColdFusion", ["cfm", "cfml", "cfc"]
|
34
|
+
exts "D", ["d", "di"]
|
35
|
+
head "D", /^#!.*\bg?dmd\b./
|
28
36
|
exts "Diff", ["diff", "patch"]
|
29
37
|
head "Diff", /(?x)^
|
30
38
|
(===\ modified\ file
|
@@ -35,75 +43,119 @@ module VER::Syntax::Detector
|
|
35
43
|
|\d+(,\d+)* (a|d|c) \d+(,\d+)* $
|
36
44
|
|diff\ --git\
|
37
45
|
)/
|
46
|
+
head "DokuWiki", /^\s*={2,}(.*)={2,}\s*$/
|
47
|
+
exts "Doxygen", ["doxygen"]
|
38
48
|
exts "Dylan", ["dylan"]
|
39
49
|
exts "Eiffel", ["e"]
|
40
50
|
exts "Erlang", ["erl", "hrl"]
|
41
51
|
exts "F-Script", ["fscript"]
|
42
52
|
exts "FXScript", ["fxscript"]
|
53
|
+
exts "Fortran - Modern", ["f90", "F90", "f95", "F95", "f03", "F03", "f08", "F08"]
|
54
|
+
head "Fortran - Modern", /(?i)-[*]- mode: f90 -[*]-/
|
55
|
+
exts "Fortran - Punchcard", ["f", "F", "f77", "F77", "for", "FOR", "fpp", "FPP"]
|
56
|
+
exts "GTD", ["gtd"]
|
57
|
+
exts "GTDalt", ["gtd", "gtdlog"]
|
58
|
+
exts "Gettext", ["po", "potx"]
|
59
|
+
exts "Go", ["go"]
|
60
|
+
exts "Graphviz (DOT)", ["dot", "DOT"]
|
61
|
+
exts "Greasemonkey", ["user.js"]
|
62
|
+
head "Greasemonkey", /\/\/ ==UserScript==/
|
43
63
|
exts "Gri", ["gri"]
|
44
64
|
head "Gri", /-[*]-( Mode:)? Gri -[*]-/
|
45
|
-
exts "HTML (Mason)", ["mhtml", "autohandler", "dhandler", "md", "mc"]
|
46
|
-
exts "HTML (Rails)", ["rhtml", "erb", "html.erb"]
|
47
|
-
exts "HTML (Tcl)", ["tcl", "adp", "inc"]
|
48
|
-
exts "HTML (ASP.net)", ["aspx", "ascx"]
|
49
65
|
exts "HTML (ASP)", ["asp"]
|
66
|
+
exts "HTML (ASP.net)", ["aspx", "ascx"]
|
67
|
+
exts "HTML (Active4D)", ["a4d", "a4p"]
|
68
|
+
exts "HTML (Erlang)", ["yaws"]
|
69
|
+
exts "HTML (Tcl)", ["tcl", "adp", "inc"]
|
50
70
|
exts "HTML", ["html", "htm", "shtml", "xhtml", "phtml", "php", "inc", "tmpl", "tpl", "ctp"]
|
51
71
|
head "HTML", /<!DOCTYPE|<(?i:html)|<\?(?i:php)/
|
52
72
|
exts "Haskell", ["hs"]
|
53
73
|
exts "Inform", ["inf"]
|
54
74
|
exts "Ini", ["ini", "conf"]
|
75
|
+
exts "Installer Distribution Script", ["dist"]
|
55
76
|
exts "Io", ["io"]
|
56
|
-
exts "
|
77
|
+
exts "JSON", ["json"]
|
57
78
|
exts "Java Properties", ["properties"]
|
79
|
+
exts "Java Server Page (JSP)", ["jsp"]
|
80
|
+
exts "Java", ["java", "bsh"]
|
58
81
|
exts "JavaScript", ["js", "htc", "jsx"]
|
59
82
|
head "LaTeX Beamer", /^\\documentclass(\[.*\])?\{beamer\}/
|
60
83
|
head "LaTeX Log", /This is (pdf|pdfe)?TeXk?, Version/
|
84
|
+
head "LaTeX Memoir", /^\\documentclass(\[.*\])?\{memoir\}/
|
61
85
|
exts "LaTeX", ["tex"]
|
62
86
|
head "LaTeX", /^\\documentclass(?!.*\{beamer\})/
|
87
|
+
exts "Lex-Flex", ["l"]
|
88
|
+
exts "LilyPond", ["ly", "lily", "ily"]
|
63
89
|
exts "Lisp", ["lisp", "cl", "l", "mud", "el"]
|
64
90
|
exts "Literate Haskell", ["lhs"]
|
65
91
|
exts "Logtalk", ["lgt", "config"]
|
66
92
|
exts "Lua", ["lua"]
|
67
93
|
exts "MEL", ["as"]
|
68
94
|
exts "MIPS Assembler", ["s", "mips", "spim", "asm"]
|
95
|
+
exts "MacPorts Portfile", ["Portfile"]
|
69
96
|
exts "Mail", ["mail"]
|
70
97
|
head "Mail", /^From: .*(?=\w+@[\w-]+\.\w+)/
|
71
98
|
exts "Makefile", ["GNUmakefile", "makefile", "Makefile", "OCamlMakefile"]
|
72
99
|
exts "Markdown", ["mdown", "markdown", "markdn", "md"]
|
100
|
+
exts "Maven POM", ["pom.xml"]
|
101
|
+
exts "Mediawiki", ["mediawiki", "wikipedia", "wiki"]
|
73
102
|
exts "Modula-3", ["m3", "cm3"]
|
74
|
-
exts "
|
75
|
-
head "
|
103
|
+
exts "MoinMoin", ["moinmoin"]
|
104
|
+
head "MultiMarkdown", /^Format:\s*(?i:complete)\s*$/
|
105
|
+
exts "Nemerle", ["n"]
|
76
106
|
exts "OCaml", ["ml", "mli"]
|
107
|
+
exts "OCamllex", ["mll"]
|
108
|
+
exts "OCamlyacc", ["mly"]
|
77
109
|
exts "Objective-C++", ["mm", "M", "h"]
|
110
|
+
exts "Objective-C", ["m", "h"]
|
78
111
|
head "PHP", /^#!.*(?<!-)php[0-9]{0,1}\b/
|
79
112
|
exts "Pascal", ["pas", "p"]
|
80
113
|
exts "Perl", ["pl", "pm", "pod", "t", "PL"]
|
81
114
|
head "Perl", /^#!.*\bperl\b/
|
82
115
|
exts "Plain Text", ["txt"]
|
116
|
+
exts "PmWiki", ["pmwiki"]
|
117
|
+
exts "Postscript", ["ps", "eps"]
|
118
|
+
head "Postscript", /^%!PS/
|
83
119
|
exts "Processing", ["pde"]
|
120
|
+
exts "Python", ["py", "rpy", "pyw", "cpy", "SConstruct", "Sconstruct", "sconstruct", "SConscript"]
|
121
|
+
head "Python", /^#!\/.*\bpython\b/
|
84
122
|
exts "Quake Style .cfg", ["cfg"]
|
85
123
|
exts "R", ["R", "r", "s", "S", "Rprofile"]
|
124
|
+
exts "Ragel", ["rl", "ragel"]
|
125
|
+
exts "Rd (R Documentation)", ["rd", "Rd"]
|
126
|
+
exts "Regular Expressions (Oniguruma)", ["re"]
|
127
|
+
exts "Regular Expressions (Python)", ["re"]
|
128
|
+
exts "Release Notes", ["tmReleaseNotes"]
|
129
|
+
exts "Remind", ["defs.rem", "REM*.txt", ".reminders"]
|
130
|
+
head "Remind", /^REM*/
|
86
131
|
exts "Rez", ["r"]
|
87
|
-
exts "Ruby on Rails", ["rxml", "builder"]
|
88
132
|
exts "Ruby", ["rb", "rbx", "rjs", "Rakefile", "rake", "cgi", "fcgi", "gemspec", "irbrc", "capfile"]
|
89
133
|
head "Ruby", /^#!\/.*\bruby\b/
|
90
|
-
exts "
|
134
|
+
exts "S5 Slide Show", ["s5"]
|
91
135
|
exts "SQL", ["sql", "ddl", "dml"]
|
136
|
+
exts "SSH Config", ["ssh_config", ".ssh/config", "sshd_config"]
|
92
137
|
exts "SWIG", ["i", "swg"]
|
138
|
+
exts "SWeave", ["Snw", "Rnw", "snw", "rnw"]
|
93
139
|
exts "Scheme", ["scm", "sch"]
|
140
|
+
exts "Scilab", ["sce", "sci", "tst", "dem"]
|
141
|
+
exts "Setext", ["etx", "etx.txt"]
|
142
|
+
head "Setext", /setext/
|
94
143
|
exts "Shell Script (Bash)", ["sh", "ss", "bashrc", "bash_profile", "bash_login", "profile", "bash_logout", ".textmate_init"]
|
95
144
|
head "Shell Script (Bash)", /^#!.*(bash|zsh|sh|tcsh)/
|
96
145
|
exts "Slate", ["slate"]
|
97
|
-
exts "
|
98
|
-
exts "
|
146
|
+
exts "Strings File", ["strings"]
|
147
|
+
exts "TSV", ["tsv"]
|
99
148
|
exts "Tcl", ["tcl"]
|
100
149
|
exts "TeX", ["sty", "cls"]
|
101
150
|
exts "Textile", ["textile"]
|
102
151
|
head "Textile", /textile/
|
152
|
+
exts "Thrift", ["thrift"]
|
153
|
+
exts "Txt2tags", ["t2t"]
|
103
154
|
exts "Vectorscript", ["vss"]
|
104
155
|
exts "XML", ["xml", "tld", "jsp", "pt", "cpt", "dtml", "rss", "opml"]
|
105
156
|
exts "XSL", ["xsl", "xslt"]
|
106
157
|
exts "YAML", ["yaml", "yml"]
|
107
158
|
exts "iCalendar", ["ics", "ifb"]
|
108
159
|
exts "reStructuredText", ["rst", "rest"]
|
160
|
+
exts "svn-commit.tmp", ["svn-commit.tmp", "svn-commit.2.tmp"]
|
109
161
|
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
module VER
|
2
|
+
class Keymap
|
3
|
+
def self.emacs(options)
|
4
|
+
emacs = new(options)
|
5
|
+
emacs.mode = options.fetch(:mode, :basic)
|
6
|
+
|
7
|
+
emacs.add_mode :quirks do |mode|
|
8
|
+
mode.arguments = false
|
9
|
+
|
10
|
+
# TODO
|
11
|
+
mode.map :universal_argument, %w[Control-u]
|
12
|
+
mode.map :keyboard_quit, %w[Control-g]
|
13
|
+
end
|
14
|
+
|
15
|
+
emacs.add_mode :basic do |mode|
|
16
|
+
mode.inherits :quirks
|
17
|
+
mode.arguments = false
|
18
|
+
mode.missing :insert_string
|
19
|
+
|
20
|
+
mode.map :quit, %w[Control-x Control-c]
|
21
|
+
mode.map :go_page_down, %w[Control-v], %w[Next]
|
22
|
+
mode.map :go_page_up, %w[Alt-v], %w[Prior]
|
23
|
+
mode.map :go_line_up, %w[Control-p], %w[Up]
|
24
|
+
mode.map :go_line_down, %w[Control-n], %w[Down]
|
25
|
+
mode.map :go_char_left, %w[Control-b], %w[Left]
|
26
|
+
mode.map :go_char_right, %w[Control-f], %w[Right]
|
27
|
+
mode.map :go_word_left, %w[Alt-b]
|
28
|
+
mode.map :go_word_right, %w[Alt-f]
|
29
|
+
mode.map :go_beginning_of_line, %w[Control-a]
|
30
|
+
mode.map :go_end_of_line, %w[Control-e]
|
31
|
+
mode.map :go_line, %w[Control-less]
|
32
|
+
mode.map :go_end_of_file, %w[Control-greater]
|
33
|
+
mode.map :undo, %w[Control-slash], %w[Undo]
|
34
|
+
mode.map :redo, %w[Redo]
|
35
|
+
mode.map :join_lines, %w[Control-j]
|
36
|
+
mode.map :insert_newline, %w[Return]
|
37
|
+
mode.map :delete_char_left, %w[BackSpace]
|
38
|
+
mode.map :delete_char_right, %w[Control-d], %w[Delete]
|
39
|
+
mode.map :delete_to_eol, %w[Control-k]
|
40
|
+
mode.map :delete_sentence, %w[Alt-k]
|
41
|
+
mode.map :delete_word_right, %w[Alt-d]
|
42
|
+
mode.map :delete_word_left, %w[Alt-BackSpace]
|
43
|
+
|
44
|
+
# HACK, this probably shouldn't switch modes.
|
45
|
+
mode.map [:start_selection, :block], %w[Control-space]
|
46
|
+
|
47
|
+
KEYSYMS.each do |sym, name|
|
48
|
+
mode.map [:insert_string, sym], [name]
|
49
|
+
end
|
50
|
+
|
51
|
+
# TODO
|
52
|
+
mode.map :recenter_top_bottom, %w[Control-l]
|
53
|
+
mode.map :go_beginning_of_sentence, %w[Alt-a]
|
54
|
+
mode.map :go_end_of_sentence, %w[Alt-e]
|
55
|
+
mode.map :kill_region, %w[Control-w]
|
56
|
+
|
57
|
+
mode.map :describe_key_briefly, %w[Control-h c]
|
58
|
+
mode.map :describe_key, %w[Control-h k]
|
59
|
+
mode.map :describe_function, %w[Control-h f]
|
60
|
+
mode.map :apropos_command, %w[Control-h a]
|
61
|
+
end
|
62
|
+
|
63
|
+
emacs
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
data/config/keymap/vim.rb
CHANGED
@@ -12,33 +12,55 @@ module VER
|
|
12
12
|
mode.map :file_save_popup, %w[Control-Alt-s]
|
13
13
|
mode.map :quit, %w[Control-q]
|
14
14
|
mode.map :start_control_mode, %w[Escape], %w[Control-c]
|
15
|
+
mode.map :open_method_list, %w[F10]
|
16
|
+
mode.map :open_terminal, %w[F9]
|
17
|
+
mode.map :open_grep_list, %w[Alt-g], %w[Control-m g]
|
18
|
+
mode.map :describe_key, %w[Control-h k]
|
19
|
+
mode.map :help_for_help, %w[Control-h question], %w[F1], %w[Help]
|
20
|
+
mode.map :tags_at, %w[Control-g t]
|
15
21
|
|
16
22
|
mode.map :buffer_switch, %w[Alt-b], %w[Control-m b]
|
17
23
|
mode.map :window_switch, %w[Alt-B], %w[Control-m B]
|
24
|
+
mode.map :open_console, %w[Control-exclam]
|
18
25
|
end
|
19
26
|
|
20
27
|
vim.add_mode :views do |mode|
|
21
|
-
mode.map :
|
22
|
-
mode.map :
|
23
|
-
|
24
|
-
mode.map :
|
28
|
+
mode.map :view_one, %w[Control-w KeyPress-1]
|
29
|
+
mode.map :view_two, %w[Control-w KeyPress-2]
|
30
|
+
|
31
|
+
mode.map :view_slave_inc, %w[Control-w plus]
|
32
|
+
mode.map :view_slave_dec, %w[Control-w minus]
|
33
|
+
|
34
|
+
mode.map :view_master_inc, %w[Control-w H]
|
35
|
+
mode.map :view_master_dec, %w[Control-w L]
|
36
|
+
|
37
|
+
mode.map :view_create, %w[Control-w c]
|
38
|
+
mode.map :view_focus_next, %w[Control-w j]
|
39
|
+
mode.map :view_focus_prev, %w[Control-w k]
|
40
|
+
mode.map :view_push_down, %w[Control-w J]
|
41
|
+
mode.map :view_push_up, %w[Control-w K]
|
42
|
+
mode.map :view_close, %w[Control-w w]
|
43
|
+
mode.map :view_push_top, %w[Control-w Return]
|
44
|
+
mode.map :view_push_bottom, %w[Control-w BackSpace]
|
25
45
|
end
|
26
46
|
|
27
47
|
vim.add_mode :move do |mode|
|
28
|
-
mode.map :
|
29
|
-
mode.map :
|
30
|
-
mode.map :
|
31
|
-
mode.map :
|
32
|
-
mode.map :
|
33
|
-
mode.map :go_line,
|
34
|
-
mode.map :
|
35
|
-
mode.map :
|
36
|
-
mode.map :
|
37
|
-
mode.map :
|
38
|
-
mode.map :
|
39
|
-
mode.map :
|
40
|
-
mode.map :
|
41
|
-
mode.map :
|
48
|
+
mode.map :beginning_of_line, %w[KeyPress-0], %w[Home]
|
49
|
+
mode.map :backward_char, %w[h], %w[Left]
|
50
|
+
mode.map :forward_char, %w[l], %w[Right]
|
51
|
+
mode.map :end_of_file, %w[G]
|
52
|
+
mode.map :end_of_line, %w[dollar], %w[End]
|
53
|
+
mode.map :go_line, %w[g g]
|
54
|
+
mode.map :next_line, %w[j], %w[Down], %w[Control-n]
|
55
|
+
mode.map :previous_line, %w[k], %w[Up], %w[Control-p]
|
56
|
+
mode.map :next_newline_block, %w[braceleft]
|
57
|
+
mode.map :page_down, %w[Control-f], %w[Next]
|
58
|
+
mode.map :page_up, %w[Control-b], %w[Prior]
|
59
|
+
mode.map :prev_newline_block, %w[braceright]
|
60
|
+
mode.map :backward_word, %w[b], %w[Shift-Left]
|
61
|
+
mode.map :forward_word, %w[w], %w[Shift-Right]
|
62
|
+
mode.map :word_right_end, %w[e]
|
63
|
+
mode.map :matching_brace, %w[percent]
|
42
64
|
end
|
43
65
|
|
44
66
|
vim.add_mode :search do |mode|
|
@@ -46,44 +68,69 @@ module VER
|
|
46
68
|
mode.map :search_next_word_under_cursor, %w[asterisk]
|
47
69
|
mode.map :search_prev, %w[N]
|
48
70
|
mode.map :search_prev_word_under_cursor, %w[numbersign]
|
49
|
-
mode.map :
|
71
|
+
mode.map :status_search_next, %w[slash]
|
72
|
+
mode.map :status_search_prev, %w[question]
|
73
|
+
mode.map :search_char_right, %w[f]
|
74
|
+
mode.map :search_char_left, %w[F]
|
75
|
+
end
|
76
|
+
|
77
|
+
vim.add_mode :ctags do |mode|
|
78
|
+
mode.map :ctags_find_current, %w[Control-bracketright] # C-]
|
79
|
+
end
|
80
|
+
|
81
|
+
vim.add_mode :complete do |mode|
|
82
|
+
mode.arguments = false
|
83
|
+
|
84
|
+
mode.to :complete_file, %w[Control-x Control-f]
|
85
|
+
mode.to :complete_line, %w[Control-x Control-l]
|
86
|
+
mode.to :complete_word, %w[Control-x Control-w]
|
87
|
+
mode.to :complete_aspell, %w[Control-x Control-a]
|
88
|
+
mode.to :complete_tm, %w[Control-x Control-x]
|
89
|
+
mode.to :smart_tab, %w[Tab]
|
50
90
|
end
|
51
91
|
|
52
92
|
vim.add_mode :control do |mode|
|
53
|
-
mode.inherits :basic, :move, :views, :search
|
54
|
-
|
55
|
-
mode.map :copy_left_word,
|
56
|
-
mode.map :copy_line,
|
57
|
-
mode.map :copy_right_word,
|
58
|
-
mode.map :
|
59
|
-
mode.map :
|
60
|
-
mode.map :
|
61
|
-
mode.map :
|
62
|
-
mode.map :
|
63
|
-
mode.map :
|
64
|
-
|
65
|
-
mode.map :
|
66
|
-
mode.map :
|
67
|
-
|
68
|
-
mode.map :
|
69
|
-
mode.map :
|
70
|
-
|
71
|
-
mode.map :
|
72
|
-
mode.map :
|
73
|
-
mode.map :
|
74
|
-
mode.map :
|
75
|
-
mode.map :
|
76
|
-
mode.map :
|
77
|
-
mode.map :
|
78
|
-
mode.map :
|
79
|
-
mode.map :
|
80
|
-
mode.map :
|
81
|
-
mode.map :
|
82
|
-
mode.map :
|
83
|
-
mode.map :
|
84
|
-
mode.map :
|
85
|
-
|
86
|
-
mode.
|
93
|
+
mode.inherits :basic, :move, :views, :search, :ctags
|
94
|
+
|
95
|
+
mode.map :copy_left_word, %w[y b]
|
96
|
+
mode.map :copy_line, %w[y y], %w[Y]
|
97
|
+
mode.map :copy_right_word, %w[y w]
|
98
|
+
mode.map :delete_line, %w[d d]
|
99
|
+
mode.map :change_line, %w[c c]
|
100
|
+
mode.map [:delete_motion, :backward_char], %w[X]
|
101
|
+
mode.map [:delete_motion, :forward_char], %w[x]
|
102
|
+
mode.map [:delete_motion, :end_of_line], %w[D]
|
103
|
+
mode.map [:change_motion, :end_of_line], %w[C]
|
104
|
+
|
105
|
+
mode.map :change_motion, ['c', :move]
|
106
|
+
mode.map :delete_motion, ['d', :move]
|
107
|
+
|
108
|
+
mode.map :eol_then_insert_mode, %w[A]
|
109
|
+
mode.map :forward_char_then_insert_mode, %w[a]
|
110
|
+
|
111
|
+
mode.map :indent_line, %w[greater]
|
112
|
+
mode.map :insert_indented_newline_above, %w[O]
|
113
|
+
mode.map :insert_indented_newline_below, %w[o]
|
114
|
+
mode.map :join_lines, %w[J]
|
115
|
+
mode.map :paste, %w[p]
|
116
|
+
mode.map :redo, %w[Control-r]
|
117
|
+
mode.map :replace_char, %w[r]
|
118
|
+
mode.map :smart_evaluate, %w[Alt-e], %w[Control-m e]
|
119
|
+
mode.map :sol_then_insert_mode, %w[I]
|
120
|
+
mode.map :start_insert_mode, %w[i]
|
121
|
+
mode.map :start_replace_mode, %w[R]
|
122
|
+
mode.map :start_select_block_mode, %w[Control-v]
|
123
|
+
mode.map :start_select_char_mode, %w[v]
|
124
|
+
mode.map :start_select_line_mode, %w[V]
|
125
|
+
mode.map :status_theme_select, %w[Alt-t], %w[Control-m t]
|
126
|
+
mode.map :syntax_switch, %w[Control-y]
|
127
|
+
mode.map :theme_switch, %w[Control-t]
|
128
|
+
mode.map :undo, %w[u]
|
129
|
+
mode.map :unindent_line, %w[less]
|
130
|
+
mode.map :wrap_line, %w[g w]
|
131
|
+
mode.map :preview, %w[F5]
|
132
|
+
mode.map :status_ex, %w[colon]
|
133
|
+
mode.map :syntax_indent_file, %w[equal]
|
87
134
|
end
|
88
135
|
|
89
136
|
vim.add_mode :replace do |mode|
|
@@ -93,76 +140,39 @@ module VER
|
|
93
140
|
vim.add_mode :readline do |mode|
|
94
141
|
mode.arguments = false
|
95
142
|
|
96
|
-
mode.map :
|
97
|
-
mode.map :
|
98
|
-
mode.map :
|
99
|
-
mode.map :
|
100
|
-
mode.map :
|
101
|
-
mode.map :
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
"+" => "plus",
|
116
|
-
"," => "comma",
|
117
|
-
"-" => "minus",
|
118
|
-
"." => "period",
|
119
|
-
"/" => "slash",
|
120
|
-
"0" => "0",
|
121
|
-
"1" => "1",
|
122
|
-
"2" => "2",
|
123
|
-
"3" => "3",
|
124
|
-
"4" => "4",
|
125
|
-
"5" => "5",
|
126
|
-
"6" => "6",
|
127
|
-
"7" => "7",
|
128
|
-
"8" => "8",
|
129
|
-
"9" => "9",
|
130
|
-
":" => "colon",
|
131
|
-
";" => "semicolon",
|
132
|
-
"<" => "less",
|
133
|
-
"=" => "equal",
|
134
|
-
">" => "greater",
|
135
|
-
"?" => "question",
|
136
|
-
"@" => "at",
|
137
|
-
"[" => "bracketleft",
|
138
|
-
"\\" => "backslash",
|
139
|
-
"]" => "bracketright",
|
140
|
-
"^" => "asciicircum",
|
141
|
-
"_" => "underscore",
|
142
|
-
"`" => "quoteleft",
|
143
|
-
"{" => "braceleft",
|
144
|
-
"|" => "bar",
|
145
|
-
"}" => "braceright",
|
146
|
-
"~" => "asciitilde",
|
147
|
-
}.each do |sym, name|
|
143
|
+
mode.map [:delete_motion, :backward_char], %w[BackSpace]
|
144
|
+
mode.map [:delete_motion, :forward_char], %w[Delete], %w[Control-d]
|
145
|
+
mode.map [:delete_motion, :backward_word], %w[Control-w]
|
146
|
+
mode.map :backward_char, %w[Left], %w[Control-b]
|
147
|
+
mode.map :forward_char, %w[Right], %w[Control-f]
|
148
|
+
mode.map :backward_word, %w[Shift-Left], %w[Alt-b]
|
149
|
+
mode.map :forward_word, %w[Shift-Right], %w[Alt-f]
|
150
|
+
mode.map :beginning_of_line, %w[Home], %w[Control-a]
|
151
|
+
mode.map :end_of_line, %w[End], %w[Control-e]
|
152
|
+
mode.map :insert_selection, %w[Shift-Insert]
|
153
|
+
mode.map :accept_line, %w[Return]
|
154
|
+
mode.map :previous_history, %w[Up], %w[Control-p]
|
155
|
+
mode.map :next_history, %w[Down], %w[Control-n]
|
156
|
+
mode.map :beginning_of_history, %w[Control-less]
|
157
|
+
mode.map :end_of_history, %w[Control-greater]
|
158
|
+
mode.map :transpose_chars, %w[Control-t]
|
159
|
+
mode.map :insert_tab, %w[Control-v Tab]
|
160
|
+
|
161
|
+
KEYSYMS.each do |sym, name|
|
148
162
|
mode.map [:insert_string, sym], [name]
|
149
163
|
end
|
150
164
|
end
|
151
165
|
|
152
166
|
vim.add_mode :insert do |mode|
|
153
|
-
mode.inherits :basic, :views, :readline
|
167
|
+
mode.inherits :basic, :views, :complete, :readline
|
154
168
|
mode.arguments = false
|
155
169
|
|
156
|
-
mode.map :
|
157
|
-
mode.map :
|
158
|
-
mode.map :
|
159
|
-
mode.map :
|
160
|
-
mode.map :go_page_up, %w[Control-b], %w[Prior]
|
161
|
-
mode.map :go_page_up, %w[Shift-Up]
|
170
|
+
mode.map :next_line, %w[Down], %w[Control-n]
|
171
|
+
mode.map :previous_line, %w[Up], %w[Control-p]
|
172
|
+
mode.map :page_down, %w[Control-f], %w[Next], %w[Shift-Down]
|
173
|
+
mode.map :page_up, %w[Control-b], %w[Prior], %w[Shift-Up]
|
162
174
|
mode.map :insert_indented_newline, %w[Return]
|
163
175
|
mode.map :smart_evaluate, %w[Alt-e], %w[Control-e]
|
164
|
-
mode.map :complete_aspell, %w[Control-x Control-a]
|
165
|
-
mode.map :complete_file, %w[Control-x Control-f]
|
166
176
|
|
167
177
|
mode.missing :insert_string
|
168
178
|
end
|
@@ -170,17 +180,21 @@ module VER
|
|
170
180
|
vim.add_mode :select do |mode|
|
171
181
|
mode.inherits :basic, :move, :search
|
172
182
|
|
173
|
-
mode.map :copy_selection,
|
174
|
-
mode.map :delete_selection,
|
175
|
-
mode.map :indent_selection,
|
176
|
-
mode.map :pipe_selection,
|
177
|
-
mode.map :smart_evaluate,
|
178
|
-
mode.map :switch_select_block_mode,
|
179
|
-
mode.map :switch_select_char_mode,
|
180
|
-
mode.map :switch_select_line_mode,
|
181
|
-
mode.map :unindent_selection,
|
182
|
-
mode.map :comment_selection,
|
183
|
-
mode.map :uncomment_selection,
|
183
|
+
mode.map :copy_selection, %w[y], %w[Y]
|
184
|
+
mode.map :delete_selection, %w[d], %w[D], %w[x], %w[BackSpace], %w[Delete]
|
185
|
+
mode.map :indent_selection, %w[greater]
|
186
|
+
mode.map :pipe_selection, %w[exclam]
|
187
|
+
mode.map :smart_evaluate, %w[Alt-e], %w[Control-e]
|
188
|
+
mode.map :switch_select_block_mode, %w[Control-v]
|
189
|
+
mode.map :switch_select_char_mode, %w[v]
|
190
|
+
mode.map :switch_select_line_mode, %w[V]
|
191
|
+
mode.map :unindent_selection, %w[less]
|
192
|
+
mode.map :comment_selection, %w[comma c]
|
193
|
+
mode.map :uncomment_selection, %w[comma u]
|
194
|
+
mode.map :wrap_selection, %w[g w]
|
195
|
+
mode.map :selection_replace_char, %w[r]
|
196
|
+
mode.map :selection_replace_string, %w[c]
|
197
|
+
mode.map [:finish_selection, :control], %w[Escape], %w[Control-c]
|
184
198
|
end
|
185
199
|
|
186
200
|
vim.add_mode :select_char do |mode|
|
@@ -195,19 +209,14 @@ module VER
|
|
195
209
|
mode.inherits :select
|
196
210
|
end
|
197
211
|
|
198
|
-
vim.add_mode :complete do |mode|
|
199
|
-
mode.inherits :basic
|
200
|
-
|
201
|
-
mode.to :complete_file, %w[Control-x Control-f]
|
202
|
-
mode.to :complete_line, %w[Control-x Control-l]
|
203
|
-
mode.to :complete_omni, %w[Control-x Control-o]
|
204
|
-
mode.to :complete_word, %w[Control-x Control-i]
|
205
|
-
end
|
206
|
-
|
207
212
|
vim.add_mode :status_query do |mode|
|
208
213
|
mode.inherits :basic, :readline
|
214
|
+
mode.arguments = false
|
209
215
|
|
210
|
-
mode.to :ask_abort,
|
216
|
+
mode.to :ask_abort, %w[Escape], %w[Control-c]
|
217
|
+
mode.to :history_prev, %w[Up], %w[Control-p]
|
218
|
+
mode.to :history_next, %w[Down], %w[Control-n]
|
219
|
+
mode.to :history_complete, %w[Tab]
|
211
220
|
mode.to :ask_submit, %w[Return]
|
212
221
|
|
213
222
|
mode.missing :insert_string
|
@@ -215,12 +224,14 @@ module VER
|
|
215
224
|
|
216
225
|
vim.add_mode :list_view_entry do |mode|
|
217
226
|
mode.inherits :basic, :readline
|
227
|
+
mode.arguments = false
|
218
228
|
|
219
229
|
# mode.to :update, %w[Key]
|
220
230
|
mode.to :pick_selection, %w[Return]
|
221
231
|
mode.to :cancel, %w[Escape], %w[Control-c]
|
222
|
-
mode.to :
|
223
|
-
mode.to :
|
232
|
+
mode.to :line_up, %w[Up]
|
233
|
+
mode.to :line_down, %w[Down]
|
234
|
+
mode.to :completion, %w[Tab]
|
224
235
|
|
225
236
|
mode.missing :insert_string
|
226
237
|
end
|
@@ -228,9 +239,108 @@ module VER
|
|
228
239
|
vim.add_mode :list_view_list do |mode|
|
229
240
|
mode.inherits :basic
|
230
241
|
|
231
|
-
mode.to :pick_selection, %w[Double-Button-1]
|
232
|
-
mode.to :
|
233
|
-
mode.to :
|
242
|
+
mode.to :pick_selection, %w[Return], %w[Double-Button-1]
|
243
|
+
mode.to :line_up, %w[Up]
|
244
|
+
mode.to :line_down, %w[Down]
|
245
|
+
end
|
246
|
+
|
247
|
+
vim.add_mode :hover_completion do |mode|
|
248
|
+
mode.inherits :basic
|
249
|
+
|
250
|
+
mode.to :go_up, %w[Up], %w[k]
|
251
|
+
mode.to :go_down, %w[Down], %w[j]
|
252
|
+
mode.to :continue_completion, %w[Right], %w[l]
|
253
|
+
mode.to :submit, %w[Return]
|
254
|
+
mode.to :cancel, %w[Escape], %w[BackSpace]
|
255
|
+
end
|
256
|
+
|
257
|
+
vim.add_mode :console_entry do |mode|
|
258
|
+
mode.inherits :basic, :readline
|
259
|
+
mode.arguments = false
|
260
|
+
|
261
|
+
# mode.to :execute, %w[Return]
|
262
|
+
# mode.to :cancel, %w[Escape], %w[Control-c]
|
263
|
+
# mode.to :history_up, %w[Up]
|
264
|
+
# mode.to :history_down, %w[Down]
|
265
|
+
|
266
|
+
mode.to :vi_eof_maybe, %w[Control-d]
|
267
|
+
mode.to :emacs_editing_mode, %w[Control-e]
|
268
|
+
mode.to :abort, %w[Control-g]
|
269
|
+
mode.to :backward_char, %w[Control-h]
|
270
|
+
mode.to :accept_line, %w[Control-j], %w[Control-m]
|
271
|
+
mode.to :kill_line, %w[Control-k]
|
272
|
+
mode.to :clear_screen, %w[Control-l]
|
273
|
+
mode.to :next_history, %w[Control-n]
|
274
|
+
mode.to :previous_history, %w[Control-p], %w[minus]
|
275
|
+
mode.to :quoted_insert, %w[Control-o], %w[Control-V]
|
276
|
+
mode.to :reverse_search_history, %w[Control-r]
|
277
|
+
mode.to :forward_search_history, %w[Control-s]
|
278
|
+
mode.to :transpose_chars, %w[Control-t]
|
279
|
+
mode.to :unix_line_discard, %w[Control-u]
|
280
|
+
mode.to :unix_word_rubout, %w[Control-w]
|
281
|
+
mode.to :yank, %w[Control-y]
|
282
|
+
mode.to :vi_undo, %w[Control-underscore]
|
283
|
+
mode.to :forwad_char, %w[space]
|
284
|
+
mode.to :insert_comment, %w[numbersign]
|
285
|
+
mode.to :end_of_line, %w[dollar]
|
286
|
+
mode.to :vi_match, %w[percent]
|
287
|
+
mode.to :vi_tilde_expand, %w[ampersand]
|
288
|
+
mode.to :vi_complete, %w[asterisk]
|
289
|
+
mode.to :next_history, %w[plus]
|
290
|
+
mode.to :vi_char_search, %w[comma]
|
291
|
+
mode.to :vi_redo, %w[period]
|
292
|
+
mode.to :vi_search, %w[numbersign]
|
293
|
+
mode.to :beginning_of_line, %w[KeyPress-0]
|
294
|
+
mode.to :vi_char_search, %w[semicolon]
|
295
|
+
mode.to :vi_complete, %w[equal]
|
296
|
+
mode.to :vi_search, %w[question]
|
297
|
+
mode.to :vi_append_eol, %w[A]
|
298
|
+
mode.to :vi_prev_word, %w[B]
|
299
|
+
mode.to :vi_change_to, %w[C]
|
300
|
+
mode.to :vi_delete_to, %w[D]
|
301
|
+
mode.to :vi_end_word, %w[E]
|
302
|
+
mode.to :vi_char_search, %w[F]
|
303
|
+
mode.to :vi_fetch_history, %w[G]
|
304
|
+
mode.to :vi_insert_beg, %w[I]
|
305
|
+
mode.to :vi_search_again, %w[N]
|
306
|
+
mode.to :vi_put, %w[P]
|
307
|
+
mode.to :vi_replace, %w[R]
|
308
|
+
mode.to :vi_subst, %w[S]
|
309
|
+
mode.to :vi_char_search, %w[T]
|
310
|
+
mode.to :revert_line, %w[U]
|
311
|
+
mode.to :vi_next_word, %w[W]
|
312
|
+
mode.to :backward_delete_char, %w[X]
|
313
|
+
mode.to :vi_yank_to, %w[Y]
|
314
|
+
mode.to :vi_complete, %w[backslash]
|
315
|
+
mode.to :vi_first_print, %w[asciicircum]
|
316
|
+
mode.to :vi_yank_arg, %w[underscore]
|
317
|
+
mode.to :vi_goto_mark, %w[quoteleft]
|
318
|
+
mode.to :vi_append_mode, %w[a]
|
319
|
+
mode.to :vi_prev_word, %w[b]
|
320
|
+
mode.to :vi_change_to, %w[c]
|
321
|
+
mode.to :vi_delete_to, %w[d]
|
322
|
+
mode.to :vi_end_word, %w[e]
|
323
|
+
mode.to :vi_char_search, %w[f]
|
324
|
+
mode.to :backward_char, %w[h]
|
325
|
+
mode.to :vi_insertion_mode, %w[i]
|
326
|
+
mode.to :next_history, %w[j]
|
327
|
+
mode.to :prev_history, %w[k]
|
328
|
+
mode.to :forward_char, %w[l]
|
329
|
+
mode.to :forward_char, %w[l]
|
330
|
+
mode.to :vi_set_mark, %w[m]
|
331
|
+
mode.to :vi_search_again, %w[n]
|
332
|
+
mode.to :vi_put, %w[p]
|
333
|
+
mode.to :vi_change_char, %w[r]
|
334
|
+
mode.to :vi_subst, %w[s]
|
335
|
+
mode.to :vi_char_search, %w[t]
|
336
|
+
mode.to :vi_undo, %w[u]
|
337
|
+
mode.to :vi_next_word, %w[w]
|
338
|
+
mode.to :vi_delete, %w[x]
|
339
|
+
mode.to :vi_yank_to, %w[y]
|
340
|
+
mode.to :vi_column, %w[bar]
|
341
|
+
mode.to :vi_change_case, %w[asciitilde]
|
342
|
+
|
343
|
+
mode.missing :insert_string
|
234
344
|
end
|
235
345
|
|
236
346
|
vim
|