diff --git a/.editorconfig b/.editorconfig index 6b28fda..0c1e1d0 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,4 @@ -# see https://aka.ms/editorconfigdocs +# see https://editorconfig.org/ root = true [*] @@ -8,7 +8,11 @@ charset = utf-8 trim_trailing_whitespace = true indent_size = 4 tab_width = 4 - -[*.sh] end_of_line = lf + +[*.{cmd,ps1,csv,doskey}] +end_of_line = crlf + +[*.{sh,yml}] indent_size = 2 + diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..74f60bd --- /dev/null +++ b/.gitattributes @@ -0,0 +1,58 @@ +# https://www.git-scm.com/docs/gitattributes +# Set default behavior to automatically normalize line endings. +# also force this repo's crlf handling to not be magic: +# git config --local core.autocrlf input +# git add --renormalize . +# check with: +# git ls-files --eol +# to force changed line endings to be committed: +# git rm --cached -r . +# git reset --hard + +* text eol=lf + +# win scripts +*.cmd text eol=crlf +*.bat text eol=crlf +*.ps1 text eol=crlf +*.doskey text eol=crlf + + +# data files: +*.json text eol=lf +*.yaml text eol=lf +*.yml text eol=lf +*.csv text eol=crlf + +# linux/macOS scripts +*.sh text eol=lf + +# LFS config: +# tar/zipball config: +# https://docs.github.com/en/github/administering-a-repository/managing-git-lfs-objects-in-archives-of-your-repository +# Archives +*.7z filter=lfs diff=lfs merge=lfs -text +*.br filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.nupkg filter=lfs diff=lfs merge=lfs -text +*.tar filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text + +# Documents +*.pdf filter=lfs diff=lfs merge=lfs -text +*.docx filter=lfs diff=lfs merge=lfs -text + +# Images +*.gif filter=lfs diff=lfs merge=lfs -text +*.ico filter=lfs diff=lfs merge=lfs -text +*.jpg filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.psd filter=lfs diff=lfs merge=lfs -text +*.webp filter=lfs diff=lfs merge=lfs -text + +# Executables +*.exe filter=lfs diff=lfs merge=lfs -text +*.dll filter=lfs diff=lfs merge=lfs -text +*.dynlib filter=lfs diff=lfs merge=lfs -text +*.pdb filter=lfs diff=lfs merge=lfs -text +*.so filter=lfs diff=lfs merge=lfs -text diff --git a/bash/bash_aliases b/bash/bash_aliases.sh similarity index 100% rename from bash/bash_aliases rename to bash/bash_aliases.sh diff --git a/bootstrap.sh b/bootstrap.sh index d99b013..90f4b43 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -201,7 +201,7 @@ function setupShellEnv { # bat: https://github.com/sharkdp/bat#configuration-file copyFile bat_config $configDir/bat/config - copyFile bash/bash_aliases $HOME/.bash_aliases + copyFile bash/bash_aliases.sh $HOME/.bash_aliases copyFile bash/inputrc $HOME/.inputrc copyFile bash/tmux.conf $HOME/.tmux.conf diff --git a/win/aliases.doskey b/win/aliases.doskey index 359e64d..693aa42 100644 --- a/win/aliases.doskey +++ b/win/aliases.doskey @@ -1,26 +1,26 @@ -..=cd ..\$* -...=cd ..\.. && cd $* -....=cd ..\..\.. && cd $* -dir=dir /ogen $* -L=bat $* -xx=exit -la=lsd -a --group-directories-first --extensionsort $* -ll=lsd -l --group-directories-first --extensionsort $* -ls=lsd --group-directories-first --extensionsort $* -ld=tre -d $* -msb=msbuild /p:TreatWarningsAsErrors=true /nr:false /m /clp:verbosity=minimal /flp:Verbosity=normal;LogFile=msbuild.log /flp3:PerformanceSummary;Verbosity=diag;LogFile=msbuild.diagnostics.log $* -a=attrib $* -c=cd $* -cc=pushd $* --=popd -c=zoxide add $1 $T cd /d $1 -e=nvim $* -v=nvim $* -view=nvim -R $* -bb=pushd %USERPROFILE% -hex=od -A x -t xC -t c -w16 $* -ff=fd $* | fzf --height=40% --layout=reverse --info=inline --border --margin=1 --preview="bat --color=always {}" --bind "enter:execute(code {})" -fff=rg --color=always --line-number --no-heading --smart-case $* | fzf --ansi --delimiter : --height=75% --layout=reverse --color "hl:-1:underline,hl+:-1:underline:reverse" --border --margin=1 --preview="bat --color=always {1} --highlight-line {2}" --bind "enter:execute(code {1})" -nv=net view $* -nu=net use $* -home=pushd %USERPROFILE%\$* +..=cd ..\$* +...=cd ..\.. && cd $* +....=cd ..\..\.. && cd $* +dir=dir /ogen $* +L=bat $* +xx=exit +la=lsd -a --group-directories-first --extensionsort $* +ll=lsd -l --group-directories-first --extensionsort $* +ls=lsd --group-directories-first --extensionsort $* +ld=tre -d $* +msb=msbuild /p:TreatWarningsAsErrors=true /nr:false /m /clp:verbosity=minimal /flp:Verbosity=normal;LogFile=msbuild.log /flp3:PerformanceSummary;Verbosity=diag;LogFile=msbuild.diagnostics.log $* +a=attrib $* +c=cd $* +cc=pushd $* +-=popd +c=zoxide add $1 $T cd /d $1 +e=nvim $* +v=nvim $* +view=nvim -R $* +bb=pushd %USERPROFILE% +hex=od -A x -t xC -t c -w16 $* +ff=fd $* | fzf --height=40% --layout=reverse --info=inline --border --margin=1 --preview="bat --color=always {}" --bind "enter:execute(code {})" +fff=rg --color=always --line-number --no-heading --smart-case $* | fzf --ansi --delimiter : --height=75% --layout=reverse --color "hl:-1:underline,hl+:-1:underline:reverse" --border --margin=1 --preview="bat --color=always {1} --highlight-line {2}" --bind "enter:execute(code {1})" +nv=net view $* +nu=net use $* +home=pushd %USERPROFILE%\$* diff --git a/win/vsvimrc b/win/vsvimrc index a0435de..aeb7cff 100644 --- a/win/vsvimrc +++ b/win/vsvimrc @@ -1,32 +1,32 @@ -" VsVim RC david@davidjenni.com -" see: https://github.com/jaredpar/VsVim -" https://github.com/VsVim/VsVim/wiki/Settings-Reference - -set cursorline -set vsvimcaret=60 -set novisualbell - -" shift/tab etc. is set via .editorconfig -set vsvim_useeditordefaults - -set scrolloff=2 -set virtualedit=onemore -set nojoinspaces - -" searching -set ignorecase -set smartcase -set incsearch -set hlsearch -set wrapscan - -set history=1000 - -nmap :vsc Edit.GoToDefinition -nmap gcc :vsc Edit.CommentSelection -nmap gcu :vsc Edit.UncommentSelection -nnoremap :nohlsearch - -nmap :vsc Edit.GoToAll -cmap ls :vsc Window.Windows -cnoremap bd :vsc Window.CloseDocumentWindow +" VsVim RC david@davidjenni.com +" see: https://github.com/jaredpar/VsVim +" https://github.com/VsVim/VsVim/wiki/Settings-Reference + +set cursorline +set vsvimcaret=60 +set novisualbell + +" shift/tab etc. is set via .editorconfig +set vsvim_useeditordefaults + +set scrolloff=2 +set virtualedit=onemore +set nojoinspaces + +" searching +set ignorecase +set smartcase +set incsearch +set hlsearch +set wrapscan + +set history=1000 + +nmap :vsc Edit.GoToDefinition +nmap gcc :vsc Edit.CommentSelection +nmap gcu :vsc Edit.UncommentSelection +nnoremap :nohlsearch + +nmap :vsc Edit.GoToAll +cmap ls :vsc Window.Windows +cnoremap bd :vsc Window.CloseDocumentWindow diff --git a/win/win32-rc.cmd b/win/win32-rc.cmd index f94dfca..e4fbaef 100644 --- a/win/win32-rc.cmd +++ b/win/win32-rc.cmd @@ -1,57 +1,57 @@ -@if "%_echo%"=="" echo off -REM win32-rc.cmd: environment settings to be used with every Win32 command prompt -REM hooked into: "HKCU\Software\Microsoft\Command Processor" @AutoRun -REM autorun hook is set from bootstrap.cmd - -REM only run once -if defined MY_BIN goto :eof - -set _HERE=%~dp0 -set HERE=%_HERE:~0,-1% -set _HERE= - -set HOME=%USERPROFILE% -set MY_BIN=%HOME% - -call :addToPath "%ProgramFiles%\Git\usr\bin" - -:setEnv -set LESS=-i -M -N -q -x4 -R -set LESSBINFMT=*d[%02x] - -set EDITOR=code --wait -set VISUAL=code --wait - -set DIRCMD=/ogen - -call :loadDoskeyIfExists %HERE%\aliases.doskey -if /i "%PROCESSOR_ARCHITECTURE%"=="amd64" ( - call :loaddoskeyifexists %here%\aliases-x64.doskey -) else ( - call :loadDoskeyIfExists %HERE%\aliases-x86.doskey -) - -if exist %MY_BIN%\go ( - set GOPATH=%MY_BIN%\go - call :addToPath "%MY_BIN%\go\bin" -) - -REM set prompt to the following: -REM (20:51:41.60) [D:\] -REM > -prompt $C$T$F $M[$+$P]$_$G$S -:: color 1e -goto :eof - -:loadDoskeyIfExists - :: param1 path to doskey macro file - if exist "%1" call doskey.exe /macrofile="%1" - exit /b 0 - -:addToPath - :: param1 path to add if it exists - if exist "%~f1" PATH=%PATH%;%~f1 - exit /b 0 - -:eof -set HERE= +@if "%_echo%"=="" echo off +REM win32-rc.cmd: environment settings to be used with every Win32 command prompt +REM hooked into: "HKCU\Software\Microsoft\Command Processor" @AutoRun +REM autorun hook is set from bootstrap.cmd + +REM only run once +if defined MY_BIN goto :eof + +set _HERE=%~dp0 +set HERE=%_HERE:~0,-1% +set _HERE= + +set HOME=%USERPROFILE% +set MY_BIN=%HOME% + +call :addToPath "%ProgramFiles%\Git\usr\bin" + +:setEnv +set LESS=-i -M -N -q -x4 -R +set LESSBINFMT=*d[%02x] + +set EDITOR=code --wait +set VISUAL=code --wait + +set DIRCMD=/ogen + +call :loadDoskeyIfExists %HERE%\aliases.doskey +if /i "%PROCESSOR_ARCHITECTURE%"=="amd64" ( + call :loaddoskeyifexists %here%\aliases-x64.doskey +) else ( + call :loadDoskeyIfExists %HERE%\aliases-x86.doskey +) + +if exist %MY_BIN%\go ( + set GOPATH=%MY_BIN%\go + call :addToPath "%MY_BIN%\go\bin" +) + +REM set prompt to the following: +REM (20:51:41.60) [D:\] +REM > +prompt $C$T$F $M[$+$P]$_$G$S +:: color 1e +goto :eof + +:loadDoskeyIfExists + :: param1 path to doskey macro file + if exist "%1" call doskey.exe /macrofile="%1" + exit /b 0 + +:addToPath + :: param1 path to add if it exists + if exist "%~f1" PATH=%PATH%;%~f1 + exit /b 0 + +:eof +set HERE=