mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-06 22:15:46 +01:00
add help for :colorscheme and move completion function to
completion.colorScheme
This commit is contained in:
1
NEWS
1
NEWS
@@ -12,6 +12,7 @@
|
||||
special versions for the old behavior
|
||||
* IMPORTANT: renamed Startup and Quit autocmd events to VimperatorEnter and
|
||||
VimperatorLeave respectively
|
||||
* add :colorscheme
|
||||
* multibyte support for hints (thanks Xie&Tian)
|
||||
* add 'exrc'
|
||||
* add 'errorbells'
|
||||
|
||||
@@ -813,6 +813,19 @@ function Completion() //{{{
|
||||
return [0, buildLongestCommonSubstring(items, filter)];
|
||||
},
|
||||
|
||||
colorScheme: function colorScheme(filter)
|
||||
{
|
||||
let schemes = [];
|
||||
let rtp = options["runtimepath"].split(",");
|
||||
|
||||
rtp.forEach(function (path) {
|
||||
schemes = schemes.concat([[c[0].replace(/\.vimp$/, ""), ""]
|
||||
for each (c in completion.file(path + "/colors/", true)[1])]);
|
||||
});
|
||||
|
||||
return [0, completion.filter(schemes, filter)];
|
||||
},
|
||||
|
||||
command: function command(filter)
|
||||
{
|
||||
var completions = [];
|
||||
|
||||
@@ -362,30 +362,21 @@ const highlight = storage.newObject("highlight", Highlights, false);
|
||||
|
||||
liberator.registerObserver("load_commands", function ()
|
||||
{
|
||||
// TODO: :colo default needs :hi clear
|
||||
commands.add(["colo[rscheme]"],
|
||||
"Load a color scheme",
|
||||
function (args)
|
||||
{
|
||||
let scheme = args.arguments[0];
|
||||
|
||||
if (!io.sourceFromRuntimePath(["colors/" + scheme + ".vimp"]))
|
||||
if (io.sourceFromRuntimePath(["colors/" + scheme + ".vimp"]))
|
||||
autocommands.trigger("ColorScheme", {});
|
||||
else
|
||||
liberator.echoerr("E185: Cannot find color scheme " + scheme);
|
||||
},
|
||||
{
|
||||
argCount: 1,
|
||||
completer: function (filter)
|
||||
{
|
||||
let rtp = options["runtimepath"].split(",");
|
||||
let schemes = [];
|
||||
|
||||
rtp.forEach(function (path) {
|
||||
schemes = schemes.concat(
|
||||
[[c[0].replace(/\.vimp$/, ""), ""] for each (c in completion.file(path + "/colors/", true)[1])]
|
||||
)
|
||||
});
|
||||
|
||||
return [0, completion.filter(schemes, filter)];
|
||||
}
|
||||
completer: function (filter) completion.colorScheme(filter)
|
||||
});
|
||||
|
||||
commands.add(["sty[le]"],
|
||||
|
||||
@@ -39,6 +39,7 @@ const config = { //{{{
|
||||
get visualbellWindow() getBrowser().mPanelContainer,
|
||||
|
||||
autocommands: [["BookmarkAdd", "Triggered after a page is bookmarked"],
|
||||
["ColorScheme", "Triggered after a color scheme has been loaded"],
|
||||
["DOMLoad", "Triggered when a page's DOM content has fully loaded"],
|
||||
["DownloadPost", "Triggered when a download has completed"],
|
||||
["LocationChange", "Triggered when changing tabs or when naviagtion to a new location"],
|
||||
|
||||
@@ -21,6 +21,7 @@ Available {events}:
|
||||
|
||||
`--------------------`----------------------------------------
|
||||
*BookmarkAdd* Triggered after a page is bookmarked
|
||||
*ColorScheme* Triggered after a color scheme has been loaded
|
||||
*DOMLoad* Triggered when a page's DOM content has fully loaded
|
||||
*DownloadPost* Triggered when a download has completed
|
||||
*LocationChange* Triggered when changing tabs or when navigating to a new location
|
||||
|
||||
@@ -153,6 +153,7 @@ section:Ex{nbsp}commands[ex-cmd-index,:index]
|
||||
||:cmap|| Map a key sequence in command-line mode +
|
||||
||:cmapclear|| Remove all mappings in command-line mode +
|
||||
||:cnoremap|| Map a key sequence without remapping keys in command-line mode +
|
||||
||:colorscheme|| Load a color scheme +
|
||||
||:comclear|| Delete all user-defined commands +
|
||||
||:command|| List and define commands +
|
||||
||:cunabbrev|| Remove an abbreviation in command-line mode +
|
||||
|
||||
@@ -7,6 +7,16 @@ styling is specified via CSS. Although you may style any user interface element
|
||||
via the [c]:style[c] command, most Vimperator elements can be styled with the
|
||||
[c]:highlight[c] command, for convenience.
|
||||
|
||||
|E185| |:colo| |:colorscheme| +
|
||||
||:colo[rscheme] {name}|| +
|
||||
________________________________________________________________________________
|
||||
Load a color scheme. {name} is found by searching the 'runtimepath' for the
|
||||
first file matching colors/{name}.vimp.
|
||||
|
||||
The ColorScheme autocommand is triggered after the color scheme has been
|
||||
sourced.
|
||||
________________________________________________________________________________
|
||||
|
||||
|:hi| |:highlight| +
|
||||
||:hi[light][!] [-append] {group}[{selector}] [{css}]|| +
|
||||
________________________________________________________________________________
|
||||
|
||||
@@ -19,11 +19,11 @@ unlet b:current_syntax
|
||||
syn match vimperatorCommandStart "\%(^\s*:\=\)\@<=" nextgroup=vimperatorCommand,vimperatorAutoCmd
|
||||
|
||||
syn keyword vimperatorCommand ab[breviate] ab[clear] addo[ns] b[uffer] ba[ck] bd[elete] beep bf[irst] bl[ast] bma[rk] bmarks
|
||||
\ bn[ext] bN[ext] bp[revious] br[ewind] buffers bun[load] bw[ipeout] ca[bbrev] cabc[lear] cd chd[ir] cuna[bbrev] cm[ap]
|
||||
\ cmapc[lear] cno[remap] comc[lear] com[mand] cu[nmap] do[autocmd] doautoa[ll] delbm[arks] delc[ommand] delmac[ros] delm[arks]
|
||||
\ delqm[arks] dels[tyle] dia[log] dl downl[oads] e[dit] ec[ho] echoe[rr] echom[sg] em[enu] exe[cute] exu[sage] fini[sh] files
|
||||
\ fo[rward] fw h[elp] ha[rdcopy] hi[ghlight] hist[ory] hs ia[bbrev] iabc[lear] im[ap] imapc[lear] ino[remap] iuna[bbrev]
|
||||
\ iu[nmap] javas[cript] ju[mps] js let ls macros ma[rk] map mapc[lear] marks mes[sages] mkv[imperatorrc] no[remap]
|
||||
\ bn[ext] bN[ext] bp[revious] br[ewind] buffers bun[load] bw[ipeout] ca[bbrev] cabc[lear] cd chd[ir] colo[rscheme] cuna[bbrev]
|
||||
\ cm[ap] cmapc[lear] cno[remap] comc[lear] com[mand] cu[nmap] do[autocmd] doautoa[ll] delbm[arks] delc[ommand] delmac[ros]
|
||||
\ delm[arks] delqm[arks] dels[tyle] dia[log] dl downl[oads] e[dit] ec[ho] echoe[rr] echom[sg] em[enu] exe[cute] exu[sage]
|
||||
\ fini[sh] files fo[rward] fw h[elp] ha[rdcopy] hi[ghlight] hist[ory] hs ia[bbrev] iabc[lear] im[ap] imapc[lear] ino[remap]
|
||||
\ iuna[bbrev] iu[nmap] javas[cript] ju[mps] js let ls macros ma[rk] map mapc[lear] marks mes[sages] mkv[imperatorrc] no[remap]
|
||||
\ noh[lsearch] norm[al] o[pen] optionu[sage] pa[geinfo] pagest[yle] pc[lose] pl[ay] pref[erences] prefs pw[d] q[uit] qa[ll]
|
||||
\ qma[rk] qmarks quita[ll] re[draw] re[load] reloada[ll] res[tart] run runt[ime] sty[le] sav[eas] sb[ar] sb[open] sbcl[ose]
|
||||
\ scrip[tnames] se[t] setg[lobal] setl[ocal] sideb[ar] so[urce] st[op] tN[ext] t[open] tab tabde[tach] tabd[uplicate]
|
||||
|
||||
Reference in New Issue
Block a user