From ab0ba8ba528b5d81587507fd45dc3fd8d7d3cd78 Mon Sep 17 00:00:00 2001 From: Ivan Bushchik Date: Sun, 5 Feb 2023 12:53:53 +0300 Subject: [PATCH] Remove oh-my-zsh from all dotfiles, fix neovim plugins installation --- .gitignore | 3 ++- README.md | 2 +- configs/.profile | 1 + configs/.zshrc | 44 ++++++++++++++----------------------------- configs/nvim/init.vim | 27 -------------------------- tools/env.sh | 2 +- tools/git.sh | 1 + tools/install.sh | 16 +++++++--------- tools/link_env.sh | 2 +- tools/mac.sh | 2 +- tools/reinstall.sh | 2 +- tools/relink.sh | 2 +- tools/upgrade.sh | 2 +- 13 files changed, 32 insertions(+), 74 deletions(-) diff --git a/.gitignore b/.gitignore index fe1678a..e6b884a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ .DS_Store oh-my-zsh -configs/nvim/site/autoload \ No newline at end of file +configs/nvim/site/autoload +zsh \ No newline at end of file diff --git a/README.md b/README.md index f0fb25a..9647391 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Features: - swaywm (sway, waybar, qt5ct, mako) -- zshrc ([oh-my-zsh](https://ohmyz.sh) + [zsh-users/zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting)) +- zshrc ([zsh-users/zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting)) - [ivabus-zsh-theme](https://github.com/ivabus/ivabus-zsh-theme) - neovim config (no plugins) - alacritty config (Solarized Dark, 60x20, JetBrains Mono) diff --git a/configs/.profile b/configs/.profile index 46fc92f..5e637d2 100644 --- a/configs/.profile +++ b/configs/.profile @@ -6,3 +6,4 @@ export MOZ_ENABLE_WAYLAND=1 export MOZ_DBUS_REMOTE=1 export QT_QPA_PLATFORMTHEME=qt5ct export XDG_CURRENT_DESKTOP=Unity +. "$HOME/.cargo/env" diff --git a/configs/.zshrc b/configs/.zshrc index b197cca..0f76165 100644 --- a/configs/.zshrc +++ b/configs/.zshrc @@ -1,42 +1,26 @@ -export ZSH="$HOME/.dotfiles/oh-my-zsh" +export ZSH="$HOME/.dotfiles/zsh" +export HISTSIZE=10000 +export SAVEHIST=10000 +setopt HIST_IGNORE_ALL_DUPS +setopt HIST_FIND_NO_DUPS +REPORTTIME=3 -ZSH_THEME="ivabus" -ENABLE_CORRECTION="true" -plugins=(git zsh-syntax-highlighting) - -# Function to quickly show stats on systemload, usage of filesystems, usage of ram/swap and uptime -stats () { - AVLD=$(cut -d " " -f1-3 /proc/loadavg) - USEDMEM=$(free -h | grep Mem | awk '{print $3 " / " $2}') - USEDSWAP=$(free -h | grep Swap | awk '{ print $3 " / " $2}') - USEDSTRG=$(df / -h | tail -n 1 | awk '{print $3}') - USEDSTRGPERC=$(df / -h | tail -n 1 | awk '{print $5}') - STRG=$(df / -h | tail -n 1 | awk '{print $2}') - USEDSTRGHOME=$(df /home -h | tail -n 1 | awk '{print $3}') - USEDSTRGPERCHOME=$(df /home -h | tail -n 1 | awk '{print $5}') - STRGHOME=$(df /home -h | tail -n 1 | awk '{print $2}') - UPTIME=$(uptime -p) - printf "\e[0;34msystem load:\e[m\t${AVLD}\n" - printf "\e[0;34musage of /:\e[m\t${USEDSTRGPERC}% (${USEDSTRG}/${STRG})\n" - printf "\e[0;34musage of /home:\e[m\t${USEDSTRGPERCHOME}% (${USEDSTRGHOME}/${STRGHOME})\n" - printf "\e[0;34mmemory usage:\e[m\t${USEDMEM}\n" - printf "\e[0;34mswap usage:\e[m\t${USEDSWAP}\n" - printf "\e[0;34muptime:\e[m\t\t${UPTIME}\n" -} - -source $ZSH/oh-my-zsh.sh source $HOME/.profile -export REPORTTIME=10 +source $ZSH/themes/ivabus.zsh-theme +source $ZSH/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh alias vi="nvim" alias vim="nvim" +alias ls="ls --color=always" +alias la="ls -la" alias upgrade_dotfiles="sh $HOME/.dotfiles/tools/upgrade.sh" alias timestamp='date -u +%FT%TZ' alias yt-dlp-opus="yt-dlp -f 251 -x" +alias ffmpeg_hard="ffmpeg -hwaccel videotoolbox -c:v h264_videotoolbox" # AsahiLinux useful aliases alias reload_net="sudo systemctl restart NetworkManager wpa_supplicant" # iwd" - - -add-zsh-hook -Uz chpwd(){ source <(tea -Eds) } #tea +# Diskutil aliases +alias dadc="diskutil apfs deleteContainer" +alias devff="diskutil eraseVolume free free" diff --git a/configs/nvim/init.vim b/configs/nvim/init.vim index 21f16be..3762d50 100644 --- a/configs/nvim/init.vim +++ b/configs/nvim/init.vim @@ -15,30 +15,3 @@ set backupdir=~/.cache/vim set completeopt=noinsert,menuone,noselect set cursorline set relativenumber - -call plug#begin() -Plug 'catppuccin/nvim', { 'as': 'catppuccin' } -Plug 'neovim/nvim-lspconfig' -Plug 'simrat39/rust-tools.nvim' -Plug 'nvim-lua/plenary.nvim' -Plug 'saecki/crates.nvim', { 'tag': 'v0.3.0' } -Plug 'neovim/nvim-lspconfig' -Plug 'hrsh7th/cmp-nvim-lsp' -Plug 'hrsh7th/cmp-buffer' -Plug 'hrsh7th/cmp-path' -Plug 'hrsh7th/cmp-cmdline' -Plug 'hrsh7th/nvim-cmp' -Plug 'saadparwaiz1/cmp_luasnip' -Plug 'L3MON4D3/LuaSnip' -Plug 'ahmedkhalf/project.nvim' -Plug 'lewis6991/gitsigns.nvim' -Plug 'nvim-neo-tree/neo-tree.nvim' -Plug 'nvim-lua/plenary.nvim' -Plug 'MunifTanjim/nui.nvim' -Plug 'nvim-tree/nvim-web-devicons' -call plug#end() -colorscheme catppuccin-macchiato -lua require('crates').setup() -lua require('gitsigns').setup() - -set completeopt=menu,menuone,noselect diff --git a/tools/env.sh b/tools/env.sh index ab3bce6..f772026 100755 --- a/tools/env.sh +++ b/tools/env.sh @@ -1,5 +1,5 @@ #!/bin/sh - +set -e NC='\033[0m' Green='\033[1;32m' ARROW="${Green}=>${NC}" diff --git a/tools/git.sh b/tools/git.sh index 4f0ba62..756b1c3 100755 --- a/tools/git.sh +++ b/tools/git.sh @@ -1,4 +1,5 @@ #!/bin/sh +set -e echo "Setting up git" read -p "Enter your name for commits: " GITNAME diff --git a/tools/install.sh b/tools/install.sh index e66ef38..a5e733b 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -1,5 +1,5 @@ #!/bin/sh - +set -e CURRENTDIR="$(pwd)" echo "Welcome to ivabus .dotfiles installer" @@ -15,16 +15,14 @@ then echo "Aborting." exit 255 fi - -# install oh-my-zsh and plugins -echo "Installing oh-my-zsh and plugins" -ZSH="$HOME/.dotfiles/oh-my-zsh" sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended > /dev/null 2>&1 -curl -fsSL https://raw.githubusercontent.com/ivabus/ivabus-zsh-theme/master/ivabus.zsh-theme -o $HOME/.dotfiles/oh-my-zsh/custom/themes/ivabus.zsh-theme > /dev/null 2>&1 -git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $HOME/.dotfiles/oh-my-zsh/custom/plugins/zsh-syntax-highlighting > /dev/null 2>&1 +mkdir -p $HOME/.dotfiles/zsh/{plugins,themes} +ZSH="$HOME/.dotfiles/zsh" +echo "Installing zsh theme and plugins" +curl -fsSL https://raw.githubusercontent.com/ivabus/ivabus-zsh-theme/master/ivabus.zsh-theme -o $HOME/.dotfiles/zsh/themes/ivabus.zsh-theme > /dev/null 2>&1 +git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $HOME/.dotfiles/zsh/plugins/zsh-syntax-highlighting > /dev/null 2>&1 # installing vimplug -curl -fLo "$HOME/.config/nvim/site/autoload/plug.vim" --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - +curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim # installing jetbrains mono if [[ $(uname) = "Linux" ]] then diff --git a/tools/link_env.sh b/tools/link_env.sh index b1765c1..a2dd6ec 100644 --- a/tools/link_env.sh +++ b/tools/link_env.sh @@ -1,5 +1,5 @@ #!/bin/sh - +set -e echo "=> Linking zshrc" if [ -f ~/.zshrc ]; then echo "=> Moving old zshrc to ~/.zshrc.old" diff --git a/tools/mac.sh b/tools/mac.sh index fb9aa68..e545eec 100755 --- a/tools/mac.sh +++ b/tools/mac.sh @@ -1,5 +1,5 @@ #!/bin/bash - +set -e # configuring mac-only things # installing homebrew diff --git a/tools/reinstall.sh b/tools/reinstall.sh index e518e4e..382675c 100755 --- a/tools/reinstall.sh +++ b/tools/reinstall.sh @@ -1,5 +1,5 @@ #!/bin/sh - +set -e echo "Reinstalling dotfiles" echo "To proceed press enter" read A diff --git a/tools/relink.sh b/tools/relink.sh index c833e01..0e4f08f 100755 --- a/tools/relink.sh +++ b/tools/relink.sh @@ -1,5 +1,5 @@ #!/bin/sh - +set -e # script that (re)links all dotfiles during the installation or upgrade. # do not run manually diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 0fcf076..2dd9db8 100755 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -1,5 +1,5 @@ #!/bin/sh - +set -e # Dotfiles upgrade script that just pulls new dotfiles from repo # oh-my-zsh update included!