diff --git a/NEWS b/NEWS index 083e63aa..42ba35d4 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@
2008-08-16:
* version 2.0 (probably)
+ * add 'loadplugins' option
* add count support to C-^ (Kazuo)
* add 'eventignore' option
* add :tabdetach command
diff --git a/content/liberator.js b/content/liberator.js
index 5fafa5f3..62537ec5 100644
--- a/content/liberator.js
+++ b/content/liberator.js
@@ -72,6 +72,10 @@ const liberator = (function () //{{{
}
});
+ liberator.options.add(["loadplugins", "lpl"],
+ "Load plugin scripts when starting up",
+ "boolean", true);
+
liberator.options.add(["verbose", "vbs"],
"Define which type of messages are logged",
"number", 0,
@@ -983,29 +987,32 @@ const liberator = (function () //{{{
else
liberator.log("No user RC file found", 3);
- // also source plugins in ~/.vimperator/plugin/
- try
+ if (liberator.options["loadplugins"])
{
- var pluginDir = liberator.io.getSpecialDirectory("plugin");
- if (pluginDir)
+ // also source plugins in ~/.vimperator/plugin/
+ try
{
- var files = liberator.io.readDirectory(pluginDir.path);
- liberator.log("Sourcing plugin directory...", 3);
- files.forEach(function (file) {
- if (!file.isDirectory() && /\.(js|vimp)$/i.test(file.path))
- liberator.io.source(file.path, false);
- });
+ var pluginDir = liberator.io.getSpecialDirectory("plugin");
+ if (pluginDir)
+ {
+ var files = liberator.io.readDirectory(pluginDir.path);
+ liberator.log("Sourcing plugin directory...", 3);
+ files.forEach(function (file) {
+ if (!file.isDirectory() && /\.(js|vimp)$/i.test(file.path))
+ liberator.io.source(file.path, false);
+ });
+ }
+ else
+ {
+ liberator.log("No user plugin directory found", 3);
+ }
}
- else
+ catch (e)
{
- liberator.log("No user plugin directory found", 3);
+ // thrown if directory does not exist
+ //liberator.log("Error sourcing plugin directory: " + e);
}
}
- catch (e)
- {
- // thrown if directory does not exist
- //liberator.log("Error sourcing plugin directory: " + e);
- }
// after sourcing the initialization files, this function will set
// all gui options to their default values, if they have not been
diff --git a/locale/en-US/options.txt b/locale/en-US/options.txt
index 150a9507..daf89380 100644
--- a/locale/en-US/options.txt
+++ b/locale/en-US/options.txt
@@ -444,6 +444,13 @@ This includes (X)HTML elements with an "href" atrribute and XLink "simple" links
____
+|\'noloadplugins'| |\'loadplugins'|
+||'loadplugins'|| boolean (default on)
+____
+Load plugin scripts when starting up.
+____
+
+
|\'nomore'| |\'more'|
||'more'|| boolean (default: on)
____
@@ -485,6 +492,7 @@ ____
Show and set the \'work offline' behavior.
____
+
|\'pageinfo' \'pa'|
||'pageinfo' 'pa'||
charlist (default: gfm)
diff --git a/locale/en-US/starting.txt b/locale/en-US/starting.txt
index a981c607..a20e8e3b 100644
--- a/locale/en-US/starting.txt
+++ b/locale/en-US/starting.txt
@@ -17,7 +17,9 @@ The plugin directory is named:
* Unix and Mac - [a]\~/.vimperator/plugin[a]
* Windows - [a]\~/vimperator/plugin[a]
-The user's '$HOME'(~) directory is determined as follows:
+Plugins will not be sourced if 'noloadplugins' is set.
+
+The user's \'$HOME'(~) directory is determined as follows:
* Unix and Mac - _$HOME_ is used.
* Windows - if _%HOME%_ is set then this is used, otherwise _%USERPROFILE%_ or finally
diff --git a/vimperator.vim b/vimperator.vim
index db05813a..bc1fe447 100644
--- a/vimperator.vim
+++ b/vimperator.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: VIMperator configuration file
" Maintainer: Doug Kearns
-" Last Change: 2008 Aug 28
+" Last Change: 2008 Aug 29
if exists("b:current_syntax")
finish
@@ -43,10 +43,11 @@ syn keyword vimperatorOption activate act activelinkfgcolor alfc activelinkbgcol
\ extendedhinttags eht eventignore ei focuscontent fc nofocuscontent nofc fullscreen fs nofullscreen nofs guioptions go
\ hintmatching hm hintstyle hs hinttags ht hinttimeout hto history hi hlsearch hls nohlsearch nohls hlsearchstyle hlss
\ incsearch is noincsearch nois ignorecase ic noignorecase noic insertmode im noinsertmode noim laststatus ls linkbgcolor lbc
- \ linkfgcolor lfc linksearch lks nolinksearch nolks more newtab nextpattern nomore pageinfo pa popups pps preload nopreload
- \ previewheight pvh previouspattern online noonline scroll scr shell sh shellcmdflag shcf showmode smd noshowmode nosmd
- \ showstatuslinks ssli showtabline stal smartcase scs nosmartcase noscs suggestengines titlestring usermode um nousermode noum
- \ urlseparator verbose vbs visualbell vb novisualbell novb visualbellstyle wildmode wim wildoptions wop wordseparators wsp
+ \ linkfgcolor lfc linksearch lks nolinksearch nolks loadplugins noloadplugins lpl nolpl more newtab nextpattern nomore
+ \ pageinfo pa popups pps preload nopreload previewheight pvh previouspattern online noonline scroll scr shell sh shellcmdflag
+ \ shcf showmode smd noshowmode nosmd showstatuslinks ssli showtabline stal smartcase scs nosmartcase noscs suggestengines
+ \ titlestring usermode um nousermode noum urlseparator verbose vbs visualbell vb novisualbell novb visualbellstyle wildmode
+ \ wim wildoptions wop wordseparators wsp
\ contained
syn region vimperatorJavascript start="\%(^\s*\%(javascript\|js\)\s\+\)\@<=" end="$" contains=@javascriptTop keepend oneline