From 368d5b2bd16dec8d3b4d96e38497708d1507f5be Mon Sep 17 00:00:00 2001 From: OCram85 Date: Wed, 15 Jun 2022 13:08:18 +0200 Subject: [PATCH] adds inital content --- .editconfig | 9 +++ .gitignore | 0 .vscode/cSpell.json | 22 ++++++ .vscode/dictionaries/default.txt | 0 .vscode/settings.json | 34 ++++++++ README.md | 2 +- git/.gitconfig | 39 ++++++++++ powershell/Microsoft.PowerShell_profile.ps1 | 32 ++++++++ powershell/README.md | 13 ++++ ssh/README.md | 3 + ssh/config | 3 + startship/README.md | 9 +++ startship/starship.toml | 86 +++++++++++++++++++++ 13 files changed, 251 insertions(+), 1 deletion(-) create mode 100644 .editconfig create mode 100644 .gitignore create mode 100644 .vscode/cSpell.json create mode 100644 .vscode/dictionaries/default.txt create mode 100644 .vscode/settings.json create mode 100644 git/.gitconfig create mode 100644 powershell/Microsoft.PowerShell_profile.ps1 create mode 100644 powershell/README.md create mode 100644 ssh/README.md create mode 100644 ssh/config create mode 100644 startship/README.md create mode 100644 startship/starship.toml diff --git a/.editconfig b/.editconfig new file mode 100644 index 0000000..3dce414 --- /dev/null +++ b/.editconfig @@ -0,0 +1,9 @@ +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/.vscode/cSpell.json b/.vscode/cSpell.json new file mode 100644 index 0000000..b4e5b04 --- /dev/null +++ b/.vscode/cSpell.json @@ -0,0 +1,22 @@ +// cSpell Settings +{ + // Version of the setting file. Always 0.1 + "version": "0.2", + // language - current active spelling language + "language": "en,de,de-DE", + // words - list of words to be always considered correct + "words": [], + // flagWords - list of words to be always considered incorrect + // This is useful for offensive words and common spelling errors. + // For example "hte" should be "the" + "flagWords": [], + "dictionaryDefinitions": [ + { + "name": "default", + "path": "./dictionaries/default.txt" + } + ], + "dictionaries": [ + "default" + ] +} diff --git a/.vscode/dictionaries/default.txt b/.vscode/dictionaries/default.txt new file mode 100644 index 0000000..e69de29 diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..febdf3d --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,34 @@ +{ + "files.encoding": "utf8", + "files.eol": "auto", + "files.trimTrailingWhitespace": true, + "files.insertFinalNewline": true, + "editor.renderWhitespace": "boundary", + "editor.formatOnSave": true, + "editor.formatOnType": true, + "editor.rulers": [ + 116 + ], + "cSpell.enabled": true, + "cSpell.enabledLanguageIds": [ + "c", + "cpp", + "csharp", + "go", + "javascript", + "javascriptreact", + "json", + "latex", + "markdown", + "php", + "plaintext", + "powershell", + "python", + "text", + "typescript", + "typescriptreact", + "yaml", + "yml" + ], + "cSpell.language": "en,de,de-DE" +} diff --git a/README.md b/README.md index 0cff500..afe06b6 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ # dotfiles -my personal dotfile collection +my personal dotfiles collection diff --git a/git/.gitconfig b/git/.gitconfig new file mode 100644 index 0000000..df63348 --- /dev/null +++ b/git/.gitconfig @@ -0,0 +1,39 @@ +[user] + name = OCram85 + email = marco.blessing@googlemail.com +[core] + # editor = \"C:/Program Files/Notepad++/notepad++.exe\" -multiInst -nosession + # editor = nano + editor = 'C:\\Program Files\\Microsoft VS Code\\Code.exe' --wait --new-window + autocrlf = False + +[i18n] + filesEncoding = utf-8 + +[push] + default = simple + +[alias] + # simplified logging views + lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all + lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all + + # fetch all remote changes + cfetch = fetch --prune --tags + + ## Phabricator inspired workflow + + # Create new feature branch + feature = "!f(){ b=$1; git checkout master; git pull; git checkout -b "$b" master; };f" + + # adds a new wip commit + wip = !"git add -A; git commit -m '[WIP]'" + + # used to squish changes in the latest commit. Should be used after a wip commit + squish = !"git add -A; git commit --no-edit --amend" + + # Push to origin / dev branch + pod = !"git push origin dev" + + # Push to custom remote branch + poc = "!f(){ b=$1; git push origin "$b";};f" diff --git a/powershell/Microsoft.PowerShell_profile.ps1 b/powershell/Microsoft.PowerShell_profile.ps1 new file mode 100644 index 0000000..7ba3fe6 --- /dev/null +++ b/powershell/Microsoft.PowerShell_profile.ps1 @@ -0,0 +1,32 @@ +# load chocoal +$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" +if (Test-Path($ChocolateyProfile)) { + Import-Module "$ChocolateyProfile" +} + +# Use these profile items not in vscode +if ($env:TERM_PROGRAM -ne 'vscode') { + Import-Module -Name MyHelper -WarningAction SilentlyContinue + # ... + # ... +} + +# redirect git stderr output. This is needed use git commands in powershell. +# Some commands do there outut into stderr instead of stdout. / git clone. +$env:GIT_REDIRECT_STDERR = '2>&1' + +# Config Electron npm package to use the proxy +$Env:ELECTRON_GET_USE_PROXY = $true +# proxy settings for http/https agent +$Env:GLOBAL_AGENT_HTTPS_PROXY = 'https://a.b.c.d:3128/' + +Import-Module -Name 'PSReadline' + +# import git auto completion +Import-Module -Name 'posh-git' + +# import starship prompt +Invoke-Expression (&starship init powershell) + +# import auto completion for tea (gitea client) +& C:\Users\wkiv924\AppData\Local\tea\tea.ps1 diff --git a/powershell/README.md b/powershell/README.md new file mode 100644 index 0000000..53dc4f8 --- /dev/null +++ b/powershell/README.md @@ -0,0 +1,13 @@ +# PowerShell Profile + +This is my Powershell user profile for Pwsh 5.1+. + +I try to keep this as small as possible and use it to load my must have tools. + +- [Chocolatey]() init +- run additional helpers on each terminal session except the vscode terminal +- fix some git issues +- set proxy config for node/ electron installer +- Load needed modules like PSReadline and posh-git +- Load starship prompt + diff --git a/ssh/README.md b/ssh/README.md new file mode 100644 index 0000000..e50b024 --- /dev/null +++ b/ssh/README.md @@ -0,0 +1,3 @@ +# .ssh + +Client config to keep the current sessions active. Avoids ending sessions on inactivity. \ No newline at end of file diff --git a/ssh/config b/ssh/config new file mode 100644 index 0000000..d2892f6 --- /dev/null +++ b/ssh/config @@ -0,0 +1,3 @@ +HOST * + ServerAliveInterval 60 + ServerAliveCountMax 2 \ No newline at end of file diff --git a/startship/README.md b/startship/README.md new file mode 100644 index 0000000..1b5df08 --- /dev/null +++ b/startship/README.md @@ -0,0 +1,9 @@ +# Starship Prompt config + +This is my personal config for the [starship](https://starship.rs/) prompt. +It requires the FiraCode Font from [NerdFonts](https://www.nerdfonts.com/) + +I'm using this config in: + +- PowerShell with the [Windows-Terminal](https://github.com/microsoft/terminal) +- any Bash shell diff --git a/startship/starship.toml b/startship/starship.toml new file mode 100644 index 0000000..420e4b3 --- /dev/null +++ b/startship/starship.toml @@ -0,0 +1,86 @@ +[aws] +symbol = " " + +[buf] +symbol = " " + +[conda] +symbol = " " + +[dart] +symbol = " " + +[directory] +read_only = " " + +[docker_context] +symbol = " " + +[elixir] +symbol = " " + +[elm] +symbol = " " + +# [git_branch] +# symbol = " " + +[golang] +symbol = " " + +[haskell] +symbol = " " + +[hg_branch] +symbol = " " + +[java] +symbol = " " + +[julia] +symbol = " " + +[memory_usage] +symbol = " " + +[nim] +symbol = " " + +[nix_shell] +symbol = " " + +[nodejs] +symbol = " " + +[package] +symbol = " " + +[rust] +symbol = " " + +# Custom Prompt +[git_branch] +format = " [$symbol$branch]($style) " +symbol = "🍣 " +style = "bold yellow" + +[git_commit] +commit_hash_length = 8 +style = "bold white" + +[git_state] +format = '[\($state( $progress_current of $progress_total)\)]($style) ' + +[git_status] +conflicted = "⚔️ " +ahead = "🏎️💨 ×${count}" +behind = "🐢 ×${count}" +diverged = "🔱 🏎️ 💨 ×${ahead_count} 🐢 ×${behind_count}" +untracked = "🛤️ ×${count}|" +stashed = "📦 " +modified = "📝 ×${count}|" +staged = "🗃️ ×${count}|" +renamed = "📛 ×${count}|" +deleted = "🗑️ ×${count}|" +style = "bright-white" +format = "$all_status$ahead_behind"