;; init.el ;; (require 'package) (add-to-list 'load-path "~/.emacs.d/lisp/") ;;(load "~/.emacs.d/custom.el") ;;(load "~/.emacs.d/lisp/init-keys.el") ;;(load "~/.emacs.d/lisp/init-exwm.el") ;;Ibuffer (global-set-key (kbd "C-x C-b") 'ibuffer) ;;Counsel (global-set-key (kbd "M-;") 'counsel-M-x) ;;Window control map (define-prefix-command 'window-control-map) (global-set-key (kbd "C-w") 'window-control-map) (global-set-key (kbd "C-c C-c") 'copy-region-as-kill) (define-key window-control-map (kbd "C-v") 'split-window-right) (define-key window-control-map (kbd "C-n") 'windmove-right) (define-key window-control-map (kbd "C-p") 'windmove-left) (define-key window-control-map (kbd "C-q") 'delete-window) (use-package corfu) (use-package hacker-typer) (setq package-archives '(("melpa" . "https://melpa.org/packages/") ("org" . "https://orgmode.org/elpa/") ("elpa" . "https://elpa.gnu.org/packages/"))) (setq apropos-sort-by-scores t) (package-initialize) (unless package-archive-contents (package-refresh-contents)) (unless (package-installed-p 'use-package) (package-install 'use-package)) (require 'use-package) (setq use-package-always-ensure t) (setq inhibit-startup-message nil) (defvar apollo/default-font-size 130) (set-face-attribute 'default nil :font "JetBrains Mono" :height 130) (scroll-bar-mode -1) (tool-bar-mode -1) (tooltip-mode -1) (set-fringe-mode 10) (menu-bar-mode -1) (blink-cursor-mode -1) (menu-bar--visual-line-mode-enable) ;Visible bell (setq visible-bell t) ;;Transparency ;;(set-frame-parameter (selected-frame) 'alpha '(90 80)) ;;(add-to-list 'default-frame-alist '(alpha 90 50)) (column-number-mode) (global-display-line-numbers-mode t) (menu-bar--display-line-numbers-mode-relative) ;;Disable line numbers for some modes (dolist (mode '(pdf-view-mode-hook org-mode-hook term-mode-hook shell-mode-hook eshell-mode-hook vterm-mode-hook elfeed)) (add-hook mode (lambda () (display-line-numbers-mode 0)))) (set-face-attribute 'default nil :font "JetBrains Mono" :height apollo/default-font-size) (set-face-attribute 'fixed-pitch nil :font "JetBrains Mono" :height apollo/default-font-size) (set-face-attribute 'variable-pitch nil :font "JetBrains Mono" :height apollo/default-font-size :weight 'regular) (use-package doom-themes :init (load-theme 'doom-dracula t)) ;; (use-package dracula-theme ;; :init (load-theme 'dracula t)) (use-package all-the-icons :ensure t) (use-package the-matrix-theme) (use-package doom-modeline :ensure t :init (doom-modeline-mode 1) :custom ((doom-modeline-height 35))) (use-package which-key :init (which-key-mode) :diminish which-key-mode :config (setq which-key-idle-delay 0.5) ) (use-package ivy :diminish :bind (("C-s" . swiper) :map ivy-minibuffer-map ("TAB" . ivy-alt-done) ("C-l" . ivy-alt-done) ("C-j" . ivy-next-line) ("C-k" . ivy-previous-line) :map ivy-switch-buffer-map ("C-k" . ivy-previous-line) ("C-l" . ivy-done) ("C-d" . ivy-switch-buffer-kill) :map ivy-reverse-i-search-map ("C-k" . ivy-previous-line) ("C-d" . ivy-reverse-i-search-kill)) :config (ivy-mode 1)) (use-package ivy-rich :init (ivy-rich-mode 1)) (use-package counsel :bind (("C-M-j" . 'counsel-switch-buffer) :map minibuffer-local-map ("C-r" . 'counsel-minibuffer-history) ("C-'" . 'counsel-find-file)) :config (counsel-mode 1)) (use-package helpful :custom (counsel-describe-function-function #'helpful-callable) (counsel-describe-variable-function #'helpful-variable) :bind ([remap describe-function] . counsel-describe-function) ([remap describe-command] . helpful-command) ([remap describe-variable] . counsel-describe-variable) ([remap describe-key] . helpful-key)) (use-package smart-cursor-color :config (smart-cursor-color-mode +1)) ;; Make ESC quit prompts (global-set-key (kbd "") 'keyboard-escape-quit) (define-prefix-command 'window) (require 'general) ;; (apollo/leader-keys ;; "t" '(:ignore t :which-key "toggles") ;; "tt" '(counsel-load-theme :which-key "choose theme")) ;; (apollo/leader-keys ;; "g" '(:ignore t :which-key "Git") ;; "gs" '(magit-status :which-key "status")) ;; (apollo/leader-keys ;; "f" '(counsel-find-file :which-key "Find File")) (defun apollo/org-mode-setup () (setq evil-auto-indent nil) (apollo/org-theme-dracula)) (use-package org :hook (org-mode . apollo/org-mode-setup) :config (setq org-directory "~/org/" org-agenda-files '("~/org/agenda.org" "~/org/med.org") org-default-notes-file (expand-file-name "notes.org" org-directory) org-ellipsis " ▼ " org-log-done 'time org-hide-emphasis-markers nil ;change to t to hide emphasis markers org-table-convert-region-max-lines 20000 org-todo-keywords ; This overwrites the default Doom org-todo-keywords '((sequence "TODO(t)" ; A task that is ready to be tackled "BLOG(b)" ; Blog writing assignments "GYM(g)" ; Things to accomplish at the gym "WAIT(w)" ; Something is holding up this task "|" ; The pipe necessary to separate "active" states and "inactive" states "DONE(d)" ; Task has been completed "CANCELLED(c)" ))) (setq org-agenda-start-log-mode t) (setq org-log-done 'time) (setq org-log-into-drawer t) ) ;; Use either org-bullets or org-superstar ;; (use-package org-bullets ;; :after org ;; :hook (org-mode . org-bullets-mode) ;; :custom ;; (org-bullets-bullet-list '("●" "○" "●" "○" "●" "●" ))) (use-package org-superstar :after org :hook (org-mode . org-superstar-mode) :config (setq org-superstar-headline-bullets-list '("◉" "●" "○" "●" "○" "●" "◆") org-superstar-itembullet-alist '((?+ . ?➤) (?- . ?✦))) ; changes +/- symbols in item lists ) (defun apollo/org-theme-darkone () "My custom org theme for doom themes" (interactive) (dolist (face '((org-level-1 1.70 "#51afef" ultra-bold) (org-level-2 1.55 "#7FBCD2" extra-bold) (org-level-3 1.40 "#da8548" bold) (org-level-4 1.20 "#da8548" semi-bold) (org-level-5 1.20 "#5699af" normal) (org-level-6 1.20 "#a9a1e1" normal) (org-level-7 1.10 "#46d9ff" normal) (org-level-8 1.00 "#ff6c6b" normal))) (set-face-attribute (nth 0 face) nil :font "Jetbrains Mono" :weight (nth 3 face) :height (nth 1 face) :foreground (nth 2 face))) (set-face-attribute 'org-table nil :font "Jetbrains Mono" :weight 'normal :height 1.0 :foreground "#A66CFF")) (defun apollo/org-theme-dracula () "Enable Dracula theme for Org headers." (interactive) (dolist (face '((org-level-1 1.7 "#8be9fd" ultra-bold) (org-level-2 1.6 "#bd93f9" extra-bold) (org-level-3 1.5 "#50fa7b" bold) (org-level-4 1.4 "#ff79c6" semi-bold) (org-level-5 1.3 "#9aedfe" normal) (org-level-6 1.2 "#caa9fa" normal) (org-level-7 1.1 "#5af78e" normal) (org-level-8 1.0 "#ff92d0" normal))) (set-face-attribute (nth 0 face) nil :font "JetBrains Mono" :weight (nth 3 face) :height (nth 1 face) :foreground (nth 2 face))) (set-face-attribute 'org-table nil :font "JetBrains Mono" :weight 'normal :height 1.0 :foreground "#bfafdf")) (defun apollo/org-mode-visual () (interactive) (setq visual-fill-column-width 100 visual-fill-column-center-text t) (visual-fill-column-mode 1)) (defun apollo/org-mode-visual-undo () (interactive) (setq visual-fill-column-width 2000 visual-fill-column-center-text nil) (visual-fill-column-mode 1)) (defadvice org-edit-src-code (around set-buffer-file-name activate compile) (let ((file-name (buffer-file-name))) ;; (1) ad-do-it ;; (2) (setq buffer-file-name file-name))) ;; (3) (use-package visual-fill-column) (org-babel-do-load-languages 'org-babel-load-languages '((emacs-lisp . t) (python . t))) (require 'org-tempo) (add-to-list 'org-structure-template-alist '("sh" . "src shell")) (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp")) (add-to-list 'org-structure-template-alist '("py" . "src python")) ;; Automatically tangle our Emacs.org config file when we save it (defun apollo/org-babel-tangle-config () (when (string-equal (buffer-file-name) (expand-file-name "~/.emacs.d/emacs.org" "~/.config/qtile/README.org")) ;; Dynamic scoping to the rescue (let ((org-confirm-babel-evaluate nil)) (org-babel-tangle)))) (add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'apollo/org-babel-tangle-config))) ;Developer ;;Essentials (electric-pair-mode 1) ;;emacs-lisp (setq tab-always-indent 'complete) (add-to-list 'completion-styles 'initials t) ;;instal flyckeck (use-package flycheck :init (global-flycheck-mode)) ;;Enable globally ;;setup lsp-mode (defun apollo/lsp-mode-setup () (setq lsp-headerline-breadcrumb-segments '(path-up-to-project file symbols)) (lsp-headerline-breadcrumb-mode)) (use-package lsp-mode :commands (lsp lsp-deferred) :hook (lsp-mode . apollo/lsp-mode-setup) :init (setq lsp-keymap-prefix "C-c l") ;; Or 'C-l', 's-l' :config (lsp-enable-which-key-integration t) ) (use-package lsp-ui :hook (lsp-mode . lsp-ui-mode) :custom (lsp-ui-doc-position 'bottom)) (use-package dap-mode ;; Uncomment the config below if you want all UI panes to be hidden by default! ;; :custom ;; (lsp-enable-dap-auto-configure nil) ;; :config ;; (dap-ui-mode 1) :config ;; Set up Node debugging (require 'dap-node) (dap-node-setup) ;; Automatically installs Node debug adapter if needed ;; Bind `C-c l d` to `dap-hydra` for easy access (general-define-key :keymaps 'lsp-mode-map :prefix lsp-keymap-prefix "d" '(dap-hydra t :wk "debugger"))) (use-package json-mode :mode ".json" :hook (json-mode . lsp-deferred)) (use-package rjsx-mode :mode ".js" :hook (rjsx-mode . lsp-deferred) :config (defadvice js-jsx-indent-line (after js-jsx-indent-line-after-hack activate) "Workaround sgml-mode and follow airbnb component style." (save-excursion (beginning-of-line) (if (looking-at-p "^ +\/?> *$") (delete-char sgml-basic-offset))))) (use-package ac-html :mode ".html" :hook (html-mode . lsp-deferred) :config (defadvice js-jsx-indent-line (after js-jsx-indent-line-after-hack activate) "Workaround sgml-mode and follow airbnb component style." (save-excursion (beginning-of-line) (if (looking-at-p "^ +\/?> *$") (delete-char sgml-basic-offset))))) (use-package typescript-mode :mode ".ts'" :hook (typescript-mode .lsp-deferred) :config (setq typescript-indent-level 2)) (use-package python-mode :ensure t :mode ".py" :hook (python-mode . lsp-deferred) :custom (dap-python-debugger 'debugpy) :config (require 'dap-python)) ;;autocomplete ;;Pyenv (use-package pyvenv :config (pyvenv-mode 1)) (use-package company :after lsp-mode :hook (lsp-mode . company-mode) :bind (:map company-active-map ("" . company-complete-selection)) (:map lsp-mode-map ("" . company-indent-or-complete-common)) :custom (company-minimum-prefix-length 1) (company-idle-delay 0.0)) (use-package company-box :hook (company-mode . company-box-mode)) (use-package magit :custom (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) ;;elfeed (use-package elfeed :config (setq elfeed-search-feed-face ":foreground #fff :weight bold" elfeed-feeds (quote ( ("https://hackaday.com/blog/feed/" hackaday linux) ("https://opensource.com/feed" opensource linux) ("https://linux.softpedia.com/backend.xml" softpedia linux) ("https://www.thelancet.com/rssfeed/ebiom_current.xml" Lancet ebiom) ("https://www.thelancet.com/rssfeed/lancet_current.xml" Lancet lancet) ("https://www.thelancet.com/rssfeed/ebiom_online.xml" LancetOnline ebiom) ("https://www.thelancet.com/rssfeed/lancet_online.xml" LancetOnline lancet) ("https://www.thelancet.com/rssfeed/lanmic_online.xml" LancetOnline Microbiology) ("https://www.techrepublic.com/rssfeeds/topic/open-source/" techrepublic linu) ))) ) (use-package elfeed-goodies :init (elfeed-goodies/setup) :config (setq elfeed-goodies/entry-pane-size 0.5)) (use-package vterm :config (setq vterm-shell "/bin/zsh") (global-set-key (kbd "C-c v") 'vterm)) (use-package pdf-tools :init (pdf-tools-install)) (use-package eyebrowse :init (eyebrowse-mode) :bind (("M-`" . eyebrowse-switch-to-window-config-0) ("M-1" . eyebrowse-switch-to-window-config-1) ("M-2" . eyebrowse-switch-to-window-config-2) ("M-3" . eyebrowse-switch-to-window-config-3) ("M-4" . eyebrowse-switch-to-window-config-4) ("M-5" . eyebrowse-switch-to-window-config-5))) (define-key dired-mode-map "b" 'dired-up-directory) (use-package paredit) (use-package corfu) (use-package monkeytype) (use-package telega) (put 'downcase-region 'disabled nil) (put 'dired-find-alternate-file 'disabled nil) (put 'set-goal-column 'disabled nil) (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 '("e3daa8f18440301f3e54f2093fe15f4fe951986a8628e98dcd781efbec7a46f2" "5586a5db9dadef93b6b6e72720205a4fa92fd60e4ccfd3a5fa389782eab2371b" "1aa4243143f6c9f2a51ff173221f4fd23a1719f4194df6cef8878e75d349613d" "7a4784fc0c0c853c578132e81a757a0f9b3e675fdd7e56303f3ee1fb8d7ae2a3" "8d3ef5ff6273f2a552152c7febc40eabca26bae05bd12bc85062e2dc224cde9a" "aec7b55f2a13307a55517fdf08438863d694550565dee23181d2ebd973ebd6b8" "7a424478cb77a96af2c0f50cfb4e2a88647b3ccca225f8c650ed45b7f50d9525" "944d52450c57b7cbba08f9b3d08095eb7a5541b0ecfb3a0a9ecd4a18f3c28948" "3199be8536de4a8300eaf9ce6d864a35aa802088c0925e944e2b74a574c68fd0" "443e2c3c4dd44510f0ea8247b438e834188dc1c6fb80785d83ad3628eadf9294" "554c2be54aecbbd3a6317906ada2e8f25f50f8d6bf3d9c22e3b30e3700d0bbd1" "5f128efd37c6a87cd4ad8e8b7f2afaba425425524a68133ac0efd87291d05874" "bf948e3f55a8cd1f420373410911d0a50be5a04a8886cabe8d8e471ad8fdba8e" "fb2c27e7ad4a81c2f57bceeca0faeb1c84fb7a167c097b998e2a1ea314455fd6" "47f3e55e4e3d570d5513d4cc58047dc059bd6ab3d135c796c4ccbfb77d4eb88b" "1070069a4671554a2c00b8375485896c1aa8144f5b8d99b86845069351770ee9" "e8483bc21cf667971eabdbb01203e3a471de1b59a4e532368b7a20f5665d686a" "b7bf7b95fb796614f0b36a7c4906a93db75ad0c6146f336c7ed085f6fceef93d" "05b767a3f3a37ac46353fd88f194934d82eb6c3644c3b8da883752f57513e7aa" default)) '(package-selected-packages '(ac-html html-mode hacker-typer autocomplete ac-slime rjsx-mode telega monkeytype evil-collection lsp-intellij lsp-mode yasnippet lsp-treemacs helm-lsp projectile hydra flycheck company avy which-key helm-xref dap-mode zenburn-theme json-mode))) (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. )