diff --git a/.vimrc b/.vimrc index ce1abfc..4d071d0 100644 --- a/.vimrc +++ b/.vimrc @@ -108,8 +108,15 @@ endif " solarized config set termguicolors set background=dark " or light -colorscheme solarized -" colorscheme darcula + +" colorscheme solarized +colorscheme darcula + +" Check if the color scheme file is available before applying it +if exists("g:plugs['darcula']") && filereadable(expand("~/.vim/plugged/darcula/colors/darcula.vim")) + colorscheme darcula +endif + hi Visual term=reverse cterm=reverse guibg=Grey " open unfolded diff --git a/.zshenv b/.zshenv index 51932c1..0c40480 100644 --- a/.zshenv +++ b/.zshenv @@ -6,7 +6,7 @@ export PATH=/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/u alias oe='open /Applications/Emacs.app' -alias config='/usr/bin/git --git-dir=$HOME/.cfg/.git/ --work-tree=$HOME' +alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME' alias -g N="2>&1 " alias pig='ping' # export PATH=$HOME/.rd/bin diff --git a/.zshrc b/.zshrc index 7ed9646..04edce2 100644 --- a/.zshrc +++ b/.zshrc @@ -113,7 +113,7 @@ COMPLETION_WAITING_DOTS="true" # Custom plugins may be added to $ZSH_CUSTOM/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. -plugins=(git rsync colorize colored-man-pages vi-mode common-aliases macos themes dircycle iterm2 docker docker-compose zsh-navigation-tools urltools history mercurial tmux zsh-syntax-highlighting zsh-autosuggestions kubectl helm terraform asdf brew web-search) +plugins=(git rsync colorize colored-man-pages vi-mode common-aliases macos themes dircycle iterm2 docker docker-compose zsh-navigation-tools urltools history mercurial tmux zsh-syntax-highlighting zsh-autosuggestions kubectl helm terraform asdf brew web-search kubectl helm) # consider plugin fzf - only available for Mac/Linux diff --git a/README.org b/README.org index 6c5e214..45eed41 100644 --- a/README.org +++ b/README.org @@ -1,6 +1,12 @@ * How to set up this configuration -** basic setup +** Automated setup + +#+begin_src sh + bash -c "$(curl -fsSL https://git.meinlschmidt.org/jetpac/dotfiles/raw/branch/main/bootstrap.sh)" +#+end_src + +** manual setup #+begin_src sh # for linux; ignore on other systems @@ -14,14 +20,17 @@ alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME' config config --local status.showUntrackedFiles no config checkout - zsh source ~/.proxies - sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" + sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh) --unattended --skip-chsh --keep-zshrc" git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + vim +PlugInstall +qall + + zsh + # run tmux, prefix + I installs all plugins (needs to have proxies set) # run vim, :PlugInstall diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100755 index 0000000..9606cfe --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,81 @@ +#!/usr/bin/env bash + +set -x + +check_installed() { + _pkgs=("$@") + all_installed=true + for pkg in "${_pkgs[@]}"; do + if ! command -v "$pkg" > /dev/null 2>&1; then + all_installed=false + break + fi + done + $all_installed && return 0 || return 1 +} + +install_packages() { + # List of packages to install + packages=(zsh git) + + if ! check_installed "${packages[@]}"; then + # Determine which package manager is available + if check_installed apt; then + echo "Using apt to install packages..." + sudo apt update + sudo apt install -y "${packages[@]}" + elif check_installed dnf; then + echo "Using dnf to install packages..." + sudo dnf install -y "${packages[@]}" + elif check_installed yum; then + echo "Using yum to install packages..." + sudo yum install -y "${packages[@]}" + elif check_installed brew; then + echo "Using Homebrew to install packages..." + brew install "${packages[@]}" + else + echo "No supported package manager found (apt, dnf, yum, brew)." + return 1 + fi + fi +} + +clone_repos () { + git clone --bare https://git.meinlschmidt.org/jetpac/dotfiles.git ~/.cfg + # alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME' + git --git-dir=$HOME/.cfg config --local status.showUntrackedFiles no + git --git-dir=$HOME/.cfg --work-tree=$HOME checkout + + + # install oh-my-zsh + curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh > /tmp/install_ohmyzsh.sh + bash /tmp/install_ohmyzsh.sh --unattended --skip-chsh --keep-zshrc + + # powerlevel10k + git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k + + # tmux tpm plugin manager + git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm + + # plug for installing vim plugins + curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim +} + +configure_vim() { + vim +PlugInstall +qall +} + +configure_tmux() { + echo "run tmux, prefix + I installs all plugins (needs to have proxies set)" +} + + +# Call the function to execute the installation +install_packages +clone_repos +configure_vim +configure_tmux + + + +# vim: foldmethod=marker:foldmarker={,}:expandtab:sw=4:ts=4: