emacs.d/bundle/bundle--mk.el

81 lines
2.5 KiB
EmacsLisp
Raw Normal View History

2022-05-06 19:55:40 +02:00
;; (defun mk-show-modeline ()
;; (interactive)
;; (setq mode-line-format
;; '(("-" mode-line-mule-info
;; mode-line-modified
;; mode-line-frame-identification
;; mode-line-buffer-identification " "
;; mode-line-position
;; mode-line-modes
;; (which-func-mode
;; ("" which-func-format "--"))
;; (global-mode-string
;; ("--" global-mode-string)) "-%-")))
;; (defvar mode-line-format-current
;; (symbol-value 'mode-line-format)))
2020-11-25 08:58:30 +01:00
2022-05-06 19:55:40 +02:00
;; (defun mk-hide-modeline ()
;; (interactive)
;; (setq mode-line-format nil))
2020-11-25 08:58:30 +01:00
2022-05-06 19:55:40 +02:00
;; (defun mk-write-mode-enable ()
;; (setq olivetti-body-width 73)
;; (olivetti-mode)
;; (mk-hide-modeline))
2020-11-25 08:58:30 +01:00
2022-05-06 19:55:40 +02:00
;; (defun mk-write-mode-disable ()
;; (olivetti-mode)
;; (mk-show-modeline))
2020-08-20 10:41:09 +02:00
2021-06-01 16:43:37 +02:00
(defun me/split-windows-horizontal (count-windows)
2020-08-20 10:41:09 +02:00
"Split windows horizontal by equal width."
2021-06-01 16:43:37 +02:00
(interactive "nHow many splits? ")
2020-08-20 10:41:09 +02:00
(delete-other-windows)
(let ((width (/ (window-total-width) count-windows)))
2021-06-05 16:56:43 +02:00
(dotimes (i (1- count-windows))
(split-window-right (- width)))))
(defun me/split-windows-vertical (count-windows)
"Split windows vertical by equal width."
(interactive "nHow many splits? ")
(delete-other-windows)
(let ((height (/ (window-total-height) count-windows)))
(dotimes (i (1- count-windows))
(split-window-below (- height)))))
2021-06-01 16:43:37 +02:00
(defun me/split-h3 ()
(interactive)
(me/split-windows-horizontal 3))
2020-08-20 10:41:09 +02:00
2021-06-05 16:56:43 +02:00
(defun me/split-v3 ()
2020-08-20 10:41:09 +02:00
(interactive)
2021-06-05 16:56:43 +02:00
(me/split-windows-vertical 3))
;; Set transparency of emacs
(defun transparency (value)
"Sets the transparency of the frame window. 0=transparent/100=opaque"
(interactive "nTransparency Value 0 - 100 opaque: ")
(set-frame-parameter (selected-frame) 'alpha value))
2021-06-02 09:39:34 +02:00
2021-11-06 16:58:57 +01:00
(defun jnf/magit-browse-pull-request ()
"In `magit-log-mode', open the associated pull request at point."
(interactive)
(let* ((remote-url
(car
(git-link--exec "remote" "get-url"
(format "%s" (magit-get-current-remote)))))
(beg (line-beginning-position))
(end (line-end-position))
(region (buffer-substring-no-properties beg end)))
(save-match-data
(and (string-match "(\\#\\([0-9]+\\))$" region)
(browse-url-default-macosx-browser
(concat
(s-replace ".git" "" remote-url)
"/pull/"
(match-string 1 region)))))))
2021-12-15 20:32:37 +01:00
2022-05-06 19:55:40 +02:00
;; (if (display-graphic-p)
;; (add-hook 'after-init-hook (lambda () (org-agenda-list) (me/split-h3)))
;; (org-agenda-list))