84 lines
1.6 KiB
Nix
84 lines
1.6 KiB
Nix
{ config, pkgs, ... }:
|
|
|
|
let
|
|
emacsWithPackages = (pkgs.emacsPackagesFor pkgs.emacs).emacsWithPackages;
|
|
in {
|
|
programs.emacs = {
|
|
enable = true;
|
|
extraConfig = ''
|
|
(load-theme 'catppuccin :no-confirm)
|
|
(global-display-line-numbers-mode 1)
|
|
(telephone-line-mode 1)
|
|
|
|
(menu-bar-mode -1)
|
|
|
|
(require 'which-key)
|
|
(which-key-mode)
|
|
|
|
(require 'evil-god-state)
|
|
(evil-define-key 'normal global-map "," 'evil-execute-in-god-state)
|
|
|
|
(which-key-enable-god-mode-support)
|
|
|
|
(require 'nix-mode)
|
|
(add-to-list 'auto-mode-alist '("\\.nix\\'" . nix-mode))
|
|
|
|
(setq evil-want-C-u-scroll t)
|
|
|
|
(require 'evil)
|
|
|
|
(evil-mode 1)
|
|
|
|
(global-flycheck-mode 1)
|
|
|
|
(evil-define-key 'god global-map [escape] 'evil-god-state-bail)
|
|
|
|
(require 'smex)
|
|
(smex-initialize)
|
|
|
|
(global-set-key (kbd "M-x") 'smex)
|
|
(global-set-key (kbd "M-X") 'smex-major-mode-commands)
|
|
;; This is your old M-x.
|
|
(global-set-key (kbd "C-c C-c M-x") 'execute-extended-command)
|
|
|
|
|
|
(add-hook 'prog-mode-hook #'rainbow-delimiters-mode)
|
|
|
|
(setq gc-cons-threshold (* 100 1024 1024)
|
|
read-process-output-max (* 1024 1024))
|
|
|
|
;;Exit insert mode by pressing j and then k quickly
|
|
(setq key-chord-two-keys-delay 0.5)
|
|
(key-chord-define evil-insert-state-map "jk" 'evil-normal-state)
|
|
(key-chord-mode 1)
|
|
|
|
'';
|
|
package = emacsWithPackages (epkgs: (with epkgs.melpaStablePackages; [
|
|
catppuccin-theme
|
|
])
|
|
++ (with epkgs.melpaPackages; [
|
|
evil
|
|
nix-mode
|
|
lsp-treemacs
|
|
flycheck
|
|
lsp-mode
|
|
company
|
|
rainbow-delimiters
|
|
undo-fu
|
|
key-chord
|
|
telephone-line
|
|
smex
|
|
ranger
|
|
evil-god-state
|
|
which-key
|
|
magit
|
|
])
|
|
++ (with epkgs.elpaPackages; [
|
|
undo-tree
|
|
])
|
|
++ [ pkgs.notmuch ]);
|
|
};
|
|
}
|
|
|
|
|