better emacs, better slate
This commit is contained in:
parent
429e5e5389
commit
efd43b0cde
@ -1,7 +1,7 @@
|
|||||||
(require 'package)
|
(require 'package)
|
||||||
(setq package-enable-at-startup nil)
|
(setq package-enable-at-startup nil)
|
||||||
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
|
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
|
||||||
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))
|
(add-to-list 'package-archives '("marmalade" . "https://marmalade-repo.org/packages/"))
|
||||||
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))
|
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))
|
||||||
(package-initialize)
|
(package-initialize)
|
||||||
|
|
||||||
@ -9,6 +9,11 @@
|
|||||||
(package-refresh-contents)
|
(package-refresh-contents)
|
||||||
(package-install 'use-package))
|
(package-install 'use-package))
|
||||||
|
|
||||||
|
|
||||||
|
(autoload 'dired-async-mode "dired-async.el" nil t)
|
||||||
|
(dired-async-mode 1)
|
||||||
|
(async-bytecomp-package-mode 1)
|
||||||
|
|
||||||
;;add ternjs to emacs
|
;;add ternjs to emacs
|
||||||
(add-to-list 'load-path "~/Development/util/tern/emacs/")
|
(add-to-list 'load-path "~/Development/util/tern/emacs/")
|
||||||
(autoload 'tern-mode "tern.el" nil t)
|
(autoload 'tern-mode "tern.el" nil t)
|
||||||
@ -68,8 +73,24 @@
|
|||||||
:ensure t)
|
:ensure t)
|
||||||
(use-package helm
|
(use-package helm
|
||||||
:ensure t
|
:ensure t
|
||||||
:bind(:map helm-mode-map
|
:diminish helm-mode
|
||||||
("C-c h" . helm-execute-persistent-action)))
|
:init (progn
|
||||||
|
(require 'helm-config)
|
||||||
|
(helm-mode)
|
||||||
|
)
|
||||||
|
:bind(("C-c h" . helm-mini)
|
||||||
|
("C-h a" . helm-apropos)
|
||||||
|
("C-x C-b" . helm-buffers-list)
|
||||||
|
("C-x b" . helm-buffers-list)
|
||||||
|
("M-y" . helm-show-kill-ring)
|
||||||
|
("M-x" . helm-M-x)
|
||||||
|
("C-x c o" . helm-occur)
|
||||||
|
("C-x c s" . helm-swoop)
|
||||||
|
("C-x c y" . helm-yas-complete)
|
||||||
|
("C-x c Y" . helm-yas-create-snippet-on-region)
|
||||||
|
("C-x c b" . my/helm-do-grep-book-notes)
|
||||||
|
("C-x c SPC" . helm-all-mark-rings))
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
(custom-set-variables
|
(custom-set-variables
|
||||||
@ -79,7 +100,7 @@
|
|||||||
;; If there is more than one, they won't work right.
|
;; If there is more than one, they won't work right.
|
||||||
'(package-selected-packages
|
'(package-selected-packages
|
||||||
(quote
|
(quote
|
||||||
(jq-mode web-beautify use-package tern-auto-complete rustfmt racer neotree magit json-reformat js2-highlight-vars jedi helm flymake-rust flycheck-rust csharp-mode company-jedi cargo))))
|
(go-mode jq-mode web-beautify use-package tern-auto-complete rustfmt racer neotree magit json-reformat js2-highlight-vars jedi helm flymake-rust flycheck-rust csharp-mode company-jedi cargo))))
|
||||||
(custom-set-faces
|
(custom-set-faces
|
||||||
;; custom-set-faces was added by Custom.
|
;; custom-set-faces was added by Custom.
|
||||||
;; If you edit it by hand, you could mess it up, so be careful.
|
;; If you edit it by hand, you could mess it up, so be careful.
|
||||||
|
75
slate.js
75
slate.js
@ -13,6 +13,26 @@ var rightHalf = slate.operation("move", {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
var topThird = slate.operation("move", {
|
||||||
|
x: "screenOriginX",
|
||||||
|
y: "screenOriginY",
|
||||||
|
width: "screenSizeX",
|
||||||
|
height: "screenSizeY/3"
|
||||||
|
});
|
||||||
|
|
||||||
|
var middleThird = slate.operation("move", {
|
||||||
|
x: "screenOriginX",
|
||||||
|
y: "screenOriginY+screenSizeY/3",
|
||||||
|
width: "screenSizeX",
|
||||||
|
height: "screenSizeY/3"
|
||||||
|
});
|
||||||
|
var bottomThird = slate.operation("move", {
|
||||||
|
x: "screenOriginX",
|
||||||
|
y: "screenOriginY+screenSizeY*0.66666",
|
||||||
|
width: "screenSizeX",
|
||||||
|
height: "screenSizeY/3"
|
||||||
|
|
||||||
|
});
|
||||||
var topHalf = slate.operation("move", {
|
var topHalf = slate.operation("move", {
|
||||||
x: "screenOriginX",
|
x: "screenOriginX",
|
||||||
y: "screenOriginY",
|
y: "screenOriginY",
|
||||||
@ -60,12 +80,15 @@ function googleChromeLayout(windowObject) {
|
|||||||
var title = windowObject.title();
|
var title = windowObject.title();
|
||||||
slate.log(title);
|
slate.log(title);
|
||||||
if (title !== undefined && title.match(/^Grafana.+$/)) {
|
if (title !== undefined && title.match(/^Grafana.+$/)) {
|
||||||
windowObject.doOperation(moveScreen2);
|
windowObject.doOperation(moveScreen1);
|
||||||
windowObject.doOperation(full);
|
windowObject.doOperation(full);
|
||||||
|
}else if (title !== undefined && title.match(/Google Play Music.+$/)) {
|
||||||
|
windowObject.doOperation(moveScreen0);
|
||||||
|
windowObject.doOperation(middleThird);
|
||||||
} else if (title !== undefined && title == "Postman") {
|
} else if (title !== undefined && title == "Postman") {
|
||||||
//do nothing
|
//do nothing
|
||||||
} else {
|
} else {
|
||||||
windowObject.doOperation(moveScreen5);
|
windowObject.doOperation(moveScreen1);
|
||||||
windowObject.doOperation(full);
|
windowObject.doOperation(full);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -78,6 +101,27 @@ slate.bind("down:cmd,alt", function (win) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
slate.bind("up:cmd,ctrl", function (win) {
|
||||||
|
if (!win) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
win.doOperation(topThird);
|
||||||
|
});
|
||||||
|
slate.bind("down:cmd,ctrl", function (win) {
|
||||||
|
if (!win) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
win.doOperation(bottomThird);
|
||||||
|
});
|
||||||
|
|
||||||
|
slate.bind("m:cmd,ctrl", function (win) {
|
||||||
|
if (!win) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
win.doOperation(middleThird);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
slate.bind("up:cmd,alt", function (win) {
|
slate.bind("up:cmd,alt", function (win) {
|
||||||
if (!win) {
|
if (!win) {
|
||||||
return;
|
return;
|
||||||
@ -180,21 +224,17 @@ var screen4Full = slate.operation("move", {
|
|||||||
height: "screenSizeY",
|
height: "screenSizeY",
|
||||||
screen: "4"
|
screen: "4"
|
||||||
});
|
});
|
||||||
var sixMonitorLayout = slate.layout("sixMonitor", {
|
|
||||||
|
|
||||||
|
var threeMonitorLayout= slate.layout("threeMonitor", {
|
||||||
"Slack": {
|
"Slack": {
|
||||||
"operations": [moveScreen0, topHalf],
|
"operations": [moveScreen0, topThird],
|
||||||
"main-first": true,
|
|
||||||
"ignore-fail": true,
|
|
||||||
"repeat": true
|
|
||||||
},
|
|
||||||
"HipChat": {
|
|
||||||
"operations": [moveScreen0, topHalf],
|
|
||||||
"main-first": true,
|
"main-first": true,
|
||||||
"ignore-fail": true,
|
"ignore-fail": true,
|
||||||
"repeat": true
|
"repeat": true
|
||||||
},
|
},
|
||||||
"Microsoft Outlook": {
|
"Microsoft Outlook": {
|
||||||
"operations": [screen0Bottom],
|
"operations": [moveScreen0, bottomThird],
|
||||||
"main-first": true,
|
"main-first": true,
|
||||||
"ignore-fail": true,
|
"ignore-fail": true,
|
||||||
"repeat": true
|
"repeat": true
|
||||||
@ -211,30 +251,31 @@ var sixMonitorLayout = slate.layout("sixMonitor", {
|
|||||||
"ignore-fail": true
|
"ignore-fail": true
|
||||||
},
|
},
|
||||||
"PyCharm": {
|
"PyCharm": {
|
||||||
"operations": [screen3Full],
|
"operations": [moveScreen2, full],
|
||||||
"main-first": true,
|
"main-first": true,
|
||||||
"ignore-fail": true,
|
"ignore-fail": true,
|
||||||
"repeat": true
|
"repeat": true
|
||||||
},
|
},
|
||||||
"WebStorm": {
|
"WebStorm": {
|
||||||
"operations": [screen4Full],
|
"operations": [moveScreen2, full],
|
||||||
"main-first": true,
|
"main-first": true,
|
||||||
"ignore-fail": true,
|
"ignore-fail": true,
|
||||||
"repeat": true
|
"repeat": true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
slate.bind("a:ctrl,alt,cmd", slate.operation("layout", {
|
slate.bind("a:ctrl,alt,cmd", slate.operation("layout", {
|
||||||
name: sixMonitorLayout
|
name: threeMonitorLayout
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
slate.default(6, sixMonitorLayout);
|
slate.default(3, threeMonitorLayout);
|
||||||
|
|
||||||
if (slate.screenCount() == 6) {
|
if (slate.screenCount() == 3) {
|
||||||
slate.operation("layout", {
|
slate.operation("layout", {
|
||||||
name: sixMonitorLayout
|
name: threeMonitorLayout
|
||||||
}).run();
|
}).run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user