-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhznsfk.js
135 lines (120 loc) · 2.61 KB
/
hznsfk.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
settings.smoothScroll = true;
const {
unmap,
iunmap,
vunmap,
aceVimMap,
mapkey,
imap,
imapkey,
getClickableElements,
vmapkey,
map,
cmap,
addSearchAlias,
removeSearchAlias,
tabOpenLink,
readText,
Clipboard,
Front,
Hints,
Visual,
RUNTIME
} = api;
// set theme
settings.theme = `
.sk_theme {
font-family: Input Sans Condensed, Charcoal, sans-serif;
font-size: 10pt;
background: #24272e;
color: #abb2bf;
}
.sk_theme tbody {
color: #fff;
}
.sk_theme input {
color: #d0d0d0;
}
.sk_theme .url {
color: #61afef;
}
.sk_theme .annotation {
color: #56b6c2;
}
.sk_theme .omnibar_highlight {
color: #528bff;
}
.sk_theme .omnibar_timestamp {
color: #e5c07b;
}
.sk_theme .omnibar_visitcount {
color: #98c379;
}
.sk_theme #sk_omnibarSearchResult ul li:nth-child(odd) {
background: #303030;
}
.sk_theme #sk_omnibarSearchResult ul li.focused {
background: #3e4452;
}
#sk_status, #sk_find {
font-size: 20pt;
}`;
mapkey('yq', '#7Copy pre text', function () {
Hints.create("pre", function (element) {
Clipboard.write(element.innerText);
});
});
mapkey(',', '#8Bookmark current page to selected folder', function () {
var page = {
url: window.location.href,
title: document.title
};
Front.openOmnibar(({ type: "AddBookmark", extra: page }));
});
//搜索
map('\\', 'gi');
//滚动
map('j', 'd');
map('k', 'e');
map('a','e');
map('s','G');
map('q','E');
map('e','R');
map('gxz', 'gx0');
map('gxc', 'gx$');
//
//标签切换
map('J', 'E');
map('K', 'R');
map('h', 'E');
map('l', 'R');
//移动标签
map('H', '<<');
map('L', '>>');
//翻页
map('[', '[[');
map(']', ']]');
//设置无论开多少标签都不用框子来选择标签,方便快捷键
settings.tabsThreshold = 100;
mapkey('yet', '#7Copy a table', function() {
Hints.create("table", function(element) {
selectElement(element);
document.execCommand('copy');
// Clipboard.write(element.innerText);
});
});
selectElement = function (el) {
var range = document.createRange(),
selection = window.getSelection();
range.selectNodeContents(el);
selection.removeAllRanges();
selection.addRange(range);
}
mapkey('of','#8Open Search with alias f',function(){
Front.openOmnibar({type: "SearchEngine", extra: "f"});
});
addSearchAlias('f','f','https://fsoufsou.com/search?q=','s','https://fsoufsou.com/search?q=',function(rt){
var xst_bilirt=JSON.parse(rt.text);
if(xst_bilirt.code!='0')return [];
return xst_bilirt.result.tag.map(ele=>ele.value);
});