Compare commits

..
2 Commits
2 changed files with 39 additions and 4 deletions
+27 -1
View File
@@ -478,6 +478,27 @@ Functions that only use built-in Emacs functionality.
(interactive)
(org-babel-load-file (concat dot-emacs-dir "/config.org")))
(defun dot/copy-cpp-function-implementation ()
(interactive)
(save-excursion
(let ((func (save-excursion
(re-search-backward "\\b")
(re-search-forward "\\([^;]+\\);")
(match-string 1)))
(type (progn
(re-search-backward "\\b")
(push-mark)
(back-to-indentation)
(buffer-substring (mark) (point))))
(class (progn
(backward-up-list)
(backward-sexp)
(back-to-indentation)
(forward-to-word 1)
(current-word))))
(kill-new (concat type class "::" func "\n{\n}"))))
(message "Copied function implementation"))
;; Reference: http://turingmachine.org/bl/2013-05-29-recursively-listing-directories-in-elisp.html
(defun dot/directory-files-recursively-depth (dir regexp include-directories maxdepth)
"Depth limited variant of the built-in `directory-files-recursively'."
@@ -1115,6 +1136,7 @@ General.el ~leader key binds.
"v l" '(:ignore t :which-key "list")
"v l r" '(magit-list-repositories :which-key "List repositories")
"v l s" '(magit-list-submodules :which-key "List submodules")
"v r" '(dot/magit-select-repo :which-key "Select repo")
;; Window
"w" '(:ignore t :which-key "window")
@@ -1170,10 +1192,14 @@ https://github.com/suyashbire1/emacs.d/blob/master/init.el
:global-prefix dot/localleader-alt-key
:states '(normal visual insert motion emacs)
:keymaps 'override ; prevent leader keybindings from ever being overridden
"" '(:ignore t :which-key "<localleader>")
)
(local-leader c++-mode-map
"i" '(:ignore t :which-key "insert")
"i i" '(dot/copy-cpp-function-implementation :which-key "Copy function implementation")
)
(local-leader org-mode-map
"'" '(org-edit-special :which-key "Org edit")
"e" '(org-export-dispatch :which-key "Org export")
+12 -3
View File
@@ -88,7 +88,9 @@ GLSL integration with company requires the package: ~glslang~.
(use-package transient
:defer t
:config (setq transient-history-file (concat dot-cache-dir "/transient/history.el")))
:config
(setq transient-history-file (concat dot-cache-dir "/transient/history.el"))
(setq transient-values-file (concat dot-cache-dir "/transient/values.el")))
(use-package magit
:after (diff-hl transient)
@@ -98,14 +100,21 @@ GLSL integration with company requires the package: ~glslang~.
:hook (magit-post-refresh . diff-hl-magit-post-refresh)
:config
(setq git-commit-fill-column 72)
(setq git-commit-summary-max-length 70)
(setq git-commit-summary-max-length 72)
(setq magit-completing-read-function #'selectrum-completing-read)
(setq magit-diff-paint-whitespace-lines 'both)
(setq magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)
(setq magit-repository-directories '(("~/dotfiles" . 0)
("~/code" . 3)))
(put 'magit-log-select-pick :advertised-binding [?\M-c])
(put 'magit-log-select-quit :advertised-binding [?\M-k]))
(put 'magit-log-select-quit :advertised-binding [?\M-k])
(defun dot/magit-select-repo ()
"Select project repo."
(interactive)
(let ((current-prefix-arg '(t)))
(call-interactively #'magit-status))))
#+END_SRC
** Project