From 3167d92a80dc322eb94da005273cad7f2352a901 Mon Sep 17 00:00:00 2001 From: Julian Teu Date: Mon, 22 Jan 2018 22:12:52 +0100 Subject: Added workspaces --- .emacs | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/.emacs b/.emacs index 51143ce..09f49dd 100644 --- a/.emacs +++ b/.emacs @@ -8,6 +8,8 @@ (when (< emacs-major-version 24) ;; For important compatibility libraries like cl-lib (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))) +(add-to-list 'package-archives + '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) ;; You might already have this line (add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t) @@ -97,3 +99,48 @@ (setq backup-directory-alist `(("." . ,(concat user-emacs-directory "backups")))) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Custom splitting functions ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defun vsplit-last-buffer () + (interactive) + (split-window-vertically) + (other-window 1 nil) + (switch-to-next-buffer) + ) +(defun hsplit-last-buffer () + (interactive) + (split-window-horizontally) + (other-window 1 nil) + (switch-to-next-buffer) + ) + +(global-set-key (kbd "C-x 2") 'vsplit-last-buffer) +(global-set-key (kbd "C-x 3") 'hsplit-last-buffer) + + +(global-set-key (kbd "C-å C-b") 'windmove-left) +(global-set-key (kbd "C-å C-f") 'windmove-right) +(global-set-key (kbd "C-å C-p") 'windmove-up) +(global-set-key (kbd "C-å C-n") 'Windmove-down) + + +(windmove-default-keybindings) + +(require 'buffer-move) +(global-set-key (kbd "") 'buf-move-up) +(global-set-key (kbd "") 'buf-move-down) +(global-set-key (kbd "") 'buf-move-left) +(global-set-key (kbd "") 'buf-move-right) + + +(require 'workgroups2) + +(workgroups-mode 1) + +(defun switch-to-last-buffer () + (interactive) + (switch-to-buffer nil)) + +(global-set-key (kbd "C-") 'switch-to-last-buffer) -- cgit v1.2.3