diff --git a/emacs/init.el b/emacs/init.el index f4d82a0..7790a71 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -1,7 +1,7 @@ (require 'package) (setq package-enable-at-startup nil) (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/")) (package-initialize) @@ -9,6 +9,11 @@ (package-refresh-contents) (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-to-list 'load-path "~/Development/util/tern/emacs/") (autoload 'tern-mode "tern.el" nil t) @@ -68,8 +73,24 @@ :ensure t) (use-package helm :ensure t - :bind(:map helm-mode-map - ("C-c h" . helm-execute-persistent-action))) + :diminish helm-mode + :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 @@ -79,7 +100,7 @@ ;; If there is more than one, they won't work right. '(package-selected-packages (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 was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/slate.js b/slate.js index 8558ebb..38de9b1 100644 --- a/slate.js +++ b/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", { x: "screenOriginX", y: "screenOriginY", @@ -60,12 +80,15 @@ function googleChromeLayout(windowObject) { var title = windowObject.title(); slate.log(title); if (title !== undefined && title.match(/^Grafana.+$/)) { - windowObject.doOperation(moveScreen2); + windowObject.doOperation(moveScreen1); windowObject.doOperation(full); + }else if (title !== undefined && title.match(/Google Play Music.+$/)) { + windowObject.doOperation(moveScreen0); + windowObject.doOperation(middleThird); } else if (title !== undefined && title == "Postman") { //do nothing } else { - windowObject.doOperation(moveScreen5); + windowObject.doOperation(moveScreen1); 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) { if (!win) { return; @@ -180,21 +224,17 @@ var screen4Full = slate.operation("move", { height: "screenSizeY", screen: "4" }); -var sixMonitorLayout = slate.layout("sixMonitor", { + + +var threeMonitorLayout= slate.layout("threeMonitor", { "Slack": { - "operations": [moveScreen0, topHalf], - "main-first": true, - "ignore-fail": true, - "repeat": true - }, - "HipChat": { - "operations": [moveScreen0, topHalf], + "operations": [moveScreen0, topThird], "main-first": true, "ignore-fail": true, "repeat": true }, "Microsoft Outlook": { - "operations": [screen0Bottom], + "operations": [moveScreen0, bottomThird], "main-first": true, "ignore-fail": true, "repeat": true @@ -211,30 +251,31 @@ var sixMonitorLayout = slate.layout("sixMonitor", { "ignore-fail": true }, "PyCharm": { - "operations": [screen3Full], + "operations": [moveScreen2, full], "main-first": true, "ignore-fail": true, "repeat": true }, "WebStorm": { - "operations": [screen4Full], + "operations": [moveScreen2, full], "main-first": true, "ignore-fail": true, "repeat": true } }); + 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", { - name: sixMonitorLayout + name: threeMonitorLayout }).run(); }