nixify emacs

This commit is contained in:
illustris committed 2023-04-06 03:22:48 +05:30
1 parent b782a63334
commit 4e482a6442
3 files changed
+60 -2

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
;; Set keybindings for cycling buffers
(global-set-key [C-prior] 'previous-buffer)
(global-set-key [C-next] 'next-buffer)
(setq mouse-yank-at-point t)
(setq load-prefer-newer t)
(setq-default c-basic-offset 8
tab-width 8
indent-tabs-mode t)
(global-set-key (kbd "C-x k") 'kill-this-buffer)
(put 'scroll-left 'disabled nil)
(load-theme 'cobalt t t)
(enable-theme 'cobalt)
(defun toggle-indentation ()
"Toggle between tabs and spaces for indentation."
(interactive)
(if indent-tabs-mode
(progn
(setq-local indent-tabs-mode nil)
(setq-local tab-width 2)
)
(progn
(setq-local indent-tabs-mode t)
(setq-local tab-width 8)
)
)
(message "Indentation set to: %s" (if indent-tabs-mode "tabs" "spaces"))
)
(eval-after-load 'nix-mode
(add-hook 'nix-mode-hook
(lambda ()
(define-key nix-mode-map (kbd "<f8>") 'toggle-indentation)
(setq-local indent-tabs-mode t)
(setq-local tab-width 8)
)
)
)