diff --git a/.bash_aliases b/.bash_aliases index c94a378..f99bbc7 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -1,7 +1,10 @@ -# For Rust stuff, uncomment this line -#. "$HOME/.cargo/env" +# Source rust things if they exist +if [ -f ~/.cargo/env ]; then + . ~/.cargo/env +fi alias ,git='git config --global user.name "Shaun Reed" && git config --global user.email "shaunrd0@gmail.com"' +# Some aliases don't make sense in the docker image, like shortcuts to fix plasmashell. if [ -f /.dockerenv ]; then export DOT_PACKAGES='git stow vim tmux ranger clang wget curl' alias ,update='apt update -y && apt upgrade -y && apt upgrade --fix-broken --fix-missing --auto-remove' @@ -19,8 +22,6 @@ else alias ,vbox="ps aux www |grep 'VBoxClient --draganddrop' | awk '{print $2}' | xargs kill" fi -# Alias / export customizations - # colored GCC warnings and errors #export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' diff --git a/.gitignore b/.gitignore index 304b2cf..b666a81 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ +.bashrc .bash_secrets +.vim/.netrwhist .idea/ .config/Code/Backups/* .config/Code/*Cache*/* diff --git a/.stow-local-ignore b/.stow-local-ignore new file mode 100644 index 0000000..94748c0 --- /dev/null +++ b/.stow-local-ignore @@ -0,0 +1,4 @@ +README.md +setup.sh +Dockerfile +VimScreenshot.png diff --git a/.tmux.conf b/.tmux.conf index 7c978fa..b59ea93 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -1,44 +1,26 @@ ############################################################################### ## Author: Shaun Reed | Contact: shaunrd0@gmail.com | URL: www.shaunreed.com ## ## ## -## A custom tmux multiplexer config / layout created for Manjaro i3 ## -##+ Inspired by vim-powerline: https://github.com/Lokaltog/powerline ## +## A custom tmux multiplexer config / layout created for KDE ## ## ## -## This config created and tested with Powerline Consolas ## -##+ https://github.com/Lokaltog/powerline-fonts ## -##+ Some symbols may require Font Awesome 5 Free Solid ## +## This config was tested with SauceCodePro Nerd Font Mono, Regular ## +## See: dot/.local/share/fonts/ ## +## https://github.com/ryanoasis/nerd-fonts ## ## ## ############################################################################### -# .tmux.conf -# # If symbols or powerline layout fail to appear... -#+ Check your terminal emulator font settings include these fonts -#+ Check that required fonts are installed +# + Check your terminal emulator font settings include these fonts +# + Check that required fonts are installed # # Note: The use of 256colours in this file allows for portable color definitions between platforms and applications -#+ Changing to a different color interpretation may result in some apps displaying colors differently than others -#+ Vim plugin 'Colorizer' does not reflect the actual 256colour values -#+ See https://jonasjacek.github.io/colors/ for a full list of 256colours +# + Changing to a different color interpretation may result in some apps displaying colors differently than others +# + Vim plugin 'Colorizer' does not reflect the actual 256colour values +# + See https://jonasjacek.github.io/colors/ for a full list of 256colours # Settings for terminal text selection / copy options # + Source: https://www.seanh.cc/2020/12/27/copy-and-paste-in-tmux/ # + Depends: https://github.com/tmux-plugins/tmux-yank#linux set -g mouse on -# These bindings are for X Windows only. If you're using a different -# window system you have to replace the `xsel` commands with something -# else. See https://github.com/tmux/tmux/wiki/Clipboard#available-tools -bind -T copy-mode DoubleClick1Pane select-pane \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i" -bind -T copy-mode-vi DoubleClick1Pane select-pane \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i" -bind -n DoubleClick1Pane select-pane \; copy-mode -M \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i" -bind -T copy-mode TripleClick1Pane select-pane \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i" -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" @@ -72,10 +54,10 @@ set -g status-style fg=colour240,bg=colour233 set -g status-left-style bg=colour233,fg=colour243 set -g status-left-length 40 -# Note: Powerline font requires alternate of bold on right side +# Note: SauceCodePro font requires alternate of bold on right side # + Corrects gap on right of character that reveals BG color # Note: No bold required, no BG reveal produced by symbol gaps on left side -# + Font: Sauce Code Pro (NERD patch) +# + Font: SauceCodePro (NERD patch, Regular) # Right side of status bar set -g status-right-style bg=colour233,fg=colour243 @@ -88,11 +70,6 @@ set -g window-status-current-format "#($HOME/go/bin/gitmux -cfg $HOME/.gitmux.co #set -g window-status-current-format "#[fg=colour255,bg=colour233]#[fg=colour100,nobold] #(whoami)@#H #[fg=colour255,bg=colour233,nobold]" run-shell "bash ~/.tmux/tmux-conf.sh" -# Check if we are running xorg -#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] #(hostname) #[fg=colour235,bg=colour233]#[fg=colour240,bg=colour233]" -#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`) " - - # Current window status set -g window-status-current-style bg=colour233,fg=colour100 # Window with activity status diff --git a/.tmux/.tmux-gui.conf b/.tmux/.tmux-gui.conf index afc9062..9655efe 100644 --- a/.tmux/.tmux-gui.conf +++ b/.tmux/.tmux-gui.conf @@ -8,12 +8,6 @@ set -g mouse on # These bindings are for X Windows only. If you're using a different # window system you have to replace the `xsel` commands with something # else. See https://github.com/tmux/tmux/wiki/Clipboard#available-tools -bind -T copy-mode DoubleClick1Pane select-pane \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i" -bind -T copy-mode-vi DoubleClick1Pane select-pane \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i" -bind -n DoubleClick1Pane select-pane \; copy-mode -M \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i" -bind -T copy-mode TripleClick1Pane select-pane \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i" -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" # List of plugins and their settings diff --git a/.vim/.netrwhist b/.vim/.netrwhist deleted file mode 100644 index 50dea27..0000000 --- a/.vim/.netrwhist +++ /dev/null @@ -1,5 +0,0 @@ -let g:netrw_dirhistmax =10 -let g:netrw_dirhistcnt =3 -let g:netrw_dirhist_3='/home/kapper/.ssh' -let g:netrw_dirhist_2='/home/kapper' -let g:netrw_dirhist_1='/home/kapper/dot/vim/.vim/bundle/vim-airline-themes' diff --git a/.vim/backup/.gitignore b/.vim/backup/.gitignore new file mode 100644 index 0000000..89b1c15 --- /dev/null +++ b/.vim/backup/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Don't ignore this file +!.gitignore diff --git a/.vim/swap/.gitignore b/.vim/swap/.gitignore new file mode 100644 index 0000000..89b1c15 --- /dev/null +++ b/.vim/swap/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Don't ignore this file +!.gitignore diff --git a/.vimrc b/.vimrc index 04e7251..e067ee8 100644 --- a/.vimrc +++ b/.vimrc @@ -1,7 +1,12 @@ " Single-quote is a comment written to be read " Double-quotes are commented out code and can be removed or added +" " General Vim Settings + +" Fix plugin compatibility issues +set nocp + let is_docker = filereadable(expand('/.dockerenv')) let has_sauce = filereadable(expand('~/.local/share/fonts/sauce-code-pro.otf')) let is_xorg = exists("$DISPLAY") @@ -13,9 +18,14 @@ let is_xorg = exists("$DISPLAY") " Keep the bottom / top of the page n lines from the cursor set scrolloff=5 +" set paths for swap, backup, and undo files +" :help directory +set directory=~/.vim/swap//,~/tmp/,/var/tmp/,/tmp/,. +" :help backupdir +set backupdir=~/.vim/backup//,~/tmp/,/var/tmp/,/tmp/,. " Persistant undo " :help undo-persistence -set undodir=~/.vim/undodir +set undodir=~/.vim/undo//,~/tmp/,/var/tmp/,/tmp/,. set undofile " Combine vim clipboard with global clipboard buffer @@ -26,29 +36,7 @@ set clipboard+=unnamedplus " Allows true colors in vim (> 8 bit colors) " :help termguicolors -"set termguicolors - -" Custom formatting based on filetype -" :help autocmd -"" autocmd FileType yaml set tabstop=2 shiftwidth=2 - -" 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() - let l:save = winsaveview() - keeppatterns %s/\s\+$//e - call winrestview(l:save) -endfun -"Call this on every attempt to save a file of types defined below.. -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 +""set termguicolors " Set tabwidth=2, adjust Vim shiftwidth to the same set tabstop=2 shiftwidth=2 @@ -64,23 +52,15 @@ set mouse=a set number -" Use Powerline symbols -""let g:airline_powerline_fonts = 1 - " Enable Syntax Highlighting in Vim syntax on " Use Sourcerer color scheme by Xero colorscheme sourcerer -" Fix plugin compatibility issues -set nocp " Allow backspace to remove all types of characters set backspace=indent,eol,start -" Set terminal title when opening file -"" autocmd BufEnter * let &titlestring = ' ' . expand("%:t") -"" set title - +" " Custom Vim Keybindings " nnoremap " Modify and remove leading quotation @@ -95,6 +75,34 @@ nnoremap "nnoremap :!cmake -S . -B ./build/ && cmake --build ./build "nnoremap :!./build/scrap +" Define function in vim to remove whitespace +fun! TrimWhitespace() + let l:save = winsaveview() + keeppatterns %s/\s\+$//e + " Restore window view to retain cursor position + call winrestview(l:save) +endfun + +" :help autocmd +augroup DotAutoCmd + autocmd! + " Set custom options based on filetype + autocmd FileType yaml set tabstop=2 shiftwidth=2 + + " Highlight characters past column N in source files based on file type + autocmd FileType cpp,c,cc,rust match ErrorMsg '\%>80v.\+' + autocmd FileType cs match ErrorMsg '\%>120v.\+' + + "Call this on every attempt to save a file of types defined below.. + autocmd BufWritePre * call TrimWhitespace() + + " Set terminal title when opening file + "" autocmd BufEnter * let &titlestring = ' ' . expand("%:t") + "" set title +augroup END + + +" " Vim Plugin Settings " set rtp+=/path/to/rtp/that/included/pathogen/vim " if needed @@ -178,7 +186,7 @@ elseif is_xorg let g:airline_symbols.notexists = 'Ɇ' let g:airline_symbols.whitespace = 'Ξ' else - " unicode symbols + " no symbols let g:airline_left_sep = '' let g:airline_left_sep = '' let g:airline_right_sep = '' @@ -201,6 +209,7 @@ else let g:airline_symbols.whitespace = '' endif +" " Clang completeion settings " If this is set, clang_complete will not be loaded at all diff --git a/README.md b/README.md index b65a668..7481961 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,23 @@ -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. +## Dotfiles + +Dotfiles configurations for headless Kubuntu 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 ![Vim screenshot](VimScreenshot.png) -### Install Dotfiles +### Install -Easiest installation is to clone repository into home directory - +If you don't install `vim-gtk3`, vim will not have access to your system clipboard, and your copy and paste buffers will not stay in sync. + +Installation instructions - ```bash -sudo apt install git stow vim xsel xclip tmux ranger clang yakuake wget curl -git clone --recursive https://github.com/shaunrd0/dot ~/dot -cd ~/dot/ -stow --adopt . -``` - -If you'd rather clone elsewhere - - -```bash -git clone --recursive https://github.com/shaunrd0/dot /path/to/dot -cd /path/to/dot/ -stow --adopt -t ~ . -``` - -**Warning:** `--adopt` is used to link conflicting files, but doing so could result in the loss of some configs within your local copy of the repository and on your local system. -After running `stow --adopt .`, be sure to check `git status` is clean. -If a file has been modified, discard the local changes to be up-to-date with `origin/master` and it will be restored on your system as well, since the files are now linked. **Your conflicting local system configurations will be lost** unless you back them up manually. - -We could run the following commands to restore changed files -```bash -git checkout -- .vimrc -# Or, to step through each change interactively using git.. -git checkout -p -# Or restore the current directory -git restore . +git clone --recursive https://github.com/shaunrd0/dot +cd dot/ +./setup.sh +mv ~/.bashrc ~/.bashrc.backup +stow . -t ~ ``` If you forget to clone recursively diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..f35961f --- /dev/null +++ b/setup.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +git submodule update --init + +sudo apt update + +sudo apt install -y \ + git \ + stow \ + vim \ + vim-gtk3 \ + xsel \ + xclip \ + tmux \ + ranger \ + clang \ + yakuake \ + wget \ + curl \ + golang-go + +go install github.com/arl/gitmux@latest +