Compare commits
4 Commits
4fe9a6b7e1
...
1e9910e471
| Author | SHA1 | Date | |
|---|---|---|---|
| 1e9910e471 | |||
| a4e15965bb | |||
| 99a0d6a185 | |||
| d95f45d049 |
41
README.md
41
README.md
@@ -2,11 +2,12 @@
|
||||
# Table of Contents
|
||||
|
||||
1. [Installation](#installation)
|
||||
2. [Usage](#usage)
|
||||
3. [Packages](#packages)
|
||||
4. [Information](#information)
|
||||
5. [Errors](#errors)
|
||||
6. [TODOs](#todos)
|
||||
2. [External programs](#programs)
|
||||
3. [Usage](#usage)
|
||||
4. [Packages](#packages)
|
||||
5. [Information](#information)
|
||||
6. [Errors](#errors)
|
||||
7. [TODOs](#todos)
|
||||
|
||||
This is an ongoing evolution of Emacs configuration files, inspired by
|
||||
a bunch of online resources.
|
||||
@@ -29,6 +30,13 @@ Installation path is `~/.config/emacs`. See details and other
|
||||
installed linux packages as requirements inside `sripts/install.sh`.
|
||||
|
||||
|
||||
<a id="programs"></a>
|
||||
|
||||
# External programs
|
||||
|
||||
- `ripgrep` (optional) used by `counsel-rg` (package `counsel`)
|
||||
|
||||
|
||||
<a id="usage"></a>
|
||||
|
||||
# Usage
|
||||
@@ -102,6 +110,13 @@ General key bindings and functions
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">all-the-icons-ivy-rich</td>
|
||||
<td class="org-right">20221202.1336</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">amx</td>
|
||||
<td class="org-right">20210305.118</td>
|
||||
@@ -564,6 +579,13 @@ General key bindings and functions
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">olivetti</td>
|
||||
<td class="org-right">20220330.635</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">ol-notmuch</td>
|
||||
<td class="org-right">20220428.1337</td>
|
||||
@@ -795,6 +817,13 @@ General key bindings and functions
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">posframe</td>
|
||||
<td class="org-right">20221220.544</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="org-left">pos-tip</td>
|
||||
<td class="org-right">20220715.102</td>
|
||||
@@ -930,7 +959,7 @@ General key bindings and functions
|
||||
|
||||
<tr>
|
||||
<td class="org-left">treemacs</td>
|
||||
<td class="org-right">20221107.2105</td>
|
||||
<td class="org-right">20221221.1301</td>
|
||||
<td class="org-left">melpa</td>
|
||||
</tr>
|
||||
|
||||
|
||||
62
README.org
62
README.org
@@ -21,6 +21,12 @@ sh -c "$(fetch -o - http://gitea.weseng.de/daniel/emacs/raw/master/scripts/insta
|
||||
Installation path is =~/.config/emacs=. See details and other
|
||||
installed linux packages as requirements inside =sripts/install.sh=.
|
||||
|
||||
* External programs
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: programs
|
||||
:END:
|
||||
- =ripgrep= (optional) used by =counsel-rg= (package =counsel=)
|
||||
|
||||
* Usage
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: usage
|
||||
@@ -55,10 +61,11 @@ General key bindings and functions
|
||||
- (=diff-buffer-with-file=) show a diff between buffer (current state) and file (saved state)
|
||||
|
||||
#+begin_src sh :exports results
|
||||
dir=$HOME/repos/emacs-conf/lisp
|
||||
dir=$(pwd)/lisp
|
||||
|
||||
verinfo() {
|
||||
#echo -n $1 ''
|
||||
# $dir: directory of packages
|
||||
# $1: package name (basenaem and w/o extension)
|
||||
if test -f $dir/$1.el; then
|
||||
ver=$(grep -i package-version: $dir/$1.el | cut -d":" -f2 | xargs)
|
||||
if test -z $ver; then
|
||||
@@ -71,31 +78,31 @@ verinfo() {
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_custom=$(
|
||||
for i in $(echo awesome-tray dialog); do
|
||||
map_pkg_ver() {
|
||||
# $1: list of package names, either full path (can include a version) or just the package name
|
||||
# $2: repo name
|
||||
# 1st: get package name: strips list element to basename and removes version and extension
|
||||
# 2nd: get package version (from the installed directory)
|
||||
# 3rd: print info
|
||||
for i in $1; do
|
||||
pkg=$(sed 's/-[0-9].*//' <(basename $i))
|
||||
ver=$(verinfo $pkg)
|
||||
echo $pkg $ver custom
|
||||
done)
|
||||
pkg_elpagnu=$(
|
||||
for i in $(ls -F ~/repos/my-elpa-gnu/archive/*.tar | grep -v @); do
|
||||
pkg=$(sed 's/-[0-9].*//' <(basename $i))
|
||||
ver=$(verinfo $pkg)
|
||||
echo $pkg $ver elpa-gnu
|
||||
done)
|
||||
pkg_elpanongnu=$(
|
||||
for i in $(ls -F ~/repos/my-elpa-nongnu/archive/*.tar | grep -v @); do
|
||||
pkg=$(sed 's/-[0-9].*//' <(basename $i))
|
||||
ver=$(verinfo $pkg)
|
||||
echo $pkg $ver elpa-nongnu
|
||||
done)
|
||||
pkg_melpa=$(
|
||||
for i in $(sort <(ls ~/repos/my-melpa/packages/*.tar | xargs -n1) <(ls ~/repos/my-melpa/packages/*.el | xargs -n1)); do
|
||||
pkg=$(sed 's/-[0-9].*//' <(basename $i))
|
||||
ver=$(verinfo $pkg)
|
||||
echo $pkg $ver melpa
|
||||
done)
|
||||
echo -e "$pkg_custom\n$pkg_elpagnu\n$pkg_elpanongnu\n$pkg_melpa" | sort | column -t -N PACKAGE_____________________,VERSION______,REPO_______
|
||||
echo $pkg $ver $2
|
||||
done
|
||||
}
|
||||
|
||||
pkg_custom_list=$(echo awesome-tray dialog)
|
||||
pkg_elpagnu_list=$(ls -F ~/repos/my-elpa-gnu/archive/*.tar | grep -v @)
|
||||
pkg_elpanongnu_list=$(ls -F ~/repos/my-elpa-nongnu/archive/*.tar | grep -v @)
|
||||
pkg_melpa_list=$(sort <(ls ~/repos/my-melpa/packages/*.tar | xargs -n1) <(ls ~/repos/my-melpa/packages/*.el | xargs -n1))
|
||||
|
||||
pkg_custom=$(map_pkg_ver "$pkg_custom_list" custom)
|
||||
pkg_elpagnu=$(map_pkg_ver "$pkg_elpagnu_list" elpa-gnu)
|
||||
pkg_elpanongnu=$(map_pkg_ver "$pkg_elpanongnu_list" elpa-nongnu)
|
||||
pkg_melpa=$(map_pkg_ver "$pkg_melpa_list" melpa)
|
||||
echo -e "$pkg_custom\n$pkg_elpagnu\n$pkg_elpanongnu\n$pkg_melpa" | \
|
||||
sort | \
|
||||
column -t -N PACKAGE_____________________,VERSION______,REPO_______
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
@@ -103,6 +110,7 @@ echo -e "$pkg_custom\n$pkg_elpagnu\n$pkg_elpanongnu\n$pkg_melpa" | sort | column
|
||||
| ace-window | 20220911.358 | melpa |
|
||||
| adaptive-wrap | 0.8 | elpa-gnu |
|
||||
| all-the-icons | 20220929.2303 | melpa |
|
||||
| all-the-icons-ivy-rich | 20221202.1336 | melpa |
|
||||
| amx | 20210305.118 | melpa |
|
||||
| anaconda-mode | 20220922.741 | melpa |
|
||||
| async | 20221217.649 | melpa |
|
||||
@@ -169,6 +177,7 @@ echo -e "$pkg_custom\n$pkg_elpagnu\n$pkg_elpanongnu\n$pkg_melpa" | sort | column
|
||||
| multiple-cursors | 20221126.743 | melpa |
|
||||
| notmuch | 20221115.1134 | melpa |
|
||||
| ob-async | 20210428.2052 | melpa |
|
||||
| olivetti | 20220330.635 | melpa |
|
||||
| ol-notmuch | 20220428.1337 | melpa |
|
||||
| org | 9.6 | elpa-gnu |
|
||||
| org-appear | 20220617.2355 | melpa |
|
||||
@@ -202,6 +211,7 @@ echo -e "$pkg_custom\n$pkg_elpagnu\n$pkg_elpanongnu\n$pkg_melpa" | sort | column
|
||||
| polymode | 20220820.163 | melpa |
|
||||
| popup | 20220927.161 | melpa |
|
||||
| popwin | 20210215.1849 | melpa |
|
||||
| posframe | 20221220.544 | melpa |
|
||||
| pos-tip | 20220715.102 | melpa |
|
||||
| powershell | 20220805.1712 | melpa |
|
||||
| pythonic | 20220723.1741 | melpa |
|
||||
@@ -221,7 +231,7 @@ echo -e "$pkg_custom\n$pkg_elpagnu\n$pkg_elpanongnu\n$pkg_melpa" | sort | column
|
||||
| systemd | 20210209.2052 | melpa |
|
||||
| tablist | 20200427.2205 | melpa |
|
||||
| transient | 20221202.1727 | melpa |
|
||||
| treemacs | 20221107.2105 | melpa |
|
||||
| treemacs | 20221221.1301 | melpa |
|
||||
| treemacs-magit | 20220917.1026 | melpa |
|
||||
| use-package | 20221209.2013 | melpa |
|
||||
| virtual-auto-fill | 20200906.2038 | melpa |
|
||||
|
||||
1937
lisp/all-the-icons-ivy-rich.el
Normal file
1937
lisp/all-the-icons-ivy-rich.el
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
;;; magit-version.el --- the Magit version you are using
|
||||
|
||||
(setq magit-version 3.3.0)
|
||||
(setq magit-version "3.3.0")
|
||||
|
||||
(provide 'migit-version)
|
||||
|
||||
|
||||
@@ -57,6 +57,12 @@
|
||||
[[help:kill-line][Cut rest of line]] ........... =C-k= [[move-line-down][Move line down]] .......... =M-down=
|
||||
[[help:indent-rigidly][Indent lines]] ........... =C-x= =TAB=
|
||||
|
||||
*Help*
|
||||
[[help:helpful-at-point][Symbol at point]] ........ =C-c= =C-d= [[help:describe-variable][Variable]] ................. =C-h= =v=
|
||||
[[help:helpful-command][Commands]] ................. =C-h= =C= [[help:helpful-variable][Variable (extended)]] ...... =C-h= =V=
|
||||
[[help:describe-function][Functions]] ................ =C-h= =f= [[help:describe-key][Key]] ...................... =C-h= =k=
|
||||
[[help:helpful-function][Functions (extended)]] ..... =C-h= =F= [[help:helpful-key][Key (extended)]] ........... =C-h= =K=
|
||||
|
||||
*Multiple cursors* [[help:mc/mark-all-dwim][Mark all at point]] .... =M-m= =s= =m= =a=
|
||||
, Jump to next cursor ...... =C-v= , (un)hide other lines ..... =C-'=
|
||||
, Jump to previous cursor .. =M-v=
|
||||
@@ -115,8 +121,14 @@
|
||||
- [[help:eval-print-last-sexp][last to buffer]] [[help:kill-sexp][Cut expression]] ........... =C-M-k=
|
||||
[[help:mark-sexp][Mark expression]] .......... =C-M-@= [[help:backward-kill-sexp][Cut last expression]] . =C-M-backsp=
|
||||
|
||||
|
||||
IBuffer
|
||||
|
||||
[[help:ibuffer-filter-by-unsaved][Filter unsaved files]] ....... =/= =u= [[help:ibuffer-filter-disable][Disable filter]] ............. =/= =/=
|
||||
|
||||
")
|
||||
(my-org-help-mode)
|
||||
(when (featurep 'org-appear) (org-appear-mode -1))
|
||||
(goto-char (point-min))
|
||||
(local-set-key (kbd "q") 'kill-buffer-and-window)
|
||||
(local-set-key (kbd "C-g") 'kill-buffer-and-window)
|
||||
|
||||
509
lisp/olivetti.el
Normal file
509
lisp/olivetti.el
Normal file
@@ -0,0 +1,509 @@
|
||||
;;; olivetti.el --- Minor mode for a nice writing environment -*- lexical-binding: t; -*-
|
||||
|
||||
;; Copyright (c) 2014-2021 Paul W. Rankin
|
||||
|
||||
;; Author: Paul W. Rankin <pwr@bydasein.com>
|
||||
;; Keywords: wp, text
|
||||
;; Package-Version: 20220330.635
|
||||
;; Package-Commit: 8d287a80c5e3d72ac01b56c8afe60b01f18500b4
|
||||
;; Version: 2.0.4
|
||||
;; Package-Requires: ((emacs "24.4"))
|
||||
;; URL: https://github.com/rnkn/olivetti
|
||||
|
||||
;; This file is not part of GNU Emacs.
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Olivetti
|
||||
;; ========
|
||||
|
||||
;; A simple Emacs minor mode for a nice writing environment.
|
||||
|
||||
;; Features
|
||||
;; --------
|
||||
|
||||
;; - Set a desired text body width to automatically resize window margins
|
||||
;; to keep the text comfortably in the middle of the window.
|
||||
;; - Text body width can be the number of characters (an integer), a fraction of
|
||||
;; the window width (a float between 0.0 and 1.0), or nil which uses the value
|
||||
;; of fill-column +2.
|
||||
;; - Interactively change body width with:
|
||||
;; olivetti-shrink C-c { { { ...
|
||||
;; olivetti-expand C-c } } } ...
|
||||
;; olivetti-set-width C-c |
|
||||
;; - If olivetti-body-width is an integer, the text body width will
|
||||
;; scale with use of text-scale-mode, whereas if a fraction (float) then
|
||||
;; the text body width will remain at that fraction.
|
||||
;; - Change the way the text body margins look with option olivetti-style: use
|
||||
;; margins, fringes, or both for a fancy "page" look.
|
||||
;; - Customize olivetti-fringe face to affect only Olivetti buffers.
|
||||
;; - Optionally remember the state of visual-line-mode on entry and
|
||||
;; recall its state on exit.
|
||||
|
||||
;; Olivetti keeps everything it does buffer-local, so you can write prose
|
||||
;; in one buffer and code in another, side-by-side in the same frame.
|
||||
|
||||
|
||||
;; Requirements
|
||||
;; ------------
|
||||
|
||||
;; - Emacs 24.4
|
||||
|
||||
|
||||
;; Installation
|
||||
;; ------------
|
||||
|
||||
;; The latest stable release of Olivetti is available via
|
||||
;; [MELPA-stable][1]. First, add MELPA-stable to your package archives:
|
||||
|
||||
;; M-x customize-option RET package-archives RET
|
||||
|
||||
;; Insert an entry named melpa-stable with URL:
|
||||
;; https://stable.melpa.org/packages/
|
||||
|
||||
;; You can then find the latest stable version of olivetti in the
|
||||
;; list returned by:
|
||||
|
||||
;; M-x list-packages RET
|
||||
|
||||
;; If you prefer the latest but perhaps unstable version, do the above
|
||||
;; using [MELPA][2].
|
||||
|
||||
|
||||
;; Advanced Installation
|
||||
;; ---------------------
|
||||
|
||||
;; Download the latest tagged release, move this file into your load-path
|
||||
;; and add to your init.el file:
|
||||
|
||||
;; (require 'olivetti)
|
||||
|
||||
;; If you wish to contribute to or alter Olivetti's code, clone the
|
||||
;; repository into your load-path and require as above:
|
||||
|
||||
;; git clone https://github.com/rnkn/olivetti.git
|
||||
|
||||
|
||||
;; Bugs and Feature Requests
|
||||
;; -------------------------
|
||||
|
||||
;; Send me an email (address in the package header). For bugs, please
|
||||
;; ensure you can reproduce with:
|
||||
|
||||
;; $ emacs -Q -l olivetti.el
|
||||
|
||||
|
||||
;; Hints
|
||||
;; -----
|
||||
|
||||
;; To always use a different width for a specific file, set a File
|
||||
;; Variable:
|
||||
|
||||
;; M-x add-file-local-variable RET olivetti-body-width RET 66 RET
|
||||
|
||||
;; See (info "(emacs) File Variables")
|
||||
|
||||
|
||||
;; Alternatives
|
||||
;; ------------
|
||||
|
||||
;; For those looking for a hardcore distraction-free writing mode with a much
|
||||
;; larger scope, I recommend [Writeroom Mode](https://github.com/joostkremers/writeroom-mode).
|
||||
|
||||
|
||||
;; [1]: https://stable.melpa.org/#/olivetti
|
||||
;; [2]: https://melpa.org/#/olivetti
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'fringe)
|
||||
|
||||
(defgroup olivetti ()
|
||||
"Minor mode for a nice writing environment"
|
||||
:prefix "olivetti-"
|
||||
:group 'text)
|
||||
|
||||
|
||||
;;; Internal Variables ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(eval-when-compile
|
||||
(require 'lisp-mnt)
|
||||
(defconst olivetti-version
|
||||
(lm-version load-file-name)))
|
||||
|
||||
(defvar-local olivetti--visual-line-mode
|
||||
nil
|
||||
"Value of `visual-line-mode' when when `olivetti-mode' is enabled.")
|
||||
|
||||
(defvar-local olivetti--split-window-preferred-function
|
||||
nil
|
||||
"Value of `split-window-preferred-function' when when
|
||||
`olivetti-mode' is enabled.")
|
||||
|
||||
(defvar-local olivetti--face-remap
|
||||
nil
|
||||
"Saved cookie from `face-remap-add-relative' when
|
||||
`olivetti-mode' is enabled.")
|
||||
|
||||
|
||||
;;; Options ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defcustom olivetti-mode-on-hook
|
||||
'(visual-line-mode)
|
||||
"Hook for `olivetti-mode', run after the mode is activated."
|
||||
:type 'hook
|
||||
:options '(visual-line-mode)
|
||||
:safe 'hook)
|
||||
|
||||
(defcustom olivetti-mode-off-hook
|
||||
nil
|
||||
"Hook for `olivetti-mode', run after the mode is deactivated."
|
||||
:type 'hook
|
||||
:safe 'hook)
|
||||
|
||||
(defcustom olivetti-body-width
|
||||
nil
|
||||
"Text body width to which to adjust relative margin width.
|
||||
If an integer, set text body width to that integer in columns; if
|
||||
a floating point between 0.0 and 1.0, set text body width to that
|
||||
fraction of the total window width. If nil (the default), use the
|
||||
value of `fill-column' + 2.
|
||||
|
||||
An integer is best if you want text body width to remain
|
||||
constant, while a floating point is best if you want text body
|
||||
width to change with window width.
|
||||
|
||||
The floating point can anything between 0.0 and 1.0 (exclusive),
|
||||
but use a value between about 0.33 and 0.9 for best effect.
|
||||
|
||||
This option does not affect file contents."
|
||||
:type '(choice (const :tag "Value of fill-column + 2" nil)
|
||||
(integer 72)
|
||||
(float 0.5))
|
||||
:safe (lambda (value)
|
||||
(or (numberp value) (null value))))
|
||||
(make-variable-buffer-local 'olivetti-body-width)
|
||||
|
||||
(defcustom olivetti-minimum-body-width
|
||||
40
|
||||
"Minimum width in columns of text body."
|
||||
:type 'integer
|
||||
:safe 'integerp)
|
||||
|
||||
(defcustom olivetti-lighter
|
||||
" Olv"
|
||||
"Mode-line indicator for `olivetti-mode'."
|
||||
:type '(choice (const :tag "No lighter" "") string)
|
||||
:safe 'stringp)
|
||||
|
||||
(defcustom olivetti-recall-visual-line-mode-entry-state
|
||||
t
|
||||
"Recall the state of `visual-line-mode' upon exiting.
|
||||
When non-nil, remember if `visual-line-mode' was enabled or not
|
||||
upon activating `olivetti-mode' and restore that state upon
|
||||
exiting."
|
||||
:type 'boolean
|
||||
:safe 'booleanp)
|
||||
|
||||
(defcustom olivetti-style
|
||||
nil
|
||||
"Window elements used to balance the text body.
|
||||
Valid options are:
|
||||
|
||||
nil use margins (default)
|
||||
t use fringes
|
||||
fancy use both margins with fringes outside
|
||||
|
||||
n.b. Fringes are only available on a graphical window system and
|
||||
will fall back to margins on console."
|
||||
:type '(choice (const :tag "Margins" nil)
|
||||
(const :tag "Fringes" t)
|
||||
(const :tag "Fringes and Margins" fancy))
|
||||
:set (lambda (symbol value)
|
||||
(set-default symbol value)
|
||||
(when (featurep 'olivetti)
|
||||
(olivetti-reset-all-windows))))
|
||||
|
||||
(defcustom olivetti-margin-width
|
||||
10
|
||||
"Width in columns of margin between text body and fringes.
|
||||
Only has any effect when `olivetti-style' is set to 'fancy."
|
||||
:type '(choice (const :tag "None" nil)
|
||||
(integer :tag "Columns" 10))
|
||||
:safe 'integerp
|
||||
:set (lambda (symbol value)
|
||||
(set-default symbol value)
|
||||
(when (featurep 'olivetti)
|
||||
(olivetti-reset-all-windows))))
|
||||
|
||||
(defface olivetti-fringe
|
||||
'((t (:inherit fringe)))
|
||||
"Face for the fringes when `olivetti-style' is non-nil."
|
||||
:group 'olivetti)
|
||||
|
||||
|
||||
;;; Set Windows ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defun olivetti-scale-width (width)
|
||||
"Scale WIDTH in accordance with the face height.
|
||||
For compatibility with `text-scale-mode', if
|
||||
`face-remapping-alist' includes a :height property on the default
|
||||
face, scale WIDTH by that factor if it is a fraction, by (height/100)
|
||||
if it is an integer, and otherwise return WIDTH."
|
||||
(let ((height (plist-get (cadr (assq 'default face-remapping-alist)) :height)))
|
||||
(when (integerp height)
|
||||
(setq height (/ height 100.0)))
|
||||
(round (* width (or height 1)))))
|
||||
|
||||
(defun olivetti-normalize-width (width window)
|
||||
"Parse WIDTH to a safe pixel value for `olivetti-body-width' for WINDOW."
|
||||
(let ((char-width (frame-char-width (window-frame window)))
|
||||
(window-width-pix (window-body-width window t))
|
||||
min-width-pix)
|
||||
(setq min-width-pix (* char-width
|
||||
(+ olivetti-minimum-body-width
|
||||
(% olivetti-minimum-body-width 2))))
|
||||
(olivetti-scale-width
|
||||
(if (floatp width)
|
||||
(floor (max min-width-pix (* window-width-pix (min width 1.0))))
|
||||
(max min-width-pix (min (* width char-width) window-width-pix))))))
|
||||
|
||||
(defun olivetti-reset-window (window)
|
||||
"Remove Olivetti's parameters and margins from WINDOW."
|
||||
(when (eq (window-parameter window 'split-window) 'olivetti-split-window)
|
||||
(set-window-parameter window 'split-window nil))
|
||||
(if (consp fringe-mode)
|
||||
(set-window-fringes window (car fringe-mode) (cdr fringe-mode))
|
||||
(set-window-fringes window fringe-mode fringe-mode))
|
||||
(set-window-margins window nil))
|
||||
|
||||
(defun olivetti-reset-all-windows ()
|
||||
"Call `olivetti-reset-window' on all windows."
|
||||
(walk-windows #'olivetti-reset-window nil t))
|
||||
|
||||
;; FIXME: these split-window functions seem to be ignored by
|
||||
;; `window-toggle-side-windows'
|
||||
;; WORKAROUND:
|
||||
;; (with-eval-after-load 'olivetti
|
||||
;; (advice-add 'window-toggle-side-windows
|
||||
;; :before 'olivetti-reset-all-windows))
|
||||
|
||||
(defun olivetti-split-window (&optional window size side pixelwise)
|
||||
"Call `split-window' after resetting WINDOW.
|
||||
Pass SIZE, SIDE and PIXELWISE unchanged."
|
||||
(olivetti-reset-all-windows)
|
||||
(split-window window size side pixelwise))
|
||||
|
||||
(defun olivetti-split-window-sensibly (&optional window)
|
||||
"Like `olivetti-split-window' but call `split-window-sensibly'.
|
||||
Pass WINDOW unchanged."
|
||||
(olivetti-reset-all-windows)
|
||||
(funcall olivetti--split-window-preferred-function window))
|
||||
|
||||
(defun olivetti-set-window (window-or-frame)
|
||||
"Balance window margins displaying current buffer.
|
||||
If WINDOW-OR-FRAME is a frame, cycle through windows displaying
|
||||
current buffer in that frame, otherwise only work on the selected
|
||||
window."
|
||||
(if (framep window-or-frame)
|
||||
(mapc #'olivetti-set-window
|
||||
(get-buffer-window-list nil nil window-or-frame))
|
||||
;; WINDOW-OR-FRAME passed below *must* be a window
|
||||
(with-selected-window window-or-frame
|
||||
(olivetti-reset-window window-or-frame)
|
||||
(when olivetti-mode
|
||||
;; If `olivetti-body-width' is nil, we need to calculate from
|
||||
;; `fill-column'
|
||||
(when (null olivetti-body-width)
|
||||
(setq olivetti-body-width (+ fill-column 2)))
|
||||
(let ((char-width-pix (frame-char-width (window-frame window-or-frame)))
|
||||
(window-width-pix (window-body-width window-or-frame t))
|
||||
(safe-width-pix (olivetti-normalize-width
|
||||
olivetti-body-width window-or-frame)))
|
||||
;; Handle possible display of fringes
|
||||
(when (and window-system olivetti-style)
|
||||
(let ((fringe-total (- (window-pixel-width window-or-frame)
|
||||
safe-width-pix))
|
||||
fringe)
|
||||
;; Account for fancy display
|
||||
(when (eq olivetti-style 'fancy)
|
||||
(setq fringe-total
|
||||
(- fringe-total
|
||||
(* olivetti-margin-width char-width-pix 2))))
|
||||
;; Calculate a single fringe width
|
||||
(setq fringe (max (round (/ fringe-total 2.0)) 0))
|
||||
;; Set the fringes
|
||||
(set-window-fringes window-or-frame fringe fringe t)))
|
||||
;; Calculate margins widths as body pixel width less fringes
|
||||
(let ((fringes (window-fringes window-or-frame))
|
||||
(margin-total-pix (/ (- window-width-pix safe-width-pix) 2.0))
|
||||
left-margin right-margin)
|
||||
;; Convert to character cell columns
|
||||
(setq left-margin (max (round (/ (- margin-total-pix
|
||||
(car fringes))
|
||||
char-width-pix))
|
||||
0)
|
||||
right-margin (max (round (/ (- margin-total-pix
|
||||
(cadr fringes))
|
||||
char-width-pix))
|
||||
0))
|
||||
;; Finally set the margins
|
||||
(set-window-margins window-or-frame left-margin right-margin)))
|
||||
;; Set remaining window parameters
|
||||
(set-window-parameter window-or-frame 'split-window
|
||||
'olivetti-split-window)))))
|
||||
|
||||
(defun olivetti-set-buffer-windows ()
|
||||
"Balance window margins in all windows displaying current buffer.
|
||||
Cycle through all windows in all visible frames displaying the
|
||||
current buffer, and call `olivetti-set-window'."
|
||||
(mapc #'olivetti-set-window (get-buffer-window-list nil nil 'visible)))
|
||||
|
||||
|
||||
;;; Width Interaction ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defun olivetti-set-width (width)
|
||||
"Set text body width to WIDTH with relative margins.
|
||||
WIDTH may be an integer specifying columns or a float specifying
|
||||
a fraction of the window width."
|
||||
(interactive
|
||||
(list (if current-prefix-arg
|
||||
(prefix-numeric-value current-prefix-arg)
|
||||
(read-number "Set text body width (integer or float): "
|
||||
olivetti-body-width))))
|
||||
(setq olivetti-body-width width)
|
||||
(olivetti-set-buffer-windows)
|
||||
(message "Text body width set to %s" olivetti-body-width))
|
||||
|
||||
(defun olivetti-expand (&optional arg)
|
||||
"Incrementally increase the value of `olivetti-body-width'.
|
||||
If prefixed with ARG, incrementally decrease."
|
||||
(interactive "P")
|
||||
(let* ((p (if arg -1 1))
|
||||
(n (cond ((integerp olivetti-body-width)
|
||||
(+ olivetti-body-width (* 2 p)))
|
||||
((floatp olivetti-body-width)
|
||||
(+ olivetti-body-width (* 0.01 p))))))
|
||||
(setq olivetti-body-width n))
|
||||
(olivetti-set-buffer-windows)
|
||||
(message "Text body width set to %s" olivetti-body-width)
|
||||
(unless overriding-terminal-local-map
|
||||
(let ((prefix-keys (substring (this-single-command-keys) 0 -1))
|
||||
(map (cdr olivetti-mode-map)))
|
||||
(when (< 0 (length prefix-keys))
|
||||
(mapc (lambda (k) (setq map (assq k map))) prefix-keys)
|
||||
(setq map (cdr-safe map))
|
||||
(when (keymapp map) (set-transient-map map t))))))
|
||||
|
||||
(defun olivetti-shrink (&optional arg)
|
||||
"Incrementally decrease the value of `olivetti-body-width'.
|
||||
If prefixed with ARG, incrementally increase."
|
||||
(interactive "P")
|
||||
(let ((p (unless arg t)))
|
||||
(olivetti-expand p)))
|
||||
|
||||
|
||||
;;; Keymap ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defvar olivetti-mode-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(define-key map (kbd "C-c }") #'olivetti-expand)
|
||||
(define-key map (kbd "C-c {") #'olivetti-shrink)
|
||||
(define-key map (kbd "C-c |") #'olivetti-set-width)
|
||||
(define-key map (kbd "C-c \\") #'olivetti-set-width) ;; OBSOLETE
|
||||
(define-key map [left-margin mouse-1] #'mouse-set-point)
|
||||
(define-key map [right-margin mouse-1] #'mouse-set-point)
|
||||
(define-key map [left-fringe mouse-1] #'mouse-set-point)
|
||||
(define-key map [right-fringe mouse-1] #'mouse-set-point)
|
||||
;; This code is taken from https://github.com/joostkremers/visual-fill-column
|
||||
(when (bound-and-true-p mouse-wheel-mode)
|
||||
(define-key map (vector 'left-margin mouse-wheel-down-event) 'mwheel-scroll)
|
||||
(define-key map (vector 'left-margin mouse-wheel-up-event) 'mwheel-scroll)
|
||||
(define-key map (vector 'right-margin mouse-wheel-down-event) 'mwheel-scroll)
|
||||
(define-key map (vector 'right-margin mouse-wheel-up-event) 'mwheel-scroll))
|
||||
map)
|
||||
"Mode map for `olivetti-mode'.")
|
||||
|
||||
|
||||
;;; Mode Definition ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;;;###autoload
|
||||
(define-minor-mode olivetti-mode
|
||||
"Olivetti provides a nice writing environment.
|
||||
Window margins are set to relative widths to accomodate a text
|
||||
body width set with `olivetti-body-width'."
|
||||
:init-value nil
|
||||
:lighter olivetti-lighter
|
||||
(if olivetti-mode
|
||||
(progn
|
||||
(cond ((<= emacs-major-version 24)
|
||||
(add-hook 'window-configuration-change-hook
|
||||
#'olivetti-set-buffer-windows t t))
|
||||
((<= emacs-major-version 26)
|
||||
(add-hook 'window-configuration-change-hook
|
||||
#'olivetti-set-buffer-windows t t)
|
||||
(add-hook 'window-size-change-functions
|
||||
#'olivetti-set-window t t))
|
||||
((<= 27 emacs-major-version)
|
||||
(add-hook 'window-size-change-functions
|
||||
#'olivetti-set-window t t)))
|
||||
(add-hook 'change-major-mode-hook
|
||||
#'olivetti-reset-all-windows nil t)
|
||||
(add-hook 'text-scale-mode-hook
|
||||
#'olivetti-set-buffer-windows t t)
|
||||
(unless (bound-and-true-p olivetti--visual-line-mode)
|
||||
(setq olivetti--visual-line-mode
|
||||
visual-line-mode))
|
||||
(unless (bound-and-true-p olivetti--split-window-preferred-function)
|
||||
(setq olivetti--split-window-preferred-function
|
||||
split-window-preferred-function))
|
||||
(setq-local split-window-preferred-function
|
||||
#'olivetti-split-window-sensibly)
|
||||
(setq olivetti--face-remap
|
||||
(face-remap-add-relative 'fringe 'olivetti-fringe))
|
||||
(olivetti-set-buffer-windows))
|
||||
(remove-hook 'window-configuration-change-hook
|
||||
#'olivetti-set-buffer-windows t)
|
||||
(remove-hook 'window-size-change-functions
|
||||
#'olivetti-set-window t)
|
||||
(remove-hook 'text-scale-mode-hook
|
||||
#'olivetti-set-window t)
|
||||
(olivetti-set-buffer-windows)
|
||||
(when olivetti--face-remap
|
||||
(face-remap-remove-relative olivetti--face-remap))
|
||||
(when olivetti-recall-visual-line-mode-entry-state
|
||||
(if olivetti--visual-line-mode
|
||||
(when (not visual-line-mode) (visual-line-mode 1))
|
||||
(when visual-line-mode (visual-line-mode 0))))
|
||||
(mapc #'kill-local-variable '(split-window-preferred-function
|
||||
olivetti-body-width
|
||||
olivetti--visual-line-mode
|
||||
olivetti--face-remap
|
||||
olivetti--split-window-preferred-function))))
|
||||
|
||||
|
||||
|
||||
(provide 'olivetti)
|
||||
|
||||
;;; olivetti.el ends here
|
||||
|
||||
;; Local Variables:
|
||||
;; coding: utf-8
|
||||
;; fill-column: 80
|
||||
;; require-final-newline: t
|
||||
;; sentence-end-double-space: nil
|
||||
;; indent-tabs-mode: nil
|
||||
;; End:
|
||||
83
lisp/posframe/posframe-benchmark.el
Normal file
83
lisp/posframe/posframe-benchmark.el
Normal file
@@ -0,0 +1,83 @@
|
||||
;;; posframe-benchmark.el --- Benchmark tool for posframe -*- lexical-binding:t -*-
|
||||
|
||||
;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Feng Shu <tumashu@163.com>
|
||||
;; Maintainer: Feng Shu <tumashu@163.com>
|
||||
;; URL: https://github.com/tumashu/posframe
|
||||
;; Version: 1.0.3
|
||||
;; Keywords: convenience, tooltip
|
||||
;; Package-Requires: ((emacs "26"))
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs is free software: you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; GNU Emacs is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;;; Code:
|
||||
(require 'cl-lib)
|
||||
(require 'posframe)
|
||||
|
||||
(defvar posframe-benchmark-alist
|
||||
(let ((str (with-temp-buffer
|
||||
(insert-file-contents (locate-library "posframe.el"))
|
||||
(buffer-string))))
|
||||
`((font-at
|
||||
(font-at (point-min)))
|
||||
(redraw-display
|
||||
(redraw-display))
|
||||
(redraw-frame
|
||||
(redraw-frame (window-frame)))
|
||||
(remove-text-properties
|
||||
(let ((string ,str))
|
||||
(remove-text-properties
|
||||
0 (length string) '(read-only t)
|
||||
string)))
|
||||
(mouse-position
|
||||
(mouse-position))
|
||||
(default-font-width
|
||||
(default-font-width))
|
||||
(posframe--get-font-height
|
||||
(posframe--get-font-height (point-min)))
|
||||
(frame-parameter
|
||||
(frame-parameter (window-frame) 'no-accept-focus))
|
||||
(set-mouse-position
|
||||
(set-mouse-position (window-frame) 0 0))
|
||||
(posn-at-point
|
||||
(posn-at-point))
|
||||
(posn-x-y
|
||||
(posn-x-y (posn-at-point)))
|
||||
(posn-object-x-y
|
||||
(posn-object-x-y (posn-at-point)))
|
||||
(set-frame-parameter
|
||||
(set-frame-parameter (window-frame) 'test 1))
|
||||
(raise-frame
|
||||
(raise-frame (window-frame))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun posframe-benchmark ()
|
||||
"Benchmark tool for posframe."
|
||||
(interactive)
|
||||
(let ((n 1000))
|
||||
(message "\n* Posframe Benchmark")
|
||||
(dolist (x posframe-benchmark-alist)
|
||||
(message "\n** Benchmark `%S' %s times ..." (car x) n)
|
||||
(benchmark n (car (cdr x))))
|
||||
(message "\n* Finished.")))
|
||||
|
||||
|
||||
(provide 'posframe-benchmark)
|
||||
|
||||
;;; posframe.el ends here
|
||||
12
lisp/posframe/posframe-pkg.el
Normal file
12
lisp/posframe/posframe-pkg.el
Normal file
@@ -0,0 +1,12 @@
|
||||
(define-package "posframe" "20221220.544" "Pop a posframe (just a frame) at point"
|
||||
'((emacs "26.1"))
|
||||
:commit "aa88860a16e28a311f81e18f1d9ed2e7d9e33991" :authors
|
||||
'(("Feng Shu" . "tumashu@163.com"))
|
||||
:maintainer
|
||||
'("Feng Shu" . "tumashu@163.com")
|
||||
:keywords
|
||||
'("convenience" "tooltip")
|
||||
:url "https://github.com/tumashu/posframe")
|
||||
;; Local Variables:
|
||||
;; no-byte-compile: t
|
||||
;; End:
|
||||
1450
lisp/posframe/posframe.el
Normal file
1450
lisp/posframe/posframe.el
Normal file
File diff suppressed because it is too large
Load Diff
@@ -129,7 +129,7 @@ SOURCE: String"
|
||||
(treemacs-annotation->face-value ann)
|
||||
(append (mapcar #'cdr new-faces) git-face))
|
||||
(setf
|
||||
(treemacs-annotation->face ann) 'deleted
|
||||
(treemacs-annotation->face ann) nil
|
||||
(treemacs-annotation->face-value ann) git-face)))))))
|
||||
|
||||
(defun treemacs-clear-annotation-faces (source)
|
||||
@@ -277,38 +277,25 @@ GIT-FACE is taken from the latest git cache, or nil if it's not known."
|
||||
(old-git-face (treemacs-annotation->git-face ann)))
|
||||
|
||||
;; Faces
|
||||
(if (eq 'deleted faces)
|
||||
;; face annotation was deleted - only the git face remains
|
||||
;; as the annotation value
|
||||
(progn
|
||||
(setf
|
||||
(treemacs-annotation->face ann) nil
|
||||
(treemacs-annotation->face-value ann) ,git-face
|
||||
(treemacs-annotation->git-face ann) ,git-face)
|
||||
(unless ,git-face
|
||||
(treemacs--remove-annotation-if-empty ann path))
|
||||
(put-text-property
|
||||
btn-start btn-end 'face
|
||||
,git-face))
|
||||
;; annotations are present, value needs updating if the git face
|
||||
;; has changed
|
||||
(let ((new-face-value
|
||||
(or
|
||||
(cond
|
||||
((and ,git-face (not (equal ,git-face old-git-face)))
|
||||
(append (mapcar #'cdr faces)
|
||||
(list ,git-face)))
|
||||
((and old-git-face (null ,git-face))
|
||||
(mapcar #'cdr faces))
|
||||
(t face-value))
|
||||
(treemacs-button-get ,btn :default-face))))
|
||||
(setf (treemacs-annotation->face-value ann)
|
||||
new-face-value
|
||||
(treemacs-annotation->git-face ann)
|
||||
,git-face)
|
||||
(put-text-property
|
||||
btn-start btn-end 'face
|
||||
new-face-value)))
|
||||
;; annotations are present, value needs updating if the git face
|
||||
;; has changed
|
||||
(let ((new-face-value
|
||||
(or
|
||||
(cond
|
||||
((and ,git-face (not (equal ,git-face old-git-face)))
|
||||
(append (mapcar #'cdr faces)
|
||||
(list ,git-face)))
|
||||
((and old-git-face (null ,git-face))
|
||||
(mapcar #'cdr faces))
|
||||
(t face-value))
|
||||
(treemacs-button-get ,btn :default-face))))
|
||||
(setf (treemacs-annotation->face-value ann)
|
||||
new-face-value
|
||||
(treemacs-annotation->git-face ann)
|
||||
,git-face)
|
||||
(put-text-property
|
||||
btn-start btn-end 'face
|
||||
new-face-value))
|
||||
|
||||
;; Suffix
|
||||
(goto-char ,btn)
|
||||
|
||||
@@ -241,7 +241,7 @@ find the key a command is bound to it will show a blank instead."
|
||||
(column-files (propertize "File Management" 'face 'treemacs-help-column-face))
|
||||
(column-ws (propertize "Workspaces" 'face 'treemacs-help-column-face))
|
||||
(column-misc (propertize "Misc." 'face 'treemacs-help-column-face))
|
||||
(column-window (propertize "Other Window." 'face 'treemacs-help-column-face))
|
||||
(column-window (propertize "Other Window" 'face 'treemacs-help-column-face))
|
||||
(common-hint (format "%s %s"
|
||||
(propertize "For common keybinds see" 'face 'treemacs-help-title-face)
|
||||
(propertize "treemacs-common-helpful-hydra" 'face 'font-lock-function-name-face)))
|
||||
@@ -278,7 +278,7 @@ find the key a command is bound to it will show a blank instead."
|
||||
%s
|
||||
%s (%s)
|
||||
|
||||
%s ^^^^^^^^^^^^^│ %s ^^^^^^^^│ %s ^^^^^^^^^^^│ %s
|
||||
%s ^^^^^^^^^^^^^│ %s ^^^^^^^^│ %s ^^^^^^^^^^│ %s
|
||||
―――――――――――――――――――――┼―――――――――――――――――――――――――――――┼――――――――――――――――――――┼――――――――――――――――――――――
|
||||
%s create file ^^^^│ %s Edit Workspaces ^^^^^^^^│ %s peek ^^^^^^│ %s refresh
|
||||
%s create dir ^^^^│ %s Create Workspace ^^^^^^^^│ %s line down ^^^^^^│ %s (re)set width
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
(define-package "treemacs" "20221107.2105" "A tree style file explorer package"
|
||||
(define-package "treemacs" "20221221.1301" "A tree style file explorer package"
|
||||
'((emacs "26.1")
|
||||
(cl-lib "0.5")
|
||||
(dash "2.11.0")
|
||||
@@ -8,7 +8,7 @@
|
||||
(hydra "0.13.2")
|
||||
(ht "2.2")
|
||||
(cfrs "1.3.2"))
|
||||
:commit "b19060f25e55514f3d798d9f5af2dcd5b94a6026" :authors
|
||||
:commit "71e5df66b99ffe16de65fb4783e7484b05aae6cb" :authors
|
||||
'(("Alexander Miller" . "alexanderm@web.de"))
|
||||
:maintainer
|
||||
'("Alexander Miller" . "alexanderm@web.de")
|
||||
|
||||
@@ -468,13 +468,14 @@ set to PARENT."
|
||||
(treemacs-dom-node->insert-into-dom! it))
|
||||
|
||||
(treemacs--inplace-map-when-unrolled dir-strings 2
|
||||
(-if-let (ann (treemacs-get-annotation (concat ,root "/" it)))
|
||||
(-if-let* ((ann (treemacs-get-annotation (concat ,root "/" it)))
|
||||
(face (treemacs-annotation->face-value ann)))
|
||||
(progn
|
||||
(put-text-property
|
||||
0
|
||||
(length it)
|
||||
'face
|
||||
(treemacs-annotation->face-value ann)
|
||||
face
|
||||
it)
|
||||
(concat it (treemacs-annotation->suffix-value ann)))
|
||||
(put-text-property
|
||||
@@ -489,13 +490,14 @@ set to PARENT."
|
||||
(end-of-line)
|
||||
(setf file-strings
|
||||
(treemacs--inplace-map-when-unrolled file-strings 3
|
||||
(-if-let (ann (treemacs-get-annotation (concat ,root "/" it)))
|
||||
(-if-let* ((ann (treemacs-get-annotation (concat ,root "/" it)))
|
||||
(face (treemacs-annotation->face-value ann)))
|
||||
(progn
|
||||
(put-text-property
|
||||
0
|
||||
(length it)
|
||||
'face
|
||||
(treemacs-annotation->face-value ann)
|
||||
face
|
||||
it)
|
||||
(concat it (treemacs-annotation->suffix-value ann)))
|
||||
(put-text-property
|
||||
|
||||
@@ -742,7 +742,7 @@ If a prefix ARG is provided expand recursively."
|
||||
(treemacs--do-expand-extension-node
|
||||
btn ext async-cache arg)
|
||||
(unless busy?
|
||||
(treemacs-update-async-node path))))
|
||||
(treemacs-update-async-node path (marker-buffer btn)))))
|
||||
((treemacs-extension->async? ext)
|
||||
(treemacs--do-expand-async-extension-node btn ext arg))
|
||||
(t
|
||||
@@ -956,8 +956,9 @@ EXPAND-DEPTH: Int"
|
||||
(goto-char (treemacs-button-start it))
|
||||
(treemacs-expand-extension-node expand-depth))))))))
|
||||
|
||||
(defun treemacs-update-async-node (path)
|
||||
"Update an asynchronous node at the given PATH.
|
||||
(defun treemacs-update-async-node (path buffer)
|
||||
"Update an asynchronous node at PATH in the given BUFFER.
|
||||
|
||||
The update process will asynchronously pre-compute the children for every node
|
||||
currently expanded under PATH. The results of this computation will be cached
|
||||
and then used to update the UI in one go."
|
||||
@@ -973,7 +974,7 @@ and then used to update the UI in one go."
|
||||
children-fn btn item
|
||||
(lambda (items)
|
||||
(treemacs--async-update-part-complete
|
||||
path item-path items)))))))
|
||||
path item-path items buffer)))))))
|
||||
|
||||
(defun treemacs--get-async-update-items (path)
|
||||
"Get the items needed for an async update at the given PATH.
|
||||
@@ -988,18 +989,19 @@ extensions instance."
|
||||
(push (cons key ext) items))))
|
||||
items))
|
||||
|
||||
(defun treemacs--async-update-part-complete (top-path updated-path items)
|
||||
(defun treemacs--async-update-part-complete (top-path updated-path items buffer)
|
||||
"Partial completion for an asynchronous update.
|
||||
TOP-PATH is the path of the node the update was called for.
|
||||
UPDATED-PATH is the path of one of top node's children (may also be TOP-PATH)
|
||||
whose content has just been computed.
|
||||
ITEMS are the new items for the UPDATED-PATH that will be cached for the next
|
||||
update."
|
||||
update.
|
||||
BUFFER is the buffer where the node is located."
|
||||
(ht-set! treemacs--async-update-cache updated-path (or items 'nothing))
|
||||
(-let [count (cl-decf (ht-get treemacs--async-update-count top-path))]
|
||||
(when (= 0 count)
|
||||
(--when-let (treemacs-get-local-buffer)
|
||||
(with-current-buffer it
|
||||
(--when-let (buffer-live-p buffer)
|
||||
(with-current-buffer buffer
|
||||
(treemacs-with-writable-buffer
|
||||
(treemacs-update-node top-path)
|
||||
(treemacs-button-put (treemacs-find-node updated-path) :busy nil)))))))
|
||||
|
||||
@@ -30,15 +30,15 @@
|
||||
:config
|
||||
(setq amx-save-file (concat user-cache-directory "amx-items")))
|
||||
|
||||
;; in an ivy action minibuffer use M-o `ivy-dispatching-done' to see
|
||||
;; in an ivy action minibuffer use M-o (`ivy-dispatching-done') to see
|
||||
;; valid actions.
|
||||
(use-package ivy
|
||||
:delight (ivy-mode "Ivy") ;; \u24BE i
|
||||
:defer 0.1
|
||||
;; Ivy-based interface to standard commands
|
||||
:bind (("C-s" . swiper)
|
||||
;; ("C-M-s" . swiper-all)
|
||||
("C-c C-r" . ivy-resume) ;; resumes the last Ivy-based completion.
|
||||
("<f6>" . ivy-resume)
|
||||
("C-c v" . ivy-push-view)
|
||||
("C-c V" . ivy-pop-view))
|
||||
:config
|
||||
@@ -56,8 +56,30 @@
|
||||
:after (ivy counsel)
|
||||
:config
|
||||
(setcdr (assq t ivy-format-functions-alist) #'ivy-format-function-line)
|
||||
;; overwrite to fix error, see https://github.com/Yevgnen/ivy-rich/issues/115#issuecomment-1336951680
|
||||
(defun ivy-rich--switch-buffer-directory (candidate)
|
||||
"Return directory of file visited by buffer named CANDIDATE, or nil if no file."
|
||||
(let* ((buffer (get-buffer candidate))
|
||||
(fn (buffer-file-name buffer)))
|
||||
;; if valid filename, i.e. buffer visiting file:
|
||||
(if fn
|
||||
;; return containing directory
|
||||
;; (directory-file-name fn) ;; REMOVED
|
||||
(file-name-directory fn) ;; ADDED
|
||||
;; else if mode explicitly offering list-buffers-directory, return that; else nil.
|
||||
;; buffers that don't explicitly visit files, but would like to show a filename,
|
||||
;; e.g. magit or dired, set the list-buffers-directory variable
|
||||
(buffer-local-value 'list-buffers-directory buffer))))
|
||||
(require 'all-the-icons-ivy-rich) ;; as suggested load `all-the-icons-ivy-rich-mode' before `ivy-rich-mode'
|
||||
(ivy-rich-mode 1))
|
||||
|
||||
(use-package all-the-icons-ivy-rich
|
||||
:defer ;; to be able to load it after `ivy-rich'
|
||||
:if (display-graphic-p)
|
||||
:config
|
||||
;; defines also nice display-transformers
|
||||
(all-the-icons-ivy-rich-mode 1))
|
||||
|
||||
(use-package swiper
|
||||
:after ivy)
|
||||
|
||||
@@ -65,15 +87,15 @@
|
||||
:after ivy
|
||||
:bind (("M-x" . counsel-M-x)
|
||||
("M-y" . counsel-yank-pop)
|
||||
;; ("C-x b" . counsel-switch-buffer)
|
||||
("C-x b" . counsel-switch-buffer)
|
||||
;; ("C-x b" . counsel-ibuffer)
|
||||
("C-x b" . counsel-buffer-or-recentf)
|
||||
("C-x C-f" . counsel-find-file)
|
||||
("C-x C-r" . counsel-recentf)
|
||||
;; ("<f1> f" . describe-function) ;; counsel-describe-function, not set bc of helpful.el
|
||||
;; ("<f1> v" . describe-variable) ;; counsel-describe-variable, net set bc of helpful.el
|
||||
("<f1> l" . find-library) ;; find-library works better with counsel as counsel-find-library
|
||||
("<f2> i" . counsel-info-lookup-symbol)
|
||||
;; ("C-x C-r" . counsel-recentf)
|
||||
("C-x C-r" . counsel-buffer-or-recentf)
|
||||
("C-h f" . counsel-describe-function)
|
||||
("C-h v" . counsel-describe-variable)
|
||||
("C-h l" . counsel-find-library)
|
||||
;; ("<f2> i" . counsel-info-lookup-symbol) ;; info-lookup-symbol see helpful-symbol
|
||||
("<f2> u" . counsel-unicode-char)
|
||||
("<f2> j" . counsel-set-variable)
|
||||
;; Ivy-based interface to shell and system tools
|
||||
|
||||
@@ -61,14 +61,15 @@
|
||||
t))))
|
||||
|
||||
(use-package ibuf-ext
|
||||
:defer t
|
||||
:after (ibuffer)
|
||||
:bind ((:map ibuffer-mode-map
|
||||
(("/ u" . ibuffer-filter-by-unsaved))))
|
||||
:config
|
||||
(define-ibuffer-filter unsaved
|
||||
"Toggle current view to buffers whose file is unsaved."
|
||||
(:description "file is unsaved")
|
||||
(with-current-buffer buf
|
||||
(and buffer-file-name (buffer-modified-p))))
|
||||
(define-key ibuffer-mode-map (kbd "/ u") 'ibuffer-filter-by-unsaved))
|
||||
(and buffer-file-name (buffer-modified-p)))))
|
||||
|
||||
;; recentf stuff
|
||||
(use-package recentf
|
||||
@@ -314,32 +315,48 @@ Version 2016-07-13"
|
||||
|
||||
;; A better *Help* buffer
|
||||
(use-package helpful
|
||||
;;:after counsel
|
||||
:bind
|
||||
(;; Note that the built-in `describe-function' includes both functions
|
||||
;; and macros. `helpful-function' is functions only, so we provide
|
||||
;; `helpful-callable' as a drop-in replacement to include `helpful-macro'.
|
||||
("C-h f" . describe-function)
|
||||
;; ("C-h f" . helpful-callable)
|
||||
("C-h v" . describe-variable)
|
||||
;; ("C-h v" . helpful-variable)
|
||||
("C-h k" . helpful-key)
|
||||
|
||||
;; ("C-h f" . helpful-callable) ;; C-h f default describe-function
|
||||
;; ("C-h v" . helpful-variable) ;; C-h v default describe-variable
|
||||
;; ("C-h k" . helpful-key) ;; C-h k default describe-key
|
||||
|
||||
;; Lookup the current symbol at point. C-c C-d is a common keybinding
|
||||
;; for this in lisp modes.
|
||||
("C-c C-d" . helpful-at-point)
|
||||
|
||||
;; Look up *F*unctions (excludes macros).
|
||||
;; By default, C-h F is bound to `Info-goto-emacs-command-node'. Helpful
|
||||
;; already links to the manual, if a function is referenced there.
|
||||
("C-h F" . helpful-function)
|
||||
;; ("C-h F" . helpful-function)
|
||||
;; Look up functions including macros (like `describe-function').
|
||||
("C-h F" . helpful-callable)
|
||||
;; ("C-h F" . counsel-describe-function) ;; calls helpful-callable, see below
|
||||
|
||||
;; Look up *K*eys.
|
||||
;; By default, C-h K is bound to `Info-goto-emacs-key-command-node'.
|
||||
;; Helpful already links to the manual, if a key is referenced there.
|
||||
("C-h K" . helpful-key)
|
||||
|
||||
;; Look up *V*ariable.
|
||||
("C-h V" . helpful-variable)
|
||||
;; ("C-h V" . counsel-describe-variable) ;; calls helpful-vraiable, see below
|
||||
|
||||
;; Look up *C*ommands.
|
||||
;; By default, C-h C is bound to describe `describe-coding-system'. I
|
||||
;; don't find this very useful, but it's frequently useful to only
|
||||
;; look at interactive functions.
|
||||
("C-h C" . helpful-command))
|
||||
:config
|
||||
(with-eval-after-load 'ivy
|
||||
;; Ivy users can use Helpful with counsel commands:
|
||||
(setq counsel-describe-function-function #'helpful-callable)
|
||||
(setq counsel-describe-variable-function #'helpful-variable)))
|
||||
;; (with-eval-after-load 'ivy
|
||||
;; ;; Ivy users can use Helpful with counsel commands:
|
||||
;; (setq counsel-describe-function-function #'helpful-callable)
|
||||
;; (setq counsel-describe-variable-function #'helpful-variable))
|
||||
)
|
||||
|
||||
;;
|
||||
;; keyboard
|
||||
@@ -764,8 +781,12 @@ Version 2016-07-13"
|
||||
))
|
||||
(easy-menu-define my-org-minor-mode-menu nil "My Org Minor Mode Menu"
|
||||
'("Org Minor Mode / Toggles" :visible (eq major-mode 'org-mode)
|
||||
["Org Appear" org-appear-mode
|
||||
:style toggle :selected org-appear-mode :help "org-appear-mode"]
|
||||
["Org Fancy Priorities [Ⓟ]" org-fancy-priorities-mode
|
||||
:style toggle :selected org-fancy-priorities-mode :help "org-sticky-header-mode"]
|
||||
["Org Indent" org-indent-mode
|
||||
:style toggle :selected org-indent-mode :help "org-indent-mode"]
|
||||
["Org Latex Remove Logfiles" (setq org-latex-remove-logfiles (not org-latex-remove-logfiles))
|
||||
:style toggle :selected org-latex-remove-logfiles :help "org-latex-remove-logfiles"]
|
||||
["Org Link Descriptive" org-toggle-link-display
|
||||
|
||||
@@ -181,6 +181,7 @@ DISPLAY-START: `integer', e.g. 3820"
|
||||
|
||||
(use-package all-the-icons
|
||||
:defer t
|
||||
:if (display-graphic-p)
|
||||
:config
|
||||
(when (and (not (my-font-installed-p "all-the-icons"))
|
||||
(window-system))
|
||||
@@ -197,32 +198,59 @@ DISPLAY-START: `integer', e.g. 3820"
|
||||
(setq dashboard-set-file-icons t)
|
||||
(setq dashboard-set-navigator t)
|
||||
(setq dashboard-startup-banner 'logo)
|
||||
(setq dashboard-navigator-buttons
|
||||
;; list of lines having list of elements
|
||||
;; element: (icon title help action face prefix suffix)
|
||||
`(;; 1st line custom views
|
||||
(("" "Custom Views:" "custom views" nil default "" "")
|
||||
(,(all-the-icons-fileicon "elisp" :height 1.0 :v-adjust -0.1) "ELisp" "my-view-elisp" (lambda (&rest _) (my-tab-view-elisp)) )
|
||||
(,(all-the-icons-alltheicon "python" :height 1.0 :v-adjust 0.0) "Python" "my-view-python" (lambda (&rest _) (my-tab-view-python)) )
|
||||
(,(all-the-icons-alltheicon "script" :height 1.0 :v-adjust 0.0) "Shell" "my-view-shell" (lambda (&rest _) (my-tab-view-shell)) )
|
||||
(,(all-the-icons-octicon "file-media" :height 1.0 :v-adjust 0.0) "Gnuplot" "my-view-gnuplot" (lambda (&rest _) (my-tab-view-gnuplot)) )
|
||||
(,(all-the-icons-octicon "file-pdf" :height 1.0 :v-adjust 0.0) "Org PDF" "my-view-org-pdf" (lambda (&rest _) (my-tab-view-org-pdf)) ))
|
||||
;; 2nd line major modes 1st part
|
||||
(("" "Major Modes:" "major modes" nil default "" "")
|
||||
("" "Deft" "deft" (lambda (&rest _) (deft)) )
|
||||
("" "EShell" "eshell-mode" (lambda (&rest _) (eshell)) )
|
||||
("" "Magit" "magit" (lambda (&rest _) (magit)) )
|
||||
(,(all-the-icons-octicon "mail" :height 1.0 :v-adjust 0.0) "Mu4e" "mu4e" (lambda (&rest _) (mu4e)) )
|
||||
(,(all-the-icons-octicon "mail" :height 1.0 :v-adjust 0.0) "Notmuch" "notmuch" (lambda (&rest _) (notmuch)) )
|
||||
("" "Org-Brain" "org-brain-visualize" (lambda (&rest _) (call-interactively 'org-brain-visualize)) ))
|
||||
;; 3rd line major modes 2nd part
|
||||
(("" "Org-Drill" "org-drill" (lambda (&rest _) (org-drill)) )
|
||||
("" "Powershell" "powershell" (lambda (&rest _) (powershell)) )
|
||||
("" "Shell" "shell" (lambda (&rest _) (shell)) )
|
||||
("" "Treemacs" "treemacs" (lambda (&rest _) (treemacs)) ))
|
||||
;; 4th line infos
|
||||
((,(all-the-icons-material "help_outline" :height 1.1 :v-adjust -0.15) "Help" "?/h" (lambda (&rest _) (describe-mode)) nil)
|
||||
(,(all-the-icons-material "refresh" :height 1.1 :v-adjust -0.15) "Restart" "restart-emacs" (lambda (&rest _) (restart-emacs)) nil))))
|
||||
(if (display-graphic-p)
|
||||
(setq dashboard-navigator-buttons
|
||||
;; list of lines having list of elements
|
||||
;; element: (icon title help action face prefix suffix)
|
||||
`(;; 1st line custom views
|
||||
(("" "Custom Views:" "custom views" nil default "" "")
|
||||
(,(all-the-icons-fileicon "elisp" :height 1.0 :v-adjust -0.1) "ELisp" "my-view-elisp" (lambda (&rest _) (my-tab-view-elisp)) )
|
||||
(,(all-the-icons-alltheicon "python" :height 1.0 :v-adjust 0.0) "Python" "my-view-python" (lambda (&rest _) (my-tab-view-python)) )
|
||||
(,(all-the-icons-alltheicon "script" :height 1.0 :v-adjust 0.0) "Shell" "my-view-shell" (lambda (&rest _) (my-tab-view-shell)) )
|
||||
(,(all-the-icons-octicon "file-media" :height 1.0 :v-adjust 0.0) "Gnuplot" "my-view-gnuplot" (lambda (&rest _) (my-tab-view-gnuplot)) )
|
||||
(,(all-the-icons-octicon "file-pdf" :height 1.0 :v-adjust 0.0) "Org PDF" "my-view-org-pdf" (lambda (&rest _) (my-tab-view-org-pdf)) ))
|
||||
;; 2nd line major modes 1st part
|
||||
(("" "Major Modes:" "major modes" nil default "" "")
|
||||
("" "Deft" "deft" (lambda (&rest _) (deft)) )
|
||||
("" "EShell" "eshell-mode" (lambda (&rest _) (eshell)) )
|
||||
("" "Magit" "magit" (lambda (&rest _) (magit)) )
|
||||
(,(all-the-icons-octicon "mail" :height 1.0 :v-adjust 0.0) "Mu4e" "mu4e" (lambda (&rest _) (mu4e)) )
|
||||
(,(all-the-icons-octicon "mail" :height 1.0 :v-adjust 0.0) "Notmuch" "notmuch" (lambda (&rest _) (notmuch)) )
|
||||
("" "Org-Brain" "org-brain-visualize" (lambda (&rest _) (call-interactively 'org-brain-visualize)) ))
|
||||
;; 3rd line major modes 2nd part
|
||||
(("" "Org-Drill" "org-drill" (lambda (&rest _) (org-drill)) )
|
||||
("" "Powershell" "powershell" (lambda (&rest _) (powershell)) )
|
||||
("" "Shell" "shell" (lambda (&rest _) (shell)) )
|
||||
("" "Treemacs" "treemacs" (lambda (&rest _) (treemacs)) ))
|
||||
;; 4th line infos
|
||||
((,(all-the-icons-material "help_outline" :height 1.1 :v-adjust -0.15) "Help" "?/h" (lambda (&rest _) (describe-mode)) nil)
|
||||
(,(all-the-icons-material "refresh" :height 1.1 :v-adjust -0.15) "Restart" "restart-emacs" (lambda (&rest _) (restart-emacs)) nil))))
|
||||
(setq dashboard-navigator-buttons
|
||||
;; list of lines having list of elements
|
||||
;; element: (icon title help action face prefix suffix)
|
||||
`(;; 1st line custom views
|
||||
(("" "Custom Views:" "custom views" nil default "" "")
|
||||
("" "ELisp" "my-view-elisp" (lambda (&rest _) (my-tab-view-elisp)) )
|
||||
("" "Python" "my-view-python" (lambda (&rest _) (my-tab-view-python)) )
|
||||
("" "Shell" "my-view-shell" (lambda (&rest _) (my-tab-view-shell)) )
|
||||
("" "Gnuplot" "my-view-gnuplot" (lambda (&rest _) (my-tab-view-gnuplot)) )
|
||||
("" "Org PDF" "my-view-org-pdf" (lambda (&rest _) (my-tab-view-org-pdf)) ))
|
||||
;; 2nd line major modes 1st part
|
||||
(("" "Major Modes:" "major modes" nil default "" "")
|
||||
("" "Deft" "deft" (lambda (&rest _) (deft)) )
|
||||
("" "EShell" "eshell-mode" (lambda (&rest _) (eshell)) )
|
||||
("" "Magit" "magit" (lambda (&rest _) (magit)) )
|
||||
("" "Mu4e" "mu4e" (lambda (&rest _) (mu4e)) )
|
||||
("" "Notmuch" "notmuch" (lambda (&rest _) (notmuch)) )
|
||||
("" "Org-Brain" "org-brain-visualize" (lambda (&rest _) (call-interactively 'org-brain-visualize)) ))
|
||||
;; 3rd line major modes 2nd part
|
||||
(("" "Org-Drill" "org-drill" (lambda (&rest _) (org-drill)) )
|
||||
("" "Powershell" "powershell" (lambda (&rest _) (powershell)) )
|
||||
("" "Shell" "shell" (lambda (&rest _) (shell)) )
|
||||
("" "Treemacs" "treemacs" (lambda (&rest _) (treemacs)) ))
|
||||
;; 4th line infos
|
||||
(("" "Help" "?/h" (lambda (&rest _) (describe-mode)) nil)
|
||||
("" "Restart" "restart-emacs" (lambda (&rest _) (restart-emacs)) nil)))))
|
||||
(setq dashboard-items '((recents . 10)
|
||||
(bookmarks . 5)
|
||||
;; (projects . 5)
|
||||
|
||||
@@ -7,6 +7,45 @@
|
||||
(add-hook 'org-mode-hook 'my-org-link-color-hook)
|
||||
(add-hook 'org-ctrl-c-ctrl-c-hook 'my-org-table-cell-color-attr)))
|
||||
|
||||
(use-package olivetti
|
||||
:commands (olivetti-mode)
|
||||
:bind (("<f8>" . my-distraction-free))
|
||||
:config
|
||||
(defun my-distraction-free ()
|
||||
"Distraction-free writing environment."
|
||||
(interactive)
|
||||
(if (equal olivetti-mode nil)
|
||||
(progn
|
||||
(window-configuration-to-register 1)
|
||||
(delete-other-windows)
|
||||
(when (equal major-mode 'org-mode)
|
||||
(when (and (featurep 'org-superstar)
|
||||
(equal org-superstar-mode t))
|
||||
;; remove leading stars
|
||||
(setq my-last-org-hide-leading-stars org-hide-leading-stars)
|
||||
(setq org-hide-leading-stars nil) ;; must be nil! hiding via `org-superstar-remove-leading-stars'
|
||||
(setq my-last-org-superstar-remove-leading-stars org-superstar-remove-leading-stars)
|
||||
(setq org-superstar-remove-leading-stars t)
|
||||
(org-superstar-restart)
|
||||
)
|
||||
(setq my-last-org-num-mode org-num-mode)
|
||||
(unless org-num-mode (org-num-mode))
|
||||
)
|
||||
(olivetti-mode t))
|
||||
(progn
|
||||
(jump-to-register 1)
|
||||
;; reset to last state
|
||||
(when (equal major-mode 'org-mode)
|
||||
(when (and (featurep 'org-superstar)
|
||||
(equal org-superstar-mode t))
|
||||
(setq org-hide-leading-stars my-last-org-hide-leading-stars)
|
||||
(setq org-superstar-remove-leading-stars my-last-org-superstar-remove-leading-stars)
|
||||
(org-superstar-restart)
|
||||
)
|
||||
(unless my-last-org-num-mode (org-num-mode -1))
|
||||
)
|
||||
(olivetti-mode 0)))))
|
||||
|
||||
(use-package my-org-article
|
||||
:after (org)
|
||||
:config
|
||||
|
||||
@@ -332,7 +332,9 @@ Example defines
|
||||
(setq org-appear-autoemphasis t) ;; toggle emphasis markers, t by default, needs `org-hide-emphasis-markers' active
|
||||
(setq org-appear-autolinks t) ;; toogle links, needs `org-link-descriptive' active
|
||||
(setq org-appear-autosubmarkers t) ;; toogle subscripts and superscripts: ^3 -> ³, needs `org-pretty-entities' active
|
||||
(setq org-appear-autokeywords t)) ;; toogle keywords: #+TITLE: foo -> foo, needs `org-hidden-keywords' active
|
||||
(setq org-appear-autokeywords t) ;; toogle keywords: #+TITLE: foo -> foo, needs `org-hidden-keywords' active
|
||||
(setq org-appear-delay 0.5) ;; with delay a mouse click open a link directly and holding down shows the description
|
||||
(setq org-appear-trigger 'always))
|
||||
|
||||
(use-package org-brain ;; uses org-id If you find that org-brain is missing entries, or list entries which doesn’t exist, try using M-x org-brain-update-id-locations, which syncs the org-brain entries with the org-id caching system.
|
||||
:commands (org-brain-visualize)
|
||||
@@ -556,7 +558,13 @@ Suggest the URL title as a description for resource."
|
||||
(setq org-roam-directory (expand-file-name "~/Sync/workspace/emacs/org-roam")) ;; check if folder exists
|
||||
(setq org-roam-db-location (concat user-cache-directory "org-roam.db"))
|
||||
;; (setq org-roam-graph-viewer nil)
|
||||
(with-eval-after-load 'which-key
|
||||
(which-key-add-key-based-replacements
|
||||
"C-c r" "org-roam"))
|
||||
:config
|
||||
;; when browsing notes display also tags
|
||||
;; set tags `org-roam-tag-add': file: #+FILETAGS: :tag1:...: / * headline :tag1:...:
|
||||
(setq org-roam-node-display-template "${title} ${tags}")
|
||||
(org-roam-db-autosync-mode) ;; sync on file change
|
||||
;;(org-roam-setup)
|
||||
)
|
||||
@@ -564,9 +572,14 @@ Suggest the URL title as a description for resource."
|
||||
(use-package org-roam-graph
|
||||
:bind (("C-c r g" . org-roam-graph)))
|
||||
|
||||
(use-package org-roam-ui
|
||||
(use-package org-roam-timestamps
|
||||
:after (org-roam)
|
||||
:config
|
||||
(org-roam-timestamps-mode))
|
||||
|
||||
(use-package org-roam-ui
|
||||
:commands (org-roam-ui-mode)
|
||||
:bind (("C-c r u" . org-roam-ui-mode))
|
||||
:config
|
||||
(setq org-roam-ui-sync-theme t)
|
||||
(setq org-roam-ui-follow t)
|
||||
@@ -583,24 +596,36 @@ Suggest the URL title as a description for resource."
|
||||
|
||||
(use-package org-superstar
|
||||
;; formerly
|
||||
;;(require 'org-bullets)
|
||||
;;(add-hook 'org-mode-hook 'org-bullets-mode)
|
||||
;; after changing settings run `org-superstar-restart'
|
||||
:hook (org-mode . org-superstar-mode) ;; defers the loading.
|
||||
:config
|
||||
(setq org-superstar-leading-bullet " ·") ;; " ․" " ·" " ⚫" or to hide: ?\s
|
||||
;; headlines
|
||||
(setq org-superstar-leading-bullet " ·") ;; " ․" " ·" " ⚫" or to hide: ?\s (without quotation marks)
|
||||
(setq org-superstar-remove-leading-stars nil) ;; to remove the indentation, needs org-superstar-leading-bullet set to ?\s
|
||||
(setq org-superstar-headline-bullets-list
|
||||
'(?◉
|
||||
?○
|
||||
?✸
|
||||
?✿))
|
||||
;; (setq org-superstar-leading-bullet ?\s)
|
||||
;; (setq org-superstar-leading-bullet "\u200b")
|
||||
;; (setq org-superstar-headline-bullets-list '(?\s))
|
||||
;; (setq org-superstar-headline-bullets-list '("\u200b"))
|
||||
;; (setq org-superstar-headline-bullets-list '(?․))
|
||||
|
||||
;; items
|
||||
(setq org-superstar-prettify-item-bullets t) ;; can cause slowdown when using a lot of lists (thousands), run command org-superstar-toggle-lightweight-list or set this variable to nil or see hack on the source web page
|
||||
(setq org-superstar-remove-leading-stars nil) ;; to remove the indentation
|
||||
(setq org-superstar-special-todo-items t) ;; using symbols defined in org-superstar-todo-bullet-alist
|
||||
;; (setq org-superstar-todo-bullet-alist
|
||||
;; '(("TODO" . 9744)
|
||||
;; ("WAIT" . 9744)
|
||||
;; ("DONE" . 9745)
|
||||
;; ("CANC" . 9745)))
|
||||
(setq org-superstar-todo-bullet-alist
|
||||
'(("TODO" . 9744)
|
||||
("WAIT" . 9744)
|
||||
("DONE" . 9744)
|
||||
("CANC" . 9744)))
|
||||
(setq org-superstar-item-bullet-alist
|
||||
'((?* . ?•)
|
||||
(?+ . ?➤)
|
||||
(?- . ?–)))
|
||||
(setq org-superstar-special-todo-items t) ;; using symbols defined in org-superstar-todo-bullet-alist
|
||||
(setq org-superstar-todo-bullet-alist ;; ☐ ☑
|
||||
'(("TODO" . ?☐)
|
||||
("WAIT" . ?☐)
|
||||
("DONE" . ?☐)
|
||||
("CANC" . ?☐)))
|
||||
|
||||
(set-face-attribute 'org-superstar-leading nil :foreground "#42444a")) ;; "#42444a"
|
||||
|
||||
(use-package org-table
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
;; omit warnings like: /opt/emacs-conf/lisp/org/oc-basic.el: Warning: ‘buffer-substring’ is an obsolete generalized variable.
|
||||
(setq byte-compile-warnings nil)
|
||||
|
||||
(require 'use-package) ;; requires bind-key
|
||||
(eval-when-compile
|
||||
(require 'use-package)) ;; requires bind-key
|
||||
(setq use-package-verbose t)
|
||||
(setq use-package-compute-statistics t)
|
||||
(use-package delight) ;; used for use-package :delight, see delight-delighted-modes
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
;; https://github.com/Alexander-Miller/treemacs
|
||||
|
||||
;; treemacs requires http://melpa.org/#/treemacs
|
||||
;; dash
|
||||
;; s.el http://melpa.org/#/s
|
||||
;; f.el http://melpa.org/#/f
|
||||
;; ht.el http://melpa.org/#/ht
|
||||
;; ace-window.el https://elpa.gnu.org/packages/ace-window.html
|
||||
;; avy.el https://elpa.gnu.org/packages/avy.html
|
||||
;; pfuture.el http://melpa.org/#/pfuture
|
||||
;; hydra.el https://elpa.gnu.org/packages/hydra.html
|
||||
;; ace-window.el https://elpa.gnu.org/packages/ace-window.html
|
||||
;; avy.el https://elpa.gnu.org/packages/avy.html
|
||||
;; cfrs https://melpa.org/#/cfrs
|
||||
;; posframe https://melpa.org/#/posframe
|
||||
;; dash https://melpa.org/#/dash
|
||||
;; f.el http://melpa.org/#/f
|
||||
;; ht.el http://melpa.org/#/ht
|
||||
;; hydra.el https://elpa.gnu.org/packages/hydra.html
|
||||
;; pfuture.el http://melpa.org/#/pfuture
|
||||
;; s.el http://melpa.org/#/s
|
||||
;; treemacs-magit ;; http://melpa.org/#/treemacs-magit
|
||||
(use-package treemacs
|
||||
:commands treemacs
|
||||
:bind (("<f9>" . treemacs))
|
||||
:init
|
||||
;; get rid of the message:
|
||||
;; [Treemacs] Warning: couldn’t find hl-line-mode’s background color for icons, falling back on unspecified-bg.
|
||||
@@ -29,7 +32,8 @@
|
||||
;;(setq treemacs-show-hidden-files t)
|
||||
;;(setq treemacs-goto-tag-strategy 'refetch-index)
|
||||
;;(setq treemacs-collapse-dirs (if treemacs-python-executable 3 0))
|
||||
;;(:map global-map ([f8] . treemacs-toggle))
|
||||
:config
|
||||
(require 'cfrs) ;; not done in treemacs, needed?
|
||||
)
|
||||
|
||||
(use-package treemacs-magit
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
(setq which-key-dont-use-unicode t))
|
||||
:config
|
||||
(which-key-mode)
|
||||
(setq which-key-allow-multiple-replacements t)
|
||||
(unless (daemonp)
|
||||
;; problem if using unicodes and emacsclient, the last line of which-key side-frame is cropped.
|
||||
(add-to-list 'which-key-replacement-alist '(("TAB" . nil) . ("↹" . nil)))
|
||||
@@ -44,6 +45,17 @@
|
||||
;; formaly which-key-declare-prefixes
|
||||
;; blob/c7a103a772d808101d7635ec10f292ab9202d9ee/layers/%2Bdistributions/spacemacs-base/packages.el
|
||||
(which-key-add-key-based-replacements
|
||||
"C-c !" "flyspell"
|
||||
"C-c ," "semantic/senator"
|
||||
"C-x RET" "coding-system"
|
||||
"C-x 8" "char"
|
||||
"C-x X" "edebug"
|
||||
"C-x a" "abbrev"
|
||||
"C-x n" "narrow"
|
||||
"C-x p" "project"
|
||||
"C-x r" "register/rectangle/bookmark"
|
||||
"C-x t" "tab"
|
||||
"C-x w" "window"
|
||||
"M-m" '("root" . "My root")
|
||||
"M-m a" "applications"
|
||||
"M-m b" "buffers"
|
||||
|
||||
Reference in New Issue
Block a user