|
|
|
@ -203,6 +203,27 @@ |
|
|
|
|
(man word) |
|
|
|
|
"Not a word."))) |
|
|
|
|
|
|
|
|
|
(defun fez/insert-line () |
|
|
|
|
(interactive) |
|
|
|
|
(move-beginning-of-line nil) |
|
|
|
|
(open-line 1)) |
|
|
|
|
|
|
|
|
|
;; TODO: Put this in C-mode or something |
|
|
|
|
(defun fez/include-guard () |
|
|
|
|
(interactive) |
|
|
|
|
(let ((guard (concat (upcase (file-name-base (buffer-file-name))) |
|
|
|
|
"_H"))) |
|
|
|
|
(goto-char (point-min)) |
|
|
|
|
(insert (concat "#ifndef " |
|
|
|
|
guard |
|
|
|
|
"\n#define " |
|
|
|
|
guard |
|
|
|
|
"\n")) |
|
|
|
|
(goto-char (point-max)) |
|
|
|
|
(insert (concat "\n\n\n#endif /* " |
|
|
|
|
guard |
|
|
|
|
" */\n"))) |
|
|
|
|
(forward-line -3)) |
|
|
|
|
;; Eshell convinience commands. |
|
|
|
|
(defalias 'open 'find-file-other-window) |
|
|
|
|
(defalias 'clean 'eshell/clear-scrollback) |
|
|
|
@ -218,13 +239,16 @@ |
|
|
|
|
;; Better buffer management (smol). |
|
|
|
|
(global-set-key (kbd "C-x C-b") 'bs-show) |
|
|
|
|
|
|
|
|
|
;; Insipiration from Nyxt, kill the current buffer. |
|
|
|
|
;; Inspiration from Nyxt, kill the current buffer. |
|
|
|
|
(global-set-key (kbd "C-x C-k") 'kill-this-buffer) |
|
|
|
|
|
|
|
|
|
(global-set-key (kbd "C-c t") 'fez/time-stamp) |
|
|
|
|
|
|
|
|
|
(global-set-key (kbd "C-z C-m") 'fez/man-at-point) |
|
|
|
|
|
|
|
|
|
(global-set-key (kbd "C-S-o") 'open-line) |
|
|
|
|
(global-set-key (kbd "C-o") 'fez/insert-line) |
|
|
|
|
|
|
|
|
|
;; zap-up-to-char > zap-to-char |
|
|
|
|
(global-set-key (kbd "M-z") 'zap-up-to-char) |
|
|
|
|
|
|
|
|
|