Update tmux configs

+ Add gitmux config
+ Use find to locate libclang in .bash_aliases
This commit is contained in:
Shaun Reed 2022-08-06 12:43:20 -04:00
parent c2e4e04a18
commit 40425d655d
6 changed files with 94 additions and 64 deletions

View File

@ -1,9 +1,11 @@
# For Rust stuff, uncomment this line
#. "$HOME/.cargo/env"
# Alias to restart plasmashell for Kubuntu Plasma session
# Clear kscreen cached settings
alias kapp-kscreen='rm -rf ~/.local/share/kscreen/*'
# Restart plasmashell
alias kapp-plasmashell='sudo pkill plasmashell && plasmashell --replace &> /dev/null &'
# Alias to clear swap
# Clear swap
alias kapp-swap='sudo swapoff -a && sudo swapon -a'
alias kapp-git='git config --global user.name "Shaun Reed" && git config --global user.email "shaunrd0@gmail.com"'
alias kapp-update='sudo apt update -y && sudo apt upgrade -y && sudo apt upgrade --fix-broken --fix-missing --auto-remove'
@ -24,11 +26,11 @@ alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo
export EDITOR="vim"
export VISUAL="vim"
export LS_COLORS="di=1;34:ln=31;47:so=32:pi=33:ex=1;32:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43"
export PATH=$PATH:/opt/:/home/kapper/.local/bin/
export PATH=$PATH:/opt/:$HOME/.local/bin/:$HOME/.dotnet:$HOME/go/bin/
export DOTNET_ROOT=$HOME/.dotnet
# Example path for autocompletion using libclang-9-dev package, obtained by the following command
# find /usr/ -name libclang.so.1 2>/dev/null
export LIBCLANG="/usr/lib/llvm-10/lib/libclang.so.1"
command -v clang &>/dev/null && export LIBCLANG="$(find /usr/ -name libclang.so.1 2>/dev/null)"
# Source a top-secret alias file
if [ -f ~/.bash_secrets ]; then

28
.gitmux.conf Normal file
View File

@ -0,0 +1,28 @@
tmux:
symbols:
branch: ""
hashprefix: ':'
ahead: ↑·
behind: ↓·
staged: '● '
conflict: '✖ '
modified: '✚ '
untracked: '… '
stashed: '⚑ '
clean: ✓
styles:
clear: '#[fg=default]'
state: '#[fg=red,bold]'
branch: '#[fg=white,bold]'
remote: '#[fg=cyan]'
staged: '#[fg=green,bold]'
conflict: '#[fg=red,bold]'
modified: '#[fg=red,bold]'
untracked: '#[fg=magenta,bold]'
stashed: '#[fg=cyan,bold]'
clean: '#[fg=green,bold]'
divergence: '#[fg=default]'
layout: ["#[bold]⎇ ", branch, ' ⥂ ', remote-branch, divergence, ' - ', flags]
options:
branch_max_len: 30
branch_trim: right

28
.gitmux.default Normal file
View File

@ -0,0 +1,28 @@
tmux:
symbols:
branch: '⎇ '
hashprefix: ':'
ahead: ↑·
behind: ↓·
staged: '● '
conflict: '✖ '
modified: '✚ '
untracked: '… '
stashed: '⚑ '
clean: ✔
styles:
clear: '#[fg=default]'
state: '#[fg=red,bold]'
branch: '#[fg=white,bold]'
remote: '#[fg=cyan]'
staged: '#[fg=green,bold]'
conflict: '#[fg=red,bold]'
modified: '#[fg=red,bold]'
untracked: '#[fg=magenta,bold]'
stashed: '#[fg=cyan,bold]'
clean: '#[fg=green,bold]'
divergence: '#[fg=default]'
layout: [branch, .., remote-branch, divergence, ' - ', flags]
options:
branch_max_len: 0
branch_trim: right

View File

@ -34,19 +34,16 @@ bind -T copy-mode TripleClick1Pane select-pane \; send -X select-line \; send
bind -T copy-mode-vi TripleClick1Pane select-pane \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i"
bind -n TripleClick1Pane select-pane \; copy-mode -M \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i"
bind -n MouseDown2Pane run "tmux set-buffer -b primary_selection \"$(xsel -o)\"; tmux paste-buffer -b primary_selection; tmux delete-buffer -b primary_selection"
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @yank_action 'copy-pipe-no-clear'
bind -T copy-mode C-c send -X copy-pipe-no-clear "xsel -i --clipboard"
bind -T copy-mode-vi C-c send -X copy-pipe-no-clear "xsel -i --clipboard"
set-option -s set-clipboard external
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -selection clipboard -i"
# remap shortcut prefix from 'C-b' to 'C-z'
unbind C-b
set-option -g prefix C-z
bind-key C-z send-prefix
# Remap shortcut prefix from 'C-b' to 'C-z'
#unbind C-b
#set-option -g prefix C-z
#bind-key C-z send-prefix
set-option -g prefix C-b
bind-key C-b send-prefix
# Reload tmux.conf in this session
bind r source-file ~/.tmux.conf
@ -60,21 +57,15 @@ bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
set-option -g status-position top
# Can't use theme plugin without risk of repo update overwriting data?
#source-file "${HOME}/.tmux-themepack/powerline/double/green.tmuxtheme"
set-option -g status-position top
# Status update interval
set -g status-interval 1
# Basic status bar colors
set -g status-style fg=colour240,bg=colour233
#set -g status-left "#[fg=colour233,bg=colour100,bold] #S #[fg=colour100,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour208]#[fg=colour240,bg=colour208] #{git_remote} #{git_flags} #[fg=colour208,bg=colour233,nobold]"
# Tmux Git
#let -g status-left "#[fg=colour233,bg=colour100,bold] #S #[fg=colour100,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour208]#[fg=colour240,bg=colour208] #{git_remote} #{git_flags} #[fg=colour208,bg=colour233,nobold]"
# Left side of status bar
set -g status-left-style bg=colour233,fg=colour243
set -g status-left-length 40
@ -84,78 +75,55 @@ set -g status-left "#[fg=colour233,bg=colour100,bold] #S #[fg=colour100,bg=colou
# Right side of status bar
set -g status-right-style bg=colour233,fg=colour243
set -g status-right-length 150
# Hide right bar entirely
#set -g status-right ""
set -g status-right-length 100
# Note: Powerline font requires alternate of bold on right side
# Corrects gap on right of character that reveals BG color
#+ Font: Powerline Consolas
#set -g status-right "#[fg=colour235,bg=colour233,bold]#[fg=colour240,bg=colour235,nobold] %H:%M:%S #[fg=colour240,bg=colour235,bold]#[fg=colour233,bg=colour240,nobold] %d-%b-%y #[fg=colour100,bg=colour240,bold]#[fg=colour233,bg=colour100,bold] #H "
set -g status-right "#[fg=colour235,bg=colour233,bold]#[fg=colour240,bg=colour235,nobold] %H:%M:%S #[fg=colour240,bg=colour235,bold]#[fg=colour233,bg=colour240,nobold] %d-%b-%y #[fg=colour100,bg=colour240,bold]#[fg=colour233,bg=colour100,bold] #(/home/kapper/go/bin/gitux #{pane_current_path}) "
set -g status-right "#[fg=colour235,bg=colour233,bold]#[fg=colour240,bg=colour235,nobold] %H:%M:%S #[fg=colour240,bg=colour235,bold]#[fg=colour233,bg=colour240,nobold] %d-%b-%y #[fg=colour100,bg=colour240,bold]#[fg=colour233,bg=colour100,bold] #(cd #{pane_current_path}; basename `git rev-parse --show-toplevel`) "
# Simple Git
#set -g status-right "#[fg=colour235,bg=colour233] #{simple_git_status} #[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour100,bg=colour240]#[fg=colour233,bg=colour100,bold] #H "
# Tmux Git
#set -g status-right "#[fg=colour208,bg=colour233]#[fg=colour235,bg=colour208] #{git_upstream} #{git_branch} #[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour100,bg=colour240]#[fg=colour233,bg=colour100,bold] #H "
# Window status
set -g window-status-format '#(/home/kapper/go/bin/gitmux #{pane_current_path})'
# set -g window-status-format " #I:#W#F (TMUX OTHER STATUS) #(pwd | sed -e "s|.*/\(.*/.*\)|\1|") "
set -g window-status-current-format '#(/home/$USER/go/bin/gitmux #{pane_current_path})'
# Set gitmux to appear in center of tmux status bar
run 'bash -c "if command -v $HOME/go/bin/gitmux &>/dev/null; then test -f $HOME/.gitmux.conf || $HOME/go/bin/gitmux -printcfg > $HOME/.gitmux.conf; fi"'
set -g window-status-current-format "#($HOME/go/bin/gitmux -cfg $HOME/.gitmux.conf \"#{pane_current_path}\")"
# Or if you don't want gitmux
#set -g window-status-current-format "#[fg=colour255,bg=colour233]#[fg=colour100,nobold] #(whoami)@#H #[fg=colour255,bg=colour233,nobold]"
# #{pane_current_path}
# Current window status
set -g window-status-current-style bg=colour233,fg=colour100
# Window with activity status
set -g window-status-activity-style bg=colour233,fg=colour245
# Window separator
set -g window-status-separator ""
# Window status alignment
set -g status-justify centre
# Pane border
set -g pane-border-style bg=default,fg=colour238
# Active pane border
set -g pane-active-border-style bg=default,fg=colour100
# Pane number indicator
set -g display-panes-colour colour233
set -g display-panes-active-colour colour245
# Clock mode
set -g clock-mode-colour colour100
set -g clock-mode-style 24
# Message
set -g message-style bg=colour100,fg=black
# Command message
set -g message-command-style bg=colour233,fg=black
# Tmux Git status bar settings
# (Un)comment source-file to enable / disable
# source-file "$HOME/.tmux-gitbar/tmux-gitbar.tmux"
set -g default-terminal "screen-256color"
# Mode
set -g mode-style bg=colour100,fg=colour235
# List of plugins and their settings
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'nhdaly/tmux-better-mouse-mode'
set -g @scroll-speed-num-lines-per-scroll 2
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @yank_action 'copy-pipe-no-clear'
bind -T copy-mode C-c send -X copy-pipe-no-clear "xsel -i --clipboard"
bind -T copy-mode-vi C-c send -X copy-pipe-no-clear "xsel -i --clipboard"
#set -g @plugin 'tmux-plugins/tmux-sensible'
#set -g @plugin 'kristijanhusak/tmux-simple-git-status'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'

15
.vimrc
View File

@ -18,7 +18,8 @@ set undofile
" Combine vim clipboard with global clipboard buffer
" Allows using y and p to copy into CTRL-C buffer, vice versa
" :help 'clipboard'
set clipboard+=unnamed
set clipboard=unnamed
set clipboard+=unnamedplus
" Allows true colors in vim (> 8 bit colors)
" :help termguicolors
@ -28,8 +29,9 @@ set clipboard+=unnamed
" :help autocmd
"" autocmd FileType yaml set tabstop=2 shiftwidth=2
" Highlight column 80 in c and cpp files
autocmd FileType cpp,c set colorcolumn=80
" Highlight characters past column N in source files based on file type
autocmd FileType cpp,c match ErrorMsg '\%>80v.\+'
autocmd FileType cs match ErrorMsg '\%>120v.\+'
" Define function in vim to remove whitespace
fun! TrimWhitespace()
@ -38,8 +40,9 @@ fun! TrimWhitespace()
call winrestview(l:save)
endfun
"Call this on every attempt to save a file of types defined below..
autocmd BufWritePre *.cpp,*.h,*.c,*.php :call TrimWhitespace()
autocmd BufWritePre *.cpp,*.h,*.c,*.php,*.cs,*.yml,*.txt,*.md :call TrimWhitespace()
""autocmd BufWritePre *.cpp,*.h,*.c,*.php :%s/\s\+$//ge
" Set terminal title when opening file
"" autocmd BufEnter * let &titlestring = ' ' . expand("%:t")
"" set title
@ -86,8 +89,8 @@ nnoremap <C-e> <C-w>
" Build and run keybinds
"" nnoremap <C-b> :!make -C build/
nnoremap <C-b> :!cmake -S . -B ./build/ && cmake --build ./build
nnoremap <C-d> :!./build/scrap
"nnoremap <C-b> :!cmake -S . -B ./build/ && cmake --build ./build
"nnoremap <C-d> :!./build/scrap
" Vim Plugin Settings

View File

@ -1,6 +1,6 @@
# Headless
Dotfiles configurations for headless Ubuntu 20.04 linux environments. Be sure to clone recursively if you want to grab updated plugins / submodules included. For example, using Pathogen with Vim to manage plugins requires that the plugin to be installed are cloned to the `~/.vim/bundle/` directory. Cloning recursively allows git to clone these same nested repositories/submodules within this directory so Pathogen can handle running the Vim plugins.
Dotfiles configurations for headless Ubuntu 22.04 linux environments. Be sure to clone recursively if you want to grab updated plugins / submodules included. For example, using Pathogen with Vim to manage plugins requires that the plugin to be installed are cloned to the `~/.vim/bundle/` directory. Cloning recursively allows git to clone these same nested repositories/submodules within this directory so Pathogen can handle running the Vim plugins.
Once installed, editing source code in vim supports features displayed in the screenshot below
@ -8,15 +8,16 @@ Once installed, editing source code in vim supports features displayed in the sc
### Install Dotfiles
Easiest installation is to clone repository into home directory -
Easiest installation is to clone repository into home directory -
```bash
sudo apt install vim xsel xclip tmux
git clone --recursive https://github.com/shaunrd0/dot ~/dot
cd ~/dot/
stow --adopt .
```
If you'd rather clone elsewhere -
If you'd rather clone elsewhere -
```bash
git clone --recursive https://github.com/shaunrd0/dot /path/to/dot