diff --git a/.gitmodules b/.gitmodules index e69de29..528856e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "vim/.vim/bundle/vundle"] + path = vim/.vim/bundle/vundle + url = https://github.com/VundleVim/Vundle.vim.git diff --git a/git/.gitconfig b/git/.gitconfig index 564332b..af9f279 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -20,7 +20,7 @@ [user] name = Thomas Ott - email = thomas.ott@greenchapter.de + email = 693276+greenchapter@users.noreply.github.com [filter "lfs"] clean = git-lfs clean -- %f diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..88f1a45 --- /dev/null +++ b/install.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +echo "cloning dotfiles." + +# git clone https://github.com/greenchapter/dotfiles.git $HOME/.dotfiles + +echo "init submodules." +# (cd $HOME/.dotfiles && git submodule update --init) + +for i in $(ls); do + echo "Link ${i} to $HOME/.$(basename ${i})."; + # ln -s ${i} "$HOME/.$(basename ${i})"; + done + +echo "Done." diff --git a/iterm/Supercharged.json b/iterm/Supercharged.json index fcca99f..e8bcda2 100644 --- a/iterm/Supercharged.json +++ b/iterm/Supercharged.json @@ -1,5 +1,11 @@ { - "Thin Strokes" : 0, + "Ansi 5 Color" : { + "Red Component" : 0.9637451171875, + "Color Space" : "sRGB", + "Blue Component" : 0.75890740260071698, + "Alpha Component" : 1, + "Green Component" : 0.48869594931602478 + }, "Working Directory" : "~", "Prompt Before Closing 2" : false, "Selected Text Color" : { @@ -9,7 +15,7 @@ "Alpha Component" : 1, "Green Component" : 1 }, - "Rows" : 28, + "Rows" : 25, "Ansi 11 Color" : { "Green Component" : 0.98039215686274506, "Red Component" : 0.94509803921568625, @@ -302,10 +308,6 @@ "Text" : "[1;5D", "Action" : 10 }, - "0xf701-0x280000" : { - "Text" : "0x1b 0x1b 0x5b 0x42", - "Action" : 11 - }, "0xf701-0x260000-0x0" : { "Text" : "[1;6B", "Action" : 10 @@ -334,10 +336,6 @@ "Text" : "[17;2~", "Action" : 10 }, - "0xf700-0x280000" : { - "Text" : "0x1b 0x1b 0x5b 0x41", - "Action" : 11 - }, "0x36-0x200000-0x0" : { "Text" : "6", "Action" : 12 @@ -611,11 +609,11 @@ }, "Transparency" : 0, "Background Color" : { - "Red Component" : 0.15686274509803921, + "Red Component" : 0.14901960784313725, "Color Space" : "sRGB", "Blue Component" : 0.21176470588235294, "Alpha Component" : 1, - "Green Component" : 0.16470588235294117 + "Green Component" : 0.16078431372549021 }, "Screen" : -1, "Initial Use Transparency" : false, @@ -625,16 +623,10 @@ "Red Component" : 1, "Blue Component" : 0.77647058823529413 }, - "Columns" : 150, + "Columns" : 122, "Use Tab Color" : false, "Visual Bell" : true, "Custom Directory" : "No", - "Ansi 5 Color" : { - "Red Component" : 0.9637451171875, - "Color Space" : "sRGB", - "Blue Component" : 0.75890740260071698, - "Alpha Component" : 1, - "Green Component" : 0.48869594931602478 - }, - "ASCII Ligatures" : false + "ASCII Ligatures" : false, + "Thin Strokes" : 0 } \ No newline at end of file diff --git a/scripts/.gitignore b/scripts/.gitignore new file mode 100644 index 0000000..55acb54 --- /dev/null +++ b/scripts/.gitignore @@ -0,0 +1 @@ +Brewfile.lock.json diff --git a/scripts/Brewfile b/scripts/Brewfile new file mode 100644 index 0000000..1576ddc --- /dev/null +++ b/scripts/Brewfile @@ -0,0 +1,57 @@ +tap "bazelbuild/tap" +tap "github/gh" +tap "heroku/brew" +tap "homebrew/bundle" +tap "homebrew/cask" +tap "homebrew/core" +brew "awscli" +brew "bat" +brew "bench" +brew "bitcoin" +brew "bmon" +brew "deno" +brew "duff" +brew "exa" +brew "fd" +brew "webp" +brew "ffmpeg" +brew "findutils" +brew "fish" +brew "fzf" +brew "git-lfs" +brew "htop" +brew "httpie" +brew "hub" +brew "hugo" +brew "imagemagick" +brew "imageoptim-cli" +brew "iperf" +brew "python" +brew "irssi" +brew "macvim" +brew "mariadb" +brew "midnight-commander" +brew "ncdu" +brew "nmap" +brew "node" +brew "nvm" +brew "p7zip" +brew "prettyping" +brew "progress" +brew "ranger" +brew "reattach-to-user-namespace" +brew "ripgrep" +brew "sassc" +brew "speedtest-cli" +brew "tmux" +brew "tor" +brew "wget" +brew "youtube-dl" +brew "zplug" +brew "zsh" +brew "zsh-completions" +brew "zstd" +brew "bazelbuild/tap/bazel" +brew "github/gh/gh" +brew "heroku/brew/heroku" +cask "basictex" diff --git a/scripts/setup.sh b/scripts/setup.sh index a0d94ac..cc98bb7 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -9,39 +9,188 @@ # git config --global --add difftool.prompt false # git config --global diff.tool opendiff -echo "๐Ÿš€ Start bootstrapping your new mac." -# get sudo rights for all the things -echo -n "Get sudo rights for all the things. Is this ok? (y/n) " -read yesno < /dev/tty -if [ "x$yesno" = "xy" ];then - sudo -v -else - echo "Sorry, these script only runs with root rights. ๐Ÿ™ˆ" - exit -fi +# +# +echo "\n\n Start bootstrapping your new mac...\n" +echo -n " _ _ __ _ _\n" +echo -n " __| |___| |_ / _(_) |___ ___\n" +echo -n " / _\` / _ \ _| _| | / -_|_-<\n" +echo -n " \__,_\___/\__|_| |_|_\___/__/\n" +# echo -n " \` /\n" +echo -n " โ–„โ–„โ–Œ โ– โ–„โ–Œโ–ช ยทโ–„โ–„โ–„โ–„โ€ข โ–„โ–„โ–„ยท โ–„โ–„โ–„ ยทโ–„โ–„โ–„โ–„\n" +echo -n " โ–ˆโ–ˆยท โ–ˆโ–Œโ–โ–ˆโ–ˆโ–ˆ โ–ชโ–€ยท.โ–ˆโ–Œโ–โ–ˆ โ–€โ–ˆ โ–€โ–„ โ–ˆยทโ–ˆโ–ˆโ–ช โ–ˆโ–ˆ\n" +echo -n " โ–ˆโ–ˆโ–ชโ–โ–ˆโ–โ–โ–Œโ–โ–ˆยทโ–„โ–ˆโ–€โ–€โ–€โ€ขโ–„โ–ˆโ–€โ–€โ–ˆ โ–โ–€โ–€โ–„ โ–โ–ˆยท โ–โ–ˆโ–Œ\n" +echo -n " โ–โ–ˆโ–Œโ–ˆโ–ˆโ–โ–ˆโ–Œโ–โ–ˆโ–Œโ–ˆโ–Œโ–ชโ–„โ–ˆโ–€โ–โ–ˆ โ–ชโ–โ–Œโ–โ–ˆโ€ขโ–ˆโ–Œโ–ˆโ–ˆ. โ–ˆโ–ˆ\n" +echo -n " โ–€โ–€โ–€โ–€ โ–€โ–ชโ–€โ–€โ–€ยทโ–€โ–€โ–€ โ€ข โ–€ โ–€ .โ–€ โ–€โ–€โ–€โ–€โ–€โ–€โ€ข\n\n\n" + + +# echo -n " .----.\n" +# echo -n " |\033[1m>_\033[0m |\n" +# echo -n " __|____|__\n" +# echo -n " | ______--|\n" +# echo -n " -/.::::.\-\n" +# echo -n " -------- \n\n" + +echo -n " This setup is as simple as described here:\n" +echo -n " \033[1mhttps://www.youtube.com/watch?v=SGzkUgTgpa4\033[0m\n\n\n" + + +main() { + + setup_shell + prerequisites + setup_homebrew + install_npm + setup_ohmyzsh + +} + +prerequisites(){ + + echo "\n โบ Checking prerequisites...\n" + + if test $(which brew); then + echo โœ“ $(brew --version) "\n" + + else + echo " ๐Ÿšซ brew is missing.\n" + install_homebrew + fi + + if test $(which curl); then + echo โœ“ $(curl --version) "\n" + fi + + if test $(which git); then + echo โœ“ $(git --version) "\n" + else + echo " ๐Ÿšซ git is missing.\n" + fi + + if test $(which zsh); then + echo โœ“ $(zsh --version) "\n" + fi + echo "\n โœด๏ธ All the needed prerequisites are there.\n" -echo -n "Do you want to install Homebrew? (y/n) " -read yesno < /dev/tty +} -if [ "x$yesno" = "xy" ];then - # Check for Homebrew, install if we don't have it - if test ! $(which brew); then - echo "Installing homebrew..." - ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +setup_shell() { + # get sudo rights for all the things + echo -ne '\033[1mGet sudo rights for all the things. Is this ok?\033[0m (yes/no) ' + read yesno < /dev/tty + + if [ "x$yesno" = "xy" ] || [ "x$yesno" = "xyes" ];then + sudo -v + else + echo "Sorry, these script only runs with root rights. ๐Ÿ™ˆ" + exit + fi +} + +install_homebrew() { + # Install Homebrew + echo -ne '\033[1mDo you want to install homebrew?\033[0m (yes/no) ' + read yesno < /dev/tty + + if [ "x$yesno" = "xy" ] || [ "x$yesno" = "xyes" ];then + echo "\n โบ Installing homebrew...\n" + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" + fi +} + +setup_homebrew() { + # Install or Update brew kegs + echo -ne '\033[1mDo you want to install the Supercharged homebrew packages?\033[0m (yes/no) ' + read yesno < /dev/tty + + if [ "x$yesno" = "xy" ] || [ "x$yesno" = "xyes" ];then + echo "\n โบ Updating homebrew packages...\n" + + brew bundle check + + echo "\n โบ Installing homebrew packages...\n" + + # https://github.com/Homebrew/homebrew-bundle + brew bundle --verbose --no-lock + + echo "\n โœด๏ธ All brew kegs are updated or installed.\n" else - echo "You already have installed homebrew." + echo "Sorry, Supercharged only works with installed brew kegs ๐Ÿ™ˆ" + exit fi -fi +} + +install_npm() { + # Install NPM Packages + echo -ne '\033[1mWould you like to install the Supercharged NPM packages?\033[0m (yes/no) ' + read yesno < /dev/tty + + if [ "x$yesno" = "xy" ] || [ "x$yesno" = "xyes" ];then + echo "\n โบ Installing the latest version of npm...\n" + npm install npm@latest -g + echo "\n โœด๏ธ Latest npm version installed.\n\n" + echo "\n โบ Installing the latest versions of the supercharged npm packages...\n" + npm install -g \ + @angular/cli@latest \ + @vue/cli@latest \ + @vue/cli-init@latest \ + contentful-cli@latest \ + ember-cli@latest \ + emma-cli@latest \ + emoj@latest \ + fast-cli@latest \ + favicon-emoji@latest \ + gatsby-cli@latest \ + gitmoji-cli@latest \ + graphql@latest \ + gulp@latest \ + gulp-cli@latest \ + netlify-cli@latest \ + nodemon@latest \ + npkill@latest \ + npm-check@latest \ + ntl@latest \ + parcel-bundler@latest \ + pm2@latest \ + pnpm@latest \ + prettier@latest \ + rollup@latest \ + sass@latest \ + semantic-release-cli@latest \ + standard-changelog@latest \ + strapi@latest \ + surge@latest \ + svelte@latest \ + vuepress@latest \ + webpack@latest \ + webpack-cli@latest \ + yarn@latest + + echo "\n โœด๏ธ You installed the latest version of the global needed node modules.\n" + + fi +} -# Update homebrew recipes -brew update +setup_ohmyzsh() { + # Install oh-my-zsh -# Install zsh Bash -brew install zsh zsh-completions + echo -ne "\033[1mWould you like to install oh-my-zsh?\033[0m (yes/no) " + read yesno < /dev/tty + + if [ "x$yesno" = "xy" ] || [ "x$yesno" = "xyes" ];then + + echo " โบ Installing oh-my-zsh...\n" + sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" + echo "\n โœด๏ธ Oh-my-zsh is installed.\n" + + else + echo "Sorry, these script only runs with root rights. ๐Ÿ™ˆ" + exit + fi +} -# Basic oh-my-zsh Installation -sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" +main "$@" diff --git a/sublime/Preferences.sublime-settings b/sublime/Preferences.sublime-settings index f91feaf..180a4c6 100644 --- a/sublime/Preferences.sublime-settings +++ b/sublime/Preferences.sublime-settings @@ -56,4 +56,5 @@ "trim_trailing_white_space_on_save": true, "wide_caret": true, "word_wrap": true, + "index_files": false, } diff --git a/vim/.vimrc b/vim/.vimrc index fb4d4ed..74ee6e7 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -1,20 +1,18 @@ set nocompatible set encoding=utf-8 nobomb filetype off - set ttimeout set ttimeoutlen=50 set timeoutlen=3000 - +let g:copilot_node_command = "/opt/homebrew/bin/node" set rtp+=/usr/local/opt/fzf set guioptions= set backspace=indent,eol,start " let g:clear_background=0 - " let s:bg = ['#282000', 236] call plug#begin() - +Plug 'sbdchd/neoformat' Plug 'dracula/vim' Plug 'othree/yajs.vim' Plug 'othree/html5.vim' @@ -28,6 +26,10 @@ Plug 'airblade/vim-gitgutter' Plug 'vim-syntastic/syntastic' Plug 'ctrlpvim/ctrlp.vim' Plug 'tpope/vim-fugitive' +Plug 'github/copilot.vim' +Plug 'othree/html5.vim' +Plug 'pangloss/vim-javascript' +Plug 'evanleck/vim-svelte', {'branch': 'main'} call plug#end() diff --git a/zsh/.zshrc b/zsh/.zshrc index 239f42f..12709de 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -24,6 +24,17 @@ CASE_SENSITIVE="true" # Uncomment following line if you want red dots to be displayed while waiting for completion COMPLETION_WAITING_DOTS="true" +# ZSH_THEME_VIRTUALENV_PREFIX='' +# ZSH_THEME_VIRTUALENV_SUFFIX='' +export VIRTUAL_ENV_DISABLE_PROMPT=1 + +function get_venv_name { + if [[ -n "$VIRTUAL_ENV" ]]; then + # Nimmt den Pfad aus $VIRTUAL_ENV und gibt nur den letzten Teil aus + echo "(${VIRTUAL_ENV:t}) " + fi +} + # Then, source plugins and add commands to $PATH export PATH=$HOME/bin:/usr/local/bin:$PATH export PATH="/opt/homebrew/bin:$PATH" @@ -32,8 +43,7 @@ export PATH="/opt/homebrew/sbin:$PATH" export MANPATH="/usr/local/man:$MANPATH" # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ -plugins=(history-substring-search git sublime vscode git-extras nvm extract last-working-dir npm docker encode64 zsh-autosuggestions zsh-fzf-history-search kubectl) - +plugins=(history-substring-search git sublime vscode git-extras nvm extract last-working-dir npm docker encode64 zsh-autosuggestions zsh-fzf-history-search kubectl virtualenv) # Workaround to keep the git prompt plugin working # https://github.com/ohmyzsh/ohmyzsh/issues/12328 @@ -65,7 +75,7 @@ export SSH_KEY_PATH="~/.ssh/rsa_id" # Add Visual Studio Code to the prompt export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin" -export PS1='%{$fg_bold[green]%}๐Ÿ•น๏ธ %{$reset_color%} $(nvm_prompt_version)%{$fg_bold[blue]%}%2~%{$reset_color%} $(my_git_prompt_info)%{$reset_color%}%Bยป%b ' +export PS1=' %{$fg_bold[green]%}$(get_venv_name)%{$reset_color%}$(nvm_prompt_version)%{$fg_bold[blue]%}%2~%{$reset_color%} $(my_git_prompt_info)%{$reset_color%}%Bยป%b ' fpath=(/usr/local/share/zsh-completions $fpath) diff --git a/zsh/custom/aliases.zsh b/zsh/custom/aliases.zsh index 574516b..1e950b1 100644 --- a/zsh/custom/aliases.zsh +++ b/zsh/custom/aliases.zsh @@ -39,3 +39,5 @@ alias gdk="git difftool" # Kubernetes export yaml='--dry-run=client -o yaml' # This way you can just run k run pod --image=nginx ${=yaml}. export now="--force --grace-period O" # This way you can run k delete pod ${=now}. +alias python='python3' +alias pip='pip3'