Skip to content

Commit

Permalink
Cleanup lineendings (#31)
Browse files Browse the repository at this point in the history
* normalize most files' line endings to LF
  • Loading branch information
davidjenni authored Jan 23, 2024
1 parent 9222501 commit 49bcbd6
Show file tree
Hide file tree
Showing 7 changed files with 181 additions and 119 deletions.
10 changes: 7 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# see https://aka.ms/editorconfigdocs
# see https://editorconfig.org/
root = true

[*]
Expand All @@ -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

58 changes: 58 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.
2 changes: 1 addition & 1 deletion bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
52 changes: 26 additions & 26 deletions win/aliases.doskey
Original file line number Diff line number Diff line change
@@ -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%\$*
64 changes: 32 additions & 32 deletions win/vsvimrc
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
" VsVim RC [email protected]
" 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 <C-]> :vsc Edit.GoToDefinition<CR>
nmap gcc :vsc Edit.CommentSelection<CR>
nmap gcu :vsc Edit.UncommentSelection<CR>
nnoremap <C-L> :nohlsearch<cr><esc>
nmap <C-P> :vsc Edit.GoToAll<CR>
cmap ls :vsc Window.Windows
cnoremap bd :vsc Window.CloseDocumentWindow
" VsVim RC [email protected]
" 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 <C-]> :vsc Edit.GoToDefinition<CR>
nmap gcc :vsc Edit.CommentSelection<CR>
nmap gcu :vsc Edit.UncommentSelection<CR>
nnoremap <C-L> :nohlsearch<cr><esc>

nmap <C-P> :vsc Edit.GoToAll<CR>
cmap ls :vsc Window.Windows
cnoremap bd :vsc Window.CloseDocumentWindow
114 changes: 57 additions & 57 deletions win/win32-rc.cmd
Original file line number Diff line number Diff line change
@@ -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=

0 comments on commit 49bcbd6

Please sign in to comment.