Skip to content

Commit

Permalink
Move emacs config to separate file
Browse files Browse the repository at this point in the history
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch main
# Your branch is up to date with 'origin/main'.
#
# Changes to be committed:
#	modified:   home/emacs.nix
#	new file:   home/emacs/init.el
#
  • Loading branch information
simonrw committed Dec 19, 2023
1 parent a8f6877 commit 4d17e55
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 40 deletions.
41 changes: 1 addition & 40 deletions home/emacs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,45 +18,6 @@
epkgs.nord-theme
epkgs.evil
];
extraConfig = ''
(blink-cursor-mode 0)
(setq inhibit-splash-screen t)
(setq inhibit-startup-message t)
(dolist (m '(tooltip-mode tool-bar-mode scroll-bar-mode menu-bar-mode))
(when (fboundp m) (funcall m -1)))
(show-paren-mode 1)
(prefer-coding-system 'utf-8)
(fset 'yes-or-no-p 'y-or-n-p)
(set-language-environment "UTF-8")
(set-buffer-file-coding-system 'utf-8)
(set-default 'truncate-lines nil)
(setq mouse-wheel-scroll-amount '(1 ((shift) . 5)))
(setq mouse-wheel-progressive-speed nil)
(setq mouse-wheel-follow-mouse t)
(add-hook 'before-save-hook 'delete-trailing-whitespace)
(global-visual-line-mode t)
(set-fringe-mode 10)
;; Enable nicer window moving
(when (fboundp 'windmove-default-keybindings)
(windmove-default-keybindings))
;; Disable visual bell
(setq visible-bell nil)
(setq ring-bell-function 'ignore)
(setq indent-tabs-mode nil)
(setq-default tab-width 4)
(set-face-attribute 'default nil :family "JetBrains Mono" :weight 'bold :height 140)
(set-face-attribute 'fixed-pitch nil :family "JetBrains Mono" :weight 'bold :height 140)
;; (set-face-attribute 'variable-pitch nil :family "Cantarell" :height 140)
(set-face-attribute 'default (selected-frame) :height 140)
;; of course
(evil-mode t)
(load-theme 'nord t)
'';
extraConfig = builtins.readFile ./emacs/init.el;
};
}
49 changes: 49 additions & 0 deletions home/emacs/init.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
(blink-cursor-mode 0)
(setq inhibit-splash-screen t)
(setq inhibit-startup-message t)
(dolist (m '(tooltip-mode tool-bar-mode scroll-bar-mode menu-bar-mode))
(when (fboundp m) (funcall m -1)))
(show-paren-mode 1)
(prefer-coding-system 'utf-8)
(fset 'yes-or-no-p 'y-or-n-p)
(set-language-environment "UTF-8")
(set-buffer-file-coding-system 'utf-8)
(set-default 'truncate-lines nil)
(setq mouse-wheel-scroll-amount '(1 ((shift) . 5)))
(setq mouse-wheel-progressive-speed nil)
(setq mouse-wheel-follow-mouse t)
(add-hook 'before-save-hook 'delete-trailing-whitespace)
(global-visual-line-mode t)
(set-fringe-mode 10)

;; Enable nicer window moving
(when (fboundp 'windmove-default-keybindings)
(windmove-default-keybindings))

;; Disable visual bell
(setq visible-bell nil)
(setq ring-bell-function 'ignore)

(setq indent-tabs-mode nil)
(setq-default tab-width 4)

;; configure ediff
(setq ediff-split-window-function 'split-window-horizontally
ediff-window-setup-function 'ediff-setup-windows-plain)

(defun srw-ediff-hook ()
(ediff-setup-keymap)
(define-key ediff-mode-map "j" 'ediff-next-difference)
(define-key ediff-mode-map "k" 'ediff-previous-difference))

(add-hook 'ediff-mode-hook 'srw-ediff-hook)

(set-face-attribute 'default nil :family "JetBrains Mono" :weight 'bold :height 120)
(set-face-attribute 'fixed-pitch nil :family "JetBrains Mono" :weight 'bold :height 120)
;; (set-face-attribute 'variable-pitch nil :family "Cantarell" :height 120)
(set-face-attribute 'default (selected-frame) :height 120)

;; of course
(evil-mode t)

(load-theme 'nord t)

0 comments on commit 4d17e55

Please sign in to comment.