diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-10-20 22:04:58 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-10-21 13:39:46 +0530 |
| commit | 717ed5d90813ac7610b8d9cf1e110b6f31e87efc (patch) | |
| tree | 42162cb8d837eb63fa9b8a9e5dfbb480464e9065 /autoload/marks.kak | |
| parent | 662295b04b96580bcf1c78df9d13dca89adaa454 (diff) | |
| download | kakoune-config-717ed5d90813ac7610b8d9cf1e110b6f31e87efc.tar.gz kakoune-config-717ed5d90813ac7610b8d9cf1e110b6f31e87efc.zip | |
Fix datadir for marks + enable treesitter
Diffstat (limited to '')
| -rw-r--r-- | autoload/marks.kak | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/autoload/marks.kak b/autoload/marks.kak index adbf3a2..8eb4117 100644 --- a/autoload/marks.kak +++ b/autoload/marks.kak @@ -2,7 +2,10 @@ declare-option str marks_path declare-option str marks_name hook global KakBegin .* %{ - set-option global marks_path %sh{ echo "$XDG_DATA_HOME/kak/marks" } + set-option global marks_path %sh{ + datadir="${XDG_DATA_HOME:-"$HOME/.local/share"}" + echo "$datadir/kak/marks" + } } hook global EnterDirectory .* %{ evaluate-commands %sh{ @@ -26,7 +29,7 @@ define-command marks-add -params 1..2 %{ pos="$(echo "$pos" | awk '{printf "%.1f", $1 <= 1 ? 0 : $1 - 0.5}')"; fi function append() { cat; echo -e "$pos\t$newfile"; } - newfiles=$(grep -v "$newfile" "$path" \ + newfiles=$(grep -v -F "$newfile" "$path" \ | nl | sed 's/^\s*//' \ | append | LC_ALL=C sort -g -b -k 2 | uniq -f1 | LC_ALL=C sort -g -b \ | sed 's/^\s*[-.0-9]\+\s\+//') |
