Compare commits
225
Commits
150f48d18d
...
wayland
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a2c0153c7 | ||
|
|
93c1ef048d | ||
|
|
ae8f793265 | ||
|
|
c62cd37298 | ||
|
|
0757d0ac9d | ||
|
|
ac8ff55089 | ||
|
|
42be3086e2 | ||
|
|
8de971278a | ||
|
|
5ecf4b09e7 | ||
|
|
bc4a34cbce | ||
|
|
ea757b4185 | ||
|
|
9a79b23a52 | ||
|
|
935d6d999b | ||
|
|
855732f3c1 | ||
|
|
a2148c1e19 | ||
|
|
679af71d41 | ||
|
|
7bc3ec6d98 | ||
|
|
4ca12fd342 | ||
|
|
b24521fd4f | ||
|
|
b561e7e2f3 | ||
|
|
b473dbbe74 | ||
|
|
e1700384a8 | ||
|
|
ebc6245ea2 | ||
|
|
5cd3ac24a1 | ||
|
|
7cef694420 | ||
|
|
ccebfdcdd5 | ||
|
|
6e50e217c3 | ||
|
|
f0835c1a06 | ||
|
|
98cf182406 | ||
|
|
16321c0c4f | ||
|
|
9d7b1f5850 | ||
|
|
3c5fbbf581 | ||
|
|
a38b5d1e15 | ||
|
|
f223178f39 | ||
|
|
33f22e6471 | ||
|
|
b21b6d2462 | ||
|
|
795f2aad5b | ||
|
|
cf156ca80b | ||
|
|
a282e01692 | ||
|
|
88f9e2e408 | ||
|
|
a208f458c1 | ||
|
|
d488a323da | ||
|
|
9cc18db3ba | ||
|
|
88dc203b9f | ||
|
|
50d8e3f455 | ||
|
|
5e7058563f | ||
|
|
5bc947db3d | ||
|
|
94f59f5b31 | ||
|
|
484fa668de | ||
|
|
1fb041fffc | ||
|
|
9f5ce80255 | ||
|
|
1068ef9502 | ||
|
|
3b01c0b759 | ||
|
|
11d351f629 | ||
|
|
dbf929c687 | ||
|
|
9461c904cd | ||
|
|
f9459cfe66 | ||
|
|
17cbd91236 | ||
|
|
89607db905 | ||
|
|
2b5aabebfb | ||
|
|
437dd48e51 | ||
|
|
82e5740e22 | ||
|
|
cf417d95b2 | ||
|
|
c3811b7f78 | ||
|
|
3378ba974c | ||
|
|
8904a85694 | ||
|
|
008efd440b | ||
|
|
dcaff77c01 | ||
|
|
b28a885af9 | ||
|
|
3492090285 | ||
|
|
21dc56539f | ||
|
|
847537257e | ||
|
|
81edda78b1 | ||
|
|
b87f56abcf | ||
|
|
82171e6684 | ||
|
|
a4bf47770c | ||
|
|
cd45f7595d | ||
|
|
915690a2c8 | ||
|
|
140c723776 | ||
|
|
68a2c75bbc | ||
|
|
92fa2f52d8 | ||
|
|
9049b130a8 | ||
|
|
4389dce613 | ||
|
|
28c152ba22 | ||
|
|
ffbefa0887 | ||
|
|
de64c467e3 | ||
|
|
d91d412362 | ||
|
|
594c32aa87 | ||
|
|
48b88d0464 | ||
|
|
2bd9ebc4ea | ||
|
|
4c88465f78 | ||
|
|
c116b8f589 | ||
|
|
9697bab8ef | ||
|
|
36631a5372 | ||
|
|
268b9e8dee | ||
|
|
9cdaac7413 | ||
|
|
9a17694bc9 | ||
|
|
e6bddb75c8 | ||
|
|
a36cbbe4eb | ||
|
|
1ae30d54b1 | ||
|
|
62e3d3f5e5 | ||
|
|
07712d1ad4 | ||
|
|
fbb9f3d8c4 | ||
|
|
793528bfd5 | ||
|
|
cf1190e78d | ||
|
|
0095a45a1b | ||
|
|
8c10a9b804 | ||
|
|
81f9372766 | ||
|
|
50db6c771a | ||
|
|
c893786fba | ||
|
|
ef203c5063 | ||
|
|
8d8a21166b | ||
|
|
946c896f28 | ||
|
|
aee2608d4a | ||
|
|
bc61433953 | ||
|
|
e5bee42ee4 | ||
|
|
86f403dd99 | ||
|
|
d002ac90cd | ||
|
|
f7651f0c1d | ||
|
|
7195f724f9 | ||
|
|
0288dbf58f | ||
|
|
301380f6b3 | ||
|
|
557fcde13b | ||
|
|
d0447731da | ||
|
|
b6d246ab38 | ||
|
|
ab1bbc6577 | ||
|
|
64130434ef | ||
|
|
fadfdd1963 | ||
|
|
b87e49711d | ||
|
|
72cd4b94f6 | ||
|
|
a2ffd2f870 | ||
|
|
7cc8839152 | ||
|
|
e1d1609968 | ||
|
|
cfd0c06fbf | ||
|
|
91e22af9d6 | ||
|
|
385c19a3cb | ||
|
|
f99ad75730 | ||
|
|
31a4b329e7 | ||
|
|
bdc4a42000 | ||
|
|
fb508e9653 | ||
|
|
148438bcc6 | ||
|
|
56a2607848 | ||
|
|
be606c0e72 | ||
|
|
d8bd83a001 | ||
|
|
614d852a5f | ||
|
|
41feb6fb39 | ||
|
|
44d11cac16 | ||
|
|
cda1f49504 | ||
|
|
e6be5b99fc | ||
|
|
2a5bca3f55 | ||
|
|
8f71084c0f | ||
|
|
a5908b4dcd | ||
|
|
3ff9ac59ab | ||
|
|
8835b90bc3 | ||
|
|
db18abd336 | ||
|
|
d4ecfcdfcb | ||
|
|
2e211183e1 | ||
|
|
58ce700a65 | ||
|
|
309882f87d | ||
|
|
98175e30ae | ||
|
|
7a08a720d0 | ||
|
|
b2abe14fdf | ||
|
|
ab114fbad6 | ||
|
|
a4032f9f99 | ||
|
|
9be2f3e0bf | ||
|
|
1f84746ed7 | ||
|
|
9a4a5e8d74 | ||
|
|
f4a3779b04 | ||
|
|
8f69bed7d9 | ||
|
|
14a0d810ee | ||
|
|
2e06b13a69 | ||
|
|
80cf6138bc | ||
|
|
a22290a3c0 | ||
|
|
8ed84d5843 | ||
|
|
da8131bdd0 | ||
|
|
c25d08993e | ||
|
|
522ef89b1c | ||
|
|
ec85c0aff6 | ||
|
|
c2fe4ca3bf | ||
|
|
507c1945a8 | ||
|
|
743d595ca7 | ||
|
|
ae1458873e | ||
|
|
4dc285d713 | ||
|
|
42586e9f8d | ||
|
|
7659b826b5 | ||
|
|
d3b31a2c89 | ||
|
|
9d2df684bf | ||
|
|
be8c5e8136 | ||
|
|
8c83d5db37 | ||
|
|
3aa353f442 | ||
|
|
2d9a38909a | ||
|
|
7722c26618 | ||
|
|
24f2f9f6c6 | ||
|
|
045de08f03 | ||
|
|
bee667effd | ||
|
|
71dacd5256 | ||
|
|
33a2a4e9fd | ||
|
|
ae4d4c3f49 | ||
|
|
5065ad17a6 | ||
|
|
f1b42d9138 | ||
|
|
beca7d4aec | ||
|
|
5687a2fb03 | ||
|
|
47978497b9 | ||
|
|
ec3cd49dfc | ||
|
|
47178aea27 | ||
|
|
6d54572740 | ||
|
|
7af24059a1 | ||
|
|
eb684b5a13 | ||
|
|
2cad1e52f8 | ||
|
|
d5b958af9d | ||
|
|
678eeae113 | ||
|
|
e15c394602 | ||
|
|
2d5cbab390 | ||
|
|
68ef4776a0 | ||
|
|
f0e541a9fd | ||
|
|
76395e8ce1 | ||
|
|
2058d72b4e | ||
|
|
959db025cd | ||
|
|
872e718603 | ||
|
|
e3aefc546e | ||
|
|
fd55489272 | ||
|
|
6c593a9853 | ||
|
|
bf5e49cbc2 | ||
|
|
a5c730df09 | ||
|
|
c9283d60cc |
@@ -0,0 +1,2 @@
|
|||||||
|
[General]
|
||||||
|
theme=KvArcDark
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<actions>
|
||||||
|
<action>
|
||||||
|
<icon>utilities-terminal</icon>
|
||||||
|
<name>Open Terminal Here</name>
|
||||||
|
<unique-id>1594675818593070-1</unique-id>
|
||||||
|
<description>Open Terminal in the Current Directory</description>
|
||||||
|
|
||||||
|
<!-- >>> session=xorg -->
|
||||||
|
<command>urxvt -cd %f</command>
|
||||||
|
<!-- <<< -->
|
||||||
|
<!-- >>> session=wayland -->
|
||||||
|
<!-- <command>ghostty -e "sh -c 'cd %f && exec $SHELL'"</command> -->
|
||||||
|
<!-- <<< -->
|
||||||
|
|
||||||
|
<patterns>*</patterns>
|
||||||
|
<startup-notify/>
|
||||||
|
<directories/>
|
||||||
|
</action>
|
||||||
|
</actions>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
continue
|
||||||
|
file-allocation=none
|
||||||
|
max-concurrent-downloads=3
|
||||||
|
max-connection-per-server=3
|
||||||
|
min-split-size=1M
|
||||||
|
split=3
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
output HDMI-1
|
||||||
|
off
|
||||||
|
output HDMI-3
|
||||||
|
off
|
||||||
|
output DP-1
|
||||||
|
crtc 0
|
||||||
|
mode 2560x1080
|
||||||
|
pos 0x0
|
||||||
|
primary
|
||||||
|
rate 59.98
|
||||||
|
x-prop-audio auto
|
||||||
|
x-prop-broadcast_rgb Automatic
|
||||||
|
x-prop-colorspace Default
|
||||||
|
x-prop-max_bpc 12
|
||||||
|
x-prop-non_desktop 0
|
||||||
|
output HDMI-2
|
||||||
|
crtc 1
|
||||||
|
mode 1920x1080
|
||||||
|
pos 4240x0
|
||||||
|
rate 60.00
|
||||||
|
x-prop-aspect_ratio Automatic
|
||||||
|
x-prop-audio auto
|
||||||
|
x-prop-broadcast_rgb Automatic
|
||||||
|
x-prop-colorspace Default
|
||||||
|
x-prop-max_bpc 12
|
||||||
|
x-prop-non_desktop 0
|
||||||
|
output DP-2
|
||||||
|
crtc 2
|
||||||
|
mode 1680x1050
|
||||||
|
pos 2560x406
|
||||||
|
rate 59.95
|
||||||
|
x-prop-audio auto
|
||||||
|
x-prop-broadcast_rgb Automatic
|
||||||
|
x-prop-colorspace Default
|
||||||
|
x-prop-max_bpc 12
|
||||||
|
x-prop-non_desktop 0
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
DP-1 00ffffffffffff00046932290dea00001c170104a5431c783aca95a6554ea1260f5054b7ef00d1c0b30095008180814081c08100714fcd4600a0a0381f4030203a00a11c2100001a000000ff0044374c4d54463035393931370a000000fd00174c18531804110140f838f03c000000fc00415355532050423239380a202001a502032571520102031112130414051f900e0f1d1e2220212309170783010000656e0c0010008c0ad08a20e02d10103e9600a11c21000018011d007251d01e206e285500a11c2100001e011d00bc52d01e20b8285540a11c2100001e8c0ad090204031200c405500a11c21000018000000000000000000000000000000000000cd
|
||||||
|
DP-2 00ffffffffffff004162685096de81022a120104a52e1d7826e525a65444a125145054a56b807100814081809500a900b3000101010121399030621a274068b03600d0221100001c000000fd00384c1e5110000a202020202020000000fc00504b422056495332323257530a000000ff003432303635353538333030380a0087
|
||||||
|
HDMI-2 00ffffffffffff004c2d3a0d00060001011a0103805932780a23ada4544d99260f474abdef80714f81c0810081809500a9c0b300010104740030f2705a80b0588a00501d7400001e023a801871382d40582c4500501d7400001e000000fd00184b0f511e000a202020202020000000fc0053414d53554e470a20202020200129020346f0535f101f041305142021225d5e62636407160312290907071507503d04c083010000e2000fe30503016e030c001000b83c20008001020304e3060d01e50e60616566011d80d0721c1620102c2580501d7400009e662156aa51001e30468f3300501d7400001e000000000000000000000000000000000000000000cd
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
output HDMI-1
|
||||||
|
off
|
||||||
|
output DP-1
|
||||||
|
off
|
||||||
|
output HDMI-2
|
||||||
|
off
|
||||||
|
output eDP-1
|
||||||
|
crtc 0
|
||||||
|
mode 3000x2000
|
||||||
|
pos 0x0
|
||||||
|
primary
|
||||||
|
rate 59.99
|
||||||
|
x-prop-broadcast_rgb Automatic
|
||||||
|
x-prop-colorspace Default
|
||||||
|
x-prop-max_bpc 12
|
||||||
|
x-prop-non_desktop 0
|
||||||
|
x-prop-scaling_mode Full aspect
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
eDP-1 00ffffffffffff0034a9a29600082131ff190104a51d137803ee91a3544c99260f50540000000101010101010101010101010101010180a2b868b1d04070080888001dbe1000001e000000fd002e3c5e7c2a010a202020202020000000fc005656583134503034384d30300a0000001000000000000000000000000000000084
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
[config]
|
||||||
|
skip-options=gamma
|
||||||
@@ -35,7 +35,7 @@ bspc config pointer_modifier mod4
|
|||||||
bspc config external_rules_command "$HOME/.config/bspwm/rules"
|
bspc config external_rules_command "$HOME/.config/bspwm/rules"
|
||||||
|
|
||||||
# Reset all rules
|
# Reset all rules
|
||||||
bspc rule -r *
|
bspc rule -r \*
|
||||||
|
|
||||||
# Open program on specific desktop
|
# Open program on specific desktop
|
||||||
bspc rule -a firefox desktop="$WS1" locked=on
|
bspc rule -a firefox desktop="$WS1" locked=on
|
||||||
@@ -48,8 +48,10 @@ bspc rule -a krita desktop="$WS5" follow=on
|
|||||||
bspc rule -a Arandr state=floating
|
bspc rule -a Arandr state=floating
|
||||||
bspc rule -a Emacs state=tiled
|
bspc rule -a Emacs state=tiled
|
||||||
bspc rule -a feh state=floating
|
bspc rule -a feh state=floating
|
||||||
|
bspc rule -a firefox:Browser state=floating
|
||||||
bspc rule -a firefox:Places state=floating
|
bspc rule -a firefox:Places state=floating
|
||||||
bspc rule -a Inferno state=floating
|
bspc rule -a Inferno state=floating
|
||||||
|
bspc rule -a looking-glass-client state=fullscreen
|
||||||
bspc rule -a Lxappearance state=floating
|
bspc rule -a Lxappearance state=floating
|
||||||
bspc rule -a mpv state=floating center=on
|
bspc rule -a mpv state=floating center=on
|
||||||
bspc rule -a Pavucontrol state=floating
|
bspc rule -a Pavucontrol state=floating
|
||||||
|
|||||||
+14
-9
@@ -2,14 +2,21 @@
|
|||||||
|
|
||||||
### Display ###
|
### Display ###
|
||||||
|
|
||||||
geometry = "0x0-20-20"
|
origin = "bottom-right"
|
||||||
|
offset = "20x20"
|
||||||
horizontal_padding = 15
|
horizontal_padding = 15
|
||||||
idle_threshold = 120
|
idle_threshold = 120
|
||||||
indicate_hidden = false
|
indicate_hidden = false
|
||||||
padding = 10
|
padding = 10
|
||||||
shrink = false
|
shrink = false
|
||||||
|
|
||||||
frame_width = 3
|
# >>> hostname=arch-desktop
|
||||||
|
frame_width = 2
|
||||||
|
# <<<
|
||||||
|
# >>> hostname=arch-laptop
|
||||||
|
# frame_width = 3
|
||||||
|
# <<<
|
||||||
|
|
||||||
separator_height = 3
|
separator_height = 3
|
||||||
separator_color = frame
|
separator_color = frame
|
||||||
|
|
||||||
@@ -21,6 +28,7 @@ format = "<b>%s</b>\n%b %p"
|
|||||||
markup = full
|
markup = full
|
||||||
word_wrap = true
|
word_wrap = true
|
||||||
show_indicators = false
|
show_indicators = false
|
||||||
|
show_age_threshold = -1
|
||||||
|
|
||||||
### History ###
|
### History ###
|
||||||
|
|
||||||
@@ -29,15 +37,12 @@ history_length = 20
|
|||||||
|
|
||||||
### Misc/Advanced ###
|
### Misc/Advanced ###
|
||||||
|
|
||||||
browser = firefox
|
browser = xdg-open
|
||||||
dmenu = rofi -dmenu -p dunst
|
dmenu = rofi -dmenu -p dunst
|
||||||
|
|
||||||
[shortcuts]
|
mouse_left_click = do_action
|
||||||
close = ctrl+space
|
mouse_middle_click = close_current
|
||||||
close_all = ctrl+shift+space
|
mouse_right_click = open_url
|
||||||
|
|
||||||
history = ctrl+grave
|
|
||||||
context = ctrl+shift+period
|
|
||||||
|
|
||||||
[urgency_low]
|
[urgency_low]
|
||||||
background = "#8C9440"
|
background = "#8C9440"
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -7,6 +7,8 @@
|
|||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
|
;; (setq debug-on-error t)
|
||||||
|
|
||||||
;; Defer the garbage collection during startup
|
;; Defer the garbage collection during startup
|
||||||
(setq gc-cons-threshold most-positive-fixnum)
|
(setq gc-cons-threshold most-positive-fixnum)
|
||||||
(add-hook 'emacs-startup-hook (lambda () (setq gc-cons-threshold 8000000)))
|
(add-hook 'emacs-startup-hook (lambda () (setq gc-cons-threshold 8000000)))
|
||||||
@@ -21,16 +23,8 @@
|
|||||||
;; Prefer to `load' the newest elisp file
|
;; Prefer to `load' the newest elisp file
|
||||||
(setq load-prefer-newer t)
|
(setq load-prefer-newer t)
|
||||||
|
|
||||||
;; Set package install location
|
;; Disable package.el
|
||||||
(setq package-user-dir (concat user-emacs-directory "elpa"))
|
(setq package-enable-at-startup nil)
|
||||||
|
|
||||||
;; Set package quickstart location
|
|
||||||
(setq package-quickstart-file (concat
|
|
||||||
(getenv "XDG_CACHE_HOME")
|
|
||||||
"/emacs/package-quickstart.el"))
|
|
||||||
|
|
||||||
;; Precompute activation actions to speed up startup
|
|
||||||
(setq package-quickstart t)
|
|
||||||
|
|
||||||
;; -------------------------------------
|
;; -------------------------------------
|
||||||
|
|
||||||
|
|||||||
+14
-16
@@ -2,25 +2,23 @@
|
|||||||
|
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
|
|
||||||
;; Setup package archives and build configuration file.
|
;; Load modules.
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(require 'package)
|
;; -----------------------------------------
|
||||||
|
|
||||||
;; Add the MELPA repository to the package manager
|
(add-to-list 'load-path (locate-user-emacs-file "site-lisp"))
|
||||||
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
|
|
||||||
|
|
||||||
;; Install the `use-package' dependency
|
(require 'dot-elpaca)
|
||||||
(unless (package-installed-p 'use-package)
|
(require 'dot-setup-el)
|
||||||
(package-refresh-contents)
|
|
||||||
(package-install 'use-package))
|
|
||||||
|
|
||||||
;; -------------------------------------
|
(require 'dot-core)
|
||||||
|
(require 'dot-ui)
|
||||||
;; Tangle and load configuration file
|
(require 'dot-evil)
|
||||||
(require 'org)
|
(require 'dot-development)
|
||||||
(when (file-readable-p (concat user-emacs-directory "config.org"))
|
(require 'dot-selection)
|
||||||
(org-babel-load-file (concat user-emacs-directory "config.org")))
|
(require 'dot-org-mode)
|
||||||
|
(require 'dot-mail)
|
||||||
;;; init.el ends here
|
(require 'dot-rss)
|
||||||
|
(require 'dot-keybinds)
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
;;; dot-core-advice.el --- -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; Advice and Aliases.
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
|
||||||
|
;; Advice
|
||||||
|
|
||||||
|
;; Define default terminal option.
|
||||||
|
(defun dot/ansi-term (program &optional new-buffer-name)
|
||||||
|
(interactive (list dot/shell)))
|
||||||
|
(advice-add 'ansi-term :before #'dot/ansi-term)
|
||||||
|
|
||||||
|
;; Aliases
|
||||||
|
|
||||||
|
;; Make confirm easier, by just pressing y/n.
|
||||||
|
(defalias 'yes-or-no-p 'y-or-n-p)
|
||||||
|
|
||||||
|
(provide 'dot-core-advice)
|
||||||
|
|
||||||
|
;;; dot-core-advice.el ends here
|
||||||
@@ -0,0 +1,249 @@
|
|||||||
|
;;; dot-core-config.el --- -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; ??
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; General
|
||||||
|
|
||||||
|
;; Columns start at 1
|
||||||
|
(setq column-number-indicator-zero-based nil)
|
||||||
|
;; TODO: Make variable below compatible with telephone-line
|
||||||
|
;; (setq mode-line-position-column-format " C%C")
|
||||||
|
|
||||||
|
;; Dont confirm on quitting Emacs
|
||||||
|
(setq confirm-kill-processes nil)
|
||||||
|
|
||||||
|
;; Custom thems, do not ask if safe
|
||||||
|
(setq custom-safe-themes t)
|
||||||
|
|
||||||
|
;; Dired move to trash
|
||||||
|
(setq delete-by-moving-to-trash t)
|
||||||
|
|
||||||
|
;; Column indicator character
|
||||||
|
(setq display-fill-column-indicator-character ?\N{U+2503})
|
||||||
|
|
||||||
|
;; Scrolling
|
||||||
|
(setq scroll-conservatively 1)
|
||||||
|
(setq mouse-wheel-scroll-amount '(5))
|
||||||
|
(setq mouse-wheel-progressive-speed nil)
|
||||||
|
(setq pixel-scroll-precision-mode t)
|
||||||
|
|
||||||
|
;; Parenthesis, set behavior
|
||||||
|
(setq show-paren-delay 0)
|
||||||
|
(setq show-paren-style 'mixed)
|
||||||
|
(setq show-paren-context-when-offscreen t)
|
||||||
|
|
||||||
|
;; Tramp default protocol
|
||||||
|
(setq tramp-default-method "ssh")
|
||||||
|
|
||||||
|
;; Set undo limit, measured in bytes
|
||||||
|
(setq-default undo-limit 400000)
|
||||||
|
(setq-default undo-strong-limit 3000000)
|
||||||
|
(setq-default undo-outer-limit 12000000)
|
||||||
|
|
||||||
|
;; Enable line numbers
|
||||||
|
(global-display-line-numbers-mode)
|
||||||
|
|
||||||
|
;; C++ syntax highlighting for .h files
|
||||||
|
(add-to-list 'auto-mode-alist '("\\.h\\'" . c++-mode))
|
||||||
|
|
||||||
|
;; Set the frame title
|
||||||
|
(setq frame-title-format
|
||||||
|
`("%b"
|
||||||
|
(:eval
|
||||||
|
(if (buffer-file-name)
|
||||||
|
(concat
|
||||||
|
(if (buffer-modified-p) " •" nil)
|
||||||
|
" ("
|
||||||
|
(abbreviate-file-name
|
||||||
|
(directory-file-name
|
||||||
|
(file-name-directory (buffer-file-name))))
|
||||||
|
")")
|
||||||
|
nil))
|
||||||
|
,(format " - GNU Emacs %s" emacs-version)
|
||||||
|
))
|
||||||
|
(setq icon-title-format frame-title-format)
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Buffers
|
||||||
|
|
||||||
|
(setq confirm-nonexistent-file-or-buffer nil)
|
||||||
|
(setq ibuffer-expert t)
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Dired
|
||||||
|
|
||||||
|
(setq wdired-allow-to-change-permissions t)
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Electric
|
||||||
|
|
||||||
|
;; Make return key also do indent of previous line
|
||||||
|
(electric-indent-mode 1)
|
||||||
|
(setq electric-pair-pairs '(
|
||||||
|
(?\( . ?\))
|
||||||
|
(?\[ . ?\])
|
||||||
|
))
|
||||||
|
(electric-pair-mode 1)
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; File Paths
|
||||||
|
|
||||||
|
;; Set file paths for built-in features like: auto-saves, backups, etc.
|
||||||
|
|
||||||
|
;; Set Directory locations
|
||||||
|
(setq auto-save-list-file-prefix (expand-file-name "auto-save/" dot-cache-dir))
|
||||||
|
(setq auto-save-file-name-transforms `((".*" ,auto-save-list-file-prefix t)))
|
||||||
|
(setq backup-directory-alist `((".*" . ,(expand-file-name "backup/" dot-cache-dir))))
|
||||||
|
(setq custom-theme-directory (expand-file-name "themes/" dot-emacs-dir))
|
||||||
|
(setq eshell-directory-name (expand-file-name "eshell/" dot-cache-dir))
|
||||||
|
(setq tramp-auto-save-directory (expand-file-name "tramp-auto-save/" dot-cache-dir))
|
||||||
|
(setq tramp-backup-directory-alist backup-directory-alist)
|
||||||
|
(setq treesit-extra-load-path `(,(expand-file-name "tree-sitter" dot-cache-dir)))
|
||||||
|
(setq url-configuration-directory (expand-file-name "url/" dot-cache-dir))
|
||||||
|
|
||||||
|
(startup-redirect-eln-cache (expand-file-name "eln-cache" dot-cache-dir))
|
||||||
|
|
||||||
|
;; Set file locations
|
||||||
|
(setq bookmark-default-file (expand-file-name "bookmarks" dot-etc-dir))
|
||||||
|
(setq nsm-settings-file (expand-file-name "network-security.data" dot-cache-dir))
|
||||||
|
(setq org-id-locations-file (expand-file-name "org-id-locations" dot-cache-dir))
|
||||||
|
(setq tramp-persistency-file-name (expand-file-name "tramp" dot-cache-dir ))
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; File Backups Versioning
|
||||||
|
|
||||||
|
;; Setup file backups versioning.
|
||||||
|
|
||||||
|
(setq backup-by-copying t) ; Don't cobbler symlinks
|
||||||
|
(setq create-lockfiles nil) ; Disable lockfiles (.#)
|
||||||
|
(setq delete-old-versions t) ; Cleanup backups
|
||||||
|
(setq kept-new-versions 5) ; Newest backups to keep
|
||||||
|
(setq kept-old-versions 2) ; Oldest backups to keep
|
||||||
|
(setq version-control t) ; Use version numbers on backups
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Formatting
|
||||||
|
|
||||||
|
;; Columnn after line-wrapping happens
|
||||||
|
(setq-default fill-column 80)
|
||||||
|
|
||||||
|
;; Automatically add newline on save at the end of the file
|
||||||
|
(setq require-final-newline t)
|
||||||
|
|
||||||
|
;; End sentences with a single space
|
||||||
|
(setq sentence-end-double-space nil)
|
||||||
|
|
||||||
|
;; `tabify' and `untabify' should only affect indentation
|
||||||
|
(setq tabify-regexp "^\t* [ \t]+")
|
||||||
|
|
||||||
|
;; Do not wrap lines
|
||||||
|
(setq-default truncate-lines t)
|
||||||
|
|
||||||
|
;; Wrap lines in the middle of words, gives a \ indicator
|
||||||
|
(setq-default word-wrap nil)
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Hide Elements
|
||||||
|
|
||||||
|
(menu-bar-mode 0)
|
||||||
|
(scroll-bar-mode 0)
|
||||||
|
(tool-bar-mode 0)
|
||||||
|
(tooltip-mode 0)
|
||||||
|
(fringe-mode 0)
|
||||||
|
(blink-cursor-mode 0)
|
||||||
|
|
||||||
|
(setq inhibit-startup-message t)
|
||||||
|
(setq initial-scratch-message nil)
|
||||||
|
(setq ring-bell-function 'ignore)
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Native Compilation
|
||||||
|
|
||||||
|
(setq native-comp-async-report-warnings-errors nil)
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Recentf
|
||||||
|
|
||||||
|
(elpaca-nil (setup recentf ; built-in
|
||||||
|
(:require recentf)
|
||||||
|
(:when-loaded
|
||||||
|
(setq recentf-auto-cleanup 'never)
|
||||||
|
(setq recentf-exclude '("~$" "/ssh:" "/sudo:"))
|
||||||
|
(setq recentf-filename-handlers '(abbreviate-file-name))
|
||||||
|
(setq recentf-max-menu-items 0)
|
||||||
|
(setq recentf-max-saved-items 200)
|
||||||
|
(setq recentf-save-file (expand-file-name "recentf" dot-cache-dir))
|
||||||
|
(recentf-mode))))
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Tabs
|
||||||
|
|
||||||
|
;; Tabs
|
||||||
|
(setq-default tab-width 4
|
||||||
|
indent-tabs-mode t
|
||||||
|
c-basic-offset 4
|
||||||
|
sgml-basic-offset 4
|
||||||
|
sh-basic-offset 4)
|
||||||
|
|
||||||
|
;; C/C++-like languages formatting style
|
||||||
|
;; https://www.emacswiki.org/emacs/IndentingC
|
||||||
|
;; https://www.gnu.org/software/emacs/manual/html_mono/ccmode.html#Getting-Started
|
||||||
|
;; https://www.gnu.org/software/emacs/manual/html_mono/ccmode.html#Adding-Styles
|
||||||
|
;; https://www.gnu.org/software/emacs/manual/html_mono/ccmode.html#Sample-Init-File
|
||||||
|
(c-add-style "user" `("linux"
|
||||||
|
(c-basic-offset . ,(default-value 'tab-width))
|
||||||
|
(c-offsets-alist
|
||||||
|
(innamespace . -)
|
||||||
|
)))
|
||||||
|
(setq-default c-default-style "user")
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; UTF-8
|
||||||
|
|
||||||
|
;; Set UTF-8 encoding as default.
|
||||||
|
|
||||||
|
(prefer-coding-system 'utf-8-unix)
|
||||||
|
(setq locale-coding-system 'utf-8-unix)
|
||||||
|
;; Default also sets file-name, keyboard and terminal coding system
|
||||||
|
(set-default-coding-systems 'utf-8-unix)
|
||||||
|
(set-buffer-file-coding-system 'utf-8-unix)
|
||||||
|
(set-selection-coding-system 'utf-8-unix)
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Window
|
||||||
|
|
||||||
|
;; Set `switch-to-buffer' to respect the window rules
|
||||||
|
(setq switch-to-buffer-obey-display-actions t)
|
||||||
|
|
||||||
|
;; Window rules
|
||||||
|
(setq display-buffer-alist
|
||||||
|
'(
|
||||||
|
;; ^\*(e?shell|(ansi-|v)?term).*
|
||||||
|
("^\\*\\(e?shell\\|\\(ansi-\\|v\\)?term\\).*"
|
||||||
|
(display-buffer-in-side-window)
|
||||||
|
(window-height . 0.25)
|
||||||
|
(side . bottom)
|
||||||
|
(slot . -1))
|
||||||
|
("\\*Faces\\*"
|
||||||
|
(display-buffer-in-side-window)
|
||||||
|
(window-height . 0.25)
|
||||||
|
(side . bottom)
|
||||||
|
(slot . 1))
|
||||||
|
("\\*Help.*"
|
||||||
|
(display-buffer-in-side-window)
|
||||||
|
(window-height . 0.25)
|
||||||
|
(side . bottom)
|
||||||
|
(slot . 0))
|
||||||
|
))
|
||||||
|
|
||||||
|
;; Allow 'undo' and 'redo' changes in Window Configuration.
|
||||||
|
(winner-mode)
|
||||||
|
|
||||||
|
(provide 'dot-core-config)
|
||||||
|
|
||||||
|
;;; dot-core-config.el ends here
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
;;; dot-core-customize.el --- -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; ??
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Customizations
|
||||||
|
|
||||||
|
;; Store customize file separately, don't freak out when it's not found.
|
||||||
|
|
||||||
|
(setq custom-file (expand-file-name "custom.el" dot-etc-dir))
|
||||||
|
(load custom-file 'noerror)
|
||||||
|
|
||||||
|
(provide 'dot-core-customize)
|
||||||
|
|
||||||
|
;;; dot-core-customize.el ends here
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
;;; dot-core-fonts.el --- -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; ??
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Set fonts
|
||||||
|
|
||||||
|
(set-face-attribute 'default nil :height 90 :family "DejaVu Sans Mono")
|
||||||
|
(set-face-attribute 'fixed-pitch-serif nil :height 100)
|
||||||
|
|
||||||
|
(provide 'dot-core-fonts)
|
||||||
|
|
||||||
|
;;; dot-core-fonts.el ends here
|
||||||
@@ -0,0 +1,195 @@
|
|||||||
|
;;; dot-core-functions.el --- -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; Custom elisp functions and macros.
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; General Functions
|
||||||
|
|
||||||
|
;; Functions that only use built-in Emacs functionality.
|
||||||
|
|
||||||
|
(defun display-startup-echo-area-message ()
|
||||||
|
"Hide default startup message."
|
||||||
|
(message nil))
|
||||||
|
|
||||||
|
(defun dot/config-visit ()
|
||||||
|
"Edit config file."
|
||||||
|
(interactive)
|
||||||
|
(find-file (expand-file-name "init.el" dot-emacs-dir)))
|
||||||
|
|
||||||
|
(defun dot/config-reload ()
|
||||||
|
"Reload config file."
|
||||||
|
(interactive)
|
||||||
|
(load (expand-file-name "init.el" dot-emacs-dir)))
|
||||||
|
|
||||||
|
(defun dot/copy-cpp-function-implementation ()
|
||||||
|
"Copy C++ function implementation to clipboard."
|
||||||
|
(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'."
|
||||||
|
(let ((result '())
|
||||||
|
(current-directory-list (directory-files dir t)))
|
||||||
|
(dolist (path current-directory-list)
|
||||||
|
(cond
|
||||||
|
((and (file-regular-p path)
|
||||||
|
(file-readable-p path)
|
||||||
|
(string-match regexp path))
|
||||||
|
(setq result (cons path result)))
|
||||||
|
((and (file-directory-p path)
|
||||||
|
(file-readable-p path)
|
||||||
|
(not (string-equal "/.." (substring path -3)))
|
||||||
|
(not (string-equal "/." (substring path -2))))
|
||||||
|
(when (and include-directories
|
||||||
|
(string-match regexp path))
|
||||||
|
(setq result (cons path result)))
|
||||||
|
(when (> maxdepth 1)
|
||||||
|
(setq result (append (nreverse (dot/directory-files-recursively-depth
|
||||||
|
path regexp include-directories (- maxdepth 1)))
|
||||||
|
result))))
|
||||||
|
(t)))
|
||||||
|
(reverse result)))
|
||||||
|
|
||||||
|
(defun dot/dired-find-file ()
|
||||||
|
"In Dired, visit the file or directory named on this line."
|
||||||
|
(interactive)
|
||||||
|
(if (file-directory-p (dired-file-name-at-point))
|
||||||
|
(dired-find-alternate-file)
|
||||||
|
(dired-find-file)))
|
||||||
|
|
||||||
|
(defun dot/dired-up-directory ()
|
||||||
|
"Run Dired on parent directory of current directory."
|
||||||
|
(interactive)
|
||||||
|
(find-alternate-file ".."))
|
||||||
|
|
||||||
|
(defun dot/find-file-emacsd ()
|
||||||
|
"Find file under `dot-emacs-dir', recursively."
|
||||||
|
(interactive)
|
||||||
|
(let ((files (mapcar 'abbreviate-file-name
|
||||||
|
(directory-files-recursively dot-emacs-dir ""))))
|
||||||
|
(find-file (completing-read "Find file (emacs): " files nil t))))
|
||||||
|
|
||||||
|
(defun dot/indent-buffer ()
|
||||||
|
"Indent each nonblank line in the buffer."
|
||||||
|
(interactive)
|
||||||
|
(save-excursion
|
||||||
|
(indent-region (point-min) (point-max) nil)))
|
||||||
|
|
||||||
|
(defun dot/insert-spaces-until-column (until-column)
|
||||||
|
"Insert spaces from point to UNTIL-COLUMN."
|
||||||
|
(interactive "nInsert spaces until column: ")
|
||||||
|
(let ((current-column (current-column)))
|
||||||
|
;; Increment column if the index is 1 based
|
||||||
|
(when (not column-number-indicator-zero-based)
|
||||||
|
(setq current-column (+ current-column 1)))
|
||||||
|
;; Insert spaces
|
||||||
|
(let ((diff (- until-column current-column)))
|
||||||
|
(if (> diff 0)
|
||||||
|
(save-excursion (insert (make-string diff ?\ )))
|
||||||
|
(user-error "Column should be higher than point")))))
|
||||||
|
|
||||||
|
(defun dot/reload-theme ()
|
||||||
|
"Reload custom theme."
|
||||||
|
(interactive)
|
||||||
|
(mapc 'load (file-expand-wildcards
|
||||||
|
(concat (car custom-theme-load-path) "*.el")))
|
||||||
|
(load-theme (car custom-enabled-themes) t))
|
||||||
|
|
||||||
|
(defun dot/sudo-find-file (filename)
|
||||||
|
"Edit file FILENAME as root."
|
||||||
|
(interactive "FOpen file (as root): ")
|
||||||
|
(find-file (concat "/sudo:root@localhost:" filename)))
|
||||||
|
|
||||||
|
(defun dot/sudo-this-file ()
|
||||||
|
"Edit the current file as root."
|
||||||
|
(interactive)
|
||||||
|
(if buffer-file-name
|
||||||
|
(find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))
|
||||||
|
(princ "Current buffer isn't a file")))
|
||||||
|
|
||||||
|
(defun dot/toggle-fringe (&optional arg)
|
||||||
|
"Toggle left-only fringe, or set state with ARG."
|
||||||
|
(interactive)
|
||||||
|
(if (or (and (eq fringe-mode 0) (eq arg nil))
|
||||||
|
(eq arg 1))
|
||||||
|
(set-fringe-mode '(nil . 0))
|
||||||
|
(set-fringe-mode 0)))
|
||||||
|
|
||||||
|
(defun dot/M-x (command)
|
||||||
|
"Prompt and execute COMMAND."
|
||||||
|
(interactive "CCommand: ")
|
||||||
|
(command-execute command))
|
||||||
|
|
||||||
|
(defun split-follow-horizontally ()
|
||||||
|
"Split and follow window."
|
||||||
|
(interactive)
|
||||||
|
(split-window-below)
|
||||||
|
(other-window 1))
|
||||||
|
(defun split-follow-vertically ()
|
||||||
|
"Split and follow window."
|
||||||
|
(interactive)
|
||||||
|
(split-window-right)
|
||||||
|
(other-window 1))
|
||||||
|
|
||||||
|
;; https://emacsredux.com/blog/2013/05/04/rename-file-and-buffer/
|
||||||
|
(defun rename-file-and-buffer ()
|
||||||
|
"Rename the current buffer and file it is visiting."
|
||||||
|
(interactive)
|
||||||
|
(let ((filename (buffer-file-name)))
|
||||||
|
(if (not (and filename (file-exists-p filename)))
|
||||||
|
(message "Buffer is not visiting a file!")
|
||||||
|
(let ((new-name (read-file-name "New name: " filename)))
|
||||||
|
(cond
|
||||||
|
((vc-backend filename) (vc-rename-file filename new-name))
|
||||||
|
(t
|
||||||
|
(rename-file filename new-name t)
|
||||||
|
(set-visited-file-name new-name t t)))))))
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Hook call functions
|
||||||
|
|
||||||
|
(defun dot/hook-disable-line-numbers ()
|
||||||
|
"Disable the line numbers."
|
||||||
|
(display-line-numbers-mode 0))
|
||||||
|
|
||||||
|
(defun dot/hook-disable-mode-line ()
|
||||||
|
"Disable the mode line."
|
||||||
|
(setq-local mode-line-format nil))
|
||||||
|
|
||||||
|
(provide 'dot-core-functions)
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Macros
|
||||||
|
|
||||||
|
;; Reference: https://github.com/arcticicestudio/nord-emacs/issues/59#issuecomment-414882071
|
||||||
|
(defmacro dot/run-after-new-frame (func)
|
||||||
|
"Run FUNC once or after every frame creation.
|
||||||
|
This is needed for UI initialization when running with the daemon."
|
||||||
|
`(if (daemonp)
|
||||||
|
(add-hook 'after-make-frame-functions
|
||||||
|
(lambda (frame) (with-selected-frame frame ,func)))
|
||||||
|
,func))
|
||||||
|
|
||||||
|
;;; dot-core-functions.el ends here
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
;;; dot-hooks.el --- -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; Add hooks.
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
|
||||||
|
;; Delete trailing whitespace
|
||||||
|
(add-hook 'before-save-hook #'delete-trailing-whitespace)
|
||||||
|
|
||||||
|
;; Display fill column indicator
|
||||||
|
(add-hook 'prog-mode-hook #'display-fill-column-indicator-mode)
|
||||||
|
(add-hook 'text-mode-hook #'display-fill-column-indicator-mode)
|
||||||
|
|
||||||
|
;; Highlight parenthesis
|
||||||
|
(add-hook 'prog-mode-hook #'show-paren-mode)
|
||||||
|
|
||||||
|
;; Disable line numbers
|
||||||
|
(add-hook 'Custom-mode-hook #'dot/hook-disable-line-numbers)
|
||||||
|
(add-hook 'dired-mode-hook #'dot/hook-disable-line-numbers)
|
||||||
|
(add-hook 'Info-mode-hook #'dot/hook-disable-line-numbers)
|
||||||
|
(add-hook 'term-mode-hook #'dot/hook-disable-line-numbers)
|
||||||
|
|
||||||
|
;; Wrap lines in the middle of words, gives a \ indicator
|
||||||
|
(add-hook 'visual-line-mode-hook (lambda () (setq word-wrap nil)))
|
||||||
|
|
||||||
|
(provide 'dot-core-hooks)
|
||||||
|
|
||||||
|
;;; dot-hooks.el ends here
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
;;; dot-core-packages.el --- -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; Install core packages.
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
;;; Compile
|
||||||
|
|
||||||
|
;; Automatically compile all packages.
|
||||||
|
;; https://github.com/emacscollective/auto-compile
|
||||||
|
|
||||||
|
(elpaca-setup auto-compile
|
||||||
|
(:require auto-compile)
|
||||||
|
(:when-loaded
|
||||||
|
(auto-compile-on-load-mode)
|
||||||
|
(auto-compile-on-save-mode)))
|
||||||
|
|
||||||
|
;;; General packages
|
||||||
|
|
||||||
|
(elpaca-setup general
|
||||||
|
(:load-after evil)
|
||||||
|
(:when-loaded
|
||||||
|
;; Fix for issue: general #493 and evil #130, #301
|
||||||
|
;; https://github.com/noctuid/evil-guide#why-dont-keys-defined-with-evil-define-key-work-immediately
|
||||||
|
(defun dot/general-fix-leader-key ()
|
||||||
|
"Fix leader key in *Messages* buffer."
|
||||||
|
(when-let ((messages-buffer (get-buffer "*Messages*")))
|
||||||
|
(with-current-buffer messages-buffer
|
||||||
|
(evil-normalize-keymaps))))
|
||||||
|
(add-hook 'emacs-startup-hook #'dot/general-fix-leader-key)))
|
||||||
|
|
||||||
|
(elpaca-setup avy)
|
||||||
|
|
||||||
|
(elpaca-setup hungry-delete
|
||||||
|
(:require hungry-delete)
|
||||||
|
(:when-loaded (global-hungry-delete-mode)))
|
||||||
|
|
||||||
|
(elpaca-setup smart-tabs-mode
|
||||||
|
;; TODO: how does this get auto-loaded?
|
||||||
|
(:when-loaded
|
||||||
|
(smart-tabs-add-language-support latex latex-mode-hook
|
||||||
|
((latex-indent-line . 4)
|
||||||
|
(latex-indent-region . 4)))
|
||||||
|
;; FIXME: breaks for Python files
|
||||||
|
(smart-tabs-insinuate 'c 'c++ 'java 'python 'latex)))
|
||||||
|
|
||||||
|
(elpaca-setup super-save
|
||||||
|
(:require super-save)
|
||||||
|
(:when-loaded
|
||||||
|
(setq super-save-auto-save-when-idle t)
|
||||||
|
|
||||||
|
;; Fix for issues: super-save #38 and lsp-mode #1322
|
||||||
|
(defun dot/super-save-disable-advice (orig-fun &rest args)
|
||||||
|
"Dont auto-save under these conditions."
|
||||||
|
(unless (equal (car args) " *LV*")
|
||||||
|
(apply orig-fun args)))
|
||||||
|
(advice-add 'super-save-command-advice :around #'dot/super-save-disable-advice)
|
||||||
|
|
||||||
|
(super-save-mode)))
|
||||||
|
|
||||||
|
(elpaca-nil (setup desktop ; built-in
|
||||||
|
(:require desktop)
|
||||||
|
(:when-loaded
|
||||||
|
(setq desktop-base-file-name "state")
|
||||||
|
(setq desktop-base-lock-name "state.lock")
|
||||||
|
(setq desktop-dirname (expand-file-name "desktop/" dot-cache-dir))
|
||||||
|
(setq desktop-path (list desktop-dirname))
|
||||||
|
(setq desktop-globals-to-save '()) ;; Only need frames and buffers
|
||||||
|
|
||||||
|
;; Create directory to store desktop file in
|
||||||
|
(unless (file-directory-p desktop-dirname)
|
||||||
|
(make-directory desktop-dirname t))
|
||||||
|
|
||||||
|
(defun dot/desktop-save ()
|
||||||
|
"Save frame state and buffers."
|
||||||
|
(interactive)
|
||||||
|
(dot/centaur-tabs-buffer-cleanup)
|
||||||
|
(desktop-save desktop-dirname t))
|
||||||
|
|
||||||
|
(defun dot/desktop-save-on-exit ()
|
||||||
|
"Save state of buffers before closing Emacs."
|
||||||
|
(dot/desktop-save)
|
||||||
|
(desktop-release-lock desktop-dirname))
|
||||||
|
(add-hook 'kill-emacs-hook #'dot/desktop-save-on-exit))))
|
||||||
|
|
||||||
|
(provide 'dot-core-packages)
|
||||||
|
|
||||||
|
;;; dot-core-packages.el ends here
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
;;; dot-core-variables.el --- -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; Global variables.
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Global Variables
|
||||||
|
|
||||||
|
;; Variables for directories, leader keys, etc.
|
||||||
|
|
||||||
|
(defvar dot-emacs-dir (directory-file-name (file-truename user-emacs-directory))
|
||||||
|
"Directory base.") ; ~/.config/emacs
|
||||||
|
|
||||||
|
(defvar dot-etc-dir (expand-file-name "etc" dot-emacs-dir)
|
||||||
|
"Directory for non-volatile storage.") ; ~/.config/emacs/etc
|
||||||
|
|
||||||
|
(defvar dot-cache-dir
|
||||||
|
(expand-file-name "emacs" (if (getenv "XDG_CACHE_HOME") (getenv "XDG_CACHE_HOME") "~/.cache"))
|
||||||
|
"Directory for cache data.") ; ~/.cache/emacs
|
||||||
|
|
||||||
|
(defvar dot/leader-key "SPC"
|
||||||
|
"Leader prefix key.")
|
||||||
|
|
||||||
|
(defvar dot/leader-alt-key "M-SPC"
|
||||||
|
"Alternative leader prefix key, used for Insert and Emacs states.")
|
||||||
|
|
||||||
|
(defvar dot/localleader-key "SPC m"
|
||||||
|
"Local leader prefix key, for 'major-mode' specific commands.")
|
||||||
|
|
||||||
|
(defvar dot/localleader-alt-key "M-SPC m"
|
||||||
|
"Alternative local leader prefix key, used for Insert and Emacs states.")
|
||||||
|
|
||||||
|
(defvar dot/shell "/bin/zsh"
|
||||||
|
"Command interpreter binary path.")
|
||||||
|
|
||||||
|
(defvar dot/hidpi (getenv "HIDPI")
|
||||||
|
"Whether the primary screen is HiDPI.")
|
||||||
|
|
||||||
|
;; Create cache directory
|
||||||
|
(unless (file-directory-p dot-cache-dir)
|
||||||
|
(make-directory dot-cache-dir t))
|
||||||
|
|
||||||
|
(provide 'dot-core-variables)
|
||||||
|
|
||||||
|
;;; dot-core-variables.el ends here
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
;;; dot-core.el --- -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; Load configuration core.
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
|
||||||
|
(add-to-list 'load-path (locate-user-emacs-file "site-lisp/core"))
|
||||||
|
|
||||||
|
(require 'dot-core-variables)
|
||||||
|
(require 'dot-core-customize)
|
||||||
|
(require 'dot-core-fonts)
|
||||||
|
(require 'dot-core-packages)
|
||||||
|
(require 'dot-core-config)
|
||||||
|
(require 'dot-core-functions)
|
||||||
|
(require 'dot-core-advice)
|
||||||
|
(require 'dot-core-hooks)
|
||||||
|
|
||||||
|
(provide 'dot-core)
|
||||||
|
|
||||||
|
;;; dot-core.el ends here
|
||||||
@@ -0,0 +1,501 @@
|
|||||||
|
;;; dot-development.el --- -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; Development.
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Company
|
||||||
|
|
||||||
|
(elpaca-setup company
|
||||||
|
(:require company)
|
||||||
|
(:with-mode
|
||||||
|
(c-mode-common
|
||||||
|
emacs-lisp-mode
|
||||||
|
latex-mode
|
||||||
|
org-mode
|
||||||
|
php-mode
|
||||||
|
shell-mode
|
||||||
|
shell-script-mode)
|
||||||
|
(:hook company-mode))
|
||||||
|
(:when-loaded
|
||||||
|
(setq company-idle-delay 0.2)
|
||||||
|
(setq company-minimum-prefix-length 2)
|
||||||
|
(setq company-show-numbers t)
|
||||||
|
(setq company-tooltip-align-annotations 't)))
|
||||||
|
|
||||||
|
;; Sort Company completions.
|
||||||
|
|
||||||
|
(elpaca-setup company-prescient
|
||||||
|
(:load-after company prescient)
|
||||||
|
(:when-loaded (company-prescient-mode)))
|
||||||
|
|
||||||
|
;; Auto-completion for C/C++ headers.
|
||||||
|
|
||||||
|
(elpaca-setup company-c-headers
|
||||||
|
(:when-loaded (add-to-list 'company-backends 'company-c-headers)))
|
||||||
|
|
||||||
|
;; GLSL integration with company requires the package: ~glslang~.
|
||||||
|
|
||||||
|
(when (executable-find "glslangValidator")
|
||||||
|
(elpaca-setup company-glsl
|
||||||
|
(:when-loaded (add-to-list 'company-backends 'company-glsl))))
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Git
|
||||||
|
|
||||||
|
(elpaca-setup diff-hl
|
||||||
|
(:require diff-hl)
|
||||||
|
(:with-mode prog-mode
|
||||||
|
(:hook turn-on-diff-hl-mode)
|
||||||
|
(:hook dot/diff-hl-enable-flydiff-and-fringe))
|
||||||
|
(:when-loaded
|
||||||
|
|
||||||
|
(defun dot/diff-hl-enable-flydiff-and-fringe ()
|
||||||
|
"Enable on the fly diff checking if file is under version control."
|
||||||
|
(let ((buffer buffer-file-name))
|
||||||
|
(when (and buffer (vc-registered buffer))
|
||||||
|
(diff-hl-flydiff-mode)
|
||||||
|
(dot/toggle-fringe 1))))))
|
||||||
|
|
||||||
|
(elpaca-setup transient
|
||||||
|
(:when-loaded
|
||||||
|
(setq transient-history-file (expand-file-name "transient/history.el" dot-cache-dir))
|
||||||
|
(setq transient-values-file (expand-file-name "transient/values.el" dot-cache-dir))))
|
||||||
|
|
||||||
|
(elpaca-setup magit
|
||||||
|
(:autoload magit-status magit-status-here)
|
||||||
|
(:with-mode git-commit-setup
|
||||||
|
(:hook git-commit-turn-on-auto-fill)
|
||||||
|
(:hook git-commit-turn-on-flyspell))
|
||||||
|
(:with-mode magit-pre-refresh (:hook diff-hl-magit-pre-refresh))
|
||||||
|
(:with-mode magit-post-refresh (:hook diff-hl-magit-post-refresh))
|
||||||
|
(:load-after diff-hl transient)
|
||||||
|
(:when-loaded
|
||||||
|
(setq git-commit-fill-column 72)
|
||||||
|
(setq git-commit-summary-max-length 72)
|
||||||
|
(setq magit-completing-read-function #'completing-read)
|
||||||
|
(setq magit-diff-paint-whitespace-lines 'both)
|
||||||
|
(setq magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)
|
||||||
|
(setq magit-process-extreme-logging nil)
|
||||||
|
(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])
|
||||||
|
|
||||||
|
(defun dot/magit-select-repo ()
|
||||||
|
"Select project repo."
|
||||||
|
(interactive)
|
||||||
|
(let ((current-prefix-arg '(t)))
|
||||||
|
(call-interactively #'magit-status)))))
|
||||||
|
|
||||||
|
(elpaca-setup magit-todos
|
||||||
|
(:load-after magit)
|
||||||
|
(:when-loaded
|
||||||
|
(magit-todos-mode)))
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Project
|
||||||
|
|
||||||
|
;; Project manager.
|
||||||
|
|
||||||
|
;; Adding to project.el project directory detection
|
||||||
|
;; https://michael.stapelberg.ch/posts/2021-04-02-emacs-project-override/
|
||||||
|
|
||||||
|
(elpaca-nil (setup project ; built-in
|
||||||
|
(setq project-list-file (expand-file-name "projects" dot-cache-dir))
|
||||||
|
(:when-loaded
|
||||||
|
|
||||||
|
(defun dot/project-find (dir)
|
||||||
|
(let ((root (locate-dominating-file dir ".project")))
|
||||||
|
(and root (list 'vc 'Filewise root))))
|
||||||
|
(add-hook 'project-find-functions #'dot/project-find)
|
||||||
|
|
||||||
|
(defun dot/find-project-root ()
|
||||||
|
"Return root of the project, determined by `.git/' and `.project',
|
||||||
|
`default-directory' otherwise."
|
||||||
|
(let ((project (project-current)))
|
||||||
|
(if project
|
||||||
|
(project-root project)
|
||||||
|
default-directory)))
|
||||||
|
|
||||||
|
(defun dot/find-file-in-project-root ()
|
||||||
|
"Find file in project root."
|
||||||
|
(interactive)
|
||||||
|
(let ((default-directory (dot/find-project-root)))
|
||||||
|
(call-interactively 'find-file)))
|
||||||
|
|
||||||
|
(defun dot/project-remember-projects-under (dir maxdepth)
|
||||||
|
"Index all projects below directory DIR recursively, until MAXDEPTH."
|
||||||
|
(let ((files (mapcar 'file-name-directory
|
||||||
|
(dot/directory-files-recursively-depth
|
||||||
|
dir "\\.git$\\|\\.project$" t maxdepth))))
|
||||||
|
(dolist (path files)
|
||||||
|
(project-remember-projects-under path))))
|
||||||
|
|
||||||
|
(unless (file-exists-p project-list-file)
|
||||||
|
(project-remember-projects-under "~/dotfiles")
|
||||||
|
(dot/project-remember-projects-under "~/code" 4))
|
||||||
|
|
||||||
|
(defun dot/project-project-name ()
|
||||||
|
"Return project name."
|
||||||
|
(let ((project (project-current)))
|
||||||
|
(if project
|
||||||
|
(let* ((project (file-truename (directory-file-name (project-root (project-current)))))
|
||||||
|
(parent-dir-full (file-name-directory (directory-file-name project)))
|
||||||
|
(parent-dir (file-name-nondirectory (substring parent-dir-full 0 -1)))
|
||||||
|
(filename (file-name-nondirectory project)))
|
||||||
|
(concat filename "/" parent-dir))
|
||||||
|
"-")))
|
||||||
|
|
||||||
|
(defun dot/project-save-project-buffers ()
|
||||||
|
"Save all project buffers."
|
||||||
|
(interactive)
|
||||||
|
(let ((buffers (cl-remove-if (lambda (buffer) (not (buffer-file-name buffer)))
|
||||||
|
(project-buffers (project-current)))))
|
||||||
|
(save-some-buffers t (lambda () (member (current-buffer) buffers))))))))
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Compile
|
||||||
|
|
||||||
|
;; Enable color escape codes.
|
||||||
|
|
||||||
|
(elpaca-nil (setup ansi-color ; built-in
|
||||||
|
(:with-mode compilation-filter (:hook ansi-color-compilation-filter))
|
||||||
|
;; :hook (compilation-filter . ansi-color-compilation-filter)
|
||||||
|
(:when-loaded (setq ansi-color-bold-is-bright t))))
|
||||||
|
|
||||||
|
(elpaca-nil (setup compile ; built-in
|
||||||
|
(defun dot/compile-disable-underline () ""
|
||||||
|
(face-remap-add-relative 'underline :underline nil))
|
||||||
|
(:with-mode comint-mode (:hook dot/compile-disable-underline))
|
||||||
|
(:when-loaded
|
||||||
|
(setq compilation-scroll-output 'first-error)
|
||||||
|
|
||||||
|
(defun dot/compile ()
|
||||||
|
"Compile project."
|
||||||
|
(interactive)
|
||||||
|
(let ((default-directory (dot/find-project-root)))
|
||||||
|
(dot/project-save-project-buffers)
|
||||||
|
(let ((current-prefix-arg '(t)))
|
||||||
|
(call-interactively 'compile)))))))
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Languages
|
||||||
|
|
||||||
|
;;; Language Server Protocol
|
||||||
|
|
||||||
|
(elpaca-setup lsp-mode
|
||||||
|
(:autoload lsp-deferred)
|
||||||
|
;; (:require lsp-modeline lsp-mode)
|
||||||
|
(:with-mode
|
||||||
|
(c-mode ; clangd
|
||||||
|
c++-mode ; clangd
|
||||||
|
php-mode ; nodejs-intelephense
|
||||||
|
csharp-mode ; omnisharp-roslyn-bin
|
||||||
|
go-mode ; gopls
|
||||||
|
kotlin-mode ; kotlin-language-server
|
||||||
|
lua-mode ; lua-language-server
|
||||||
|
latex-mode ; texlab
|
||||||
|
swift-mode ; swift-bin
|
||||||
|
web-mode)
|
||||||
|
(:hook lsp-deferred))
|
||||||
|
(:when-loaded
|
||||||
|
(setq lsp-auto-guess-root t)
|
||||||
|
(setq lsp-clients-clangd-args '("-j=2"
|
||||||
|
"--background-index"
|
||||||
|
"--clang-tidy"
|
||||||
|
"--compile-commands-dir=build"
|
||||||
|
"--log=error"
|
||||||
|
"--header-insertion-decorators=0"
|
||||||
|
"--pch-storage=memory"
|
||||||
|
"--enable-config"))
|
||||||
|
(setq lsp-csharp-omnisharp-roslyn-binary-path "/usr/bin/omnisharp")
|
||||||
|
(setq lsp-csharp-server-install-dir "/usr/lib/omnisharp/")
|
||||||
|
(setq lsp-clients-lua-language-server-bin "/usr/bin/lua-language-server")
|
||||||
|
(setq lsp-clients-lua-language-server-install-dir "/usr/lib/lua-language-server/")
|
||||||
|
(setq lsp-clients-lua-language-server-main-location "/usr/lib/lua-language-server/main.lua")
|
||||||
|
(setq lsp-enable-xref t)
|
||||||
|
(setq lsp-headerline-breadcrumb-enable nil)
|
||||||
|
(setq lsp-intelephense-storage-path (expand-file-name "lsp-cache" dot-cache-dir))
|
||||||
|
(setq lsp-keep-workspace-alive nil)
|
||||||
|
;; (setq lsp-modeline-code-actions-enable nil)
|
||||||
|
;; (setq lsp-modeline-diagnostics-enable nil)
|
||||||
|
;; (setq lsp-modeline-workspace-status-enable nil)
|
||||||
|
(setq lsp-prefer-flymake nil)
|
||||||
|
(setq lsp-session-file (expand-file-name "lsp-session-v1" dot-cache-dir))
|
||||||
|
|
||||||
|
;; Mark clangd args variable as safe to modify via .dir-locals.el
|
||||||
|
(put 'lsp-clients-clangd-args 'safe-local-variable #'listp)
|
||||||
|
|
||||||
|
;; Enable which-key descriptions
|
||||||
|
(dolist (leader-key (list dot/leader-key dot/leader-alt-key))
|
||||||
|
(let ((lsp-keymap-prefix (concat leader-key " l")))
|
||||||
|
(lsp-enable-which-key-integration)))
|
||||||
|
|
||||||
|
(defun dot/lsp-format-buffer-or-region ()
|
||||||
|
"Format the selection (or buffer) with LSP."
|
||||||
|
(interactive)
|
||||||
|
(unless (bound-and-true-p lsp-mode)
|
||||||
|
(message "Not in an LSP buffer"))
|
||||||
|
(call-interactively
|
||||||
|
(if (use-region-p)
|
||||||
|
#'lsp-format-region
|
||||||
|
#'lsp-format-buffer)))
|
||||||
|
|
||||||
|
;; This is cached to prevent unneeded I/O
|
||||||
|
(setq lsp-in-cpp-project-cache nil)
|
||||||
|
(defun dot/lsp-format-cpp-buffer ()
|
||||||
|
"Format buffer in C++ projects."
|
||||||
|
(unless lsp-in-cpp-project-cache
|
||||||
|
(set (make-local-variable 'lsp-in-cpp-project-cache)
|
||||||
|
(list
|
||||||
|
(if (and (eq major-mode 'c++-mode)
|
||||||
|
(bound-and-true-p lsp-mode)
|
||||||
|
(or
|
||||||
|
(locate-dominating-file "." ".clang-format")
|
||||||
|
(locate-dominating-file "." "_clang-format")))
|
||||||
|
t
|
||||||
|
nil))))
|
||||||
|
(when (car lsp-in-cpp-project-cache)
|
||||||
|
(lsp-format-buffer)))
|
||||||
|
(add-hook 'before-save-hook #'dot/lsp-format-cpp-buffer)))
|
||||||
|
|
||||||
|
(elpaca-setup lsp-ui
|
||||||
|
(:autoload lsp-ui-mode)
|
||||||
|
(:load-after flycheck lsp-mode)
|
||||||
|
(:when-loaded
|
||||||
|
(setq lsp-ui-doc-border (face-foreground 'default))
|
||||||
|
(setq lsp-ui-doc-delay 0.5)
|
||||||
|
(setq lsp-ui-doc-enable t)
|
||||||
|
(setq lsp-ui-doc-header t)
|
||||||
|
(setq lsp-ui-doc-include-signature t)
|
||||||
|
(setq lsp-ui-doc-position 'top)
|
||||||
|
(setq lsp-ui-doc-use-childframe t)
|
||||||
|
(setq lsp-ui-flycheck-list-position 'right)
|
||||||
|
(setq lsp-ui-imenu-enable nil)
|
||||||
|
(setq lsp-ui-peek-enable nil)
|
||||||
|
(setq lsp-ui-sideline-enable nil)))
|
||||||
|
|
||||||
|
;;; Debug Adapter Protocol
|
||||||
|
|
||||||
|
(elpaca-setup treemacs
|
||||||
|
(:hook dot/hook-disable-line-numbers)
|
||||||
|
(:when-loaded (setq treemacs-persist-file (expand-file-name "treemacs/persist" dot-cache-dir))))
|
||||||
|
|
||||||
|
(elpaca-setup lsp-treemacs
|
||||||
|
(:load-after treemacs)
|
||||||
|
(:when-loaded (setq lsp-treemacs-error-list-current-project-only t)))
|
||||||
|
|
||||||
|
(elpaca-setup dap-mode
|
||||||
|
(:with-mode lsp-after-initialize (:hook dot/dap-install-debug-adapters))
|
||||||
|
(:load-after lsp-treemacs lsp-mode)
|
||||||
|
(:when-loaded
|
||||||
|
(setq dap-auto-configure-features '(sessions locals expressions controls tooltip))
|
||||||
|
(setq dap-breakpoints-file (expand-file-name "dap/breakpoints" dot-cache-dir))
|
||||||
|
(setq dap-utils-extension-path (expand-file-name "dap" dot-cache-dir))
|
||||||
|
|
||||||
|
;; Create dap extension directory
|
||||||
|
(unless (file-directory-p dap-utils-extension-path)
|
||||||
|
(make-directory dap-utils-extension-path t))
|
||||||
|
|
||||||
|
(defun dot/dap-install-debug-adapters ()
|
||||||
|
"Install and Load debug adapters."
|
||||||
|
(interactive)
|
||||||
|
(unless (bound-and-true-p lsp-mode)
|
||||||
|
(user-error "Not in an LSP buffer"))
|
||||||
|
(when (string-equal major-mode "c++-mode")
|
||||||
|
(require 'dap-cpptools)
|
||||||
|
(dap-cpptools-setup)))))
|
||||||
|
|
||||||
|
;;; C/C++
|
||||||
|
|
||||||
|
(elpaca-nil (setup c-mode ; built-in
|
||||||
|
;; C++ // line comment style in c-mode
|
||||||
|
(defun dot/c-mode-comment-style () ""
|
||||||
|
(c-toggle-comment-style -1))
|
||||||
|
(:hook dot/c-mode-comment-style)))
|
||||||
|
|
||||||
|
;;; C#
|
||||||
|
|
||||||
|
;; Packages:
|
||||||
|
;; - dotnet-host
|
||||||
|
;; - dotnet-runtime-6.0
|
||||||
|
;; - dotnet-sdk-6.0
|
||||||
|
;; - dotnet-targeting-pack-6.0
|
||||||
|
;; - omnisharp-roslyn-bin
|
||||||
|
;; - netcoredbg (edit PKGBUILD to detect dotnet -6.0 dependencies)
|
||||||
|
|
||||||
|
(elpaca-nil (setup csharp-mode)) ; built-in
|
||||||
|
|
||||||
|
;;; CMake
|
||||||
|
|
||||||
|
(elpaca-setup cmake-mode
|
||||||
|
(:defer 2)
|
||||||
|
(:when-loaded (setq cmake-tab-width (default-value 'tab-width))))
|
||||||
|
|
||||||
|
;;; Emacs Lisp
|
||||||
|
|
||||||
|
(elpaca-nil (setup emacs-lisp ; built-in
|
||||||
|
(defun dot/elisp-init () ""
|
||||||
|
(setq-local indent-tabs-mode nil))
|
||||||
|
(:hook dot/elisp-init)))
|
||||||
|
|
||||||
|
;;; GLSL
|
||||||
|
|
||||||
|
(elpaca-setup glsl-mode)
|
||||||
|
|
||||||
|
;;; Golang
|
||||||
|
|
||||||
|
(elpaca-setup go-mode)
|
||||||
|
|
||||||
|
;;; HTML
|
||||||
|
|
||||||
|
(elpaca-setup web-mode
|
||||||
|
(:file-match "\\.ts")
|
||||||
|
(:file-match "\\.vue"))
|
||||||
|
|
||||||
|
;;; Kotlin
|
||||||
|
|
||||||
|
(elpaca-setup kotlin-mode)
|
||||||
|
|
||||||
|
;;; Lua
|
||||||
|
|
||||||
|
(elpaca-setup lua-mode
|
||||||
|
(:when-loaded (setq lua-indent-level (default-value 'tab-width))))
|
||||||
|
|
||||||
|
;;; PHP
|
||||||
|
|
||||||
|
(elpaca-setup php-mode
|
||||||
|
(defun dot/php-mode-init () ""
|
||||||
|
(setq-local indent-tabs-mode t))
|
||||||
|
(:hook dot/php-mode-init))
|
||||||
|
|
||||||
|
(elpaca-setup restclient)
|
||||||
|
(elpaca-setup restclient-jq
|
||||||
|
(:load-after restclient))
|
||||||
|
|
||||||
|
;;; Python
|
||||||
|
|
||||||
|
(elpaca-nil (setup python-mode ; built-in
|
||||||
|
(defun dot/python-mode-init () ""
|
||||||
|
(setq-local indent-tabs-mode t)
|
||||||
|
(setq-local tab-width (default-value 'tab-width))
|
||||||
|
(setq python-indent-offset (default-value 'tab-width)))
|
||||||
|
(:hook dot/python-mode-init)))
|
||||||
|
|
||||||
|
;;; Swift
|
||||||
|
|
||||||
|
(elpaca-setup swift-mode)
|
||||||
|
(elpaca-setup lsp-sourcekit
|
||||||
|
(:load-after lsp-mode)
|
||||||
|
(:when-loaded
|
||||||
|
(setq lsp-sourcekit-executable "/usr/bin/sourcekit-lsp")))
|
||||||
|
|
||||||
|
;;; YAML
|
||||||
|
|
||||||
|
(elpaca-setup yaml-mode)
|
||||||
|
;; :defer t)
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Syntax Highlighting
|
||||||
|
|
||||||
|
;; (elpaca-setup tree-sitter-langs))
|
||||||
|
|
||||||
|
;; (elpaca-setup tree-sitter)
|
||||||
|
;; (:also-load tree-sitter-langs)
|
||||||
|
;; (:when-loaded
|
||||||
|
;; (global-tree-sitter-mode)
|
||||||
|
;; (add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode)))
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Quality of Life
|
||||||
|
|
||||||
|
;;; Flycheck, on the fly syntax checking
|
||||||
|
|
||||||
|
(elpaca-setup flycheck
|
||||||
|
(:autoload flycheck-mode)
|
||||||
|
(:with-mode
|
||||||
|
(c-mode-common
|
||||||
|
emacs-lisp-mode
|
||||||
|
latex-mode
|
||||||
|
org-mode
|
||||||
|
php-mode
|
||||||
|
sh-mode
|
||||||
|
shell-mode
|
||||||
|
shell-script-mode)
|
||||||
|
(:hook flycheck-mode))
|
||||||
|
(:when-loaded
|
||||||
|
(setq flycheck-clang-language-standard "c++20")
|
||||||
|
(setq flycheck-gcc-language-standard "c++20")))
|
||||||
|
|
||||||
|
;; For .el files which are intended to be packages
|
||||||
|
(elpaca-setup flycheck-package
|
||||||
|
(:load-after flycheck)
|
||||||
|
(:when-loaded
|
||||||
|
(add-to-list 'flycheck-checkers 'flycheck-emacs-lisp-package)
|
||||||
|
(flycheck-package-setup)))
|
||||||
|
|
||||||
|
(elpaca-setup flycheck-clang-tidy
|
||||||
|
(:load-after flycheck)
|
||||||
|
(:with-mode flycheck-mode (:hook flycheck-clang-tidy-setup))
|
||||||
|
(:when-loaded (setq flycheck-clang-tidy-extra-options "--format-style=file")))
|
||||||
|
|
||||||
|
;;; Flyspell
|
||||||
|
|
||||||
|
(elpaca-nil (setup ispell ; built-in
|
||||||
|
(:when-loaded
|
||||||
|
(setq ispell-program-name "/usr/bin/hunspell")
|
||||||
|
(ispell-set-spellchecker-params)
|
||||||
|
(ispell-hunspell-add-multi-dic "en_US,nl_NL")
|
||||||
|
(setq ispell-dictionary "en_US,nl_NL"))))
|
||||||
|
|
||||||
|
;; Give Flyspell a selection menu.
|
||||||
|
(elpaca-setup flyspell-correct
|
||||||
|
(:load-after flyspell)
|
||||||
|
(:with-mode org-mode (:hook flyspell-mode))
|
||||||
|
(:when-loaded
|
||||||
|
(setq flyspell-issue-message-flag nil)
|
||||||
|
(setq flyspell-issue-welcome-flag nil))
|
||||||
|
|
||||||
|
(defun dot/flyspell-toggle ()
|
||||||
|
"Toggle Flyspell, prompt for language."
|
||||||
|
(interactive)
|
||||||
|
(if (symbol-value flyspell-mode)
|
||||||
|
(flyspell-mode -1)
|
||||||
|
(call-interactively 'ispell-change-dictionary)
|
||||||
|
(if (derived-mode-p 'prog-mode)
|
||||||
|
(flyspell-prog-mode)
|
||||||
|
(flyspell-mode))
|
||||||
|
(flyspell-buffer))))
|
||||||
|
|
||||||
|
;;; Rainbow Delimiters
|
||||||
|
|
||||||
|
(elpaca-setup rainbow-delimiters
|
||||||
|
(:hook-into prog-mode))
|
||||||
|
|
||||||
|
;;; Rainbow Mode
|
||||||
|
|
||||||
|
(elpaca-setup rainbow-mode
|
||||||
|
(:hook-into css-mode))
|
||||||
|
|
||||||
|
;;; YASnippet
|
||||||
|
|
||||||
|
(elpaca-setup yasnippet
|
||||||
|
(:autoload yas-expand yas-insert-snippet)
|
||||||
|
(setq yas-snippet-dirs (list (expand-file-name "snippets" dot-emacs-dir)))
|
||||||
|
(setq yas-prompt-functions '(yas-completing-prompt))
|
||||||
|
(:when-loaded
|
||||||
|
(yas-global-mode)))
|
||||||
|
|
||||||
|
(elpaca-setup yasnippet-snippets
|
||||||
|
(:load-after yasnippet))
|
||||||
|
|
||||||
|
;; https://stackoverflow.com/questions/22735895/configuring-a-yasnippet-for-two-scenarios-1-region-is-active-2-region-is
|
||||||
|
|
||||||
|
(provide 'dot-development)
|
||||||
|
|
||||||
|
;;; dot-org-mode.el ends here
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
;;; dot-elpaca.el --- -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; Elpaca bootstrap
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
|
||||||
|
;; Elpaca bootstrap
|
||||||
|
(defvar elpaca-installer-version 0.9)
|
||||||
|
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
|
||||||
|
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
|
||||||
|
(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory))
|
||||||
|
(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git"
|
||||||
|
:ref nil :depth 1 :inherit ignore
|
||||||
|
:files (:defaults "elpaca-test.el" (:exclude "extensions"))
|
||||||
|
:build (:not elpaca--activate-package)))
|
||||||
|
(let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory))
|
||||||
|
(build (expand-file-name "elpaca/" elpaca-builds-directory))
|
||||||
|
(order (cdr elpaca-order))
|
||||||
|
(default-directory repo))
|
||||||
|
(add-to-list 'load-path (if (file-exists-p build) build repo))
|
||||||
|
(unless (file-exists-p repo)
|
||||||
|
(make-directory repo t)
|
||||||
|
(when (< emacs-major-version 28) (require 'subr-x))
|
||||||
|
(condition-case-unless-debug err
|
||||||
|
(if-let* ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*"))
|
||||||
|
((zerop (apply #'call-process `("git" nil ,buffer t "clone"
|
||||||
|
,@(when-let* ((depth (plist-get order :depth)))
|
||||||
|
(list (format "--depth=%d" depth) "--no-single-branch"))
|
||||||
|
,(plist-get order :repo) ,repo))))
|
||||||
|
((zerop (call-process "git" nil buffer t "checkout"
|
||||||
|
(or (plist-get order :ref) "--"))))
|
||||||
|
(emacs (concat invocation-directory invocation-name))
|
||||||
|
((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch"
|
||||||
|
"--eval" "(byte-recompile-directory \".\" 0 'force)")))
|
||||||
|
((require 'elpaca))
|
||||||
|
((elpaca-generate-autoloads "elpaca" repo)))
|
||||||
|
(progn (message "%s" (buffer-string)) (kill-buffer buffer))
|
||||||
|
(error "%s" (with-current-buffer buffer (buffer-string))))
|
||||||
|
((error) (warn "%s" err) (delete-directory repo 'recursive))))
|
||||||
|
(unless (require 'elpaca-autoloads nil t)
|
||||||
|
(require 'elpaca)
|
||||||
|
(elpaca-generate-autoloads "elpaca" repo)
|
||||||
|
(load "./elpaca-autoloads")))
|
||||||
|
(add-hook 'after-init-hook #'elpaca-process-queues)
|
||||||
|
(elpaca `(,@elpaca-order))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defmacro elpaca-nil (body)
|
||||||
|
"Defer execution until all Elpaca queues have been processed."
|
||||||
|
(declare (indent 1))
|
||||||
|
`(add-hook 'elpaca-after-init-hook (lambda () (,@body)) 1))
|
||||||
|
|
||||||
|
;; Stop coping with startup time, its done loading when its done loading
|
||||||
|
(elpaca-nil (setq after-init-time (current-time)))
|
||||||
|
|
||||||
|
(provide 'dot-elpaca)
|
||||||
|
|
||||||
|
;;; dot-elpaca.el ends here
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
;;; dot-evil.el --- -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; Setup Evil and related packages.
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
|
||||||
|
(elpaca-setup undo-tree
|
||||||
|
(:when-loaded
|
||||||
|
(setq undo-tree-auto-save-history t)
|
||||||
|
(setq undo-tree-history-directory-alist `(("." . ,(expand-file-name "undo-tree" dot-cache-dir))))
|
||||||
|
(global-undo-tree-mode)))
|
||||||
|
|
||||||
|
(elpaca-setup goto-chg)
|
||||||
|
|
||||||
|
(elpaca-setup evil
|
||||||
|
(:also-load undo-tree goto-chg)
|
||||||
|
(setq evil-ex-complete-emacs-commands nil)
|
||||||
|
(setq evil-kill-on-visual-paste nil)
|
||||||
|
(setq evil-operator-state-cursor 'box) ; Do not set half cursor
|
||||||
|
(setq evil-search-module 'evil-search)
|
||||||
|
(setq evil-split-window-below t)
|
||||||
|
(setq evil-undo-system 'undo-tree)
|
||||||
|
(setq evil-vsplit-window-right t)
|
||||||
|
(setq evil-want-C-u-scroll t)
|
||||||
|
(setq evil-want-Y-yank-to-eol t)
|
||||||
|
(setq evil-want-integration t)
|
||||||
|
(setq evil-want-keybinding nil) ; Needed by evil-collection
|
||||||
|
(:require evil)
|
||||||
|
(:when-loaded
|
||||||
|
|
||||||
|
;; Put search results in the center of the window
|
||||||
|
(defun dot/evil-scroll-center (&rest _)
|
||||||
|
"Scroll cursor to center of the window."
|
||||||
|
(evil-scroll-line-to-center nil))
|
||||||
|
(advice-add 'evil-ex-search :after #'dot/evil-scroll-center)
|
||||||
|
(advice-add 'evil-match :after #'dot/evil-scroll-center)
|
||||||
|
|
||||||
|
(defun dot/evil-normal-sort-paragraph ()
|
||||||
|
"Sort paragraph cursor is under.
|
||||||
|
Vim equivalence: vip:sort<CR>"
|
||||||
|
(interactive)
|
||||||
|
(let ((p (point)))
|
||||||
|
(evil-visual-char)
|
||||||
|
(call-interactively 'evil-inner-paragraph)
|
||||||
|
(evil-ex-sort (region-beginning) (region-end))
|
||||||
|
(goto-char p)))
|
||||||
|
|
||||||
|
(defun dot/evil-insert-shift-left ()
|
||||||
|
"Shift line left, retains cursor position.
|
||||||
|
Vim equivalence: <C-D>"
|
||||||
|
(interactive)
|
||||||
|
(evil-shift-left-line 1))
|
||||||
|
|
||||||
|
(defun dot/evil-insert-shift-right ()
|
||||||
|
"Shift line right, retains cursor position.
|
||||||
|
Vim equivalence: <Tab>"
|
||||||
|
(interactive)
|
||||||
|
(unless (yas-expand)
|
||||||
|
(insert "\t")))
|
||||||
|
|
||||||
|
|
||||||
|
(defun dot/evil-visual-shift-left ()
|
||||||
|
"Shift visual selection left, retains the selection.
|
||||||
|
Vim equivalence: <gv"
|
||||||
|
(interactive)
|
||||||
|
(call-interactively #'evil-shift-left)
|
||||||
|
(setq deactivate-mark nil))
|
||||||
|
|
||||||
|
(defun dot/evil-visual-shift-right ()
|
||||||
|
"Shift visual selection left, retains the selection.
|
||||||
|
Vim equivalence: >gv"
|
||||||
|
(interactive)
|
||||||
|
(call-interactively #'evil-shift-right)
|
||||||
|
(setq deactivate-mark nil))
|
||||||
|
|
||||||
|
(evil-mode)))
|
||||||
|
|
||||||
|
;; Evil command aliases.
|
||||||
|
|
||||||
|
(elpaca-nil (setup evil-ex ; evil-ex.el is part of evil
|
||||||
|
(:when-loaded
|
||||||
|
(evil-ex-define-cmd "W" "w")
|
||||||
|
(evil-ex-define-cmd "Q" "q")
|
||||||
|
(evil-ex-define-cmd "WQ" "wq")
|
||||||
|
(evil-ex-define-cmd "Wq" "wq"))))
|
||||||
|
|
||||||
|
(elpaca-setup evil-collection
|
||||||
|
(setq evil-collection-company-use-tng nil)
|
||||||
|
(setq evil-collection-key-blacklist (list dot/leader-key dot/localleader-key
|
||||||
|
dot/leader-alt-key dot/localleader-alt-key
|
||||||
|
"M-h" "M-j" "M-k" "M-l"))
|
||||||
|
(setq evil-collection-setup-minibuffer t)
|
||||||
|
(:load-after evil)
|
||||||
|
(:when-loaded
|
||||||
|
(evil-collection-init)))
|
||||||
|
|
||||||
|
(elpaca-setup evil-nerd-commenter
|
||||||
|
(:load-after evil))
|
||||||
|
|
||||||
|
(provide 'dot-evil)
|
||||||
|
|
||||||
|
;;; dot-evil.el ends here
|
||||||
@@ -0,0 +1,673 @@
|
|||||||
|
;;; dot-keybinds.el --- -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; All keybinds.
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Useful links
|
||||||
|
|
||||||
|
;; Mastering Emacs key bindings
|
||||||
|
;; https://www.masteringemacs.org/article/mastering-key-bindings-emacs
|
||||||
|
|
||||||
|
;; use-package bind key
|
||||||
|
;; https://github.com/jwiegley/use-package/blob/master/bind-key.el
|
||||||
|
|
||||||
|
;; GNU remapping commands
|
||||||
|
;; https://www.gnu.org/software/emacs/manual/html_node/elisp/Remapping-Commands.html
|
||||||
|
|
||||||
|
;; GNU binding combinations of modifiers
|
||||||
|
;; https://www.gnu.org/software/emacs/manual/html_node/efaq/Binding-combinations-of-modifiers-and-function-keys.html
|
||||||
|
|
||||||
|
;; Doom Emacs bindings
|
||||||
|
;; https://github.com/hlissner/doom-emacs/blob/develop/modules/config/default/+evil-bindings.el
|
||||||
|
|
||||||
|
;; Keybindings and States
|
||||||
|
;; https://github.com/noctuid/evil-guide#keybindings-and-states
|
||||||
|
|
||||||
|
;; General.el
|
||||||
|
;; https://github.com/noctuid/general.el
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Disable Native
|
||||||
|
|
||||||
|
;; Disable keybinds of native modes that clash with other custom keybinds.
|
||||||
|
|
||||||
|
(elpaca-nil (setup emacs
|
||||||
|
(:global
|
||||||
|
"M-h" nil
|
||||||
|
"M-j" nil
|
||||||
|
"M-k" nil
|
||||||
|
"M-l" nil
|
||||||
|
"<pinch>" nil ; Do not scale text when pinching touchpad
|
||||||
|
)))
|
||||||
|
|
||||||
|
(elpaca-nil (setup org
|
||||||
|
(:bind "M-h" nil
|
||||||
|
"C-M-h" nil
|
||||||
|
)))
|
||||||
|
|
||||||
|
(elpaca-nil (setup cc-mode
|
||||||
|
(:bind-into c-mode-base-map
|
||||||
|
"M-j" nil
|
||||||
|
"C-M-h" nil
|
||||||
|
)))
|
||||||
|
|
||||||
|
(elpaca-nil (setup nxml-mode
|
||||||
|
(:bind "M-h" nil
|
||||||
|
)))
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Disable Package
|
||||||
|
|
||||||
|
;; Disable keybinds of installed packages that clash with other custom keybinds.
|
||||||
|
|
||||||
|
(elpaca-nil (setup evil-states
|
||||||
|
(:bind-into evil-motion-state-map dot/leader-key nil
|
||||||
|
)))
|
||||||
|
|
||||||
|
(elpaca-nil (setup magit
|
||||||
|
(:evil-bind normal
|
||||||
|
;; Do not close magit when pressing escape
|
||||||
|
"<escape>" nil)))
|
||||||
|
|
||||||
|
(elpaca-nil (setup php-mode
|
||||||
|
(:bind "M-j" nil
|
||||||
|
"C-M-h" nil
|
||||||
|
)))
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Set Native
|
||||||
|
|
||||||
|
;; Set keybinds to native functionality.
|
||||||
|
|
||||||
|
;;; Set Native Global Keybinds
|
||||||
|
|
||||||
|
(elpaca-nil (setup emacs
|
||||||
|
(:global
|
||||||
|
;; Buffers
|
||||||
|
"C-x C-b" ibuffer
|
||||||
|
"M-w" kill-buffer-and-window
|
||||||
|
|
||||||
|
;; Config edit/reload
|
||||||
|
"C-c r" dot/config-reload
|
||||||
|
"C-c v" dot/config-visit
|
||||||
|
|
||||||
|
;; Find file
|
||||||
|
"C-x C-f" dot/find-file-in-project-root
|
||||||
|
|
||||||
|
;; Split and follow window
|
||||||
|
"C-x 2" split-follow-horizontally
|
||||||
|
"C-x 3" split-follow-vertically
|
||||||
|
|
||||||
|
;; Terminal
|
||||||
|
"<s-backspace>" ansi-term
|
||||||
|
|
||||||
|
;; Universal prefix argument
|
||||||
|
"C-M-u" universal-argument
|
||||||
|
)))
|
||||||
|
|
||||||
|
;;; Set Native Mode Keybinds
|
||||||
|
|
||||||
|
;; Dired
|
||||||
|
(elpaca-nil (setup dired
|
||||||
|
(:bind
|
||||||
|
[remap dired-find-file] dot/dired-find-file
|
||||||
|
[remap dired-up-directory] dot/dired-up-directory
|
||||||
|
)))
|
||||||
|
|
||||||
|
;; Org
|
||||||
|
(elpaca-nil (setup org
|
||||||
|
(:bind "M-c" org-edit-special
|
||||||
|
)))
|
||||||
|
(elpaca-nil (setup org-src
|
||||||
|
(:bind "M-c" org-edit-src-exit
|
||||||
|
"M-k" org-edit-src-abort
|
||||||
|
)))
|
||||||
|
(elpaca-nil (setup org-capture
|
||||||
|
(:bind "M-c" org-capture-finalize
|
||||||
|
"M-w" org-capture-refile
|
||||||
|
"M-k" org-capture-kill
|
||||||
|
)))
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Set Package
|
||||||
|
|
||||||
|
;; Set keybinds to functionality of installed packages.
|
||||||
|
|
||||||
|
(elpaca-nil (setup emacs
|
||||||
|
(:global
|
||||||
|
;; Buffers
|
||||||
|
"M-h" centaur-tabs-backward-tab
|
||||||
|
"M-j" centaur-tabs-forward-group
|
||||||
|
"M-k" centaur-tabs-backward-group
|
||||||
|
"M-l" centaur-tabs-forward-tab
|
||||||
|
"M-H" centaur-tabs-move-current-tab-to-left
|
||||||
|
"M-L" centaur-tabs-move-current-tab-to-right
|
||||||
|
"M-\`" evil-switch-to-windows-last-buffer
|
||||||
|
;; Other
|
||||||
|
"M-s" avy-goto-char-timer
|
||||||
|
"M-x" dot/M-x
|
||||||
|
)))
|
||||||
|
|
||||||
|
(elpaca-nil (setup company
|
||||||
|
(:bind-into company-active-map
|
||||||
|
;; Company completion selection
|
||||||
|
"M-n" nil
|
||||||
|
"M-p" nil
|
||||||
|
"M-h" company-abort
|
||||||
|
"M-j" company-select-next
|
||||||
|
"M-k" company-select-previous
|
||||||
|
"M-l" company-complete-selection
|
||||||
|
"<escape>" company-abort
|
||||||
|
)))
|
||||||
|
|
||||||
|
(elpaca-nil (setup evil-ex
|
||||||
|
(:bind-into evil-ex-completion-map
|
||||||
|
;; Evil command history selection
|
||||||
|
"M-h" abort-recursive-edit
|
||||||
|
"M-j" next-complete-history-element
|
||||||
|
"M-k" previous-complete-history-element
|
||||||
|
"M-l" exit-minibuffer
|
||||||
|
)))
|
||||||
|
|
||||||
|
(elpaca-nil (setup emacs
|
||||||
|
(:global
|
||||||
|
;; flyspell-correct
|
||||||
|
[remap ispell-word] flyspell-correct-at-point ; z=
|
||||||
|
|
||||||
|
;; Helpful overwrite default help functions
|
||||||
|
[remap describe-command] helpful-command
|
||||||
|
[remap describe-function] helpful-callable
|
||||||
|
[remap describe-key] helpful-key
|
||||||
|
[remap describe-symbol] helpful-at-point
|
||||||
|
[remap describe-variable] helpful-variable
|
||||||
|
)
|
||||||
|
(setup which-key
|
||||||
|
(:when-loaded
|
||||||
|
(which-key-add-key-based-replacements "C-h o" "describe-symbol-at-point")))))
|
||||||
|
|
||||||
|
;; LSP
|
||||||
|
(elpaca-nil (setup lsp-mode
|
||||||
|
(:bind-into lsp-signature-mode-map
|
||||||
|
"M-j" lsp-signature-next
|
||||||
|
"M-k" lsp-signature-previous
|
||||||
|
)))
|
||||||
|
|
||||||
|
;; Magit
|
||||||
|
(elpaca-nil (setup magit
|
||||||
|
(:bind-into magit-log-select-mode-map
|
||||||
|
"M-c" magit-log-select-pick
|
||||||
|
"M-k" magit-log-select-quit
|
||||||
|
)))
|
||||||
|
|
||||||
|
;; Org-roam
|
||||||
|
(elpaca-nil (setup org-roam
|
||||||
|
(:bind [down-mouse-1] org-roam-visit-thing
|
||||||
|
)))
|
||||||
|
|
||||||
|
;; Minibuffer completion selection
|
||||||
|
(elpaca-nil (setup minibuffer
|
||||||
|
(:bind-into minibuffer-local-map
|
||||||
|
"M-J" next-history-element
|
||||||
|
"M-K" previous-history-element
|
||||||
|
"M-h" abort-recursive-edit
|
||||||
|
"M-i" vertico-quick-insert
|
||||||
|
"M-j" vertico-next
|
||||||
|
"M-k" vertico-previous
|
||||||
|
"M-l" vertico-exit
|
||||||
|
"M-m" vertico-quick-exit
|
||||||
|
"<backspace>" dot/vertico-backspace
|
||||||
|
"<S-backspace>" evil-delete-backward-char-and-join
|
||||||
|
)))
|
||||||
|
|
||||||
|
;; with-editor
|
||||||
|
(elpaca-nil (setup with-editor
|
||||||
|
(:bind
|
||||||
|
"M-c" with-editor-finish
|
||||||
|
"M-k" with-editor-cancel
|
||||||
|
)))
|
||||||
|
|
||||||
|
;;; Global evil keymap
|
||||||
|
|
||||||
|
(elpaca-nil (setup evil
|
||||||
|
(:bind-into evil-normal-state-map
|
||||||
|
"C-n" neotree-toggle-in-project-root
|
||||||
|
"C-S-p" evil-paste-pop-next
|
||||||
|
"S-<up>" scroll-down-line
|
||||||
|
"S-<down>" scroll-up-line
|
||||||
|
)
|
||||||
|
|
||||||
|
(:bind-into evil-insert-state-map
|
||||||
|
"<backtab>" dot/evil-insert-shift-left ; <S-Tab>
|
||||||
|
"TAB" dot/evil-insert-shift-right ; <Tab>
|
||||||
|
)
|
||||||
|
|
||||||
|
(:bind-into evil-visual-state-map
|
||||||
|
"<" dot/evil-visual-shift-left ; <gv
|
||||||
|
">" dot/evil-visual-shift-right ; >gv
|
||||||
|
)
|
||||||
|
|
||||||
|
(:bind-into evil-ex-map
|
||||||
|
"e" dot/find-file-in-project-root
|
||||||
|
)))
|
||||||
|
|
||||||
|
;;; Other evil state-related keybinds
|
||||||
|
|
||||||
|
;; Custom (M-x customize)
|
||||||
|
(elpaca-nil (setup cus-edit
|
||||||
|
(:evil-bind-into normal custom-mode-map
|
||||||
|
[down-mouse-1] widget-button-click
|
||||||
|
)))
|
||||||
|
|
||||||
|
;; Dashboard
|
||||||
|
(elpaca-nil (setup dashboard
|
||||||
|
(:evil-bind normal
|
||||||
|
[down-mouse-1] widget-button-click
|
||||||
|
"g" dashboard-refresh-buffer
|
||||||
|
"m" dot/dashboard-goto-bookmarks
|
||||||
|
"p" dot/dashboard-goto-projects
|
||||||
|
"r" dot/dashboard-goto-recent-files
|
||||||
|
)))
|
||||||
|
|
||||||
|
;; Dap
|
||||||
|
(elpaca-nil (setup dap-ui
|
||||||
|
(:evil-bind-into normal dap-ui-session-mode-map
|
||||||
|
"D" dap-ui-delete-session
|
||||||
|
)))
|
||||||
|
|
||||||
|
;; Deft
|
||||||
|
(elpaca-nil (setup deft
|
||||||
|
(:evil-bind normal
|
||||||
|
[down-mouse-1] widget-button-click
|
||||||
|
"+" deft-new-file-named
|
||||||
|
"-" deft-new-file
|
||||||
|
"a" deft-archive-file
|
||||||
|
"c" deft-filter-clear
|
||||||
|
"d" deft-delete-file
|
||||||
|
"f" deft-find-file
|
||||||
|
"g" deft-refresh
|
||||||
|
"q" kill-this-buffer
|
||||||
|
"R" deft-rename-file
|
||||||
|
"s" deft-filter
|
||||||
|
"ts" '("Toggle search" . deft-toggle-incremental-search) ; which-key
|
||||||
|
"tt" '("Toggle sort" . deft-toggle-sort-method) ; custom string
|
||||||
|
)))
|
||||||
|
|
||||||
|
;; Elfeed
|
||||||
|
(elpaca-nil (setup elfeed
|
||||||
|
(:evil-bind-into normal elfeed-search-mode-map
|
||||||
|
"b" elfeed-search-browse-url
|
||||||
|
"c" elfeed-search-clear-filter
|
||||||
|
"gr" '("Refresh buffer" . elfeed-search-update--force)
|
||||||
|
"gR" '("Update feeds" . elfeed-search-fetch)
|
||||||
|
"q" elfeed-search-quit-window
|
||||||
|
"u" elfeed-search-tag-all-unread
|
||||||
|
"U" nil
|
||||||
|
"r" elfeed-search-untag-all-unread
|
||||||
|
)
|
||||||
|
(:evil-bind-into normal elfeed-show-mode-map
|
||||||
|
"b" elfeed-show-visit
|
||||||
|
"g" elfeed-show-refresh
|
||||||
|
"q" elfeed-kill-buffer
|
||||||
|
"u" elfeed-show-tag--unread
|
||||||
|
"y" elfeed-show-yank
|
||||||
|
)))
|
||||||
|
|
||||||
|
;; Magit
|
||||||
|
(elpaca-nil (setup magit
|
||||||
|
(:evil-bind (normal visual)
|
||||||
|
"{" magit-section-backward-sibling
|
||||||
|
"}" magit-section-forward-sibling
|
||||||
|
)))
|
||||||
|
|
||||||
|
;; Minibuffer
|
||||||
|
(elpaca-nil (setup minibuffer
|
||||||
|
(:evil-bind-into normal minibuffer-local-map
|
||||||
|
"TAB" vertico-insert
|
||||||
|
"j" vertico-next
|
||||||
|
"k" vertico-previous
|
||||||
|
"<up>" vertico-previous
|
||||||
|
"<down>" vertico-next
|
||||||
|
)
|
||||||
|
(:evil-bind-into insert minibuffer-local-map
|
||||||
|
"TAB" vertico-insert
|
||||||
|
)))
|
||||||
|
|
||||||
|
;; Mu4e
|
||||||
|
(elpaca-nil (setup mu4e
|
||||||
|
(:evil-bind-into normal mu4e-compose-mode-map
|
||||||
|
"q" mu4e-message-kill-buffer
|
||||||
|
"M-c" message-send-and-exit
|
||||||
|
"M-k" mu4e-message-kill-buffer
|
||||||
|
)))
|
||||||
|
|
||||||
|
;; Neotree
|
||||||
|
(elpaca-nil (setup neotree
|
||||||
|
(:evil-bind normal
|
||||||
|
"RET" neotree-enter
|
||||||
|
"<backtab>" neotree-collapse-all ; <S-tab>
|
||||||
|
"c" neotree-create-node
|
||||||
|
"r" neotree-rename-node
|
||||||
|
"d" neotree-delete-node
|
||||||
|
"h" neotree-select-previous-sibling-node
|
||||||
|
"g" neotree-refresh
|
||||||
|
"j" neotree-next-line
|
||||||
|
"k" neotree-previous-line
|
||||||
|
"l" neotree-enter
|
||||||
|
"C" neotree-change-root
|
||||||
|
"H" neotree-hidden-file-toggle
|
||||||
|
"q" neotree-hide
|
||||||
|
)))
|
||||||
|
|
||||||
|
;; Org
|
||||||
|
(elpaca-nil (setup org
|
||||||
|
(:evil-bind normal
|
||||||
|
"RET" dot/org-ret-at-point
|
||||||
|
)
|
||||||
|
(:evil-bind insert
|
||||||
|
"RET" evil-ret
|
||||||
|
)
|
||||||
|
(:evil-bind-into motion org-agenda-mode-map
|
||||||
|
"RET" org-agenda-switch-to
|
||||||
|
)))
|
||||||
|
|
||||||
|
;; Wdired
|
||||||
|
(elpaca-nil (setup wdired
|
||||||
|
(:evil-bind (normal insert)
|
||||||
|
"M-c" wdired-finish-edit
|
||||||
|
"M-k" wdired-abort-changes
|
||||||
|
)))
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Set leader key
|
||||||
|
|
||||||
|
;; General.el ~leader key binds.
|
||||||
|
|
||||||
|
;;; Global Leader
|
||||||
|
|
||||||
|
(elpaca-nil (setup general
|
||||||
|
(:when-loaded
|
||||||
|
(general-create-definer space-leader
|
||||||
|
:prefix dot/leader-key
|
||||||
|
:non-normal-prefix dot/leader-alt-key
|
||||||
|
:global-prefix dot/leader-alt-key
|
||||||
|
:states '(normal visual insert motion emacs)
|
||||||
|
:keymaps 'override) ; prevent leader keybindings from ever being overridden
|
||||||
|
|
||||||
|
(space-leader
|
||||||
|
"SPC" '(dot/M-x :which-key "Execute command")
|
||||||
|
"RET" '(consult-bookmark :which-key "Go to bookmark")
|
||||||
|
|
||||||
|
;; Apps
|
||||||
|
"a" '(:ignore t :which-key "apps")
|
||||||
|
"a d" '(deft :which-key "Deft")
|
||||||
|
"a e" '(elfeed :which-key "Elfeed")
|
||||||
|
|
||||||
|
;; Buffer / bookmark
|
||||||
|
"b" '(:ignore t :which-key "buffer/bookmark")
|
||||||
|
"b a" '(auto-revert-mode :which-key "Auto revert buffer")
|
||||||
|
"b b" '(consult-buffer :which-key "Switch buffer")
|
||||||
|
"b d" '(dashboard-refresh-buffer :which-key "Dashboard")
|
||||||
|
"b k" '(kill-current-buffer :which-key "Kill buffer")
|
||||||
|
"b m" '(bookmark-set :which-key "Make bookmark")
|
||||||
|
"b n" '(evil-buffer-new :which-key "New empty buffer")
|
||||||
|
"b r" '(revert-buffer :which-key "Revert buffer")
|
||||||
|
"b s" '(basic-save-buffer :which-key "Save buffer")
|
||||||
|
"b B" '(ibuffer :which-key "List buffers")
|
||||||
|
"b C" '(dot/centaur-tabs-buffer-cleanup :which-key "Cleanup buffers")
|
||||||
|
"b M" '(bookmark-delete :which-key "Delete bookmark")
|
||||||
|
"b S" '(evil-write-all :which-key "Save all buffers")
|
||||||
|
"b <left>" '(previous-buffer :which-key "Previous buffer")
|
||||||
|
"b <right>" '(next-buffer :which-key "Next buffer")
|
||||||
|
|
||||||
|
;; Comments
|
||||||
|
"c" '(:ignore t :which-key "comment/config")
|
||||||
|
"c c" '(evilnc-comment-or-uncomment-lines :which-key "Toggle comment")
|
||||||
|
"c p" '(evilnc-comment-or-uncomment-paragraphs :which-key "Toggle comment paragraph")
|
||||||
|
"c y" '(evilnc-comment-and-kill-ring-save :which-key "Comment and copy")
|
||||||
|
|
||||||
|
;; Elisp
|
||||||
|
"e" '(:ignore t :which-key "elisp")
|
||||||
|
"e ;" '(eval-expression :which-key "Evaluate expression")
|
||||||
|
"e b" '(eval-buffer :which-key "Evaluate buffer")
|
||||||
|
"e e" '(eval-last-sexp :which-key "Evaluate last sexp")
|
||||||
|
"e r" '(eval-region :which-key "Evaluate region")
|
||||||
|
"e t" '(dot/reload-theme :which-key "Reload theme")
|
||||||
|
|
||||||
|
;; File
|
||||||
|
"f" '(:ignore t :which-key "file")
|
||||||
|
"f d" '(dired :which-key "Find directory")
|
||||||
|
"f f" '(dot/find-file-in-project-root :which-key "Find file")
|
||||||
|
"f o" '(ff-find-other-file :which-key "Find header/source file")
|
||||||
|
"f r" '(consult-recent-file :which-key "Find recent file")
|
||||||
|
"f R" '(rename-file-and-buffer :which-key "Rename file")
|
||||||
|
"f s" '(basic-save-buffer :which-key "Save file")
|
||||||
|
"f S" '(write-file :which-key "Save file as...")
|
||||||
|
"f u" '(dot/sudo-find-file :which-key "Sudo find file")
|
||||||
|
"f U" '(dot/sudo-this-file :which-key "Sudo this file")
|
||||||
|
"f e" '(:ignore t :which-key "emacs")
|
||||||
|
"f e c" '(dot/config-visit :which-key "Config visit")
|
||||||
|
"f e f" '(dot/find-file-emacsd :which-key "Find emacs file")
|
||||||
|
"f e r" '(dot/config-reload :which-key "Config reload")
|
||||||
|
|
||||||
|
;; Go to
|
||||||
|
"g" '(:ignore t :which-key "goto")
|
||||||
|
"g b" '(consult-bookmark :which-key "Go to bookmark")
|
||||||
|
"g f" '(consult-flycheck :which-key "Go to flycheck error")
|
||||||
|
"g m" '(consult-mark :which-key "Go to marker")
|
||||||
|
|
||||||
|
;; Help
|
||||||
|
"h" '(:keymap help-map :which-key "help")
|
||||||
|
"h o" '(:ignore t :which-key "describe-symbol-at-point")
|
||||||
|
|
||||||
|
;; Insert
|
||||||
|
"i" '(:ignore t :which-key "insert")
|
||||||
|
"i b" '(dot/indent-buffer :which-key "Indent buffer")
|
||||||
|
"i f" '(fill-region :which-key "Reflow region")
|
||||||
|
"i F" '(fill-paragraph :which-key "Reflow paragraph")
|
||||||
|
"i r" '(indent-region :which-key "Indent region")
|
||||||
|
"i s" '(dot/evil-normal-sort-paragraph :which-key "Sort paragraph")
|
||||||
|
"i S" '(dot/insert-spaces-until-column :which-key "Insert spaces")
|
||||||
|
"i y" '(yas-insert-snippet :which-key "Insert yasnippet")
|
||||||
|
|
||||||
|
;; Notes
|
||||||
|
"n" '(:ignore t :which-key "notes")
|
||||||
|
"n a" '(org-agenda :which-key "Org agenda")
|
||||||
|
"n r" '(:ignore t :which-key "org-roam")
|
||||||
|
"n r c" '(org-roam-capture :which-key "Capture")
|
||||||
|
"n r C" '(org-roam-db-sync :which-key "Build cache")
|
||||||
|
"n r f" '(org-roam-node-find :which-key "Find node")
|
||||||
|
"n r g" '(org-roam-graph :which-key "Show graph")
|
||||||
|
"n r i" '(org-roam-node-insert :which-key "Insert")
|
||||||
|
"n r I" '(dot/org-roam-node-insert-immediate :which-key "Insert (without capture)")
|
||||||
|
"n r r" '(org-roam-buffer-toggle :which-key "Toggle buffer")
|
||||||
|
"n r s" '(org-roam-ui-mode :which-key "Toggle server")
|
||||||
|
|
||||||
|
;; Org
|
||||||
|
"o" '(:ignore t :which-key "org")
|
||||||
|
"o i" '(dot/org-clock-in :which-key "Clock in")
|
||||||
|
"o o" '(dot/org-clock-out :which-key "Clock out")
|
||||||
|
"o s" '(dot/org-switch-task :which-key "Switch task")
|
||||||
|
|
||||||
|
;; Project
|
||||||
|
"p" '(:keymap project-prefix-map :which-key "project")
|
||||||
|
"p b" '(consult-project-buffer :which-key "project-switch-buffer")
|
||||||
|
"p f" '(consult-project-extra-find :which-key "project-find-file")
|
||||||
|
"p g" '(consult-grep :which-key "project-find-regexp")
|
||||||
|
|
||||||
|
;; Quit
|
||||||
|
"q" '(:ignore t :which-key "quit")
|
||||||
|
"q q" '(save-buffers-kill-terminal :which-key "Quit Emacs")
|
||||||
|
"q Q" '(save-buffers-kill-emacs :which-key "Quit Emacs (and daemon)")
|
||||||
|
"q f" '(delete-frame :which-key "Close frame")
|
||||||
|
"q o" '(delete-other-frames :which-key "Close other frames")
|
||||||
|
|
||||||
|
;; Search
|
||||||
|
"s" '(:ignore t :which-key "search")
|
||||||
|
"s a" '(avy-goto-char-timer :which-key "Avy goto char")
|
||||||
|
"s f" '(consult-find :which-key "Search file")
|
||||||
|
"s l" '(avy-goto-line :which-key "Avy goto line")
|
||||||
|
"s p" '(consult-grep :which-key "Search project")
|
||||||
|
"s q" '(evil-ex-nohighlight :which-key "Stop search")
|
||||||
|
"s s" '(dot/consult-line-no-fuzzy :which-key "Search buffer")
|
||||||
|
"s S" '(consult-line-multi :which-key "Search all buffers")
|
||||||
|
|
||||||
|
;; Tabs / toggle
|
||||||
|
"t" '(:ignore t :which-key "tabs/toggle")
|
||||||
|
"t f" '(dot/toggle-fringe :which-key "Toggle fringe")
|
||||||
|
"t g" '(centaur-tabs-switch-group :which-key "Switch tab group")
|
||||||
|
"t h" '(centaur-tabs-backward-group :which-key "Tab backward group")
|
||||||
|
"t j" '(centaur-tabs-select-end-tab :which-key "Tab select first")
|
||||||
|
"t k" '(centaur-tabs-select-beg-tab :which-key "Tab select last")
|
||||||
|
"t l" '(centaur-tabs-forward-group :which-key "Tab forward group")
|
||||||
|
"t n" '(neotree-toggle-in-project-root :which-key "Toggle Neotree")
|
||||||
|
"t s" '(dot/flyspell-toggle :which-key "Toggle spell checker")
|
||||||
|
"t w" '(visual-line-mode :which-key "Toggle line wrapping")
|
||||||
|
|
||||||
|
;; Update packages
|
||||||
|
"U" '(elpaca-merge-all :which-key "Update packages")
|
||||||
|
|
||||||
|
;; Version control
|
||||||
|
"v" '(:ignore t :which-key "git")
|
||||||
|
"v b" '(magit-branch-checkout :which-key "Magit switch branch")
|
||||||
|
"v B" '(magit-blame-addition :which-key "Magit blame")
|
||||||
|
"v C" '(magit-clone :which-key "Magit clone")
|
||||||
|
"v F" '(magit-fetch :which-key "Magit fetch")
|
||||||
|
"v L" '(magit-log :which-key "Magit log")
|
||||||
|
"v s" '(magit-show-commit :which-key "Magit show commit")
|
||||||
|
"v S" '(magit-stage-file :which-key "Stage file")
|
||||||
|
"v U" '(magit-unstage-file :which-key "Unstage file")
|
||||||
|
"v v" '(magit-status :which-key "Magit status")
|
||||||
|
"v V" '(magit-status-here :which-key "Magit status here")
|
||||||
|
"v c" '(:ignore t :which-key "create")
|
||||||
|
"v c c" '(magit-commit-create :which-key "Commit")
|
||||||
|
"v c b" '(magit-branch-and-checkout :which-key "Branch")
|
||||||
|
"v c r" '(magit-init :which-key "Initialize repo")
|
||||||
|
"v f" '(:ignore t :which-key "file")
|
||||||
|
"v f c" '(magit-find-git-config-file :which-key "Find gitconfig file")
|
||||||
|
"v f D" '(magit-file-delete :which-key "Delete file")
|
||||||
|
"v f f" '(magit-find-file :which-key "Find file")
|
||||||
|
"v f R" '(magit-file-rename :which-key "Rename file")
|
||||||
|
"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")
|
||||||
|
"w +" '(evil-window-increase-height :which-key "Increase window height")
|
||||||
|
"w -" '(evil-window-decrease-height :which-key "Decrease window height")
|
||||||
|
"w <" '(evil-window-decrease-width :which-key "Decrease window width")
|
||||||
|
"w =" '(balance-windows :which-key "Balance windows")
|
||||||
|
"w >" '(evil-window-increase-width :which-key "Increase window width")
|
||||||
|
"w _" '(evil-window-set-height :which-key "Maximize window height")
|
||||||
|
"w h" '(windmove-left :which-key "Focus window left")
|
||||||
|
"w j" '(windmove-down :which-key "Focus window down")
|
||||||
|
"w k" '(windmove-up :which-key "Focus window up")
|
||||||
|
"w l" '(windmove-right :which-key "Focus window right")
|
||||||
|
"w o" '(delete-other-windows :which-key "Close other windows")
|
||||||
|
"w s" '(split-follow-horizontally :which-key "Split horizontal")
|
||||||
|
"w v" '(split-follow-vertically :which-key "Split vertical")
|
||||||
|
"w w" '(other-window :which-key "Focus other window")
|
||||||
|
"w q" '(dot/centaur-tabs-kill-buffer-or-window :which-key "Close window")
|
||||||
|
"w r" '(winner-redo :which-key "Redo window configuration")
|
||||||
|
"w u" '(winner-undo :which-key "Undo window configuration")
|
||||||
|
"w <left>" '(windmove-left :which-key "Focus window left")
|
||||||
|
"w <right>" '(windmove-right :which-key "Focus window right")
|
||||||
|
"w <up>" '(windmove-up :which-key "Focus window up")
|
||||||
|
"w <down>" '(windmove-down :which-key "Focus window down")
|
||||||
|
)
|
||||||
|
|
||||||
|
;; Evaluated keybinds.
|
||||||
|
|
||||||
|
(with-eval-after-load 'lsp-mode
|
||||||
|
(space-leader lsp-mode-map
|
||||||
|
"l" lsp-command-map
|
||||||
|
"l = f" '(dot/lsp-format-buffer-or-region :which-key "format buffer or region")
|
||||||
|
))
|
||||||
|
|
||||||
|
(with-eval-after-load 'dap-mode
|
||||||
|
(space-leader lsp-mode-map
|
||||||
|
"l d" '(dap-hydra :which-key "DAP hydra")
|
||||||
|
)))))
|
||||||
|
|
||||||
|
;; Source:
|
||||||
|
;; https://github.com/redguardtoo/emacs.d/blob/master/lisp/init-evil.el#L712
|
||||||
|
;; https://github.com/suyashbire1/emacs.d/blob/master/init.el
|
||||||
|
|
||||||
|
;;; Local Leader
|
||||||
|
|
||||||
|
(elpaca-nil (setup general
|
||||||
|
(:when-loaded
|
||||||
|
(general-create-definer local-leader
|
||||||
|
:prefix dot/localleader-key
|
||||||
|
:non-normal-prefix dot/localleader-alt-key
|
||||||
|
: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")
|
||||||
|
"o" '(org-open-at-point :which-key "Org open at point")
|
||||||
|
"q" '(org-set-tags-command :which-key "Org tags")
|
||||||
|
|
||||||
|
"g" '(:ignore t :which-key "goto")
|
||||||
|
"g o" '(consult-outline :which-key "Org go to heading")
|
||||||
|
|
||||||
|
"i" '(:ignore t :which-key "insert")
|
||||||
|
"i c" '(org-table-insert-column :which-key "Insert table column")
|
||||||
|
"i h" '(org-table-insert-hline :which-key "Insert table hline")
|
||||||
|
"i H" '(org-table-hline-and-move :which-key "Insert table hline and move")
|
||||||
|
"i r" '(org-table-insert-row :which-key "Insert table row")
|
||||||
|
"i t" '(org-insert-structure-template :which-key "Insert template")
|
||||||
|
|
||||||
|
"l" '(:ignore t :which-key "links")
|
||||||
|
"l i" '(org-id-store-link :which-key "Store ID link")
|
||||||
|
"l l" '(org-insert-link :which-key "Insert link")
|
||||||
|
"l s" '(org-store-link :which-key "Store link")
|
||||||
|
"l S" '(org-insert-last-stored-link :which-key "Insert stored link")
|
||||||
|
|
||||||
|
"s" '(:ignore t :which-key "tree/subtree")
|
||||||
|
"s h" '(org-promote-subtree :which-key "Org promote subtree")
|
||||||
|
"s j" '(org-metadown :which-key "Org move subtree down")
|
||||||
|
"s k" '(org-metaup :which-key "Org move subtree up")
|
||||||
|
"s l" '(org-demote-subtree :which-key "Org demote subtree")
|
||||||
|
"s <left>" '(org-promote-subtree :which-key "Org promote subtree")
|
||||||
|
"s <right>" '(org-demote-subtree :which-key "Org demote subtree")
|
||||||
|
"s <up>" '(org-move-subree-up :which-key "Org move subtree up")
|
||||||
|
"s <down>" '(org-move-subtree-down :which-key "Org move subtree down")
|
||||||
|
|
||||||
|
"t" '(:ignore t :which-key "toggle")
|
||||||
|
"t t" '(org-todo :which-key "Org todo state")
|
||||||
|
"t l" '(org-toggle-link-display :which-key "Org link display")
|
||||||
|
)
|
||||||
|
|
||||||
|
(local-leader org-src-mode-map
|
||||||
|
"k" '(org-edit-src-abort :which-key "Org Edit abort"))
|
||||||
|
|
||||||
|
(local-leader elfeed-search-mode-map
|
||||||
|
"g" '(elfeed-search-update--force :which-key "Elfeed refresh buffer")
|
||||||
|
"G" '(elfeed-search-fetch :which-key "Elfeed update feeds")
|
||||||
|
)
|
||||||
|
|
||||||
|
(local-leader elfeed-show-mode-map
|
||||||
|
"g" '(elfeed-show-refresh :which-key "Elfeed refresh buffer")
|
||||||
|
))))
|
||||||
|
|
||||||
|
;; c-fill-paragraph Reflow comment
|
||||||
|
;; https://youtu.be/hbmV1bnQ-i0?t=1910
|
||||||
|
|
||||||
|
(provide 'dot-keybinds)
|
||||||
|
|
||||||
|
;;; dot-keybinds.el ends here
|
||||||
@@ -0,0 +1,148 @@
|
|||||||
|
;;; dot-mail.el --- -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; Mail configuration.
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Mail Functions
|
||||||
|
|
||||||
|
(with-eval-after-load 'auth-source
|
||||||
|
(defun dot/mail-auth-get-field (host prop)
|
||||||
|
"Find PROP in `auth-sources' for HOST entry."
|
||||||
|
(when-let ((source (auth-source-search :max 1 :host host)))
|
||||||
|
(if (eq prop :secret)
|
||||||
|
(funcall (plist-get (car source) prop))
|
||||||
|
(plist-get (flatten-list source) prop)))))
|
||||||
|
|
||||||
|
;; Mail in Emacs with mu4e
|
||||||
|
|
||||||
|
;; Useful mu4e manual pages:
|
||||||
|
|
||||||
|
;; Key bindings
|
||||||
|
;; [https://www.djcbsoftware.nl/code/mu/mu4e/MSGV-Keybindings.html#MSGV-Keybindings]
|
||||||
|
|
||||||
|
(elpaca-nil (setup mu4e ; loaded from AUR package
|
||||||
|
(add-to-list 'load-path "/usr/share/emacs/site-lisp/mu4e")
|
||||||
|
(:autoload mu4e mu4e-update-index)
|
||||||
|
(:when-loaded
|
||||||
|
(add-to-list 'auth-sources (expand-file-name "authinfo.gpg" dot-etc-dir))
|
||||||
|
(setq user-full-name (dot/mail-auth-get-field "fullname" :user))
|
||||||
|
(setq user-mail-address (dot/mail-auth-get-field "info" :user))
|
||||||
|
(setq mail-user-agent 'mu4e-user-agent)
|
||||||
|
|
||||||
|
;; Headers
|
||||||
|
(setq mu4e-headers-date-format "%d-%m-%Y")
|
||||||
|
(setq mu4e-headers-time-format "%I:%M %p")
|
||||||
|
(setq mu4e-headers-long-date-format "%d-%m-%Y %I:%M:%S %p")
|
||||||
|
|
||||||
|
;; Syncing
|
||||||
|
(setq mu4e-get-mail-command (concat "mbsync -a -c " (expand-file-name "isync/mbsyncrc" (getenv "XDG_CONFIG_HOME"))))
|
||||||
|
(setq mu4e-update-interval (* 15 60)) ; 15 minutes
|
||||||
|
(setq mu4e-maildir "~/mail")
|
||||||
|
(setq mu4e-attachment-dir "~/downloads")
|
||||||
|
|
||||||
|
;; Avoid mail syncing issues when using mbsync
|
||||||
|
(setq mu4e-change-filenames-when-moving t)
|
||||||
|
|
||||||
|
;; Misc
|
||||||
|
(setq mu4e-completing-read-function 'completing-read)
|
||||||
|
(setq mu4e-confirm-quit nil)
|
||||||
|
(setq mu4e-display-update-status-in-modeline t)
|
||||||
|
(setq mu4e-hide-index-messages t)
|
||||||
|
(setq mu4e-sent-messages-behavior 'sent)
|
||||||
|
(setq mu4e-view-show-addresses t)
|
||||||
|
(setq mu4e-view-show-images nil)
|
||||||
|
|
||||||
|
;; Compose
|
||||||
|
(setq mu4e-compose-context-policy 'ask)
|
||||||
|
(setq mu4e-compose-dont-reply-to-self t)
|
||||||
|
(setq mu4e-compose-signature (concat (dot/mail-auth-get-field "fullname" :user) "\nriyyi.com\n"))
|
||||||
|
(setq mu4e-compose-signature-auto-include t)
|
||||||
|
|
||||||
|
;; Contexts
|
||||||
|
(setq mu4e-context-policy 'pick-first)
|
||||||
|
(setq mu4e-contexts
|
||||||
|
`(,(make-mu4e-context
|
||||||
|
:name "info"
|
||||||
|
:match-func (lambda (msg)
|
||||||
|
(when msg
|
||||||
|
(string= (mu4e-message-field msg :maildir) "/info")))
|
||||||
|
:vars `((user-mail-address . ,(dot/mail-auth-get-field "info" :user))
|
||||||
|
(mu4e-drafts-folder . "/info/Drafts")
|
||||||
|
(mu4e-refile-folder . "/info/Archive")
|
||||||
|
(mu4e-sent-folder . "/info/Sent")
|
||||||
|
(mu4e-trash-folder . "/info/Trash")))
|
||||||
|
,(make-mu4e-context
|
||||||
|
:name "private"
|
||||||
|
:match-func (lambda (msg)
|
||||||
|
(when msg
|
||||||
|
(string= (mu4e-message-field msg :maildir) "/private")))
|
||||||
|
:vars `((user-mail-address . ,(dot/mail-auth-get-field "private" :user))
|
||||||
|
(mu4e-drafts-folder . "/private/Drafts")
|
||||||
|
(mu4e-refile-folder . "/private/Archive")
|
||||||
|
(mu4e-sent-folder . "/private/Sent")
|
||||||
|
(mu4e-trash-folder . "/private/Trash")))
|
||||||
|
))
|
||||||
|
|
||||||
|
;; Do not mark messages as IMAP-deleted, just move them to the Trash directory!
|
||||||
|
;; https://github.com/djcb/mu/issues/1136#issuecomment-486177435
|
||||||
|
(setf (alist-get 'trash mu4e-marks)
|
||||||
|
(list :char '("d" . "▼")
|
||||||
|
:prompt "dtrash"
|
||||||
|
:dyn-target (lambda (target msg)
|
||||||
|
(mu4e-get-trash-folder msg))
|
||||||
|
:action (lambda (docid msg target)
|
||||||
|
(mu4e~proc-move docid (mu4e~mark-check-target target) "-N"))))
|
||||||
|
|
||||||
|
;; Start mu4e in the background for mail syncing
|
||||||
|
(mu4e t))))
|
||||||
|
|
||||||
|
;; Use mu4e-alert to show new e-mail notifications.
|
||||||
|
;; https://github.com/iqbalansari/mu4e-alert
|
||||||
|
|
||||||
|
(elpaca-setup mu4e-alert
|
||||||
|
(:defer 20)
|
||||||
|
(:when-loaded
|
||||||
|
(setq mu4e-alert-interesting-mail-query "(maildir:/info/Inbox OR maildir:/private/Inbox) AND flag:unread AND NOT flag:trashed")
|
||||||
|
(setq mu4e-alert-notify-repeated-mails nil)
|
||||||
|
|
||||||
|
(mu4e-alert-set-default-style 'libnotify)
|
||||||
|
(mu4e-alert-enable-notifications)))
|
||||||
|
|
||||||
|
;; Sending mail.
|
||||||
|
|
||||||
|
(elpaca-nil (setup smtpmail ; built-in
|
||||||
|
(setq smtpmail-default-smtp-server "mail.riyyi.com")
|
||||||
|
(:load-after mu4e)
|
||||||
|
(:when-loaded
|
||||||
|
(setq smtpmail-smtp-server "mail.riyyi.com")
|
||||||
|
(setq smtpmail-local-domain "riyyi.com")
|
||||||
|
(setq smtpmail-smtp-service 587)
|
||||||
|
(setq smtpmail-stream-type 'starttls)
|
||||||
|
(setq smtpmail-queue-mail nil))))
|
||||||
|
|
||||||
|
(elpaca-nil (setup sendmail ; built-in
|
||||||
|
(:load-after mu4e)
|
||||||
|
(:when-loaded (setq send-mail-function 'smtpmail-send-it))))
|
||||||
|
|
||||||
|
(elpaca-nil (setup message ; built-in
|
||||||
|
(:load-after mu4e)
|
||||||
|
(:when-loaded
|
||||||
|
(setq message-kill-buffer-on-exit t)
|
||||||
|
(setq message-send-mail-function 'smtpmail-send-it))))
|
||||||
|
|
||||||
|
;; Sources:
|
||||||
|
;; - https://rakhim.org/fastmail-setup-with-emacs-mu4e-and-mbsync-on-macos/
|
||||||
|
;; - https://wiki.archlinux.org/title/Isync
|
||||||
|
;; - https://man.archlinux.org/man/community/isync/mbsync.1.en
|
||||||
|
;; - https://gitlab.com/protesilaos/dotfiles/-/blob/master/mbsync/.mbsyncrc
|
||||||
|
;; - https://gitlab.com/protesilaos/dotfiles/-/blob/master/emacs/.emacs.d/prot-lisp/prot-mail.el
|
||||||
|
;; - https://gitlab.com/protesilaos/dotfiles/-/blob/master/emacs/.emacs.d/prot-lisp/prot-mu4e-deprecated-conf.el
|
||||||
|
;; - https://github.com/daviwil/dotfiles/blob/master/Mail.org
|
||||||
|
|
||||||
|
(provide 'dot-mail)
|
||||||
|
|
||||||
|
;;; dot-mail.el ends here
|
||||||
@@ -0,0 +1,352 @@
|
|||||||
|
;;; dot-org-mode.el --- -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; Load org-mode modules.
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; LaTeX Configuration
|
||||||
|
|
||||||
|
(elpaca-nil (setup tex-mode ; built-in
|
||||||
|
(:when-loaded
|
||||||
|
(defun dot/tex-mode-init () ""
|
||||||
|
(setq indent-tabs-mode t)
|
||||||
|
(setq tab-width 4)
|
||||||
|
(setq tex-indent-basic 4))
|
||||||
|
(:hook dot/tex-mode-init)
|
||||||
|
|
||||||
|
(with-eval-after-load 'project
|
||||||
|
(defun compile-latex ()
|
||||||
|
"Compile LaTeX project."
|
||||||
|
(interactive)
|
||||||
|
(let ((default-directory (dot/find-project-root)))
|
||||||
|
(dot/project-save-project-buffers)
|
||||||
|
(shell-command "make")))))))
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Org Configuration
|
||||||
|
|
||||||
|
;; Base Org.
|
||||||
|
|
||||||
|
(elpaca-nil (setup org ; built-in
|
||||||
|
(setq org-directory (expand-file-name "documents/org" (getenv "HOME")))
|
||||||
|
(setq org-default-notes-file (expand-file-name "notes.org" org-directory))
|
||||||
|
(:with-mode before-save
|
||||||
|
(:hook dot/org-set-last-modified))
|
||||||
|
(:when-loaded
|
||||||
|
(setq org-adapt-indentation nil)
|
||||||
|
(setq org-ellipsis "⤵")
|
||||||
|
(setq org-image-actual-width nil)
|
||||||
|
(setq org-startup-folded nil)
|
||||||
|
|
||||||
|
;; Enable structured template completion
|
||||||
|
(add-to-list 'org-modules 'org-tempo t)
|
||||||
|
(add-to-list 'org-structure-template-alist
|
||||||
|
'("el" . "src emacs-lisp"))
|
||||||
|
|
||||||
|
(defun dot/org-find-or-create-heading (heading level)
|
||||||
|
"Find or create heading"
|
||||||
|
(if (re-search-forward (format org-complex-heading-regexp-format
|
||||||
|
(regexp-quote heading))
|
||||||
|
nil t)
|
||||||
|
(beginning-of-line)
|
||||||
|
(goto-char (point-max))
|
||||||
|
(unless (bolp) (insert "\n"))
|
||||||
|
(insert (concat (make-string level ?*) " ") heading "\n")
|
||||||
|
(beginning-of-line 0)))
|
||||||
|
|
||||||
|
(defun dot/org-find-month-week-day ()
|
||||||
|
"Find or create the journal tree for the current week under current month"
|
||||||
|
(unless (derived-mode-p 'org-mode)
|
||||||
|
(error "Target buffer \"%s\" for dot/find-org-week should be in Org mode"
|
||||||
|
(current-buffer)))
|
||||||
|
(org-capture-put-target-region-and-position)
|
||||||
|
(widen)
|
||||||
|
(goto-char (point-min))
|
||||||
|
(dot/org-find-or-create-heading "Worklog" 1)
|
||||||
|
(org-narrow-to-subtree)
|
||||||
|
(dot/org-find-or-create-heading (format-time-string "%B") 2) ;; month
|
||||||
|
(org-narrow-to-subtree)
|
||||||
|
(dot/org-find-or-create-heading (format-time-string "Week %W") 3)
|
||||||
|
(org-narrow-to-subtree)
|
||||||
|
(dot/org-find-or-create-heading (format-time-string "%A") 4) ;; day
|
||||||
|
(org-end-of-subtree))
|
||||||
|
|
||||||
|
;; Capture templates
|
||||||
|
(setq org-capture-templates
|
||||||
|
`(("i" "Clock in" plain (file+function ,(expand-file-name "worklog.org" org-directory) dot/org-find-month-week-day)
|
||||||
|
"| %<%Y-%m-%d> | IN | %<%H:%M> | %^{Location|Office|Home|Office|Visit} |\n===================================%?"
|
||||||
|
:immediate-finish t)
|
||||||
|
("o" "Clock out" plain (file+function ,(expand-file-name "worklog.org" org-directory) dot/org-find-month-week-day)
|
||||||
|
"===================================\n| %<%Y-%m-%d> | OUT | %<%H:%M> |%?"
|
||||||
|
:immediate-finish t)
|
||||||
|
("s" "Switch task" plain (file+function ,(expand-file-name "worklog.org" org-directory) dot/org-find-month-week-day)
|
||||||
|
"| %<%Y-%m-%d> | %<%H:%M> | %^{Item ID} | X | %^{Description|-} |%?"
|
||||||
|
:immediate-finish t)))
|
||||||
|
|
||||||
|
;; Keybind functions
|
||||||
|
(defun dot/org-clock-in () (interactive) (org-capture nil "i"))
|
||||||
|
(defun dot/org-clock-out () (interactive) (org-capture nil "o"))
|
||||||
|
(defun dot/org-switch-task () (interactive) (org-capture nil "s"))
|
||||||
|
|
||||||
|
(with-eval-after-load 'evil-commands
|
||||||
|
(defun dot/org-ret-at-point ()
|
||||||
|
"Org return key at point.
|
||||||
|
|
||||||
|
If point is on:
|
||||||
|
checkbox -- toggle it
|
||||||
|
link -- follow it
|
||||||
|
table -- go to next row
|
||||||
|
otherwise -- run the default (evil-ret) expression"
|
||||||
|
(interactive)
|
||||||
|
(let ((type (org-element-type (org-element-context))))
|
||||||
|
(pcase type
|
||||||
|
('link (if org-return-follows-link (org-open-at-point) (evil-ret)))
|
||||||
|
((guard (org-at-item-checkbox-p)) (org-toggle-checkbox))
|
||||||
|
('table-cell (org-table-next-row))
|
||||||
|
(_ (evil-ret))
|
||||||
|
))))
|
||||||
|
|
||||||
|
(defun dot/org-find-file-property (property &optional anywhere)
|
||||||
|
"Return the position of the file PROPERTY if it exists.
|
||||||
|
|
||||||
|
When ANYWHERE is non-nil, search beyond the preamble."
|
||||||
|
(save-excursion
|
||||||
|
(goto-char (point-min))
|
||||||
|
(let ((first-heading
|
||||||
|
(save-excursion
|
||||||
|
(re-search-forward org-outline-regexp-bol nil t))))
|
||||||
|
(when (re-search-forward (format "^#\\+%s:" property)
|
||||||
|
(if anywhere nil first-heading)
|
||||||
|
t)
|
||||||
|
(point)))))
|
||||||
|
|
||||||
|
(defun dot/org-set-file-property (property value)
|
||||||
|
"Set the file PROPERTY in the preamble."
|
||||||
|
(when-let ((pos (dot/org-find-file-property property)))
|
||||||
|
(save-excursion
|
||||||
|
(goto-char pos)
|
||||||
|
(if (looking-at-p " ")
|
||||||
|
(forward-char)
|
||||||
|
(insert " "))
|
||||||
|
(delete-region (point) (line-end-position))
|
||||||
|
(insert value))))
|
||||||
|
|
||||||
|
(defun dot/org-set-last-modified ()
|
||||||
|
"Update the LAST_MODIFIED file property in the preamble."
|
||||||
|
(when (derived-mode-p 'org-mode)
|
||||||
|
(dot/org-set-file-property "LAST_MODIFIED"
|
||||||
|
(format-time-string "[%Y-%m-%d %a %H:%M]")))))))
|
||||||
|
|
||||||
|
;; Org agenda.
|
||||||
|
|
||||||
|
(elpaca-nil (setup org-agenda ; built-in
|
||||||
|
(:load-after evil org)
|
||||||
|
(:when-loaded
|
||||||
|
(setq org-agenda-files `(,org-directory ,user-emacs-directory))
|
||||||
|
(setq org-agenda-span 14)
|
||||||
|
(setq org-agenda-window-setup 'current-window)
|
||||||
|
(evil-set-initial-state 'org-agenda-mode 'motion))))
|
||||||
|
|
||||||
|
;; Org capture.
|
||||||
|
|
||||||
|
(elpaca-nil (setup org-capture ; built-in
|
||||||
|
;; Org-capture in new tab, rather than split window
|
||||||
|
(:hook delete-other-windows)))
|
||||||
|
|
||||||
|
;; Org keys.
|
||||||
|
|
||||||
|
(elpaca-nil (setup org-keys ; built-in
|
||||||
|
(:when-loaded
|
||||||
|
(setq org-return-follows-link t))))
|
||||||
|
|
||||||
|
;; Org links.
|
||||||
|
|
||||||
|
(elpaca-nil (setup ol ; built-in
|
||||||
|
(:when-loaded
|
||||||
|
;; Do not open links to .org files in a split window
|
||||||
|
(add-to-list 'org-link-frame-setup '(file . find-file)))))
|
||||||
|
|
||||||
|
;; Org source code blocks.
|
||||||
|
|
||||||
|
(elpaca-nil (setup org-src ; built-in
|
||||||
|
(:when-loaded
|
||||||
|
(setq org-edit-src-content-indentation 0)
|
||||||
|
(setq org-src-fontify-natively t)
|
||||||
|
(setq org-src-preserve-indentation t)
|
||||||
|
(setq org-src-tab-acts-natively t)
|
||||||
|
(setq org-src-window-setup 'current-window))))
|
||||||
|
|
||||||
|
;; Org exporter.
|
||||||
|
|
||||||
|
(elpaca-nil (setup ox ; built-in
|
||||||
|
(:when-loaded
|
||||||
|
(setq org-export-coding-system 'utf-8-unix))))
|
||||||
|
|
||||||
|
;; Org latex exporter.
|
||||||
|
|
||||||
|
(elpaca-nil (setup ox-latex ; built-in
|
||||||
|
(:when-loaded
|
||||||
|
;; Define how minted (highlighted src code) is added to src code blocks
|
||||||
|
;; Requires packages: texlive-bin, texlive-latexextra and python-pygments
|
||||||
|
(setq org-latex-listings 'minted)
|
||||||
|
(setq org-latex-minted-options '(("frame" "lines") ("linenos=true")))
|
||||||
|
;; Set 'Table of Contents' layout
|
||||||
|
(setq org-latex-toc-command "\\newpage \\tableofcontents \\newpage")
|
||||||
|
;; Add minted package to every LaTeX header
|
||||||
|
(add-to-list 'org-latex-packages-alist '("" "minted"))
|
||||||
|
;; Add -shell-escape so pdflatex exports minted correctly
|
||||||
|
(setcar org-latex-pdf-process (replace-regexp-in-string
|
||||||
|
"-%latex -interaction"
|
||||||
|
"-%latex -shell-escape -interaction"
|
||||||
|
(car org-latex-pdf-process))))))
|
||||||
|
|
||||||
|
;;; Org Bullets
|
||||||
|
|
||||||
|
(elpaca-setup org-bullets
|
||||||
|
(:hook-into org-mode))
|
||||||
|
|
||||||
|
;;; Org Export Packages
|
||||||
|
|
||||||
|
;; HTML exporter.
|
||||||
|
|
||||||
|
(elpaca-setup htmlize
|
||||||
|
(:when-loaded (setq org-export-html-postamble nil)))
|
||||||
|
;;org-export-html-postamble-format ; TODO
|
||||||
|
|
||||||
|
;; GitHub flavored Markdown exporter.
|
||||||
|
|
||||||
|
(elpaca-setup ox-gfm)
|
||||||
|
|
||||||
|
;;; Org Roam
|
||||||
|
|
||||||
|
(elpaca-setup emacsql
|
||||||
|
(:also-load emacsql-sqlite-builtin))
|
||||||
|
|
||||||
|
(elpaca-setup org-roam
|
||||||
|
(:autoload org-roam-node-find) ;; TODO, is this enough?
|
||||||
|
(setq org-roam-v2-ack t)
|
||||||
|
(setq org-roam-database-connector 'sqlite-builtin)
|
||||||
|
(:when-loaded
|
||||||
|
(setq org-roam-db-location (expand-file-name "org-roam.db" dot-cache-dir))
|
||||||
|
(setq org-roam-directory org-directory)
|
||||||
|
;; Exclude Syncthing backup directory
|
||||||
|
(setq org-roam-file-exclude-regexp "\\.stversions")
|
||||||
|
(setq org-roam-verbose nil)
|
||||||
|
|
||||||
|
(setq org-roam-capture-templates
|
||||||
|
'(("d" "default" plain
|
||||||
|
"%?"
|
||||||
|
:target (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+TITLE: ${title}\n#+LAST_MODIFIED:\n#+FILETAGS: %^{File tags||:structure:}\n")
|
||||||
|
:unnarrowed t)))
|
||||||
|
|
||||||
|
(defun dot/org-roam-node-insert-immediate (arg &rest args)
|
||||||
|
(interactive "P")
|
||||||
|
(let ((args (push arg args))
|
||||||
|
(org-roam-capture-templates (list (append (car org-roam-capture-templates)
|
||||||
|
'(:immediate-finish t)))))
|
||||||
|
(apply #'org-roam-node-insert args)))
|
||||||
|
|
||||||
|
(cl-defmethod org-roam-node-slug ((node org-roam-node))
|
||||||
|
"Return the slug of NODE, strip out common words."
|
||||||
|
(let* ((title (org-roam-node-title node))
|
||||||
|
(words (split-string title " "))
|
||||||
|
(common-words '("a" "an" "and" "as" "at" "by" "is" "it" "of" "the" "to"))
|
||||||
|
(title (string-join (seq-remove (lambda (element) (member element common-words)) words) "_"))
|
||||||
|
(pairs '(("c\\+\\+" . "cpp") ;; convert c++ -> cpp
|
||||||
|
("c#" . "cs") ;; convert c# -> cs
|
||||||
|
("[^[:alnum:][:digit:]]" . "_") ;; convert anything not alphanumeric
|
||||||
|
("__*" . "_") ;; remove sequential underscores
|
||||||
|
("^_" . "") ;; remove starting underscore
|
||||||
|
("_$" . "")))) ;; remove ending underscore
|
||||||
|
(cl-flet ((cl-replace (title pair)
|
||||||
|
(replace-regexp-in-string (car pair) (cdr pair) title)))
|
||||||
|
(downcase (-reduce-from #'cl-replace title pairs)))))
|
||||||
|
|
||||||
|
;; Right-align org-roam-node-tags in the completion menu without a length limit
|
||||||
|
;; Source: https://github.com/org-roam/org-roam/issues/1775#issue-971157225
|
||||||
|
(setq org-roam-node-display-template "${title} ${tags:0}")
|
||||||
|
(setq org-roam-node-annotation-function #'dot/org-roam-annotate-tag)
|
||||||
|
(defun dot/org-roam-annotate-tag (node)
|
||||||
|
(let ((tags (mapconcat 'identity (org-roam-node-tags node) " #")))
|
||||||
|
(unless (string-empty-p tags)
|
||||||
|
(concat
|
||||||
|
(propertize " " 'display `(space :align-to (- right ,(+ 2 (length tags)))))
|
||||||
|
(propertize (concat "#" tags) 'face 'bold)))))
|
||||||
|
|
||||||
|
(org-roam-setup)))
|
||||||
|
|
||||||
|
;; Enable https://www.orgroam.com/manual.html#org_002droam_002dprotocol, needed to process org-protocol:// links
|
||||||
|
|
||||||
|
(elpaca-nil (setup org-roam-protocol ; org-roam-protocol.el is part of org-roam
|
||||||
|
(:load-after org-roam)
|
||||||
|
(:when-loaded
|
||||||
|
|
||||||
|
;; Templates used when creating a new file from a bookmark
|
||||||
|
(setq org-roam-capture-ref-templates
|
||||||
|
'(("r" "ref" plain
|
||||||
|
"%?"
|
||||||
|
:target (file+head "${slug}.org" "#+TITLE: ${title}\n \n${body}")
|
||||||
|
:unnarrowed t))))))
|
||||||
|
|
||||||
|
;; The roam-ref protocol bookmarks to add:
|
||||||
|
|
||||||
|
;; javascript:location.href =
|
||||||
|
;; 'org-protocol://roam-ref?template=r'
|
||||||
|
;; + '&ref=' + encodeURIComponent(location.href)
|
||||||
|
;; + '&title=' + encodeURIComponent(document.title)
|
||||||
|
;; + '&body=' + encodeURIComponent(window.getSelection())
|
||||||
|
|
||||||
|
;; Setup org-roam-ui, runs at http://127.0.0.1:35901.
|
||||||
|
|
||||||
|
(elpaca-setup org-roam-ui
|
||||||
|
(:load-after org-roam)
|
||||||
|
(:when-loaded
|
||||||
|
(setq org-roam-ui-follow t)
|
||||||
|
(setq org-roam-ui-open-on-start t)
|
||||||
|
(setq org-roam-ui-sync-theme nil) ;; FIXME: Make this work (org-roam-ui-get-theme)
|
||||||
|
(setq org-roam-ui-update-on-save t)))
|
||||||
|
|
||||||
|
;; Easily searchable .org files via Deft.
|
||||||
|
|
||||||
|
(elpaca-setup deft
|
||||||
|
(:hook dot/hook-disable-line-numbers)
|
||||||
|
(:when-loaded
|
||||||
|
(setq deft-auto-save-interval 0)
|
||||||
|
(setq deft-default-extension "org")
|
||||||
|
(setq deft-directory org-directory)
|
||||||
|
(setq deft-file-naming-rules '((noslash . "-")
|
||||||
|
(nospace . "-")
|
||||||
|
(case-fn . downcase)))
|
||||||
|
(setq deft-new-file-format "%Y%m%d%H%M%S-deft")
|
||||||
|
(setq deft-recursive t)
|
||||||
|
;; Exclude Syncthing backup directory
|
||||||
|
(setq deft-recursive-ignore-dir-regexp (concat "\\.stversions\\|" deft-recursive-ignore-dir-regexp))
|
||||||
|
;; Remove file variable -*- .. -*- and Org Mode :PROPERTIES: lines
|
||||||
|
(setq deft-strip-summary-regexp (concat "\\(^.*-\\*-.+-\\*-$\\|^:[[:alpha:]_]+:.*$\\)\\|" deft-strip-summary-regexp))
|
||||||
|
(setq deft-use-filename-as-title nil)
|
||||||
|
(setq deft-use-filter-string-for-filename t)
|
||||||
|
|
||||||
|
(add-to-list 'deft-extensions "tex")
|
||||||
|
|
||||||
|
;; Start filtering immediately
|
||||||
|
(with-eval-after-load 'evil
|
||||||
|
(evil-set-initial-state 'deft-mode 'insert))
|
||||||
|
|
||||||
|
(defun deft-parse-title (file contents)
|
||||||
|
"Parse the given FILE and CONTENTS and determine the title."
|
||||||
|
(if (string-match "#\\+\\(TITLE\\|title\\):\s*\\(.*\\)$" contents)
|
||||||
|
(match-string 2 contents)
|
||||||
|
(deft-base-filename file)))))
|
||||||
|
|
||||||
|
;;; Org "Table of Contents"
|
||||||
|
|
||||||
|
;; Generate table of contents without exporting.
|
||||||
|
(elpaca-setup toc-org
|
||||||
|
(:hook-into org-mode))
|
||||||
|
|
||||||
|
(provide 'dot-org-mode)
|
||||||
|
|
||||||
|
;;; dot-org-mode.el ends here
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
;;; dot-rss.el --- -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; RSS.
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
|
||||||
|
(elpaca-setup elfeed
|
||||||
|
(:autoload elfeed)
|
||||||
|
(:with-mode dot/hook-disable-line-numbers
|
||||||
|
(:hook-into elfeed-search-mode)
|
||||||
|
(:hook-into elfeed-show-mode))
|
||||||
|
(:when-loaded
|
||||||
|
(setq elfeed-db-directory (expand-file-name "elfeed" dot-cache-dir))
|
||||||
|
(setq elfeed-enclosure-default-dir "~/downloads/")
|
||||||
|
(setq elfeed-search-filter "@6-months-ago +unread")
|
||||||
|
(setq elfeed-search-clipboard-type 'CLIPBOARD)
|
||||||
|
(setq elfeed-search-title-max-width 100)
|
||||||
|
(setq elfeed-search-title-min-width 30)
|
||||||
|
(setq elfeed-search-trailing-width 55)
|
||||||
|
(setq elfeed-show-unique-buffers t)
|
||||||
|
(load (expand-file-name "elfeed-feeds" dot-etc-dir))))
|
||||||
|
|
||||||
|
(provide 'dot-rss)
|
||||||
|
|
||||||
|
;;; dot-rss.el ends here
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
;;; dot-selection.el --- -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; Incremental narrowing in Emacs.
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
(elpaca-setup prescient
|
||||||
|
(:require prescient)
|
||||||
|
(:when-loaded
|
||||||
|
(setq completion-styles '(prescient basic))
|
||||||
|
(setq prescient-filter-method '(literal regexp fuzzy))
|
||||||
|
(setq prescient-save-file (expand-file-name "prescient-save.el" dot-cache-dir))
|
||||||
|
(prescient-persist-mode)))
|
||||||
|
|
||||||
|
(elpaca-setup (vertico :files (:defaults "extensions/*"))
|
||||||
|
(:load-after prescient)
|
||||||
|
(:when-loaded
|
||||||
|
(setq vertico-previous-directory nil)
|
||||||
|
(defun dot/vertico-backspace ()
|
||||||
|
"In Vertico file completion, backward kill sexp, delete char otherwise."
|
||||||
|
(interactive)
|
||||||
|
(if (not (and (active-minibuffer-window)
|
||||||
|
minibuffer-completing-file-name))
|
||||||
|
(backward-delete-char 1)
|
||||||
|
(setq vertico-previous-directory
|
||||||
|
(concat (file-name-nondirectory (directory-file-name (minibuffer-contents)))
|
||||||
|
"/"))
|
||||||
|
(vertico-directory-delete-word 1)))
|
||||||
|
|
||||||
|
(vertico-mode))
|
||||||
|
|
||||||
|
(defun dot/vertico-dired-goto-last-visited (&rest _)
|
||||||
|
"Go to directory candidate that was last visited."
|
||||||
|
(when minibuffer-completing-file-name
|
||||||
|
(setq vertico--index (or (seq-position vertico--candidates vertico-previous-directory)
|
||||||
|
(when (string= vertico-previous-directory "~/")
|
||||||
|
(seq-position vertico--candidates (concat user-login-name "/")))
|
||||||
|
(if (= vertico--total 0) -1 0)))
|
||||||
|
(setq vertico-previous-directory nil)))
|
||||||
|
(advice-add 'vertico--update-candidates :after #'dot/vertico-dired-goto-last-visited))
|
||||||
|
|
||||||
|
(elpaca-nil (setup vertico-mouse ; vertico-mouse.el is part of vertico
|
||||||
|
(:load-after vertico)
|
||||||
|
(:when-loaded (vertico-mouse-mode))))
|
||||||
|
|
||||||
|
(elpaca-setup vertico-prescient
|
||||||
|
(:load-after vertico prescient)
|
||||||
|
(:when-loaded
|
||||||
|
(vertico-prescient-mode)))
|
||||||
|
|
||||||
|
(elpaca-setup marginalia
|
||||||
|
(:load-after vertico)
|
||||||
|
(:when-loaded
|
||||||
|
(setq marginalia-annotators '(marginalia-annotators-heavy marginalia-annotators-light))
|
||||||
|
(marginalia-mode)))
|
||||||
|
|
||||||
|
(elpaca-setup consult
|
||||||
|
(:load-after vertico)
|
||||||
|
(:when-loaded
|
||||||
|
(setq consult-narrow-key (kbd "?"))
|
||||||
|
|
||||||
|
(defun dot/consult-line-no-fuzzy ()
|
||||||
|
"Call consult-line without fuzzy matching."
|
||||||
|
(interactive)
|
||||||
|
(let ((prescient-filter-method (delete 'fuzzy (copy-tree prescient-filter-method))))
|
||||||
|
(consult-line)))
|
||||||
|
|
||||||
|
(consult-customize
|
||||||
|
dot/consult-line-no-fuzzy :prompt "Search: "
|
||||||
|
consult-line-multi :prompt "Search: " :initial nil)))
|
||||||
|
|
||||||
|
(elpaca-setup consult-flycheck
|
||||||
|
(:load-after consult flycheck))
|
||||||
|
|
||||||
|
(elpaca-setup consult-project-extra
|
||||||
|
(:load-after consult project)
|
||||||
|
(:when-loaded (setq project-switch-commands 'consult-project-extra-find)))
|
||||||
|
|
||||||
|
(provide 'dot-selection)
|
||||||
|
|
||||||
|
;;; dot-selection.el ends here
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
;;; dot-setup.el --- -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; Configure SetupEl and keywords.
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; SetupEl
|
||||||
|
|
||||||
|
;; Install and load SetupEl immediately
|
||||||
|
(elpaca setup (require 'setup)
|
||||||
|
|
||||||
|
;;; Configure custom macros
|
||||||
|
|
||||||
|
(setup-define :load-after
|
||||||
|
(lambda (&rest features)
|
||||||
|
(let ((body `(require ',(setup-get 'feature))))
|
||||||
|
(dolist (feature (nreverse features))
|
||||||
|
(setq body `(with-eval-after-load ',feature ,body)))
|
||||||
|
body))
|
||||||
|
:documentation "Load the current feature after FEATURES.")
|
||||||
|
|
||||||
|
(setup-define :autoload
|
||||||
|
(lambda (func)
|
||||||
|
(let ((fn (if (memq (car-safe func) '(quote function))
|
||||||
|
(cadr func)
|
||||||
|
func)))
|
||||||
|
`(unless (fboundp (quote ,fn))
|
||||||
|
(autoload (function ,fn) ,(symbol-name (setup-get 'feature)) nil t))))
|
||||||
|
:documentation "Autoload COMMAND if not already bound."
|
||||||
|
:repeatable t
|
||||||
|
:signature '(FUNC ...))
|
||||||
|
|
||||||
|
(setup-define :defer
|
||||||
|
(lambda (secs)
|
||||||
|
`(if (numberp ,secs)
|
||||||
|
(run-with-idle-timer ,secs nil (lambda () (require ',(setup-get 'feature))))
|
||||||
|
,(setup-quit)))
|
||||||
|
:documentation "Defer loading of feature for SECS idle seconds.")
|
||||||
|
|
||||||
|
;;; Configure custom macros for evil bindings
|
||||||
|
|
||||||
|
(setup-define :with-evil-state
|
||||||
|
(lambda (states &rest body)
|
||||||
|
(setup-bind body (states states)))
|
||||||
|
:documentation "Change the STATE that BODY will bind to."
|
||||||
|
:indent 1)
|
||||||
|
|
||||||
|
(setup-define :evil-bind-impl
|
||||||
|
(lambda (key command)
|
||||||
|
`(evil-define-key* ',(setup-get 'states) ,(setup-get 'map) ,key ,command))
|
||||||
|
:documentation "Bind KEY to COMMAND in the current map."
|
||||||
|
:after-loaded t
|
||||||
|
:ensure '(kbd func)
|
||||||
|
:repeatable t)
|
||||||
|
|
||||||
|
(setup-define :evil-bind
|
||||||
|
(lambda (states &rest keybinds)
|
||||||
|
`(with-eval-after-load 'evil
|
||||||
|
(:with-evil-state ,states (:evil-bind-impl ,@keybinds))))
|
||||||
|
:documentation "Bind KEYBINDS in STATES in the current map.")
|
||||||
|
|
||||||
|
(setup-define :evil-bind-into
|
||||||
|
(lambda (states feature-or-map &rest keybinds)
|
||||||
|
(if (string-match-p "-map\\'" (symbol-name feature-or-map))
|
||||||
|
`(:with-map ,feature-or-map (:evil-bind ,states ,@keybinds))
|
||||||
|
`(:with-feature ,feature-or-map (:evil-bind ,states ,@keybinds))))
|
||||||
|
:documentation "Bind KEYBINDS in STATE into the map of FEATURE-OR-MAP.
|
||||||
|
The arguments REST are handled as by `:evil-bind'."
|
||||||
|
:indent 1)
|
||||||
|
)
|
||||||
|
|
||||||
|
;;; Add setup.el macro
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defmacro elpaca-setup (order &rest body)
|
||||||
|
"Execute BODY in `setup' declaration after ORDER is finished.
|
||||||
|
If the :disabled keyword is present in body, the package is completely ignored.
|
||||||
|
This happens regardless of the value associated with :disabled.
|
||||||
|
The expansion is a string indicating the package has been disabled."
|
||||||
|
(declare (indent 1))
|
||||||
|
(if (memq :disabled body)
|
||||||
|
(format "%S :disabled by elpaca-setup" order)
|
||||||
|
(let ((o order))
|
||||||
|
(when-let ((ensure (cl-position :ensure body)))
|
||||||
|
(setq o (if (null (nth (1+ ensure) body)) nil order)
|
||||||
|
body (append (cl-subseq body 0 ensure)
|
||||||
|
(cl-subseq body (+ ensure 2)))))
|
||||||
|
`(elpaca ,o (setup
|
||||||
|
,(if-let (((memq (car-safe order) '(quote \`)))
|
||||||
|
(feature (flatten-tree order)))
|
||||||
|
(cadr feature)
|
||||||
|
(elpaca--first order))
|
||||||
|
,@body)))))
|
||||||
|
|
||||||
|
;; Startup benchmark
|
||||||
|
(elpaca-setup benchmark-init
|
||||||
|
(:require benchmark-init)
|
||||||
|
(:when-loaded
|
||||||
|
(benchmark-init/activate)
|
||||||
|
(add-hook 'elpaca-after-init-hook #'benchmark-init/deactivate)))
|
||||||
|
|
||||||
|
(provide 'dot-setup-el)
|
||||||
|
|
||||||
|
;;; dot-setup.el ends here
|
||||||
@@ -0,0 +1,238 @@
|
|||||||
|
;;; dot-ui.el --- -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; Setup UI packages.
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; All the icons
|
||||||
|
|
||||||
|
(elpaca-setup all-the-icons
|
||||||
|
(:require all-the-icons)
|
||||||
|
(:when-loaded
|
||||||
|
|
||||||
|
;; Install all-the-icons if font files are not found
|
||||||
|
(dot/run-after-new-frame
|
||||||
|
(unless (find-font (font-spec :name "all-the-icons"))
|
||||||
|
(all-the-icons-install-fonts t)))))
|
||||||
|
|
||||||
|
(elpaca-setup all-the-icons-dired
|
||||||
|
(:hook-into dired-mode)
|
||||||
|
(:load-after all-the-icons)
|
||||||
|
(:when-loaded (setq all-the-icons-dired-monochrome nil)))
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Centaur tabs
|
||||||
|
|
||||||
|
;; Places buffers as tabs in a bar at the top of the frame.
|
||||||
|
|
||||||
|
(elpaca-setup centaur-tabs
|
||||||
|
(:load-after all-the-icons)
|
||||||
|
(:with-mode
|
||||||
|
(eshell-mode
|
||||||
|
help-mode
|
||||||
|
helpful-mode
|
||||||
|
mu4e-view-mode
|
||||||
|
neotree-mode
|
||||||
|
shell-mode)
|
||||||
|
(:hook centaur-tabs-local-mode))
|
||||||
|
(:when-loaded
|
||||||
|
(setq centaur-tabs-enable-ido-completion nil)
|
||||||
|
(setq centaur-tabs-height (if dot/hidpi 38 18))
|
||||||
|
(setq centaur-tabs-modified-marker "•")
|
||||||
|
(setq centaur-tabs-set-icons t)
|
||||||
|
(setq centaur-tabs-set-modified-marker t)
|
||||||
|
(setq centaur-tabs-style "slant")
|
||||||
|
|
||||||
|
(setq centaur-tabs-project-buffer-group-calc nil)
|
||||||
|
(defun centaur-tabs-buffer-groups ()
|
||||||
|
"Organize tabs into groups by buffer."
|
||||||
|
(unless centaur-tabs-project-buffer-group-calc
|
||||||
|
(set (make-local-variable 'centaur-tabs-project-buffer-group-calc)
|
||||||
|
(list
|
||||||
|
(cond
|
||||||
|
((string-equal "*" (substring (buffer-name) 0 1)) "Emacs")
|
||||||
|
((or (memq major-mode '(magit-process-mode
|
||||||
|
magit-status-mode
|
||||||
|
magit-diff-mode
|
||||||
|
magit-log-mode
|
||||||
|
magit-file-mode
|
||||||
|
magit-blob-mode
|
||||||
|
magit-blame-mode))
|
||||||
|
(string= (buffer-name) "COMMIT_EDITMSG")) "Magit")
|
||||||
|
((project-current) (dot/project-project-name))
|
||||||
|
((memq major-mode '(org-mode
|
||||||
|
emacs-lisp-mode)) "Org Mode")
|
||||||
|
((derived-mode-p 'dired-mode) "Dired")
|
||||||
|
((derived-mode-p 'prog-mode
|
||||||
|
'text-mode) "Editing")
|
||||||
|
(t "Other")))))
|
||||||
|
(symbol-value 'centaur-tabs-project-buffer-group-calc))
|
||||||
|
|
||||||
|
(defun centaur-tabs-hide-tab (buffer)
|
||||||
|
"Hide from the tab bar by BUFFER name."
|
||||||
|
|
||||||
|
(let ((name (format "%s" buffer)))
|
||||||
|
(or
|
||||||
|
;; Current window is dedicated window
|
||||||
|
(window-dedicated-p (selected-window))
|
||||||
|
;; Buffer name matches below blacklist
|
||||||
|
(string-match-p "^ ?\\*.*\\*" name))))
|
||||||
|
|
||||||
|
(defun dot/centaur-tabs-is-buffer-unimportant (buffer)
|
||||||
|
"Return t if BUFFER is unimportant and can be killed without caution."
|
||||||
|
(let ((name (format "%s" buffer)))
|
||||||
|
(cond
|
||||||
|
((centaur-tabs-hide-tab name) t)
|
||||||
|
((string-match-p "^magit\\(-[a-z]+\\)*: .*" name) t)
|
||||||
|
(t nil))))
|
||||||
|
|
||||||
|
(defun dot/centaur-tabs-buffer-cleanup ()
|
||||||
|
"Clean up all the hidden buffers."
|
||||||
|
(interactive)
|
||||||
|
(dolist (buffer (buffer-list))
|
||||||
|
(when (dot/centaur-tabs-is-buffer-unimportant buffer)
|
||||||
|
(kill-buffer buffer)))
|
||||||
|
(princ "Cleaned buffers"))
|
||||||
|
|
||||||
|
(defun dot/centaur-tabs-kill-buffer-or-window ()
|
||||||
|
"Delete window of the current buffer, also kill if the buffer is hidden."
|
||||||
|
(interactive)
|
||||||
|
(if (dot/centaur-tabs-is-buffer-unimportant (buffer-name))
|
||||||
|
(kill-buffer-and-window)
|
||||||
|
(delete-window)))
|
||||||
|
|
||||||
|
(centaur-tabs-headline-match)
|
||||||
|
(centaur-tabs-mode)))
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Dashboard
|
||||||
|
|
||||||
|
(elpaca-setup page-break-lines
|
||||||
|
(:require page-break-lines))
|
||||||
|
|
||||||
|
(elpaca-setup dashboard
|
||||||
|
(:require dashboard)
|
||||||
|
(:hook dot/hook-disable-line-numbers)
|
||||||
|
(:when-loaded
|
||||||
|
(setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*") (dashboard-refresh-buffer)))
|
||||||
|
(setq dashboard-banner-logo-title "GNU Emacs master race!")
|
||||||
|
(setq dashboard-center-content t)
|
||||||
|
(setq dashboard-page-separator "\n\f\n")
|
||||||
|
(setq dashboard-projects-backend 'project-el)
|
||||||
|
(setq dashboard-set-file-icons t)
|
||||||
|
(setq dashboard-set-footer nil)
|
||||||
|
(setq dashboard-set-heading-icons t)
|
||||||
|
(setq dashboard-show-shortcuts t)
|
||||||
|
(setq dashboard-startup-banner 'logo)
|
||||||
|
(setq dashboard-items '((projects . 10)
|
||||||
|
(bookmarks . 5)
|
||||||
|
(recents . 5)))
|
||||||
|
|
||||||
|
;; Fix keybinds..
|
||||||
|
|
||||||
|
(defun dot/dashboard-goto-bookmarks ()
|
||||||
|
"Move point to bookmarks."
|
||||||
|
(interactive)
|
||||||
|
(funcall (local-key-binding "m")))
|
||||||
|
|
||||||
|
(defun dot/dashboard-goto-projects ()
|
||||||
|
"Move point to projects."
|
||||||
|
(interactive)
|
||||||
|
(funcall (local-key-binding "p")))
|
||||||
|
|
||||||
|
(defun dot/dashboard-goto-recent-files ()
|
||||||
|
"Move point to recent files."
|
||||||
|
(interactive)
|
||||||
|
(funcall (local-key-binding "r")))
|
||||||
|
|
||||||
|
(dashboard-setup-startup-hook)
|
||||||
|
))
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Helpful
|
||||||
|
|
||||||
|
;; A better *help* buffer.
|
||||||
|
|
||||||
|
(elpaca-setup helpful
|
||||||
|
(:require helpful)
|
||||||
|
(:hook dot/hook-disable-line-numbers))
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Neotree
|
||||||
|
|
||||||
|
;; Provides Emacs with a file tree.
|
||||||
|
|
||||||
|
(elpaca-setup neotree
|
||||||
|
(:autoload neotree-toggle)
|
||||||
|
(:hook dot/hook-disable-line-numbers)
|
||||||
|
(:hook hl-line-mode)
|
||||||
|
|
||||||
|
;; This needs to be in init to actually start loading the package
|
||||||
|
(with-eval-after-load 'project
|
||||||
|
(defun neotree-toggle-in-project-root ()
|
||||||
|
"Toggle Neotree in project root."
|
||||||
|
(interactive)
|
||||||
|
(let ((default-directory (dot/find-project-root)))
|
||||||
|
(call-interactively #'neotree-toggle))))
|
||||||
|
|
||||||
|
(:when-loaded
|
||||||
|
(setq neo-theme (if (display-graphic-p) 'icons 'arrow))
|
||||||
|
(setq neo-autorefresh nil)
|
||||||
|
(setq neo-mode-line-type 'none)
|
||||||
|
(setq neo-show-hidden-files t)
|
||||||
|
(setq neo-vc-integration '(face))))
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Telephone Line
|
||||||
|
|
||||||
|
;; Emacs mode line replacement.
|
||||||
|
|
||||||
|
(elpaca-setup telephone-line
|
||||||
|
(:require telephone-line)
|
||||||
|
(:when-loaded
|
||||||
|
(setq telephone-line-height (if dot/hidpi 30 15))
|
||||||
|
(setq telephone-line-lhs
|
||||||
|
'((evil . (telephone-line-evil-tag-segment))
|
||||||
|
(accent . (telephone-line-erc-modified-channels-segment
|
||||||
|
telephone-line-process-segment
|
||||||
|
telephone-line-buffer-segment))
|
||||||
|
(nil . (telephone-line-project-segment))))
|
||||||
|
(telephone-line-mode)))
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Theme
|
||||||
|
|
||||||
|
(elpaca-setup hybrid-reverse-theme
|
||||||
|
(:require hybrid-reverse-theme)
|
||||||
|
(:when-loaded
|
||||||
|
(dot/run-after-new-frame
|
||||||
|
(load-theme 'hybrid-reverse t))))
|
||||||
|
|
||||||
|
;; -----------------------------------------
|
||||||
|
;; Which-key
|
||||||
|
|
||||||
|
;; Popup that displays available key bindings.
|
||||||
|
|
||||||
|
(elpaca-setup which-key
|
||||||
|
(:hook-into elpaca-after-init)
|
||||||
|
(:when-loaded
|
||||||
|
(setq which-key-add-column-padding 1)
|
||||||
|
(setq which-key-max-display-columns nil)
|
||||||
|
(setq which-key-min-display-lines 6)
|
||||||
|
(setq which-key-sort-order #'dot/which-key-prefix-then-key-order-alpha)
|
||||||
|
(setq which-key-sort-uppercase-first nil)
|
||||||
|
|
||||||
|
(defun dot/which-key-prefix-then-key-order-alpha (acons bcons)
|
||||||
|
"Order by prefix, then lexicographical."
|
||||||
|
(let ((apref? (which-key--group-p (cdr acons)))
|
||||||
|
(bpref? (which-key--group-p (cdr bcons))))
|
||||||
|
(if (not (eq apref? bpref?))
|
||||||
|
(and (not apref?) bpref?)
|
||||||
|
(which-key-key-order-alpha acons bcons))))))
|
||||||
|
|
||||||
|
(provide 'dot-ui)
|
||||||
|
|
||||||
|
;;; dot-ui.el ends here
|
||||||
@@ -6,4 +6,4 @@ namespace ${1:Namespace} {
|
|||||||
|
|
||||||
$0
|
$0
|
||||||
|
|
||||||
}
|
} // namespace $1
|
||||||
|
|||||||
@@ -5,16 +5,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) `(format-time-string "%Y")` ${1:Author} ${2:<${3:Email}>}
|
* Copyright (C) `(format-time-string "%Y")` ${1:Author} ${2:<${3:Email}>}
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
*/
|
||||||
$0
|
$0
|
||||||
|
|||||||
@@ -5,25 +5,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) `(format-time-string "%Y")` ${1:Author} ${2:<${3:Email}>}
|
* Copyright (C) `(format-time-string "%Y")` ${1:Author} ${2:<${3:Email}>}
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
* modification, are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
||||||
* list of conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
*/
|
||||||
$0
|
$0
|
||||||
|
|||||||
@@ -5,29 +5,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) `(format-time-string "%Y")` ${1:Author} ${2:<${3:Email}>}
|
* Copyright (C) `(format-time-string "%Y")` ${1:Author} ${2:<${3:Email}>}
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
* modification, are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
||||||
* list of conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
*
|
|
||||||
* 3. Neither the name of the copyright holder nor the names of its
|
|
||||||
* contributors may be used to endorse or promote products derived from
|
|
||||||
* this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
*/
|
||||||
$0
|
$0
|
||||||
@@ -5,18 +5,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) `(format-time-string "%Y")` ${1:Author} ${2:<${3:Email}>}
|
* Copyright (C) `(format-time-string "%Y")` ${1:Author} ${2:<${3:Email}>}
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 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, write to the Free Software Foundation, Inc.,
|
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*/
|
*/
|
||||||
$0
|
$0
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: gpl2-only
|
||||||
|
# key: gpl2-only
|
||||||
|
# --
|
||||||
|
/*
|
||||||
|
* Copyright (C) `(format-time-string "%Y")` ${1:Author} ${2:<${3:Email}>}
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: GPL-2.0-only
|
||||||
|
*/
|
||||||
|
$0
|
||||||
@@ -5,17 +5,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) `(format-time-string "%Y")` ${1:Author} ${2:<${3:Email}>}
|
* Copyright (C) `(format-time-string "%Y")` ${1:Author} ${2:<${3:Email}>}
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
* 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/>.
|
|
||||||
*/
|
*/
|
||||||
$0
|
$0
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: gpl3-only
|
||||||
|
# key: gpl3-only
|
||||||
|
# --
|
||||||
|
/*
|
||||||
|
* Copyright (C) `(format-time-string "%Y")` ${1:Author} ${2:<${3:Email}>}
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
*/
|
||||||
|
$0
|
||||||
@@ -5,21 +5,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) `(format-time-string "%Y")` ${1:Author} ${2:<${3:Email}>}
|
* Copyright (C) `(format-time-string "%Y")` ${1:Author} ${2:<${3:Email}>}
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
* SPDX-License-Identifier: MIT
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
|
||||||
* the Software without restriction, including without limitation the rights to
|
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
* subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
*/
|
||||||
$0
|
$0
|
||||||
@@ -0,0 +1,205 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: al2-full
|
||||||
|
# key: al2-full
|
||||||
|
# --
|
||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright `(format-time-string "%Y")` ${1:Author} ${2:<${3:Email}>}
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: bsd2-full
|
||||||
|
# key: bsd2-full
|
||||||
|
# --
|
||||||
|
BSD 2-Clause License
|
||||||
|
|
||||||
|
Copyright (C) `(format-time-string "%Y")` ${1:Author} ${2:<${3:Email}>}
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice, this
|
||||||
|
list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer in the documentation
|
||||||
|
and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: bsd3-full
|
||||||
|
# key: bsd3-full
|
||||||
|
# --
|
||||||
|
BSD 3-Clause License
|
||||||
|
|
||||||
|
Copyright (C) `(format-time-string "%Y")` ${1:Author} ${2:<${3:Email}>}
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice, this
|
||||||
|
list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer in the documentation
|
||||||
|
and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
3. Neither the name of the copyright holder nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived from
|
||||||
|
this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: bsd4-full
|
||||||
|
# key: bsd4-full
|
||||||
|
# --
|
||||||
|
BSD 4-Clause License
|
||||||
|
|
||||||
|
Copyright (C) `(format-time-string "%Y")` ${1:Author} ${2:<${3:Email}>}
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice, this
|
||||||
|
list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer in the documentation
|
||||||
|
and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
3. Neither the name of the copyright holder nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived from
|
||||||
|
this software without specific prior written permission.
|
||||||
|
|
||||||
|
4. Neither the name of the copyright holder nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived from
|
||||||
|
this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
@@ -0,0 +1,343 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: gpl2-full
|
||||||
|
# key: gpl2-full
|
||||||
|
# --
|
||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 2, June 1991
|
||||||
|
|
||||||
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The licenses for most software are designed to take away your
|
||||||
|
freedom to share and change it. By contrast, the GNU General Public
|
||||||
|
License is intended to guarantee your freedom to share and change free
|
||||||
|
software--to make sure the software is free for all its users. This
|
||||||
|
General Public License applies to most of the Free Software
|
||||||
|
Foundation's software and to any other program whose authors commit to
|
||||||
|
using it. (Some other Free Software Foundation software is covered by
|
||||||
|
the GNU Lesser General Public License instead.) You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
this service if you wish), that you receive source code or can get it
|
||||||
|
if you want it, that you can change the software or use pieces of it
|
||||||
|
in new free programs; and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to make restrictions that forbid
|
||||||
|
anyone to deny you these rights or to ask you to surrender the rights.
|
||||||
|
These restrictions translate to certain responsibilities for you if you
|
||||||
|
distribute copies of the software, or if you modify it.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must give the recipients all the rights that
|
||||||
|
you have. You must make sure that they, too, receive or can get the
|
||||||
|
source code. And you must show them these terms so they know their
|
||||||
|
rights.
|
||||||
|
|
||||||
|
We protect your rights with two steps: (1) copyright the software, and
|
||||||
|
(2) offer you this license which gives you legal permission to copy,
|
||||||
|
distribute and/or modify the software.
|
||||||
|
|
||||||
|
Also, for each author's protection and ours, we want to make certain
|
||||||
|
that everyone understands that there is no warranty for this free
|
||||||
|
software. If the software is modified by someone else and passed on, we
|
||||||
|
want its recipients to know that what they have is not the original, so
|
||||||
|
that any problems introduced by others will not reflect on the original
|
||||||
|
authors' reputations.
|
||||||
|
|
||||||
|
Finally, any free program is threatened constantly by software
|
||||||
|
patents. We wish to avoid the danger that redistributors of a free
|
||||||
|
program will individually obtain patent licenses, in effect making the
|
||||||
|
program proprietary. To prevent this, we have made it clear that any
|
||||||
|
patent must be licensed for everyone's free use or not licensed at all.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
|
0. This License applies to any program or other work which contains
|
||||||
|
a notice placed by the copyright holder saying it may be distributed
|
||||||
|
under the terms of this General Public License. The "Program", below,
|
||||||
|
refers to any such program or work, and a "work based on the Program"
|
||||||
|
means either the Program or any derivative work under copyright law:
|
||||||
|
that is to say, a work containing the Program or a portion of it,
|
||||||
|
either verbatim or with modifications and/or translated into another
|
||||||
|
language. (Hereinafter, translation is included without limitation in
|
||||||
|
the term "modification".) Each licensee is addressed as "you".
|
||||||
|
|
||||||
|
Activities other than copying, distribution and modification are not
|
||||||
|
covered by this License; they are outside its scope. The act of
|
||||||
|
running the Program is not restricted, and the output from the Program
|
||||||
|
is covered only if its contents constitute a work based on the
|
||||||
|
Program (independent of having been made by running the Program).
|
||||||
|
Whether that is true depends on what the Program does.
|
||||||
|
|
||||||
|
1. You may copy and distribute verbatim copies of the Program's
|
||||||
|
source code as you receive it, in any medium, provided that you
|
||||||
|
conspicuously and appropriately publish on each copy an appropriate
|
||||||
|
copyright notice and disclaimer of warranty; keep intact all the
|
||||||
|
notices that refer to this License and to the absence of any warranty;
|
||||||
|
and give any other recipients of the Program a copy of this License
|
||||||
|
along with the Program.
|
||||||
|
|
||||||
|
You may charge a fee for the physical act of transferring a copy, and
|
||||||
|
you may at your option offer warranty protection in exchange for a fee.
|
||||||
|
|
||||||
|
2. You may modify your copy or copies of the Program or any portion
|
||||||
|
of it, thus forming a work based on the Program, and copy and
|
||||||
|
distribute such modifications or work under the terms of Section 1
|
||||||
|
above, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) You must cause the modified files to carry prominent notices
|
||||||
|
stating that you changed the files and the date of any change.
|
||||||
|
|
||||||
|
b) You must cause any work that you distribute or publish, that in
|
||||||
|
whole or in part contains or is derived from the Program or any
|
||||||
|
part thereof, to be licensed as a whole at no charge to all third
|
||||||
|
parties under the terms of this License.
|
||||||
|
|
||||||
|
c) If the modified program normally reads commands interactively
|
||||||
|
when run, you must cause it, when started running for such
|
||||||
|
interactive use in the most ordinary way, to print or display an
|
||||||
|
announcement including an appropriate copyright notice and a
|
||||||
|
notice that there is no warranty (or else, saying that you provide
|
||||||
|
a warranty) and that users may redistribute the program under
|
||||||
|
these conditions, and telling the user how to view a copy of this
|
||||||
|
License. (Exception: if the Program itself is interactive but
|
||||||
|
does not normally print such an announcement, your work based on
|
||||||
|
the Program is not required to print an announcement.)
|
||||||
|
|
||||||
|
These requirements apply to the modified work as a whole. If
|
||||||
|
identifiable sections of that work are not derived from the Program,
|
||||||
|
and can be reasonably considered independent and separate works in
|
||||||
|
themselves, then this License, and its terms, do not apply to those
|
||||||
|
sections when you distribute them as separate works. But when you
|
||||||
|
distribute the same sections as part of a whole which is a work based
|
||||||
|
on the Program, the distribution of the whole must be on the terms of
|
||||||
|
this License, whose permissions for other licensees extend to the
|
||||||
|
entire whole, and thus to each and every part regardless of who wrote it.
|
||||||
|
|
||||||
|
Thus, it is not the intent of this section to claim rights or contest
|
||||||
|
your rights to work written entirely by you; rather, the intent is to
|
||||||
|
exercise the right to control the distribution of derivative or
|
||||||
|
collective works based on the Program.
|
||||||
|
|
||||||
|
In addition, mere aggregation of another work not based on the Program
|
||||||
|
with the Program (or with a work based on the Program) on a volume of
|
||||||
|
a storage or distribution medium does not bring the other work under
|
||||||
|
the scope of this License.
|
||||||
|
|
||||||
|
3. You may copy and distribute the Program (or a work based on it,
|
||||||
|
under Section 2) in object code or executable form under the terms of
|
||||||
|
Sections 1 and 2 above provided that you also do one of the following:
|
||||||
|
|
||||||
|
a) Accompany it with the complete corresponding machine-readable
|
||||||
|
source code, which must be distributed under the terms of Sections
|
||||||
|
1 and 2 above on a medium customarily used for software interchange; or,
|
||||||
|
|
||||||
|
b) Accompany it with a written offer, valid for at least three
|
||||||
|
years, to give any third party, for a charge no more than your
|
||||||
|
cost of physically performing source distribution, a complete
|
||||||
|
machine-readable copy of the corresponding source code, to be
|
||||||
|
distributed under the terms of Sections 1 and 2 above on a medium
|
||||||
|
customarily used for software interchange; or,
|
||||||
|
|
||||||
|
c) Accompany it with the information you received as to the offer
|
||||||
|
to distribute corresponding source code. (This alternative is
|
||||||
|
allowed only for noncommercial distribution and only if you
|
||||||
|
received the program in object code or executable form with such
|
||||||
|
an offer, in accord with Subsection b above.)
|
||||||
|
|
||||||
|
The source code for a work means the preferred form of the work for
|
||||||
|
making modifications to it. For an executable work, complete source
|
||||||
|
code means all the source code for all modules it contains, plus any
|
||||||
|
associated interface definition files, plus the scripts used to
|
||||||
|
control compilation and installation of the executable. However, as a
|
||||||
|
special exception, the source code distributed need not include
|
||||||
|
anything that is normally distributed (in either source or binary
|
||||||
|
form) with the major components (compiler, kernel, and so on) of the
|
||||||
|
operating system on which the executable runs, unless that component
|
||||||
|
itself accompanies the executable.
|
||||||
|
|
||||||
|
If distribution of executable or object code is made by offering
|
||||||
|
access to copy from a designated place, then offering equivalent
|
||||||
|
access to copy the source code from the same place counts as
|
||||||
|
distribution of the source code, even though third parties are not
|
||||||
|
compelled to copy the source along with the object code.
|
||||||
|
|
||||||
|
4. You may not copy, modify, sublicense, or distribute the Program
|
||||||
|
except as expressly provided under this License. Any attempt
|
||||||
|
otherwise to copy, modify, sublicense or distribute the Program is
|
||||||
|
void, and will automatically terminate your rights under this License.
|
||||||
|
However, parties who have received copies, or rights, from you under
|
||||||
|
this License will not have their licenses terminated so long as such
|
||||||
|
parties remain in full compliance.
|
||||||
|
|
||||||
|
5. You are not required to accept this License, since you have not
|
||||||
|
signed it. However, nothing else grants you permission to modify or
|
||||||
|
distribute the Program or its derivative works. These actions are
|
||||||
|
prohibited by law if you do not accept this License. Therefore, by
|
||||||
|
modifying or distributing the Program (or any work based on the
|
||||||
|
Program), you indicate your acceptance of this License to do so, and
|
||||||
|
all its terms and conditions for copying, distributing or modifying
|
||||||
|
the Program or works based on it.
|
||||||
|
|
||||||
|
6. Each time you redistribute the Program (or any work based on the
|
||||||
|
Program), the recipient automatically receives a license from the
|
||||||
|
original licensor to copy, distribute or modify the Program subject to
|
||||||
|
these terms and conditions. You may not impose any further
|
||||||
|
restrictions on the recipients' exercise of the rights granted herein.
|
||||||
|
You are not responsible for enforcing compliance by third parties to
|
||||||
|
this License.
|
||||||
|
|
||||||
|
7. If, as a consequence of a court judgment or allegation of patent
|
||||||
|
infringement or for any other reason (not limited to patent issues),
|
||||||
|
conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot
|
||||||
|
distribute so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you
|
||||||
|
may not distribute the Program at all. For example, if a patent
|
||||||
|
license would not permit royalty-free redistribution of the Program by
|
||||||
|
all those who receive copies directly or indirectly through you, then
|
||||||
|
the only way you could satisfy both it and this License would be to
|
||||||
|
refrain entirely from distribution of the Program.
|
||||||
|
|
||||||
|
If any portion of this section is held invalid or unenforceable under
|
||||||
|
any particular circumstance, the balance of the section is intended to
|
||||||
|
apply and the section as a whole is intended to apply in other
|
||||||
|
circumstances.
|
||||||
|
|
||||||
|
It is not the purpose of this section to induce you to infringe any
|
||||||
|
patents or other property right claims or to contest validity of any
|
||||||
|
such claims; this section has the sole purpose of protecting the
|
||||||
|
integrity of the free software distribution system, which is
|
||||||
|
implemented by public license practices. Many people have made
|
||||||
|
generous contributions to the wide range of software distributed
|
||||||
|
through that system in reliance on consistent application of that
|
||||||
|
system; it is up to the author/donor to decide if he or she is willing
|
||||||
|
to distribute software through any other system and a licensee cannot
|
||||||
|
impose that choice.
|
||||||
|
|
||||||
|
This section is intended to make thoroughly clear what is believed to
|
||||||
|
be a consequence of the rest of this License.
|
||||||
|
|
||||||
|
8. If the distribution and/or use of the Program is restricted in
|
||||||
|
certain countries either by patents or by copyrighted interfaces, the
|
||||||
|
original copyright holder who places the Program under this License
|
||||||
|
may add an explicit geographical distribution limitation excluding
|
||||||
|
those countries, so that distribution is permitted only in or among
|
||||||
|
countries not thus excluded. In such case, this License incorporates
|
||||||
|
the limitation as if written in the body of this License.
|
||||||
|
|
||||||
|
9. The Free Software Foundation may publish revised and/or new versions
|
||||||
|
of the General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the Program
|
||||||
|
specifies a version number of this License which applies to it and "any
|
||||||
|
later version", you have the option of following the terms and conditions
|
||||||
|
either of that version or of any later version published by the Free
|
||||||
|
Software Foundation. If the Program does not specify a version number of
|
||||||
|
this License, you may choose any version ever published by the Free Software
|
||||||
|
Foundation.
|
||||||
|
|
||||||
|
10. If you wish to incorporate parts of the Program into other free
|
||||||
|
programs whose distribution conditions are different, write to the author
|
||||||
|
to ask for permission. For software which is copyrighted by the Free
|
||||||
|
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||||
|
make exceptions for this. Our decision will be guided by the two goals
|
||||||
|
of preserving the free status of all derivatives of our free software and
|
||||||
|
of promoting the sharing and reuse of software generally.
|
||||||
|
|
||||||
|
NO WARRANTY
|
||||||
|
|
||||||
|
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||||
|
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||||
|
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||||
|
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||||
|
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||||
|
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||||
|
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||||
|
REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||||
|
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||||
|
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||||
|
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||||
|
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||||
|
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||||
|
POSSIBILITY OF SUCH DAMAGES.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
convey the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
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 2 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, write to the Free Software Foundation, Inc.,
|
||||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program is interactive, make it output a short notice like this
|
||||||
|
when it starts in an interactive mode:
|
||||||
|
|
||||||
|
Gnomovision version 69, Copyright (C) year name of author
|
||||||
|
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, the commands you use may
|
||||||
|
be called something other than `show w' and `show c'; they could even be
|
||||||
|
mouse-clicks or menu items--whatever suits your program.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or your
|
||||||
|
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||||
|
necessary. Here is a sample; alter the names:
|
||||||
|
|
||||||
|
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||||
|
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||||
|
|
||||||
|
<signature of Ty Coon>, 1 April 1989
|
||||||
|
Ty Coon, President of Vice
|
||||||
|
|
||||||
|
This General Public License does not permit incorporating your program into
|
||||||
|
proprietary programs. If your program is a subroutine library, you may
|
||||||
|
consider it more useful to permit linking proprietary applications with the
|
||||||
|
library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License.
|
||||||
@@ -0,0 +1,678 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: gpl3-full
|
||||||
|
# key: gpl3-full
|
||||||
|
# --
|
||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
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/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
<program> Copyright (C) <year> <name of author>
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, your program's commands
|
||||||
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your program
|
||||||
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License. But first, please read
|
||||||
|
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: mit-full
|
||||||
|
# key: mit-full
|
||||||
|
# --
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (C) `(format-time-string "%Y")` ${1:Author} ${2:<${3:Email}>}
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.$0
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# Unbind existing
|
||||||
|
prev_img unbound
|
||||||
|
next_img unbound
|
||||||
|
|
||||||
|
# Set bindings
|
||||||
|
zoom_in 4
|
||||||
|
zoom_out 5
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
[general]
|
||||||
|
temp-day=5700
|
||||||
|
|
||||||
|
; >>> hostname=arch-desktop
|
||||||
|
temp-night=3500
|
||||||
|
; <<<
|
||||||
|
; >>> hostname=arch-laptop
|
||||||
|
; temp-night=3000
|
||||||
|
; <<<
|
||||||
|
|
||||||
|
fade=1
|
||||||
|
|
||||||
|
brightness-day=1.0
|
||||||
|
brightness-night=0.9
|
||||||
|
|
||||||
|
location-provider=manual
|
||||||
|
|
||||||
|
; >>> session=xorg
|
||||||
|
adjustment-method=randr
|
||||||
|
; <<<
|
||||||
|
; >>> session=wayland
|
||||||
|
; adjustment-method=wayland
|
||||||
|
; <<<
|
||||||
|
|
||||||
|
[manual]
|
||||||
|
lat=51.81
|
||||||
|
lon=4.67
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
app-notifications = no-clipboard-copy
|
||||||
|
confirm-close-surface = false
|
||||||
|
copy-on-select = clipboard
|
||||||
|
cursor-style-blink = false
|
||||||
|
font-family = DejaVuSansM Nerd Font Mono
|
||||||
|
font-size = 10
|
||||||
|
link-url = true
|
||||||
|
selection-invert-fg-bg = true
|
||||||
|
term = xterm-256color
|
||||||
|
theme = terminal-sexy
|
||||||
|
window-decoration = false
|
||||||
|
window-inherit-working-directory = true
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
palette = 0=#282a2e
|
||||||
|
palette = 1=#a54242
|
||||||
|
palette = 2=#8c9440
|
||||||
|
palette = 3=#de935f
|
||||||
|
palette = 4=#5f819d
|
||||||
|
palette = 5=#85678f
|
||||||
|
palette = 6=#5e8d87
|
||||||
|
palette = 7=#707880
|
||||||
|
palette = 8=#373b41
|
||||||
|
palette = 9=#cc6666
|
||||||
|
palette = 10=#b5bd68
|
||||||
|
palette = 11=#f0c674
|
||||||
|
palette = 12=#81a2be
|
||||||
|
palette = 13=#b294bb
|
||||||
|
palette = 14=#8abeb7
|
||||||
|
palette = 15=#c5c8c6
|
||||||
|
background = #1c1c1c
|
||||||
|
foreground = #c5c8c6
|
||||||
|
cursor-color = #c5c8c6
|
||||||
|
selection-background = #373b41
|
||||||
|
selection-foreground = #c5c8c6
|
||||||
@@ -7,3 +7,11 @@
|
|||||||
[user]
|
[user]
|
||||||
name = Riyyi
|
name = Riyyi
|
||||||
email = riyyi3@gmail.com
|
email = riyyi3@gmail.com
|
||||||
|
[diff]
|
||||||
|
tool = nvimdiff
|
||||||
|
[merge]
|
||||||
|
tool = nvimdiff
|
||||||
|
conflictstyle = diff3
|
||||||
|
[mergetool]
|
||||||
|
prompt = false
|
||||||
|
keepBackup = false
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
pinentry-program /usr/bin/pinentry
|
pinentry-program /usr/bin/pinentry-gtk
|
||||||
|
|
||||||
default-cache-ttl 900
|
default-cache-ttl 900
|
||||||
max-cache-ttl 7200
|
max-cache-ttl 7200
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
# DO NOT EDIT! This file will be overwritten by nwg-look.
|
||||||
|
# Any customization should be done in ~/.gtkrc-2.0.mine instead.
|
||||||
|
|
||||||
|
include "/home/rick/.gtkrc-2.0.mine"
|
||||||
gtk-theme-name="Arc-Dark"
|
gtk-theme-name="Arc-Dark"
|
||||||
gtk-icon-theme-name="Arc"
|
gtk-icon-theme-name="Arc"
|
||||||
gtk-font-name="DejaVu Sans 10"
|
gtk-font-name="DejaVu Sans 10"
|
||||||
|
|||||||
@@ -14,3 +14,4 @@ gtk-xft-antialias=1
|
|||||||
gtk-xft-hinting=1
|
gtk-xft-hinting=1
|
||||||
gtk-xft-hintstyle=hintslight
|
gtk-xft-hintstyle=hintslight
|
||||||
gtk-xft-rgba=rgb
|
gtk-xft-rgba=rgb
|
||||||
|
gtk-application-prefer-dark-theme=1
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
general {
|
||||||
|
lock_cmd = pidof hyprlock || hyprlock
|
||||||
|
before_sleep_cmd = loginctl lock-session
|
||||||
|
after_sleep_cmd = hyprctl dispatch dpms on # avoid having to press a key twice to turn on display
|
||||||
|
}
|
||||||
|
|
||||||
|
# Turn the screen off after 30 seconds on the lock-screen
|
||||||
|
listener {
|
||||||
|
timeout = 30
|
||||||
|
on-timeout = pidof hyprlock && hyprctl dispatch dpms off
|
||||||
|
on-resume = hyprctl dispatch dpms on
|
||||||
|
}
|
||||||
@@ -0,0 +1,422 @@
|
|||||||
|
################
|
||||||
|
### MONITORS ###
|
||||||
|
################
|
||||||
|
|
||||||
|
# See https://wiki.hyprland.org/Configuring/Monitors/
|
||||||
|
|
||||||
|
monitor = desc:Ancor Communications Inc ASUS PB298 D7LMTF059917, preferred, 0x0, auto
|
||||||
|
monitor = desc:Iiyama North America PL2492H 11511037C7430, preferred, 2560x0, auto
|
||||||
|
monitor = , preferred, auto, auto # fallback
|
||||||
|
|
||||||
|
|
||||||
|
###################
|
||||||
|
### MY PROGRAMS ###
|
||||||
|
###################
|
||||||
|
|
||||||
|
# See https://wiki.hyprland.org/Configuring/Keywords/
|
||||||
|
|
||||||
|
# Set programs that you use
|
||||||
|
$terminal = ghostty
|
||||||
|
$fileManager = thunar
|
||||||
|
$menu = rofi -show drun
|
||||||
|
|
||||||
|
|
||||||
|
#################
|
||||||
|
### AUTOSTART ###
|
||||||
|
#################
|
||||||
|
|
||||||
|
# System level
|
||||||
|
exec-once = gammastep
|
||||||
|
exec-once = systemctl --user start hyprpolkitagent
|
||||||
|
exec-once = hyprctl setcursor capitaine-cursors-light 24
|
||||||
|
exec-once = hypridle
|
||||||
|
exec-once = ydotoold
|
||||||
|
|
||||||
|
# Scripts
|
||||||
|
exec-once = ${HOME}/.local/bin/wm/wallpaper.sh
|
||||||
|
exec-once = ${HOME}/.local/bin/panel/waybar.sh
|
||||||
|
|
||||||
|
# Applications
|
||||||
|
exec-once = [workspace 1] firefox
|
||||||
|
exec-once = [workspace 2] $terminal
|
||||||
|
exec-once = [workspace 3] thunar --daemon
|
||||||
|
exec-once = [workspace 3] thunar
|
||||||
|
|
||||||
|
|
||||||
|
#############################
|
||||||
|
### ENVIRONMENT VARIABLES ###
|
||||||
|
#############################
|
||||||
|
|
||||||
|
# See https://wiki.hyprland.org/Configuring/Environment-variables/
|
||||||
|
|
||||||
|
env = XDG_CURRENT_DESKTOP,Hyprland
|
||||||
|
env = XDG_SESSION_TYPE,wayland
|
||||||
|
env = XDG_SESSION_DESKTOP,Hyprland
|
||||||
|
|
||||||
|
env = XCURSOR_SIZE,24
|
||||||
|
env = HYPRCURSOR_SIZE,24
|
||||||
|
|
||||||
|
|
||||||
|
#####################
|
||||||
|
### LOOK AND FEEL ###
|
||||||
|
#####################
|
||||||
|
|
||||||
|
# Refer to https://wiki.hyprland.org/Configuring/Variables/
|
||||||
|
|
||||||
|
# https://wiki.hyprland.org/Configuring/Variables/#general
|
||||||
|
general {
|
||||||
|
gaps_in = 5
|
||||||
|
gaps_out = 10
|
||||||
|
|
||||||
|
border_size = 2
|
||||||
|
|
||||||
|
# https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors
|
||||||
|
col.active_border = rgb(404552)
|
||||||
|
col.inactive_border = rgb(2b2e39)
|
||||||
|
|
||||||
|
# Set to true enable resizing windows by clicking and dragging on borders and gaps
|
||||||
|
resize_on_border = false
|
||||||
|
|
||||||
|
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
|
||||||
|
allow_tearing = false
|
||||||
|
|
||||||
|
layout = dwindle
|
||||||
|
}
|
||||||
|
|
||||||
|
# https://wiki.hyprland.org/Configuring/Variables/#decoration
|
||||||
|
decoration {
|
||||||
|
rounding = 0
|
||||||
|
|
||||||
|
# Change transparency of focused and unfocused windows
|
||||||
|
active_opacity = 1.0
|
||||||
|
inactive_opacity = 1.0
|
||||||
|
|
||||||
|
shadow {
|
||||||
|
enabled = false
|
||||||
|
}
|
||||||
|
|
||||||
|
# https://wiki.hyprland.org/Configuring/Variables/#blur
|
||||||
|
blur {
|
||||||
|
enabled = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# https://wiki.hyprland.org/Configuring/Variables/#animations
|
||||||
|
animations {
|
||||||
|
enabled = true
|
||||||
|
|
||||||
|
# Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
|
||||||
|
|
||||||
|
bezier = easeOutQuint,0.23,1,0.32,1
|
||||||
|
bezier = easeInOutCubic,0.65,0.05,0.36,1
|
||||||
|
bezier = linear,0,0,1,1
|
||||||
|
bezier = almostLinear,0.5,0.5,0.75,1.0
|
||||||
|
bezier = quick,0.15,0,0.1,1
|
||||||
|
|
||||||
|
animation = global, 1, 10, default
|
||||||
|
animation = border, 1, 5.39, easeOutQuint
|
||||||
|
animation = windows, 1, 4.79, easeOutQuint
|
||||||
|
animation = windowsIn, 1, 4.1, easeOutQuint, popin 87%
|
||||||
|
animation = windowsOut, 1, 1.49, linear, popin 87%
|
||||||
|
animation = fadeIn, 1, 1.73, almostLinear
|
||||||
|
animation = fadeOut, 1, 1.46, almostLinear
|
||||||
|
animation = fade, 1, 3.03, quick
|
||||||
|
animation = layers, 1, 3.81, easeOutQuint
|
||||||
|
animation = layersIn, 1, 4, easeOutQuint, fade
|
||||||
|
animation = layersOut, 1, 1.5, linear, fade
|
||||||
|
animation = fadeLayersIn, 1, 1.79, almostLinear
|
||||||
|
animation = fadeLayersOut, 1, 1.39, almostLinear
|
||||||
|
animation = workspaces, 1, 1.94, almostLinear, fade
|
||||||
|
animation = workspacesIn, 1, 1.21, almostLinear, fade
|
||||||
|
animation = workspacesOut, 1, 1.94, almostLinear, fade
|
||||||
|
}
|
||||||
|
|
||||||
|
# Ref https://wiki.hyprland.org/Configuring/Workspace-Rules/
|
||||||
|
# "Smart gaps" / "No gaps when only"
|
||||||
|
workspace = w[tv1], gapsout:0, gapsin:0
|
||||||
|
workspace = f[1], gapsout:0, gapsin:0
|
||||||
|
windowrule = border_size 0, match:float 0, match:workspace w[tv1]
|
||||||
|
windowrule = rounding 0, match:float 0, match:workspace w[tv1]
|
||||||
|
windowrule = border_size 0, match:float 0, match:workspace f[1]
|
||||||
|
windowrule = rounding 0, match:float 0, match:workspace f[1]
|
||||||
|
|
||||||
|
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
|
||||||
|
dwindle {
|
||||||
|
force_split = 2 # split to the bottom right
|
||||||
|
preserve_split = true
|
||||||
|
pseudotile = false
|
||||||
|
}
|
||||||
|
|
||||||
|
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
|
||||||
|
master {
|
||||||
|
new_status = master
|
||||||
|
}
|
||||||
|
|
||||||
|
# https://wiki.hyprland.org/Configuring/Variables/#misc
|
||||||
|
misc {
|
||||||
|
disable_hyprland_logo = true
|
||||||
|
vfr = true # lower amount of sent frames when nothing is happening on-screen
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#############
|
||||||
|
### INPUT ###
|
||||||
|
#############
|
||||||
|
|
||||||
|
# https://wiki.hyprland.org/Configuring/Variables/#input
|
||||||
|
input {
|
||||||
|
kb_layout = us
|
||||||
|
kb_variant =
|
||||||
|
kb_model =
|
||||||
|
kb_options = caps:swapescape
|
||||||
|
kb_rules =
|
||||||
|
|
||||||
|
follow_mouse = 1
|
||||||
|
|
||||||
|
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
|
||||||
|
|
||||||
|
touchpad {
|
||||||
|
natural_scroll = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# https://wiki.hyprland.org/Configuring/Variables/#gestures
|
||||||
|
gestures {
|
||||||
|
workspace_swipe_touch = false
|
||||||
|
}
|
||||||
|
|
||||||
|
# Example per-device config
|
||||||
|
# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more
|
||||||
|
device { # hyprctl devices
|
||||||
|
name = logitech-wireless-mouse-pid:4038
|
||||||
|
sensitivity = -0.5
|
||||||
|
accel_profile = flat
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
###################
|
||||||
|
### KEYBINDINGS ###
|
||||||
|
###################
|
||||||
|
|
||||||
|
# See https://wiki.hyprland.org/Configuring/Keywords/
|
||||||
|
$mainMod = SUPER # Sets "Windows" key as main modifier
|
||||||
|
|
||||||
|
# Bind docs https://wiki.hyprland.org/Configuring/Binds/
|
||||||
|
|
||||||
|
#--- Control ---#
|
||||||
|
|
||||||
|
# Reload hyprland
|
||||||
|
bind = $mainMod Control_L, r, forcerendererreload
|
||||||
|
|
||||||
|
# Close hyprland
|
||||||
|
bind = $mainMod SHIFT, M, exit,
|
||||||
|
|
||||||
|
#--- Window ---#
|
||||||
|
|
||||||
|
# Close window
|
||||||
|
bind = $mainMod, q, killactive,
|
||||||
|
|
||||||
|
#-- State/flags --#
|
||||||
|
|
||||||
|
# Toggle fullscreen mode
|
||||||
|
bind = $mainMod, f, fullscreen
|
||||||
|
|
||||||
|
# Toggle tiled/floating
|
||||||
|
bind = $mainMod, Space, togglefloating,
|
||||||
|
|
||||||
|
#-- Focus --#
|
||||||
|
|
||||||
|
# Focus window in direction
|
||||||
|
bind = $mainMod, h, movefocus, l
|
||||||
|
bind = $mainMod, j, movefocus, d
|
||||||
|
bind = $mainMod, k, movefocus, u
|
||||||
|
bind = $mainMod, l, movefocus, r
|
||||||
|
bind = $mainMod, left, movefocus, l
|
||||||
|
bind = $mainMod, right, movefocus, r
|
||||||
|
bind = $mainMod, up, movefocus, u
|
||||||
|
bind = $mainMod, down, movefocus, d
|
||||||
|
|
||||||
|
# Focus previous/next window
|
||||||
|
bind = $mainMod, Tab, cyclenext
|
||||||
|
bind = $mainMod SHIFT, Tab, cyclenext, prev
|
||||||
|
|
||||||
|
# Focus workspace
|
||||||
|
bind = $mainMod, 1, workspace, 1
|
||||||
|
bind = $mainMod, 2, workspace, 2
|
||||||
|
bind = $mainMod, 3, workspace, 3
|
||||||
|
bind = $mainMod, 4, workspace, 4
|
||||||
|
bind = $mainMod, 5, workspace, 5
|
||||||
|
bind = $mainMod, 6, workspace, 6
|
||||||
|
bind = $mainMod, 7, workspace, 7
|
||||||
|
bind = $mainMod, 8, workspace, 8
|
||||||
|
bind = $mainMod, 9, workspace, 9
|
||||||
|
bind = $mainMod, 0, workspace, 10
|
||||||
|
|
||||||
|
# Focus previous/next workspace
|
||||||
|
bind = $mainMod, equal, workspace, e+1
|
||||||
|
bind = $mainMod, minus, workspace, e-1
|
||||||
|
|
||||||
|
# Focus last workspace
|
||||||
|
bind = $mainMod, GRAVE, focuscurrentorlast
|
||||||
|
|
||||||
|
# Focus previous/next monitor
|
||||||
|
# TODO
|
||||||
|
|
||||||
|
# Special workspace (scratchpad)
|
||||||
|
bind = $mainMod, T, togglespecialworkspace, magic
|
||||||
|
|
||||||
|
#-- Move --#
|
||||||
|
|
||||||
|
# Send window to workspace
|
||||||
|
bind = $mainMod SHIFT, 1, movetoworkspacesilent, 1
|
||||||
|
bind = $mainMod SHIFT, 2, movetoworkspacesilent, 2
|
||||||
|
bind = $mainMod SHIFT, 3, movetoworkspacesilent, 3
|
||||||
|
bind = $mainMod SHIFT, 4, movetoworkspacesilent, 4
|
||||||
|
bind = $mainMod SHIFT, 5, movetoworkspacesilent, 5
|
||||||
|
bind = $mainMod SHIFT, 6, movetoworkspacesilent, 6
|
||||||
|
bind = $mainMod SHIFT, 7, movetoworkspacesilent, 7
|
||||||
|
bind = $mainMod SHIFT, 8, movetoworkspacesilent, 8
|
||||||
|
bind = $mainMod SHIFT, 9, movetoworkspacesilent, 9
|
||||||
|
bind = $mainMod SHIFT, 0, movetoworkspacesilent, 10
|
||||||
|
|
||||||
|
# Move window to previous/next workspace
|
||||||
|
bind = $mainMod SHIFT, equal, movetoworkspace, e+1
|
||||||
|
bind = $mainMod SHIFT, minus, movetoworkspace, e-1
|
||||||
|
|
||||||
|
# Move window to previous/next monitor
|
||||||
|
# TODO
|
||||||
|
|
||||||
|
# Move floating window
|
||||||
|
bind = Control_L Alt_L, h, moveactive, -30 0
|
||||||
|
bind = Control_L Alt_L, j, moveactive, 0 30
|
||||||
|
bind = Control_L Alt_L, k, moveactive, 0 -30
|
||||||
|
bind = Control_L Alt_L, l, moveactive, 30 0
|
||||||
|
bind = Control_L Alt_L, left, moveactive, -30 0
|
||||||
|
bind = Control_L Alt_L, right, moveactive, 30 0
|
||||||
|
bind = Control_L Alt_L, up, moveactive, 0 -30
|
||||||
|
bind = Control_L Alt_L, down, moveactive, 0 30
|
||||||
|
|
||||||
|
# Flip the tree from the current windows parent
|
||||||
|
bind = $mainMod Alt_L, 5, swapsplit, # dwindle
|
||||||
|
bind = $mainMod Alt_L, 6, togglesplit, # dwindle
|
||||||
|
|
||||||
|
# Special workspace (scratchpad)
|
||||||
|
bind = $mainMod SHIFT, T, movetoworkspace, special:magic
|
||||||
|
|
||||||
|
#-- Resize --#
|
||||||
|
|
||||||
|
# Resize windows
|
||||||
|
bind = $mainMod Alt_L, h, resizeactive, -10 0
|
||||||
|
bind = $mainMod Alt_L, j, resizeactive, 0 10
|
||||||
|
bind = $mainMod Alt_L, k, resizeactive, 0 -10
|
||||||
|
bind = $mainMod Alt_L, l, resizeactive, 10 0
|
||||||
|
bind = $mainMod Alt_L, left, resizeactive, -10 0
|
||||||
|
bind = $mainMod Alt_L, right, resizeactive, 10 0
|
||||||
|
bind = $mainMod Alt_L, up, resizeactive, 0 -10
|
||||||
|
bind = $mainMod Alt_L, down, resizeactive, 0 10
|
||||||
|
|
||||||
|
# Move/resize windows with mainMod + LMB/RMB and dragging
|
||||||
|
bindm = $mainMod, mouse:272, movewindow
|
||||||
|
bindm = $mainMod, mouse:273, resizewindow
|
||||||
|
|
||||||
|
#-- Preselect node --#
|
||||||
|
|
||||||
|
bind = SUPER Control_L, h, layoutmsg, preselect left
|
||||||
|
bind = SUPER Control_L, j, layoutmsg, preselect down
|
||||||
|
bind = SUPER Control_L, k, layoutmsg, preselect up
|
||||||
|
bind = SUPER Control_L, l, layoutmsg, preselect right
|
||||||
|
bind = SUPER Control_L, left, layoutmsg, preselect left
|
||||||
|
bind = SUPER Control_L, right, layoutmsg, preselect right
|
||||||
|
bind = SUPER Control_L, up, layoutmsg, preselect up
|
||||||
|
bind = SUPER Control_L, down, layoutmsg, preselect down
|
||||||
|
|
||||||
|
#--- General ---#
|
||||||
|
|
||||||
|
# Start terminal
|
||||||
|
bind = $mainMod, Return, exec, $terminal
|
||||||
|
|
||||||
|
# Start rofi (program launcher)
|
||||||
|
bind = $mainMod, d, exec, $menu
|
||||||
|
|
||||||
|
# mpv
|
||||||
|
bind = $mainMod, m, exec, play
|
||||||
|
bind = $mainMod SHIFT, m, exec, play queue
|
||||||
|
|
||||||
|
#--- Control, compositor agnostic ---#
|
||||||
|
|
||||||
|
# Reload
|
||||||
|
bind = $mainMod Control_L, r, exec, ${HOME}/.local/bin/panel/waybar.sh
|
||||||
|
|
||||||
|
# System
|
||||||
|
bind = $mainMod SHIFT, s, exec, system
|
||||||
|
|
||||||
|
# Screen brightness
|
||||||
|
bind = $mainMod, F2, exec, brictl dec 10
|
||||||
|
bind = $mainMod, F3, exec, brictl inc 10
|
||||||
|
|
||||||
|
# Screen capture
|
||||||
|
bind = , Print, exec, printscreen
|
||||||
|
bind = Control_L, Print, exec, aliases screencast
|
||||||
|
|
||||||
|
# Laptop multimedia keys
|
||||||
|
bindel = , XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
|
||||||
|
bindel = , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
|
||||||
|
bindel = , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
|
||||||
|
bindel = , XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
|
||||||
|
bindel = , XF86MonBrightnessUp, exec, brictl inc 10
|
||||||
|
bindel = , XF86MonBrightnessDown, exec, brictl dec 10
|
||||||
|
|
||||||
|
bindl = , XF86AudioNext, exec, playerctl next
|
||||||
|
bindl = , XF86AudioPause, exec, playerctl play-pause
|
||||||
|
bindl = , XF86AudioPlay, exec, playerctl play-pause
|
||||||
|
bindl = , XF86AudioPrev, exec, playerctl previous
|
||||||
|
|
||||||
|
bindl = , XF86HomePage, exec, inputctl -d toggle # toggle touchpad
|
||||||
|
bindl = , XF86Search, exec, inputctl -s toggle # toggle touchscreen
|
||||||
|
|
||||||
|
#--- Notification ---#
|
||||||
|
|
||||||
|
# Notifiation
|
||||||
|
bind = Control_L, space, exec, dunstctl close
|
||||||
|
bind = Control_L SHIFT, space, exec, dunstctl close-all
|
||||||
|
bind = Control_L, grave, exec, dunstctl history-pop
|
||||||
|
bind = Control_L SHIFT, period, exec, dunstctl context
|
||||||
|
|
||||||
|
|
||||||
|
##############################
|
||||||
|
### WINDOWS AND WORKSPACES ###
|
||||||
|
##############################
|
||||||
|
|
||||||
|
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
|
||||||
|
# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules
|
||||||
|
|
||||||
|
# Ignore maximize requests from apps. You'll probably like this.
|
||||||
|
windowrule = suppress_event maximize, match:class .*
|
||||||
|
|
||||||
|
# Fix some dragging issues with XWayland
|
||||||
|
windowrule = no_focus true, match:class ^$, match:title ^$, match:xwayland true, match:float true, match:fullscreen false, match:pin false
|
||||||
|
|
||||||
|
# Set to floating
|
||||||
|
windowrule = float true, match:class feh # window rule v1 can only do either class or title, not both
|
||||||
|
windowrule = float true, match:class mpv
|
||||||
|
windowrule = float true, match:class org.pulseaudio.pavucontrol
|
||||||
|
windowrule = float true, match:class pinentry-gtk
|
||||||
|
windowrule = float true, match:class xarchiver
|
||||||
|
windowrule = float true, match:class firefox, match:title Library
|
||||||
|
windowrule = float true, match:class firefox, match:title ^About.*
|
||||||
|
windowrule = float true, match:class thunar, match:title File Operation Progress
|
||||||
|
|
||||||
|
# Resize floating windows
|
||||||
|
windowrule = size >50% >70%, match:class org.pulseaudio.pavucontrol
|
||||||
|
|
||||||
|
# Put workspaces on specific monitors
|
||||||
|
workspace = 1, monitor:desc:Ancor Communications Inc ASUS PB298 D7LMTF059917, persistent:true, default:true
|
||||||
|
workspace = 2, monitor:desc:Ancor Communications Inc ASUS PB298 D7LMTF059917, persistent:true
|
||||||
|
workspace = 3, monitor:desc:Ancor Communications Inc ASUS PB298 D7LMTF059917, persistent:true
|
||||||
|
workspace = 4, monitor:desc:Ancor Communications Inc ASUS PB298 D7LMTF059917, persistent:true
|
||||||
|
workspace = 5, monitor:desc:Ancor Communications Inc ASUS PB298 D7LMTF059917, persistent:true
|
||||||
|
workspace = 6, monitor:desc:Ancor Communications Inc ASUS PB298 D7LMTF059917, persistent:true
|
||||||
|
workspace = 7, monitor:desc:Ancor Communications Inc ASUS PB298 D7LMTF059917, persistent:true
|
||||||
|
workspace = 8, monitor:desc:Ancor Communications Inc ASUS PB298 D7LMTF059917, persistent:true
|
||||||
|
workspace = 9, monitor:desc:Iiyama North America PL2492H 11511037C7430, persistent:true, default:true
|
||||||
|
workspace = 10, monitor:desc:Iiyama North America PL2492H 11511037C7430, persistent:true
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
$font_size = 48
|
||||||
|
$font_size_small = 16
|
||||||
|
$image_size = 175
|
||||||
|
|
||||||
|
general {
|
||||||
|
hide_cursor = true
|
||||||
|
ignore_empty_input = true
|
||||||
|
}
|
||||||
|
|
||||||
|
background {
|
||||||
|
monitor =
|
||||||
|
path = screenshot
|
||||||
|
blur_passes = 2
|
||||||
|
blur_size = 2
|
||||||
|
noise = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
font_family = DejaVu Sans Serif
|
||||||
|
font_size = $font_size
|
||||||
|
|
||||||
|
text = $TIME12
|
||||||
|
text_align = center
|
||||||
|
|
||||||
|
position = 0, 275
|
||||||
|
halign = center
|
||||||
|
valign = center
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
font_family = DejaVu Sans Serif
|
||||||
|
font_size = $font_size_small
|
||||||
|
|
||||||
|
text = cmd[] date "+%A, %B %d"
|
||||||
|
|
||||||
|
position = 0, 200
|
||||||
|
halign = center
|
||||||
|
valign = center
|
||||||
|
}
|
||||||
|
|
||||||
|
image {
|
||||||
|
monitor =
|
||||||
|
path = ~/.local/bin/wm/lock.png
|
||||||
|
size = $image_size
|
||||||
|
rounding = -1
|
||||||
|
border_size = 0
|
||||||
|
|
||||||
|
halign = center
|
||||||
|
valign = center
|
||||||
|
}
|
||||||
|
|
||||||
|
input-field {
|
||||||
|
monitor =
|
||||||
|
size = $image_size, $image_size
|
||||||
|
|
||||||
|
outline_thickness = 10
|
||||||
|
outer_color = rgba(255, 255, 255, 0.0)
|
||||||
|
inner_color = rgba(0, 0, 0, 0.0)
|
||||||
|
check_color = rgba(255, 255, 255, 1.0)
|
||||||
|
fail_color = rgba(255, 0, 0, 1.0)
|
||||||
|
|
||||||
|
font_family = DejaVu Sans Serif
|
||||||
|
font_color = rgba(255, 255, 255, 0.9)
|
||||||
|
placeholder_text =
|
||||||
|
fail_text =
|
||||||
|
|
||||||
|
hide_input = true
|
||||||
|
rounding = -1
|
||||||
|
fade_on_empty = false
|
||||||
|
|
||||||
|
halign = center
|
||||||
|
valign = center
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
splash = false
|
||||||
+2
-2
@@ -13,8 +13,8 @@ set $mod2 Mod1
|
|||||||
floating_modifier $mod
|
floating_modifier $mod
|
||||||
|
|
||||||
# Application startup
|
# Application startup
|
||||||
exec_always --no-startup-id $HOME/.scripts/wm/wallpaper.sh &
|
exec_always --no-startup-id $HOME/.local/bin/wm/wallpaper.sh &
|
||||||
exec_always --no-startup-id $HOME/.scripts/panel/polybar.sh &
|
exec_always --no-startup-id $HOME/.local/bin/panel/polybar.sh &
|
||||||
exec --no-startup-id firefox &
|
exec --no-startup-id firefox &
|
||||||
exec --no-startup-id urxvt &
|
exec --no-startup-id urxvt &
|
||||||
exec --no-startup-id thunar &
|
exec --no-startup-id thunar &
|
||||||
|
|||||||
@@ -0,0 +1,110 @@
|
|||||||
|
# -*- conf -*-
|
||||||
|
|
||||||
|
#--- Account ---#
|
||||||
|
IMAPAccount info
|
||||||
|
Host mail.riyyi.com
|
||||||
|
Port 993
|
||||||
|
UserCmd "gpg2 -q --for-your-eyes-only --no-tty -d ~/.config/emacs/etc/authinfo.gpg | awk -F ' ' '/info/ { print $(NF-2); exit; }'"
|
||||||
|
PassCmd "gpg2 -q --for-your-eyes-only --no-tty -d ~/.config/emacs/etc/authinfo.gpg | awk -F ' ' '/info/ { print $NF; exit; }'"
|
||||||
|
# SSL
|
||||||
|
SSLType IMAPS
|
||||||
|
SSLVersions TLSv1.3
|
||||||
|
CertificateFile /etc/ssl/certs/ca-certificates.crt
|
||||||
|
|
||||||
|
#--- Remote ---#
|
||||||
|
IMAPStore info-remote
|
||||||
|
Account info
|
||||||
|
|
||||||
|
#--- Local ---#
|
||||||
|
MaildirStore info-local
|
||||||
|
# IMAP subfolders represent local subfolders
|
||||||
|
SubFolders Verbatim
|
||||||
|
# The trailing "/" is important
|
||||||
|
Path ~/mail/info/
|
||||||
|
Inbox ~/mail/info/Inbox
|
||||||
|
|
||||||
|
#--- Sync ---#
|
||||||
|
Channel info
|
||||||
|
Far :info-remote:
|
||||||
|
Near :info-local:
|
||||||
|
# Automatically create missing mailboxes, only locally
|
||||||
|
Create Near
|
||||||
|
# Do not permanently remove all messages marked for deletion
|
||||||
|
Expunge None
|
||||||
|
# Include everything
|
||||||
|
Patterns *
|
||||||
|
# Save the synchronization state files in the relevant directory
|
||||||
|
SyncState *
|
||||||
|
# Make sure the date of the arrival stays the same when you move messages around
|
||||||
|
CopyArrivalDate yes
|
||||||
|
|
||||||
|
# ------------------------------------------
|
||||||
|
|
||||||
|
#--- Account ---#
|
||||||
|
IMAPAccount private
|
||||||
|
Host mail.riyyi.com
|
||||||
|
Port 993
|
||||||
|
UserCmd "gpg2 -q --for-your-eyes-only --no-tty -d ~/.config/emacs/etc/authinfo.gpg | awk -F ' ' '/private/ { print $(NF-2); exit; }'"
|
||||||
|
PassCmd "gpg2 -q --for-your-eyes-only --no-tty -d ~/.config/emacs/etc/authinfo.gpg | awk -F ' ' '/private/ { print $NF; exit; }'"
|
||||||
|
# SSL
|
||||||
|
SSLType IMAPS
|
||||||
|
SSLVersions TLSv1.3
|
||||||
|
CertificateFile /etc/ssl/certs/ca-certificates.crt
|
||||||
|
|
||||||
|
#--- Remote ---#
|
||||||
|
IMAPStore private-remote
|
||||||
|
Account private
|
||||||
|
|
||||||
|
#--- Local ---#
|
||||||
|
MaildirStore private-local
|
||||||
|
# IMAP subfolders represent local subfolders
|
||||||
|
SubFolders Verbatim
|
||||||
|
# The trailing "/" is important
|
||||||
|
Path ~/mail/private/
|
||||||
|
Inbox ~/mail/private/Inbox
|
||||||
|
|
||||||
|
#--- Sync ---#
|
||||||
|
Channel private
|
||||||
|
Far :private-remote:
|
||||||
|
Near :private-local:
|
||||||
|
# Automatically create missing mailboxes, only locally
|
||||||
|
Create Near
|
||||||
|
# Do not permanently remove all messages marked for deletion
|
||||||
|
Expunge None
|
||||||
|
# Include everything
|
||||||
|
Patterns *
|
||||||
|
# Save the synchronization state files in the relevant directory
|
||||||
|
SyncState *
|
||||||
|
# Make sure the date of the arrival stays the same when you move messages around
|
||||||
|
CopyArrivalDate yes
|
||||||
|
|
||||||
|
# ------------------------------------------
|
||||||
|
|
||||||
|
# https://www.gnu.org/software/emacs/manual/html_node/smtpmail/Authentication.html
|
||||||
|
|
||||||
|
# Example config:
|
||||||
|
|
||||||
|
# machine fullname login "<FULL_NAME>"
|
||||||
|
|
||||||
|
# machine info port 993 login <MAIL> password <SECRET>
|
||||||
|
# machine private port 993 login <MAIL> password <SECRET>
|
||||||
|
|
||||||
|
# machine mail.riyyi.com port 587 login <MAIL> password <SECRET>
|
||||||
|
# machine mail.riyyi.com port 587 login <MAIL> password <SECRET>
|
||||||
|
|
||||||
|
# Create password file:
|
||||||
|
|
||||||
|
# $ touch ~/.config/emacs/etc/authinfo.gpg
|
||||||
|
# $ echo "<CONFIG>" > ~/.config/emacs/etc/authinfo.gpg
|
||||||
|
# $ gpg -e -r <MAIL_USED_FOR_GPG> ~/.config/emacs/etc/authinfo.gpg
|
||||||
|
|
||||||
|
# Run to sync mail:
|
||||||
|
# $ mbsync -a -c ~/.config/isync/mbsyncrc
|
||||||
|
|
||||||
|
# Initialize mu:
|
||||||
|
# mu init --maildir=~/mail --my-address=<MAIL> --my-address=<MAIL2>
|
||||||
|
# mu index
|
||||||
|
|
||||||
|
# Packages:
|
||||||
|
# isync
|
||||||
|
# mu (AUR)
|
||||||
@@ -1,13 +1,22 @@
|
|||||||
[dmenu]
|
[dmenu]
|
||||||
dmenu_command = /usr/bin/rofi
|
dmenu_command = /usr/bin/rofi -dmenu -i
|
||||||
pinentry = /usr/bin/pinentry
|
pinentry = /usr/bin/pinentry-gtk
|
||||||
|
|
||||||
[database]
|
[database]
|
||||||
database_1 = ~/documents/password.kdbx
|
database_1 = ~/documents/password.kdbx
|
||||||
|
keyfile_1 =
|
||||||
pw_cache_period_min = 60
|
pw_cache_period_min = 60
|
||||||
|
autotype_default = {USERNAME}{TAB}{PASSWORD}{ENTER}
|
||||||
|
|
||||||
gui_editor = emacsclient
|
gui_editor = emacsclient
|
||||||
editor = vim
|
editor = vim
|
||||||
terminal = urxvt
|
terminal = urxvt
|
||||||
|
|
||||||
|
# >>> session=xorg
|
||||||
type_library = xdotool
|
type_library = xdotool
|
||||||
|
# <<<
|
||||||
|
# >>> session=wayland
|
||||||
|
# type_library = ydotool
|
||||||
|
# <<<
|
||||||
|
|
||||||
hide_groups = Recycle Bin
|
hide_groups = Recycle Bin
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"ignorePatterns": [
|
||||||
|
".git/",
|
||||||
|
"*.md",
|
||||||
|
"manafiles.json",
|
||||||
|
"packages",
|
||||||
|
"README.org",
|
||||||
|
"screenshot.png"
|
||||||
|
],
|
||||||
|
"systemPatterns": [
|
||||||
|
"/boot/",
|
||||||
|
"/etc/",
|
||||||
|
"/usr/lib/",
|
||||||
|
"/usr/share/"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -38,7 +38,7 @@ text/css=emacsclient.desktop
|
|||||||
text/html=firefox.desktop
|
text/html=firefox.desktop
|
||||||
text/markdown=emacsclient.desktop
|
text/markdown=emacsclient.desktop
|
||||||
text/plain=emacsclient.desktop
|
text/plain=emacsclient.desktop
|
||||||
text/plain=org.gnome.gedit.desktop
|
text/plain=emacsclient.desktop
|
||||||
text/x-c++src=emacsclient.desktop
|
text/x-c++src=emacsclient.desktop
|
||||||
text/x-cmake=emacsclient.desktop
|
text/x-cmake=emacsclient.desktop
|
||||||
text/x-csrc=emacsclient.desktop
|
text/x-csrc=emacsclient.desktop
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ sub-auto=fuzzy
|
|||||||
sub-file-paths=ass:srt:sub:subs:subtitles:Subtitles
|
sub-file-paths=ass:srt:sub:subs:subtitles:Subtitles
|
||||||
|
|
||||||
# [SUBTITLES LOOK] (for srt)
|
# [SUBTITLES LOOK] (for srt)
|
||||||
sub-font="Segoe UI Semibold"
|
sub-font="DejaVu Sans"
|
||||||
sub-font-size=48
|
sub-font-size=48
|
||||||
sub-margin-y=36
|
sub-margin-y=36
|
||||||
sub-color="#FFFFFFFF"
|
sub-color="#FFFFFFFF"
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-- when opening a .lua file, this file gets executed
|
||||||
|
vim.opt.expandtab = false
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
require("core")
|
||||||
|
require("packages").setup({
|
||||||
|
require("ui"),
|
||||||
|
require("selection"),
|
||||||
|
require("editor"),
|
||||||
|
require("development"),
|
||||||
|
require("git"),
|
||||||
|
})
|
||||||
|
require("terminal").setup()
|
||||||
|
require("keybinds").setup()
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||||
|
"LuaSnip": { "branch": "master", "commit": "3732756842a2f7e0e76a7b0487e9692072857277" },
|
||||||
|
"auto-save.nvim": { "branch": "main", "commit": "37c82fd548e3f5ffc2d9d020a65dac1044584f44" },
|
||||||
|
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||||
|
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
||||||
|
"cmp-nvim-lua": { "branch": "main", "commit": "e3a22cb071eb9d6508a156306b102c45cd2d573d" },
|
||||||
|
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
||||||
|
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||||
|
"dashboard-nvim": { "branch": "master", "commit": "0775e567b6c0be96d01a61795f7b64c1758262f6" },
|
||||||
|
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
|
||||||
|
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||||
|
"gitsigns.nvim": { "branch": "main", "commit": "5813e4878748805f1518cee7abb50fd7205a3a48" },
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
||||||
|
"lspkind.nvim": { "branch": "master", "commit": "3ddd1b4edefa425fda5a9f95a4f25578727c0bb3" },
|
||||||
|
"lspsaga.nvim": { "branch": "main", "commit": "8efe00d6aed9db6449969f889170f1a7e43101a1" },
|
||||||
|
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
|
||||||
|
"neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" },
|
||||||
|
"neogit": { "branch": "master", "commit": "d8bf9102692250193b855acd9025a826f1af2729" },
|
||||||
|
"nvim-base16": { "branch": "master", "commit": "e05bcb99951d8ae4ecbf4ae053922fd2be6263a5" },
|
||||||
|
"nvim-cmp": { "branch": "main", "commit": "d97d85e01339f01b842e6ec1502f639b080cb0fc" },
|
||||||
|
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "d696e36d5792daf828f8c8e8d4b9aa90c1a10c2a" },
|
||||||
|
"nvim-treesitter": { "branch": "main", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||||
|
"nvim-treesitter-textobjects": { "branch": "master", "commit": "5ca4aaa6efdcc59be46b95a3e876300cfead05ef" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "6788013bb9cb784e606ada44206b0e755e4323d7" },
|
||||||
|
"omnisharp-extended-lsp.nvim": { "branch": "main", "commit": "a47388e5417e7f1cfa6962cc441a23c4c5fb2151" },
|
||||||
|
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||||
|
"project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" },
|
||||||
|
"rainbow-delimiters.nvim": { "branch": "master", "commit": "8aafe2cbd89cd4090f573a98cab6b20366576fde" },
|
||||||
|
"sqlite.lua": { "branch": "master", "commit": "50092d60feb242602d7578398c6eb53b4a8ffe7b" },
|
||||||
|
"telescope-all-recent.nvim": { "branch": "main", "commit": "e437f60ea468268e49ffdc0c9ed7c5ba384e63cf" },
|
||||||
|
"telescope-file-browser.nvim": { "branch": "master", "commit": "3610dc7dc91f06aa98b11dca5cc30dfa98626b7e" },
|
||||||
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
|
||||||
|
"telescope-recent-files": { "branch": "main", "commit": "eb190c0baded1cbfa9d8767c817b054377683163" },
|
||||||
|
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||||
|
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
||||||
|
"toggleterm.nvim": { "branch": "main", "commit": "9a88eae817ef395952e08650b3283726786fb5fb" },
|
||||||
|
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" },
|
||||||
|
"ultimate-autopair.nvim": { "branch": "development", "commit": "5835876b57901d81ebbeb3cd6ad71aaed66f82d7" },
|
||||||
|
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
|
||||||
|
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
require("core.leader-key")
|
||||||
|
require("core.config")
|
||||||
|
require("core.buffers")
|
||||||
|
require("core.autocommands")
|
||||||
|
require("core.globals")
|
||||||
|
require("core.filetypes")
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
local F = require("core.functions")
|
||||||
|
|
||||||
|
--------------------------------------------
|
||||||
|
--- Commands ---
|
||||||
|
|
||||||
|
-- Prevent typo
|
||||||
|
vim.cmd [[
|
||||||
|
cnoreabbrev <expr> W (getcmdtype() is# ":" && getcmdline() is# "W") ? ("w") : ("W")
|
||||||
|
cnoreabbrev <expr> Q (getcmdtype() is# ":" && getcmdline() is# "Q") ? ("q") : ("Q")
|
||||||
|
cnoreabbrev <expr> WQ (getcmdtype() is# ":" && getcmdline() is# "WQ") ? ("wq") : ("WQ")
|
||||||
|
cnoreabbrev <expr> Wq (getcmdtype() is# ":" && getcmdline() is# "Wq") ? ("wq") : ("Wq")
|
||||||
|
]]
|
||||||
|
|
||||||
|
--------------------------------------------
|
||||||
|
--- Autocommands ---
|
||||||
|
|
||||||
|
-- Cut off trailing whitespace and trailing blank lines
|
||||||
|
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
||||||
|
pattern = "*",
|
||||||
|
callback = F.trim_buffer,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Highlight on yank
|
||||||
|
-- See `:help vim.highlight.on_yank()`
|
||||||
|
local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true })
|
||||||
|
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||||
|
pattern = "*",
|
||||||
|
group = highlight_group,
|
||||||
|
callback = function() vim.highlight.on_yank() end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Show message when autosaving
|
||||||
|
local autosave_group = vim.api.nvim_create_augroup("autosave", {})
|
||||||
|
vim.api.nvim_create_autocmd("User", {
|
||||||
|
pattern = "AutoSaveWritePost",
|
||||||
|
group = autosave_group,
|
||||||
|
callback = function(opts)
|
||||||
|
if opts.data.saved_buffer ~= nil then
|
||||||
|
local filename = vim.api.nvim_buf_get_name(opts.data.saved_buffer)
|
||||||
|
vim.notify("Wrote " .. filename, vim.log.levels.INFO)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("BufWinEnter", {
|
||||||
|
callback = function()
|
||||||
|
-- Buffer tracking
|
||||||
|
require("core.buffers").add_buffer()
|
||||||
|
end,
|
||||||
|
desc = "Track all full window buffers visited",
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "BufDelete", "BufWipeout" }, {
|
||||||
|
callback = function(opts)
|
||||||
|
-- Buffer tracking
|
||||||
|
require("core.buffers").remove_buffer(opts.match)
|
||||||
|
end,
|
||||||
|
desc = "Track all full window buffers killed",
|
||||||
|
})
|
||||||
@@ -0,0 +1,347 @@
|
|||||||
|
local F = require("core.functions")
|
||||||
|
|
||||||
|
-- Module for managing buffers, these are used for navigation
|
||||||
|
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
-- Buffers, categorized into groups
|
||||||
|
-- {
|
||||||
|
-- { group = "Project", buffers = { "buffer1", "buffer2" }, active_index = 1 },
|
||||||
|
-- { group = "Other", buffers = { "buffer3", "buffer4" }, active_index = 1 },
|
||||||
|
-- }
|
||||||
|
M.buffers = {}
|
||||||
|
|
||||||
|
M.buffer_default_group = "Other"
|
||||||
|
|
||||||
|
M.buffer_matcher = {
|
||||||
|
-- match = truthy, function() -> thruthy, or string matching buffer filename
|
||||||
|
-- group = string, function() -> string
|
||||||
|
{ match = F.find_project_root, group = F.find_project_root },
|
||||||
|
{ match = true, group = "Other" }, -- default
|
||||||
|
}
|
||||||
|
|
||||||
|
--------------------------------------------
|
||||||
|
|
||||||
|
local get_buffer_name = function()
|
||||||
|
local buf = vim.api.nvim_get_current_buf()
|
||||||
|
local buffer_name = vim.api.nvim_buf_get_name(buf)
|
||||||
|
if not buffer_name or buffer_name == "" then return nil end
|
||||||
|
return buffer_name
|
||||||
|
end
|
||||||
|
|
||||||
|
M.add_buffer = function()
|
||||||
|
local buffer_name = get_buffer_name()
|
||||||
|
if not buffer_name then return end
|
||||||
|
|
||||||
|
-- Evaluate group
|
||||||
|
local eval_group = function(config_group)
|
||||||
|
if not config_group then return M.buffer_default_group end
|
||||||
|
if type(config_group) == "function" then return config_group() end
|
||||||
|
return config_group
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Add if buffer does not exist yet
|
||||||
|
local add = function(config_group)
|
||||||
|
local group = eval_group(config_group)
|
||||||
|
|
||||||
|
local index
|
||||||
|
for i, buffer_group in ipairs(M.buffers) do
|
||||||
|
if buffer_group.group == group then index = i end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Group is new entirely, so we only have 1 buffer
|
||||||
|
if not index then
|
||||||
|
table.insert(M.buffers, { group = group, buffers = { buffer_name }, active_index = 1 })
|
||||||
|
return #M.buffers, 1 -- group index, buffer index
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Buffer previously added, set active
|
||||||
|
for i, buffer in ipairs(M.buffers[index].buffers) do
|
||||||
|
if buffer == buffer_name then
|
||||||
|
M.buffers[index].active_index = i
|
||||||
|
return index, i -- group index, buffer index
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Buffer is new, add it to the list
|
||||||
|
table.insert(M.buffers[index].buffers, buffer_name)
|
||||||
|
local count = #M.buffers[index].buffers
|
||||||
|
M.buffers[index].active_index = count
|
||||||
|
|
||||||
|
return index, count -- group index, buffer index
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Walk matcher configuration
|
||||||
|
local matcher = M.buffer_matcher or {}
|
||||||
|
if matcher and type(matcher) == "function" then
|
||||||
|
matcher = matcher()
|
||||||
|
end
|
||||||
|
if #matcher == 0 then add(M.buffer_default_group) end
|
||||||
|
for _, config in ipairs(M.buffer_matcher) do
|
||||||
|
if type(config.match) == "function" and config.match() then
|
||||||
|
return add(config.group)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Match path's filename
|
||||||
|
if type(config.match) == "string" and config.match == buffer_name:match("([^/]+)$") then
|
||||||
|
return add(config.group)
|
||||||
|
end
|
||||||
|
|
||||||
|
if type(config.match) == "boolean" and config.match then
|
||||||
|
return add(config.group)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return add(M.buffer_default_group)
|
||||||
|
end
|
||||||
|
|
||||||
|
local get_group_from_buffer = function(buffer_name)
|
||||||
|
for i, buffer_group in ipairs(M.buffers) do
|
||||||
|
for j, buffer in ipairs(buffer_group.buffers) do
|
||||||
|
if buffer == buffer_name then
|
||||||
|
return i, j -- group index, buffer index
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local focus_buffer = function(new_buffer_name)
|
||||||
|
for _, buffer in ipairs(vim.api.nvim_list_bufs()) do
|
||||||
|
if vim.api.nvim_buf_get_name(buffer) == new_buffer_name then
|
||||||
|
vim.api.nvim_set_current_buf(buffer)
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
M.remove_buffer = function(buffer_name)
|
||||||
|
if not buffer_name or buffer_name == "" then return end
|
||||||
|
|
||||||
|
local group_index, buffer_index = get_group_from_buffer(buffer_name)
|
||||||
|
if not group_index or not buffer_index then return end
|
||||||
|
|
||||||
|
local buffer_group = M.buffers[group_index]
|
||||||
|
|
||||||
|
-- Remove the buffer and decrease active index
|
||||||
|
table.remove(buffer_group.buffers, buffer_index)
|
||||||
|
buffer_group.active_index = math.max(buffer_group.active_index - 1, 1)
|
||||||
|
local new_buffer_name = buffer_group.buffers[buffer_group.active_index]
|
||||||
|
|
||||||
|
-- If there are now no buffers in the group, delete the group
|
||||||
|
if #buffer_group.buffers == 0 then
|
||||||
|
table.remove(M.buffers, group_index)
|
||||||
|
if #M.buffers == 0 then return end
|
||||||
|
if #M.buffers < group_index then group_index = group_index - 1 end
|
||||||
|
new_buffer_name = M.buffers[group_index].buffers[M.buffers[group_index].active_index]
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Make the new index the active buffer
|
||||||
|
focus_buffer(new_buffer_name)
|
||||||
|
end
|
||||||
|
|
||||||
|
local buffer_action_in_active_group = function(action, direction)
|
||||||
|
local buffer_name = get_buffer_name()
|
||||||
|
if not buffer_name then return end
|
||||||
|
|
||||||
|
-- Get active group from the current buffer
|
||||||
|
local group_index, buffer_index = get_group_from_buffer(buffer_name)
|
||||||
|
if not group_index then group_index, buffer_index = M.add_buffer() end
|
||||||
|
|
||||||
|
-- Get buffer set
|
||||||
|
local buffers = M.buffers[group_index].buffers
|
||||||
|
if #buffers < 2 then return end
|
||||||
|
|
||||||
|
-- Determine the other index
|
||||||
|
local other_index = buffer_index + direction
|
||||||
|
if buffer_index == 1 and direction == -1 then
|
||||||
|
other_index = #buffers
|
||||||
|
elseif buffer_index == #buffers and direction == 1 then
|
||||||
|
other_index = 1
|
||||||
|
end
|
||||||
|
|
||||||
|
if action == "move" then
|
||||||
|
for _, buffer in ipairs(vim.api.nvim_list_bufs()) do
|
||||||
|
-- TODO: Probably not needed if the other autocommands are implemented
|
||||||
|
-- Remove inactive buffers
|
||||||
|
if not vim.api.nvim_buf_is_loaded(buffer) then
|
||||||
|
for i, group_buffer in ipairs(buffers) do
|
||||||
|
if buffer == group_buffer then
|
||||||
|
table.remove(buffers, i)
|
||||||
|
if i > 1 and i <= other_index then
|
||||||
|
other_index = other_index - 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
goto continue
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Make buffer active
|
||||||
|
if vim.api.nvim_buf_get_name(buffer) == buffers[other_index] then
|
||||||
|
vim.api.nvim_set_current_buf(buffer)
|
||||||
|
M.buffers[group_index].active_index = other_index
|
||||||
|
break
|
||||||
|
end
|
||||||
|
|
||||||
|
::continue::
|
||||||
|
end
|
||||||
|
elseif action == "swap" then
|
||||||
|
local tmp = buffers[other_index]
|
||||||
|
buffers[other_index] = buffers[buffer_index]
|
||||||
|
buffers[buffer_index] = tmp
|
||||||
|
end
|
||||||
|
|
||||||
|
M.buffers[group_index].buffers = buffers
|
||||||
|
end
|
||||||
|
|
||||||
|
M.buffer_move_left = function()
|
||||||
|
buffer_action_in_active_group("move", -1)
|
||||||
|
end
|
||||||
|
|
||||||
|
M.buffer_move_right = function()
|
||||||
|
buffer_action_in_active_group("move", 1)
|
||||||
|
end
|
||||||
|
|
||||||
|
M.buffer_swap_left = function()
|
||||||
|
buffer_action_in_active_group("swap", -1)
|
||||||
|
end
|
||||||
|
|
||||||
|
M.buffer_swap_right = function()
|
||||||
|
buffer_action_in_active_group("swap", 1)
|
||||||
|
end
|
||||||
|
|
||||||
|
--------------------------------------------
|
||||||
|
-- Group move
|
||||||
|
|
||||||
|
local buffer_group_move = function(direction)
|
||||||
|
local buffer_name = get_buffer_name()
|
||||||
|
if not buffer_name then return end
|
||||||
|
|
||||||
|
-- Get active group from the current buffer
|
||||||
|
local group_index, _ = get_group_from_buffer(buffer_name)
|
||||||
|
if not group_index then group_index, _ = M.add_buffer() end
|
||||||
|
|
||||||
|
-- Check groups bounds
|
||||||
|
if #M.buffers < 2 then return end
|
||||||
|
|
||||||
|
-- Determine the other index
|
||||||
|
local other_index = group_index + direction
|
||||||
|
if group_index == 1 and direction == -1 then
|
||||||
|
other_index = #M.buffers
|
||||||
|
elseif group_index == #M.buffers and direction == 1 then
|
||||||
|
other_index = 1
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Get active index from other group
|
||||||
|
local other_active_index = M.buffers[other_index].active_index
|
||||||
|
|
||||||
|
-- Make buffer active
|
||||||
|
-- TODO: What do if this buffer no longer exists?
|
||||||
|
local other_buffer = M.buffers[other_index].buffers[other_active_index]
|
||||||
|
focus_buffer(other_buffer)
|
||||||
|
end
|
||||||
|
|
||||||
|
M.buffer_group_move_up = function()
|
||||||
|
buffer_group_move(-1)
|
||||||
|
end
|
||||||
|
|
||||||
|
M.buffer_group_move_down = function()
|
||||||
|
buffer_group_move(1)
|
||||||
|
end
|
||||||
|
|
||||||
|
--------------------------------------------
|
||||||
|
-- Telescope functionss
|
||||||
|
|
||||||
|
local pick = function(title, items, entry_maker, action)
|
||||||
|
local actions = require("telescope.actions")
|
||||||
|
local action_state = require("telescope.actions.state")
|
||||||
|
local conf = require("telescope.config").values
|
||||||
|
local finders = require("telescope.finders")
|
||||||
|
local pickers = require("telescope.pickers")
|
||||||
|
|
||||||
|
pickers.new({}, {
|
||||||
|
prompt_title = title,
|
||||||
|
finder = finders.new_table {
|
||||||
|
results = items,
|
||||||
|
entry_maker = entry_maker,
|
||||||
|
},
|
||||||
|
previewer = false,
|
||||||
|
sorter = conf.generic_sorter({}),
|
||||||
|
attach_mappings = function(prompt_bufnr)
|
||||||
|
actions.select_default:replace(function()
|
||||||
|
actions.close(prompt_bufnr)
|
||||||
|
|
||||||
|
local selection = action_state.get_selected_entry()
|
||||||
|
action(selection)
|
||||||
|
end)
|
||||||
|
|
||||||
|
return true
|
||||||
|
end,
|
||||||
|
}):find()
|
||||||
|
end
|
||||||
|
|
||||||
|
M.buffer_pick_buffer = function()
|
||||||
|
local buffer_name = get_buffer_name()
|
||||||
|
if not buffer_name then return end
|
||||||
|
|
||||||
|
-- Get active group from the current buffer
|
||||||
|
local group_index, _ = get_group_from_buffer(buffer_name)
|
||||||
|
if not group_index then group_index, _ = M.add_buffer() end
|
||||||
|
|
||||||
|
-- Get all buffers from the active group
|
||||||
|
local buffers = {}
|
||||||
|
for i, buffer in ipairs(M.buffers[group_index].buffers) do
|
||||||
|
table.insert(buffers, { key = buffer, value = tostring(i) })
|
||||||
|
end
|
||||||
|
|
||||||
|
pick("Group buffers",
|
||||||
|
buffers,
|
||||||
|
function(buffer)
|
||||||
|
-- Only show last part of the path
|
||||||
|
local display = buffer.key:match("^.+/(.+)$") or buffer.key
|
||||||
|
return {
|
||||||
|
display = display, -- shown in the picker
|
||||||
|
ordinal = buffer.value, -- used for sorting/filtering
|
||||||
|
value = buffer.value, -- actual value
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
function(selection)
|
||||||
|
local new_buffer_name = M.buffers[group_index].buffers[tonumber(selection.value)]
|
||||||
|
|
||||||
|
-- Make new buffer active
|
||||||
|
focus_buffer(new_buffer_name)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
M.buffer_pick_group = function()
|
||||||
|
-- Get all groups
|
||||||
|
local groups = {}
|
||||||
|
for i, buffer_group in ipairs(M.buffers) do
|
||||||
|
table.insert(groups, { key = buffer_group.group, value = tostring(i) })
|
||||||
|
end
|
||||||
|
|
||||||
|
pick("Groups",
|
||||||
|
groups,
|
||||||
|
function(group)
|
||||||
|
-- Only show last part of the path
|
||||||
|
local display = group.key:match("^.+/(.+)$") or group.key
|
||||||
|
return {
|
||||||
|
display = display, -- shown in the picker
|
||||||
|
ordinal = group.value, -- used for sorting/filtering
|
||||||
|
value = group.value, -- actual value
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
function(selection)
|
||||||
|
local buffer_group = M.buffers[tonumber(selection.value)]
|
||||||
|
local new_buffer_name = buffer_group.buffers[buffer_group.active_index]
|
||||||
|
|
||||||
|
-- Make new buffer active
|
||||||
|
focus_buffer(new_buffer_name)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
--- Behavior ---
|
||||||
|
|
||||||
|
-- vim.opt.autochdir = true
|
||||||
|
vim.opt.clipboard = "unnamedplus"
|
||||||
|
vim.opt.encoding = "utf-8"
|
||||||
|
vim.opt.fileencoding = "utf-8"
|
||||||
|
vim.opt.mouse = "a"
|
||||||
|
vim.opt.scrolloff = 8
|
||||||
|
vim.opt.signcolumn = "yes" -- always show gutter/fringe
|
||||||
|
vim.opt.ttimeoutlen = 0
|
||||||
|
|
||||||
|
-- Case-insensitive searching UNLESS \C or capital in search
|
||||||
|
vim.opt.ignorecase = true
|
||||||
|
vim.opt.smartcase = true
|
||||||
|
|
||||||
|
--- Editing ---
|
||||||
|
|
||||||
|
vim.opt.number = true
|
||||||
|
vim.opt.breakindent = true
|
||||||
|
|
||||||
|
vim.opt.backspace = "indent,eol,start"
|
||||||
|
vim.opt.expandtab = false
|
||||||
|
vim.opt.shiftround = true
|
||||||
|
vim.opt.shiftwidth = 4
|
||||||
|
vim.opt.softtabstop = 4
|
||||||
|
vim.opt.tabstop = 4
|
||||||
|
|
||||||
|
vim.opt.smartindent = true
|
||||||
|
|
||||||
|
vim.opt.wrap = false
|
||||||
|
|
||||||
|
--- Files
|
||||||
|
|
||||||
|
vim.opt.backup = true
|
||||||
|
vim.opt.backupdir = vim.fn.stdpath("cache") .. "/backup"
|
||||||
|
vim.opt.swapfile = false
|
||||||
|
vim.opt.undofile = true
|
||||||
|
vim.opt.undodir = vim.fn.stdpath("cache") .. "/undodir"
|
||||||
|
|
||||||
|
vim.opt.shadafile = vim.fn.stdpath("cache") .. "/netrwhist"
|
||||||
|
|
||||||
|
--- UI ---
|
||||||
|
|
||||||
|
vim.opt.colorcolumn = "81"
|
||||||
|
vim.opt.completeopt = "menuone,noselect"
|
||||||
|
vim.opt.cursorline = true
|
||||||
|
vim.opt.fillchars = vim.opt.fillchars + "diff:╱"
|
||||||
|
vim.opt.showtabline = 0
|
||||||
|
vim.opt.termguicolors = true
|
||||||
|
vim.opt.title = true
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
vim.filetype.add({
|
||||||
|
extension = {
|
||||||
|
flw = "lua",
|
||||||
|
},
|
||||||
|
})
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
local M = {}
|
||||||
|
|
||||||
|
M.is_buffer_a_file = function()
|
||||||
|
local buffer_name = vim.fn.bufname()
|
||||||
|
|
||||||
|
return buffer_name ~= "" and vim.fn.filereadable(buffer_name) == 1
|
||||||
|
end
|
||||||
|
|
||||||
|
M.normalize_path = function(path)
|
||||||
|
if not path then return nil end
|
||||||
|
return IS_WINDOWS() and path:gsub("\\", "/") or path
|
||||||
|
end
|
||||||
|
|
||||||
|
M.get_file_path = function()
|
||||||
|
if not M.is_buffer_a_file() then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
local file_path = vim.fn.expand("%:p")
|
||||||
|
|
||||||
|
return M.normalize_path(vim.fn.fnamemodify(file_path, ":h")) .. "/"
|
||||||
|
end
|
||||||
|
|
||||||
|
M.get_netrw_path = function() -- b:netrw_curdir
|
||||||
|
if vim.fn.expand("#" .. vim.fn.bufnr()) == "0" then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
return M.normalize_path(vim.fn.fnamemodify(vim.fn.bufname(), ":p"))
|
||||||
|
end
|
||||||
|
|
||||||
|
M.get_current_directory = function()
|
||||||
|
return M.get_file_path() or M.get_netrw_path() or M.normalize_path(vim.fn.getcwd())
|
||||||
|
end
|
||||||
|
|
||||||
|
M.find_project_root = function()
|
||||||
|
local current_directory = M.get_current_directory()
|
||||||
|
if current_directory:match("^term://") then return nil, current_directory end
|
||||||
|
|
||||||
|
local directory = current_directory
|
||||||
|
while directory ~= "/" and not directory:match("^%a:[/\\]?$") do
|
||||||
|
local git_path = vim.loop.fs_stat(directory .. "/.git")
|
||||||
|
if git_path then
|
||||||
|
return M.normalize_path(directory:gsub("/$", "")) -- remove trailing slash
|
||||||
|
end
|
||||||
|
|
||||||
|
local project_file = vim.loop.fs_stat(directory .. "/.project")
|
||||||
|
if project_file and project_file.type == "file" then
|
||||||
|
return M.normalize_path(directory:gsub("/$", "")) -- remove trailing slash
|
||||||
|
end
|
||||||
|
|
||||||
|
directory = M.normalize_path(vim.fn.fnamemodify(directory, ":h"))
|
||||||
|
end
|
||||||
|
|
||||||
|
return nil, current_directory
|
||||||
|
end
|
||||||
|
|
||||||
|
-- This will merge tables with index-value pairs and keep the unique values
|
||||||
|
M.table_merge_unique = function(...)
|
||||||
|
local result = {}
|
||||||
|
local seen_values = {}
|
||||||
|
for _, value in ipairs(vim.tbl_flatten(...)) do
|
||||||
|
if not seen_values[value] then
|
||||||
|
seen_values[value] = true
|
||||||
|
table.insert(result, value)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Cut off trailing whitespace and trailing blank lines
|
||||||
|
-- https://vi.stackexchange.com/questions/37421/how-to-remove-neovim-trailing-white-space
|
||||||
|
-- https://stackoverflow.com/questions/7495932/how-can-i-trim-blank-lines-at-the-end-of-file-in-vim
|
||||||
|
M.trim_buffer = function()
|
||||||
|
local save_cursor = vim.fn.getpos(".")
|
||||||
|
pcall(function() vim.cmd([[%s/\s\+$//e]]) end)
|
||||||
|
pcall(function() vim.cmd([[%s#\($\n\s*\)\+\%$##]]) end)
|
||||||
|
vim.fn.setpos(".", save_cursor)
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
IS_WINDOWS = function()
|
||||||
|
return string.find(vim.loop.os_uname().sysname, "NT")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Usage:
|
||||||
|
-- :lua P("Hello World!")
|
||||||
|
P = function(v)
|
||||||
|
print(vim.inspect(v))
|
||||||
|
return v
|
||||||
|
end
|
||||||
|
|
||||||
|
RELOAD = function(...)
|
||||||
|
return require("plenary.reload").reload_module(...)
|
||||||
|
end
|
||||||
|
|
||||||
|
R = function(name)
|
||||||
|
RELOAD(name)
|
||||||
|
return require(name)
|
||||||
|
end
|
||||||
|
|
||||||
|
LOG = function(v)
|
||||||
|
vim.fn.writefile({ vim.inspect(v) }, vim.fn.stdpath("cache") .. "/log", "a")
|
||||||
|
end
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
-- Set <space> as the leader key
|
||||||
|
-- See `:help mapleader`
|
||||||
|
-- NOTE: Must happen before plugins are required (otherwise wrong leader will be used)
|
||||||
|
vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { silent = true })
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
vim.g.maplocalleader = " "
|
||||||
@@ -0,0 +1,213 @@
|
|||||||
|
return {
|
||||||
|
|
||||||
|
-- Autocompletion
|
||||||
|
{
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
lazy = true, -- defer
|
||||||
|
dependencies = {
|
||||||
|
-- Snippet Engine & its associated nvim-cmp source
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
"saadparwaiz1/cmp_luasnip",
|
||||||
|
|
||||||
|
-- Adds LSP completion capabilities
|
||||||
|
"hrsh7th/cmp-nvim-lsp", -- source for neovim"s built-in LSP client
|
||||||
|
"hrsh7th/cmp-nvim-lua", -- source for neovim"s Lua API
|
||||||
|
"hrsh7th/cmp-buffer",
|
||||||
|
"hrsh7th/cmp-path",
|
||||||
|
|
||||||
|
-- Adds a number of user-friendly snippets
|
||||||
|
"rafamadriz/friendly-snippets",
|
||||||
|
|
||||||
|
-- Icons in the completion menu
|
||||||
|
"onsails/lspkind.nvim",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local luasnip = require("luasnip")
|
||||||
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
|
luasnip.config.setup({})
|
||||||
|
|
||||||
|
require("cmp").setup({
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
luasnip.lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
completion = {
|
||||||
|
completeopt = "menu,menuone,noinsert",
|
||||||
|
},
|
||||||
|
sources = {
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "nvim_lua" },
|
||||||
|
{ name = "luasnip" },
|
||||||
|
{ name = "buffer" },
|
||||||
|
{ name = "path" },
|
||||||
|
},
|
||||||
|
formatting = {
|
||||||
|
fields = { "kind", "abbr", "menu" },
|
||||||
|
-- https://github.com/hrsh7th/nvim-cmp/wiki/Menu-Appearance#how-to-get-types-on-the-left-and-offset-the-menu
|
||||||
|
-- https://github.com/onsails/lspkind.nvim#option-2-nvim-cmp
|
||||||
|
format = function(entry, vim_item)
|
||||||
|
local kind = require("lspkind").cmp_format({ mode = "symbol_text", maxwidth = 50 })(entry,
|
||||||
|
vim_item)
|
||||||
|
local strings = vim.split(kind.kind, "%s", { trimempty = true })
|
||||||
|
kind.kind = strings[1] or ""
|
||||||
|
kind.menu = " (" .. (strings[2] or "") .. ")"
|
||||||
|
|
||||||
|
return kind
|
||||||
|
end,
|
||||||
|
expandable_indicator = true,
|
||||||
|
},
|
||||||
|
mapping = require("keybinds").nvim_cmp(),
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- LSP Configuration & Plugins
|
||||||
|
{ -- https://github.com/neovim/nvim-lspconfig
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
dependencies = {
|
||||||
|
-- Improve the built-in LSP UI
|
||||||
|
"nvimdev/lspsaga.nvim",
|
||||||
|
-- Additional lua configuration, makes Nvim stuff amazing!
|
||||||
|
"folke/neodev.nvim",
|
||||||
|
-- C# "Goto Definition" with decompilation support
|
||||||
|
"Hoffs/omnisharp-extended-lsp.nvim",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
-- Setup neovim Lua configuration
|
||||||
|
require("lspsaga").setup() -- ?? does this do anything with doc hover
|
||||||
|
require("neodev").setup()
|
||||||
|
|
||||||
|
-- Vim process
|
||||||
|
local pid = vim.fn.getpid()
|
||||||
|
|
||||||
|
-- Setup language servers
|
||||||
|
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||||
|
local servers = {
|
||||||
|
clangd = {}, -- C/C++
|
||||||
|
intelephense = {}, -- PHP
|
||||||
|
lua_ls = { -- Lua, via lua-language-server
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
workspace = { checkThirdParty = false },
|
||||||
|
telemetry = { enable = false },
|
||||||
|
diagnostics = {
|
||||||
|
-- Ignore Lua_LS's noisy `missing-fields` warnings
|
||||||
|
disable = { "missing-fields" },
|
||||||
|
-- Ignore Lua_LS's noise `undefined global` warnings
|
||||||
|
globals = { "vim" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
omnisharp = { -- C#, via omnisharp-roslyn-bin
|
||||||
|
cmd = { "/usr/bin/omnisharp", "--languageserver", "--hostPID", tostring(pid) },
|
||||||
|
handlers = {
|
||||||
|
["textDocument/definition"] = require('omnisharp_extended').handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ts_ls = {
|
||||||
|
init_options = {
|
||||||
|
plugins = {
|
||||||
|
{
|
||||||
|
name = '@vue/typescript-plugin',
|
||||||
|
location = '/home/rick/.cache/.bun/install/global/node_modules/@vue/language-server',
|
||||||
|
languages = { 'vue' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filetypes = { 'javascript', 'javascriptreact', 'javascript.jsx', 'typescript', 'typescriptreact', 'typescript.tsx', 'vue', },
|
||||||
|
-- filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
|
||||||
|
-- requires: bun install -g typescript-language-server
|
||||||
|
-- TODO: Update which-key config, maybe other packages
|
||||||
|
-- Sources:
|
||||||
|
-- https://github.com/vuejs/language-tools?tab=readme-ov-file#hybrid-mode-configuration-requires-vuelanguage-server-version-200
|
||||||
|
-- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/configs/ts_ls.lua#L4
|
||||||
|
},
|
||||||
|
-- volar = {
|
||||||
|
-- -- init_options = {
|
||||||
|
-- -- vue = {
|
||||||
|
-- -- hybridMode = false,
|
||||||
|
-- -- },
|
||||||
|
-- -- },
|
||||||
|
-- },
|
||||||
|
-- volar = {
|
||||||
|
-- -- init_options = {
|
||||||
|
-- -- typescript = {
|
||||||
|
-- -- serverPath = '/home/rick/.cache/.bun/install/global/node_modules/typescript/lib//tsserverlibrary.js'
|
||||||
|
-- -- }
|
||||||
|
-- -- },
|
||||||
|
-- -- filetypes = {'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue', 'json'}
|
||||||
|
-- },
|
||||||
|
vue_ls = {},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
|
||||||
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
|
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
|
||||||
|
|
||||||
|
for server, _ in pairs(servers) do
|
||||||
|
local opts = vim.tbl_extend("keep", servers[server], {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = require("keybinds").lspconfig_on_attach,
|
||||||
|
})
|
||||||
|
-- P(server)
|
||||||
|
-- P(opts)
|
||||||
|
if vim.lsp.config then
|
||||||
|
vim.lsp.config(server, opts)
|
||||||
|
vim.lsp.enable(server)
|
||||||
|
else
|
||||||
|
require("lspconfig")[server].setup(opts)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Project
|
||||||
|
{
|
||||||
|
"ahmedkhalf/project.nvim",
|
||||||
|
opts = {
|
||||||
|
detection_methods = { "lsp", "pattern" },
|
||||||
|
patterns = { ".git", ".project" },
|
||||||
|
datapath = vim.fn.stdpath("cache"),
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
-- Add syncing between project.nvim and dashboard-nvim project entries.
|
||||||
|
-- NOTE: Must come before the project.nvim setup(),
|
||||||
|
-- so the glue's VimLeavePre autocmd is defined before it.
|
||||||
|
local F = require("core.functions")
|
||||||
|
vim.api.nvim_create_autocmd("VimLeavePre", {
|
||||||
|
pattern = "*",
|
||||||
|
callback = function()
|
||||||
|
-- Fetch project.nvim projects
|
||||||
|
local project = require("project_nvim.project")
|
||||||
|
local history = require("project_nvim.utils.history")
|
||||||
|
local recent = history.recent_projects or {}
|
||||||
|
local session = history.session_projects or {}
|
||||||
|
local recent_plus_session = F.table_merge_unique(recent, session)
|
||||||
|
|
||||||
|
-- Fetch dashboard-nvim projects
|
||||||
|
local utils = require("dashboard.utils")
|
||||||
|
local path = utils.path_join(vim.fn.stdpath("cache"), "dashboard/cache")
|
||||||
|
local projects = utils.read_project_cache(path) or {}
|
||||||
|
|
||||||
|
-- Add any projects that project.nvim uniquely knows about to dashboard-nvim
|
||||||
|
local all_projects = F.table_merge_unique(recent_plus_session, projects)
|
||||||
|
vim.fn.writefile({ "return " .. vim.inspect(all_projects) }, path)
|
||||||
|
|
||||||
|
-- Add any projects that dashboard-nvim uniquely knows about to project.nvim
|
||||||
|
for _, value in ipairs(projects) do
|
||||||
|
if not vim.tbl_contains(recent_plus_session, value) then
|
||||||
|
pcall(project.set_pwd, value, "manual") -- skip non-existent directories, dont error
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
require("project_nvim").setup(opts)
|
||||||
|
require("telescope").load_extension("projects")
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
return {
|
||||||
|
|
||||||
|
-- Detect tabstop and shiftwidth automatically
|
||||||
|
"tpope/vim-sleuth",
|
||||||
|
|
||||||
|
-- "gc" to comment visual regions/lines
|
||||||
|
"numToStr/Comment.nvim",
|
||||||
|
|
||||||
|
-- Highlight, edit, and navigate code
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||||
|
},
|
||||||
|
build = ":TSUpdate",
|
||||||
|
opts = {
|
||||||
|
ensure_installed = {
|
||||||
|
"bash", "c", "cmake", "cpp", "c_sharp", "css", "go",
|
||||||
|
"haskell", "html", "java", "javascript", "jsdoc", "json",
|
||||||
|
"latex", "lua", "make", "markdown", "php", "python",
|
||||||
|
"query", "regex", "rust", "toml", "tsx", "typescript",
|
||||||
|
"vim", "vimdoc", "yaml",
|
||||||
|
},
|
||||||
|
sync_install = false,
|
||||||
|
auto_install = true,
|
||||||
|
|
||||||
|
-- Default install directory is <plugin_path>/parser
|
||||||
|
-- parser_install_dir
|
||||||
|
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
additional_vim_regex_highlighting = false,
|
||||||
|
},
|
||||||
|
indent = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Auto-save
|
||||||
|
{
|
||||||
|
"okuuva/auto-save.nvim",
|
||||||
|
cmd = "ASToggle", -- defer, until run command
|
||||||
|
event = { "InsertLeave", "TextChanged" }, -- defer, until event trigger
|
||||||
|
opts = {
|
||||||
|
debounce_delay = 5000, -- delay for `defer_save`, in ms
|
||||||
|
condition = function(buf)
|
||||||
|
-- Dont save special-buffers
|
||||||
|
return vim.fn.getbufvar(buf, "&buftype") == ""
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("auto-save").setup(opts)
|
||||||
|
|
||||||
|
-- Cut off trailing whitespace and trailing blank lines
|
||||||
|
local group = vim.api.nvim_create_augroup("AutoSave", { clear = false })
|
||||||
|
local core = require("core.functions")
|
||||||
|
vim.api.nvim_create_autocmd("User", {
|
||||||
|
pattern = "AutoSaveWritePre",
|
||||||
|
group = group,
|
||||||
|
callback = function(event)
|
||||||
|
if event.data.saved_buffer ~= nil then
|
||||||
|
core.trim_buffer()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Autopair / electric pair
|
||||||
|
{ -- https://github.com/altermo/ultimate-autopair.nvim
|
||||||
|
"altermo/ultimate-autopair.nvim",
|
||||||
|
event = { "InsertEnter", "CmdlineEnter" }, -- defer
|
||||||
|
branch = "development",
|
||||||
|
opts = {
|
||||||
|
bs = { -- See: `:h ultimate-autopair-map-backspace-config`
|
||||||
|
-- Call the backspace logic from the config, instead of automap
|
||||||
|
-- https://github.com/altermo/ultimate-autopair.nvim/issues/60
|
||||||
|
map = "<Plug>ultimate-autopair-BS",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
return {
|
||||||
|
|
||||||
|
-- Adds git related signs to the gutter/fringe
|
||||||
|
{
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
opts = {
|
||||||
|
-- See `:help gitsigns.txt`
|
||||||
|
signs = {
|
||||||
|
add = { text = "█" },
|
||||||
|
change = { text = "█" },
|
||||||
|
delete = { text = "█" },
|
||||||
|
topdelete = { text = "█" },
|
||||||
|
changedelete = { text = "█" },
|
||||||
|
untracked = { text = "┆" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Magit clone
|
||||||
|
{
|
||||||
|
"NeogitOrg/neogit",
|
||||||
|
cmd = "Neogit", -- defer
|
||||||
|
lazy = true,
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
|
||||||
|
"sindrets/diffview.nvim", -- diff integration
|
||||||
|
-- { "sindrets/diffview.nvim", opts = { enhanced_diff_hl = true } }, -- diff integration
|
||||||
|
},
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,313 @@
|
|||||||
|
local builtin
|
||||||
|
local telescope
|
||||||
|
|
||||||
|
local F = require("core.functions")
|
||||||
|
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
M.setup = function()
|
||||||
|
-- Prevent dependency loop
|
||||||
|
builtin = require("telescope.builtin")
|
||||||
|
telescope = require("telescope")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Set which-key key section description
|
||||||
|
M.wk = function(keybind, description, bufnr)
|
||||||
|
require("which-key").add({
|
||||||
|
{ keybind, group = description, mode = { "n", "v" }, buffer = bufnr },
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
M.buffer_close = function()
|
||||||
|
-- Check if there are more than 2 buffers and alternate file is set
|
||||||
|
local command = vim.fn.expand("#") ~= "" and #vim.fn.getbufinfo({ buflisted = 1 }) > 1
|
||||||
|
and "e #|bd #|bwipeout #" -- see `:h c_#`
|
||||||
|
or "bd"
|
||||||
|
vim.api.nvim_command(command)
|
||||||
|
end
|
||||||
|
|
||||||
|
M.buffer_dashboard = function()
|
||||||
|
vim.api.nvim_command("Dashboard")
|
||||||
|
end
|
||||||
|
|
||||||
|
M.file_config = function()
|
||||||
|
builtin.find_files({
|
||||||
|
prompt_title = "Nvim Config",
|
||||||
|
cwd = vim.fn.stdpath("config"),
|
||||||
|
hidden = true,
|
||||||
|
no_ignore = true,
|
||||||
|
-- path_display = { "shorten" },
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
M.file_find = function()
|
||||||
|
telescope.extensions.file_browser.file_browser({
|
||||||
|
cwd = F.get_current_directory(),
|
||||||
|
hidden = true,
|
||||||
|
no_ignore = true,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
M.file_find_home = function()
|
||||||
|
telescope.extensions.file_browser.file_browser({
|
||||||
|
cwd = "~",
|
||||||
|
hidden = true,
|
||||||
|
no_ignore = true,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
M.file_find_recent = function()
|
||||||
|
telescope.extensions.recent_files.pick()
|
||||||
|
end
|
||||||
|
|
||||||
|
M.file_save = function()
|
||||||
|
vim.api.nvim_command("w")
|
||||||
|
end
|
||||||
|
|
||||||
|
M.goto_trouble = function()
|
||||||
|
vim.api.nvim_command("Trouble")
|
||||||
|
end
|
||||||
|
|
||||||
|
M.goto_todos_telescope = function()
|
||||||
|
vim.api.nvim_command("TodoTelescope")
|
||||||
|
end
|
||||||
|
|
||||||
|
M.goto_todos_trouble = function()
|
||||||
|
vim.api.nvim_command("TodoTrouble")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Smart delete
|
||||||
|
M.hungry_delete = function()
|
||||||
|
return function()
|
||||||
|
local start_line = vim.fn.line(".")
|
||||||
|
local start_col = vim.fn.col(".")
|
||||||
|
local start_line_content = vim.fn.getline(start_line)
|
||||||
|
local line_length = start_line_content:len()
|
||||||
|
|
||||||
|
-- Check if there are multiple whitespace characters after the cursor
|
||||||
|
local is_1_whitespace = start_line_content:sub(start_col, start_col):match("%s")
|
||||||
|
local is_2_whitespace = start_line_content:sub(start_col + 1, start_col + 1):match("%s")
|
||||||
|
if (start_col <= line_length - 1 and is_1_whitespace and is_2_whitespace)
|
||||||
|
or (start_col == line_length and is_1_whitespace)
|
||||||
|
or start_col - 1 == line_length then -- in insert mode, the column is 1 higher
|
||||||
|
-- Hungry delete
|
||||||
|
|
||||||
|
-- Iterate forwards through each line and character
|
||||||
|
local last_line = vim.fn.line("$")
|
||||||
|
for line = start_line, last_line do
|
||||||
|
local line_content = (line == start_line) and start_line_content or vim.fn.getline(line)
|
||||||
|
local col = (line == start_line) and start_col or 1
|
||||||
|
|
||||||
|
for c = col, #line_content do
|
||||||
|
local char = line_content:sub(c, c)
|
||||||
|
|
||||||
|
-- Look until it hits a non-whitespace character
|
||||||
|
if not vim.fn.strcharpart(char, 0, 1):match("%s") then
|
||||||
|
-- Delete empty lines, from the starting line to the current line
|
||||||
|
vim.api.nvim_buf_set_lines(0, start_line - 1, line - 1, false, {})
|
||||||
|
|
||||||
|
-- Keep the content that was before the cursor at the start_line,
|
||||||
|
-- plus the content from the current column to the end of the current line
|
||||||
|
vim.fn.setline(start_line,
|
||||||
|
start_line_content:sub(1, start_col - 1) .. line_content:sub(c))
|
||||||
|
|
||||||
|
vim.fn.cursor({ start_line, start_col })
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Delete empty lines, if the end of the buffer was only whitespace
|
||||||
|
vim.api.nvim_buf_set_lines(0, start_line - 1, last_line, false, {})
|
||||||
|
|
||||||
|
-- Keep the content that was before the cursor
|
||||||
|
vim.fn.setline(start_line, start_line_content:sub(1, start_col - 1))
|
||||||
|
|
||||||
|
vim.fn.cursor({ start_line, start_col })
|
||||||
|
else
|
||||||
|
-- Normal delete
|
||||||
|
vim.cmd("normal! x")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Smart backspace
|
||||||
|
M.hungry_delete_backspace = function()
|
||||||
|
-- Cache some values
|
||||||
|
local core = require("ultimate-autopair.core")
|
||||||
|
local keycode = vim.api.nvim_replace_termcodes("<Plug>ultimate-autopair-BS", true, false, true)
|
||||||
|
local fallback = vim.api.nvim_replace_termcodes("<C-h>", true, false, true) -- <BS> => <C-h>, \b
|
||||||
|
|
||||||
|
return function()
|
||||||
|
local start_line = vim.fn.line(".")
|
||||||
|
local start_col = vim.fn.col(".")
|
||||||
|
local start_line_content = vim.fn.getline(start_line)
|
||||||
|
|
||||||
|
-- Check if there are multiple whitespace characters before the cursor
|
||||||
|
local is_1_whitespace = start_line_content:sub(start_col - 1, start_col - 1):match("%s")
|
||||||
|
local is_2_whitespace = start_line_content:sub(start_col - 2, start_col - 2):match("%s")
|
||||||
|
if (start_col >= 3 and is_1_whitespace and is_2_whitespace)
|
||||||
|
or (start_col == 2 and is_1_whitespace)
|
||||||
|
or start_col == 1 then
|
||||||
|
-- Hungry delete
|
||||||
|
|
||||||
|
-- Iterate backwards through each line and character
|
||||||
|
for line = start_line, 1, -1 do
|
||||||
|
local line_content = (line == start_line) and start_line_content or vim.fn.getline(line)
|
||||||
|
local col = (line == start_line) and (start_col - 1) or #line_content
|
||||||
|
|
||||||
|
for c = col, 1, -1 do
|
||||||
|
local char = line_content:sub(c, c)
|
||||||
|
|
||||||
|
-- Look until it hits a non-whitespace character
|
||||||
|
if not vim.fn.strcharpart(char, 0, 1):match("%s") then
|
||||||
|
-- Delete empty lines, from the starting line to the current line
|
||||||
|
vim.api.nvim_buf_set_lines(0, line - 1, start_line - 1, false, {})
|
||||||
|
|
||||||
|
-- Keep the content from the start of the current line to the current column,
|
||||||
|
-- plus the content that was after the cursor at the start_line
|
||||||
|
vim.fn.setline(line, line_content:sub(1, c) .. (line == start_line
|
||||||
|
and line_content:sub(start_col) -- found non-whitespace on the same line it started
|
||||||
|
or start_line_content:sub(start_col))) -- jumped through empty lines
|
||||||
|
|
||||||
|
vim.fn.cursor({ line, c + 1 })
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Delete empty lines, if the start of the buffer was only whitespace
|
||||||
|
vim.api.nvim_buf_set_lines(0, 0, start_line - 1, false, {})
|
||||||
|
|
||||||
|
-- Keep the content that was after the cursor
|
||||||
|
vim.fn.setline(1, "" .. start_line_content:sub(start_col))
|
||||||
|
else
|
||||||
|
-- Normal backspace, prevent run_run recursive mapping via fallback to \b
|
||||||
|
local actions = core.run_run(keycode)
|
||||||
|
vim.api.nvim_feedkeys(actions ~= keycode and actions or fallback, "n", false) -- equivalent to { expr = true }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
M.lsp_format_buffer = function()
|
||||||
|
vim.lsp.buf.format({
|
||||||
|
formatting_options = {
|
||||||
|
tabSize = 4,
|
||||||
|
insertSpaces = false,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
M.project_file = function()
|
||||||
|
local res, err = F.find_project_root()
|
||||||
|
if res then
|
||||||
|
builtin.git_files({ cwd = res })
|
||||||
|
else -- fall-back to find_files, if current buffer isnt in a project
|
||||||
|
builtin.find_files({ cwd = err })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
M.project_grep = function()
|
||||||
|
local res, err = F.find_project_root()
|
||||||
|
builtin.live_grep({ cwd = res or err })
|
||||||
|
end
|
||||||
|
|
||||||
|
M.project_list = function()
|
||||||
|
telescope.extensions.projects.projects()
|
||||||
|
end
|
||||||
|
|
||||||
|
M.search_buffer = function()
|
||||||
|
builtin.current_buffer_fuzzy_find({
|
||||||
|
previewer = false,
|
||||||
|
sorting_strategy = "ascending",
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
M.toggle_term = function()
|
||||||
|
vim.api.nvim_command("ToggleTerm")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- TODO: Temporary copy/pasted until project_nvim exposes this function
|
||||||
|
-- https://github.com/ahmedkhalf/project.nvim/issues/145
|
||||||
|
-- TODO: Create a Telescope extension out of this, for telescope-all-recent
|
||||||
|
local function create_finder()
|
||||||
|
local results = require("project_nvim").get_recent_projects()
|
||||||
|
local entry_display = require("telescope.pickers.entry_display")
|
||||||
|
local finders = require("telescope.finders")
|
||||||
|
|
||||||
|
-- Reverse results
|
||||||
|
for i = 1, math.floor(#results / 2) do
|
||||||
|
results[i], results[#results - i + 1] = results[#results - i + 1], results[i]
|
||||||
|
end
|
||||||
|
local displayer = entry_display.create({
|
||||||
|
separator = " ",
|
||||||
|
items = {
|
||||||
|
{
|
||||||
|
width = 30,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
remaining = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
local function make_display(entry)
|
||||||
|
return displayer({ entry.name, { entry.value, "Comment" } })
|
||||||
|
end
|
||||||
|
|
||||||
|
return finders.new_table({
|
||||||
|
results = results,
|
||||||
|
entry_maker = function(entry)
|
||||||
|
local name = vim.fn.fnamemodify(entry, ":t")
|
||||||
|
return {
|
||||||
|
display = make_display,
|
||||||
|
name = name,
|
||||||
|
value = entry,
|
||||||
|
ordinal = name .. " " .. entry,
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
M.vc_select_repo = function()
|
||||||
|
-- local projects = require("project_nvim").get_recent_projects()
|
||||||
|
|
||||||
|
local actions = require("telescope.actions")
|
||||||
|
local action_state = require("telescope.actions.state")
|
||||||
|
local conf = require("telescope.config").values
|
||||||
|
-- local finders = require("telescope.finders")
|
||||||
|
local pickers = require("telescope.pickers")
|
||||||
|
pickers.new({}, {
|
||||||
|
prompt_title = "Select Project",
|
||||||
|
finder = create_finder(),
|
||||||
|
-- finder = telescope.extensions.projects.create_finder(),
|
||||||
|
-- finder = finders.new_table {
|
||||||
|
-- results = projects,
|
||||||
|
-- },
|
||||||
|
previewer = false,
|
||||||
|
sorter = conf.generic_sorter({}),
|
||||||
|
attach_mappings = function(prompt_bufnr)
|
||||||
|
actions.select_default:replace(function()
|
||||||
|
actions.close(prompt_bufnr)
|
||||||
|
|
||||||
|
local selection = action_state.get_selected_entry()
|
||||||
|
-- require("neogit").open({ cwd = selection[1] })
|
||||||
|
require("neogit").open({ cwd = selection.value })
|
||||||
|
end)
|
||||||
|
|
||||||
|
return true
|
||||||
|
end,
|
||||||
|
}):find()
|
||||||
|
end
|
||||||
|
|
||||||
|
M.vc_status = function()
|
||||||
|
if F.find_project_root() then
|
||||||
|
-- Open the repository of the current file
|
||||||
|
require("neogit").open({ cwd = "%:p:h" })
|
||||||
|
else
|
||||||
|
-- Pick a project to open
|
||||||
|
M.vc_select_repo()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
@@ -0,0 +1,273 @@
|
|||||||
|
local K = vim.keymap.set
|
||||||
|
|
||||||
|
local builtin
|
||||||
|
local bs = require("core.buffers")
|
||||||
|
local wk = require("which-key")
|
||||||
|
|
||||||
|
local F = require("keybind-functions")
|
||||||
|
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
--------------------------------------------
|
||||||
|
--- Keybindings ---
|
||||||
|
|
||||||
|
M.setup = function()
|
||||||
|
F.setup()
|
||||||
|
|
||||||
|
-- Prevent dependency loop
|
||||||
|
builtin = require("telescope.builtin")
|
||||||
|
|
||||||
|
-- Change default behavior
|
||||||
|
K("n", "Y", "y$")
|
||||||
|
K("v", "p", "pgvy")
|
||||||
|
|
||||||
|
K("n", "J", "mzJ`z") -- dont move cursor to end of line
|
||||||
|
|
||||||
|
K("n", "<C-d>", "<C-d>zz") -- stay in the middle
|
||||||
|
K("n", "<C-u>", "<C-u>zz")
|
||||||
|
K("n", "n", "nzzzv")
|
||||||
|
K("n", "N", "Nzzzv")
|
||||||
|
|
||||||
|
K("x", "p", "\"_dP") -- dont overwrite clipboard when pasting visually
|
||||||
|
|
||||||
|
-- Remap for dealing with word wrap
|
||||||
|
K("n", "k", [[v:count == 0 ? "gk" : "k"]], { expr = true, silent = true })
|
||||||
|
K("n", "j", [[v:count == 0 ? "gj" : "j"]], { expr = true, silent = true })
|
||||||
|
|
||||||
|
-- Tab/Shift+Tab functionality
|
||||||
|
K("n", "<Tab>", ">>_")
|
||||||
|
K("n", "<S-Tab>", "<<_")
|
||||||
|
K("i", "<S-Tab>", "<C-D>")
|
||||||
|
K("v", "<Tab>", ">gv")
|
||||||
|
K("v", "<S-Tab>", "<gv")
|
||||||
|
|
||||||
|
-- Move highlighted blocks
|
||||||
|
K("v", "J", ":m '>+1<CR>gv=gv")
|
||||||
|
K("v", "K", ":m '<-2<CR>gv=gv")
|
||||||
|
|
||||||
|
-- Switch to previous buffer
|
||||||
|
K("n", "<M-`>", "<C-6>")
|
||||||
|
|
||||||
|
-- Center buffer with Ctrl+L
|
||||||
|
K("n", "<C-l>", "zz")
|
||||||
|
|
||||||
|
-- Close buffer with Alt-w
|
||||||
|
K("n", "<M-w>", F.buffer_close)
|
||||||
|
|
||||||
|
-- Hungry delete
|
||||||
|
K("i", "<BS>", F.hungry_delete_backspace())
|
||||||
|
K("i", "<Del>", F.hungry_delete())
|
||||||
|
|
||||||
|
-- Navigation
|
||||||
|
K("n", "<M-h>", bs.buffer_move_left)
|
||||||
|
K("n", "<M-j>", bs.buffer_group_move_down)
|
||||||
|
K("n", "<M-k>", bs.buffer_group_move_up)
|
||||||
|
K("n", "<M-l>", bs.buffer_move_right)
|
||||||
|
K("n", "<M-H>", bs.buffer_swap_left)
|
||||||
|
K("n", "<M-L>", bs.buffer_swap_right)
|
||||||
|
|
||||||
|
-- Terminal
|
||||||
|
K("n", "<C-\\>", F.toggle_term)
|
||||||
|
K("t", "<C-\\>", F.toggle_term)
|
||||||
|
|
||||||
|
----------------------------------------
|
||||||
|
--- Leader keys ---
|
||||||
|
|
||||||
|
|
||||||
|
K("n", "<leader><space>", builtin.commands, { desc = "Execute command" })
|
||||||
|
|
||||||
|
|
||||||
|
F.wk("<leader>b", "buffer/bookmark")
|
||||||
|
K("n", "<leader>bb", builtin.buffers, { desc = "Switch buffer" })
|
||||||
|
K("n", "<leader>bB", bs.buffer_pick_buffer, { desc = "Switch tab group buffer" })
|
||||||
|
K("n", "<leader>bd", F.buffer_dashboard, { desc = "Dashboard" })
|
||||||
|
|
||||||
|
|
||||||
|
F.wk("<leader>c", "comment")
|
||||||
|
-- numToStr/Comment.nvim
|
||||||
|
K("n", "<leader>cc", "<Plug>(comment_toggle_linewise_current)", { desc = "Comment toggle linewise" })
|
||||||
|
K("n", "<leader>cp", "<Plug>(comment_toggle_blockwise_current)", { desc = "Comment toggle blockwise" })
|
||||||
|
K("x", "<leader>cc", "<Plug>(comment_toggle_linewise_visual)", { desc = "Comment toggle linewise (visual)" })
|
||||||
|
K("x", "<leader>cp", "<Plug>(comment_toggle_blockwise_visual)", { desc = "Comment toggle blockwise (visual)" })
|
||||||
|
|
||||||
|
|
||||||
|
F.wk("<leader>e", "eval")
|
||||||
|
K("n", "<leader>eb", ":w<CR>:source %<CR>", { desc = "Evaluate buffer" })
|
||||||
|
|
||||||
|
|
||||||
|
F.wk("<leader>f", "file")
|
||||||
|
K("n", "<leader>fc", F.file_config, { desc = "Config file" })
|
||||||
|
K("n", "<leader>ff", F.file_find, { desc = "Find file" })
|
||||||
|
K("n", "<leader>fh", F.file_find_home, { desc = "Find file in ~" })
|
||||||
|
K("n", "<leader>fr", F.file_find_recent, { desc = "Find recent file" })
|
||||||
|
K("n", "<leader>fs", F.file_save, { desc = "Save file" })
|
||||||
|
|
||||||
|
|
||||||
|
F.wk("<leader>h", "help")
|
||||||
|
K("n", "<leader>hh", builtin.help_tags, { desc = "Describe" })
|
||||||
|
K("n", "<leader>hk", builtin.keymaps, { desc = "Describe key" })
|
||||||
|
K("n", "<leader>hm", builtin.man_pages, { desc = "Describe manpage" })
|
||||||
|
|
||||||
|
|
||||||
|
F.wk("<leader>g", "goto")
|
||||||
|
K("n", "<leader>ge", F.goto_trouble, { desc = "Goto trouble" })
|
||||||
|
K("n", "<leader>gt", F.goto_todos_telescope, { desc = "Goto todos (Telescope)" })
|
||||||
|
K("n", "<leader>gT", F.goto_todos_trouble, { desc = "Goto todos (Trouble)" })
|
||||||
|
|
||||||
|
|
||||||
|
F.wk("<leader>p", "project")
|
||||||
|
K("n", "<leader>pf", F.project_file, { desc = "Find project file" })
|
||||||
|
K("n", "<leader>pg", F.project_grep, { desc = "Find in project" })
|
||||||
|
K("n", "<leader>pp", F.project_list, { desc = "List projects" })
|
||||||
|
|
||||||
|
|
||||||
|
F.wk("<leader>s", "search")
|
||||||
|
K("n", "<leader>ss", F.search_buffer, { desc = "Search buffer" })
|
||||||
|
K("n", "<leader>sq", ":nohlsearch<CR>", { desc = "Stop search", silent = true })
|
||||||
|
|
||||||
|
|
||||||
|
F.wk("<leader>t", "tabs/toggle")
|
||||||
|
K("n", "<leader>tg", bs.buffer_pick_group, { desc = "Switch tab group" })
|
||||||
|
|
||||||
|
|
||||||
|
F.wk("<leader>v", "git") -- version control
|
||||||
|
K("n", "<leader>vr", F.vc_select_repo, { desc = "Select repo" })
|
||||||
|
K("n", "<leader>vv", F.vc_status, { desc = "Neogit status" })
|
||||||
|
|
||||||
|
|
||||||
|
K({ "n", "v" }, "<leader>w", "<C-W>", { remap = true }) -- keymap and which-key should *both* be triggered
|
||||||
|
wk.add({
|
||||||
|
{
|
||||||
|
mode = { "n", "v" },
|
||||||
|
{ "<leader>w", group = "window" },
|
||||||
|
{ "<leader>w+", desc = "Increase height" },
|
||||||
|
{ "<leader>w-", desc = "Decrease height" },
|
||||||
|
{ "<leader>w<", desc = "Decrease width" },
|
||||||
|
{ "<leader>w=", desc = "Equally high and wide" },
|
||||||
|
{ "<leader>w>", desc = "Increase width" },
|
||||||
|
{ "<leader>wT", desc = "Break out into a new tab" },
|
||||||
|
{ "<leader>w_", desc = "Max out the height" },
|
||||||
|
{ "<leader>wh", desc = "Go to the left window" },
|
||||||
|
{ "<leader>wj", desc = "Go to the down window" },
|
||||||
|
{ "<leader>wk", desc = "Go to the up window" },
|
||||||
|
{ "<leader>wl", desc = "Go to the right window" },
|
||||||
|
{ "<leader>wo", desc = "Close all other windows" },
|
||||||
|
{ "<leader>wq", desc = "Quit a window" },
|
||||||
|
{ "<leader>ws", desc = "Split window" },
|
||||||
|
{ "<leader>wv", desc = "Split window vertically" },
|
||||||
|
{ "<leader>ww", desc = "Switch windows" },
|
||||||
|
{ "<leader>wx", desc = "Swap current with next" },
|
||||||
|
{ "<leader>w|", desc = "Max out the width" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
-- https://github.com/folke/which-key.nvim/issues/270
|
||||||
|
-- https://github.com/folke/which-key.nvim/blob/main/lua/which-key/plugins/presets/misc.lua
|
||||||
|
end
|
||||||
|
|
||||||
|
--------------------------------------------
|
||||||
|
--- Plugin specific ---
|
||||||
|
|
||||||
|
-- This function gets run when an LSP connects to a particular buffer.
|
||||||
|
M.lspconfig_on_attach = function(_, bufnr)
|
||||||
|
local nnoremap = function(keys, func, desc)
|
||||||
|
vim.keymap.set("n", keys, func, { buffer = bufnr, desc = desc })
|
||||||
|
end
|
||||||
|
|
||||||
|
F.wk("<leader>l", "lsp", bufnr)
|
||||||
|
nnoremap("<leader>la", vim.lsp.buf.code_action, "Code action")
|
||||||
|
nnoremap("<leader>lf", F.lsp_format_buffer, "Format buffer")
|
||||||
|
nnoremap("<leader>lr", vim.lsp.buf.rename, "Rename")
|
||||||
|
|
||||||
|
nnoremap("<leader>ld", "<cmd>Lspsaga hover_doc<CR>", "Show documentation")
|
||||||
|
-- vim.keymap.set("n", "<leader>ld", "<cmd>Lspsaga hover_doc<CR>", { desc = "Show documentation" })
|
||||||
|
|
||||||
|
F.wk("<leader>lg", "goto", bufnr)
|
||||||
|
nnoremap("<leader>lga", builtin.lsp_dynamic_workspace_symbols, "Workspace symbols")
|
||||||
|
nnoremap("<leader>lgd", vim.lsp.buf.declaration, "Declaration")
|
||||||
|
nnoremap("<leader>lgg", vim.lsp.buf.definition, "Definition") -- builtin.lsp_definitions
|
||||||
|
nnoremap("<leader>lgi", builtin.lsp_implementations, "Implementation")
|
||||||
|
nnoremap("<leader>lgr", builtin.lsp_references, "References")
|
||||||
|
nnoremap("<leader>lgs", builtin.lsp_document_symbols, "Document symbols")
|
||||||
|
nnoremap("<leader>lgt", builtin.lsp_type_definitions, "Type definition")
|
||||||
|
|
||||||
|
-- See `:help K` for why this keymap
|
||||||
|
nnoremap("K", vim.lsp.buf.hover, "Hover Documentation")
|
||||||
|
nnoremap("<C-k>", vim.lsp.buf.signature_help, "Signature Documentation")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Keybindings for nvim-cmp popup
|
||||||
|
M.nvim_cmp = function()
|
||||||
|
local cmp = require("cmp")
|
||||||
|
local luasnip = require("luasnip")
|
||||||
|
return cmp.mapping.preset.insert({
|
||||||
|
["<M-h>"] = cmp.mapping.abort(),
|
||||||
|
["<M-j>"] = cmp.mapping.select_next_item(),
|
||||||
|
["<M-k>"] = cmp.mapping.select_prev_item(),
|
||||||
|
["<M-l>"] = cmp.mapping.confirm({
|
||||||
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
|
select = true,
|
||||||
|
}),
|
||||||
|
|
||||||
|
["<Esc>"] = cmp.mapping.abort(),
|
||||||
|
["<CR>"] = cmp.mapping.confirm({
|
||||||
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
|
select = true,
|
||||||
|
}),
|
||||||
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
|
|
||||||
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
elseif luasnip.expand_or_locally_jumpable() then
|
||||||
|
luasnip.expand_or_jump()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item()
|
||||||
|
elseif luasnip.locally_jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Telescope picker generic mappings
|
||||||
|
M.telescope_default_mappings = function()
|
||||||
|
local actions = require("telescope.actions")
|
||||||
|
return {
|
||||||
|
n = {
|
||||||
|
["<M-h>"] = actions.close,
|
||||||
|
["<M-j>"] = actions.move_selection_next,
|
||||||
|
["<M-k>"] = actions.move_selection_previous,
|
||||||
|
["<M-l>"] = actions.select_default,
|
||||||
|
},
|
||||||
|
i = {
|
||||||
|
["<M-h>"] = actions.close,
|
||||||
|
["<M-j>"] = actions.move_selection_next,
|
||||||
|
["<M-k>"] = actions.move_selection_previous,
|
||||||
|
["<M-l>"] = actions.select_default,
|
||||||
|
|
||||||
|
["<Tab>"] = actions.select_default,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Keybindings for toggleterm.nvim
|
||||||
|
M.toggleterm_nvim = function()
|
||||||
|
local keymaps = function()
|
||||||
|
local opts = { buffer = 0 }
|
||||||
|
K("t", "<Esc>", [[<C-\><C-n>]], opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("TermOpen", {
|
||||||
|
pattern = "term://*toggleterm#*",
|
||||||
|
callback = keymaps,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
local M = {}
|
||||||
|
|
||||||
|
local plugin_path = vim.fn.stdpath("cache") .. "/lazy"
|
||||||
|
|
||||||
|
-- Install lazy.nvim plugin manager
|
||||||
|
-- See `:help lazy.nvim.txt`
|
||||||
|
M.install = function()
|
||||||
|
local lazy_path = plugin_path .. "/lazy.nvim"
|
||||||
|
if not vim.loop.fs_stat(lazy_path) then
|
||||||
|
vim.fn.system {
|
||||||
|
"git",
|
||||||
|
"clone",
|
||||||
|
"--filter=blob:none",
|
||||||
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
|
"--branch=stable", -- latest stable release
|
||||||
|
lazy_path,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazy_path)
|
||||||
|
end
|
||||||
|
|
||||||
|
M.setup = function(modules)
|
||||||
|
M.install()
|
||||||
|
|
||||||
|
local options = {
|
||||||
|
root = plugin_path, -- directory where plugins will be installed
|
||||||
|
}
|
||||||
|
|
||||||
|
require("lazy").setup(modules, options)
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
@@ -0,0 +1,132 @@
|
|||||||
|
return {
|
||||||
|
|
||||||
|
-- Fuzzy Finder (files, LSP, etc)
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
branch = "0.1.x",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope-fzf-native.nvim",
|
||||||
|
build = IS_WINDOWS() and "mingw32-make" or "make",
|
||||||
|
cond = function()
|
||||||
|
return vim.fn.executable(IS_WINDOWS() and "mingw32-make" or "make") == 1
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
-- Extensions
|
||||||
|
"nvim-telescope/telescope-file-browser.nvim",
|
||||||
|
"smartpde/telescope-recent-files",
|
||||||
|
},
|
||||||
|
extensions = {
|
||||||
|
"fzf",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("telescope").setup({
|
||||||
|
defaults = {
|
||||||
|
sorting_strategy = "ascending",
|
||||||
|
|
||||||
|
layout_strategy = "config",
|
||||||
|
layout_config = {
|
||||||
|
height = 10, -- amount of results
|
||||||
|
config = { -- apply settings to the "config" layout
|
||||||
|
search_condensed = true,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
border = true,
|
||||||
|
|
||||||
|
history = {
|
||||||
|
path = vim.fn.stdpath("cache") .. "/telescope_history",
|
||||||
|
},
|
||||||
|
|
||||||
|
mappings = require("keybinds").telescope_default_mappings(),
|
||||||
|
},
|
||||||
|
extensions = {
|
||||||
|
file_browser = {
|
||||||
|
hide_parent_dir = true, -- hide "../"
|
||||||
|
prompt_path = true, -- set path as prompt prefix
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
require("telescope").load_extension("fzf")
|
||||||
|
require("telescope").load_extension "file_browser"
|
||||||
|
require("telescope").load_extension("recent_files")
|
||||||
|
|
||||||
|
--- ┌──────────────────────────────────────────────────┐
|
||||||
|
--- │ │
|
||||||
|
--- │ ┌───────────────────┐ │
|
||||||
|
--- │ │ │ │
|
||||||
|
--- │ │ │ │
|
||||||
|
--- │ │ Preview │ │
|
||||||
|
--- │ │ │ │
|
||||||
|
--- │ │ │ │
|
||||||
|
--- │ └───────────────────┘ │
|
||||||
|
--- │ │
|
||||||
|
--- ├──────────────────────────────────────────────────┤
|
||||||
|
--- │ Prompt │
|
||||||
|
--- ├──────────────────────────────────────────────────┤
|
||||||
|
--- │ Results │
|
||||||
|
--- │ │
|
||||||
|
--- └──────────────────────────────────────────────────┘
|
||||||
|
require("telescope.pickers.layout_strategies").config = function(picker, max_columns, max_lines,
|
||||||
|
layout_config)
|
||||||
|
local p_window = require "telescope.pickers.window"
|
||||||
|
local initial_options = p_window.get_initial_window_options(picker)
|
||||||
|
local results = initial_options.results
|
||||||
|
local prompt = initial_options.prompt
|
||||||
|
local preview = initial_options.preview
|
||||||
|
-- Layout config isnt filled by Telescope automatically
|
||||||
|
layout_config = require("telescope.config").values.layout_config or {}
|
||||||
|
|
||||||
|
results.title = ""
|
||||||
|
results.borderchars = { "─", "│", "─", "│", "├", "┤", "╯", "╰" }
|
||||||
|
|
||||||
|
local bs = picker.window.border and 2 or 0
|
||||||
|
local search_condensed = bs ~= 0 and layout_config.config.search_condensed and 2 or 0
|
||||||
|
|
||||||
|
-- Height
|
||||||
|
prompt.height = 1
|
||||||
|
results.height = layout_config.height or 10
|
||||||
|
local search_height = (prompt.height + results.height + (bs * 3))
|
||||||
|
preview.height = math.floor((max_lines - search_height) * 0.8)
|
||||||
|
|
||||||
|
-- Width
|
||||||
|
prompt.width = max_columns - (bs ~= 0 and search_condensed == 0 and bs or 0)
|
||||||
|
results.width = max_columns - (bs ~= 0 and search_condensed == 0 and bs or 0)
|
||||||
|
preview.width = math.floor(max_columns * 0.75)
|
||||||
|
|
||||||
|
-- Line (position), coordinates start at top-left
|
||||||
|
prompt.line = max_lines - results.height + search_condensed - bs -- take overlapping border into account
|
||||||
|
results.line = max_lines - results.height + search_condensed - bs + (bs / 2) + prompt.height
|
||||||
|
preview.line = math.floor((max_lines - search_height - preview.height + bs) / 2) + 1
|
||||||
|
|
||||||
|
return {
|
||||||
|
preview = picker.previewer and preview.width > 0 and preview,
|
||||||
|
prompt = prompt,
|
||||||
|
results = results,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Telescope pickers sorted by recency and frequency
|
||||||
|
{
|
||||||
|
"prochri/telescope-all-recent.nvim",
|
||||||
|
dependencies = {
|
||||||
|
"kkharji/sqlite.lua",
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
database = {
|
||||||
|
folder = vim.fn.stdpath("cache"),
|
||||||
|
},
|
||||||
|
pickers = { -- extension_name#extension_method
|
||||||
|
["projects#projects"] = {
|
||||||
|
disable = false,
|
||||||
|
use_cwd = false,
|
||||||
|
sorting = "frecency",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
-- Module for managing popup terminal
|
||||||
|
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
M.persistent_term = nil
|
||||||
|
|
||||||
|
local create_command = function(name, command)
|
||||||
|
if not name or type(name) ~= "string" then return end
|
||||||
|
|
||||||
|
vim.api.nvim_create_user_command(name, function()
|
||||||
|
local cmd = type(command) == "function" and command() or command
|
||||||
|
M.send_cmd_to_term(cmd)
|
||||||
|
end, {})
|
||||||
|
end
|
||||||
|
|
||||||
|
M.setup = function()
|
||||||
|
-- Setup keybinds
|
||||||
|
require("keybinds").toggleterm_nvim()
|
||||||
|
|
||||||
|
create_command("RunScript", "sleep 2 && ls /")
|
||||||
|
create_command("ScanScript", function()
|
||||||
|
local file_path = vim.fn.expand("%:p")
|
||||||
|
LOG(file_path)
|
||||||
|
|
||||||
|
return "ls"
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
M.send_cmd_to_term = function(cmd)
|
||||||
|
local term = require("toggleterm.terminal").Terminal
|
||||||
|
local default = term:new({ id = 1 })
|
||||||
|
if not default:is_open() then default:open() end
|
||||||
|
default:send(cmd)
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
@@ -0,0 +1,209 @@
|
|||||||
|
return {
|
||||||
|
|
||||||
|
-- Theme
|
||||||
|
{
|
||||||
|
"RRethy/nvim-base16",
|
||||||
|
lazy = false, -- make sure to load this during startup if it is your main colorscheme
|
||||||
|
priority = 1000,
|
||||||
|
config = function()
|
||||||
|
require("base16-colorscheme").with_config({
|
||||||
|
-- TODO: maybe make Telescope borders visible?
|
||||||
|
-- telescope = false,
|
||||||
|
})
|
||||||
|
vim.cmd.colorscheme "base16-tomorrow-night"
|
||||||
|
|
||||||
|
local colors = require("base16-colorscheme").colors
|
||||||
|
-- local blue_m1 = "#9cc4e6"
|
||||||
|
local blue = colors.base0D -- #81a2be
|
||||||
|
-- local blue_p1 = "#5f819d"
|
||||||
|
local blue_p2 = "#445666"
|
||||||
|
local blue_p3 = "#2a3640"
|
||||||
|
local cyan = colors.base0C -- #8abeb7
|
||||||
|
local fg = colors.base05 -- #c5c8c6
|
||||||
|
local fg_dark = "#515151"
|
||||||
|
-- local green = colors.base0B -- #b5bd68
|
||||||
|
local green_p1 = "#8c9440"
|
||||||
|
-- local green_p2 = "#5f875f"
|
||||||
|
local green_bg = "#404324"
|
||||||
|
-- local orange = colors.base09 -- #de935f
|
||||||
|
-- local magenta = colors.base0E -- #b294bb
|
||||||
|
local red = colors.base08 -- #cc6666
|
||||||
|
local red_bg = "#4e2626"
|
||||||
|
local yellow = colors.base0A -- #f0c674
|
||||||
|
|
||||||
|
-- Cursor
|
||||||
|
vim.api.nvim_command("highlight CursorLineNr guifg=" .. yellow .. " gui=bold")
|
||||||
|
-- Diffview
|
||||||
|
vim.api.nvim_command("highlight DiffviewDiffAdd guibg=" .. green_bg)
|
||||||
|
vim.api.nvim_command("highlight DiffviewDiffChange guibg=" .. blue_p3) -- Unchanged part on a change line
|
||||||
|
vim.api.nvim_command("highlight DiffviewDiffDelete guibg=" .. red_bg .. " guifg=" .. fg_dark)
|
||||||
|
vim.api.nvim_command("highlight DiffviewDiffText guibg=" .. blue_p2) -- Changed part on a change line
|
||||||
|
-- Git gutter
|
||||||
|
vim.api.nvim_command("highlight GitSignsAdd guifg=" .. green_p1)
|
||||||
|
vim.api.nvim_command("highlight GitSignsChange guifg=" .. yellow)
|
||||||
|
-- Rainbow delimiters
|
||||||
|
vim.api.nvim_command("highlight RainbowDelimiterBlue guifg=" .. blue)
|
||||||
|
vim.api.nvim_command("highlight RainbowDelimiterCyan guifg=" .. cyan)
|
||||||
|
vim.api.nvim_command("highlight RainbowDelimiterGreen guifg=" .. green_p1)
|
||||||
|
vim.api.nvim_command("highlight RainbowDelimiterOrange guifg=" .. fg)
|
||||||
|
vim.api.nvim_command("highlight RainbowDelimiterRed guifg=" .. red)
|
||||||
|
vim.api.nvim_command("highlight RainbowDelimiterYellow guifg=" .. yellow)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Set lualine as statusline
|
||||||
|
{
|
||||||
|
-- See `:help lualine.txt`
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
opts = {
|
||||||
|
options = {
|
||||||
|
icons_enabled = false,
|
||||||
|
theme = "base16",
|
||||||
|
component_separators = { left = "", right = "" },
|
||||||
|
section_separators = { left = "", right = "" },
|
||||||
|
globalstatus = true,
|
||||||
|
},
|
||||||
|
sections = {
|
||||||
|
lualine_a = { "mode" },
|
||||||
|
lualine_b = { "encoding", "filename" },
|
||||||
|
lualine_c = {
|
||||||
|
{
|
||||||
|
-- TODO: nvim alternate file stuff and closing files is busted
|
||||||
|
"project",
|
||||||
|
fmt = function()
|
||||||
|
local path = require("core.functions").find_project_root() or ""
|
||||||
|
return path:match("([^/]+)$")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
lualine_x = { "diagnostics", "fileformat" },
|
||||||
|
lualine_y = { "filetype" },
|
||||||
|
lualine_z = { "progress", "location" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Add file type icons to plugins
|
||||||
|
{ "nvim-tree/nvim-web-devicons", lazy = true },
|
||||||
|
|
||||||
|
-- Dashboard
|
||||||
|
{
|
||||||
|
"nvimdev/dashboard-nvim",
|
||||||
|
event = "VimEnter",
|
||||||
|
opts = {
|
||||||
|
config = {
|
||||||
|
header = {
|
||||||
|
" . . ",
|
||||||
|
" ';;,. ::' ",
|
||||||
|
" ,:::;,, :ccc, ",
|
||||||
|
" ,::c::,,,,. :cccc, ",
|
||||||
|
" ,cccc:;;;;;. cllll, ",
|
||||||
|
" ,cccc;.;;;;;, cllll; ",
|
||||||
|
" :cccc; .;;;;;;. coooo; ",
|
||||||
|
" ;llll; ,:::::'loooo; ",
|
||||||
|
" ;llll: ':::::loooo: ",
|
||||||
|
" :oooo: .::::llodd: ",
|
||||||
|
" .;ooo: ;cclooo:. ",
|
||||||
|
" .;oc 'coo;. ",
|
||||||
|
" .' .,. ",
|
||||||
|
"",
|
||||||
|
" _______________________________________________________",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
},
|
||||||
|
shortcut = {
|
||||||
|
{ desc = "Neovim master race!" },
|
||||||
|
},
|
||||||
|
footer = {},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Show project errors
|
||||||
|
{
|
||||||
|
"folke/trouble.nvim",
|
||||||
|
cmd = "Trouble", -- defer
|
||||||
|
opts = {
|
||||||
|
mode = "lsp_references",
|
||||||
|
use_diagnostic_signs = true,
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
-- Gutter/fringe icons
|
||||||
|
-- https://github.com/folke/trouble.nvim/issues/52
|
||||||
|
local signs = {
|
||||||
|
Error = "»",
|
||||||
|
Warn = "»",
|
||||||
|
Hint = "»",
|
||||||
|
Info = "»",
|
||||||
|
Other = "»",
|
||||||
|
}
|
||||||
|
for type, icon in pairs(signs) do
|
||||||
|
local hl = "DiagnosticSign" .. type
|
||||||
|
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Show project TODOs
|
||||||
|
{
|
||||||
|
"folke/todo-comments.nvim",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Useful plugin to show you pending keybinds.
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
|
||||||
|
-- Rainbow delimiters
|
||||||
|
{
|
||||||
|
"HiPhish/rainbow-delimiters.nvim",
|
||||||
|
opts = {
|
||||||
|
highlight = {
|
||||||
|
"RainbowDelimiterOrange", -- white
|
||||||
|
"RainbowDelimiterCyan",
|
||||||
|
"RainbowDelimiterYellow",
|
||||||
|
"RainbowDelimiterGreen",
|
||||||
|
"RainbowDelimiterBlue",
|
||||||
|
"RainbowDelimiterOrange", -- white
|
||||||
|
"RainbowDelimiterCyan",
|
||||||
|
"RainbowDelimiterYellow",
|
||||||
|
"RainbowDelimiterGreen",
|
||||||
|
"RainbowDelimiterBlue",
|
||||||
|
"RainbowDelimiterRed",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("rainbow-delimiters.setup").setup(opts)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Rainbow-mode
|
||||||
|
{ -- https://github.com/norcalli/nvim-colorizer.lua
|
||||||
|
"norcalli/nvim-colorizer.lua",
|
||||||
|
opts = {},
|
||||||
|
}, -- :ColorizerToggle
|
||||||
|
|
||||||
|
-- Popup terminal
|
||||||
|
{
|
||||||
|
"akinsho/toggleterm.nvim",
|
||||||
|
config = function()
|
||||||
|
vim.cmd [[let &shellcmdflag = '-s']] -- required for Windows
|
||||||
|
require("toggleterm").setup({
|
||||||
|
auto_scroll = true,
|
||||||
|
direction = "float",
|
||||||
|
float_opts = {
|
||||||
|
border = "curved",
|
||||||
|
row = function() return vim.o.lines - 4 end,
|
||||||
|
width = function() return vim.o.columns - 6 end,
|
||||||
|
height = 20,
|
||||||
|
winblend = 0,
|
||||||
|
},
|
||||||
|
hide_numbers = true,
|
||||||
|
open_mapping = nil,
|
||||||
|
persist_mode = true,
|
||||||
|
size = 20,
|
||||||
|
start_in_insert = true,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"export-settings-ini": true,
|
||||||
|
"export-gtkrc-20": true,
|
||||||
|
"export-index-theme": true,
|
||||||
|
"export-xsettingsd": true,
|
||||||
|
"export-gtk4-symlinks": true
|
||||||
|
}
|
||||||
@@ -1,4 +1,9 @@
|
|||||||
#!/hint/bash
|
#!/hint/bash
|
||||||
|
|
||||||
# Make Flags: use 4 threads
|
# Amount of threads the use with the make command
|
||||||
MAKEFLAGS="-j4"
|
# >>> hostname=arch-desktop
|
||||||
|
MAKEFLAGS="-j8"
|
||||||
|
# <<<
|
||||||
|
# >>> hostname=arch-laptop
|
||||||
|
# MAKEFLAGS="-j4"
|
||||||
|
# <<<
|
||||||
|
|||||||
+12
-9
@@ -1,4 +1,4 @@
|
|||||||
include-file = $HOME/.config/polybar/colors
|
include-file = $HOME/.config/polybar/xresources
|
||||||
include-file = $HOME/.config/polybar/modules
|
include-file = $HOME/.config/polybar/modules
|
||||||
|
|
||||||
; https://github.com/polybar/polybar/wiki/Configuration#global-wm-settings
|
; https://github.com/polybar/polybar/wiki/Configuration#global-wm-settings
|
||||||
@@ -10,7 +10,6 @@ margin-bottom = 0
|
|||||||
[settings]
|
[settings]
|
||||||
throttle-output = 5
|
throttle-output = 5
|
||||||
throttle-output-for = 10
|
throttle-output-for = 10
|
||||||
throttle-input-for = 30
|
|
||||||
|
|
||||||
screenchange-reload = true
|
screenchange-reload = true
|
||||||
|
|
||||||
@@ -19,6 +18,7 @@ screenchange-reload = true
|
|||||||
|
|
||||||
pseudo-transparency = false
|
pseudo-transparency = false
|
||||||
|
|
||||||
|
; https://github.com/polybar/polybar/wiki/Configuration#bar-settings
|
||||||
[bar/polybar]
|
[bar/polybar]
|
||||||
monitor = ${env:MONITOR:eDP-1}
|
monitor = ${env:MONITOR:eDP-1}
|
||||||
|
|
||||||
@@ -44,12 +44,15 @@ padding-right = 2
|
|||||||
module-margin-left = 1
|
module-margin-left = 1
|
||||||
module-margin-right = 2
|
module-margin-right = 2
|
||||||
|
|
||||||
|
dpi-x = ${font.dpi}
|
||||||
|
dpi-y = ${font.dpi}
|
||||||
|
|
||||||
; https://github.com/polybar/polybar/wiki/Fonts
|
; https://github.com/polybar/polybar/wiki/Fonts
|
||||||
font-0 = "DejaVu Sans:pixelsize=18;3"
|
font-0 = "DejaVu Sans:pixelsize=9;3"
|
||||||
font-1 = "Source Han Sans JP Medium:pixelsize=18;3"
|
font-1 = "Source Han Sans JP Medium:pixelsize=9;3"
|
||||||
font-2 = "Font Awesome 5 Free:style=Regular:pixelsize=16;3"
|
font-2 = "Font Awesome 6 Free:style=Regular:pixelsize=8;3"
|
||||||
font-3 = "Font Awesome 5 Free:style=Solid:pixelsize=16;3"
|
font-3 = "Font Awesome 6 Free:style=Solid:pixelsize=8;3"
|
||||||
font-4 = "Font Awesome 5 Brands:pixelsize=16;3"
|
font-4 = "Font Awesome 6 Brands:pixelsize=8;3"
|
||||||
|
|
||||||
modules-left = bspwm
|
modules-left = bspwm
|
||||||
modules-center = title
|
modules-center = title
|
||||||
@@ -64,8 +67,8 @@ tray-detached = false
|
|||||||
wm-restack = bspwm
|
wm-restack = bspwm
|
||||||
; wm-name = ${env:PANEL_NAME:polybar_panel}
|
; wm-name = ${env:PANEL_NAME:polybar_panel}
|
||||||
|
|
||||||
scroll-up = bspwm-deskprev
|
scroll-up = #bspwm.prev
|
||||||
scroll-down = bspwm-desknext
|
scroll-down = #bspwm.next
|
||||||
|
|
||||||
cursor-click = pointer
|
cursor-click = pointer
|
||||||
; cursor-scroll = ns-resize
|
; cursor-scroll = ns-resize
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ format =
|
|||||||
type = internal/date
|
type = internal/date
|
||||||
interval = 5
|
interval = 5
|
||||||
|
|
||||||
time = %I:%M %p
|
time = %I:%M %p %a
|
||||||
time-alt =
|
time-alt =
|
||||||
|
|
||||||
format = %{A1:$HOME/.local/bin/panel/date.sh:}<label>%{A}
|
format = %{A1:$HOME/.local/bin/panel/date.sh:}<label>%{A}
|
||||||
|
|||||||
@@ -30,3 +30,7 @@ bgcolor-inactive = ${xrdb:WmColor.bgcolor_Inactive:#2b2e39}
|
|||||||
bgcolor-urgent = ${xrdb:WmColor.bgcolor_Urgent:#dc7a43}
|
bgcolor-urgent = ${xrdb:WmColor.bgcolor_Urgent:#dc7a43}
|
||||||
fgcolor = ${xrdb:WmColor.fgcolor:#ffffff}
|
fgcolor = ${xrdb:WmColor.fgcolor:#ffffff}
|
||||||
fgcolor-inactive = ${xrdb:WmColor.fgcolor_Inactive:#676e7d}
|
fgcolor-inactive = ${xrdb:WmColor.fgcolor_Inactive:#676e7d}
|
||||||
|
|
||||||
|
; System font DPI scaling
|
||||||
|
[font]
|
||||||
|
dpi = ${xrdb:Xft.dpi:96}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# -*- python -*-
|
||||||
|
|
||||||
|
import os
|
||||||
|
import atexit
|
||||||
|
import readline
|
||||||
|
|
||||||
|
history = os.path.join(os.environ['XDG_CACHE_HOME'], 'python_history')
|
||||||
|
try:
|
||||||
|
readline.read_history_file(history)
|
||||||
|
except OSError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def write_history():
|
||||||
|
try:
|
||||||
|
readline.write_history_file(history)
|
||||||
|
except OSError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
atexit.register(write_history)
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
[Appearance]
|
[Appearance]
|
||||||
color_scheme_path=/usr/share/qt5ct/colors/darker.conf
|
color_scheme_path=/usr/share/qt5ct/colors/darker.conf
|
||||||
custom_palette=false
|
custom_palette=false
|
||||||
icon_theme=breeze-dark
|
icon_theme=Arc
|
||||||
standard_dialogs=gtk2
|
standard_dialogs=default
|
||||||
style=gtk2
|
style=kvantum
|
||||||
|
|
||||||
[Fonts]
|
[Fonts]
|
||||||
fixed=@Variant(\0\0\0@\0\0\0\x16\0\x44\0\x65\0j\0\x61\0V\0u\0 \0S\0\x61\0n\0s@$\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
|
fixed=@Variant(\0\0\0@\0\0\0\x16\0\x44\0\x65\0j\0\x61\0V\0u\0 \0S\0\x61\0n\0s@$\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
|
||||||
@@ -19,10 +19,14 @@ gui_effects=@Invalid()
|
|||||||
keyboard_scheme=2
|
keyboard_scheme=2
|
||||||
menus_have_icons=true
|
menus_have_icons=true
|
||||||
show_shortcuts_in_context_menus=true
|
show_shortcuts_in_context_menus=true
|
||||||
stylesheets=@Invalid()
|
stylesheets=/usr/share/qt5ct/qss/tooltip-arc.qss
|
||||||
toolbutton_style=4
|
toolbutton_style=4
|
||||||
underline_shortcut=1
|
underline_shortcut=1
|
||||||
wheel_scroll_lines=3
|
wheel_scroll_lines=3
|
||||||
|
|
||||||
[SettingsWindow]
|
[SettingsWindow]
|
||||||
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\x1\x8e\0\0\0\xc0\0\0\x4p\0\0\x3&\0\0\x1\x90\0\0\0\xc2\0\0\x4n\0\0\x3$\0\0\0\0\0\0\0\0\x5\xdc\0\0\x1\x90\0\0\0\xc2\0\0\x4n\0\0\x3$)
|
geometry=@Invalid()
|
||||||
|
|
||||||
|
[Troubleshooting]
|
||||||
|
force_raster_widgets=0
|
||||||
|
ignored_applications=@Invalid()
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
[Appearance]
|
||||||
|
color_scheme_path=/usr/share/qt6ct/colors/darker.conf
|
||||||
|
custom_palette=false
|
||||||
|
icon_theme=Arc
|
||||||
|
standard_dialogs=default
|
||||||
|
style=kvantum
|
||||||
|
|
||||||
|
[Fonts]
|
||||||
|
fixed="DejaVu Sans,10,-1,5,400,0,0,0,0,0,0,0,0,0,0,1"
|
||||||
|
general="DejaVu Sans,10,-1,5,400,0,0,0,0,0,0,0,0,0,0,1"
|
||||||
|
|
||||||
|
[Interface]
|
||||||
|
activate_item_on_single_click=1
|
||||||
|
buttonbox_layout=0
|
||||||
|
cursor_flash_time=1000
|
||||||
|
dialog_buttons_have_icons=1
|
||||||
|
double_click_interval=400
|
||||||
|
gui_effects=@Invalid()
|
||||||
|
keyboard_scheme=2
|
||||||
|
menus_have_icons=true
|
||||||
|
show_shortcuts_in_context_menus=true
|
||||||
|
stylesheets=@Invalid()
|
||||||
|
toolbutton_style=4
|
||||||
|
underline_shortcut=1
|
||||||
|
wheel_scroll_lines=3
|
||||||
|
|
||||||
|
[SettingsWindow]
|
||||||
|
geometry=@Invalid()
|
||||||
|
|
||||||
|
[Troubleshooting]
|
||||||
|
force_raster_widgets=0
|
||||||
|
ignored_applications=@Invalid()
|
||||||
@@ -1,32 +1,58 @@
|
|||||||
import os
|
import os
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
# Load autoconfig.yml
|
||||||
config.load_autoconfig()
|
config.load_autoconfig()
|
||||||
|
|
||||||
## Keybinds
|
# Keybinds
|
||||||
|
# ---------------------------------------- #
|
||||||
|
|
||||||
# General
|
# General
|
||||||
config.unbind('d')
|
config.unbind('d')
|
||||||
config.bind('dd', 'tab-close')
|
config.bind('dd', 'tab-close')
|
||||||
config.bind('<F1>', 'config-cycle tabs.show always never')
|
config.bind('go', 'set-cmd-text :open -s {url:pretty}')
|
||||||
|
config.bind('gO', 'set-cmd-text :open -s -t -r {url:pretty}')
|
||||||
|
config.bind('o', 'set-cmd-text -s :open -s')
|
||||||
|
config.bind('O', 'set-cmd-text -s :open -s -t')
|
||||||
config.bind('Sb', 'open -t qute://bookmarks#bookmarks')
|
config.bind('Sb', 'open -t qute://bookmarks#bookmarks')
|
||||||
config.bind('Sh', 'open -t qute://history')
|
config.bind('Sh', 'open -t qute://history')
|
||||||
config.bind('Sq', 'open -t qute://bookmarks')
|
config.bind('Sq', 'open -t qute://bookmarks')
|
||||||
config.bind('Ss', 'open -t qute://settings')
|
config.bind('Ss', 'open -t qute://settings')
|
||||||
|
config.bind('wo', 'set-cmd-text -s :open -s -w')
|
||||||
|
config.bind('wO', 'set-cmd-text -s :open -s -w {url:pretty}')
|
||||||
|
config.bind('wp', 'open -s -w -- {clipboard}')
|
||||||
|
config.bind('wP', 'open -s -w -- {primary}')
|
||||||
|
config.bind('<<', 'tab-move -')
|
||||||
|
config.bind('>>', 'tab-move +')
|
||||||
|
config.bind('<Alt-`>', 'tab-focus last')
|
||||||
|
config.bind('<F1>', 'config-cycle tabs.show always never')
|
||||||
|
|
||||||
|
# Command menu selection
|
||||||
|
config.bind('<Alt-h>', 'mode-leave', mode='command')
|
||||||
|
config.bind('<Alt-j>', 'completion-item-focus --history next', mode='command')
|
||||||
|
config.bind('<Alt-k>', 'completion-item-focus --history prev', mode='command')
|
||||||
|
config.bind('<Alt-l>', 'command-accept', mode='command')
|
||||||
|
config.bind('<Ctrl-g>', 'mode-leave', mode='command')
|
||||||
|
|
||||||
# Legacy bindings
|
# Legacy bindings
|
||||||
config.bind('<Alt-Left>', 'back')
|
config.bind('<Alt-Left>', 'back')
|
||||||
config.bind('<Alt-Right>', 'forward')
|
config.bind('<Alt-Right>', 'forward')
|
||||||
|
config.bind('<Ctrl-->', 'zoom-out')
|
||||||
|
config.bind('<Ctrl-=>', 'zoom-in')
|
||||||
|
config.bind('<Ctrl-0>', 'zoom')
|
||||||
config.bind('<Ctrl-B>', 'open -t qute://bookmarks#bookmarks')
|
config.bind('<Ctrl-B>', 'open -t qute://bookmarks#bookmarks')
|
||||||
config.bind('<Ctrl-D>', 'bookmark-add')
|
config.bind('<Ctrl-D>', 'bookmark-add')
|
||||||
config.bind('<Ctrl-F>', 'set-cmd-text /')
|
config.bind('<Ctrl-F>', 'set-cmd-text /')
|
||||||
config.bind('<Ctrl-H>', 'open -t qute://history')
|
config.bind('<Ctrl-H>', 'open -t qute://history')
|
||||||
config.bind('<Ctrl-L>', 'set-cmd-text :open {url:pretty}')
|
config.bind('<Ctrl-L>', 'set-cmd-text :open -s {url:pretty}')
|
||||||
config.bind('<Ctrl-R>', 'reload')
|
config.bind('<Ctrl-R>', 'reload')
|
||||||
config.bind('<Ctrl-Shift-R>', 'reload -f')
|
config.bind('<Ctrl-Shift-R>', 'reload -f')
|
||||||
config.bind('<Ctrl-Shift-T>', 'undo')
|
config.bind('<Ctrl-Shift-T>', 'undo')
|
||||||
config.bind('<Ctrl-Shift-Tab>', 'tab-prev')
|
config.bind('<Ctrl-Shift-Tab>', 'tab-prev')
|
||||||
|
config.bind('<Ctrl-T>', ':open -t about:blank ;; set-cmd-text -s :open -s ')
|
||||||
config.bind('<Ctrl-Tab>', 'tab-next')
|
config.bind('<Ctrl-Tab>', 'tab-next')
|
||||||
config.bind('<F6>', 'set-cmd-text :open {url:pretty}')
|
config.bind('<F6>', 'set-cmd-text :open -s {url:pretty}')
|
||||||
|
config.bind('<F12>', 'devtools bottom')
|
||||||
config.bind('<Shift-Space>', 'scroll-page 0 -1')
|
config.bind('<Shift-Space>', 'scroll-page 0 -1')
|
||||||
config.bind('<Space>', 'scroll-page 0 0.5')
|
config.bind('<Space>', 'scroll-page 0 0.5')
|
||||||
# j open downloads
|
# j open downloads
|
||||||
@@ -37,29 +63,28 @@ config.bind('<Ctrl-Shift-m>', 'hint links spawn umpv {hint-url}')
|
|||||||
config.bind(';M', 'hint --rapid links spawn umpv {hint-url}')
|
config.bind(';M', 'hint --rapid links spawn umpv {hint-url}')
|
||||||
|
|
||||||
# Reload browser config
|
# Reload browser config
|
||||||
config.bind('<Alt-Shift-r>', 'config-source')
|
config.bind('<Alt-Shift-r>', 'config-source ;; message-info "qutebrowser reloaded."')
|
||||||
|
|
||||||
## Config
|
# Run :debug-keytester to get keybinding names
|
||||||
|
|
||||||
# General
|
# General
|
||||||
|
# ---------------------------------------- #
|
||||||
|
|
||||||
c.auto_save.session = True
|
c.auto_save.session = True
|
||||||
c.completion.height = '35%'
|
c.completion.height = '35%'
|
||||||
# c.completion.shrink = False
|
# c.completion.shrink = False
|
||||||
|
c.content.geolocation = False
|
||||||
c.content.headers.accept_language = 'en-US,en;q=0.5'
|
c.content.headers.accept_language = 'en-US,en;q=0.5'
|
||||||
c.content.headers.custom = {"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"}
|
c.content.headers.custom = { 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' }
|
||||||
c.content.headers.user_agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36'
|
c.content.headers.do_not_track = True
|
||||||
c.content.host_blocking.lists = [
|
c.content.headers.referer = 'same-domain'
|
||||||
'https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts',
|
c.content.headers.user_agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/{upstream_browser_version} Safari/537.36'
|
||||||
'https://www.malwaredomainlist.com/hostslist/hosts.txt',
|
|
||||||
'https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext&useip=0.0.0.0'
|
|
||||||
]
|
|
||||||
# c.content.host_blocking.whitelist = ['piwik.org']
|
|
||||||
c.content.pdfjs = True
|
c.content.pdfjs = True
|
||||||
c.fonts.monospace = '"DejaVu Sans", "xos4 Terminus", Terminus, Monospace, Monaco, "Bitstream Vera Sans Mono", "Andale Mono", "Courier New", Courier, "Liberation Mono", monospace, Fixed, Consolas, Terminal'
|
c.content.webrtc_ip_handling_policy = 'default-public-interface-only'
|
||||||
|
c.fonts.default_family = ['DejaVu Sans', 'Source Han Sans JP']
|
||||||
# c.hints.chars = 'asdfghjkl'
|
# c.hints.chars = 'asdfghjkl'
|
||||||
c.scrolling.bar = 'always'
|
c.scrolling.bar = 'always'
|
||||||
c.session.lazy_restore = True
|
c.session.lazy_restore = True
|
||||||
# $ /usr/share/qutebrowser/scripts/dictcli.py install en-US nl-NL
|
|
||||||
c.spellcheck.languages = ['en-US', 'nl-NL']
|
c.spellcheck.languages = ['en-US', 'nl-NL']
|
||||||
c.statusbar.padding = {'top': 1, 'bottom': 3, 'left': 5, 'right': 5}
|
c.statusbar.padding = {'top': 1, 'bottom': 3, 'left': 5, 'right': 5}
|
||||||
c.statusbar.position = 'top'
|
c.statusbar.position = 'top'
|
||||||
@@ -68,7 +93,7 @@ c.tabs.indicator.width = 0
|
|||||||
c.tabs.last_close = 'blank'
|
c.tabs.last_close = 'blank'
|
||||||
c.tabs.padding = {'top': 3, 'bottom': 3, 'left': 5, 'right': 5}
|
c.tabs.padding = {'top': 3, 'bottom': 3, 'left': 5, 'right': 5}
|
||||||
c.tabs.position = 'left'
|
c.tabs.position = 'left'
|
||||||
c.tabs.title.format = '{index}: {audio}{title}'
|
c.tabs.title.format = '{index}: {audio}{current_title}'
|
||||||
c.tabs.width = 240
|
c.tabs.width = 240
|
||||||
c.url.default_page = 'about:blank'
|
c.url.default_page = 'about:blank'
|
||||||
c.url.searchengines = {
|
c.url.searchengines = {
|
||||||
@@ -80,8 +105,11 @@ c.url.searchengines = {
|
|||||||
'i': 'https://google.com/search?tbm=isch&q={}',
|
'i': 'https://google.com/search?tbm=isch&q={}',
|
||||||
'yt': 'https://youtube.com/results?search_query={}',
|
'yt': 'https://youtube.com/results?search_query={}',
|
||||||
}
|
}
|
||||||
|
c.url.start_pages = 'https://google.com'
|
||||||
|
|
||||||
# Colors
|
# Colors
|
||||||
|
# ---------------------------------------- #
|
||||||
|
|
||||||
e = os.environ
|
e = os.environ
|
||||||
bgcolor = e['BGCOLOR']
|
bgcolor = e['BGCOLOR']
|
||||||
bgcolor_inactive = e['BGCOLOR_INACTIVE']
|
bgcolor_inactive = e['BGCOLOR_INACTIVE']
|
||||||
@@ -206,3 +234,8 @@ c.colors.tabs.selected.odd.fg = white
|
|||||||
|
|
||||||
# Default background color
|
# Default background color
|
||||||
c.colors.webpage.bg = fgcolor
|
c.colors.webpage.bg = fgcolor
|
||||||
|
|
||||||
|
# Update external dependencies
|
||||||
|
# ---------------------------------------- #
|
||||||
|
|
||||||
|
subprocess.run(['setsid', '-f', 'python', os.path.join(e['XDG_CONFIG_HOME'], 'qutebrowser/update.py')] + c.spellcheck.languages)
|
||||||
|
|||||||
Executable
+32
@@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
import os
|
||||||
|
import requests
|
||||||
|
import sys
|
||||||
|
|
||||||
|
arguments = sys.argv
|
||||||
|
e = os.environ
|
||||||
|
|
||||||
|
# Remove script call from argument list
|
||||||
|
arguments.pop(0)
|
||||||
|
|
||||||
|
# Update spellcheck dictionaries
|
||||||
|
# ---------------------------------------- #
|
||||||
|
|
||||||
|
for language in arguments:
|
||||||
|
os.system('/usr/share/qutebrowser/scripts/dictcli.py install ' + language)
|
||||||
|
|
||||||
|
# Update user scripts
|
||||||
|
# ---------------------------------------- #
|
||||||
|
|
||||||
|
dir = os.path.join(e['XDG_DATA_HOME'], 'qutebrowser/greasemonkey')
|
||||||
|
|
||||||
|
scripts = ['https://www.4chan-x.net/builds/4chan-X.user.js',
|
||||||
|
'https://greasyfork.org/scripts/395257-better-google/code/Better Google.user.js',
|
||||||
|
'https://greasyfork.org/scripts/29420-google-dwimages/code/Google DWIMages.user.js']
|
||||||
|
for url in scripts:
|
||||||
|
r = requests.get(url, allow_redirects = True)
|
||||||
|
open(os.path.join(dir, os.path.basename(url)), 'wb').write(r.content)
|
||||||
|
|
||||||
|
# Reload greasemonkey
|
||||||
|
os.system('qutebrowser -C /dev/null :greasemonkey-reload')
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
[redshift]
|
|
||||||
temp-day=5700
|
|
||||||
temp-night=3000
|
|
||||||
fade=1
|
|
||||||
|
|
||||||
brightness-day=1.0
|
|
||||||
brightness-night=0.9
|
|
||||||
|
|
||||||
location-provider=manual
|
|
||||||
adjustment-method=randr
|
|
||||||
|
|
||||||
[manual]
|
|
||||||
lat=51.81
|
|
||||||
lon=4.67
|
|
||||||
@@ -9,9 +9,11 @@ configuration {
|
|||||||
display-drun: "run";
|
display-drun: "run";
|
||||||
|
|
||||||
/* Layout */
|
/* Layout */
|
||||||
font: "DejaVu Sans Mono, Font Awesome 5 Free 12";
|
font: "DejaVu Sans Mono, Font Awesome 6 Free 12";
|
||||||
lines: 8;
|
|
||||||
width: 50;
|
/* >>> hostname=arch-laptop */
|
||||||
|
/* dpi: 192; */
|
||||||
|
/* <<< */
|
||||||
|
|
||||||
/* Icons */
|
/* Icons */
|
||||||
icon-theme: "Arc";
|
icon-theme: "Arc";
|
||||||
@@ -20,7 +22,7 @@ configuration {
|
|||||||
/* Keybinds */
|
/* Keybinds */
|
||||||
kb-cancel: "Escape,Control+g,Control+bracketleft,Alt+h";
|
kb-cancel: "Escape,Control+g,Control+bracketleft,Alt+h";
|
||||||
kb-row-down: "Down,Control+n,Alt+j";
|
kb-row-down: "Down,Control+n,Alt+j";
|
||||||
kb-row-up: "Up,Control+p,ISO_Left_Tab,Alt+k";
|
kb-row-up: "Up,Control+p,Alt+k";
|
||||||
kb-accept-entry: "Control+j,Control+m,Return,KP_Enter,Alt+l";
|
kb-accept-entry: "Control+j,Control+m,Return,KP_Enter,Alt+l";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,21 @@
|
|||||||
/* -*- css -*- */
|
/* -*- css -*- */
|
||||||
|
|
||||||
window {
|
window {
|
||||||
border: 4;
|
border: 0.13em;
|
||||||
|
width: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
listview {
|
listview {
|
||||||
|
lines: 8;
|
||||||
scrollbar: false;
|
scrollbar: false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
element-icon {
|
||||||
|
padding: 0.05em 0 0.05em 0.2em;
|
||||||
|
size: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
element-text {
|
||||||
|
background-color: default;
|
||||||
|
padding: 0.05em 0 0.05em 0.3em;
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#--- Player ---#
|
||||||
|
|
||||||
|
player=mpv
|
||||||
|
title={title} - {author}
|
||||||
|
|
||||||
|
#--- Video ---#
|
||||||
|
|
||||||
|
default-stream=720p,720p60,480p,best
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user