summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.emacs.d/init.el317
1 files changed, 110 insertions, 207 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index b396a18..e0f0842 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -5,12 +5,11 @@
(require 'package)
(add-to-list 'load-path "~/.emacs.d/lisp/")
(add-to-list 'load-path "/home/apollo/.guix-profile/share/emacs/site-lisp")
+(add-to-list 'load-path "~/dotfiles")
(guix-emacs-autoload-packages)
-;(require 'vterm)
-;(vterm)
-(add-hook 'dired-mode-hook 'all-the-icons-dired-mode)
+
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
("org" . "https://orgmode.org/elpa/")
@@ -20,28 +19,94 @@
(package-initialize)
(unless package-archive-contents
-(package-refresh-contents))
-
+ (package-refresh-contents))
+
+;; Request some packages:
+(defconst my-package-list '(org-snooze
+ all-the-icons
+ dashboard
+ general
+ doom-themes
+ doom-modeline
+ counsel
+ which-key
+ ivy
+ ivy-rich
+ all-the-icons-ivy-rich
+ helpful
+ org
+ org-modern
+ visual-fill-column
+ rainbow-delimiters
+ flycheck
+ lsp-mode
+ lsp-ui
+ json-mode
+ rjsx-mode
+ typescript-mode
+ python-mode
+ pyvenv
+ company
+ company-box
+ magit
+ elfeed
+ elfeed-goodies
+ eshell
+ multi-vterm
+ paredit
+ corfu
+ monkeytype
+ sudo-edit
+ exwm
+ exwm-mff
+ exwm-firefox-core
+ consult
+ alsamixer
+ simple-httpd
+ circe
+ eshell-syntax-highlighting
+ pdf-tools
+ mastodon)
+ "List of my favorite packages")
+
+(defvar my-missing-packages '()
+ "List populated at each startup that contains the list of packages that need
+to be installed.")
+
+(dolist (p my-package-list)
+ (when (not (package-installed-p p))
+ (add-to-list 'my-missing-packages p)))
+
+(when my-missing-packages
+ (message "Emacs is now refreshing its package database...")
+ (package-refresh-contents)
+ ;; Install the missing packages
+ (dolist (p my-missing-packages)
+ (message "Installing `%s' .." p)
+ (package-install p))
+ (setq my-missing-packages '()))
(unless (package-installed-p 'use-package)
(package-install 'use-package))
(require 'use-package)
-
(setq use-package-always-ensure t)
(load "functions.el")
(load "keys.el")
(load "all-the-icons-dired.el")
-;(load "anki-editor.el")
(load "secret")
-;(use-package anki-editor)
(load "exwm-holyK-firefox")
+;; if you are using guix, emacs-exwm will look for ~/.exwm.el
+;; in case we are not using guix we are gonna load it anyway here, just to get the
+;; transperancy and other modifications
+(load ".exwm")
(setq inhibit-startup-message nil)
(defvar apollo/default-font-size 130)
(set-face-attribute 'default nil :font "JetBrains Mono" :height 130)
+(add-hook 'dired-mode-hook 'all-the-icons-dired-mode)
(scroll-bar-mode -1)
(tool-bar-mode -1)
@@ -81,12 +146,9 @@
:font "JetBrains Mono"
:height apollo/default-font-size
:weight 'regular)
-(use-package all-the-icons
- :ensure t)
;Dashboard settings
;(use-package dashboard
- :config
(dashboard-setup-startup-hook)
(setq dashboard-items '((recents . 5)
@@ -115,32 +177,22 @@
(defvar eshell-path-env (getenv "~/.local/bin"))
-(use-package general)
-(use-package doom-themes
- :init (load-theme 'doom-ayu-dark t))
+(load-theme 'doom-ayu-dark t)
+(doom-modeline-mode 1)
+(setq doom-modeline-height 35)
-(use-package the-matrix-theme)
+;; (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 doom-modeline
- :ensure t
- :init (doom-modeline-mode 1)
- :custom ((doom-modeline-height 35)))
-
-(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 which-key
- :init (which-key-mode)
- :diminish which-key-mode
- :config
- (setq which-key-idle-delay 0.5)
- )
+(which-key-mode)
+(setq which-key-idle-delay 0.5)
(use-package ivy
:diminish
@@ -160,13 +212,8 @@
:config
(ivy-mode 1))
-(use-package ivy-rich
- :init
- (ivy-rich-mode 1))
-
-(use-package all-the-icons-ivy-rich
- :ensure t
- :init (all-the-icons-ivy-rich-mode 1))
+(ivy-rich-mode 1)
+(all-the-icons-ivy-rich-mode 1)
(use-package helpful
@@ -232,8 +279,7 @@
"CANCELLED(c)" )))
(setq org-agenda-start-log-mode t)
(setq org-log-done 'time)
- (setq org-log-into-drawer t)
-)
+ (setq org-log-into-drawer t))
;; Use either org-bullets or org-superstar
;; (use-package org-bullets
@@ -319,8 +365,6 @@
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)
@@ -358,16 +402,13 @@
;;emacs-lisp
(setq tab-always-indent 'complete)
(add-to-list 'completion-styles 'initials t)
-(use-package rainbow-delimiters
- :config
- (add-hook 'emacs-lisp-mode-hook #'rainbow-delimiters-mode)
- (add-hook 'scheme-mode-hook #'rainbow-delimiters-mode))
+
+(add-hook 'emacs-lisp-mode-hook #'rainbow-delimiters-mode)
+(add-hook 'scheme-mode-hook #'rainbow-delimiters-mode)
;;instal flyckeck
-(use-package flycheck
- :init
- (global-flycheck-mode))
+(global-flycheck-mode)
;;Enable globally
@@ -481,29 +522,23 @@
;;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))
+(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)
+ )))
+
+
+(elfeed-goodies/setup)
+(setq elfeed-goodies/entry-pane-size 0.5)
;; (use-package vterm
;; :config
@@ -511,21 +546,14 @@
;; :bind(("C-c C-v c" . 'vterm-send-stop)))
(use-package eshell
- :ensurte t
+ :ensure t
:bind (("C-c e" . 'eshell)))
-(use-package multi-vterm
- :ensure t)
-
(add-hook 'pdf-view-mode #'pdf-isearch-minor-mode)
(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)
@@ -556,131 +584,6 @@
(defun apollo/exwm-update-class ()
(exwm-workspace-rename-buffer exwm-class-name))
-(use-package exwm
- :config
- (setq exwm-workspace-number 6)
- ;; When window "class" updates, use it to set the buffer name
- (add-hook 'exwm-update-class-hook #'apollo/exwm-update-class)
-
- ;;When EXWM starts up, run this hook
- (add-hook 'exwm-init-hook #'apollo/exwm-init-hook)
- (start-process-shell-command
- "xrandr" nil "xrandr --output DisplayPort-2 --primary --mode 2560x1440 --pos 1920x0 --rotate normal --output HDMI-A-0 --mode 1920x1080 --pos 0x0 --rotate normal")
-
- ;; Set the screen resolution
-
- (require 'exwm-randr)
- (setq exwm-randr-workspace-output-plist '(1 "DP-1" 2 "HDMI-A-0"))
- (add-hook 'exwm-randr-screen-change-hook
- (lambda ()
- (start-process-shell-command
- "xrandr" nil "xrandr --output DisplayPort-2 --primary --mode 2560x1440 --pos 1920x0 --rotate normal --output HDMI-A-0 --mode 1920x1080 --pos 0x0 --rotate normal" )))
- (exwm-randr-enable)
-
-
- ;; Load the system tray before exwm-init
- (require 'exwm-systemtray)
- (exwm-systemtray-enable)
-
- ;; These keys should always pass through to Emacs
- (setq exwm-input-prefix-keys
- '(?\C-x
- ?\C-u
- ?\C-h
- ?\C-w
- ?\M-x
- ?\M-`
- ?\M-&
- ?\M-:
- ?\s-d
- ?\C-\M-j ;; Buffer list
- ?\C-\ )) ;; Ctrl+Space
-
- ;; Ctrl+Q will enable the next key to be sent directly
- (define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key)
-
- ;; Set up global key bindings. These always work, no matter the input state!
- ;; Keep in mind that changing this list after EXWM initializes has no effect.
- (setq exwm-input-global-keys
- `(
- ;; Reset to line-mode (C-c C-k switches to char-mode via exwm-input-release-keyboard)
- ([?\s-r] . exwm-reset)
-
- ;; Move between windows
-; ([s-up] . windmove-up)
-; ([s-down] . windmove-down)
-
- ;; Launch applications via shell command
- ([?\s-&] . (lambda (command)
- (interactive (list (read-shell-command "$ ")))
- (start-process-shell-command command nil command)))
-
- ;; Switch workspace
- ([?\s-e] . exwm-workspace-switch)
- ([?\s-`] . (lambda () (interactive) (exwm-workspace-switch-create 0)))
- ([?\s-1] . (lambda () (interactive) (exwm-workspace-switch-create 1)))
- ([?\s-2] . (lambda () (interactive) (exwm-workspace-switch-create 2)))
- ([?\s-3] . (lambda () (interactive) (exwm-workspace-switch-create 3)))
- ([?\s-4] . (lambda () (interactive) (exwm-workspace-switch-create 4)))
-
- ,@(mapcar (lambda (i)
- `(,(kbd (format "s-%d" i)) .
- (lambda ()
- (interactive)
- (exwm-workspace-switch-create ,i))))
- (number-sequence 0 9))))
-
- (defun exwm-enlarge-horizontally-50 ()
- (interactive)
- (exwm-layout-enlarge-window-horizontally 50))
-
- (defun exwm-shrink-horizontally-50 ()
- "Shrink window horizontally by 10"
- (interactive)
- (exwm-layout-shrink-window-horizontally 50))
-
- (defun exwm-shrink-vertically-50 ()
- "Shrink window by 50."
- (interactive)
- (exwm-layout-shrink-window 50))
-
- (defun exwm-enlarge-vertically-50 ()
- "Enlarge window by 50."
- (interactive)
- (exwm-layout-enlarge-window 50))
-
- (exwm-input-set-key (kbd "C-c d") 'dmenu)
- (exwm-input-set-key (kbd "s-<tab>") 'rofi)
- (exwm-input-set-key (kbd "s-Q") 'kill-emacs)
- (exwm-input-set-key (kbd "<XF86AudioRaiseVolume>") 'apollo/volume-increase)
- (exwm-input-set-key (kbd "<XF86AudioLowerVolume>") 'apollo/volume-decrease)
- (exwm-input-set-key (kbd "s-0") 'apollo/emacs-keys)
- (exwm-input-set-key (kbd "s-9") 'apollo/greek-keyboard)
- (exwm-input-set-key (kbd "C-w C-<left>") 'exwm-shrink-horizontally-50)
- (exwm-input-set-key (kbd "C-w C-<right>") 'exwm-enlarge-horizontally-50)
- (exwm-input-set-key (kbd "C-w C-<up>") 'exwm-shrink-vertically-50)
- (exwm-input-set-key (kbd "C-w C-<up>") 'exwm-enlarge-vertically-50)
-
- (exwm-enable))
-
-;;Transparency
-(set-frame-parameter (selected-frame) 'alpha '(90 90))
-(add-to-list 'default-frame-alist '(alpha 90 90))
-
-;;Follow focus using exwm-mff
-(use-package exwm-mff
- :init
- (exwm-mff-mode))
-
-
-
-
-
-(use-package exwm-firefox-core
- :ensure t)
-(use-package exwm-firefox-evil
- :ensure t)
-
(use-package consult
:ensure t
:bind(("M-g g" . consult-goto-line)))