diff options
author | Rose <rose@pinkro.se> | 2025-08-25 18:45:30 +0200 |
---|---|---|
committer | Rose <rose@pinkro.se> | 2025-08-25 18:45:30 +0200 |
commit | 9bb29c3310baff546b17ff3c8aeddb2296b7f0ce (patch) | |
tree | 91d4e06712b65890f62302559598d8d6acf0307a /emacs/.emacs | |
parent | cee9eb00e06e992250a55f8278c26d4448316da1 (diff) | |
download | dotfiles-9bb29c3310baff546b17ff3c8aeddb2296b7f0ce.tar.gz dotfiles-9bb29c3310baff546b17ff3c8aeddb2296b7f0ce.tar.bz2 |
Move to funkier structure !!
Diffstat (limited to 'emacs/.emacs')
-rw-r--r-- | emacs/.emacs | 209 |
1 files changed, 209 insertions, 0 deletions
diff --git a/emacs/.emacs b/emacs/.emacs new file mode 100644 index 0000000..f0275a5 --- /dev/null +++ b/emacs/.emacs @@ -0,0 +1,209 @@ +(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. + '(custom-safe-themes + '("1e6997bc08f0b11a2b5b6253525aed4e1eb314715076a0c0c2486bd97569f18a" + "249e100de137f516d56bcf2e98c1e3f9e1e8a6dce50726c974fa6838fbfcec6b" + default)) + '(inhibit-startup-screen t) + '(package-selected-packages + '(ascii-table multiple-cursors toml-mode yaml-mode ada-mode meson-mode + rust-mode nix-mode all-the-icons kaolin-themes + centaur-tabs elcord latex-preview-pane lsp-latex + dashboard lsp-mode lsp-treemacs yasnippet company + flycheck dap-mode magit projectile persp-mode helm + helm-lsp go-mode lsp-ui undo-tree)) + '(warning-suppress-log-types '((use-package))) + '(warning-suppress-types '((comp)))) +(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. + ) + +;; hide gui stuff +(tool-bar-mode -1) +(menu-bar-mode -1) + + +(global-display-line-numbers-mode 1) + +(require 'package) +(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) +(package-initialize) + +(setq package-selected-packages '(lsp-mode lsp-treemacs yasnippet company flycheck dap-mode magit projectile persp-mode helm helm-lsp go-mode lsp-ui undo-tree)) + +(when (cl-find-if-not #'package-installed-p package-selected-packages) + (package-refresh-contents) + (mapc #'package-install package-selected-packages)) + +(global-set-key (kbd "M-o") 'ace-window) +(global-set-key (kbd "C-x <down>") 'scroll-up-line) +(global-set-key (kbd "C-x <up>") 'scroll-up-line) + + +(set-frame-font "OG Courier Zero Slash 11" nil t) +(set-face-attribute 'default nil :height 120) + +(use-package rust-mode) + +;; Tabs +(use-package centaur-tabs + :demand + :ensure t + :config + (centaur-tabs-mode t) + :bind + ("C-c <left>" . centaur-tabs-backward) + ("C-c <right>" . centaur-tabs-forward)) + +(use-package all-the-icons + :if (display-graphic-p)) + +;; Theme +(use-package kaolin-themes + :config + (load-theme 'kaolin-valley-light t) + (kaolin-treemacs-theme)) + + +;; dashboard +(use-package dashboard + :ensure t + :config + (progn + (dashboard-setup-startup-hook) + (setq dashboard-banner-logo-title "AAAAAAAAAAAAAAAAA") + (setq dashboard-startup-banner "/home/xen/Documents/fumo.txt") + (setq dashboard-center-content t) + (setq dashboard-show-shortcuts nil) + (setq dashboard-item-shortcuts '((recents . "r") + (agenda . "a") + (registers . "e"))))) + +(use-package treemacs + :ensure t + :defer t + :pin manual + :init + (with-eval-after-load 'winum + (define-key winum-keymap (kbd "M-0") #'treemacs-select-window)) + :config + (progn + (setq treemacs-collapse-dirs (if treemacs-python-executable 3 0) + treemacs-deferred-git-apply-delay 0.5 + treemacs-directory-name-transformer #'identity + treemacs-display-in-side-window t + treemacs-eldoc-display 'simple + treemacs-file-event-delay 2000 + treemacs-file-extension-regex treemacs-last-period-regex-value + treemacs-file-follow-delay 0.2 + treemacs-file-name-transformer #'identity + treemacs-follow-after-init t + treemacs-expand-after-init t + treemacs-find-workspace-method 'find-for-file-or-pick-first + treemacs-git-command-pipe "" + treemacs-goto-tag-strategy 'refetch-index + treemacs-header-scroll-indicators '(nil . "^^^^^^") + treemacs-hide-dot-git-directory t + treemacs-indentation 2 + treemacs-indentation-string " " + treemacs-is-never-other-window t + treemacs-max-git-entries 5000 + treemacs-missing-project-action 'ask + treemacs-move-forward-on-expand nil + treemacs-no-png-images nil + treemacs-no-delete-other-windows t + treemacs-project-follow-cleanup nil + treemacs-persist-file (expand-file-name ".cache/treemacs-persist" user-emacs-directory) + treemacs-position 'left + treemacs-read-string-input 'from-child-frame + treemacs-recenter-distance 0.1 + treemacs-recenter-after-file-follow nil + treemacs-recenter-after-tag-follow nil + treemacs-recenter-after-project-jump 'always + treemacs-recenter-after-project-expand 'on-distance + treemacs-litter-directories '("/node_modules" "/.venv" "/.cask") + treemacs-project-follow-into-home nil + treemacs-show-cursor nil + treemacs-show-hidden-files t + treemacs-silent-filewatch nil + treemacs-silent-refresh nil + treemacs-sorting 'alphabetic-asc + treemacs-select-when-already-in-treemacs 'move-back + treemacs-space-between-root-nodes t + treemacs-tag-follow-cleanup t + treemacs-tag-follow-delay 1.5 + treemacs-text-scale nil + treemacs-user-mode-line-format nil + treemacs-user-header-line-format nil + treemacs-wide-toggle-width 70 + treemacs-width 35 + treemacs-width-increment 1 + treemacs-width-is-initially-locked t + treemacs-workspace-switch-cleanup nil) + + ;; The default width and height of the icons is 22 pixels. If you are + ;; using a Hi-DPI display, uncomment this to double the icon size. + ;;(treemacs-resize-icons 44) + + (treemacs-follow-mode t) + (treemacs-filewatch-mode t) + (treemacs-fringe-indicator-mode 'always) + (treemacs-hide-gitignored-files-mode nil)) + :bind + (:map global-map + ("M-0" . treemacs-select-window) + ("C-x t 1" . treemacs-delete-other-windows) + ("C-x t t" . treemacs) + ("C-x t d" . treemacs-select-directory) + ("C-x t B" . treemacs-bookmark) + ("C-x t C-t" . treemacs-find-file) + ("C-x t M-t" . treemacs-find-tag))) + +(use-package treemacs-icons-dired + :hook (dired-mode . treemacs-icons-dired-enable-once) + :ensure t) + +;; undo tree +(global-undo-tree-mode) + +;; Company mode +(setq company-idle-delay 0) +(setq company-minimum-prefix-length 1) + +;; Go lsp mode +(defun lsp-go-install-save-hooks() + (add-hook 'before-save-hook #'lsp-format-buffer t t) + (add-hook 'before-save-hook #'lsp-organize-imports t t)) +(add-hook 'go-mode-hook #'lsp-go-install-save-hooks) + +;; lsp mode +(with-eval-after-load 'lsp-mode + (add-hook 'prog-mode-hook #'lsp-deferred) + (yas-minor-mode)) + +(require 'multiple-cursors) +(global-set-key (kbd "C-c C-c") 'mc/edit-lines) +(global-set-key (kbd "C->") 'mc/mark-next-like-this) +(global-set-key (kbd "C-<") 'mc/mark-previous-like-this) +(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this) + +(projectile-mode +1) +;; Recommended keymap prefix on Windows/Linux +(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map) +(setq projectile-project-search-path '("~/Projects")) +(add-hook 'makefile-mode-hook (lambda () (lsp-mode -1))) +;; Tex +(use-package tex + :ensure auctex) +(setq TeX-auto-save t) +(setq TeX-parse-self t) +(setq-default TeX-master nil) + +(setq-default show-trailing-whitespace t) +(setq load-home-init-file t) ; don't load init file from ~/.xemacs/init.el |