diff --git a/emacs/init.el b/emacs/init.el index c3d88df..fbfc09e 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -23,7 +23,7 @@ ;; If there is more than one, they won't work right. '(package-selected-packages (quote - (vue-mode jedi-direx multi-web-mode web-mode quack elpy importmagic py-autopep8 flycheck excorporate ivy nginx-mode helm-projectile projectile json-mode jinja2-mode company-terraform terraform-mode yaml-mode company racer rust-mode magit theme-looper myterminal-controls meta-presenter which-key dired-launch material-theme neotree undo-tree ztree buffer-move powerline ace-window ace-jump-mode multiple-cursors helm)))) + (csharp-mode dired-dups swift-mode highlight-indent-guides rainbow-delimiters vue-mode multi-web-mode web-mode quack elpy importmagic py-autopep8 flycheck excorporate ivy nginx-mode helm-projectile projectile json-mode jinja2-mode company-terraform terraform-mode yaml-mode company racer rust-mode magit theme-looper myterminal-controls meta-presenter which-key dired-launch material-theme neotree undo-tree ztree buffer-move powerline ace-window ace-jump-mode multiple-cursors helm)))) (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/emacs/super-emacs/file-modes.el b/emacs/super-emacs/file-modes.el index 7dad277..5500c35 100644 --- a/emacs/super-emacs/file-modes.el +++ b/emacs/super-emacs/file-modes.el @@ -4,10 +4,9 @@ -(defvar dwlisp-mode-hook nil) -(add-to-list 'auto-mode-alist '("\\.lisp\\'" . dwlisp-mode)) -(define-derived-mode dwlisp-mode - lisp-mode "dwlisp" - "major mode for dwlisp" - (setq lisp-body-indent 2)) +(setq lisp-body-indent 2) + +;cc mode +(setq c-default-style "linux" + c-basic-offset 4) diff --git a/emacs/super-emacs/interface.el b/emacs/super-emacs/interface.el index 31ba3b0..5e8b5d2 100644 --- a/emacs/super-emacs/interface.el +++ b/emacs/super-emacs/interface.el @@ -1,6 +1,6 @@ ;Change title-bar text (setq frame-title-format - "%b %F") + "%F %b ") ;Disable menu-bar (menu-bar-mode -1) @@ -21,3 +21,11 @@ ;line numbers (global-linum-mode) + + ;; ITERM2 MOUSE SUPPORT +(unless window-system + (require 'mouse) + (xterm-mouse-mode t) + (defun track-mouse (e)) + (setq mouse-sel-mode t) + ) diff --git a/emacs/super-emacs/misc.el b/emacs/super-emacs/misc.el index 111f4b5..0fd1d80 100644 --- a/emacs/super-emacs/misc.el +++ b/emacs/super-emacs/misc.el @@ -22,6 +22,7 @@ (global-whitespace-mode) (setq whitespace-line-column 500) +(add-hook 'before-save-hook 'delete-trailing-whitespace) ;Enable winner-mode (winner-mode t) @@ -70,3 +71,27 @@ (setq clean-buffer-list-kill-never-regexps (append '("^\\*EMMS Playlist\\*.*$") clean-buffer-list-kill-never-regexps-init)) + + +;https://stackoverflow.com/questions/43765/pin-emacs-buffers-to-windows-for-cscope +(defun toggle-window-dedicated () + +"Toggle whether the current active window is dedicated or not" + +(interactive) + +(message + + (if (let (window (get-buffer-window (current-buffer))) + + (set-window-dedicated-p window + + (not (window-dedicated-p window)))) + + "Window '%s' is dedicated" + + "Window '%s' is normal") + + (current-buffer))) + +(global-set-key (kbd "") 'toggle-window-dedicated) diff --git a/emacs/super-emacs/packages.el b/emacs/super-emacs/packages.el index c0129c2..72b8c96 100644 --- a/emacs/super-emacs/packages.el +++ b/emacs/super-emacs/packages.el @@ -56,27 +56,15 @@ (setq company-minimum-prefix-length 2) (global-company-mode) -;; (defvar company-mode-whitelist -;; '( -;; js-mode-hook -;; python-mode-hook -;; rust-mode-hook -;; lisp-mode-hook -;; terraform-mode-hook -;; org-mode-hook -;; )) -;; (mapc (lambda (h) -;; (add-hook h #'company-mode)) -;; company-mode-whitelist) ;Set up ace-jump-mode -(autoload 'ace-jump-mode - "ace-jump-mode" +(autoload 'ace-jump-mode + "ace-jump-mode" "Emacs quick move minor mode" t) -(autoload 'ace-jump-mode-pop-mark - "ace-jump-mode" +(autoload 'ace-jump-mode-pop-mark + "ace-jump-mode" "Ace jump back:-" t) @@ -85,6 +73,7 @@ (setq powerline-default-separator 'slant) + ;Configure theme-looper (theme-looper-set-theme-set '(deeper-blue wheatgrass @@ -144,3 +133,10 @@ ;;flycheck (setq flycheck-flake8-maximum-line-length 500) + + +(add-hook 'prog-mode-hook 'rainbow-delimiters-mode) + +(require 'semantic) +(semantic-mode 1) +(global-semantic-stickyfunc-mode 1) diff --git a/slate.js b/slate.js index 2be04a1..5896ff2 100644 --- a/slate.js +++ b/slate.js @@ -52,6 +52,14 @@ var full = slate.operation("move", { width: "screenSizeX", height: "screenSizeY" }); + +var fullDubble = slate.operation("move", { + x: "screenOriginX", + y: "screenOriginY", + width: "screenSizeX*2", + height: "screenSizeY" +}); + var topLeft = S.op("corner", { "direction": "top-left", "width": "screenSizeX/2", @@ -60,7 +68,7 @@ var topLeft = S.op("corner", { var topLeftShort = S.op("corner", { "direction": "top-left", "width": "screenSizeX/2", - "height": "screenSizeY/4" + "height": "screenSizeY*0.40" }); var topRight = S.op("corner", { @@ -76,7 +84,7 @@ var bottomLeft = S.op("corner", { var bottomLeftTall = S.op("corner", { "direction": "bottom-left", "width": "screenSizeX/2", - "height": "screenSizeY*0.63" + "height": "screenSizeY*0.6" }); var bottomRight = S.op("corner", { @@ -196,6 +204,14 @@ var threeMonitorLayout = slate.layout("threeMonitor", { "repeat": true, "ignore-fail": true }, + "Firefox": { + "operations": [function(wo) { + wo.doOperation(moveScreen1); + wo.doOperation(full); + }], + "repeat": true, + "ignore-fail": true + }, "PyCharm Community Edition": { "operations": [function(wo) { wo.doOperation(moveScreen2); @@ -234,10 +250,129 @@ var threeMonitorLayout = slate.layout("threeMonitor", { } }); +var fourMonitorLayout = slate.layout("fourMonitor", { + "Slack": { + "operations": [function(wo) { + wo.doOperation(moveScreen0); + wo.doOperation(topLeftShort); + }], + "main-first": true, + "ignore-fail": true, + "repeat": true + }, + "Microsoft Outlook": { + "operations": [function(wo) { + wo.doOperation(moveScreen0); + wo.doOperation(bottomLeftTall); + }], + "main-first": true, + "ignore-fail": false, + "repeat": true + }, + "Google Play Music Desktop Player": { + "operations": [function(wo) { + wo.doOperation(moveScreen0); + wo.doOperation(bottomRight); + }], + "main-first": true, + "ignore-fail": false, + "repeat": true + }, + "VMware Fusion": { + "operations": [function(wo) { + wo.doOperation(moveScreen1); + wo.doOperation(full); + }], + "main-first": true, + "ignore-fail": true, + "repeat": true + }, + "Google Chrome": { + "operations": [googleChromeLayout], + "repeat": true, + "ignore-fail": true + }, + "Firefox": { + "operations": [function(wo) { + wo.doOperation(moveScreen0); + wo.doOperation(full); + }], + "repeat": true, + "ignore-fail": true + }, + "PyCharm Community Edition": { + "operations": [function(wo) { + wo.doOperation(moveScreen2); + wo.doOperation(full); + }], + "main-first": true, + "ignore-fail": true, + "repeat": true + }, + "WebStorm": { + "operations": [function(wo) { + wo.doOperation(moveScreen2); + wo.doOperation(full); + }], + "main-first": true, + "ignore-fail": true, + "repeat": true + }, + "Xcode": { + "operations": [function(wo) { + wo.doOperation(moveScreen2); + wo.doOperation(full); + }], + "main-first": true, + "ignore-fail": true, + "repeat": true + }, + "Android Studio": { + "operations": [function(wo) { + wo.doOperation(moveScreen2); + wo.doOperation(full); + }], + "main-first": true, + "ignore-fail": true, + "repeat": true + }, + "Emacs": { + "operations": [function(wo) { + wo.doOperation(moveScreen3); + wo.doOperation(full); + }], + "main-first": true, + "ignore-fail": true, + "repeat": true + }, + "iTerm2": { + "operations": [function(wo) { + wo.doOperation(moveScreen1); + wo.doOperation(full); + }], + "main-first": true, + "ignore-fail": true, + "repeat": true + } +}); -slate.bind("a:ctrl,alt,cmd", slate.operation("layout", { - name: threeMonitorLayout -})); + +slate.bind("f:ctrl,cmd", fullDubble) + +slate.bind("a:ctrl,alt,cmd", function(wo){ + +if (slate.screenCount() == 3) { + slate.operation("layout", { + name: threeMonitorLayout + }).run(); +} +if (slate.screenCount() == 4) { + slate.operation("layout", { + name: fourMonitorLayout + }).run(); +} + +}); @@ -248,6 +383,11 @@ if (slate.screenCount() == 3) { name: threeMonitorLayout }).run(); } +if (slate.screenCount() == 4) { + slate.operation("layout", { + name: fourMonitorLayout + }).run(); +} slate.log("screen count " + slate.screenCount()); slate.eachScreen(function(screenObject) {