summaryrefslogtreecommitdiff
path: root/.emacs.d
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2022-11-30 02:38:10 +0200
committerThanos Apollo <[email protected]>2022-11-30 02:38:10 +0200
commit50bc7230ad8780d4d037ad66581d40e87a9dad8d (patch)
tree6b2213335b659480e99c4d9df12fef0dcba7a45f /.emacs.d
parentd5b34d9ed4171a87ae8dea8c7791f17af9294d1d (diff)
Restracture and organize downloads
Diffstat (limited to '.emacs.d')
-rw-r--r--.emacs.d/init.el131
-rw-r--r--.emacs.d/lisp/init-exwm.el170
-rw-r--r--.emacs.d/lisp/init-keys.el31
-rw-r--r--.emacs.d/lisp/my-functions.el45
4 files changed, 126 insertions, 251 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index 326ee14..8b688a1 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -25,10 +25,10 @@
(require 'use-package)
(setq use-package-always-ensure t)
-(load "my-functions.el")
-(load "init-keys.el")
+(load "functions.el")
+(load "keys.el")
(load "all-the-icons-dired.el")
-(load "init-exwm")
+
(setq inhibit-startup-message nil)
@@ -108,6 +108,7 @@
:face 'font-lock-keyword-face))
+(defvar eshell-path-env (getenv "~/.local/bin"))
(use-package general)
(use-package doom-themes
:init (load-theme 'doom-dracula t))
@@ -242,7 +243,7 @@
org-superstar-headline-bullets-list '("◉" "●" "○" "●" "○" "●" "◆")
org-superstar-itembullet-alist '((?+ . ?➤) (?- . ?✦))) ; changes +/- symbols in item lists
)
-
+(use-package org-modern)
(defun apollo/org-theme-darkone ()
"My custom org theme for doom themes"
(interactive)
@@ -367,6 +368,13 @@
(setq lsp-keymap-prefix "C-c l") ;; Or 'C-l', 's-l'
:config
(lsp-enable-which-key-integration t)
+ (lsp-register-custom-settings
+ '(("pyls.plugins.pyls_mypy.enabled" t t)
+ ("pyls.plugins.pyls_mypy.live_mode" nil t)
+ ("pyls.plugins.pyls_black.enabled" t t)
+ ("pyls.plugins.pyls_isort.enabled" t t)
+ ("pyls.plugins.flake8.enable" t t)))
+ (setq lsp-pyls-server-command "~/.local/bin/pyls")
)
(use-package lsp-ui
@@ -538,7 +546,120 @@
;; (eaf-bind-key scroll_up "C-n" eaf-pdf-viewer-keybinding)
;; (eaf-bind-key scroll_down "C-p" eaf-pdf-viewer-keybinding)
;; (eaf-bind-key nil "M-q" eaf-browser-keybinding))
+(defun apollo/exwm-init-hook ()
+ "Do this upon start."
+ (display-battery-mode 0) ;;Change to 1 to display battery
+
+ (setq display-time-day-and-date t)
+ (display-time-mode 1)
+
+ ;;Launch apps that will run in the background
+;; (apollo/run-in-background "blueman-applet")
+ (apollo/run-in-background "picom")
+;; (apollo/run-in-background "nm-applet")
+ (apollo/emacs-keys)
+ (apollo/restore-wallpaper)
+ )
+
+(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)
+
+ ;; (start-process-shell-command "xrandr" nil "xrandr --output Virtual-1 --primary --mode 2048x1152 --pos 0x0 --rotate normal")
+
+ ;; 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
+ ([C-w C-p] . windmove-left)
+ ([C-w C-n] . windmove-right)
+; ([s-up] . windmove-up)
+; ([s-down] . windmove-down)
+ ([C-w C-v] . split-window-right)
+
+ ;; 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)))
+
+ ;; 's-N': Switch to certain workspace with Super (Win) plus a number key (0 - 9)
+ ,@(mapcar (lambda (i)
+ `(,(kbd (format "s-%d" i)) .
+ (lambda ()
+ (interactive)
+ (exwm-workspace-switch-create ,i))))
+ (number-sequence 0 9))))
+
+ (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-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))
(custom-set-variables
;; custom-set-variables was added by Custom.
@@ -549,7 +670,7 @@
'(custom-safe-themes
'("05626f77b0c8c197c7e4a31d9783c4ec6e351d9624aa28bc15e7f6d6a6ebd926" "49acd691c89118c0768c4fb9a333af33e3d2dca48e6f79787478757071d64e68" "60ada0ff6b91687f1a04cc17ad04119e59a7542644c7c59fc135909499400ab8" "545ab1a535c913c9214fe5b883046f02982c508815612234140240c129682a68" "ce4234c32262924c1d2f43e6b61312634938777071f1129c7cde3ebd4a3028da" "c865644bfc16c7a43e847828139b74d1117a6077a845d16e71da38c8413a5aaa" "680f62b751481cc5b5b44aeab824e5683cf13792c006aeba1c25ce2d89826426" "631c52620e2953e744f2b56d102eae503017047fb43d65ce028e88ef5846ea3b" "2dd4951e967990396142ec54d376cced3f135810b2b69920e77103e0bcedfba9" "a138ec18a6b926ea9d66e61aac28f5ce99739cf38566876dc31e29ec8757f6e2" "683b3fe1689da78a4e64d3ddfce90f2c19eb2d8ab1bab1738a63d8263119c3f4" "2dc03dfb67fbcb7d9c487522c29b7582da20766c9998aaad5e5b63b5c27eec3f" "830596655dc39879096d9b7772768de6042fb5a4293c6b90c98a9b98bce96e4a" "7dc296b80df1b29bfc4062d1a66ee91efb462d6a7a934955e94e786394d80b71" "0ce768d3ea6d809292d12b22a5ff6de65e24a8d527e4e0885cf87640f42dff7d" "02f57ef0a20b7f61adce51445b68b2a7e832648ce2e7efb19d217b6454c1b644" "e3daa8f18440301f3e54f2093fe15f4fe951986a8628e98dcd781efbec7a46f2" "5586a5db9dadef93b6b6e72720205a4fa92fd60e4ccfd3a5fa389782eab2371b" "1aa4243143f6c9f2a51ff173221f4fd23a1719f4194df6cef8878e75d349613d" "7a4784fc0c0c853c578132e81a757a0f9b3e675fdd7e56303f3ee1fb8d7ae2a3" "8d3ef5ff6273f2a552152c7febc40eabca26bae05bd12bc85062e2dc224cde9a" "aec7b55f2a13307a55517fdf08438863d694550565dee23181d2ebd973ebd6b8" "7a424478cb77a96af2c0f50cfb4e2a88647b3ccca225f8c650ed45b7f50d9525" "944d52450c57b7cbba08f9b3d08095eb7a5541b0ecfb3a0a9ecd4a18f3c28948" "3199be8536de4a8300eaf9ce6d864a35aa802088c0925e944e2b74a574c68fd0" "443e2c3c4dd44510f0ea8247b438e834188dc1c6fb80785d83ad3628eadf9294" "554c2be54aecbbd3a6317906ada2e8f25f50f8d6bf3d9c22e3b30e3700d0bbd1" "5f128efd37c6a87cd4ad8e8b7f2afaba425425524a68133ac0efd87291d05874" "bf948e3f55a8cd1f420373410911d0a50be5a04a8886cabe8d8e471ad8fdba8e" "fb2c27e7ad4a81c2f57bceeca0faeb1c84fb7a167c097b998e2a1ea314455fd6" "47f3e55e4e3d570d5513d4cc58047dc059bd6ab3d135c796c4ccbfb77d4eb88b" "1070069a4671554a2c00b8375485896c1aa8144f5b8d99b86845069351770ee9" "e8483bc21cf667971eabdbb01203e3a471de1b59a4e532368b7a20f5665d686a" "b7bf7b95fb796614f0b36a7c4906a93db75ad0c6146f336c7ed085f6fceef93d" "05b767a3f3a37ac46353fd88f194934d82eb6c3644c3b8da883752f57513e7aa" default))
'(package-selected-packages
- '(dmenu sudo-edit exwm dracula-theme dashboard treemacs-icons-dired 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)))
+ '(org-modern sudo-edit exwm dracula-theme dashboard treemacs-icons-dired 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.
diff --git a/.emacs.d/lisp/init-exwm.el b/.emacs.d/lisp/init-exwm.el
deleted file mode 100644
index cce35df..0000000
--- a/.emacs.d/lisp/init-exwm.el
+++ /dev/null
@@ -1,170 +0,0 @@
-;;; package : EXWM configuration ---
-;;; .* --- .*
-
-;;; Code:
-
-(use-package dmenu)
-
-(defun apollo/rofi-switch-window ()
- "Launch rofi. Cant get it to work with exwm as of now tho."
- (interactive)
- (start-process-shell-command
- "rofi" nil "rofi -show window"))
-;; (global-set-key (kbd "s-<tab>") 'apollo/run_rofi)
-
-(defun apollo/run-in-background (command)
- "Run COMMAND in the background."
- (let ((command-parts (split-string command "[ ]+")))
- (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts)))))
-
-(defun rofi ()
- "Run Rofi."
- (interactive)
- (apollo/run-in-background "rofi -show drun"))
-
-(defun apollo/volume-increase ()
- "Increase Volume."
- (interactive)
- (start-process-shell-command
- "amixer" nil "amixer sset Master 5%+"))
-
-(defun apollo/volume-decrease ()
- "Decrease Volume."
- (interactive)
- (start-process-shell-command
- "amixer" nil "amixer sset Master 5%-"))
-
-(defun apollo/set-wallpaper ()
- "Restore wallpaper."
- (interactive)
- (start-process-shell-command
- "nitrogen" nil "nitrogen --restore"))
-
-(defun apollo/emacs-keys ()
- "Swap caps with ctrl."
- (interactive)
- (start-process-shell-command
- "setxkbmap" nil "setxkbmap us -option ctrl:swapcaps"))
-
-(defun apollo/greek-keyboard ()
- "Swap caps with ctrl."
- (interactive)
- (start-process-shell-command
- "setxkbmap" nil "setxkbmap gr"))
-
-(defun apollo/exwm-init-hook ()
- "Do this upon start."
- (display-battery-mode 0) ;;Change to 1 to display battery
-
- (setq display-time-day-and-date t)
- (display-time-mode 1)
-
- ;;Launch apps that will run in the background
-;; (apollo/run-in-background "blueman-applet")
- (apollo/run-in-background "picom")
-;; (apollo/run-in-background "nm-applet")
- (apollo/emacs-keys)
- (apollo/set-wallpaper)
- )
-
-(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)
-
- ;; (start-process-shell-command "xrandr" nil "xrandr --output Virtual-1 --primary --mode 2048x1152 --pos 0x0 --rotate normal")
-
- ;; 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
- ([C-w C-p] . windmove-left)
- ([C-w C-n] . windmove-right)
-; ([s-up] . windmove-up)
-; ([s-down] . windmove-down)
- ([C-w C-v] . split-window-right)
-
- ;; 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)))
-
- ;; 's-N': Switch to certain workspace with Super (Win) plus a number key (0 - 9)
- ,@(mapcar (lambda (i)
- `(,(kbd (format "s-%d" i)) .
- (lambda ()
- (interactive)
- (exwm-workspace-switch-create ,i))))
- (number-sequence 0 9))))
-
- (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-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))
-
-;;; init-exwm.el ends here
diff --git a/.emacs.d/lisp/init-keys.el b/.emacs.d/lisp/init-keys.el
deleted file mode 100644
index 051a93a..0000000
--- a/.emacs.d/lisp/init-keys.el
+++ /dev/null
@@ -1,31 +0,0 @@
-;; init-keys.el
-;;; Code:
-
-;;Ibuffer
-(global-set-key (kbd "C-x C-b") 'ibuffer)
-
-;;Editing
-(global-set-key (kbd "C-d") 'kill-region)
-(global-set-key (kbd "C-k") 'copy-region-as-kill)
-
-;;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)
-(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)
-
-
-;;; God Mode
-;; (use-package god-mode
-;; :init
-;; (god-mode)
-;; :config
-;; (global-set-key (kbd "C-f") #'god-mode-all))
-
-
-;;init-keys ends here
diff --git a/.emacs.d/lisp/my-functions.el b/.emacs.d/lisp/my-functions.el
deleted file mode 100644
index 85eb60a..0000000
--- a/.emacs.d/lisp/my-functions.el
+++ /dev/null
@@ -1,45 +0,0 @@
-;;; package --- Summary
-;;; Commentary:
-;;; useful snippets of code for my daily use.
-;;; Code:
-
-
-(defun apollo/html-boostrap-boilerplate ()
- "Insert html boilerplate with boostrap link."
- (interactive)
- (insert
-"<!DOCTYPE html>
-<html lang=\"en\">
- <head>
- <meta charset=\"UTF-8\">
- <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
- <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">
- <title>My Title</title>
- <link rel=\"stylesheet\" href=\"./style.css\">
- <link href=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi\" crossorigin=\"anonymous\">
- </head>
- <body>
- <main>
- <h1>Starting point</h1>
- </main>
- <script src=\"index.js\"></script>
- </body>
-</html>" ))
-
-(defun center-buffer ()
- "Center buffer."
- (interactive)
- (setq visual-fill-column-width 100
- visual-fill-column-center-text t)
- (visual-fill-column-mode 1))
-
-(defun center-buffer-undo ()
- "Undo center-buffer."
- (interactive)
- (setq visual-fill-column-width 2000
- visual-fill-column-center-text nil)
- (visual-fill-column-mode 1))
-
-
-;;; my-functions.el ends here
-