From 920b151a4591b0aad99578b94ffdf93647f6da3b Mon Sep 17 00:00:00 2001 From: ThanosApollo Date: Tue, 1 Nov 2022 14:05:56 +0200 Subject: remove literate configs --- .config/qtile/README.org | 539 ----------------------------------------------- .emacs.d/emacs.org | 459 ---------------------------------------- 2 files changed, 998 deletions(-) delete mode 100644 .config/qtile/README.org delete mode 100644 .emacs.d/emacs.org diff --git a/.config/qtile/README.org b/.config/qtile/README.org deleted file mode 100644 index a82676a..0000000 --- a/.config/qtile/README.org +++ /dev/null @@ -1,539 +0,0 @@ -#+PROPERTY: header-args:python :tangle ./config.py - -* Qtile configuration -* Table of Contents -:PROPERTIES: -:TOC: :include all :ignore this -:END: -:CONTENTS: -- [[#imports][Imports]] -- [[#colors][Colors]] -- [[#keybindings][Keybindings]] - - [[#keyboard][Keyboard]] - - [[#mouse][Mouse]] -- [[#panel][Panel]] - - [[#groups][Groups]] - - [[#layouts][Layouts]] - - [[#widgets][Widgets]] - - [[#defaults][Defaults]] - - [[#custom-widgets][Custom Widgets]] - - [[#widget-list][Widget List]] -- [[#screens][Screens]] -- [[#settings][Settings]] - - [[#cursor][Cursor]] - - [[#wname][Wname]] -:END: -** Imports -#+begin_src python -import os -import subprocess -from libqtile import layout, bar, widget, hook -from libqtile.config import Click, Drag, Group, Match, Screen, Rule, Key -from libqtile.command import lazy -from libqtile.dgroups import simple_key_binder -from colors import gruvbox, nord_fox, my_colors, dracula -from spotify_widget import Spotify -#+end_src -** Colors -#+begin_src python :tangle ./colors.py -nord_fox = { - 'bg': "#2e3440", - 'fg': "#b9bfca", - 'fg_gutter': "#4b5668", - 'black': "#3b4252", - 'red': "#bf616a", - 'green': "#a3be8c", - 'yellow': "#ebcb8b", - 'blue': "#81a1c1", - 'magenta': "#b48ead", - 'cyan': "#88c0d0", - 'white': "#e5e9f0", - 'orange': "#c9826b", - 'pink': "#bf88bc", -} - -gruvbox = { - 'bg': '#282828', - 'fg': '#d4be98', - 'dark-red': '#ea6962', - 'red': '#ea6962', - 'dark-green': '#a9b665', - 'green': '#a9b665', - 'dark-yellow': '#e78a4e', - 'yellow': '#d8a657', - 'dark-blue': '#7daea3', - 'blue': '#7daea3', - 'dark-magenta': '#d3869b', - 'magenta': '#d3869b', - 'dark-cyan': '#89b482', - 'cyan': '#89b482', - 'dark-gray': '#665c54', - 'gray': '#928374', - - 'fg4': '#766f64', - 'fg3': '#665c54', - 'fg2': '#504945', - 'fg1': '#3c3836', - 'bg0': '#32302f', - 'fg0': '#1d2021', - 'fg9': '#ebdbb2' -} - -my_colors = { - "black" : "#000000", - "black2": "#2F343F", - "blue" : "#3384d0", - "red" : "#ff0000", - "grey" : "#a9a9a9", - "grey2" : "#C0C5CE", - "cyan" : "#6790EB", - "green" : "#62FF00", - "white" : "#F3F4F5", - "orange": "#FBA922", -} -dracula = { - "bg" : "#282a36" , - "fg" : "#f8f8f2", - "curr": "#44475a", - "cyan": "#8be9fd", - "green": "#50fa7b", - "orange": "#ffb86c", - "purple": "#bd93f9", - "red" : "#ff5555", -} - -#+end_src -** Keybindings -*** Keyboard -#+begin_src python - mod = "mod4" - browser = "qutebrowser" - term = "alacritty" - editor = "emacsclient -c -a 'emacs'" - dgroups_key_binder = simple_key_binder("mod4") #Change groups - keys = [ - Key([mod], "Return", - lazy.spawn(term), - ), - Key([mod, "shift"], "a", - lazy.spawn('anki'), - ), - Key([mod, "shift"], "m", - lazy.spawn("spotify"), - ), - Key([mod], "Tab", - lazy.spawn("rofi -show drun"), - ), - Key([mod], "r", - lazy.spawn("rofi -show run"), - ), - Key([mod], "w", - lazy.spawn("rofi -show window"), - ), - Key([mod], "p", - lazy.spawn("passmenu -p 'Password for: '"), - ), - Key([mod], "b", - lazy.spawn(browser), - ), - Key([mod, "shift"], "c", - lazy.next_layout(), - ), - Key([mod], "q", - lazy.window.kill(), - ), - Key([mod, "shift"], "r", - lazy.restart(), - ), - Key([mod, "shift"], "0", - lazy.shutdown(), - ), - Key([mod, "shift"], "e", - lazy.spawn(editor), - ), - ### Switch focus of monitors - Key([mod], "period", - lazy.next_screen(), - ), - ### Treetab controls - Key([mod, "shift"], "h", - lazy.layout.move_left(), - ), - Key([mod, "shift"], "l", - lazy.layout.move_right(), - ), - ### Window controls - Key([mod], "j", - lazy.layout.down(), - ), - Key([mod], "k", - lazy.layout.up(), - ), - Key([mod, "shift"], "j", - lazy.layout.shuffle_down(), - lazy.layout.section_down(), - ), - Key([mod, "shift"], "k", - lazy.layout.shuffle_up(), - lazy.layout.section_up(), - ), - Key([mod], "h", - lazy.layout.shrink(), - lazy.layout.decrease_nmaster(), - ), - Key([mod], "l", - lazy.layout.grow(), - lazy.layout.increase_nmaster(), - ), - Key([mod], "n", - lazy.layout.normalize(), - ), - Key([mod], "m", - lazy.layout.maximize(), - ), - Key([mod, "shift"], "f", - lazy.window.toggle_floating(), - ), - Key([mod], "f", - lazy.window.toggle_fullscreen(), - ), - ### Stack controls - Key([mod, "shift"], "Tab", - lazy.layout.rotate(), - lazy.layout.flip(), - ), - Key([mod, "shift"], "space", - lazy.layout.toggle_split(), - ), - ### Volume controls - Key([], "XF86AudioLowerVolume", - lazy.spawn('amixer sset Master 5%-'), - ), - Key([], "XF86AudioRaiseVolume", - lazy.spawn('amixer sset Master 5%+'), - ), - ### Spotify - Key([mod, "shift"], "p", - lazy.spawn("spotify-control play-pause"), - ), - Key([mod, "shift"], "n", - lazy.spawn("spotify-control next"), - ), - Key([mod, "shift"], "b", - lazy.spawn("spotify-control previous"), - ), - ### Change languages - Key([mod], "F1", - lazy.spawn("setxkbmap us -option caps:swapescape"), - ), - Key([mod],"F2", - lazy.spawn("setxkbmap gr"), - ), - ] - -#+end_src -*** Mouse -#+begin_src python - mouse = [ - Drag([mod], "Button1", lazy.window.set_position_floating(), start=lazy.window.get_position()), - Drag([mod], "Button3", lazy.window.set_size_floating(), start=lazy.window.get_size()), - Click([mod], "Button2", lazy.window.bring_to_front()), - ] -#+end_src - -** Panel -*** Groups -#+begin_src python -groups = [] -group_names = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0",] -group_labels = ["Ⅰ", "Ⅱ", "Ⅲ", "Ⅳ", "Ⅴ", "Ⅵ", "Ⅶ", "Ⅷ", "Ⅸ", "Ⅹ",] -group_layouts = ["monadtall", "monadtall", "monadtall", "monadtall", "monadtall", "monadtall", "monadtall", "monadtall", "monadtall", "monadtall",] -for i in range(len(group_names)): - groups.append( - Group( - name=group_names[i], - layout=group_layouts[i].lower(), - label=group_labels[i], - )) -#+end_src -*** Layouts -#+begin_src python -def init_layout_theme(): - return {"margin":5, - "border_width":2, - "border_focus": dracula["cyan"], - "border_normal": dracula["bg"], - } - -layout_theme = init_layout_theme() - - -layouts = [ - layout.MonadTall(**layout_theme), - #layout.MonadWide(**layout_theme), - #layout.Matrix(**layout_theme), - #layout.Bsp(**layout_theme), - layout.Floating(**layout_theme), - # layout.RatioTile(**layout_theme), - layout.Max(**layout_theme) -] -#+end_src - -*** Widgets -**** Defaults -#+begin_src python -def init_widgets_defaults(): - return dict(font="Noto Sans", - fontsize = 12, - padding = 2, - foreground =dracula["fg"], - background = dracula["bg"] - ) - -widget_defaults = init_widgets_defaults() -#+end_src -**** Custom Widgets -***** Spotify -- A custom widget, pulls metadata via dbus, displaying song and artist of current playing song through spotify -- Qtile provides a similar widget named *Mpris2* - - /I wanted to play around with dbus, so I made this one/ -#+begin_src python :tangle ./spotify_widget.py -import dbus -import subprocess -from functools import partial -from libqtile.widget import base - -class Spotify(base.ThreadPoolText): - """A simple Spotify widget, made using dbus-python. - Show the song and artist of now listening song and allow basic mouse - control from the bar using spotify-control( - Github: https://github.com/J00LZ/spotify-control - AUR: https://aur.archlinux.org/packages/spotify-control - ): - - toggle pause (or play if stopped) on left click; - - skip forward in playlist on scroll up; - - skip backward in playlist on scroll down. - """ - - defaults = [ - ("color", "00ff00", "Text"), - ("update_interval", 0.5, "Update Time in seconds."), - ] - - def __init__(self, **config): - base.ThreadPoolText.__init__(self, "", **config) - self.add_defaults(Spotify.defaults) - self.local = None - self.add_callbacks( - { - "Button1": partial(subprocess.Popen, ["spotify-control", "play-pause"]), - "Button4": partial(subprocess.Popen, ["spotify-control", "next"]), - "Button5": partial(subprocess.Popen, ["spotify-control", "previous"]), - } - ) - - def now_playing(self): - """Return current song""" - session_bus = dbus.SessionBus() - bus_data = ("org.mpris.MediaPlayer2.spotify", "/org/mpris/MediaPlayer2") - spotify_bus = session_bus.get_object(*bus_data) - interface = dbus.Interface(spotify_bus, "org.freedesktop.DBus.Properties") - metadata = interface.Get("org.mpris.MediaPlayer2.Player", "Metadata") - data = { - "artist" : next(iter(metadata.get("xesam:albumArtist"))), - "song" : metadata.get("xesam:title") - } - song = data["song"] + " ♫ " + data["artist"] - self.layout.colour = self.color - return song - - def poll(self): - """Poll content for the text box.""" - try: - return self.now_playing() - except : - return "Spotify is not responding" -#+end_src -**** Widget List -#+begin_src python -def init_widgets_list(): - widgets_list = [ - widget.Spacer( - length=7, - ), - widget.Image( - filename = "~/.config/qtile/rms.png", - scale = "True", - margin = 2, - ), - widget.Spacer( - length=7, - ), - widget.GroupBox( - font="FontAwesome", - fontsize = 20, - padding = 3, - margin = 4, - borderwidth = 1, - active = dracula["cyan"], - inactive = dracula["curr"], - rounded = False, - highlight_method = "line", - this_current_screen_border = dracula["red"], - other_current_screen_border = dracula["curr"], - ), - widget.CurrentLayout( - font = "Noto Sans Bold", - foreground = dracula["fg"], - background = "#5B4B8A", - ), - widget.Spacer( - length=5 - ), - widget.WindowName( - font="JetBrains Mono Bold", - fontsize = 12, - foreground = dracula["green"], - background = dracula["bg"], - ), - # widget.Image( - # filename = "~/.config/qtile/spotify2.png", - # scale = True, - # ), - # Spotify( - # fontsize = 12, - # background = dracula["bg"], - # color = dracula["green"], - # fmt = '{}', - # font = "JetBrains Mono Bold" - # ), - # widget.Moc( - # font = "JetBrains Mono", - # fontsize= 13, - # play_color=dracula["green"], - # paddig = 10, - # ), - widget.Spacer( - length=10, - ), - widget.Image( - filename = "~/.config/qtile/volume1.png", - scale = True, - ), - widget.Spacer( - length=7, - padding = 10, - ), - widget.Volume( - fontsize = 15, - fmt = '{} ' , - background = dracula["bg"], - foreground = dracula['orange'], - font = "JetBrains Mono", - margin = 10, - ), - # widget.Mpris2( - # fontsize= 16, - # background = my_colors["red"], - # objname="org.mpris.MediaPlayer2.spotify" - # ), - widget.Spacer( - length=7, - padding = 10, - ), - widget.Image( - filename = "~/.config/qtile/ram2.png", - scale = True, - ), - widget.Memory( - measure_mem="G", - fontsize=15, - foreground = dracula["cyan"], - background = dracula["bg"], - font='JetBrains Mono Bold', - ), - widget.MemoryGraph( - type='box', - graph_color = dracula["cyan"], - foreground = dracula["fg"], - background = dracula["bg"], - ), - widget.Spacer( - length=7 - ), - widget.Image( - filename = "~/.config/qtile/cpu1.png", - scale = True, - ), - widget.ThermalSensor( - threshold=50, - fontsize=15, - font='JetBrains Mono Bold', - foreground = dracula["cyan"], - background = dracula["bg"], - ), - widget.CPUGraph( - type='box', - graph_color = dracula["cyan"], - background = dracula["bg"], - ), - widget.Spacer( - length=5 - ), - widget.TextBox( - font="FontAwesome", - text="  ", - foreground=dracula["orange"], - background=dracula["bg"], - padding = 2, - fontsize=18 - ), - widget.Clock( - font='JetBrains Mono Bold', - foreground = dracula["cyan"], - background = dracula["bg"], - fontsize = 18, - format="%d-%m-%Y | %H:%M" - ), - widget.Spacer( - length=6 - ), - widget.Systray( - background= dracula["bg"], - icon_size=20, - padding = 10, - margin = 10, - ), - widget.Spacer( - length=5 - ), - ] - return widgets_list -#+end_src - -** Screens -#+begin_src python -widgets_screen1 = init_widgets_screen1() -widgets_screen2 = init_widgets_screen2() - - -def init_screens(): - return [Screen(top=bar.Bar(widgets=init_widgets_screen1(), size=33, margin = [6,20,3,20]),), - Screen(top=bar.Bar(widgets=init_widgets_screen2(), size=28, margin = 7))] - -screens = init_screens() -#+end_src - -** Settings -*** Cursor -#+begin_src python -follow_mouse_focus = True -bring_front_click = False -cursor_warp = True -auto_fullscreen = True -focus_on_window_activation = "smart" # or smart -#+end_src -*** Wname -#+begin_src python -wmname = "Qtile-Apo11o" -#+end_src diff --git a/.emacs.d/emacs.org b/.emacs.d/emacs.org deleted file mode 100644 index 8f9132f..0000000 --- a/.emacs.d/emacs.org +++ /dev/null @@ -1,459 +0,0 @@ -#+title My emacs configuration -#+PROPERTY: header-args:emacs-lisp :tangle ./init.el -* Package System Setup -#+begin_src emacs-lisp -(require 'package) - -(setq package-archives '(("melpa" . "https://melpa.org/packages/") - ("org" . "https://orgmode.org/elpa/") - ("elpa" . "https://elpa.gnu.org/packages/"))) - -(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) -#+end_src -* UI Configuration -** Basics Configuration -#+begin_src emacs-lisp - (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) - - - - (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)) - (add-hook mode (lambda () (display-line-numbers-mode 0)))) - -#+end_src - -** Font configuration -I use *JetBrains Mono*, *Arial* and *Cantarell* for this configuration, which will need to be installed in your system for this configuration to work -#+begin_src emacs-lisp - (set-face-attribute 'default nil - :font "JetBrains Mono" - :height apollo/default-font-size) - (set-face-attribute 'fixed-pitch nil - :font "Arial" - :height 260) - - (set-face-attribute 'variable-pitch nil - :font "Cantarell" - :height 295 - :weight 'regular) -#+end_src -** Color theme -#+begin_src emacs-lisp -(use-package doom-themes - :init (load-theme 'doom-dracula t)) -#+end_src -** Modeline -#+begin_src emacs-lisp -(use-package all-the-icons - :ensure t) - - -(use-package doom-modeline - :ensure t - :init (doom-modeline-mode 1) - :custom ((doom-modeline-height 35))) -#+end_src -** Which Key -#+begin_src emacs-lisp -(use-package which-key - :init (which-key-mode) - :diminish which-key-mode - :config - (setq which-key-idle-delay 0.5) - ) -#+end_src -** Ivy and counsel -#+begin_src emacs-lisp - (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)) -#+end_src -** Helpful Help Commands -#+begin_src emacs-lisp -(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)) -#+end_src -** Cursor color -+ I'm using smart-cursor-color-mode - #+begin_src emacs-lisp -(use-package smart-cursor-color - :config - (smart-cursor-color-mode +1)) - #+end_src -* Keybinding configuration -** The Essentials -I use [[https://evil.readthedocs.io/en/latest/index.html][evil-mode]] for a vim-like experience, with *general.el* and *evil-collection* for better integration -#+begin_src emacs-lisp - ;; Make ESC quit prompts - (global-set-key (kbd "") 'keyboard-escape-quit) - (use-package general - :config - (general-create-definer apollo/leader-keys - :keymaps '(normal insert visual emacs) - :prefix "SPC" - :global-prefix "C-SPC") - - (apollo/leader-keys - "t" '(:ignore t :which-key "toggles") - "tt" '(counsel-load-theme :which-key "choose theme"))) - - - (use-package evil - :init - (setq evil-want-integration t) - (setq evil-want-keybinding nil) - (setq evil-want-C-u-scroll t) - (setq evil-want-C-i-jump nil) - ;;:hook (evil-mode . apollo/evil-hook) - :config - (evil-mode 1) - (define-key evil-insert-state-map (kbd "C-f") 'evil-normal-state) - - (evil-global-set-key 'motion "j" 'evil-next-visual-line) - (evil-global-set-key 'motion "k" 'evil-previous-visual-line) - - (evil-set-initial-state 'messages-buffer-mode 'normal) - (evil-set-initial-state 'dashboard-mode 'normal) - (evil-define-key 'normal dired-mode-map - (kbd "h") 'dired-up-directory - (kbd "l") 'dired-find-file - (kbd "m") 'dired-mark - (kbd "R") 'dired-do-rename - (kbd "D") 'dired-do-delete) - ) - - (use-package evil-collection - :after evil - :config - (evil-collection-init)) - ;;Ibuffer - (global-set-key (kbd "C-x C-b") 'ibuffer) - ;;Counsel - (global-set-key (kbd "M-;") 'counsel-M-x) - (global-set-key (kbd "C-;") 'counsel-find-file) -#+end_src -** apollo/leader-keys -*** Magit -#+begin_src emacs-lisp -(apollo/leader-keys - "g" '(:ignore t :which-key "Git") - "gs" '(magit-status :which-key "status")) -#+end_src -*** Counsel -#+begin_src emacs-lisp - (apollo/leader-keys - "f" '(counsel-find-file :which-key "Find File")) -#+end_src -* Org mode -** Basic configuration -#+begin_src emacs-lisp -(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) -) -#+end_src -*** Org bullets -+ Recently I've been trying out org-superstar as a replacement for org-bullets, but I kept the configuration as a comment for anyone wanting to test it out -#+begin_src emacs-lisp -;; 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 - ) -#+end_src -*** Org Themes -**** Dark-one -#+begin_src emacs-lisp -(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")) -#+end_src -**** Dracula -#+begin_src emacs-lisp -(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")) -#+end_src -**** Center text function -#+begin_src emacs-lisp - (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)) - - - (use-package visual-fill-column) -#+end_src -** Babel Languages -#+begin_src emacs-lisp - (org-babel-do-load-languages - 'org-babel-load-languages - '((emacs-lisp . t) - (python . t))) -#+end_src -** Babel templates -#+begin_src emacs-lisp - (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")) -#+end_src -** Auto-tangle configuration -#+begin_src emacs-lisp -;; 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")) - ;; 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))) -#+end_src -Add some text -* Development -** Languages -*** IDE Features | lsp-mode -**** lsp-mode -#+begin_src emacs-lisp -;;instal flyckeck -(use-package flyckeck) -;;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) - ) -#+end_src -**** lsp-ui -#+begin_src emacs-lisp -(use-package lsp-ui - :hook (lsp-mode . lsp-ui-mode) - :custom - (lsp-ui-doc-position 'bottom)) -#+end_src -*** Debugging with dap -#+begin_src emacs-lisp -(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"))) -#+end_src -*** Javascript -+ For javascript, automatic installation guide [[https://emacs-lsp.github.io/lsp-mode/page/lsp-typescript/][here]] -#+begin_src emacs-lisp -#+end_src -*** TypeScript -#+begin_src emacs-lisp - (use-package typescript-mode - :mode "\\.ts\\'" - :hook (typescript-mode .lsp-deferred) - :config - (setq typescript-indent-level 2)) -#+end_src -*** Python -#+begin_src emacs-lisp - (use-package python-mode - :ensure t - :hook (python-mode . lsp-deferred) - :custom - ;; NOTE: Set these if Python 3 is called "python3" on your system! - ;; (python-shell-interpreter "python3") - ;; (dap-python-executable "python3") - (dap-python-debugger 'debugpy) - :config - (require 'dap-python)) - - ;;Pyenv -(use-package pyvenv - :config - (pyvenv-mode 1)) -;;set PATH of pyls -(setq lsp-pyls-server-command "/home/apollo/.local/bin/pylsp") -#+end_src -*** Company mode -#+begin_src emacs-lisp -(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)) -#+end_src -** Magit -The best Git interface - #+begin_src emacs-lisp -(use-package magit - :custom - (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) - #+end_src - -- cgit v1.2.3