Compare commits
2
Commits
8904a85694
...
c3811b7f78
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c3811b7f78 | ||
|
|
3378ba974c |
@@ -478,6 +478,27 @@ Functions that only use built-in Emacs functionality.
|
|||||||
(interactive)
|
(interactive)
|
||||||
(org-babel-load-file (concat dot-emacs-dir "/config.org")))
|
(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
|
;; 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)
|
(defun dot/directory-files-recursively-depth (dir regexp include-directories maxdepth)
|
||||||
"Depth limited variant of the built-in `directory-files-recursively'."
|
"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" '(:ignore t :which-key "list")
|
||||||
"v l r" '(magit-list-repositories :which-key "List repositories")
|
"v l r" '(magit-list-repositories :which-key "List repositories")
|
||||||
"v l s" '(magit-list-submodules :which-key "List submodules")
|
"v l s" '(magit-list-submodules :which-key "List submodules")
|
||||||
|
"v r" '(dot/magit-select-repo :which-key "Select repo")
|
||||||
|
|
||||||
;; Window
|
;; Window
|
||||||
"w" '(:ignore t :which-key "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
|
:global-prefix dot/localleader-alt-key
|
||||||
:states '(normal visual insert motion emacs)
|
:states '(normal visual insert motion emacs)
|
||||||
:keymaps 'override ; prevent leader keybindings from ever being overridden
|
:keymaps 'override ; prevent leader keybindings from ever being overridden
|
||||||
|
|
||||||
"" '(:ignore t :which-key "<localleader>")
|
"" '(: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
|
(local-leader org-mode-map
|
||||||
"'" '(org-edit-special :which-key "Org edit")
|
"'" '(org-edit-special :which-key "Org edit")
|
||||||
"e" '(org-export-dispatch :which-key "Org export")
|
"e" '(org-export-dispatch :which-key "Org export")
|
||||||
|
|||||||
@@ -88,7 +88,9 @@ GLSL integration with company requires the package: ~glslang~.
|
|||||||
|
|
||||||
(use-package transient
|
(use-package transient
|
||||||
:defer t
|
: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
|
(use-package magit
|
||||||
:after (diff-hl transient)
|
: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)
|
:hook (magit-post-refresh . diff-hl-magit-post-refresh)
|
||||||
:config
|
:config
|
||||||
(setq git-commit-fill-column 72)
|
(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-completing-read-function #'selectrum-completing-read)
|
||||||
(setq magit-diff-paint-whitespace-lines 'both)
|
(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)
|
(setq magit-repository-directories '(("~/dotfiles" . 0)
|
||||||
("~/code" . 3)))
|
("~/code" . 3)))
|
||||||
|
|
||||||
(put 'magit-log-select-pick :advertised-binding [?\M-c])
|
(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
|
#+END_SRC
|
||||||
|
|
||||||
** Project
|
** Project
|
||||||
|
|||||||
Reference in New Issue
Block a user