Bootstrap : Add Editorconfig.

This commit is contained in:
Dmitry Voronin 2023-12-17 19:44:49 +03:00
parent ec91fbef54
commit ff07b915af

View file

@ -1,6 +1,6 @@
# Install Cargo/Rust.
function bootstrap_rust() {
curl https://sh.rustup.rs -sSf | sh
curl https://sh.rustup.rs -sSf | sh
rustup component add rust-analyzer
}
@ -25,3 +25,33 @@ function bootstrap_grub() {
function bootstrap_ffmpeg() {
flatpak install org.kde.kdenlive
}
# Install Editorconfig file (with tabs) in current directory.
function bootstrap_editorconfig() {
echo "\
[*]
end_of_line = lf
charset = utf-8
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true
" > .editorconfig
}
# Install Editorconfig file (with specified spaces, 8 by default) in current directory.
# Usage: bootstrap_editorconfig_space [AMOUNT]
function bootstrap_editorconfig_space() {
local spaces="${1}"
[[ "${spaces}" = "" ]] && spaces=8
echo "\
[*]
end_of_line = lf
charset = utf-8
indent_style = space
indent_size = ${spaces}
insert_final_newline = true
trim_trailing_whitespace = true
" > .editorconfig
}