AutoYADM commit: 2025-06-13 14:07:05

This commit is contained in:
Daniel Fichtinger 2025-06-13 14:07:05 -04:00
parent 7fd9131e71
commit 30d07da785
3 changed files with 42 additions and 17 deletions

View file

@ -18,18 +18,39 @@ define-command editorconfig-load -params ..1 -docstring "editorconfig-load [file
file="${1:-$kak_buffile}" file="${1:-$kak_buffile}"
filetype="$kak_opt_filetype" filetype="$kak_opt_filetype"
# check if we have a real file or a scratch buffer # check if we have a real file or a scratch buffer
# if [ -f "$file" ]; then if [ ! -f "$file" ]; then
# case "$filetype" in scratch="true"
# markdown) file="scratch.md" ;; # need to create .editorconfig in /tmp if it's not there
# python) file="scratch.py" ;; if [ ! -f "/tmp/.editorconfig" ]; then
# sh) file="scratch.sh" ;; cp "$HOME/.editorconfig" "/tmp/.editorconfig"
# bash) file="scratch.sh" ;; fi
# fish) file="scratch.fish" ;; case "$filetype" in
# json) file="scratch.json" ;; markdown)
# toml) file="scratch.toml" ;; file="/tmp/scratch.md"
# *) file="scratch.txt" ;; touch "$file";;
# esac python)
# fi file="/tmp/scratch.py"
touch "$file";;
sh)
file="/tmp/scratch.sh"
touch "$file";;
bash)
file="/tmp/scratch.sh"
touch "$file";;
fish)
file="/tmp/scratch.fish"
touch "$file";;
json)
file="/tmp/scratch.json"
touch "$file";;
toml)
file="/tmp/scratch.toml"
touch "$file";;
*)
file="/tmp/scratch.txt"
touch "$file";;
esac
fi
case $file in case $file in
/*) # $kak_buffile is a full path that starts with a '/' /*) # $kak_buffile is a full path that starts with a '/'
printf %s\\n "remove-hooks buffer editorconfig-hooks" printf %s\\n "remove-hooks buffer editorconfig-hooks"
@ -69,6 +90,10 @@ define-command editorconfig-load -params ..1 -docstring "editorconfig-load [file
} }
' ;; ' ;;
esac esac
# if [ -n "$scratch" ]; then
# rm "/tmp/.editorconfig"
# rm "$file"
# fi
} }
} }
complete-command editorconfig-load file complete-command editorconfig-load file

View file

@ -95,7 +95,7 @@ bundle-noload kakoune-text-objects https://github.com/Delapouite/kakoune-text-ob
bundle smarttab.kak https://github.com/andreyorst/smarttab.kak %{ bundle smarttab.kak https://github.com/andreyorst/smarttab.kak %{
require-module smarttab require-module smarttab
set-option global softtabstop 2 set-option global softtabstop 2
hook global BufCreate .* %{ hook global WinSetOption filetype=.* %{
editorconfig-load editorconfig-load
autoconfigtab autoconfigtab
} }

View file

@ -15,18 +15,18 @@ indent_size = 4
[*.go] [*.go]
indent_style = tab indent_style = tab
[*md] [*.md]
trim_trailing_whitespace = false trim_trailing_whitespace = false
insert_final_newline = true insert_final_newline = true
indent_style = space indent_style = space
indent_size = 2 indent_size = 2
[*yml] [*.yml]
indent_style = space indent_style = space
indent_size = 2 indent_size = 2
[*typ] [*.typ]
indent_style = space indent_style = space
indent_size = 2 indent_size = 2
[*fish] [*.fish]
indent_style = space indent_style = space
indent_size = 4 indent_size = 4