emacs.d/init.el
2026-05-20 23:29:11 +02:00

75 lines
2.1 KiB
EmacsLisp

(setq custom-file "./custom")
(setq display-line-numbers-type 'relative)
(global-display-line-numbers-mode 1)
(tool-bar-mode 0)
(menu-bar-mode 0)
(scroll-bar-mode 0)
(column-number-mode 1)
(setq select-enable-clipboard t)
(setq-default truncate-lines t)
(setq make-backup-files nil
auto-save-default nil)
;; keys
(global-set-key (kbd "C-c C-c") 'comment-line)
(require 'package)
(setq package-archives
'(("melpa" . "https://melpa.org/packages/")
("gnu" . "https://elpa.gnu.org/packages/")))
(package-initialize)
(unless package-archive-contents (package-refresh-contents))
(setq use-package-always-ensure t)
(require 'use-package)
(setq evil-want-C-u-scroll t
evil-want-keybinding nil
evil-want-integration t
evil-undo-system 'undo-tree)
(use-package undo-tree
:config
(global-undo-tree-mode))
(use-package evil
:config
(evil-mode 1))
(add-to-list 'evil-emacs-state-modes 'dired-mode)
(use-package fzf
:bind
;; Don't forget to set keybinds!
:config
(setq fzf/args "-x --color bw --print-query --margin=1,0 --no-hscroll"
fzf/executable "fzf"
fzf/git-grep-args "-i --line-number %s"
;; command used for `fzf-grep-*` functions
;; example usage for ripgrep:
fzf/grep-command "rg --no-heading -nH"
;; fzf/grep-command "grep -nrH"
;; If nil, the fzf buffer will appear at the top of the window
fzf/position-bottom t
fzf/window-height 15))
(use-package tree-sitter-langs
:config
(global-undo-tree-mode))
;; window-management
(use-package zoom-window
:ensure t
:config
(setq zoom-window-mode-line-color "DarkGreen"))
;; :bind ("C-w z" . zoom-window-zoom))
(global-set-key (kbd "C-x C-w") 'kill-region) ;; move original action
(global-set-key (kbd "C-w") nil) ;; free C-w as prefix
(define-key global-map (kbd "C-w z") 'zoom-window-zoom)
(define-key global-map (kbd "C-c f f") 'fzf-git-files)
(define-key global-map (kbd "C-c f a") 'fzf-find-file)
(define-key global-map (kbd "C-c f b") 'fzf-switch-buffer)
(load-theme 'modus-vivendi-tinted)