1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 05:57:58 +01:00

add 'exrc'

This commit is contained in:
Doug Kearns
2008-10-21 15:45:57 +00:00
parent b58c04200f
commit 2141d475f8
6 changed files with 27 additions and 4 deletions

1
NEWS
View File

@@ -11,6 +11,7 @@
special versions for the old behavior
* IMPORTANT: renamed Startup and Quit autocmd events to VimperatorEnter and
VimperatorLeave respectively
* add 'exrc'
* add 'errorbells'
* add shell command completion for :!
* add :map <silent> to prevent a mapping from being echoed

View File

@@ -478,10 +478,12 @@ function IO() //{{{
return dirs;
},
getRCFile: function ()
getRCFile: function (dir)
{
var rcFile1 = ioManager.getFile("~/." + EXTENSION_NAME + "rc");
var rcFile2 = ioManager.getFile("~/_" + EXTENSION_NAME + "rc");
dir = dir || "~";
let rcFile1 = ioManager.getFile(joinPaths(dir, "/." + EXTENSION_NAME + "rc"));
let rcFile2 = ioManager.getFile(joinPaths(dir, "/_" + EXTENSION_NAME + "rc"));
if (WINDOWS)
[rcFile1, rcFile2] = [rcFile2, rcFile1];

View File

@@ -63,6 +63,10 @@ const liberator = (function () //{{{
"Ring the bell when an error message is displayed",
"boolean", false);
options.add(["exrc", "ex"],
"Allow reading of an RC file in the current directory",
"boolean", false);
const tabopts = [
["n", "Tab number", null, ".hl-TabNumber"],
["N", "Tab number over icon", null, ".hl-TabIconNumber"],
@@ -1168,13 +1172,20 @@ const liberator = (function () //{{{
// make sourcing asynchronous, otherwise commands that open new tabs won't work
setTimeout(function () {
var rcFile = io.getRCFile();
let rcFile = io.getRCFile("~");
if (rcFile)
io.source(rcFile.path, true);
else
liberator.log("No user RC file found", 3);
if (options["exrc"])
{
let localRcFile = io.getRCFile(io.getCurrentDirectory());
if (localRcFile)
io.source(localRcFile.path, true);
}
if (options["loadplugins"])
liberator.loadPlugins();

View File

@@ -257,6 +257,7 @@ section:Options[option-index]
||'editor'|| Set the external text editor +
||'errorbells'|| Ring the bell when an error message is displayed +
||'eventignore'|| List of autocommand event names which should be ignored +
||'exrc'|| Allow reading of an RC file in the current directory +
||'extendedhinttags'|| XPath string of hintable elements activated by ';' +
||'fileencoding'|| set the charactor encoding for the current page +
||'focuscontent'|| Try to stay in normal mode after loading a web page +

View File

@@ -266,6 +266,12 @@ Warning: Vimperator will not behave correctly if the editor forks its own
process, such as with gvim without the -f argument.
____
|\'noex'| |\'noexrc'| |\'ex'| |\'exrc'|
||'exrc' 'ex'|| boolean (default: off)
____
Allow reading of an RC file in the current directory. This file is sourced in
addition to, and after, your default RC file.
____
|\'eht'| |\'extendedhinttags'|
||'extendedhinttags' 'eht'|| string

View File

@@ -12,6 +12,8 @@ JavaScript files found in the plugin directory. The RC file may be named
* Unix and Mac: [a]\~/.vimperatorrc[a] then [a]\~/_vimperatorrc[a]
* Windows - [a]\~/_vimperatorrc[a] then [a]\~/.vimperatorrc[a]
If 'exrc' is set then any RC file in the current directory is also sourced.
The plugin directory can be in any of the directories in 'runtimepath'. Using
the default value of 'runtimepath' this would be: