diff options
author | jakobst1n <jakob.stendahl@outlook.com> | 2021-01-17 15:55:40 +0100 |
---|---|---|
committer | jakobst1n <jakob.stendahl@outlook.com> | 2021-01-17 15:57:20 +0100 |
commit | d0f5528ec11c9957dd9b62688771eb62acb0c47f (patch) | |
tree | b32a203aa1bdadcbbde4e158beaae764ebe72215 | |
parent | 5c196fb44cd3d569fe5aafc267c8fd5a2abffeb3 (diff) | |
download | dotfiles-d0f5528ec11c9957dd9b62688771eb62acb0c47f.tar.gz dotfiles-d0f5528ec11c9957dd9b62688771eb62acb0c47f.zip |
Do things with zsh and tmux
m--------- | Common/vim/plugged/arm-syntax-vim | 0 | ||||
m--------- | Common/vim/plugged/ctrlp.vim | 0 | ||||
m--------- | Common/vim/plugged/nerdTree | 0 | ||||
m--------- | Common/vim/plugged/vim-airline | 0 | ||||
m--------- | Common/vim/plugged/vim-airline-themes | 0 | ||||
m--------- | Common/vim/plugged/vim-fugitive | 0 | ||||
l--------- | Common/vim/vim | 2 | ||||
-rw-r--r-- | Common/vimrc | 3 | ||||
-rw-r--r-- | Common/zshrc (renamed from mac/zshrc) | 42 | ||||
-rwxr-xr-x | install.sh | 8 | ||||
-rwxr-xr-x | install/install_debian.sh | 6 | ||||
-rwxr-xr-x | install/install_fedora.sh | 70 | ||||
-rwxr-xr-x | install/install_mac.sh | 22 | ||||
-rw-r--r-- | linux/tmux.conf | 57 | ||||
-rw-r--r-- | linux/zshrc | 56 | ||||
-rw-r--r-- | mac/tmux.conf | 14 |
16 files changed, 182 insertions, 98 deletions
diff --git a/Common/vim/plugged/arm-syntax-vim b/Common/vim/plugged/arm-syntax-vim new file mode 160000 +Subproject caf53551a063a6b7d56ce8bc873bb75c066c6b3 diff --git a/Common/vim/plugged/ctrlp.vim b/Common/vim/plugged/ctrlp.vim -Subproject 44c8e24956d7dcfee3ee6083a0573fed31d136e +Subproject 971c4d41880b72dbbf1620b3ad91418a6a6f6b9 diff --git a/Common/vim/plugged/nerdTree b/Common/vim/plugged/nerdTree -Subproject 82b1649f2e1c79ff17730fe0a3750bbec203dd2 +Subproject aaa946fb6bd79b9af86fbaf4b6b63fd81d839bd diff --git a/Common/vim/plugged/vim-airline b/Common/vim/plugged/vim-airline -Subproject ce932f3825f59258f814d4b66174283875348a9 +Subproject c7a633ce8f4547e680377efe8ea70493fcce134 diff --git a/Common/vim/plugged/vim-airline-themes b/Common/vim/plugged/vim-airline-themes -Subproject f4ba787e9c5455a6a88c6d04e61b18982637576 +Subproject 8f1aa2c7fa44bf33b1fd4678f9c7b40c126b0e2 diff --git a/Common/vim/plugged/vim-fugitive b/Common/vim/plugged/vim-fugitive -Subproject 67efbf66e0fcfd25e617d22892a7e9768bfd0f9 +Subproject bebe504e38d0a20c30d6dd666c4c793b3cc6610 diff --git a/Common/vim/vim b/Common/vim/vim index f81b69e..1353f12 120000 --- a/Common/vim/vim +++ b/Common/vim/vim @@ -1 +1 @@ -/Users/jakobstendahl/_code/Personal projects/dotfiles/Common/vim
\ No newline at end of file +/home/jakob/_code/dotfiles/Common/vim
\ No newline at end of file diff --git a/Common/vimrc b/Common/vimrc index 274370a..4769511 100644 --- a/Common/vimrc +++ b/Common/vimrc @@ -258,6 +258,9 @@ endtry " Return to last edit position when opening files (You want this!) au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif +" Make mouse work nice with tmux +set mouse=a + """""""""""""""""""""""""""""" " => Status line @@ -9,16 +9,21 @@ fi # export PATH=$HOME/bin:/usr/local/bin:$PATH # Check if env setup file exists -if [ ! -f /usr/local/etc/zsh_env_setup ]; then - echo "export ZSH=$HOME/.oh-my-zsh" > /usr/local/etc/zsh_env_setup - echo "DEFAULT_USER=$USER" >> /usr/local/etc/zsh_env_setup +if [ ! -f ~/.zsh_env_setup ]; then + echo "export ZSH=$HOME/.oh-my-zsh" > ~/.zsh_env_setup + echo "DEFAULT_USER=$USER" >> ~/.zsh_env_setup fi # Source env setup file -source /usr/local/etc/zsh_env_setup +source ~/.zsh_env_setup # Source powerlevel10k theme -source /usr/local/opt/powerlevel10k/powerlevel10k.zsh-theme +case "$OSTYPE" in + darwin*) + source /usr/local/opt/powerlevel10k/powerlevel10k.zsh-theme;; + linux*) + ZSH_THEME="powerlevel10k/powerlevel10k";; +esac COMPLETION_WAITING_DOTS="true" @@ -35,15 +40,8 @@ source $ZSH/oh-my-zsh.sh # Modify locale and path export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8 -path+=("/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/share/dotnet:/Library/Frameworks/Mono.framework/Versions/Current/Commands") -export PATH -export PATH=/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/share/dotnet:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/opt/local/bin:/opt/local/sbin -path+=("$(readlink /Users/$DEFAULT_USER/bin)") -export path -eval "$(pyenv init -)" # Add aliases -alias krak='/Applications/GitKraken.app/Contents/MacOS/GitKraken -p "$(PWD)" &>> /dev/null &' alias lsp="ps -ax | grep" alias lsa="ls -la" alias lsg="ls | grep" @@ -63,7 +61,21 @@ man() { [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh -#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! -export SDKMAN_DIR="/Users/jakobstendahl/.sdkman" -[[ -s "/Users/jakobstendahl/.sdkman/bin/sdkman-init.sh" ]] && source "/Users/jakobstendahl/.sdkman/bin/sdkman-init.sh" +case "$OSTYPE" in + darwin*) + path+=("$(readlink /Users/$DEFAULT_USER/bin)") + path+=("/Library/TeX/texbin") + path+=("/usr/local/share/dotnet") + export PATH + alias krak='/Applications/GitKraken.app/Contents/MacOS/GitKraken -p "$(PWD)" &>> /dev/null &' + + #THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! + export SDKMAN_DIR="/Users/jakobstendahl/.sdkman" + [[ -s "/Users/jakobstendahl/.sdkman/bin/sdkman-init.sh" ]] && source "/Users/jakobstendahl/.sdkman/bin/sdkman-init.sh" + ;; + linux*) + alias pbcopy='xsel --clipboard --input' + alias pbpaste='xsel --clipboard --output' + ;; +esac @@ -2,7 +2,7 @@ echo "Install the dependencies and symlink the dotfiles" tput setaf 4 -echo "Install on wich system? Enter either \"mac\", \"debian\", \"arch\":" +echo "Install on wich system? Enter either \"mac\", \"debian\", \"arch\", \"fedora\":" tput setaf 3 printf "> " read platform @@ -19,4 +19,8 @@ fi if [ $platform == "debian" ]; then ./install/install_debian.sh -fi
\ No newline at end of file +fi + +if [ $platform == "fedora" ]; then + ./install/install_fedora.sh +fi diff --git a/install/install_debian.sh b/install/install_debian.sh index dc1d3ec..a2b8c6a 100755 --- a/install/install_debian.sh +++ b/install/install_debian.sh @@ -33,12 +33,12 @@ dlgYN "> Install Oh-My-Zsh" res if [ $res -eq 1 ]; then tput sc sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" - + # Zsh-autosuggestions git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions # Zsh-syntax-highlighting git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting - + tput rc; tput ed fi @@ -63,7 +63,7 @@ if [ $res -eq 1 ]; then CWD=$(pwd) tput sc ln -isf "$CWD/bin" ~/bin - ln -isf "$CWD/linux/zshrc" ~/.zshrc + ln -isf "$CWD/Common/zshrc" ~/.zshrc ln -isf "$CWD/linux/tmux.conf" ~/.tmux.conf ln -isf "$CWD/Common/vimrc" ~/.vimrc ln -isf "$CWD/Common/vim" ~/.vim diff --git a/install/install_fedora.sh b/install/install_fedora.sh new file mode 100755 index 0000000..6b3a23a --- /dev/null +++ b/install/install_fedora.sh @@ -0,0 +1,70 @@ +#!/bin/bash + +function dlgYN() { + tput sc + tput setaf 4 + printf "$1 (y/n)? " + while : + do + read -n 1 -p "" YNQuestionAnswer + if [[ $YNQuestionAnswer == "y" ]]; then + tput rc; tput el + printf "$1?: \e[0;32mYes\e[0m\n" + tput sc + eval $2=1 # Set parameter 2 of input to the return value + break + elif [[ $YNQuestionAnswer == "n" ]]; then + tput rc; tput el + printf "$1?: \e[0;31mNo\e[0m\n" + eval $2=0 # Set parameter 2 of input to the return value + break + fi + done +} + +dlgYN "> Install \"Highlight, atool, w3m, mediainfo, vim, git\"" res +if [ $res -eq 1 ]; then + tput sc + sudo dnf -qy install highlight atool w3m mediainfo curl zsh vim git python3-pip zsh tmux + tput rc; tput ed +fi + +dlgYN "> Install Oh-My-Zsh" res +if [ $res -eq 1 ]; then + tput sc + sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" + + # Zsh-autosuggestions + git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions + # Zsh-syntax-highlighting + git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting + + tput rc; tput ed +fi + +dlgYN "> Install Powerline and Powerlevel10k" res +if [ $res -eq 1 ]; then + tput sc + pip3 install pygments + pip3 install powerline-status + git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k + tput rc; tput ed +fi + +dlgYN "> Create symlinks" res +if [ $res -eq 1 ]; then + CWD=$(pwd) + tput sc + ln -isf "$CWD/bin" ~/bin + ln -isf "$CWD/linux/tmux.conf" ~/.tmux.conf + ln -isf "$CWD/Common/zshrc" ~/.zshrc + ln -isf "$CWD/Common/vimrc" ~/.vimrc + ln -isf "$CWD/Common/vim" ~/.vim + ln -isf "$CWD/Common/p10k.zsh" ~/.p10k.zsh + tput rc; tput ed +fi + +tput setaf 3 +echo "\nPlease install the font Roboto mono nerd, and enable it in your terminal." +echo "\nPlease run ':PlugInstall' in vim" +tput sgr0 diff --git a/install/install_mac.sh b/install/install_mac.sh index 9ac4bc4..4097395 100755 --- a/install/install_mac.sh +++ b/install/install_mac.sh @@ -32,7 +32,7 @@ fi dlgYN "> Install \"Highlight, atool, w3m, mediainfo, vim\"" res if [ $res -eq 1 ]; then tput sc - brew install highlight atool w3m mediainfo vim + brew install highlight atool w3m mediainfo vim tput rc; tput ed fi @@ -40,33 +40,33 @@ dlgYN "> Install Oh-My-Zsh" res if [ $res -eq 1 ]; then tput sc sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" - - # Zsh-autosuggestions + + # Zsh-autosuggestions git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions - # Zsh-syntax-highlighting - git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting - + # Zsh-syntax-highlighting + git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting + tput rc; tput ed fi dlgYN "> Install Powerline && powerlevel10k" res if [ $res -eq 1 ]; then tput sc - pip3 install pygments + pip3 install pygments pip3 install powerline-status - brew install romkatv/powerlevel10k/powerlevel10k + brew install romkatv/powerlevel10k/powerlevel10k tput rc; tput ed fi dlgYN "> Create symlinks" res if [ $res -eq 1 ]; then CWD=$(PWD) - tput sc - ln -isf "$CWD/bin" ~/bin - ln -isf "$CWD/mac/zshrc" ~/.zshrc + tput sc + ln -isf "$CWD/bin" ~/bin ln -isf "$CWD/mac/tmux.conf" ~/.tmux.conf ln -isf "$CWD/mac/Hyperterm/hyper.js" ~/.hyper.js ln -isf "$CWD/mac/Hyperterm/local" ~/.hyper_plugins/local + ln -isf "$CWD/Common/zshrc" ~/.zshrc ln -isf "$CWD/Common/vimrc" ~/.vimrc ln -isf "$CWD/Common/vim" ~/.vim ln -isf "$CWD/Common/p10k.zsh" ~/.p10k.zsh diff --git a/linux/tmux.conf b/linux/tmux.conf index 5abfeb1..4977e70 100644 --- a/linux/tmux.conf +++ b/linux/tmux.conf @@ -1,19 +1,40 @@ +# -- general ------------------------------------------------------------------- +#set -g default-terminal "xterm-256color" set -g default-terminal "screen-256color" +set -as terminal-overrides ",*:U8=0" +set -s escape-time 10 # faster command sequences +set -s focus-events on + run-shell "powerline-daemon -q" -source "/Users/jakobstendahl/Library/Python/2.7/lib/python/site-packages/powerline/bindings/tmux/powerline.conf" +#source "/usr/local/lib/python3.7/site-packages/powerline/bindings/tmux/powerline.conf" +source "/home/jakob/.local/lib/python3.9/site-packages/powerline/bindings/tmux/powerline.conf" + +# -- display ------------------------------------------------------------------- set -g base-index 1 setw -g pane-base-index 1 +setw -g automatic-rename on # rename window to reflect current program +set -g renumber-windows on # renumber windows when a window is closed -set-option -g default-shell /opt/local/bin/zsh -set-option -g pane-border-fg colour235 -set-option -g pane-active-border-fg colour240 +set -g display-panes-time 800 # slightly longer pane indicators display time +set -g display-time 1000 # slightly longer status messages display time -set-option -g message-bg colour235 -set-option -g message-fg colour166 +set -g status-interval 10 # redraw status line every 10 seconds + +set-option -g default-shell /usr/bin/zsh set-option -g display-panes-active-colour colour33 set-option -g display-panes-colour colour166 +# activity +set -g monitor-activity on +set -g visual-activity off + +# -- navigation ---------------------------------------------------------------- + +# Set window notification +setw -g monitor-activity on +set -g visual-activity on + unbind C-b set -g prefix C-a @@ -22,7 +43,25 @@ bind -n M-Right select-pane -R bind -n M-Up select-pane -U bind -n M-Down select-pane -D -setw -g monitor-activity on -set -g visual-activity on +bind P paste-buffer +bind-key -Tcopy-mode-vi 'v' send -X begin-selection +bind-key -Tcopy-mode-vi 'y' send -X copy-selection +bind-key -Tcopy-mode-vi 'r' send -X rectangle-toggle +bind-key -Tcopy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -sel clip -i'` + +bind-key S-Left swap-window -t -1 +bind-key S-Right swap-window -t +1 + +# Bells +set -g visual-bell on +set -g bell-action any + +# Scroll in shell +set -g terminal-overrides 'xterm*:smcup@:rmcup@' +#set -wg xterm-keys 1 +set -g mouse on +#set-option -s set-clipboard off + + + -set-window-option -g window-status-current-bg yellow diff --git a/linux/zshrc b/linux/zshrc deleted file mode 100644 index d43b59d..0000000 --- a/linux/zshrc +++ /dev/null @@ -1,56 +0,0 @@ -# If you come from bash you might have to change your $PATH. -# export PATH=$HOME/bin:/usr/local/bin:$PATH - -# Check if env setup file exists -if [ ! -f /usr/local/etc/zsh_env_setup ]; then - echo "export ZSH=$HOME/.oh-my-zsh" > /usr/local/etc/zsh_env_setup - echo "DEFAULT_USER=$USER" >> /usr/local/etc/zsh_env_setup -fi - -# Source env setup file -source /usr/local/etc/zsh_env_setup - -# Source powerlevel10k theme -ZSH_THEME="powerlevel10k/powerlevel10k" - -COMPLETION_WAITING_DOTS="true" - -# Setup plugins -plugins=( - git - zsh-autosuggestions - zsh-syntax-highlighting -) - -# Setup oh-my-zsh -source $ZSH/oh-my-zsh.sh - -# Locales -export LC_ALL=en_US.UTF-8 -export LANG=en_US.UTF-8 - -# Path add bin -path+=("$(readlink /Users/$DEFAULT_USER/bin)") -export path - -# Add aliases -alias krak='/Applications/GitKraken.app/Contents/MacOS/GitKraken -p "$(PWD)" &>> /dev/null &' -alias lsp="ps -ax | grep" -alias lsa="ls -la" -alias lsg="ls | grep" -alias lsag="ls -la | grep" -alias ls="tput setaf 3 && echo \"'lsa' for 'ls -la', \n'lsg' for 'ls | grep',\n'lsag' for 'ls -la | grep',\n'lsp' for 'ps -ax |grep'\" && tput sgr0 && ls" - -# man pages in colors -man() { - LESS_TERMCAP_md=$'\e[01;31m' \ - LESS_TERMCAP_me=$'\e[0m' \ - LESS_TERMCAP_se=$'\e[0m' \ - LESS_TERMCAP_so=$'\e[01;44;33m' \ - LESS_TERMCAP_ue=$'\e[0m' \ - LESS_TERMCAP_us=$'\e[01;32m' \ - command man "$@" -} - -# Source powerlevel10k conf -[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
\ No newline at end of file diff --git a/mac/tmux.conf b/mac/tmux.conf index f0f272a..15ac4b7 100644 --- a/mac/tmux.conf +++ b/mac/tmux.conf @@ -42,6 +42,12 @@ bind -n M-Right select-pane -R bind -n M-Up select-pane -U bind -n M-Down select-pane -D +bind P paste-buffer +bind-key -Tcopy-mode-vi 'v' send -X begin-selection +bind-key -Tcopy-mode-vi 'y' send -X copy-selection +bind-key -Tcopy-mode-vi 'r' send -X rectangle-toggle +bind-key -Tcopy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -sel clip -i'` + bind-key S-Left swap-window -t -1 bind-key S-Right swap-window -t +1 @@ -51,4 +57,10 @@ set -g bell-action any # Scroll in shell set -g terminal-overrides 'xterm*:smcup@:rmcup@' -set -wg xterm-keys 1 +#set -wg xterm-keys 1 +set -g mouse on +#set-option -s set-clipboard off + + + + |