;; -*- lexical-binding: nil -*- ;; Keybind reminder for self: ;; C-x C-f : enter a file / find one ;; C-x C-f RET "/ssh:USER@IP:" logs into sh via emacs ;; C-x C-f RET '"ssh:USER@IP|sudo::/path/to/file" edit as superuser via ssh ;; C-x C-w : save file with name ;; C-x C-s : save file ;; C-x k : kills a buffer with its name ;; C-x RIGHT | LEFT : switches between buffers left and right ;; C-x b : switch to buffer with its name ;; C-x 2 | 3 : split window horizontally or vertical ;; C-x 0 : kills one window ;; C-x C-q : toggle read-only mode ;; M-x cd : change dir duh ;; M-x package-list-packages RET Ux : updates packages ;; M-ESC : Escapes corfu prompt ;; C-g : Escapes emacs command line ;; Setup Melpa (require 'package) (add-to-list 'package-archives '("melpa-snapshots" . "https://snapshots.melpa.org/packages/") t) ;; All packages ;; Super duper evil emacs (use-package evil :ensure t :init (defvar evil-mode-buffers '()) ;; Error in post-command-hook (evil-normal-post-command): (void-variable evil-mode-buffers) ;;(setq evil-want-keybinding nil) (evil-mode 1) :config (evil-set-undo-system 'undo-redo)) ;; Theme (use-package base16-theme :ensure t :init (setq base16-theme-256-color-source 'colors) (setq base16-highlight-mode-line 'off) :config (load-theme 'base16-purpledream t)) (use-package markdown-mode :ensure t) ;; Completion menu (use-package corfu :ensure t :config (keymap-set corfu-map "M-ESC" #'corfu-quit) (setq corfu-auto t) (setq corfu-auto-delay 0) (setq corfu-auto-prefix 0) (keymap-set corfu-map "RET" `( menu-item "" nil :filter ,(lambda (&optional _) (and (derived-mode-p 'eshell-mode 'comint-mode) #'corfu-send)))) :init (global-corfu-mode)) ;; Vterm (use-package vterm :config (setq vterm-shell 'bash) (add-hook 'vterm-mode-hook (lambda () (setq evil-default-state 'emacs))) :ensure t) ;; QML (use-package qml-mode :ensure t) ;; LSP / Eglot ;; (add-hook 'nix-mode-hook #'eglot-ensure) ;;(for nix) (add-hook 'c-mode-hook 'eglot-ensure) (add-hook 'c++-mode-hook 'eglot-ensure) (add-hook 'qml-mode-hook 'eglot-ensure) (with-eval-after-load 'eglot (add-to-list 'eglot-server-programs '(c-mode . ("clangd"))) (add-to-list 'eglot-server-programs '(c++-mode . ("clangd"))) (add-to-list 'eglot-server-programs '(qml-mode . ("~/Projects/Code/Random/qmlls"))) (add-hook 'after-save-hook 'eglot-format)) ;; Set some basic stuff up (setq scroll-step 1) (setq scroll-conservatively 10000) (setq set-fringe-mode -1) (xterm-mouse-mode t) (mouse-wheel-mode t) (setq-default truncate-lines t) (setq truncate-partial-width-windows nil) (setq initial-scratch-message "") (setq make-backup-files nil) (setq inhibit-startup-message t) (setq visible-bell t) (setq ring-bell-function 'ignore) (setq use-short-answers t) (setq browse-url-generic-program "xdg-open") (setq-default indent-tabs-mode 'only) (setq-default tab-width 2) ;;(defvaralias 'c-basic-offset 'tab-width) (menu-bar-mode -1) (tool-bar-mode -1) (scroll-bar-mode -1) ;;(global-visual-line-mode t) (add-to-list 'default-frame-alist '(font . "NotoSansM Nerd Font 12")) ;; Display line numbers in every buffer (global-display-line-numbers-mode 1) ;; Keybinds (keymap-global-set "C-c C-v" 'vterm) (keymap-global-set "C-c v" 'vterm) (keymap-global-set "C-x v" 'clipboard-yank) (keymap-global-set "C-x c" 'clipboard-kill-ring-save) ;; ssh stuff (guix is annoying at times) (setq tramp-remote-path '(tramp-default-remote-path "/bin" "/usr/bin" "/sbin" "/usr/sbin" "/usr/local/bin" "/usr/local/sbin" "/local/bin" "/local/freeware/bin" "/local/gnu/bin" "/usr/freeware/bin" "/usr/pkg/bin" "/usr/contrib/bin" "/opt/bin" "/opt/sbin" "/opt/local/bin" "/opt/homebrew/bin" "/opt/homebrew/sbin" "/run/current-system/profile/bin")) (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(base16-theme-highlight-mode-line 'box) '(package-selected-packages '(evil))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. ;; Removing ass boxes and making theme be "smooth" '(default ((t (:box nil :background "#1e0a28" :foreground "#ffffff")))) '(font-lock-comment-face ((t (:foreground "#656565")))) '(font-lock-comment-delimiter-face ((t (:foreground "#656565")))) '(ansi-color-fast-blick ((t (:box nil)))) '(ansi-color-slow-blick ((t (:box nil)))) '(corfu-border ((t (:background nil)))) '(cursor ((t (:inherit t :background "#506050" :foreground "#000000")))) '(fringe ((t nil))) '(help-key-binding ((t (:box nil)))) '(line-number ((t (:foreground "#504050" :background "#1e0a28")))) '(read-multiple-choice ((t (:box nil)))) '(tab-bar-tab-highlight ((t (:box nil)))) '(tabulated-list-fake-header ((t (:overline nil :underline nil)))) '(tool-bar ((t (:box nil)))) '(widget-field ((t (:box nil)))))