summaryrefslogtreecommitdiff
path: root/emacs/.emacs
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2021-09-11 01:26:46 +0200
committerJulian T <julian@jtle.dk>2021-09-11 01:31:17 +0200
commit9acb10c41560bed47f67005375cc5fed61aeed1a (patch)
tree43b6287d7fdc319713aae2218ed298d596c7c4f9 /emacs/.emacs
parent090a5755db429ac1cdc0343a22abfcd9e16c9152 (diff)
Alter emacs keybindings
This commit replaces splitting, so they cursor is moved to the new frame. Also swaps C-h and C-x because h is a lot easier to hit.
Diffstat (limited to 'emacs/.emacs')
-rw-r--r--emacs/.emacs23
1 files changed, 20 insertions, 3 deletions
diff --git a/emacs/.emacs b/emacs/.emacs
index f051328..232b2e5 100644
--- a/emacs/.emacs
+++ b/emacs/.emacs
@@ -10,8 +10,8 @@
'geiser-racket
'company
'nix-mode
- 'lsp-mode
- 'magit
+ 'lsp-mode
+ 'magit
))
(mapc (lambda (pack)
@@ -21,6 +21,7 @@
(require 'use-package)
(require 'nix-mode)
+(require 'magit)
(use-package evil
:ensure t
@@ -43,10 +44,26 @@
(global-hl-line-mode)
(global-display-line-numbers-mode)
(setq display-line-numbers-type 'relative)
-
(tool-bar-mode -1)
(toggle-scroll-bar -1)
+;; Keyboard bindings
+(defun split-and-follow-horizontal ()
+ (interactive)
+ (split-window-below)
+ (balance-windows)
+ (other-window 1))
+(global-set-key(kbd "C-x 2") 'split-and-follow-horizontal)
+(defun split-and-follow-vertical ()
+ (interactive)
+ (split-window-right)
+ (balance-windows)
+ (other-window 1))
+(global-set-key(kbd "C-x 3") 'split-and-follow-vertical)
+
+(keyboard-translate ?\C-h ?\C-x)
+(keyboard-translate ?\C-x ?\C-h)
+
;; Completion
(require 'lsp-mode)