diff --git a/.gitattributes b/.gitattributes index 7beaa80..a74c4ff 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,6 @@ *.rs linguist-language=Rust + +*.html linguist-detectable=false +*.sh linguist-detectable=false +*.vimrc linguist-detectable=false diff --git a/.gitignore b/.gitignore index 8ea0d84..8e8b085 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ # directories (by name) /_build/ +/_build-ci/ /scripts/__pycache__/ /scratch/ /target/ @@ -14,8 +15,6 @@ .DS_Store -#Cargo.lock - # files (by pattern) diff --git a/.vimrc b/.vimrc index ae7a676..d34bf9e 100644 --- a/.vimrc +++ b/.vimrc @@ -1,6 +1,70 @@ +" Synesis C/C++ project .vimrc — aligned with .sis/.vscode/c_cxx/settings.json +set nocompatible +filetype indent plugin on +syntax enable set autoindent -set expandtab -set shiftwidth=4 -set softtabstop=4 -set tabstop=4 +set backspace=indent,eol,start +set hlsearch +set incsearch +set number + +" files.insertFinalNewline +set eol +set fixeol + +" editor.renderWhitespace: all +set list +set listchars=tab:->,trail:-,extends:>,precedes:<,nbsp:+ + +" editor.detectIndentation: false — global defaults (editor.tabSize: 2, insertSpaces: false) +set tabstop=2 +set shiftwidth=2 +set softtabstop=2 +set noexpandtab +set colorcolumn=76 + +" colorcolumn draws a full-column tint in Vim (not a VS Code-style 1px line). +" Keep it subtle via the ColorColumn highlight group; reapply after colorscheme changes. +if has('termguicolors') + " set termguicolors +endif + +function! s:ConfigureColorColumn() abort + highlight ColorColumn ctermbg=236 guibg=#2a2a2a cterm=NONE gui=NONE +endfunction + +call s:ConfigureColorColumn() +autocmd ColorScheme * call s:ConfigureColorColumn() + +" files.trimTrailingWhitespace +autocmd BufWritePre * %s/\s\+$//e + +augroup sis_c_cxx + autocmd! + + " [c] / [cpp] + autocmd FileType c,cpp setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 colorcolumn=60,64,68,72,76 + + " [rust] + autocmd FileType rs setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 colorcolumn=76 + + " [cmake] + autocmd FileType cmake setlocal noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 + + " [shellscript] + autocmd FileType sh,bash,zsh setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2 colorcolumn=60,76 + + " [bat] + autocmd FileType bat,dosbatch setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 colorcolumn=60,76 + + " [json] / [markdown] / [yaml] / [ruby] + autocmd FileType json,markdown,yaml,ruby setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2 + + " [python] + autocmd FileType python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 colorcolumn=60,76 + + " [toml] + autocmd FileType toml setlocal noexpandtab tabstop=2 shiftwidth=2 softtabstop=2 +augroup END + diff --git a/.vscode/settings.json b/.vscode/settings.json index 6365143..f3490c4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,11 +1,16 @@ { "[json]": { + "editor.insertSpaces": false, + "editor.tabSize": 2, + }, + "[markdown]": { + "editor.insertSpaces": true, "editor.tabSize": 2, }, "[python]": { "editor.insertSpaces": true, "editor.rulers": [ 60, 76 ], - "editor.tabSize": 2, + "editor.tabSize": 4, }, "[ruby]": { "editor.insertSpaces": true, @@ -25,6 +30,7 @@ "editor.detectIndentation": false, "editor.insertSpaces": false, "editor.renderWhitespace": "all", + "editor.rulers": [ 76 ], "editor.tabSize": 2, "files.insertFinalNewline": true, "files.trimTrailingWhitespace": true, diff --git a/EXAMPLES.md b/EXAMPLES.md index e1f50c6..6f9dd90 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -1,4 +1,4 @@ -# shwild.Rust Examples +# shwild.Rust Examples |Name|Source & Description|Summary| |---|---|---| diff --git a/LICENSE b/LICENSE index 3f515c4..3050cda 100644 --- a/LICENSE +++ b/LICENSE @@ -1,13 +1,11 @@ BSD 3-Clause License - shwild.Rust -Copyright (c) 2019-2024, Matthew Wilson and Synesis Information Systems +Copyright (c) 2019-2026, Matthew Wilson and Synesis Information Systems Copyright (c) 2005-2019, Matthew Wilson and Sean Kelly - All rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: +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. diff --git a/rustfmt.toml b/rustfmt.toml index c08d358..36a98d2 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,10 +1,14 @@ # rustfmt.toml for shwild.Rust # -# Requires nightly rustfmt with unstable features enabled — use ./scripts/fmt +# Requires nightly rustfmt with unstable features enabled, e.g.: +# +# ./scripts/fmt +# +# Or: +# +# RUSTFMT="$(rustup which --toolchain nightly rustfmt)" cargo fmt -- --unstable-features # -# configured for cargo-fmt 1.84.0 - # array_width=60 # deprecated # attr_fn_like_width=70 # deprecated binop_separator="Front"