From 668a8af6e1b0fca1f186b51a81681282fbb73aea Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Mon, 2 Oct 2023 19:01:26 +0700 Subject: [PATCH] Emacs: select-frame, open in rider, custom agenda, magit-here --- .config/emacs/init.org | 90 +++++++++++++++++++++++++++++++++---- .config/fish/fish_variables | 2 +- 2 files changed, 83 insertions(+), 9 deletions(-) diff --git a/.config/emacs/init.org b/.config/emacs/init.org index 091ef18..4753916 100644 --- a/.config/emacs/init.org +++ b/.config/emacs/init.org @@ -250,6 +250,7 @@ Finish up '((dotenv :url "https://github.com/pkulev/dotenv.el") (doom-themes :url "https://github.com/JosephFerano/doom-themes") (pico8-mode :url "https://github.com/Kaali/pico8-mode") + (org-timeblock :url "https://github.com/ichernyshovvv/org-timeblock") (app-launcher :url "https://github.com/SebastienWae/app-launcher"))) (package-initialize) @@ -1296,6 +1297,22 @@ Ace Window will show a hint if there are more than 2 windows, but I don't really ;; (evil-global-set-key 'normal (kbd "M-8") '(lambda () (interactive) (tab-bar-select-tab 8))) ;; (evil-global-set-key 'normal (kbd "M-9") '(lambda () (interactive) (tab-bar-select-tab 9))) +#+end_src +*** Frames +#+begin_src emacs-lisp +(undelete-frame-mode) +(defun joe/select-frame () + (interactive) + (let* ((frames (mapcar + (lambda (f) (cons (substring-no-properties + (cdr (assoc 'name (frame-parameters f)))) + f)) + (frame-list))) + (selected-frame-name (completing-read "Select Frame: " (mapcar #'car frames))) + (selected-frame (alist-get selected-frame-name frames "" nil 'string-equal))) + (select-frame-set-input-focus selected-frame))) + +(define-key 'ctl-x-5-prefix (kbd "RET") #'joe/select-frame) #+end_src ** Projects #+begin_src emacs-lisp @@ -1320,6 +1337,29 @@ Ace Window will show a hint if there are more than 2 windows, but I don't really (define-key 'ctl-x-5-prefix "n" #'set-frame-name)) #+end_src + +Stuff to immediately switch to Jetbrains for debugging + +#+begin_src emacs-lisp + +(global-set-key (kbd "C-M-r") #'joe/open-in-rider) +(defun joe/raise-frame-hook () +(select-frame-set-input-focus (selected-frame))) +(add-hook 'server-switch-hook #'joe/raise-frame-hook) +(add-hook 'server-switch-hook #'raise-frame) + +(defun joe/open-in-rider () + (interactive) + (shell-command + (mapconcat #'shell-quote-argument + (list "rider" + "--line" + (int-to-string (line-number-at-pos)) + "--column" + (int-to-string (current-column)) + buffer-file-name) + " "))) +#+end_src ** VEMCO *** Vertico #+begin_src emacs-lisp @@ -1760,7 +1800,7 @@ be kept here commented out in case we want to try it again. (setq vterm-shell "/bin/fish") (setq vterm-timer-delay 0.01) (setq vterm-buffer-name-string "VTerm - %s") -(setq vterm-buffer-name-string nil) +;; (setq vterm-buffer-name-string nil) (setq vterm-max-scrollback 100000) (setq vterm-kill-buffer-on-exit t) @@ -2045,10 +2085,15 @@ the right frame, I'm going to use the frame's name to close and remove the hook #+begin_src emacs-lisp (require 'gdscript-mode) #+end_src +** Game Dev +#+begin_src emacs-lisp +(add-to-list 'auto-mode-alist '("\\.vert\\'" . shader-mode)) +(add-to-list 'auto-mode-alist '("\\.frag\\'" . shader-mode)) +#+end_src ** Programming Languages *** Python #+begin_src emacs-lisp -(require 'elpy) + (define-key inferior-python-mode-map (kbd "C-n") #'comint-next-input) (define-key inferior-python-mode-map (kbd "C-p") #'comint-previous-input) @@ -2330,6 +2375,26 @@ and there's no need for a middle-man when it's already been implemented. " ═════ " " ════════════════════ ")) (define-key global-map (kbd "C-c a") #'org-agenda) + +(setq org-agenda-custom-commands + '(("n" "Agenda and all TODOs" + ((agenda "") + (alltodo ""))) + ("d" "Daily view" + ((agenda "" + ((org-agenda-overriding-header "Daily Agenda") + (org-agenda-span 1) + (org-agenda-time-grid nil) + (org-agenda-overriding-columns-format "%20ITEM %DEADLINE") + (org-agenda-view-columns-initially nil))) + (tags-todo "dampsig" + ((org-agenda-overriding-header "🖥️📚🔢⚛️📊🕹️ DAMPSIG\n") + (org-agenda-block-separator ?*))) + (tags-todo "+PRIORITY=\"B\"" + ()) + (tags-todo "+PRIORITY=\"C\"") + (tags-todo "+PRIORITY=\"D\""))) + )) #+end_src *** org-capture #+begin_src emacs-lisp @@ -2346,16 +2411,16 @@ and there's no need for a middle-man when it's already been implemented. ":DIFFICULTY: medium" ":END:" "" - "#+TITLE: Leetcode %?: " + "#+TITLE: Leetcode %?" "#+AUTHOR: Joseph Ferano" "#+STARTUP: show2levels" "#+TAGS: " "" "* Python Solution" ":PROPERTIES:" - ":CompletionTime: 7m" - ":TimeComplexity: O(logn)" - ":MemoryComplexity: O(h)" + ":CompletionTime: " + ":TimeComplexity: O()" + ":MemoryComplexity: O()" ":END:" ":LOGBOOK:" ":END:" @@ -2373,8 +2438,8 @@ and there's no need for a middle-man when it's already been implemented. (concat "* %^t\n" "** Schedule\n" - "** Notes\n" - "** Resources")) + "** Resources\n" + "** Notes")) (setq org-capture-templates `( ("l" "Leetcode Solution" plain @@ -2470,6 +2535,15 @@ over as explained [[https://manueluberti.eu/2018/02/17/magit-bury-buffer.html][h (setq magit-bury-buffer-function #'joe/magit-kill-buffers) (setq magit-clone-set-remote.pushDefault t) (setq magit-clone-default-directory "~/Development/") + +(defun joe/magit-status-here () + (interactive) + (let ((magit-display-buffer-function + (lambda (buffer) + (display-buffer buffer '(display-buffer-same-window))))) + (magit-status))) + +(evil-define-key 'normal joe/evil-space-mode-map (kbd "SPC g h") #'joe/magit-status-here) ;; (define-key magit-mode-map "h" 'backward-char) ;; (define-key magit-mode-map "l" 'backward-char) diff --git a/.config/fish/fish_variables b/.config/fish/fish_variables index bf11fb8..2373482 100644 --- a/.config/fish/fish_variables +++ b/.config/fish/fish_variables @@ -40,4 +40,4 @@ SETUVAR fish_pager_color_description:B3A06D\x1eyellow SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan SETUVAR fish_pager_color_selected_background:\x2dr -SETUVAR fish_user_paths:/home/joe/\x2elocal/bin/elm\x1e/home/joe/\x2elocal/share/bin/cargo/bin\x1e\x1e/home/joe/\x2elocal/bin +SETUVAR fish_user_paths:/home/joe/\x2elocal/share/JetBrains/Toolbox/scripts\x1e/home/joe/\x2elocal/bin/elm\x1e/home/joe/\x2elocal/share/bin/cargo/bin\x1e\x1e/home/joe/\x2elocal/bin