summaryrefslogtreecommitdiffstats
path: root/vimperator/.vimperator
diff options
context:
space:
mode:
authorAmin Bandali <me@aminb.org>2015-06-18 23:26:19 -0400
committerAmin Bandali <me@aminb.org>2015-06-18 23:26:19 -0400
commit1267cee65a4bad8a3468ad8d72c1e48424fa49ec (patch)
treef49d0a30061619dc665eb5bc36af3f3539d8187c /vimperator/.vimperator
parent215cc3c85912169c355c364f920a0c9f23456cb8 (diff)
downloadconfigs-1267cee65a4bad8a3468ad8d72c1e48424fa49ec.tar.gz
configs-1267cee65a4bad8a3468ad8d72c1e48424fa49ec.tar.xz
configs-1267cee65a4bad8a3468ad8d72c1e48424fa49ec.zip
delete vimperator dots, as I don't use it anymore
Diffstat (limited to 'vimperator/.vimperator')
-rw-r--r--vimperator/.vimperator/colors/indigo.vimp102
-rw-r--r--vimperator/.vimperator/colors/seaweed.vimp53
-rw-r--r--vimperator/.vimperator/colors/zenburn.vimp85
-rw-r--r--vimperator/.vimperator/plugin/PDF.js.js250
-rw-r--r--vimperator/.vimperator/plugin/_smooziee.js171
5 files changed, 0 insertions, 661 deletions
diff --git a/vimperator/.vimperator/colors/indigo.vimp b/vimperator/.vimperator/colors/indigo.vimp
deleted file mode 100644
index 5673179..0000000
--- a/vimperator/.vimperator/colors/indigo.vimp
+++ /dev/null
@@ -1,102 +0,0 @@
-" ==VimperatorColorSchema==
-" name: indigo
-" author: mashiro
-" ==/VimperatorColorSchema==
-
-" Highlights {{{1
-hi Boolean color: orchid;
-hi Function color: skyblue;
-hi Null color: cornflowerblue;
-hi Number color: cornflowerblue;
-hi Object color: khaki;
-hi String color: orchid;
-hi Mapping color: orchid;
-
-hi Key font-weight: bold;
-
-hi Enabled color: #d0ffd0;
-hi Disabled color: red;
-
-hi Normal color: #d0d0d0; background: #1c1c1c; font-size: 12px;
-hi ErrorMsg color: #ffffff; background: #440000; font-size: 12px;
-hi InfoMsg color: #d0d0d0; background: #1c1c1c; font-size: 12px;
-hi ModeMsg color: #d0d0d0; background: #1c1c1c; font-size: 12px;
-hi MoreMsg color: #d0ffd0; background: #1c1c1c; font-size: 12px;
-hi WarningMsg color: #ff0000; background: #1c1c1c; font-size: 12px;
-hi Message white-space: normal; min-width: 100%; padding-left: 2em; text-indent: -2em; display: block; font-size: 12px;
-hi NonText color: #a0a0d0; min-height: 16px; padding-left: 2px; font-size: 12px;
-hi Preview color: #a0a0d0; font-size: 12px;
-hi Prompt background: url("chrome://liberator/skin/prompt.png"); width: 10px; background-position: center; background-repeat: no-repeat;
-hi PromptText color: #1c1c1c; background: #d0d0f0; font-size: 12px;
-
-hi CmdOutput white-space: pre;
-hi CmdLine font-size: 14px; background: black; color: #d0d0d0; -moz-transition: all 0.25s;
-hi CmdLine>* font-family: monospace;
-
-hi ContentSeparator border: none; display: -moz-box;
-
-"hi CompGroup
-hi CompGroup:not(:first-of-type) margin-top: 1ex;
-hi CompTitle font-size: 12px; font-weight: bold; background: -moz-linear-gradient(19% 75% 90deg, #2c2c2f, #2a2a2f, #2f2f2f 100%);
-hi CompTitle>* color: #a0a0d0; border-bottom: 1px solid #3c3c3f; padding: 1px 0.5ex; text-shadow: 1px 1px 0px #0c0c0c;
-hi CompMsg font-style: italic; margin-left: 16px;
-hi CompItem font-size: 12px;
-hi CompItem[selected] color: #dddddd; background: #3c3c3f;
-hi CompItem>* height: 18px; min-height: 18px; padding: 0 0.5ex;
-hi CompIcon width: 16px; min-width: 16px; display: inline-block; margin-right: .5ex;
-hi CompIcon>img max-width: 16px; max-height: 16px; vertical-align: middle;
-hi CompResult width: 500px; max-width: 500px; overflow: hidden;
-hi CompDesc width: 500px; max-width: 500px; color: #a0a0d0;
-
-hi Indicator color: #a0a0d0;
-hi Filter color: #7090d0;
-
-hi Keyword color: khaki;
-hi Tag color: #a0a0d0;
-
-hi LineNr color: #ffd0d0; background: #1c1c1c;
-hi Question color: #a0a0d0; background: #1c1c1c; font-weight: bold;
-
-hi StatusLine color: #7090d0; background: transparent; font-weight: normal; font-size: 12px;
-
-hi TabNumber font-weight: bold; margin: 0px; padding-right: .3ex;
-
-hi Title color: orchid; background: #1c1c1c; font-weight: bold;
-hi URL text-decoration: none; color: #d0ffd0;
-hi URL:hover text-decoration: underline; cursor: pointer;
-
-hi FrameIndicator background-color: red; opacity: 0.5; z-index: 999; position: fixed; top: 0; bottom: 0; left: 0; right: 0;
-
-hi Bell border: none; background-color: #d0d0d0;
-hi Hint font-family: monospace; font-size: 14px; font-weight: normal; color: #dddddd; background-color: #1c1c1c; border: none; margin: -0.7em 0 0 -0.7em; padding: 0px 5px;
-hi Hint::after content: attr(number);
-hi HintElem background-color: rgba(208, 208, 240, 0.8); color: #1c1c1c;
-hi HintActive background-color: rgba( 85, 102, 187, 0.8); color: #dddded;
-hi HintImage opacity: .5;
-
-" 影(重かったらコメントアウト) {{{2
-hi -append Hint background-color: rgba(28, 28, 28, 0.8); border: 1px solid #1c1c1c; -moz-border-radius: 4px; -moz-box-shadow: 0px 0px 1px black; text-shadow: 1px 1px 2px black;
-hi -append HintElem text-decoration: none; -moz-border-radius: 4px; -moz-box-shadow: 0 0 2px #0c0c0c;
-hi -append HintActive text-decoration: none; -moz-border-radius: 4px; -moz-box-shadow: 0 0 2px #0c0c0c;
-" }}}2
-" }}}1
-
-" Styles {{{1
-style -name indigo-feed-button chrome://* <<EOM
- #feed-button {
- list-style-image: url("chrome://browser/skin/feeds/feedIcon16.png") !important;
- -moz-image-region: auto !important;
- border: none !important;
- min-width: 0 !important;
- }
-EOM
-
-style -name indigo-sbmcommentsviewer chrome://* <<EOM
- .liberator-sbmcommentsviewer-content {
- padding: 0 !important;
- border: none !important;
- }
-EOM
-" }}}1
-
-" vim: ft=vimperator
diff --git a/vimperator/.vimperator/colors/seaweed.vimp b/vimperator/.vimperator/colors/seaweed.vimp
deleted file mode 100644
index 8e1dd7c..0000000
--- a/vimperator/.vimperator/colors/seaweed.vimp
+++ /dev/null
@@ -1,53 +0,0 @@
-" ==Vimperator_Color_Scheme==
-" name: seaweed
-" url: http://code.google.com/p/vimperator-labs/issues/detail?id=54&q=label%3Aproject-vimperator%20label%3Atype-colorscheme&colspec=ID%20Summary%20Project%20Type%20Status%20Priority%20Stars%20Owner
-" ==Seaweed_Colorscheme_Settings==
-hi Bell border: 0 none; background-color: #2f2f2f;
-hi Boolean color: #f6e9e9;
-hi CmdLine font-family: Sans; padding: 1px;
-hi CmdOutput white-space: pre;
-hi CompDesc color: #77a8c1; width: 50%;
-hi CompIcon width: 16px; min-width: 16px; display: inline-block; margin-right: .5ex;
-" hi CompLess text-align: center; height: 0; line-height: .5ex; padding-top: 1ex;
-" hi CompLess::after content: "\2303" /* Unicode up arrowhead */
-" hi CompMore text-align: center; height: .5ex; line-height: .5ex; margin-bottom: -.5ex;
-" hi CompMore::after content: "\2304" /* Unicode down arrowhead */
-hi CompMsg font-style: italic; margin-left: 16px;
-hi CompResult width: 45%; overfloaw: hidden;
-hi CompTitle color: #9acd32; background: #2f2f2f; font-weight: bold;
-hi CompTitle>* padding: 0 .5ex;
-hi ErrorMsg color: green; background: #2f2f2f; font-weight: bold;
-hi Filter font-weight: bold;
-hi FrameIndicator background-color: #2f2f2f; opacity: 0.5; z-index: 999; position: fixed; top: 0; bottom: 0; left: 0; right: 0;
-hi Function color: navy;
-" hi Gradient height: 1px; margin-bottom: -1px; margin-top: -1px;
-" hi GradientLeft background-color: #2f2f2f;
-" hi GradientRight background-color: #2f2f2f;
-hi Hint font-family: Sans; font-size: 10px; font-weight: bold; color: #f6e9e9; background-color: red; border-color: ButtonShadow; border-width: 0px; border-style: solid; padding 0px 1px 0px 1px;
-hi Hint::after content: attr(number);
-hi HintActive background: #2f2f2f; color: #f6e9e9;
-hi HintElem background-color: #2f2f2f; color: #f6e9e9;
-hi HintImage opacity: .5;
-hi Indicator color: blue;
-hi InfoMsg color: green; background: #2f2f2f;
-hi LineNr color: green; background: #2f2f2f;
-hi Message white-space: normal; min-width: 100%; padding-left: 2em; text-indent: -2em; display: block;
-hi ModeMsg color: #8ade8e; background: #2f2f2f;
-hi MoreMsg color: #8ade8e; background: #2f2f2f;
-hi NonText color: blue; min-height: 16px; padding-left: 2px;
-hi Normal color: #8ade8e; background: #2f2f2f;
-hi Null color: blue;
-hi Number color: blue;
-hi Object color: maroon;
-hi Preview color: gray;
-hi Question color: #8ade8e; background: green; font-weight: bold;
-" hi Search font-size: inherit; padding: 0; color: #2f2f2f; background-color: yellow; padding: 0;
-hi StatusLine color: #9acd32; background: #2f2f2f;
-" hi StatusLineBroken color: red; background: #2f2f2f;
-" hi StatusLineSecure color: #77a8c1; background: #2f2f2f;
-hi String color: green;
-hi Tag color: blue;
-hi Title color: green; background: #2f2f2f; font-weight: bold;
-hi URL text-decoration: none; color: green; background: inherit;
-hi URL:hover text-decoration: underline; cursor: pointer;
-hi WarningMsg color: red; background: #2f2f2f;
diff --git a/vimperator/.vimperator/colors/zenburn.vimp b/vimperator/.vimperator/colors/zenburn.vimp
deleted file mode 100644
index 369236c..0000000
--- a/vimperator/.vimperator/colors/zenburn.vimp
+++ /dev/null
@@ -1,85 +0,0 @@
-" ==Vimperator_Color_Scheme==
-" name: zenburn
-" url: https://github.com/livibetter/dotfiles/tree/master/vimperator/colors
-" original name: vimPgray
-"
-" Created for matching this GTK+ theme:
-" http://www.gnome-look.org/content/show.php/Clearlooks+Zenburn?content=103035
-"
-" Last edited:
-" Edited by Yu-Jie Lin <http://j.mp/Google-livibetter>
-"
-" Original vimp: 2010-11-01T10:04:00+0800
-" http://github.com/VoQn/vimperator-colorscheme/blob/master/colors/default.vimp
-"
-" Reference:
-" chrome://liberator/locale/styling.html
-" ==VimPGray_Colorscheme_Settings==
-
-" Reset all styles first
-hi clear
-
-hi CompDesc color: #999; width: 50%;
-hi CompItem[selected] background: #666;
-
-" Used in Command Line
-" Entire bottom line
-hi CmdLine color: #aaa; background: #333; font-family: Inconsolata; font-size: 12px; padding: 0px; vertical-align: middle; border: none;
-
-" Used in the URL column of `bmarks`
-hi CompResult color: #aaa; width: 45%; overflow: hidden;
-hi CompTitle color: #ddc; background: #333; font-weight: bold;
-hi CompTitle>* color: #aaa; font-weight: bold; border-top: 1px solid gray; border-bottom: 1px solid #BBB; padding: 1px 0.5ex;
-
-" Hints!
-hi Hint color: white; background-color: #800; border-color: ButtonShadow; font-family: Inconsolata; font-size: 12px; border-width: 0px; border-style: solid; padding 0 1px;
-hi Hint::after content: attr(number);
-hi HintActive color: black; background: #480;
-hi HintElem color: black; background-color: #880;
-hi HintImage opacity: .5;
-
-" Used also in wrapping error messages as the background, simple speaking
-hi InfoMsg color: #ddc; background: #333;
-
-" Used when error on syntax error in vimperatorrc, etc.
-hi LineNr color: orange; background-color: #333;
-
-hi ErrorMsg color: #c22; background-color: #333; font-weight: bold;
-
-" Used in CARET or COMMAND modes
-hi ModeMsg color: #ddc; background: #333;
-
-hi MoreMsg color: #080; background: #222; font-weight: bold; -moz-border-radius: 5px; padding-left: 5px;
-
-hi Normal color: #ddc; background: #333;
-
-" Used in :`js tr<TAB>`
-hi Boolean color: #f00;
-hi Function color: #04c;
-hi Null color: #00c;
-hi Number color: #00c;
-hi Object color: #c40;
-hi String color: #0c0;
-
-" Used in "Press ENTER..." of `jumps` or `bmarks`, or "Follow Hint..." or `f`
-hi Question color: #080; background: #222; font-weight: bold; -moz-border-radius: 5px; padding-left: 5px;
-
-" hi Search color: #333; background-color: #cc0; font-size: inherit; padding: 0; padding: 0;
-
-hi StatusLine color: #ddc; background: #333; font-family: Inconsolata; font-size: 14px; margin-top: 1px;
-
-" Firefox's tabs
-hi TabNumber color: #ddc; font-weight: bold; margin: 0; padding-right: .3ex; text-shadow: #000 -1px 0 0, #000 0 1px 0, #000 1px 0 0, #000 0 -1px 0;
-
-" Used in `pageinfo` or `jumps`
-hi Title color: #ddc; background: #333; font-weight: bold;
-
-" Used in items of Info field of `bmarks`
-hi Keyword color: #CC0;
-hi Tag color: #0CC;
-hi URL color: #080; text-decoration: none; padding: 0 2px;
-hi URL:hover color: #880; background-color: #222; -moz-border-radius: 5px; cursor: pointer;
-
-hi ContentSeparator border:none;
-
-" vim:set filetype=vim:
diff --git a/vimperator/.vimperator/plugin/PDF.js.js b/vimperator/.vimperator/plugin/PDF.js.js
deleted file mode 100644
index 0f04981..0000000
--- a/vimperator/.vimperator/plugin/PDF.js.js
+++ /dev/null
@@ -1,250 +0,0 @@
-/* NEW BSD LICENSE {{{
-Copyright (c) 2012, anekos.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
- 3. The names of the authors may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGE.
-
-
-###################################################################################
-# http://sourceforge.jp/projects/opensource/wiki/licenses%2Fnew_BSD_license #
-# に参考になる日本語訳がありますが、有効なのは上記英文となります。 #
-###################################################################################
-
-}}} */
-
-// INFO {{{
-let INFO = xml`
-<plugin name="PDF.js.js" version="1.0.0"
- href="http://vimpr.github.com/"
- summary="PDF.js controller."
- lang="en-US"
- xmlns="http://vimperator.org/namespaces/liberator">
- <author email="anekos@snca.net">anekos</author>
- <license>New BSD License</license>
- <project name="Vimperator" minVersion="3.0"/>
- <p></p>
- <item>
- <tags>:pdfjs-mapping-sample</tags>
- <description><p>mapping sample</p><code><![CDATA[
- nnoremap -urls ^\\.pdf$ i :<C-u>pdfjs index<Space>
- nnoremap -urls ^\\.pdf$ z :<C-u>pdfjs zoom<Space>
- ]]></code></description>
- </item>
-</plugin>`;
-// }}}
-
-(function () {
-
- let scrollCount = 1;
-
- // Functions {{{
-
- function getScrollHeight (count) {
- let base = content.innerHeight / 10;
- if (count > 0)
- scrollCount = count;
- return base * scrollCount;
- }
-
- function addMap (keys, desc, action) {
- mappings.addUserMap(
- [modes.NORMAL],
- keys,
- desc + ' - PDF.js.js',
- action,
- {
- count: true,
- matchingUrls: /\.pdf$/
- }
- );
- }
-
- function getOutline () {
- return Array.slice(content.document.querySelector('#outlineView').querySelectorAll('.outlineItem > a'));
- }
-
- function getOutlineLevel (node) {
- let level = 0;
- while (node && (node.getAttribute('id') != 'outlineView')) {
- node = node.parentNode;
- level++;
- }
- return node ? (level / 2): 0;
- }
-
- function nSpace (level) {
- let res = '';
- for (i = 0; i < level; i++)
- res += ' ';
- return res;
- }
-
- // }}}
-
- // Mappings {{{
-
- addMap(
- ['j'],
- 'Scroll Down',
- function (count) {
- content.document.querySelector('#viewerContainer').scrollTop += getScrollHeight(count);
- }
- );
-
- addMap(
- ['k'],
- 'Scroll up',
- function (count) {
- content.document.querySelector('#viewerContainer').scrollTop -= getScrollHeight(count);
- }
- );
-
- addMap(
- ['n'],
- 'Next page',
- function (count) {
- content.window.wrappedJSObject.PDFView.page += (count > 0 ? count : 1);
- }
- );
-
- addMap(
- ['p'],
- 'Previous page',
- function (count) {
- content.window.wrappedJSObject.PDFView.page -= (count > 0 ? count : 1);
- }
- );
-
- addMap(
- ['gg'],
- 'Go to page top or N page.',
- function (count) {
- if (count > 0)
- content.window.wrappedJSObject.PDFView.page = count;
- else
- content.window.wrappedJSObject.PDFView.page = 1;
- }
- );
-
- addMap(
- ['zh'],
- 'Fit to page.',
- function (count) {
- liberator.execute('pdfjs zoom page-fit');
- }
- );
-
- addMap(
- ['zw'],
- 'Fit to page to width.',
- function (count) {
- liberator.execute('pdfjs zoom page-width');
- }
- );
-
- addMap(
- ['za'],
- 'Fit to page to width.',
- function (count) {
- liberator.execute('pdfjs zoom auto');
- }
- );
-
- addMap(
- ['zz'],
- 'Fit to page to width.',
- function (count) {
- commandline.open('', 'pdfjs zoom ', modes.EX);
- }
- );
-
- // }}}
-
- commands.addUserCommand( // {{{
- ['pdfjs'],
- 'PDF.js',
- function () void 'Meow is best',
- {
- subCommands: [
- new Command(
- ['i[ndex]'],
- 'Jump page by index',
- function (args) {
- let index = args.literalArg.match(/^#(\d+)$/);
- if (index) {
- let os = getOutline();
- buffer.followLink(os[parseInt(index[1], 10)], liberator.CURRENT_TAB);
- } else {
- content.window.wrappedJSObject.PDFView.page = parseInt(args.literalArg, 10);
- }
- },
- {
- literal: 0,
- completer: function (context, args) {
- function desc (o) {
- const PageRE = /#page=(\d+)\&/;
- if (o.href && PageRE.test(o.href)) {
- return `${nSpace(getOutlineLevel(o))} ${o.textContent} (p${o.href.match(PageRE)[1]})`;
- } else {
- return `${nSpace(getOutlineLevel(o))} ${o.textContent}`;
- }
- }
-
- let os = getOutline();
- context.compare = void 0;
- context.filters = [CompletionContext.Filter.textDescription];
- context.completions = [
- [
- '#' + i, desc(o)
- ]
- for ([i, o] in Iterator(os))
- ];
- }
- }
- ),
-
- new Command(
- ['z[oom]'],
- 'Zoom',
- function (args) {
- content.window.wrappedJSObject.PDFView.parseScale(args.literalArg);
- },
- {
- literal: 0,
- completer: function (context, args) {
- let os = Array.slice(content.document.querySelector('#scaleSelect').querySelectorAll('option'));
- context.completions = [
- [o.value, o.textContent]
- for ([, o] in Iterator(os))
- ];
- }
- }
- )
- ]
- },
- true
- ); // }}}
-
-})();
-
-// vim:sw=2 ts=2 et si fdm=marker:
diff --git a/vimperator/.vimperator/plugin/_smooziee.js b/vimperator/.vimperator/plugin/_smooziee.js
deleted file mode 100644
index a8af10d..0000000
--- a/vimperator/.vimperator/plugin/_smooziee.js
+++ /dev/null
@@ -1,171 +0,0 @@
-//
-// _smooziee.js
-//
-// LICENSE: {{{
-// Copyright (c) 2009 snaka<snaka.gml@gmail.com>
-//
-// distributable under the terms of an MIT-style license.
-// http://www.opensource.jp/licenses/mit-license.html
-// }}}
-//
-// INFO: {{{
-var INFO = xml`
-<plugin name="smooziee" version="0.10.2"
- href="https://github.com/vimpr/vimperator-plugins/raw/master/_smooziee.js"
- summary="j,kキーでのスクロールをスムースに"
- lang="en_US"
- xmlns="http://vimperator.org/namespaces/liberator">
- <author email="snaka.gml@gmail.com" homepage="http://vimperator.g.hatena.ne.jp/snaka72/">snaka</author>
- <project name="Vimperator" minVersion="3.6"/>
- <license>MIT style license</license>
- <p>j,k key scrolling to be smoothly.</p>
- <h3 tag="smooziee_global_variables">Global vriables</h3>
- <p>You can configure following variable as you like.</p>
- <dl>
- <dt>smooziee_scroll_amount</dt><dd>Scrolling amount(unit:px). Default value is 400px.</dd>
- <dt>smooziee_interval</dt><dd>Scrolling interval(unit:ms). Default value is 20ms.</dd>
- </dl>
- <h3 tag="smooziee_example">Example</h3>
- <p>Set scroll amount is 300px and interval is 10ms.</p>
- <code><ex><![CDATA[
- let g:smooziee_scroll_amount="300"
- let g:smooziee_scroll_interval="10"
- ]]></ex></code>
- <h3 tag="smooziee_API">API</h3>
- <code>smooziee.smoothScrollBy(amount);</code>
- <p>Example</p>
- <code><ex><![CDATA[
- :js liberator.plugins.smooziee.smoothScrollBy(600)
- :js liberator.plugins.smooziee.smoothScrollBy(-600)
- ]]></ex></code>
-</plugin>
-<plugin name="smooziee" version="0.10.2"
- href="https://github.com/vimpr/vimperator-plugins/raw/master/_smooziee.js"
- summary="j,kキーでのスクロールをスムースに"
- lang="ja"
- xmlns="http://vimperator.org/namespaces/liberator">
- <author email="snaka.gml@gmail.com" homepage="http://vimperator.g.hatena.ne.jp/snaka72/">snaka</author>
- <project name="Vimperator" minVersion="3.6"/>
- <license>MIT style license</license>
- <p>普段のj,kキーのスクロールをLDRizeライクにスムースにします。</p>
- <h3 tag="smooziee_global_variables">グローバル変数</h3>
- <p>以下の変数を.vimperatorrcなどで設定することで動作を調整することができます。</p>
- <dl>
- <dt>smooziee_scroll_amount</dt>
- <dd>1回にスクロールする幅です(単位:ピクセル)。デフォルトは"400"です。</dd>
- <dt>smooziee_interval</dt>
- <dd>スクロール時のアニメーションのインターバルです(単位:ミリ秒)。
- "1"以上の値を設定します。デフォルトは"20"です。</dd>
- </dl>
- <h3 tag="smooziee_example">設定例</h3>
- <p>スクロール量を300pxに、インターバルを10msに設定します。</p>
- <code><ex><![CDATA[
- let g:smooziee_scroll_amount="300"
- let g:smooziee_scroll_interval="10"
- ]]></ex></code>
- <h3 tag="smooziee_API">API</h3>
- <p>他のキーにマップする場合やスクリプトから呼び出せるようAPIを用意してます。</p>
- <code>smooziee.smoothScrollBy(amount);</code>
- <p>Example</p>
- <code><ex><![CDATA[
- :js liberator.plugins.smooziee.smoothScrollBy(600)
- :js liberator.plugins.smooziee.smoothScrollBy(-600)
- ]]></ex></code>
- <h3 tag="soomziee_ToDo">ToDo</h3>
- <ul>
- <li>読み込みの順番によっては他のプラグインと競合する可能性があるのをなんとかしたい。</li>
- </ul>
-</plugin>`;
-// }}}
-
-let self = liberator.plugins.smooziee = (function(){
-
- // Mappings {{{
-/* mappings.addUserMap(
- [modes.NORMAL],
- ["j"],
- "Smooth scroll down",
- function(count){
- self.smoothScrollBy(getScrollAmount() * (count || 1));
- },
- {
- count: true
- }
- );
- mappings.addUserMap(
- [modes.NORMAL],
- ["k"],
- "Smooth scroll up",
- function(count){
- self.smoothScrollBy(getScrollAmount() * -(count || 1));
- },
- {
- count: true
- }
- );
-*/
-
- mappings.addUserMap(
- [modes.NORMAL],
- ["d"],
- "Smooth scroll down page",
- function(count){
- self.smoothScrollBy(getScrollAmount() * 3.5 * (count || 1));
- },
- {
- count: true
- }
- );
- mappings.addUserMap(
- [modes.NORMAL],
- ["u"],
- "Smooth scroll up page",
- function(count){
- self.smoothScrollBy(getScrollAmount() * 3.5 * -(count || 1));
- },
- {
- count: true
- }
- );
- // }}}
- // PUBLIC {{{
- var PUBLICS = {
- smoothScrollBy: function(moment) {
- win = Buffer.findScrollableWindow();
- interval = window.eval(liberator.globalVariables.smooziee_scroll_interval || '20');
- destY = win.scrollY + moment;
- clearTimeout(next);
- smoothScroll(moment);
- }
- }
-
- // }}}
- // PRIVATE {{{
- var next;
- var destY;
- var win;
- var interval;
-
- function getScrollAmount() window.eval(liberator.globalVariables.smooziee_scroll_amount || '400');
-
- function smoothScroll(moment) {
- if (moment > 0)
- moment = Math.floor(moment / 2);
- else
- moment = Math.ceil(moment / 2);
-
- win.scrollBy(0, moment);
-
- if (Math.abs(moment) < 1) {
- setTimeout(makeScrollTo(win.scrollX, destY), interval);
- destY = null;
- return;
- }
- next = setTimeout(function() smoothScroll(moment), interval);
- }
-
- function makeScrollTo(x, y) function() win.scrollTo(x, y);
- // }}}
- return PUBLICS;
-})();
-// vim: sw=2 ts=2 et si fdm=marker: