Skip to content

Latest commit

 

History

History
1364 lines (1169 loc) · 41 KB

emacs.org

File metadata and controls

1364 lines (1169 loc) · 41 KB

Base Config

Native Comp

(when (and (fboundp 'native-comp-available-p)
         (native-comp-available-p))

  (progn
    (setq native-comp-async-report-warnings-errors nil)
    (setq comp-deferred-compilation t)
    (add-to-list 'native-comp-eln-load-path (expand-file-name "eln-cache/" user-emacs-directory))
    (setq package-native-compile t)
    )
  )

Package Management

;; Initialize package sources
;; (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))

;; ;; Initialize use-package on non-Linux platforms
;; (unless (package-installed-p 'use-package)
;;   (package-install 'use-package))

;; (require 'use-package)
;; (setq use-package-always-ensure t)

(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))


(setq package-enable-at-startup nil)
(add-to-list 'load-path "~/.emacs.d/site-lisp/")
(setq use-package-always-ensure t)
(straight-use-package 'use-package)
(setq straight-use-package-by-default t)

UI

Theme

(use-package doom-themes
  :init (load-theme 'doom-palenight t))

(use-package all-the-icons)

(use-package doom-modeline
  :init (doom-modeline-mode 1)
  :custom ((doom-modeline-height 15)))

Tweaks

(setq inhibit-startup-message t)

(scroll-bar-mode -1)        ; Disable visible scrollbar
(tool-bar-mode -1)          ; Disable the toolbar
(tooltip-mode -1)           ; Disable tooltips
(set-fringe-mode 10)        ; Give some breathing room

(menu-bar-mode -1)            ; Disable the menu bar

;; Set up the visible bell
(setq visible-bell t)

(column-number-mode)
(global-display-line-numbers-mode t)

;; Set frame transparency
(set-frame-parameter (selected-frame) 'alpha 95)
(add-to-list 'default-frame-alist `(alpha . ,95))
;;(set-frame-parameter (selected-frame) 'fullscreen 'maximized)
;;(add-to-list 'default-frame-alist '(fullscreen . maximized))

;; Disable line numbers for some modes
(dolist (mode '(org-mode-hook
                term-mode-hook
                shell-mode-hook
                treemacs-mode-hook
                eshell-mode-hook))
  (add-hook mode (lambda () (display-line-numbers-mode 0))))

Fonts

(set-face-attribute 'default nil :font "Iosevka" :height 140)

;; Set the fixed pitch face
(set-face-attribute 'fixed-pitch nil :font "Iosevka" :height 140)

;; Set the variable pitch face
(set-face-attribute 'variable-pitch nil :font "Iosevka Aile" :height 160 :weight 'regular)

Dashboard

(use-package page-break-lines)

(use-package dashboard 
  :init      
  (setq dashboard-set-heading-icons t)
  (setq dashboard-set-file-icons t)
  (setq dashboard-banner-logo-title "Emacs Is More Than A Text Editor!")
  (setq dashboard-startup-banner `logo) 
  (setq dashboard-center-content t)
  (setq dashboard-set-navigator t)
  (setq dashboard-page-separator  "\n\f\n")
  (setq dashboard-items '((recents . 5)
                          (agenda . 5 )
                          (bookmarks . 5)
                          (projects . 3)))
  :config
  (dashboard-modify-heading-icons '((recents . "file-text")
                                    (bookmarks . "book"))))

;; (defun my/initial-window-buffer-setup ()
;;   (switch-to-buffer-other-window "*scratch*")
;;   (switch-to-buffer-other-window "*dashboard*")
;; )

Disable Bell

;;Avoid having noisy sounds when scrolling to the bottom of a buffer
(defun my-bell-function ()
  (unless (memq this-command
		'(isearch-abort abort-recursive-edit exit-minibuffer
				keyboard-quit mwheel-scroll down up next-line previous-line
				backward-char forward-char))
    (ding)))
(setq ring-bell-function 'my-bell-function)
(setq ring-bell-function 'ignore)

Tweaks

Clean Folders

 ;; NOTE: If you want to move everything out of the ~/.emacs.d folder
 ;; reliably, set `user-emacs-directory` before loading no-littering!
 ;(setq user-emacs-directory "~/.cache/emacs")

 (use-package no-littering
   :init
    (setq no-littering-etc-directory
	(expand-file-name "config/" user-emacs-directory))
    (setq no-littering-var-directory
	   (expand-file-name "data/" user-emacs-directory))
   )

 ;; no-littering doesn't set this by default so we must place
 ;; auto save files in the same path as it uses for sessions
 (setq auto-save-file-name-transforms
	`((".*" ,(no-littering-expand-var-file-name "auto-save/") t)))

LSP optimization settings

(setq gc-cons-threshold 100000000)
(setq read-process-output-max (* 1024 1024))

Lisp

Macros

(defmacro my/general-define-key (args)
  `(progn ,@(mapcar (lambda (arglist)
		      `(general-def ,@arglist :package 'general))
		    args)))

(defmacro f-string (fmt)
  "Like `s-format' but with format fields in it.
FMT is a string to be expanded against the current lexical
environment. It is like what is used in `s-lex-format', but has
an expanded syntax to allow format-strings. For example:
${user-full-name 20s} will be expanded to the current value of
the variable `user-full-name' in a field 20 characters wide.
  (let ((f (sqrt 5)))  (f-string \"${f 1.2f}\"))
  will render as: 2.24
This function is inspired by the f-strings in Python 3.6, which I
enjoy using a lot.
"
  (let* ((matches (s-match-strings-all"${\\(?3:\\(?1:[^} ]+\\) *\\(?2:[^}]*\\)\\)}" fmt))
         (agetter (cl-loop for (m0 m1 m2 m3) in matches
                        collect `(cons ,m3  (format (format "%%%s" (if (string= ,m2 "")
                                                                      (if s-lex-value-as-lisp "S" "s")
                                                                   ,m2))
                                                  (symbol-value (intern ,m1)))))))

    `(s-format ,fmt 'aget (list ,@agetter))))

Functions

(defun my/load-default-init-file ()
  (interactive)
  (load-file "~/.emacs")
)

(defun my/stop-emacs-server ()
  (interactive)
  (eshell-command "ps aux | grep 'emacs --daemon' | awk  '{print $2}' | xargs kill -9")
  )

(defun my/insert-functions-in-scratch-buffer (str)
  (let
    ((l (apropos str)))
    (dolist (x l)
      (with-current-buffer
          "*scratch*"
        (progn
          (insert "\n")
          (insert (symbol-name (car x)))
          )
        )
      )
    )
  )

F-strings

Keybindings

General

;; Emacs oriented keybinding. Do good, not evil!
;; An interesting link for this is
;; https://yiufung.net/post/emacs-key-binding-conventions-and-why-you-should-try-it/

(use-package general
  :config
  (my/general-define-key
   (("M-w" 'easy-kill
     "C-@" 'er/expand-region
     "C-s" 'swiper-isearch
     "M-s" 'swiper
     "C-M-s" 'avy-goto-char
     "C-x o" 'other-window
     "M-o" 'ace-window 
     "C-x C-b" 'persp-counsel-switch-buffer
     ;; "C-x x" 'persp-mode-prefix-key
     )
    ("C-c w" 'hydra-window/body
     "C-c p" 'projectile-command-map
     ;; "C-c b" 'my/eaf-open-browser	
     ;; "C-c B" 'hydra-browser/body
     "C-c e" 'elfeed
     "C-c y w" 'aya-create
     "C-c y y" 'aya-expand
     "C-c y l" 'ivy-yasnippet
     "C-c y s" 'aya-persist-snippet
     "C->" 'mc/mark-next-like-this
     "C-<" 'mc/mark-previous-like-this
     "C-c C->" 'mc/mark-all-like-this
     "C-S-c C-S-c" 'mc/edit-lines
     )
    (lsp-mode-map
     "C-c l u r" 'lsp-ui-peek-find-references
     "C-c l u d" 'lsp-ui-peek-find-definitions
     "C-c l u g" 'lsp-ui-doc-glance
     "C-c l u f" 'lsp-ui-doc-focus-frame
     "C-c l u m" 'lsp-ui-imenu
     "C-c l u t" 'lsp-treemacs-symbols
     )
    (python-mode-map
     "C-M-b" 'python-nav-backward-block
     "C-M-f" 'python-nav-forward-block
     "C-M-a" 'python-nav-backward-defun
     "C-M-e" 'python-nav-forward-defun
     "C-M-u" 'python-nav-up-list
     "\r" 'newline-and-indent
     )
    (minibuffer-local-map
     "C-r" 'counsel-minibuffer-history)
)))

Hydras

Window

(use-package hydra)
(use-package pretty-hydra)
(use-package windmove)
(use-package transpose-frame)
(use-package headlong)
(winner-mode 1)

;;shameleslly taken from abo-abo's init files
(pretty-hydra-define hydra-window (:foreign-keys warn :quit-key "q")
("Arrange"
 (("v" (lambda ()
         (interactive)
         (split-window-right)
         (windmove-right))
       "vert")
  ("x" (lambda ()
         (interactive)
         (split-window-below)
         (windmove-down))
       "horz")
 ("d" ace-delete-window "del")
 ("o" delete-other-windows "one" :exit t)
 ("s" ace-swap-window "swap") 
 ("t" transpose-frame "transpose" :exit t)
 ("+" balance-windows "balance")
 ("u" (progn (winner-undo) (setq this-command 'winner-undo)) "undo"))
 "Move"
 (("h" windmove-left nil)
  ("j" windmove-down nil)
  ("k" windmove-up nil)
  ("l" windmove-right nil)
  ("a" ace-window "ace")
  ("i" ace-maximize-window "ace-one" :exit t)
  ("b" ido-switch-buffer "buf")
  ("m" headlong-bookmark-jump "bmk"))
  )
)

M-e atomic edit C-t toggle password autofill C-d save page password ; translate page , reader mode

Caret mode usual keys

“c” eaf-py-proxy-insert_or_caret_at_line “v” eaf-py-proxy-caret_toggle_mark “w” eaf-py-proxy-caret_next_word “M-w” eaf-py-proxy-copy_text <escape> eaf-py-proxy-caret_exit

To be added

()

Which-key

(use-package which-key
  :init (which-key-mode)
  :diminish which-key-mode
  :config
  (setq which-key-idle-delay 1)
)

Discoverability

Ivy

Basics and Counsel

(use-package ivy
  :diminish
  :config
  (ivy-mode 1))

(use-package counsel
  :custom
  (counsel-linux-app-format-function #'counsel-linux-app-format-function-name-only)
  :config
  (counsel-mode 1))

(use-package ivy-rich
  :after ivy
  :init
  (ivy-rich-mode 1)
  (setq ivy-rich-parse-remote-buffer nil))

Prescient

(use-package ivy-prescient
  :after counsel
  :custom
  (ivy-prescient-enable-filtering nil)
  :config
  (setq ivy-prescient-sort-commands '(:not swiper swiper-isearch counsel-yank-pop counsel-find-file counsel-recentf counsel-descbinds))
  (ivy-prescient-mode 1))
(defun my/startup-window-layout ()
  (split-window-horizontally)
  (other-window 1)
  (split-window-below)
  (other-window 2)
  )

(defun my/config-startup-perspective ()
  (persp-switch "project")
  (my/startup-window-layout)
  (switch-to-buffer "*dashboard*")
  (other-window 1)
  (shell (generate-new-buffer-name "*shell*"))
  (other-window 1)
  (switch-to-buffer "*scratch* (project)")
  )

(use-package perspective
  :custom
  (persp-mode-prefix-key (kbd "C-c x"))
  :init
  (persp-mode 1)
  (my/config-startup-perspective)
  )

(use-package burly)

Projectile

(defun my/switch-project-action ()
 (persp-switch (projectile-project-name))
 )
  (use-package projectile
    :init
    (setq projectile-project-search-path '("~/" "~/work"))
    :config
    (setq projectile-completion-system 'ivy)
    (setq projectile-switch-project-action #'my/switch-project-action)
    (projectile-mode)
  )

Ace Window

(use-package ace-window)

Expand

(use-package expand-region)
(use-package easy-kill)

Multiple cursors

(use-package multiple-cursors)  

Tramp

(with-eval-after-load 'tramp
  (add-to-list 'tramp-methods
               '("sshxa"
                 (tramp-login-program "ssh")
                 (tramp-login-args
                  (("-l" "%u")
                   ("-p" "%p")
                   ("%c")
                   ("-e" "none")
                   ("-t" "-t")
                   ("-o" "RemoteCommand=\"%l\"")
                   ("-A")
                   ("%h")))
                 (tramp-async-args
                  (("-q")))
		   (tramp-remote-shell         "/bin/sh")
                 (tramp-remote-shell-login
                  ("-l"))
                 (tramp-remote-shell-args
                  ("-c")))
               )
  (tramp-set-completion-function "sshxa" tramp-completion-function-alist-ssh))

  (use-package docker-tramp)

    (defun remote-shell--dummy1 (path)
        (interactive "sPath:")
        (let ((default-directory path) (current-prefix-arg '(4)))
          (call-interactively 'shell)))

    (defun remote-shell--dummy2 (path)
        (interactive (list (read-directory-name "Default directory: " nil nil t default-directory)))
        (let ((default-directory path) (current-prefix-arg '(4)))
          (call-interactively 'shell)))

    ;; (load-file (concat (car (directory-files "/home/juanpablo/.emacs.d/elpa/" t "counsel*" nil)) "/counsel.el"))
    (load-file "/home/juanpablo/.emacs.d/straight/build/counsel/counsel.el")
    (defun open-shell-new-buffer (path)
      (let ((default-directory path) (current-prefix-arg '(4)))
        (call-interactively 'shell)
        )
      )
    (defun remote-shell ()
      (interactive)
      (ivy-read "Open shell in path:" #'read-file-name-internal
                :matcher #'counsel--find-file-matcher
                :initial-input nil
                :action #'open-shell-new-buffer
                :preselect (counsel--preselect-file)
                :require-match 'confirm-after-completion
                :history 'file-name-history
                :keymap counsel-find-file-map
                :caller #'remote-shell)
      )
(defun efs/org-font-setup ()
  ;; Replace list hyphen with dot
  (font-lock-add-keywords 'org-mode
                          '(("^ *\\([-]\\) "
                             (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) ""))))))

  ;; Set faces for heading levels
  (dolist (face '((org-level-1 . 1.2)
                  (org-level-2 . 1.1)
                  (org-level-3 . 1.05)
                  (org-level-4 . 1.0)
                  (org-level-5 . 1.1)
                  (org-level-6 . 1.1)
                  (org-level-7 . 1.1)
                  (org-level-8 . 1.1)))
    (set-face-attribute (car face) nil :font "Cantarell" :weight 'regular :height (cdr face)))

  ;; Ensure that anything that should be fixed-pitch in Org files appears that way
  (set-face-attribute 'org-block nil    :foreground nil :inherit 'fixed-pitch)
  (set-face-attribute 'org-table nil    :inherit 'fixed-pitch)
  (set-face-attribute 'org-formula nil  :inherit 'fixed-pitch)
  (set-face-attribute 'org-code nil     :inherit '(shadow fixed-pitch))
  (set-face-attribute 'org-table nil    :inherit '(shadow fixed-pitch))
  (set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch))
  (set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch))
  (set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch))
  (set-face-attribute 'org-checkbox nil  :inherit 'fixed-pitch)
  (set-face-attribute 'line-number nil :inherit 'fixed-pitch)
  (set-face-attribute 'line-number-current-line nil :inherit 'fixed-pitch))

(defun efs/org-mode-setup ()
  (org-indent-mode)
  (variable-pitch-mode 1)
  (visual-line-mode 1))

(use-package org
  :commands (org-capture org-agenda)
  :hook (org-mode . efs/org-mode-setup)
  :config
  (setq org-ellipsis "")
  (efs/org-font-setup)
  (org-babel-do-load-languages
    'org-babel-load-languages
    '((emacs-lisp . t)
      (python . t)
      (shell . t)))
  (setq org-confirm-babel-evaluate nil)
  (setq org-capture-templates nil)
)
(use-package org-bullets
  :hook (org-mode . org-bullets-mode)
  :custom
  (org-bullets-bullet-list '("" "" "" "" "" "" "")))
(use-package org-download
  :init
  (with-eval-after-load 'org
    (org-download-enable))
)

In-buffer Completion

    (use-package corfu

    ;; Optional customizations
      :custom
      (corfu-cycle t)                ;; Enable cycling for`corfu-next/previous'
      (corfu-auto t)			  ;; Enable auto completion
      (corfu-separator ?\s)          ;; Orderless field separator
      (corfu-quit-at-boundary 'separator)   ;; Never quit at completion boundary
      (corfu-quit-no-match 'separator)      ;; Never quit, even if there is no match
      (corfu-preview-current 'insert)    ;; Disable current candidate preview
      ;; (corfu-preselect-first nil)    ;; Disable candidate preselection
      ;; (corfu-on-exact-match nil)     ;; Configure handling of exact matches
      (corfu-echo-documentation nil) ;; Disable documentation in the echo area
    ;; (corfu-scroll-margin 5)        ;; Use scroll margin

      (corfu-auto-prefix 2)
      (corfu-auto-delay 0.0)

      :init
      (global-corfu-mode)
    ;; You may want to enable Corfu only for certain modes.
    ;; :hook ((prog-mode . corfu-mode)
    ;;        (shell-mode . corfu-mode)
    ;;        (eshell-mode . corfu-mode))

    ;; Recommended: Enable Corfu globally.
    ;; This is recommended since dabbrev can be used globally (M-/).
    )

  ;; Use dabbrev with Corfu!
  (use-package dabbrev
    ;; Swap M-/ and C-M-/
    :bind (("M-/" . dabbrev-completion)
           ("C-M-/" . dabbrev-expand)))


      ;; Add extensions
    (use-package cape
      ;; Bind dedicated completion commands
      ;; Alternative prefix keys: C-c p, M-p, M-+, ...
      :bind (;; ("C-c p p" . completion-at-point) capf
             ;; ("C-c p t" . complete-tag)        ;; etags
             ;; ("C-c p d" . cape-dabbrev)        ;; or dabbrev-completion
             ;; ("C-c p f" . cape-file)
             ;; ("C-c p k" . cape-keyword)
             ;; ("C-c p s" . cape-symbol)
             ;; ("C-c p a" . cape-abbrev)
             ;; ("C-c p i" . cape-ispell)
             ;; ("C-c p l" . cape-line)
             ;; ("C-c p w" . cape-dict)
             ;; ("C-c p \\" . cape-tex)
             ;; ("C-c p _" . cape-tex)
             ;; ("C-c p ^" . cape-tex)
             ;; ("C-c p &" . cape-sgml)
             ;; ("C-c p r" . cape-rfc1345)
             )
      :init
      ;; Add `completion-at-point-functions', used by `completion-at-point'.
      (add-to-list 'completion-at-point-functions #'cape-file)
      (add-to-list 'completion-at-point-functions #'cape-dabbrev)
      ;;(add-to-list 'completion-at-point-functions #'cape-keyword)
      ;;(add-to-list 'completion-at-point-functions #'cape-tex)
      ;;(add-to-list 'completion-at-point-functions #'cape-sgml)
      ;;(add-to-list 'completion-at-point-functions #'cape-      ;;(add-to-list 'completion-at-point-functions #'cape-abbrev)
      ;;(add-to-list 'completion-at-point-functions #'cape-ispell)
      ;;(add-to-list 'completion-at-point-functions #'cape-dict)
      ;;(add-to-list 'completion-at-point-functions #'cape-symbol)
      ;;(add-to-list 'completion-at-point-functions #'cape-line)
    )

(use-package kind-icon
  :after corfu
  :custom
  (kind-icon-use-icons t)
  (kind-icon-default-face 'corfu-default) ; Have background color be the same as `corfu' face background
  (kind-icon-blend-background nil)  ; Use midpoint color between foreground and background colors ("blended")?
  (kind-icon-blend-frac 0.08)

  ;; NOTE 2022-02-05: `kind-icon' depends `svg-lib' which creates a cache
  ;; directory that defaults to the `user-emacs-directory'. Here, I change that
  ;; directory to a location appropriate to `no-littering' conventions, a
  ;; package which moves directories of other packages to sane locations.
  (svg-lib-icons-dir (no-littering-expand-var-file-name "svg-lib/cache/")) ; Change cache dir
  :config
  (add-to-list 'corfu-margin-formatters #'kind-icon-margin-formatter) ; Enable `kind-icon'

  ;; Add hook to reset cache so the icon colors match my theme
  ;; NOTE 2022-02-05: This is a hook which resets the cache whenever I switch
  ;; the theme using my custom defined command for switching themes. If I don't
  ;; do this, then the backgound color will remain the same, meaning it will not
  ;; match the background color corresponding to the current theme. Important
  ;; since I have a light theme and dark theme I switch between. This has no
  ;; function unless you use something similar
  (add-hook 'kb/themes-hooks #'(lambda () (interactive) (kind-icon-reset-cache))))

(use-package corfu-doc
;; NOTE 2022-02-05: At the time of writing, `corfu-doc' is not yet on melpa
:straight (corfu-doc :type git :host github :repo "galeo/corfu-doc")
:after corfu
:hook (corfu-mode . corfu-doc-mode)
:custom
(corfu-doc-delay 0.5)
(corfu-doc-max-width 70)
(corfu-doc-max-height 20)

;; NOTE 2022-02-05: I've also set this in the `corfu' use-package to be
;; extra-safe that this is set when corfu-doc is loaded. I do not want
;; documentation shown in both the echo area and in the `corfu-doc' popup.
(corfu-echo-documentation nil))

  (defun my/lsp-mode-setup ()
    (setq lsp-headerline-breadcrumb-segments '(path-up-to-project file symbols))
    (lsp-headerline-breadcrumb-mode))

  (defun my/lsp-mode-setup-completion ()
    (setf (alist-get 'styles (alist-get 'lsp-capf completion-category-defaults))
          '(flex))) ;; Configure flex

  (use-package lsp-mode
    :custom
    (lsp-completion-provider :none) ;; we use Corfu!
    :commands (lsp lsp-deferred)
    :hook
    (lsp-mode . my/lsp-mode-setup)
    (lsp-completion-mode . my/lsp-mode-setup-completion)
    :init
    (setq lsp-keymap-prefix "C-c l")
    (add-to-list 'exec-path "/home/juanpablo/miniconda3/bin")
    :config
    (lsp-enable-which-key-integration t))

  (use-package lsp-ui
    :hook (lsp-mode . lsp-ui-mode)
    :custom
    (lsp-ui-doc-position 'bottom)
    (lsp-ui-imenu-buffer-position 'left)
    )


  (use-package lsp-treemacs
    :after lsp)

  (use-package lsp-ivy)

  (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 evil-nerd-commenter
  :bind ("M-/" . evilnc-comment-or-uncomment-lines))

Python

(use-package python-mode
  :hook (python-mode . lsp-deferred)
  :custom
  (dap-python-debugger 'debugpy)
  :config
  (require 'dap-python))

(use-package sphinx-doc
  :hook (python-mode . sphinx-doc-mode)
  )

(use-package jupyter)

(use-package pyvenv)

ChatGPT

(use-package chatgpt
  :straight (:host github :repo "joshcho/ChatGPT.el" :files ("dist" "*.el"))
  :init
  (require 'python)
  (setq chatgpt-repo-path "~/.emacs.d/straight/repos/ChatGPT.el/")
  :bind ("C-c q" . chatgpt-query)
  )

Writing

Mail

(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu4e")

(use-package mu4e
  :ensure nil
  :config
  (setq mu4e-contexts
      (list
       ;; Work account
       (make-mu4e-context
        :name "Kwali"
        :match-func
          (lambda (msg)
            (when msg
              (string-prefix-p "/Gmail" (mu4e-message-field msg :maildir))))
        :vars '((user-mail-address . "[email protected]")
                (user-full-name    . "Juan Pablo Morales")
                (smtpmail-smtp-server  . "smtp.gmail.com")
                (smtpmail-smtp-service . 465)
                (smtpmail-stream-type  . ssl)
                (mu4e-drafts-folder  . "/Gmail/[Gmail]/Drafts")
                (mu4e-sent-folder  . "/Gmail/[Gmail]/Sent Mail")
                (mu4e-refile-folder  . "/Gmail/[Gmail]/All Mail")
                (mu4e-trash-folder  . "/Gmail/[Gmail]/Trash")))))

  (setq message-send-mail-function 'smtpmail-send-it)
)

Atomic Emacs

(use-package atomic-chrome
  
  :config
  (atomic-chrome-start-server)
  (setq atomic-chrome-buffer-open-style 'frame)
  (setq atomic-chrome-default-major-mode 'python-mode)
  (setq atomic-chrome-url-major-mode-alist
	'(("redmine" . textile-mode)))
)

EAF

(use-package eaf :straight (eaf :type git :host github :repo “emacs-eaf/emacs-application-framework” :files (”.el” ”.py” “core” “app” “*.json”) :includes (eaf-browser) :pre-build ((“python” “install-eaf.py” “–install” “browser”)) ) :custom (eaf-browser-continue-where-left-off t) :config (setq eaf-browser-enable-adblocker t) )

(use-package eaf-browser)

(defun my/eaf-open-browser (&optional args) (interactive “P”) (progn (split-window-right) (other-window 1) ) (if (equal current-prefix-arg ‘(4)) (call-interactively #’eaf-open-browser) (eaf-open (eaf-wrap-url “www.google.com”) “browser” args)) )

(equal current-prefix-arg nil)

Nyxt

  (use-package emacs-with-nyxt
    :ensure nil
    :load-path "~/.emacs.d/site-lisp/emacs-with-nyxt"
    )

(use-package slime
    :config
    (setq slime-lisp-implementations 
      '(
        ;; (clisp ("/usr/bin/clisp"))
        (sbcl ("/usr/bin/sbcl"))
      )
    )
  )

  ;; (use-package sly
  ;;   :config
  ;;   (setq sly-lisp-implementations 
  ;;     '((clisp ("/usr/bin/clisp"))
  ;;       ;; (sbcl ("/usr/bin/sbcl"))
  ;;     )
  ;;   )
  ;; )
(use-package restclient
  :mode (("\\.http\\'" . restclient-mode))
  )

Elfeed

(use-package elfeed
  :config
  (setq elfeed-feeds
    '("https://planet.emacslife.com/atom.xml")
    )
  )