diff --git a/init.el b/init.el index 963bde4..8584ba6 100644 --- a/init.el +++ b/init.el @@ -16,10 +16,12 @@ ;;==================== ;; Custom Bindings: -;; [ F6 ] -> Toggle line-wrapping -;; [ F7 ] -> Toggle linum-mode -;; [ C-x C-b ] -> (Overwritten) Invoke ibuffer -;; [ C-x RET ] -> Open eshell in the current buffer +;; [ F6 ] -> Toggle line-wrapping +;; [ F7 ] -> Toggle linum-mode +;; [ C-x C-b ] -> (Overwritten) Invoke ibuffer +;; [ C-x RET ] -> Open eshell in the current buffer +;; [ C-c ] -> Focus on the window in +;; [ M-n / M-p] -> Scroll up/down by one line ;; Default but Useful: ;; [ M-g M-g || M-g g ] -> Go to line number @@ -38,6 +40,26 @@ ;; Bind a key to open up eshell. (global-set-key (kbd "C-x RET") 'eshell) +;; Bind keys to switch windows easier. +(global-set-key (kbd "C-c ") 'windmove-up) +(global-set-key (kbd "C-c ") 'windmove-down) +(global-set-key (kbd "C-c ") 'windmove-left) +(global-set-key (kbd "C-c ") 'windmove-right) + +;; Bind keys to scroll up/down by one line +(defun scroll-up-line-nm () + (interactive) + (setq scroll-margin 0) + (scroll-up-line) + (setq scroll-margin 6)) +(defun scroll-down-line-nm () + (interactive) + (setq scroll-margin 0) + (scroll-down-line) + (setq scroll-margin 6)) +(global-set-key (kbd "M-n") 'scroll-up-line-nm) +(global-set-key (kbd "M-p") 'scroll-down-line-nm) + ;;==================== ;; Variables/Basic Config. ;;====================