Selaa lähdekoodia

Merge branch 'master' of github.com:10sr/dotfiles

pull/1/head
10sr 11 vuotta sitten
vanhempi
commit
1501df106c
3 muutettua tiedostoa jossa 28 lisäystä ja 39 poistoa
  1. +22
    -30
      _keysnail.js
  2. +5
    -7
      emacs.el
  3. +1
    -2
      shrc

+ 22
- 30
_keysnail.js Näytä tiedosto

@@ -160,7 +160,7 @@ local["^https?://(www\.|cloud\.|)feedly\.com/"] = [
// }],
['l', function(ev, arg){
var host = window.content.location.host;
if (host === "cloud.feedly.com") {
if (host === "cloud.feedly.com" || host === "feedly.com") {
window.content.location.href = "http://" + host + "/#latest";
} else if (host === "www.feedly.com") {
window.content.location.href = "http://" + host + "/home#latest";
@@ -296,8 +296,8 @@ ext.add("my-index-html", function(ev, arg){
}, "open my index.html");

ext.add("echo-tab-info", function(){
var all = gBrowser.tabs.length;
var ix = gBrowser.mCurrentTab._tPos;
var all = getBrowser().tabs.length;
var ix = getBrowser().mCurrentTab._tPos;
var title = window.document.title;
var url = window.content.location.href;
display.echoStatusBar((ix + 1).toString() + " / " +
@@ -465,10 +465,10 @@ ext.add('auto-install-plugins', function(ev, arg){
}, 'Install plugins automatically if not installed yet.');

ext.add('put-aside-this-page', function (ev, arg) {
var n = gBrowser.mCurrentTab._tPos;
gBrowser.moveTabTo(gBrowser.mCurrentTab, 0);
var n = getBrowser().mCurrentTab._tPos;
getBrowser().moveTabTo(getBrowser().mCurrentTab, 0);
if (n != 0) {
gBrowser.selectedTab = gBrowser.mTabs[n];
getBrowser().selectedTab = getBrowser().mTabs[n];
}
}, 'put aside this page');

@@ -495,9 +495,9 @@ ext.add("hide-sidebar", function(){
}, "hide-sidebar");

ext.add("close-and-next-tab", function (ev, arg) {
var n = gBrowser.mCurrentTab._tPos;
gBrowser.removeCurrentTab();
gBrowser.selectedTab = gBrowser.mTabs[n];
var n = getBrowser().mCurrentTab._tPos;
getBrowser().removeCurrentTab();
getBrowser().selectedTab = getBrowser().mTabs[n];
}, "close and focus to next tab");

//////////////////////////////////////
@@ -693,7 +693,7 @@ ext.add("list-closed-tabs", function () {
ext.add("list-tab-history", function () {
const fav = "chrome://mozapps/skin/places/defaultFavicon.png";
var tabHistory = [];
var sessionHistory = gBrowser.webNavigation.sessionHistory;
var sessionHistory = getBrowser().webNavigation.sessionHistory;
if (sessionHistory.count < 1)
return void display.echoStatusBar("Tab history not exist", 2000);
var curIdx = sessionHistory.index;
@@ -720,7 +720,8 @@ ext.add("list-tab-history", function () {
header : ["Title", "URL"],
initialIndex : thIdx,
callback : function(i) {
if (i >= 0) gBrowser.webNavigation.gotoIndex(tabHistory[i][3]);
if (i >= 0)
getBrowser().webNavigation.gotoIndex(tabHistory[i][3]);
}
});
}, 'List tab history');
@@ -743,11 +744,10 @@ key.suspendKey = "Not defined";

// ================================= Hooks ================================= //


hook.setHook('KeyBoardQuit', function (aEvent) {
// ext.exec("hide-sidebar");
let(elem = document.commandDispatcher.focusedElement) elem && elem.blur();
gBrowser.focus();
getBrowser().focus();
content.focus();
command.closeFindBar();
if (util.isCaretEnabled()) {
@@ -774,14 +774,6 @@ hook.setHook('Unload', function () {

// ============================= Key bindings ============================== //

key.setGlobalKey('C-<right>', function () {
gBrowser.mTabContainer.advanceSelectedTab(1, true);
}, 'ひとつ右のタブへ');

key.setGlobalKey('C-<left>', function () {
gBrowser.mTabContainer.advanceSelectedTab(-1, true);
}, 'ひとつ左のタブへ');

key.setGlobalKey('C-<up>', function () {
var browser = getBrowser();
if (browser.mCurrentTab.previousSibling) {
@@ -803,7 +795,7 @@ key.setGlobalKey('C-<down>', function () {

key.setGlobalKey('<delete>', function (ev, arg) {
let (elem = document.commandDispatcher.focusedElement) elem && elem.blur();
gBrowser.focus();
getBrowser().focus();
content.focus();
}, 'コンテンツへフォーカス', true);

@@ -847,7 +839,7 @@ key.setViewKey(['t', 'p'], function (ev, arg) {
ext.exec("twitter-client-tweet-this-page", arg, ev);
}, 'このページのタイトルと URL を使ってつぶやく', true);

key.setViewKey('u', function (ev) {
key.setViewKey([['u'], ['S-SPC']], function (ev) {
goDoCommand("cmd_scrollPageUp");
}, '一画面分スクロールアップ');

@@ -913,7 +905,7 @@ key.setViewKey('a', function (ev, arg) {
allTabs.open();
}, 'alltabs.open');

key.setViewKey('d', function (ev) {
key.setViewKey([['d'], ['SPC']], function (ev) {
goDoCommand("cmd_scrollPageDown");
}, '一画面スクロールダウン');

@@ -1029,10 +1021,10 @@ key.setEditKey('C-o', function (ev) {
command.openLine(ev);
}, '行を開く (Open line)');

key.setViewKey('S-SPC', function (ev) {
goDoCommand("cmd_scrollPageUp");
}, '一画面分スクロールアップ');
key.setGlobalKey('C-<right>', function (ev) {
getBrowser().mTabContainer.advanceSelectedTab(1, true);
}, 'ひとつ右のタブへ');

key.setViewKey('SPC', function (ev) {
goDoCommand("cmd_scrollPageDown");
}, '一画面スクロールダウン');
key.setGlobalKey('C-<left>', function (ev) {
getBrowser().mTabContainer.advanceSelectedTab(-1, true);
}, 'ひとつ左のタブへ');

+ 5
- 7
emacs.el Näytä tiedosto

@@ -1007,18 +1007,16 @@ found, otherwise returns nil."
"https://raw.github.com/mooz/js2-mode/master/js2-mode.el"
t)
(lazy-load-eval 'js2-mode)
(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
(add-to-list 'auto-mode-alist '("\\.jsm\\'" . js2-mode))
;; (add-hook 'js2-mode-hook
;; (lambda ()
;; (add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
;; (add-to-list 'auto-mode-alist '("\\.jsm\\'" . js2-mode))
(add-hook 'js2-mode-hook
(lambda ()
(define-key js2-mode-map (kbd "C-m") (lambda ()
(interactive)
(js2-enter-key)
(indent-for-tab-command)))
(add-hook (kill-local-variable 'before-save-hook)
'js2-before-save)
;; (add-hook (kill-local-variable 'before-save-hook)
;; 'js2-before-save)
;; (add-hook 'before-save-hook
;; 'my-indent-buffer
;; nil
@@ -1364,7 +1362,7 @@ If called intearctively, find word at point."
t) ; save to file immediately after adding file to recentf list
(add-hook 'kill-emacs-hook
'recentf-load-list)
(run-with-idle-timer 5 t 'recentf-save-list)
;;(run-with-idle-timer 5 t 'recentf-save-list)
;; (add-hook 'find-file-hook
;; (lambda ()
;; (recentf-add-file default-directory)))


+ 1
- 2
shrc Näytä tiedosto

@@ -375,8 +375,7 @@ fi
# pwd
# }
cd(){
builtin cd "$@"
pwd
builtin cd "$@" && pwd
}

# pad


Ladataan…
Peruuta
Tallenna