From 589ebcfca6606b480667366d1829a76ffc36f5cd Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 27 Sep 2023 12:12:29 -0400 Subject: [PATCH 01/28] Add modules to copy.sh Add tpm to tmux --- .gitmodules | 3 +++ copy.sh | 2 ++ fake_home/.tmux.conf | 14 ++++++++++---- fake_home/.tmux/plugins/tpm | 1 + 4 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 .gitmodules create mode 160000 fake_home/.tmux/plugins/tpm diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..808c346 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "fake_home/.tmux/plugins/tpm"] + path = fake_home/.tmux/plugins/tpm + url = https://github.com/tmux-plugins/tpm.git diff --git a/copy.sh b/copy.sh index 61271ee..cf3adf8 100755 --- a/copy.sh +++ b/copy.sh @@ -2,6 +2,8 @@ # Install required packages if [[ "$1" != "--install" ]]; then + git submodule init + git submodule update SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" FAKE_HOME="$SCRIPT_DIR/fake_home" diff --git a/fake_home/.tmux.conf b/fake_home/.tmux.conf index fe1e46a..8ea3137 100644 --- a/fake_home/.tmux.conf +++ b/fake_home/.tmux.conf @@ -1,15 +1,19 @@ -# set -g default-terminal "screen-255color" +set -g default-terminal "xterm-256color" +set-option -ga terminal-overrides ",xterm-256color:Tc" + +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' # remap prefix from 'C-b' to 'C-a' unbind C-b set-option -g prefix C-a bind-key C-a send-prefix + set -g default-shell /usr/bin/zsh -set-option -g default-terminal "screen-256color" set -g status-right "# %A, %d %b %Y - %I:%M %p " -set -g status-bg blue -set -g status-fg black +set -g status-bg black +set -g status-fg blue # Smart pane switching with awareness of Vim splits. # See: https://github.com/christoomey/vim-tmux-navigator @@ -34,3 +38,5 @@ bind-key -T copy-mode-vi 'C-\' select-pane -l setw -g window-status-current-style fg=blue,bg=black setw -g window-status-current-format ' #I #{s|/home/sagevaillancourt|~|:pane_current_path} #W#F ' setw -g window-status-format ' #I #{s|/home/sagevaillancourt|~|:pane_current_path} #W#F ' + +run '~/.tmux/plugins/tpm/tpm' diff --git a/fake_home/.tmux/plugins/tpm b/fake_home/.tmux/plugins/tpm new file mode 160000 index 0000000..99469c4 --- /dev/null +++ b/fake_home/.tmux/plugins/tpm @@ -0,0 +1 @@ +Subproject commit 99469c4a9b1ccf77fade25842dc7bafbc8ce9946 From 6cb7075c12271b8dbb4db1076ef6b16d8b963162 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 27 Sep 2023 12:21:12 -0400 Subject: [PATCH 02/28] Various tweaks and improvements. --- .idea/.dotfiles.iml | 8 +- fake_home/.bashrc | 1 + fake_home/.config/rofi/config.rasi | 31 +- fake_home/.config/starship.toml | 26 +- fake_home/.config/xfce4/terminal/terminalrc | 6 +- fake_home/.gitconfig | 1 + fake_home/.ideavimrc | 9 + fake_home/.rofi-history-search.sh | 4 +- fake_home/.rofi-list-git-repos.py | 9 +- fake_home/.shell_aliases | 15 +- fake_home/.sofi.sh | 118 ++++- fake_home/.vim/colors/monokai.vim | 467 ++++++++++++++++++++ fake_home/.vimrc | 9 +- fake_home/.zshrc | 6 +- 14 files changed, 658 insertions(+), 52 deletions(-) create mode 100644 fake_home/.vim/colors/monokai.vim diff --git a/.idea/.dotfiles.iml b/.idea/.dotfiles.iml index bc2cd87..da80146 100644 --- a/.idea/.dotfiles.iml +++ b/.idea/.dotfiles.iml @@ -1,8 +1,12 @@ - - + + + + + \ No newline at end of file diff --git a/fake_home/.bashrc b/fake_home/.bashrc index 6a82646..b3d18fc 100644 --- a/fake_home/.bashrc +++ b/fake_home/.bashrc @@ -2,6 +2,7 @@ # ~/.bashrc # +export PATH=./:~/.bin:~/.local/bin/:$HOME/.platformio/penv/bin:/usr/local/go/bin:$PATH [[ $- != *i* ]] && return colors() { diff --git a/fake_home/.config/rofi/config.rasi b/fake_home/.config/rofi/config.rasi index 8c96b2b..60b6c06 100644 --- a/fake_home/.config/rofi/config.rasi +++ b/fake_home/.config/rofi/config.rasi @@ -1,15 +1,5 @@ configuration { - modes: [ combi, emoji ]; sort: true; - combi-modes: [ - window, - drun, - emoji, - "tabs:/home/sage/.rofi-tabs.sh", - // "history:/home/sage/.rofi-history-search.sh", - "projects:/home/sage/.rofi-list-git-repos.py", - "suspend:/home/sage/.rofi-suspend.sh" - ]; show-icons: true; drun { display-name: ""; @@ -34,16 +24,27 @@ configuration { display-name: ""; fallback-icon: "firefox-beta"; } + modes: [ combi, "mvn:/home/sagevaillancourt/.rofi-mvn-search.py" ]; + combi-modes: [ + window, + drun, + emoji, + "mvn:/home/sagevaillancourt/.rofi-mvn-search.py", + "tabs:/home/sagevaillancourt/.rofi-tabs.sh", + // "history:/home/sage/.rofi-history-search.sh", + "projects:/home/sagevaillancourt/.rofi-list-git-repos.py", + "suspend:/home/sagevaillancourt/.rofi-suspend.sh" + ]; } //@theme "/usr/share/rofi/themes/gruvbox-dark-hard.rasi" //@theme "/usr/share/rofi/themes/Arc-Dark.rasi" -@theme "/usr/share/rofi/themes/android_notification.rasi" +@theme "/usr/local/share/rofi/themes/android_notification.rasi" textbox-prompt-sep { - // str: ">"; + str: ">"; } -inputbar { - // children: [ "textbox-prompt-sep","entry","case-indicator" ]; -} +// inputbar { +// children: [ "textbox-prompt-sep","entry","case-indicator" ]; +// } diff --git a/fake_home/.config/starship.toml b/fake_home/.config/starship.toml index 504031d..95967c3 100644 --- a/fake_home/.config/starship.toml +++ b/fake_home/.config/starship.toml @@ -6,6 +6,12 @@ $hostname\ $shlvl\ $kubernetes\ $directory\ +$git_branch\ +$git_commit\ +$git_state\ +$git_metrics\ +$git_status\ +$hg_branch\ $vcsh\ $java\ $nodejs\ @@ -34,12 +40,6 @@ $terraform\ $vlang\ $vagrant\ $zig\ -$git_branch\ -$git_commit\ -$git_state\ -$git_metrics\ -$git_status\ -$hg_branch\ $docker_context\ $cmake\ $nix_shell\ @@ -92,3 +92,17 @@ discharging_symbol = " " # threshold = 100 # style = "green" # discharging_symbol = " " + +# [git_branch] +# format = "\n on [$symbol$branch(:$remote_branch)]($style) " + +[directory.substitutions] +'~/git/' = '' + +[custom.in-project-dir] +command = '/home/sagevaillancourt/.in_project_dir.sh' +when = true +style = 'bold red' + +[dotnet] +format = 'via [$symbol($version) (◎ $tfm )]($style)' diff --git a/fake_home/.config/xfce4/terminal/terminalrc b/fake_home/.config/xfce4/terminal/terminalrc index da24c57..c7ca1a8 100644 --- a/fake_home/.config/xfce4/terminal/terminalrc +++ b/fake_home/.config/xfce4/terminal/terminalrc @@ -16,7 +16,7 @@ MiscTabCloseMiddleClick=TRUE MiscTabPosition=GTK_POS_TOP MiscHighlightUrls=TRUE ScrollingLines=999999 -BackgroundDarkness=0.750000 +BackgroundDarkness=0.610000 ScrollingOnOutput=FALSE MiscBellUrgent=TRUE MiscMouseWheelZoom=TRUE @@ -33,12 +33,12 @@ ScrollingBar=TERMINAL_SCROLLBAR_NONE BackgroundImageFile=/home/sage/Pictures/ballpapers/wallhaven-r7vxk1.jpg BackgroundImageShading=0.790000 BackgroundImageStyle=TERMINAL_BACKGROUND_STYLE_CENTERED -FontName=FiraCode Nerd Font weight=450 14 +FontName=FiraCode Nerd Font weight=453 10 ColorCursor=#f8f8f2 ColorBold=#f8f8f2 ColorBoldUseDefault=FALSE ColorPalette=rgb(39,40,34);rgb(249,38,114);rgb(146,198,42);rgb(244,191,117);rgb(102,217,239);rgb(174,129,255);rgb(161,239,228);rgb(248,248,242);rgb(117,113,94);rgb(249,38,114);rgb(166,226,46);rgb(244,191,117);rgb(102,217,239);rgb(174,129,255);rgb(161,239,228);rgb(249,248,245) -ColorForeground=#f8f8f2 +ColorForeground=#ffffffffffff ColorBackground=#206d206d206d CustomCommand=zsh diff --git a/fake_home/.gitconfig b/fake_home/.gitconfig index 3510408..3515826 100644 --- a/fake_home/.gitconfig +++ b/fake_home/.gitconfig @@ -5,6 +5,7 @@ [core] autocrlf = input excludesfile = ~/.gitignore + hooksPath = ~/.githooks [credential] helper = store diff --git a/fake_home/.ideavimrc b/fake_home/.ideavimrc index 36630d9..b1bd1e8 100644 --- a/fake_home/.ideavimrc +++ b/fake_home/.ideavimrc @@ -1,5 +1,7 @@ set nocompatible " be iMproved, required filetype off " required +set visualbell +set noerrorbells " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim @@ -53,9 +55,15 @@ nnoremap nnoremap nnoremap +nnoremap dK kdd +nnoremap dJ jdd + nnoremap >f viwc:set ri":set nori vnoremap \f c:set ri":set nori +let mapleader = " " +map bs :action BuildWholeSolutionAction + autocmd BufWinLeave *.* mkview autocmd BufWinEnter *.* silent loadview set viewoptions-=options @@ -63,3 +71,4 @@ set nohlsearch " Save with sudo cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' edit! +set ideajoin \ No newline at end of file diff --git a/fake_home/.rofi-history-search.sh b/fake_home/.rofi-history-search.sh index 76d625f..b83d511 100755 --- a/fake_home/.rofi-history-search.sh +++ b/fake_home/.rofi-history-search.sh @@ -1,4 +1,6 @@ -FIREFOX_PROFILE="$HOME/.mozilla/firefox/qzw6ae3r.default-beta" +#!/bin/bash + +FIREFOX_PROFILE="$HOME/.mozilla/firefox/7sxxu758.dev-edition-default" PLACES_FILE="$FIREFOX_PROFILE/places.sqlite" WORKING_PLACES="$FIREFOX_PROFILE/places2.sqlite" CACHE_FILE="$HOME/.rofi-history-cache" diff --git a/fake_home/.rofi-list-git-repos.py b/fake_home/.rofi-list-git-repos.py index bb8a7cb..bb25b60 100755 --- a/fake_home/.rofi-list-git-repos.py +++ b/fake_home/.rofi-list-git-repos.py @@ -6,9 +6,9 @@ import sys home = os.environ['HOME'] git_dirs = [ - home + "/work", home + "/projects", home + "/git", + home + "/git/worktrees", home + "/WebStormProjects", home + "/RiderProjects" ] @@ -58,6 +58,7 @@ def get_icon(project: str) -> str | None: def open_project(project: str) -> (): + project = project.replace("~", home) (project_type, file) = get_project_type(project) if project_type is None: return @@ -73,7 +74,9 @@ def print_project_message(project: str) -> (): if icon is None: return - print(f'{project}\0icon\x1f{icon}') + project = project.replace(home, "~") + print(f'git {project}') + # print(f'{project}\0icon\x1f{icon}') if __name__ == '__main__': @@ -86,4 +89,4 @@ if __name__ == '__main__': if os.path.isdir(project): print_project_message(project) else: - open_project(sys.argv[1]) + open_project(sys.argv[1][4:]) diff --git a/fake_home/.shell_aliases b/fake_home/.shell_aliases index f922434..8be6707 100755 --- a/fake_home/.shell_aliases +++ b/fake_home/.shell_aliases @@ -1,5 +1,15 @@ #!/bin/bash +function uvim { + vim "scp://undercover.cafe:64522//data/data/com.termux/files/home/$@" +} + +function hearch { + history 0 | sed 's/[0-9 ]*//' | grep "$@" +} + +alias hsearch='hearch' + function fin { find -iname "*$@*" } @@ -34,9 +44,6 @@ function ww { ws $(rg --no-line-number --no-filename . ~/wiki | sed 's/[^a-zA-Z0-9]\+/\n/g' | grep -v "^$" | sort -f | uniq -ci | sort -hr | fzf -i | cut -c 9-) } -if command -v bat; then - alias cat="bat" -fi export FZF_DEFAULT_COMMAND='fd --type f' alias fzf="fzf --preview 'bat --style=numbers --color=always {}'" @@ -89,7 +96,7 @@ alias termrc='vim ~/.config/xfce4/terminal/terminalrc' # Use `grepr` for a recursive, case-insensitive, and filtered grep # alias grepr="grep -RInsi --color=auto --exclude-dir=.git --exclude=tags" # alias grepr='grep -RInsi --color=auto --exclude-dir=.git --exclude-dir=banana_pi_kernel --exclude-dir={bpi_build_scripts, storm_dox, sam_dox} --exclude=tags --exclude=\*.{ko, o}' -alias grepr='grep -RIns --color=auto --exclude-dir=.git --exclude-dir=venv --exclude-dir=node_modules --exclude=tags --exclude-dir=build' +alias grepr='grep -RIns --color=auto --exclude-dir=.git --exclude-dir=venv --exclude-dir=node_modules --exclude=tags --exclude-dir=build --exclude-dir=.idea' alias grepi='grepr -i' alias apt="sudo apt" diff --git a/fake_home/.sofi.sh b/fake_home/.sofi.sh index e884a28..b1e09d4 100755 --- a/fake_home/.sofi.sh +++ b/fake_home/.sofi.sh @@ -10,13 +10,28 @@ FILE_LOCATIONS="$HOME/Documents $HOME/Downloads" ! [[ "$XDG_SESSION_TYPE" = "x11" ]] IS_X11="$?" +sofi_id() { + gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/Windows --method org.gnome.Shell.Extensions.Windows.List | cut -c 3- | rev | cut -c4- | rev | jq '.[] | .id' | while read id; do + if gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/Windows --method org.gnome.Shell.Extensions.Windows.GetTitle $id | grep "SOFI" &> /dev/null; then + echo $id + fi + done +} + # Open search window or raise existing one if [[ "$1" == "--launch" ]]; then if (($IS_X11)) && existing="$(xdotool search $WINDOW_NAME)"; then xdotool windowraise "$existing" else # xfce4-terminal --role="$WINDOW_NAME" --title="$WINDOW_NAME" --startup-id="$WINDOW_NAME" -e "bash -c '$HOME/.sofi.sh'" - xterm -fa 'Monospaced' -fs 10 -e "bash -c '$HOME/.sofi.sh'" + + + id="$(sofi_id)" + if [[ "$id" != "" ]]; then + gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/Windows --method org.gnome.Shell.Extensions.Windows.Activate $id + else + xterm -geometry 120x40 -fa 'Monospaced' -fs 10 -T "SOFI" -e "bash -c '$HOME/.sofi.sh'" + fi # st -e bash -c '$HOME/.sofi.sh'" fi exit $? @@ -24,14 +39,17 @@ fi windows() { if ! (($IS_X11)); then - return + gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/Windows --method org.gnome.Shell.Extensions.Windows.List | cut -c 3- | rev | cut -c4- | rev | jq '.[] | .id' | while read id; do + echo "win" "$(gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/Windows --method org.gnome.Shell.Extensions.Windows.GetTitle $id | cut -c 3- | rev | cut -c4- | rev)" "|" $id + done + else + xprop -root _NET_CLIENT_LIST | + pcregrep -o1 '# (.*)' | + sed 's/, /\n/g' | + xargs -I {} -n1 xprop -id {} _NET_WM_NAME | + grep -v '"Desktop"\|"xfce4-panel"' | + sed 's/_NET_WM_NAME(UTF8_STRING) = "/win /' | sed 's/"$//' fi - xprop -root _NET_CLIENT_LIST | - pcregrep -o1 '# (.*)' | - sed 's/, /\n/g' | - xargs -I {} -n1 xprop -id {} _NET_WM_NAME | - grep -v '"Desktop"\|"xfce4-panel"' | - sed 's/_NET_WM_NAME(UTF8_STRING) = "/win /' | sed 's/"$//' } read_apps() { @@ -42,6 +60,10 @@ read_apps() { sed 's/Name=/app /' > "$CACHE_FILE" & } +read_snap_apps() { + snap list | tail -n +2 | awk '{print "snp " $1}' +} + open_app() { app="$(echo "$1" | cut -c 5-)" # shellcheck disable=SC2086 @@ -69,6 +91,7 @@ if [[ "$1" == "--print-only" ]]; then <(windows) \ <($HOME/.rofi-list-git-repos.py --no-icon) \ <(read_apps) \ + <(read_snap_apps) \ <(list_files) \ $HOME/.emojis exit 1 @@ -78,28 +101,97 @@ choice="$(cat \ <(windows) \ <("$HOME/.rofi-list-git-repos.py") \ <(read_apps) \ + <(read_snap_apps) \ <(list_files) \ "$HOME/.emojis" \ - | fzf)" + | fzf --print-query --preview="$HOME/.sofi-preview.sh {} {q}")" +echo +qstring="$(echo "$choice" | head -n 1)" +choice="$(echo "$choice" | tail -n 1)" + +mvn_handler() { + qarg="$(echo "$1" | cut -c 5-)" + row_count=10 + arr_result="$(curl -s "https://search.maven.org/solrsearch/select?q=$qarg&rows=$row_count&wt=json" | jq '[.response.docs[] | { g, a, latestVersion } ]')" + + for i in 0 1 2 3 4 5 6 7 8 9; do + groupId="$(echo -n "$arr_result" | jq -r ".[$i].g")" + artifactId="$(echo -n "$arr_result" | jq -r ".[$i].a")" + latestVersion="$(echo -n "$arr_result" | jq -r ".[$i].latestVersion")" + echo "mvr $groupId:$artifactId $latestVersion" + done | fzf --print-query --preview="$HOME/.sofi-preview.sh {} {q}" +} + +npm_handler() { + qarg="$(echo "$1" | cut -c 5-)" + NVM_DIR="$HOME/.nvm" + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm + [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion + package="$(npm search $qarg | tail -n +2 | fzf | sed 's/ .*//')" + setsid xdg-open "https://npmjs.com/package/$package" &> /dev/null & +} case $choice in git*) setsid "$HOME/.rofi-list-git-repos.py" "$choice" &> /dev/null & ;; win*) - wmctrl -i -R "$(xwininfo -root -tree | - grep "$(echo "$choice" | cut -c 5-)" | - awk '{ print $1 }' | - sed 's/0x/0x00/')" + if (($IS_X11)); then + wmctrl -i -R "$(xwininfo -root -tree | + grep "$(echo "$choice" | cut -c 5-)" | + awk '{ print $1 }' | + sed 's/0x/0x00/')" + else + gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/Windows --method org.gnome.Shell.Extensions.Windows.Activate "$(echo "$choice" | sed 's/.* \([0-9]\+\)$/\1/')" + fi ;; app*) open_app "$choice" ;; + snp*) + app="$(echo "$choice" | cut -c 5-)" + setsid $app >/dev/null 2>&1 /dev/null & ;; + + *) + case $qstring in + mvn*) + lib="$(mvn_handler "$qstring")" + lib="$(echo "$lib" | cut -c 5-)" + groupId="$(echo -n "${lib//[$'\t\r\n']}" | sed 's/\(.*\):.*/\1/')" + artifactId="$(echo -n "${lib//[$'\t\r\n']}" | sed 's/.*:\(.*\) .*/\1/')" + latestVersion="$(echo -n "${lib//[$'\t\r\n']}" | sed 's/.* \(.*\)/\1/')" + + xml="$(cat < + ${groupId} + ${artifactId} + ${latestVersion} + +EOF +)" + if (($IS_X11)); then + nohup xclip -selection clipboard <(echo -n "$xml") &> /dev/null & + else + wl-copy "$xml" + fi + echo "Copied to clipboard!" + sleep 0.5 + ;; + + npm*) + lib="$(npm_handler "$qstring")" + lib="$(echo "$lib" | cut -c 5-)" + ;; + + esac + ;; esac + sleep 0.1 diff --git a/fake_home/.vim/colors/monokai.vim b/fake_home/.vim/colors/monokai.vim new file mode 100644 index 0000000..ee5158a --- /dev/null +++ b/fake_home/.vim/colors/monokai.vim @@ -0,0 +1,467 @@ +" File: monokai.vim +" Maintainer: Crusoe Xia (crusoexia) +" URL: https://github.com/crusoexia/vim-monokai +" License: MIT +" +" The colour palette is from http://www.colourlovers.com/ + +" Initialisation +" -------------- + +if !has("gui_running") && &t_Co < 256 + finish +endif + +if ! exists("g:monokai_gui_italic") + let g:monokai_gui_italic = 0 +endif + +if ! exists("g:monokai_term_italic") + let g:monokai_term_italic = 0 +endif + +let g:monokai_termcolors = 256 " does not support 16 color term right now. + +set background=dark +hi clear + +if exists("syntax_on") + syntax reset +endif + +let colors_name = "monokai" + +function! s:h(group, style) + let s:ctermformat = "NONE" + let s:guiformat = "NONE" + if has_key(a:style, "format") + let s:ctermformat = a:style.format + let s:guiformat = a:style.format + endif + if g:monokai_term_italic == 0 + let s:ctermformat = substitute(s:ctermformat, ",italic", "", "") + let s:ctermformat = substitute(s:ctermformat, "italic,", "", "") + let s:ctermformat = substitute(s:ctermformat, "italic", "", "") + endif + if g:monokai_gui_italic == 0 + let s:guiformat = substitute(s:guiformat, ",italic", "", "") + let s:guiformat = substitute(s:guiformat, "italic,", "", "") + let s:guiformat = substitute(s:guiformat, "italic", "", "") + endif + if g:monokai_termcolors == 16 + let l:ctermfg = (has_key(a:style, "fg") ? a:style.fg.cterm16 : "NONE") + let l:ctermbg = (has_key(a:style, "bg") ? a:style.bg.cterm16 : "NONE") + else + let l:ctermfg = (has_key(a:style, "fg") ? a:style.fg.cterm : "NONE") + let l:ctermbg = (has_key(a:style, "bg") ? a:style.bg.cterm : "NONE") + end + execute "highlight" a:group + \ "guifg=" (has_key(a:style, "fg") ? a:style.fg.gui : "NONE") + \ "guibg=" (has_key(a:style, "bg") ? a:style.bg.gui : "NONE") + \ "guisp=" (has_key(a:style, "sp") ? a:style.sp.gui : "NONE") + \ "gui=" (!empty(s:guiformat) ? s:guiformat : "NONE") + \ "ctermfg=" . l:ctermfg + \ "ctermbg=" . l:ctermbg + \ "cterm=" (!empty(s:ctermformat) ? s:ctermformat : "NONE") +endfunction + +" Palettes +" -------- + +let s:white = { "gui": "#E8E8E3", "cterm": "252" } +let s:white2 = { "gui": "#d8d8d3", "cterm": "250" } +let s:black = { "gui": "#272822", "cterm": "234" } +let s:lightblack = { "gui": "#2D2E27", "cterm": "235" } +let s:lightblack2 = { "gui": "#383a3e", "cterm": "236" } +let s:lightblack3 = { "gui": "#3f4145", "cterm": "237" } +let s:darkblack = { "gui": "#211F1C", "cterm": "233" } +let s:grey = { "gui": "#8F908A", "cterm": "243" } +let s:lightgrey = { "gui": "#575b61", "cterm": "237" } +let s:darkgrey = { "gui": "#64645e", "cterm": "239" } +let s:warmgrey = { "gui": "#75715E", "cterm": "59" } + +let s:pink = { "gui": "#F92772", "cterm": "197" } +let s:green = { "gui": "#A6E22D", "cterm": "148" } +let s:aqua = { "gui": "#66d9ef", "cterm": "81" } +let s:yellow = { "gui": "#E6DB74", "cterm": "186" } +let s:orange = { "gui": "#FD9720", "cterm": "208" } +let s:purple = { "gui": "#ae81ff", "cterm": "141" } +let s:red = { "gui": "#e73c50", "cterm": "196" } +let s:purered = { "gui": "#ff0000", "cterm": "52" } +let s:darkred = { "gui": "#5f0000", "cterm": "52" } + +let s:addfg = { "gui": "#d7ffaf", "cterm": "193" } +let s:addbg = { "gui": "#5f875f", "cterm": "65" } +let s:delfg = { "gui": "#ff8b8b", "cterm": "210" } +let s:delbg = { "gui": "#f75f5f", "cterm": "124" } +let s:changefg = { "gui": "#d7d7ff", "cterm": "189" } +let s:changebg = { "gui": "#5f5f87", "cterm": "60" } + +let s:cyan = { "gui": "#A1EFE4" } +let s:br_green = { "gui": "#9EC400" } +let s:br_yellow = { "gui": "#E7C547" } +let s:br_blue = { "gui": "#7AA6DA" } +let s:br_purple = { "gui": "#B77EE0" } +let s:br_cyan = { "gui": "#54CED6" } +let s:br_white = { "gui": "#FFFFFF" } + +" Highlighting +" ------------ + +" editor +call s:h("Normal", { "fg": s:white, "bg": s:black }) +call s:h("ColorColumn", { "bg": s:lightblack }) +call s:h("Cursor", { "fg": s:black, "bg": s:white }) +call s:h("CursorColumn", { "bg": s:lightblack2 }) +call s:h("CursorLine", { "bg": s:lightblack2 }) +call s:h("NonText", { "fg": s:lightgrey }) +call s:h("Visual", { "bg": s:lightgrey }) +call s:h("Search", { "fg": s:black, "bg": s:yellow }) +call s:h("MatchParen", { "fg": s:purple, "format": "underline,bold" }) +call s:h("Question", { "fg": s:yellow }) +call s:h("ModeMsg", { "fg": s:yellow }) +call s:h("MoreMsg", { "fg": s:yellow }) +call s:h("ErrorMsg", { "fg": s:black, "bg": s:red, "format": "standout" }) +call s:h("WarningMsg", { "fg": s:red }) +call s:h("VertSplit", { "fg": s:darkgrey, "bg": s:darkblack }) +call s:h("LineNr", { "fg": s:grey, "bg": s:lightblack }) +call s:h("CursorLineNr", { "fg": s:orange, "bg": s:lightblack }) +call s:h("SignColumn", { "bg": s:lightblack }) + +" statusline +call s:h("StatusLine", { "fg": s:black, "bg": s:lightgrey }) +call s:h("StatusLineNC", { "fg": s:lightgrey, "bg": s:black }) +call s:h("TabLine", { "fg": s:lightgrey, "bg": s:lightblack }) +call s:h("TabLineSel", { "fg": s:darkblack, "bg": s:warmgrey, "format": "bold" }) +call s:h("TabLineFill", { "bg": s:lightblack }) +call s:h("User1", { "fg": s:yellow, "bg": s:lightgrey, "format": "bold" }) +call s:h("User2", { "fg": s:orange, "bg": s:lightgrey, "format": "bold" }) +call s:h("User3", { "fg": s:purple, "bg": s:lightgrey, "format": "bold" }) +call s:h("User4", { "fg": s:aqua, "bg": s:lightgrey, "format": "bold" }) + +" spell +call s:h("SpellBad", { "fg": s:red, "format": "underline" }) +call s:h("SpellCap", { "fg": s:purple, "format": "underline" }) +call s:h("SpellRare", { "fg": s:aqua, "format": "underline" }) +call s:h("SpellLocal", { "fg": s:pink, "format": "underline" }) + +" misc +call s:h("SpecialKey", { "fg": s:pink }) +call s:h("Title", { "fg": s:yellow }) +call s:h("Directory", { "fg": s:aqua }) + +" diff +call s:h("DiffAdd", { "fg": s:addfg, "bg": s:addbg }) +call s:h("DiffDelete", { "fg": s:delfg, "bg": s:delbg }) +call s:h("DiffChange", { "fg": s:changefg, "bg": s:changebg }) +call s:h("DiffText", { "fg": s:black, "bg": s:aqua }) + +" fold +call s:h("Folded", { "fg": s:warmgrey, "bg": s:darkblack }) +call s:h("FoldColumn", { "bg": s:darkblack }) +" Incsearch" + +" popup menu +call s:h("Pmenu", { "fg": s:white2, "bg": s:lightblack3 }) +call s:h("PmenuSel", { "fg": s:aqua, "bg": s:lightblack3, "format": "reverse,bold" }) +call s:h("PmenuThumb", { "fg": s:lightblack, "bg": s:grey }) +" PmenuSbar" + +" Generic Syntax Highlighting +" --------------------------- + +call s:h("Constant", { "fg": s:purple }) +call s:h("Number", { "fg": s:purple }) +call s:h("Float", { "fg": s:purple }) +call s:h("Boolean", { "fg": s:purple }) +call s:h("Character", { "fg": s:yellow }) +call s:h("String", { "fg": s:yellow }) + +call s:h("Type", { "fg": s:aqua }) +call s:h("Structure", { "fg": s:aqua }) +call s:h("StorageClass", { "fg": s:aqua }) +call s:h("Typedef", { "fg": s:aqua }) + +call s:h("Identifier", { "fg": s:green }) +call s:h("Function", { "fg": s:green }) + +call s:h("Statement", { "fg": s:pink }) +call s:h("Operator", { "fg": s:pink }) +call s:h("Label", { "fg": s:pink }) +call s:h("Keyword", { "fg": s:pink }) +" Conditional" +" Repeat" +" Exception" + +call s:h("PreProc", { "fg": s:green }) +call s:h("Include", { "fg": s:pink }) +call s:h("Define", { "fg": s:pink }) +call s:h("Macro", { "fg": s:green }) +call s:h("PreCondit", { "fg": s:green }) + +call s:h("Special", { "fg": s:purple }) +call s:h("SpecialChar", { "fg": s:pink }) +call s:h("Delimiter", { "fg": s:pink }) +call s:h("SpecialComment",{ "fg": s:aqua }) +call s:h("Tag", { "fg": s:pink }) +" Debug" + +call s:h("Todo", { "fg": s:orange, "format": "bold,italic" }) +call s:h("Comment", { "fg": s:warmgrey, "format": "italic" }) + +call s:h("Underlined", { "fg": s:green }) +call s:h("Ignore", {}) +call s:h("Error", { "fg": s:red, "bg": s:darkred }) + +" NerdTree +" -------- + +call s:h("NERDTreeOpenable", { "fg": s:yellow }) +call s:h("NERDTreeClosable", { "fg": s:yellow }) +call s:h("NERDTreeHelp", { "fg": s:yellow }) +call s:h("NERDTreeBookmarksHeader", { "fg": s:pink }) +call s:h("NERDTreeBookmarksLeader", { "fg": s:black }) +call s:h("NERDTreeBookmarkName", { "fg": s:yellow }) +call s:h("NERDTreeCWD", { "fg": s:pink }) +call s:h("NERDTreeUp", { "fg": s:white }) +call s:h("NERDTreeDirSlash", { "fg": s:grey }) +call s:h("NERDTreeDir", { "fg": s:grey }) + +" Syntastic +" --------- + +hi! link SyntasticErrorSign Error +call s:h("SyntasticWarningSign", { "fg": s:lightblack, "bg": s:orange }) + +" coc +" --- + +hi! link CocErrorSign Error +call s:h("CocErrorHighlight", { "fg": s:red, "format": "underline" }) +call s:h("CocErrorFloat", { "fg": s:purered, "bg": s:lightblack3 }) + +call s:h("CocWarningSign", { "fg": s:orange, "bg": s:lightblack }) +call s:h("CocWarningHighlight", { "format": "underline" }) +call s:h("CocWarningFloat", { "fg": s:orange, "bg": s:lightblack3 }) + +call s:h("CocInfoSign", { "fg": s:yellow, "bg": s:lightblack3 }) +call s:h("CocInfoHighlight", { "format": "underline" }) + +call s:h("CocHintSign", { "fg": s:white, "bg": s:lightblack3 }) +call s:h("CocHintHighlight", { "format": "underline" }) + +" Language highlight +" ------------------ + +" Java properties +call s:h("jpropertiesIdentifier", { "fg": s:pink }) + +" Vim command +call s:h("vimCommand", { "fg": s:pink }) + +" Javascript +call s:h("jsClassKeyword", { "fg": s:aqua, "format": "italic" }) +call s:h("jsGlobalObjects", { "fg": s:aqua, "format": "italic" }) +call s:h("jsFuncName", { "fg": s:green }) +call s:h("jsThis", { "fg": s:orange, "format": "italic" }) +call s:h("jsObjectKey", { "fg": s:white }) +call s:h("jsFunctionKey", { "fg": s:green }) +call s:h("jsPrototype", { "fg": s:aqua }) +call s:h("jsExceptions", { "fg": s:aqua }) +call s:h("jsFutureKeys", { "fg": s:aqua }) +call s:h("jsBuiltins", { "fg": s:aqua }) +call s:h("jsStatic", { "fg": s:aqua }) +call s:h("jsSuper", { "fg": s:orange, "format": "italic" }) +call s:h("jsFuncArgRest", { "fg": s:purple, "format": "italic" }) +call s:h("jsFuncArgs", { "fg": s:orange, "format": "italic" }) +call s:h("jsStorageClass", { "fg": s:aqua, "format": "italic" }) +call s:h("jsDocTags", { "fg": s:aqua, "format": "italic" }) +call s:h("jsFunction", { "fg": s:aqua, "format": "italic" }) + +" Typescript +call s:h("typescriptBraces", { "fg": s:white }) +call s:h("typescriptParens", { "fg": s:white }) +call s:h("typescriptOperator", { "fg": s:pink }) +call s:h("typescriptEndColons", { "fg": s:white }) +call s:h("typescriptModule", { "fg": s:aqua }) +call s:h("typescriptPredefinedType", { "fg": s:aqua }) +call s:h("typescriptImport", { "fg": s:pink }) +call s:h("typescriptExport", { "fg": s:pink }) +call s:h("typescriptIdentifier", { "fg": s:orange, "format": "italic" }) +call s:h("typescriptVariable", { "fg": s:aqua }) +call s:h("typescriptCastKeyword", { "fg": s:pink }) +call s:h("typescriptAmbientDeclaration", { "fg": s:pink }) +call s:h("typescriptTestGlobal", { "fg": s:pink }) +call s:h("typescriptFuncKeyword", { "fg": s:aqua }) +call s:h("typescriptFuncTypeArrow", { "fg": s:aqua }) +call s:h("typescriptFuncType", { "fg": s:orange, "format": "italic" }) +call s:h("typescriptFuncName", { "fg": s:green }) +call s:h("typescriptArrowFuncArg", { "fg": s:orange, "format": "italic" }) +call s:h("typescriptCall", { "fg": s:orange, "format": "italic" }) +call s:h("typescriptClassKeyword", { "fg": s:aqua, "format": "italic" }) +call s:h("typescriptClassName", { "fg": s:white }) +call s:h("typescriptClassHeritage", { "fg": s:white }) +call s:h("typescriptInterfaceKeyword", { "fg": s:aqua, "format": "italic" }) +call s:h("typescriptInterfaceName", { "fg": s:white }) +call s:h("typescriptObjectLabel", { "fg": s:green }) +call s:h("typescriptMember", { "fg": s:green }) +call s:h("typescriptTypeReference", { "fg": s:purple, "format": "italic" }) +call s:h("typescriptTypeParameter", { "fg": s:purple, "format": "italic" }) +call s:h("typescriptOptionalMark", { "fg": s:pink }) +call s:h("tsxAttrib", { "fg": s:green }) +call s:h("tsxTagName", { "fg": s:pink }) + +" Dart +call s:h("dartStorageClass", { "fg": s:pink }) +call s:h("dartExceptions", { "fg": s:pink }) +call s:h("dartConditional", { "fg": s:pink }) +call s:h("dartRepeat", { "fg": s:pink }) +call s:h("dartTypedef", { "fg": s:pink }) +call s:h("dartKeyword", { "fg": s:pink }) +call s:h("dartConstant", { "fg": s:purple }) +call s:h("dartBoolean", { "fg": s:purple }) +call s:h("dartCoreType", { "fg": s:aqua }) +call s:h("dartType", { "fg": s:aqua }) + +" HTML +call s:h("htmlTag", { "fg": s:white }) +call s:h("htmlEndTag", { "fg": s:white }) +call s:h("htmlTagName", { "fg": s:pink }) +call s:h("htmlArg", { "fg": s:green }) +call s:h("htmlSpecialChar", { "fg": s:purple }) + +" XML +call s:h("xmlTag", { "fg": s:pink }) +call s:h("xmlEndTag", { "fg": s:pink }) +call s:h("xmlTagName", { "fg": s:orange }) +call s:h("xmlAttrib", { "fg": s:green }) + +" JSX +call s:h("jsxTag", { "fg": s:white }) +call s:h("jsxCloseTag", { "fg": s:white }) +call s:h("jsxCloseString", { "fg": s:white }) +call s:h("jsxPunct", { "fg": s:white }) +call s:h("jsxClosePunct", { "fg": s:white }) +call s:h("jsxTagName", { "fg": s:pink }) +call s:h("jsxComponentName", { "fg": s:pink }) +call s:h("jsxAttrib", { "fg": s:green }) +call s:h("jsxEqual", { "fg": s:white }) +call s:h("jsxBraces", { "fg": s:white }) + +" CSS +call s:h("cssProp", { "fg": s:yellow }) +call s:h("cssUIAttr", { "fg": s:yellow }) +call s:h("cssFunctionName", { "fg": s:aqua }) +call s:h("cssColor", { "fg": s:purple }) +call s:h("cssPseudoClassId", { "fg": s:purple }) +call s:h("cssClassName", { "fg": s:green }) +call s:h("cssValueLength", { "fg": s:purple }) +call s:h("cssCommonAttr", { "fg": s:pink }) +call s:h("cssBraces" , { "fg": s:white }) +call s:h("cssClassNameDot", { "fg": s:pink }) +call s:h("cssURL", { "fg": s:orange, "format": "underline,italic" }) + +" LESS +call s:h("lessVariable", { "fg": s:green }) + +" SASS +call s:h("sassMixing", { "fg": s:aqua }) +call s:h("sassMixin", { "fg": s:aqua }) +call s:h("sassFunctionDecl", { "fg": s:aqua }) +call s:h("sassReturn", { "fg": s:aqua }) +call s:h("sassClass", { "fg": s:green }) +call s:h("sassClassChar", { "fg": s:pink }) +call s:h("sassIdChar", { "fg": s:pink }) +call s:h("sassControl", { "fg": s:aqua }) +call s:h("sassFor", { "fg": s:aqua }) + +" ruby +call s:h("rubyInterpolationDelimiter", {}) +call s:h("rubyInstanceVariable", {}) +call s:h("rubyGlobalVariable", {}) +call s:h("rubyClassVariable", {}) +call s:h("rubyPseudoVariable", {}) +call s:h("rubyFunction", { "fg": s:green }) +call s:h("rubyStringDelimiter", { "fg": s:yellow }) +call s:h("rubyRegexp", { "fg": s:yellow }) +call s:h("rubyRegexpDelimiter", { "fg": s:yellow }) +call s:h("rubySymbol", { "fg": s:purple }) +call s:h("rubyEscape", { "fg": s:purple }) +call s:h("rubyInclude", { "fg": s:pink }) +call s:h("rubyOperator", { "fg": s:pink }) +call s:h("rubyControl", { "fg": s:pink }) +call s:h("rubyClass", { "fg": s:pink }) +call s:h("rubyDefine", { "fg": s:pink }) +call s:h("rubyException", { "fg": s:pink }) +call s:h("rubyRailsARAssociationMethod",{ "fg": s:orange }) +call s:h("rubyRailsARMethod", { "fg": s:orange }) +call s:h("rubyRailsRenderMethod", { "fg": s:orange }) +call s:h("rubyRailsMethod", { "fg": s:orange }) +call s:h("rubyConstant", { "fg": s:aqua }) +call s:h("rubyBlockArgument", { "fg": s:orange }) +call s:h("rubyBlockParameter", { "fg": s:orange }) + +" eruby +call s:h("erubyDelimiter", {}) +call s:h("erubyRailsMethod", { "fg": s:aqua }) + +" c +call s:h("cLabel", { "fg": s:pink }) +call s:h("cStructure", { "fg": s:aqua }) +call s:h("cStorageClass", { "fg": s:pink }) +call s:h("cInclude", { "fg": s:pink }) +call s:h("cDefine", { "fg": s:pink }) +call s:h("cSpecial", { "fg": s:purple }) + +" Markdown +call s:h("markdownCode", { "fg": s:purple, "format": "italic" } ) +call s:h("markdownListMarker", { "fg": s:purple } ) + +" vim-notes +call s:h("notesTitle", { "fg": s:aqua, "format": "bold" } ) +call s:h("notesAtxMarker", { "fg": s:pink, "format": "italic,bold" } ) +call s:h("notesShortHeading", { "fg": s:white, "format": "bold" } ) +call s:h("notesListBullet", { "fg": s:purple } ) +call s:h("notesListNumber", { "fg": s:purple, "format": "italic" } ) +call s:h("notesBold", { "format": "bold" } ) +call s:h("notesDoneMarker", { "fg": s:green } ) + +" Terminal Colors +" --------------- +if has('nvim') + let g:terminal_color_0 = s:black.gui + let g:terminal_color_1 = s:red.gui + let g:terminal_color_2 = s:green.gui + let g:terminal_color_3 = s:yellow.gui + let g:terminal_color_4 = s:aqua.gui + let g:terminal_color_5 = s:purple.gui + let g:terminal_color_6 = s:cyan.gui + let g:terminal_color_7 = s:white.gui + let g:terminal_color_8 = s:darkgrey.gui + let g:terminal_color_9 = s:pink.gui + let g:terminal_color_10 = s:br_green.gui + let g:terminal_color_11 = s:br_yellow.gui + let g:terminal_color_12 = s:br_blue.gui + let g:terminal_color_13 = s:br_purple.gui + let g:terminal_color_14 = s:br_cyan.gui + let g:terminal_color_15 = s:br_white.gui +else + let g:terminal_ansi_colors = [ + \ s:black.gui, + \ s:red.gui, + \ s:green.gui, + \ s:yellow.gui, + \ s:aqua.gui, + \ s:purple.gui, + \ s:cyan.gui, + \ s:white.gui, + \ s:darkgrey.gui, + \ s:pink.gui, + \ s:br_green.gui, + \ s:br_yellow.gui, + \ s:br_blue.gui, + \ s:br_purple.gui, + \ s:br_cyan.gui, + \ s:br_white.gui] +endif + diff --git a/fake_home/.vimrc b/fake_home/.vimrc index e3f66d2..e8b69a9 100644 --- a/fake_home/.vimrc +++ b/fake_home/.vimrc @@ -19,10 +19,10 @@ else let &t_8b = "\[48:2:%lu:%lu:%lum" syntax enable - colorscheme jellybeans + colorscheme monokai endif -let mapleader=" " +" let mapleader=" " "nnoremap w yiwq:PIe `~/.shell_aliases ws "nnoremap w yiw:let srr_back = &srr set srr=>q:PIr! /home/sage/.shell_aliases wf " TODO Check if file needs saving @@ -177,6 +177,9 @@ iab reteun return iab reutner return " Keep same gutter color when errored -highlight! link SignColumn LineNr +" highlight! link SignColumn LineNr + +" Include hyphens in words +set iskeyword+=- so ~/.vim/user/files.vim diff --git a/fake_home/.zshrc b/fake_home/.zshrc index 7c39b7c..a8914cd 100644 --- a/fake_home/.zshrc +++ b/fake_home/.zshrc @@ -1,4 +1,3 @@ -source ~/.zsh_local if test -f /usr/share/doc/fzf/examples/completion.zsh &> /dev/null; then source /usr/share/doc/fzf/examples/completion.zsh fi @@ -38,7 +37,7 @@ if [ -x /usr/bin/dircolors ]; then alias egrep='egrep --color=auto' fi -export PATH=./:~/.bin:$HOME/.dotnet:$HOME/.platformio/penv/bin:/usr/local/go/bin:$PATH +export PATH=~/.bin:$HOME/.dotnet:~/.local/bin:$HOME/.platformio/penv/bin:/usr/local/go/bin:$PATH fignore=(o) @@ -91,7 +90,10 @@ if test -f ~/.cargo/env; then fi source ~/.shell_aliases +source ~/.zsh_local export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion + +source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh From 8449e511d102e2a3d725dbb6ac94aac2b6dde63b Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 12:07:49 -0500 Subject: [PATCH 03/28] Add .Xresources with xterm monokai colors --- fake_home/.Xresources | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 fake_home/.Xresources diff --git a/fake_home/.Xresources b/fake_home/.Xresources new file mode 100644 index 0000000..93af9c9 --- /dev/null +++ b/fake_home/.Xresources @@ -0,0 +1,33 @@ +xterm*font: *-fixed-*-*-*-26-* +! terminal colours +xterm*foreground:#FFFFFF +xterm*background:#202020 + +!black darkgray +*color0: #1B1D1E +*color8: #808080 +!darkred red +*color1: #FF0044 +*color9: #F92672 +!darkgreen green +*color2: #82B414 +*color10: #A6E22E +!darkyellow yellow +*color3: #FD971F +*color11: #E6DB74 +!darkblue blue +*color4: #266C98 +*color12: #7070F0 +!darkmagenta magenta +*color5: #AC0CB1 +*color13: #D63AE1 +!darkcyan cyan +*color6: #AE81FF +*color14: #66D9EF +!gray white +*color7: #CCCCCC +*color15: #F8F8F2 + +xterm*faceName: Envy Code R +xterm*faceNameDoublesize: Droid Sans Fallback +xterm*faceSize: 12 From ccebce83938eec97899726ca6ebf5673d70c2474 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 12:16:51 -0500 Subject: [PATCH 04/28] Add PATH bits to .bashrc --- fake_home/.bashrc | 1 + 1 file changed, 1 insertion(+) diff --git a/fake_home/.bashrc b/fake_home/.bashrc index 6a82646..b3d18fc 100644 --- a/fake_home/.bashrc +++ b/fake_home/.bashrc @@ -2,6 +2,7 @@ # ~/.bashrc # +export PATH=./:~/.bin:~/.local/bin/:$HOME/.platformio/penv/bin:/usr/local/go/bin:$PATH [[ $- != *i* ]] && return colors() { From 3557f5644901d45a9a1457421599fc4025e1d7fd Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 12:17:11 -0500 Subject: [PATCH 05/28] Add hooksPath to gitconfig --- fake_home/.gitconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/fake_home/.gitconfig b/fake_home/.gitconfig index 3510408..3515826 100644 --- a/fake_home/.gitconfig +++ b/fake_home/.gitconfig @@ -5,6 +5,7 @@ [core] autocrlf = input excludesfile = ~/.gitignore + hooksPath = ~/.githooks [credential] helper = store From 4f2cd94b350f04eef699904a5f7a695dd3427f2e Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 12:17:24 -0500 Subject: [PATCH 06/28] Some ideavimrc tweaks --- fake_home/.ideavimrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fake_home/.ideavimrc b/fake_home/.ideavimrc index 36630d9..b1bd1e8 100644 --- a/fake_home/.ideavimrc +++ b/fake_home/.ideavimrc @@ -1,5 +1,7 @@ set nocompatible " be iMproved, required filetype off " required +set visualbell +set noerrorbells " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim @@ -53,9 +55,15 @@ nnoremap nnoremap nnoremap +nnoremap dK kdd +nnoremap dJ jdd + nnoremap >f viwc:set ri":set nori vnoremap \f c:set ri":set nori +let mapleader = " " +map bs :action BuildWholeSolutionAction + autocmd BufWinLeave *.* mkview autocmd BufWinEnter *.* silent loadview set viewoptions-=options @@ -63,3 +71,4 @@ set nohlsearch " Save with sudo cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' edit! +set ideajoin \ No newline at end of file From fbed79f63f85e37dc32d0c696e47e538e4cdb486 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 12:20:47 -0500 Subject: [PATCH 07/28] Drop icons from sofi --- fake_home/.rofi-history-search.sh | 4 +++- fake_home/.rofi-list-git-repos.py | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/fake_home/.rofi-history-search.sh b/fake_home/.rofi-history-search.sh index 76d625f..b83d511 100755 --- a/fake_home/.rofi-history-search.sh +++ b/fake_home/.rofi-history-search.sh @@ -1,4 +1,6 @@ -FIREFOX_PROFILE="$HOME/.mozilla/firefox/qzw6ae3r.default-beta" +#!/bin/bash + +FIREFOX_PROFILE="$HOME/.mozilla/firefox/7sxxu758.dev-edition-default" PLACES_FILE="$FIREFOX_PROFILE/places.sqlite" WORKING_PLACES="$FIREFOX_PROFILE/places2.sqlite" CACHE_FILE="$HOME/.rofi-history-cache" diff --git a/fake_home/.rofi-list-git-repos.py b/fake_home/.rofi-list-git-repos.py index bb8a7cb..8a39f05 100755 --- a/fake_home/.rofi-list-git-repos.py +++ b/fake_home/.rofi-list-git-repos.py @@ -6,9 +6,9 @@ import sys home = os.environ['HOME'] git_dirs = [ - home + "/work", home + "/projects", home + "/git", + home + "/git/worktrees", home + "/WebStormProjects", home + "/RiderProjects" ] @@ -58,6 +58,7 @@ def get_icon(project: str) -> str | None: def open_project(project: str) -> (): + project = project.replace("~", home) (project_type, file) = get_project_type(project) if project_type is None: return @@ -73,7 +74,8 @@ def print_project_message(project: str) -> (): if icon is None: return - print(f'{project}\0icon\x1f{icon}') + project = project.replace(home, "~") + print(f'git {project}') if __name__ == '__main__': @@ -86,4 +88,4 @@ if __name__ == '__main__': if os.path.isdir(project): print_project_message(project) else: - open_project(sys.argv[1]) + open_project(sys.argv[1][4:]) From ac6ff3b9f8fb6f1e59bbdf6e6b497819d870f261 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 12:21:25 -0500 Subject: [PATCH 08/28] No paging with bat 'cat' alias Add hearch/hsearch --- fake_home/.shell_aliases | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fake_home/.shell_aliases b/fake_home/.shell_aliases index f922434..1ea5674 100755 --- a/fake_home/.shell_aliases +++ b/fake_home/.shell_aliases @@ -1,5 +1,11 @@ #!/bin/bash +function hearch { + history 0 | sed 's/[0-9 ]*//' | grep "$@" +} + +alias hsearch='hearch' + function fin { find -iname "*$@*" } @@ -35,7 +41,7 @@ function ww { } if command -v bat; then - alias cat="bat" + alias cat="bat -p" fi export FZF_DEFAULT_COMMAND='fd --type f' alias fzf="fzf --preview 'bat --style=numbers --color=always {}'" @@ -89,7 +95,7 @@ alias termrc='vim ~/.config/xfce4/terminal/terminalrc' # Use `grepr` for a recursive, case-insensitive, and filtered grep # alias grepr="grep -RInsi --color=auto --exclude-dir=.git --exclude=tags" # alias grepr='grep -RInsi --color=auto --exclude-dir=.git --exclude-dir=banana_pi_kernel --exclude-dir={bpi_build_scripts, storm_dox, sam_dox} --exclude=tags --exclude=\*.{ko, o}' -alias grepr='grep -RIns --color=auto --exclude-dir=.git --exclude-dir=venv --exclude-dir=node_modules --exclude=tags --exclude-dir=build' +alias grepr='grep -RIns --color=auto --exclude-dir=.git --exclude-dir=venv --exclude-dir=node_modules --exclude=tags --exclude-dir=build --exclude-dir=.idea' alias grepi='grepr -i' alias apt="sudo apt" From 3d44a754a6ad797f4068c4559e16930ae53a251c Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 12:21:39 -0500 Subject: [PATCH 09/28] Change vim scheme to monokai --- fake_home/.vim/colors/monokai.vim | 467 ++++++++++++++++++++++++++++++ fake_home/.vimrc | 9 +- 2 files changed, 473 insertions(+), 3 deletions(-) create mode 100644 fake_home/.vim/colors/monokai.vim diff --git a/fake_home/.vim/colors/monokai.vim b/fake_home/.vim/colors/monokai.vim new file mode 100644 index 0000000..ee5158a --- /dev/null +++ b/fake_home/.vim/colors/monokai.vim @@ -0,0 +1,467 @@ +" File: monokai.vim +" Maintainer: Crusoe Xia (crusoexia) +" URL: https://github.com/crusoexia/vim-monokai +" License: MIT +" +" The colour palette is from http://www.colourlovers.com/ + +" Initialisation +" -------------- + +if !has("gui_running") && &t_Co < 256 + finish +endif + +if ! exists("g:monokai_gui_italic") + let g:monokai_gui_italic = 0 +endif + +if ! exists("g:monokai_term_italic") + let g:monokai_term_italic = 0 +endif + +let g:monokai_termcolors = 256 " does not support 16 color term right now. + +set background=dark +hi clear + +if exists("syntax_on") + syntax reset +endif + +let colors_name = "monokai" + +function! s:h(group, style) + let s:ctermformat = "NONE" + let s:guiformat = "NONE" + if has_key(a:style, "format") + let s:ctermformat = a:style.format + let s:guiformat = a:style.format + endif + if g:monokai_term_italic == 0 + let s:ctermformat = substitute(s:ctermformat, ",italic", "", "") + let s:ctermformat = substitute(s:ctermformat, "italic,", "", "") + let s:ctermformat = substitute(s:ctermformat, "italic", "", "") + endif + if g:monokai_gui_italic == 0 + let s:guiformat = substitute(s:guiformat, ",italic", "", "") + let s:guiformat = substitute(s:guiformat, "italic,", "", "") + let s:guiformat = substitute(s:guiformat, "italic", "", "") + endif + if g:monokai_termcolors == 16 + let l:ctermfg = (has_key(a:style, "fg") ? a:style.fg.cterm16 : "NONE") + let l:ctermbg = (has_key(a:style, "bg") ? a:style.bg.cterm16 : "NONE") + else + let l:ctermfg = (has_key(a:style, "fg") ? a:style.fg.cterm : "NONE") + let l:ctermbg = (has_key(a:style, "bg") ? a:style.bg.cterm : "NONE") + end + execute "highlight" a:group + \ "guifg=" (has_key(a:style, "fg") ? a:style.fg.gui : "NONE") + \ "guibg=" (has_key(a:style, "bg") ? a:style.bg.gui : "NONE") + \ "guisp=" (has_key(a:style, "sp") ? a:style.sp.gui : "NONE") + \ "gui=" (!empty(s:guiformat) ? s:guiformat : "NONE") + \ "ctermfg=" . l:ctermfg + \ "ctermbg=" . l:ctermbg + \ "cterm=" (!empty(s:ctermformat) ? s:ctermformat : "NONE") +endfunction + +" Palettes +" -------- + +let s:white = { "gui": "#E8E8E3", "cterm": "252" } +let s:white2 = { "gui": "#d8d8d3", "cterm": "250" } +let s:black = { "gui": "#272822", "cterm": "234" } +let s:lightblack = { "gui": "#2D2E27", "cterm": "235" } +let s:lightblack2 = { "gui": "#383a3e", "cterm": "236" } +let s:lightblack3 = { "gui": "#3f4145", "cterm": "237" } +let s:darkblack = { "gui": "#211F1C", "cterm": "233" } +let s:grey = { "gui": "#8F908A", "cterm": "243" } +let s:lightgrey = { "gui": "#575b61", "cterm": "237" } +let s:darkgrey = { "gui": "#64645e", "cterm": "239" } +let s:warmgrey = { "gui": "#75715E", "cterm": "59" } + +let s:pink = { "gui": "#F92772", "cterm": "197" } +let s:green = { "gui": "#A6E22D", "cterm": "148" } +let s:aqua = { "gui": "#66d9ef", "cterm": "81" } +let s:yellow = { "gui": "#E6DB74", "cterm": "186" } +let s:orange = { "gui": "#FD9720", "cterm": "208" } +let s:purple = { "gui": "#ae81ff", "cterm": "141" } +let s:red = { "gui": "#e73c50", "cterm": "196" } +let s:purered = { "gui": "#ff0000", "cterm": "52" } +let s:darkred = { "gui": "#5f0000", "cterm": "52" } + +let s:addfg = { "gui": "#d7ffaf", "cterm": "193" } +let s:addbg = { "gui": "#5f875f", "cterm": "65" } +let s:delfg = { "gui": "#ff8b8b", "cterm": "210" } +let s:delbg = { "gui": "#f75f5f", "cterm": "124" } +let s:changefg = { "gui": "#d7d7ff", "cterm": "189" } +let s:changebg = { "gui": "#5f5f87", "cterm": "60" } + +let s:cyan = { "gui": "#A1EFE4" } +let s:br_green = { "gui": "#9EC400" } +let s:br_yellow = { "gui": "#E7C547" } +let s:br_blue = { "gui": "#7AA6DA" } +let s:br_purple = { "gui": "#B77EE0" } +let s:br_cyan = { "gui": "#54CED6" } +let s:br_white = { "gui": "#FFFFFF" } + +" Highlighting +" ------------ + +" editor +call s:h("Normal", { "fg": s:white, "bg": s:black }) +call s:h("ColorColumn", { "bg": s:lightblack }) +call s:h("Cursor", { "fg": s:black, "bg": s:white }) +call s:h("CursorColumn", { "bg": s:lightblack2 }) +call s:h("CursorLine", { "bg": s:lightblack2 }) +call s:h("NonText", { "fg": s:lightgrey }) +call s:h("Visual", { "bg": s:lightgrey }) +call s:h("Search", { "fg": s:black, "bg": s:yellow }) +call s:h("MatchParen", { "fg": s:purple, "format": "underline,bold" }) +call s:h("Question", { "fg": s:yellow }) +call s:h("ModeMsg", { "fg": s:yellow }) +call s:h("MoreMsg", { "fg": s:yellow }) +call s:h("ErrorMsg", { "fg": s:black, "bg": s:red, "format": "standout" }) +call s:h("WarningMsg", { "fg": s:red }) +call s:h("VertSplit", { "fg": s:darkgrey, "bg": s:darkblack }) +call s:h("LineNr", { "fg": s:grey, "bg": s:lightblack }) +call s:h("CursorLineNr", { "fg": s:orange, "bg": s:lightblack }) +call s:h("SignColumn", { "bg": s:lightblack }) + +" statusline +call s:h("StatusLine", { "fg": s:black, "bg": s:lightgrey }) +call s:h("StatusLineNC", { "fg": s:lightgrey, "bg": s:black }) +call s:h("TabLine", { "fg": s:lightgrey, "bg": s:lightblack }) +call s:h("TabLineSel", { "fg": s:darkblack, "bg": s:warmgrey, "format": "bold" }) +call s:h("TabLineFill", { "bg": s:lightblack }) +call s:h("User1", { "fg": s:yellow, "bg": s:lightgrey, "format": "bold" }) +call s:h("User2", { "fg": s:orange, "bg": s:lightgrey, "format": "bold" }) +call s:h("User3", { "fg": s:purple, "bg": s:lightgrey, "format": "bold" }) +call s:h("User4", { "fg": s:aqua, "bg": s:lightgrey, "format": "bold" }) + +" spell +call s:h("SpellBad", { "fg": s:red, "format": "underline" }) +call s:h("SpellCap", { "fg": s:purple, "format": "underline" }) +call s:h("SpellRare", { "fg": s:aqua, "format": "underline" }) +call s:h("SpellLocal", { "fg": s:pink, "format": "underline" }) + +" misc +call s:h("SpecialKey", { "fg": s:pink }) +call s:h("Title", { "fg": s:yellow }) +call s:h("Directory", { "fg": s:aqua }) + +" diff +call s:h("DiffAdd", { "fg": s:addfg, "bg": s:addbg }) +call s:h("DiffDelete", { "fg": s:delfg, "bg": s:delbg }) +call s:h("DiffChange", { "fg": s:changefg, "bg": s:changebg }) +call s:h("DiffText", { "fg": s:black, "bg": s:aqua }) + +" fold +call s:h("Folded", { "fg": s:warmgrey, "bg": s:darkblack }) +call s:h("FoldColumn", { "bg": s:darkblack }) +" Incsearch" + +" popup menu +call s:h("Pmenu", { "fg": s:white2, "bg": s:lightblack3 }) +call s:h("PmenuSel", { "fg": s:aqua, "bg": s:lightblack3, "format": "reverse,bold" }) +call s:h("PmenuThumb", { "fg": s:lightblack, "bg": s:grey }) +" PmenuSbar" + +" Generic Syntax Highlighting +" --------------------------- + +call s:h("Constant", { "fg": s:purple }) +call s:h("Number", { "fg": s:purple }) +call s:h("Float", { "fg": s:purple }) +call s:h("Boolean", { "fg": s:purple }) +call s:h("Character", { "fg": s:yellow }) +call s:h("String", { "fg": s:yellow }) + +call s:h("Type", { "fg": s:aqua }) +call s:h("Structure", { "fg": s:aqua }) +call s:h("StorageClass", { "fg": s:aqua }) +call s:h("Typedef", { "fg": s:aqua }) + +call s:h("Identifier", { "fg": s:green }) +call s:h("Function", { "fg": s:green }) + +call s:h("Statement", { "fg": s:pink }) +call s:h("Operator", { "fg": s:pink }) +call s:h("Label", { "fg": s:pink }) +call s:h("Keyword", { "fg": s:pink }) +" Conditional" +" Repeat" +" Exception" + +call s:h("PreProc", { "fg": s:green }) +call s:h("Include", { "fg": s:pink }) +call s:h("Define", { "fg": s:pink }) +call s:h("Macro", { "fg": s:green }) +call s:h("PreCondit", { "fg": s:green }) + +call s:h("Special", { "fg": s:purple }) +call s:h("SpecialChar", { "fg": s:pink }) +call s:h("Delimiter", { "fg": s:pink }) +call s:h("SpecialComment",{ "fg": s:aqua }) +call s:h("Tag", { "fg": s:pink }) +" Debug" + +call s:h("Todo", { "fg": s:orange, "format": "bold,italic" }) +call s:h("Comment", { "fg": s:warmgrey, "format": "italic" }) + +call s:h("Underlined", { "fg": s:green }) +call s:h("Ignore", {}) +call s:h("Error", { "fg": s:red, "bg": s:darkred }) + +" NerdTree +" -------- + +call s:h("NERDTreeOpenable", { "fg": s:yellow }) +call s:h("NERDTreeClosable", { "fg": s:yellow }) +call s:h("NERDTreeHelp", { "fg": s:yellow }) +call s:h("NERDTreeBookmarksHeader", { "fg": s:pink }) +call s:h("NERDTreeBookmarksLeader", { "fg": s:black }) +call s:h("NERDTreeBookmarkName", { "fg": s:yellow }) +call s:h("NERDTreeCWD", { "fg": s:pink }) +call s:h("NERDTreeUp", { "fg": s:white }) +call s:h("NERDTreeDirSlash", { "fg": s:grey }) +call s:h("NERDTreeDir", { "fg": s:grey }) + +" Syntastic +" --------- + +hi! link SyntasticErrorSign Error +call s:h("SyntasticWarningSign", { "fg": s:lightblack, "bg": s:orange }) + +" coc +" --- + +hi! link CocErrorSign Error +call s:h("CocErrorHighlight", { "fg": s:red, "format": "underline" }) +call s:h("CocErrorFloat", { "fg": s:purered, "bg": s:lightblack3 }) + +call s:h("CocWarningSign", { "fg": s:orange, "bg": s:lightblack }) +call s:h("CocWarningHighlight", { "format": "underline" }) +call s:h("CocWarningFloat", { "fg": s:orange, "bg": s:lightblack3 }) + +call s:h("CocInfoSign", { "fg": s:yellow, "bg": s:lightblack3 }) +call s:h("CocInfoHighlight", { "format": "underline" }) + +call s:h("CocHintSign", { "fg": s:white, "bg": s:lightblack3 }) +call s:h("CocHintHighlight", { "format": "underline" }) + +" Language highlight +" ------------------ + +" Java properties +call s:h("jpropertiesIdentifier", { "fg": s:pink }) + +" Vim command +call s:h("vimCommand", { "fg": s:pink }) + +" Javascript +call s:h("jsClassKeyword", { "fg": s:aqua, "format": "italic" }) +call s:h("jsGlobalObjects", { "fg": s:aqua, "format": "italic" }) +call s:h("jsFuncName", { "fg": s:green }) +call s:h("jsThis", { "fg": s:orange, "format": "italic" }) +call s:h("jsObjectKey", { "fg": s:white }) +call s:h("jsFunctionKey", { "fg": s:green }) +call s:h("jsPrototype", { "fg": s:aqua }) +call s:h("jsExceptions", { "fg": s:aqua }) +call s:h("jsFutureKeys", { "fg": s:aqua }) +call s:h("jsBuiltins", { "fg": s:aqua }) +call s:h("jsStatic", { "fg": s:aqua }) +call s:h("jsSuper", { "fg": s:orange, "format": "italic" }) +call s:h("jsFuncArgRest", { "fg": s:purple, "format": "italic" }) +call s:h("jsFuncArgs", { "fg": s:orange, "format": "italic" }) +call s:h("jsStorageClass", { "fg": s:aqua, "format": "italic" }) +call s:h("jsDocTags", { "fg": s:aqua, "format": "italic" }) +call s:h("jsFunction", { "fg": s:aqua, "format": "italic" }) + +" Typescript +call s:h("typescriptBraces", { "fg": s:white }) +call s:h("typescriptParens", { "fg": s:white }) +call s:h("typescriptOperator", { "fg": s:pink }) +call s:h("typescriptEndColons", { "fg": s:white }) +call s:h("typescriptModule", { "fg": s:aqua }) +call s:h("typescriptPredefinedType", { "fg": s:aqua }) +call s:h("typescriptImport", { "fg": s:pink }) +call s:h("typescriptExport", { "fg": s:pink }) +call s:h("typescriptIdentifier", { "fg": s:orange, "format": "italic" }) +call s:h("typescriptVariable", { "fg": s:aqua }) +call s:h("typescriptCastKeyword", { "fg": s:pink }) +call s:h("typescriptAmbientDeclaration", { "fg": s:pink }) +call s:h("typescriptTestGlobal", { "fg": s:pink }) +call s:h("typescriptFuncKeyword", { "fg": s:aqua }) +call s:h("typescriptFuncTypeArrow", { "fg": s:aqua }) +call s:h("typescriptFuncType", { "fg": s:orange, "format": "italic" }) +call s:h("typescriptFuncName", { "fg": s:green }) +call s:h("typescriptArrowFuncArg", { "fg": s:orange, "format": "italic" }) +call s:h("typescriptCall", { "fg": s:orange, "format": "italic" }) +call s:h("typescriptClassKeyword", { "fg": s:aqua, "format": "italic" }) +call s:h("typescriptClassName", { "fg": s:white }) +call s:h("typescriptClassHeritage", { "fg": s:white }) +call s:h("typescriptInterfaceKeyword", { "fg": s:aqua, "format": "italic" }) +call s:h("typescriptInterfaceName", { "fg": s:white }) +call s:h("typescriptObjectLabel", { "fg": s:green }) +call s:h("typescriptMember", { "fg": s:green }) +call s:h("typescriptTypeReference", { "fg": s:purple, "format": "italic" }) +call s:h("typescriptTypeParameter", { "fg": s:purple, "format": "italic" }) +call s:h("typescriptOptionalMark", { "fg": s:pink }) +call s:h("tsxAttrib", { "fg": s:green }) +call s:h("tsxTagName", { "fg": s:pink }) + +" Dart +call s:h("dartStorageClass", { "fg": s:pink }) +call s:h("dartExceptions", { "fg": s:pink }) +call s:h("dartConditional", { "fg": s:pink }) +call s:h("dartRepeat", { "fg": s:pink }) +call s:h("dartTypedef", { "fg": s:pink }) +call s:h("dartKeyword", { "fg": s:pink }) +call s:h("dartConstant", { "fg": s:purple }) +call s:h("dartBoolean", { "fg": s:purple }) +call s:h("dartCoreType", { "fg": s:aqua }) +call s:h("dartType", { "fg": s:aqua }) + +" HTML +call s:h("htmlTag", { "fg": s:white }) +call s:h("htmlEndTag", { "fg": s:white }) +call s:h("htmlTagName", { "fg": s:pink }) +call s:h("htmlArg", { "fg": s:green }) +call s:h("htmlSpecialChar", { "fg": s:purple }) + +" XML +call s:h("xmlTag", { "fg": s:pink }) +call s:h("xmlEndTag", { "fg": s:pink }) +call s:h("xmlTagName", { "fg": s:orange }) +call s:h("xmlAttrib", { "fg": s:green }) + +" JSX +call s:h("jsxTag", { "fg": s:white }) +call s:h("jsxCloseTag", { "fg": s:white }) +call s:h("jsxCloseString", { "fg": s:white }) +call s:h("jsxPunct", { "fg": s:white }) +call s:h("jsxClosePunct", { "fg": s:white }) +call s:h("jsxTagName", { "fg": s:pink }) +call s:h("jsxComponentName", { "fg": s:pink }) +call s:h("jsxAttrib", { "fg": s:green }) +call s:h("jsxEqual", { "fg": s:white }) +call s:h("jsxBraces", { "fg": s:white }) + +" CSS +call s:h("cssProp", { "fg": s:yellow }) +call s:h("cssUIAttr", { "fg": s:yellow }) +call s:h("cssFunctionName", { "fg": s:aqua }) +call s:h("cssColor", { "fg": s:purple }) +call s:h("cssPseudoClassId", { "fg": s:purple }) +call s:h("cssClassName", { "fg": s:green }) +call s:h("cssValueLength", { "fg": s:purple }) +call s:h("cssCommonAttr", { "fg": s:pink }) +call s:h("cssBraces" , { "fg": s:white }) +call s:h("cssClassNameDot", { "fg": s:pink }) +call s:h("cssURL", { "fg": s:orange, "format": "underline,italic" }) + +" LESS +call s:h("lessVariable", { "fg": s:green }) + +" SASS +call s:h("sassMixing", { "fg": s:aqua }) +call s:h("sassMixin", { "fg": s:aqua }) +call s:h("sassFunctionDecl", { "fg": s:aqua }) +call s:h("sassReturn", { "fg": s:aqua }) +call s:h("sassClass", { "fg": s:green }) +call s:h("sassClassChar", { "fg": s:pink }) +call s:h("sassIdChar", { "fg": s:pink }) +call s:h("sassControl", { "fg": s:aqua }) +call s:h("sassFor", { "fg": s:aqua }) + +" ruby +call s:h("rubyInterpolationDelimiter", {}) +call s:h("rubyInstanceVariable", {}) +call s:h("rubyGlobalVariable", {}) +call s:h("rubyClassVariable", {}) +call s:h("rubyPseudoVariable", {}) +call s:h("rubyFunction", { "fg": s:green }) +call s:h("rubyStringDelimiter", { "fg": s:yellow }) +call s:h("rubyRegexp", { "fg": s:yellow }) +call s:h("rubyRegexpDelimiter", { "fg": s:yellow }) +call s:h("rubySymbol", { "fg": s:purple }) +call s:h("rubyEscape", { "fg": s:purple }) +call s:h("rubyInclude", { "fg": s:pink }) +call s:h("rubyOperator", { "fg": s:pink }) +call s:h("rubyControl", { "fg": s:pink }) +call s:h("rubyClass", { "fg": s:pink }) +call s:h("rubyDefine", { "fg": s:pink }) +call s:h("rubyException", { "fg": s:pink }) +call s:h("rubyRailsARAssociationMethod",{ "fg": s:orange }) +call s:h("rubyRailsARMethod", { "fg": s:orange }) +call s:h("rubyRailsRenderMethod", { "fg": s:orange }) +call s:h("rubyRailsMethod", { "fg": s:orange }) +call s:h("rubyConstant", { "fg": s:aqua }) +call s:h("rubyBlockArgument", { "fg": s:orange }) +call s:h("rubyBlockParameter", { "fg": s:orange }) + +" eruby +call s:h("erubyDelimiter", {}) +call s:h("erubyRailsMethod", { "fg": s:aqua }) + +" c +call s:h("cLabel", { "fg": s:pink }) +call s:h("cStructure", { "fg": s:aqua }) +call s:h("cStorageClass", { "fg": s:pink }) +call s:h("cInclude", { "fg": s:pink }) +call s:h("cDefine", { "fg": s:pink }) +call s:h("cSpecial", { "fg": s:purple }) + +" Markdown +call s:h("markdownCode", { "fg": s:purple, "format": "italic" } ) +call s:h("markdownListMarker", { "fg": s:purple } ) + +" vim-notes +call s:h("notesTitle", { "fg": s:aqua, "format": "bold" } ) +call s:h("notesAtxMarker", { "fg": s:pink, "format": "italic,bold" } ) +call s:h("notesShortHeading", { "fg": s:white, "format": "bold" } ) +call s:h("notesListBullet", { "fg": s:purple } ) +call s:h("notesListNumber", { "fg": s:purple, "format": "italic" } ) +call s:h("notesBold", { "format": "bold" } ) +call s:h("notesDoneMarker", { "fg": s:green } ) + +" Terminal Colors +" --------------- +if has('nvim') + let g:terminal_color_0 = s:black.gui + let g:terminal_color_1 = s:red.gui + let g:terminal_color_2 = s:green.gui + let g:terminal_color_3 = s:yellow.gui + let g:terminal_color_4 = s:aqua.gui + let g:terminal_color_5 = s:purple.gui + let g:terminal_color_6 = s:cyan.gui + let g:terminal_color_7 = s:white.gui + let g:terminal_color_8 = s:darkgrey.gui + let g:terminal_color_9 = s:pink.gui + let g:terminal_color_10 = s:br_green.gui + let g:terminal_color_11 = s:br_yellow.gui + let g:terminal_color_12 = s:br_blue.gui + let g:terminal_color_13 = s:br_purple.gui + let g:terminal_color_14 = s:br_cyan.gui + let g:terminal_color_15 = s:br_white.gui +else + let g:terminal_ansi_colors = [ + \ s:black.gui, + \ s:red.gui, + \ s:green.gui, + \ s:yellow.gui, + \ s:aqua.gui, + \ s:purple.gui, + \ s:cyan.gui, + \ s:white.gui, + \ s:darkgrey.gui, + \ s:pink.gui, + \ s:br_green.gui, + \ s:br_yellow.gui, + \ s:br_blue.gui, + \ s:br_purple.gui, + \ s:br_cyan.gui, + \ s:br_white.gui] +endif + diff --git a/fake_home/.vimrc b/fake_home/.vimrc index e3f66d2..e8b69a9 100644 --- a/fake_home/.vimrc +++ b/fake_home/.vimrc @@ -19,10 +19,10 @@ else let &t_8b = "\[48:2:%lu:%lu:%lum" syntax enable - colorscheme jellybeans + colorscheme monokai endif -let mapleader=" " +" let mapleader=" " "nnoremap w yiwq:PIe `~/.shell_aliases ws "nnoremap w yiw:let srr_back = &srr set srr=>q:PIr! /home/sage/.shell_aliases wf " TODO Check if file needs saving @@ -177,6 +177,9 @@ iab reteun return iab reutner return " Keep same gutter color when errored -highlight! link SignColumn LineNr +" highlight! link SignColumn LineNr + +" Include hyphens in words +set iskeyword+=- so ~/.vim/user/files.vim From 214da3ea55608f2f0c7b502ba646063c6cab0f75 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 12:22:03 -0500 Subject: [PATCH 10/28] Re-order and cleanup starship --- fake_home/.config/starship.toml | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/fake_home/.config/starship.toml b/fake_home/.config/starship.toml index 504031d..6815efa 100644 --- a/fake_home/.config/starship.toml +++ b/fake_home/.config/starship.toml @@ -6,6 +6,12 @@ $hostname\ $shlvl\ $kubernetes\ $directory\ +$git_branch\ +$git_commit\ +$git_state\ +$git_metrics\ +$git_status\ +$hg_branch\ $vcsh\ $java\ $nodejs\ @@ -34,12 +40,6 @@ $terraform\ $vlang\ $vagrant\ $zig\ -$git_branch\ -$git_commit\ -$git_state\ -$git_metrics\ -$git_status\ -$hg_branch\ $docker_context\ $cmake\ $nix_shell\ @@ -92,3 +92,17 @@ discharging_symbol = " " # threshold = 100 # style = "green" # discharging_symbol = " " + +# [git_branch] +# format = "\n on [$symbol$branch(:$remote_branch)]($style) " + +[directory.substitutions] +'~/git/' = '' + +# [custom.in-project-dir] +# command = '/home/sagevaillancourt/.in_project_dir.sh' +# when = true +# style = 'bold red' + +[dotnet] +format = 'via [$symbol($version) (◎ $tfm )]($style)' From 60e1947b345ada9e39e165f4c9588a47c5ea81fb Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 12:23:16 -0500 Subject: [PATCH 11/28] Tweak zsh_local sourcing and add some syntax highlighting --- fake_home/.zshrc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fake_home/.zshrc b/fake_home/.zshrc index 7c39b7c..0e9301f 100644 --- a/fake_home/.zshrc +++ b/fake_home/.zshrc @@ -1,4 +1,3 @@ -source ~/.zsh_local if test -f /usr/share/doc/fzf/examples/completion.zsh &> /dev/null; then source /usr/share/doc/fzf/examples/completion.zsh fi @@ -38,7 +37,7 @@ if [ -x /usr/bin/dircolors ]; then alias egrep='egrep --color=auto' fi -export PATH=./:~/.bin:$HOME/.dotnet:$HOME/.platformio/penv/bin:/usr/local/go/bin:$PATH +export PATH=~/.bin:$HOME/.dotnet:~/.local/bin:/usr/local/go/bin:$PATH fignore=(o) @@ -91,7 +90,10 @@ if test -f ~/.cargo/env; then fi source ~/.shell_aliases +source ~/.zsh_local export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion + +test -f /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh source && /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh From 2d4e7178daf0fd8aa7a647b06281d6061cd1f778 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 12:23:31 -0500 Subject: [PATCH 12/28] Change default xfce4-terminal font-size to 10 --- fake_home/.config/xfce4/terminal/terminalrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fake_home/.config/xfce4/terminal/terminalrc b/fake_home/.config/xfce4/terminal/terminalrc index da24c57..528baf9 100644 --- a/fake_home/.config/xfce4/terminal/terminalrc +++ b/fake_home/.config/xfce4/terminal/terminalrc @@ -33,7 +33,7 @@ ScrollingBar=TERMINAL_SCROLLBAR_NONE BackgroundImageFile=/home/sage/Pictures/ballpapers/wallhaven-r7vxk1.jpg BackgroundImageShading=0.790000 BackgroundImageStyle=TERMINAL_BACKGROUND_STYLE_CENTERED -FontName=FiraCode Nerd Font weight=450 14 +FontName=FiraCode Nerd Font 10 ColorCursor=#f8f8f2 ColorBold=#f8f8f2 ColorBoldUseDefault=FALSE From 2ec5a546718a557d029a1cb4441b31e8ef0e15fb Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 12:24:21 -0500 Subject: [PATCH 13/28] sofi improvements --- .idea/.dotfiles.iml | 8 ++- fake_home/.sofi-preview.sh | 58 ++++++++++++++++++ fake_home/.sofi.sh | 118 +++++++++++++++++++++++++++++++++---- 3 files changed, 169 insertions(+), 15 deletions(-) create mode 100755 fake_home/.sofi-preview.sh diff --git a/.idea/.dotfiles.iml b/.idea/.dotfiles.iml index bc2cd87..da80146 100644 --- a/.idea/.dotfiles.iml +++ b/.idea/.dotfiles.iml @@ -1,8 +1,12 @@ - - + + + + + \ No newline at end of file diff --git a/fake_home/.sofi-preview.sh b/fake_home/.sofi-preview.sh new file mode 100755 index 0000000..b26cde4 --- /dev/null +++ b/fake_home/.sofi-preview.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +choice="$1" +query_string="$2" +arg="$(echo "$choice" | cut -c 5-)" +arg="${arg/#\~/$HOME}" + +case $choice in + git*) + tree -L 1 $arg + exit 0 + ;; + win*) + echo $choice + exit 0 + ;; + app*) + echo $choice + exit 0 + ;; + emj*) + echo $choice + exit 0 + ;; + fil*) + echo $choice + exit 0 + ;; + mvr*) + groupId="$(echo "$arg" | sed 's/\(.*\):.*/\1/')" + artifactId="$(echo "$arg" | sed 's/.*:\(.*\) .*/\1/')" + latestVersion="$(echo "$arg" | sed 's/.* \(.*\)/\1/')" + echo "" + echo " $groupId" + echo " $artifactId" + echo " $latestVersion" + echo "" + exit 0 + ;; + + *) + qarg="$(echo "$query_string" | cut -c 5-)" + qarg="${qarg/#\~/$HOME}" + case $query_string in + mvn*) + curl -s "https://search.maven.org/solrsearch/select?q=$qarg&rows=5&wt=json" | jq '[.response.docs[] | { g, a, latestVersion, timestamp } ]' 2>/dev/null + ;; + npm*) + NVM_DIR="$HOME/.nvm" + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm + [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion + npm search $qarg | tail -n +2 + ;; + esac + ;; +esac + + diff --git a/fake_home/.sofi.sh b/fake_home/.sofi.sh index e884a28..b1e09d4 100755 --- a/fake_home/.sofi.sh +++ b/fake_home/.sofi.sh @@ -10,13 +10,28 @@ FILE_LOCATIONS="$HOME/Documents $HOME/Downloads" ! [[ "$XDG_SESSION_TYPE" = "x11" ]] IS_X11="$?" +sofi_id() { + gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/Windows --method org.gnome.Shell.Extensions.Windows.List | cut -c 3- | rev | cut -c4- | rev | jq '.[] | .id' | while read id; do + if gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/Windows --method org.gnome.Shell.Extensions.Windows.GetTitle $id | grep "SOFI" &> /dev/null; then + echo $id + fi + done +} + # Open search window or raise existing one if [[ "$1" == "--launch" ]]; then if (($IS_X11)) && existing="$(xdotool search $WINDOW_NAME)"; then xdotool windowraise "$existing" else # xfce4-terminal --role="$WINDOW_NAME" --title="$WINDOW_NAME" --startup-id="$WINDOW_NAME" -e "bash -c '$HOME/.sofi.sh'" - xterm -fa 'Monospaced' -fs 10 -e "bash -c '$HOME/.sofi.sh'" + + + id="$(sofi_id)" + if [[ "$id" != "" ]]; then + gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/Windows --method org.gnome.Shell.Extensions.Windows.Activate $id + else + xterm -geometry 120x40 -fa 'Monospaced' -fs 10 -T "SOFI" -e "bash -c '$HOME/.sofi.sh'" + fi # st -e bash -c '$HOME/.sofi.sh'" fi exit $? @@ -24,14 +39,17 @@ fi windows() { if ! (($IS_X11)); then - return + gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/Windows --method org.gnome.Shell.Extensions.Windows.List | cut -c 3- | rev | cut -c4- | rev | jq '.[] | .id' | while read id; do + echo "win" "$(gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/Windows --method org.gnome.Shell.Extensions.Windows.GetTitle $id | cut -c 3- | rev | cut -c4- | rev)" "|" $id + done + else + xprop -root _NET_CLIENT_LIST | + pcregrep -o1 '# (.*)' | + sed 's/, /\n/g' | + xargs -I {} -n1 xprop -id {} _NET_WM_NAME | + grep -v '"Desktop"\|"xfce4-panel"' | + sed 's/_NET_WM_NAME(UTF8_STRING) = "/win /' | sed 's/"$//' fi - xprop -root _NET_CLIENT_LIST | - pcregrep -o1 '# (.*)' | - sed 's/, /\n/g' | - xargs -I {} -n1 xprop -id {} _NET_WM_NAME | - grep -v '"Desktop"\|"xfce4-panel"' | - sed 's/_NET_WM_NAME(UTF8_STRING) = "/win /' | sed 's/"$//' } read_apps() { @@ -42,6 +60,10 @@ read_apps() { sed 's/Name=/app /' > "$CACHE_FILE" & } +read_snap_apps() { + snap list | tail -n +2 | awk '{print "snp " $1}' +} + open_app() { app="$(echo "$1" | cut -c 5-)" # shellcheck disable=SC2086 @@ -69,6 +91,7 @@ if [[ "$1" == "--print-only" ]]; then <(windows) \ <($HOME/.rofi-list-git-repos.py --no-icon) \ <(read_apps) \ + <(read_snap_apps) \ <(list_files) \ $HOME/.emojis exit 1 @@ -78,28 +101,97 @@ choice="$(cat \ <(windows) \ <("$HOME/.rofi-list-git-repos.py") \ <(read_apps) \ + <(read_snap_apps) \ <(list_files) \ "$HOME/.emojis" \ - | fzf)" + | fzf --print-query --preview="$HOME/.sofi-preview.sh {} {q}")" +echo +qstring="$(echo "$choice" | head -n 1)" +choice="$(echo "$choice" | tail -n 1)" + +mvn_handler() { + qarg="$(echo "$1" | cut -c 5-)" + row_count=10 + arr_result="$(curl -s "https://search.maven.org/solrsearch/select?q=$qarg&rows=$row_count&wt=json" | jq '[.response.docs[] | { g, a, latestVersion } ]')" + + for i in 0 1 2 3 4 5 6 7 8 9; do + groupId="$(echo -n "$arr_result" | jq -r ".[$i].g")" + artifactId="$(echo -n "$arr_result" | jq -r ".[$i].a")" + latestVersion="$(echo -n "$arr_result" | jq -r ".[$i].latestVersion")" + echo "mvr $groupId:$artifactId $latestVersion" + done | fzf --print-query --preview="$HOME/.sofi-preview.sh {} {q}" +} + +npm_handler() { + qarg="$(echo "$1" | cut -c 5-)" + NVM_DIR="$HOME/.nvm" + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm + [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion + package="$(npm search $qarg | tail -n +2 | fzf | sed 's/ .*//')" + setsid xdg-open "https://npmjs.com/package/$package" &> /dev/null & +} case $choice in git*) setsid "$HOME/.rofi-list-git-repos.py" "$choice" &> /dev/null & ;; win*) - wmctrl -i -R "$(xwininfo -root -tree | - grep "$(echo "$choice" | cut -c 5-)" | - awk '{ print $1 }' | - sed 's/0x/0x00/')" + if (($IS_X11)); then + wmctrl -i -R "$(xwininfo -root -tree | + grep "$(echo "$choice" | cut -c 5-)" | + awk '{ print $1 }' | + sed 's/0x/0x00/')" + else + gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/Windows --method org.gnome.Shell.Extensions.Windows.Activate "$(echo "$choice" | sed 's/.* \([0-9]\+\)$/\1/')" + fi ;; app*) open_app "$choice" ;; + snp*) + app="$(echo "$choice" | cut -c 5-)" + setsid $app >/dev/null 2>&1 /dev/null & ;; + + *) + case $qstring in + mvn*) + lib="$(mvn_handler "$qstring")" + lib="$(echo "$lib" | cut -c 5-)" + groupId="$(echo -n "${lib//[$'\t\r\n']}" | sed 's/\(.*\):.*/\1/')" + artifactId="$(echo -n "${lib//[$'\t\r\n']}" | sed 's/.*:\(.*\) .*/\1/')" + latestVersion="$(echo -n "${lib//[$'\t\r\n']}" | sed 's/.* \(.*\)/\1/')" + + xml="$(cat < + ${groupId} + ${artifactId} + ${latestVersion} + +EOF +)" + if (($IS_X11)); then + nohup xclip -selection clipboard <(echo -n "$xml") &> /dev/null & + else + wl-copy "$xml" + fi + echo "Copied to clipboard!" + sleep 0.5 + ;; + + npm*) + lib="$(npm_handler "$qstring")" + lib="$(echo "$lib" | cut -c 5-)" + ;; + + esac + ;; esac + sleep 0.1 From 29ad3e9ed69581be9e131e25330468aaf28698c1 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 12:26:39 -0500 Subject: [PATCH 14/28] Hide 'not found' win message --- fake_home/.sofi.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fake_home/.sofi.sh b/fake_home/.sofi.sh index b1e09d4..a63923c 100755 --- a/fake_home/.sofi.sh +++ b/fake_home/.sofi.sh @@ -48,7 +48,9 @@ windows() { sed 's/, /\n/g' | xargs -I {} -n1 xprop -id {} _NET_WM_NAME | grep -v '"Desktop"\|"xfce4-panel"' | - sed 's/_NET_WM_NAME(UTF8_STRING) = "/win /' | sed 's/"$//' + sed 's/_NET_WM_NAME(UTF8_STRING) = "/win /' | + sed 's/"$//' | + grep -v 'not found' fi } From 12ed01fb9697f14a24fde45d561a42e4b71d3cf1 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 13:39:18 -0500 Subject: [PATCH 15/28] Fix syntax source Terminal font size -> 11 --- fake_home/.config/xfce4/terminal/terminalrc | 2 +- fake_home/.zshrc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fake_home/.config/xfce4/terminal/terminalrc b/fake_home/.config/xfce4/terminal/terminalrc index 528baf9..ffefe3f 100644 --- a/fake_home/.config/xfce4/terminal/terminalrc +++ b/fake_home/.config/xfce4/terminal/terminalrc @@ -33,7 +33,7 @@ ScrollingBar=TERMINAL_SCROLLBAR_NONE BackgroundImageFile=/home/sage/Pictures/ballpapers/wallhaven-r7vxk1.jpg BackgroundImageShading=0.790000 BackgroundImageStyle=TERMINAL_BACKGROUND_STYLE_CENTERED -FontName=FiraCode Nerd Font 10 +FontName=FiraCode Nerd Font 11 ColorCursor=#f8f8f2 ColorBold=#f8f8f2 ColorBoldUseDefault=FALSE diff --git a/fake_home/.zshrc b/fake_home/.zshrc index 0e9301f..792cd5b 100644 --- a/fake_home/.zshrc +++ b/fake_home/.zshrc @@ -96,4 +96,4 @@ export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion -test -f /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh source && /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +test -f /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh && source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh From a2117e97be9796bb473072a12f8a50ae6d63d208 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 13:42:44 -0500 Subject: [PATCH 16/28] Merge --- fake_home/.gitconfig | 2 ++ fake_home/.rofi-list-git-repos.py | 8 ++++++-- fake_home/.shell_aliases | 7 +++++++ fake_home/.vimrc | 2 +- fake_home/.zshrc | 4 ++-- 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/fake_home/.gitconfig b/fake_home/.gitconfig index 3515826..16089ec 100644 --- a/fake_home/.gitconfig +++ b/fake_home/.gitconfig @@ -28,3 +28,5 @@ rebase = false [protocol "file"] allow = always +[safe] + directory = /var/lib/gitea/custom diff --git a/fake_home/.rofi-list-git-repos.py b/fake_home/.rofi-list-git-repos.py index bb25b60..fd77977 100755 --- a/fake_home/.rofi-list-git-repos.py +++ b/fake_home/.rofi-list-git-repos.py @@ -80,13 +80,17 @@ def print_project_message(project: str) -> (): if __name__ == '__main__': - if len(sys.argv) == 1: + include_icon = sys.argv[1] != "--no-icon" if len(sys.argv) > 1 else True + if len(sys.argv) == 1 or not include_icon: for git_dir in git_dirs: if not os.path.isdir(git_dir): continue for project in os.listdir(git_dir): project = f'{git_dir}/{project}' if os.path.isdir(project): - print_project_message(project) + if include_icon: + print_project_message(project) + else: + print(f'git {project}') else: open_project(sys.argv[1][4:]) diff --git a/fake_home/.shell_aliases b/fake_home/.shell_aliases index 8be6707..ec07d22 100755 --- a/fake_home/.shell_aliases +++ b/fake_home/.shell_aliases @@ -10,6 +10,13 @@ function hearch { alias hsearch='hearch' +alias caddyfile="sudo vim /etc/caddy/Caddyfile" +alias cf="sudo vim /etc/caddy/Caddyfile" + +function download-channel { + ~/Downloads/yt-dlp "$1" --format 'bestvideo[height=1080]+bestaudio/best' --download-archive archive.txt --output '%(uploader)s/%(upload_date)s.%(title)s.%(id)s.%(ext)s' --restrict-filenames --merge-output-format mkv --ignore-errors +} + function fin { find -iname "*$@*" } diff --git a/fake_home/.vimrc b/fake_home/.vimrc index e8b69a9..94c76b6 100644 --- a/fake_home/.vimrc +++ b/fake_home/.vimrc @@ -11,7 +11,7 @@ set tags=./tags;/ " Search up to / for tags file set updatetime=100 set clipboard=unnamedplus " Use system clipboard -if empty($DISPLAY) +if empty($DISPLAY) && empty($SSH_CONNECTION) colorscheme elflord else set termguicolors diff --git a/fake_home/.zshrc b/fake_home/.zshrc index a8914cd..9413d13 100644 --- a/fake_home/.zshrc +++ b/fake_home/.zshrc @@ -3,8 +3,7 @@ if test -f /usr/share/doc/fzf/examples/completion.zsh &> /dev/null; then fi HISTFILE=~/.histfile -HISTSIZE=10000 -SAVEHIST=10000 +HISTSIZE=SAVEHIST=100000 setopt appendhistory autocd notify setopt menu_complete unsetopt beep @@ -97,3 +96,4 @@ export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +test -f "$HOME/.asdf/asdf.sh" && . "$HOME/.asdf/asdf.sh" From cd0357d2fc4b8dbe880d13b3cb5e6819292fd971 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 13:48:46 -0500 Subject: [PATCH 17/28] Remove config.rasi --- fake_home/.config/rofi/config.rasi | 50 ------------------------------ 1 file changed, 50 deletions(-) delete mode 100644 fake_home/.config/rofi/config.rasi diff --git a/fake_home/.config/rofi/config.rasi b/fake_home/.config/rofi/config.rasi deleted file mode 100644 index 60b6c06..0000000 --- a/fake_home/.config/rofi/config.rasi +++ /dev/null @@ -1,50 +0,0 @@ -configuration { - sort: true; - show-icons: true; - drun { - display-name: ""; - } - emoji { - display-name: ""; - } - window { - display-name: ""; - } - projects { - display-name: ""; - } - suspend { - display-name: ""; - } - tabs { - display-name: ""; - fallback-icon: "firefox-beta"; - } - history { - display-name: ""; - fallback-icon: "firefox-beta"; - } - modes: [ combi, "mvn:/home/sagevaillancourt/.rofi-mvn-search.py" ]; - combi-modes: [ - window, - drun, - emoji, - "mvn:/home/sagevaillancourt/.rofi-mvn-search.py", - "tabs:/home/sagevaillancourt/.rofi-tabs.sh", - // "history:/home/sage/.rofi-history-search.sh", - "projects:/home/sagevaillancourt/.rofi-list-git-repos.py", - "suspend:/home/sagevaillancourt/.rofi-suspend.sh" - ]; -} - -//@theme "/usr/share/rofi/themes/gruvbox-dark-hard.rasi" -//@theme "/usr/share/rofi/themes/Arc-Dark.rasi" -@theme "/usr/local/share/rofi/themes/android_notification.rasi" - -textbox-prompt-sep { - str: ">"; -} - -// inputbar { -// children: [ "textbox-prompt-sep","entry","case-indicator" ]; -// } From 997187559744b0f27b3c1c8c2f99d48e8832bf95 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 13:53:02 -0500 Subject: [PATCH 18/28] Fix incomplete merge in shell aliases --- fake_home/.shell_aliases | 3 --- 1 file changed, 3 deletions(-) diff --git a/fake_home/.shell_aliases b/fake_home/.shell_aliases index 7abe2fd..ecd2d20 100755 --- a/fake_home/.shell_aliases +++ b/fake_home/.shell_aliases @@ -47,12 +47,9 @@ function ww { ws $(rg --no-line-number --no-filename . ~/wiki | sed 's/[^a-zA-Z0-9]\+/\n/g' | grep -v "^$" | sort -f | uniq -ci | sort -hr | fzf -i | cut -c 9-) } -<<<<<<< HEAD -======= if command -v bat; then alias cat="bat -p" fi ->>>>>>> 12ed01fb9697f14a24fde45d561a42e4b71d3cf1 export FZF_DEFAULT_COMMAND='fd --type f' alias fzf="fzf --preview 'bat --style=numbers --color=always {}'" From a4a03ebd0fb53b46b9a67ac4a60d1ab8b2fbea0e Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 14:00:47 -0500 Subject: [PATCH 19/28] Fix problematic zsh_local ordering --- copy.sh | 4 ++-- fake_home/.zshrc | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/copy.sh b/copy.sh index 745b0db..6cc5c6c 100755 --- a/copy.sh +++ b/copy.sh @@ -73,8 +73,8 @@ fi echo -n "starship is " if ! command -v starship &> /dev/null; then echo "not installed. Installing..." -curl -sS https://starship.rs/install.sh | sh -echo "Starship requires an NFont: https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/FiraCode.zip" + curl -sS https://starship.rs/install.sh | sh + echo "Starship requires an NFont: https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/FiraCode.zip" else echo "already installed." fi diff --git a/fake_home/.zshrc b/fake_home/.zshrc index 38f0111..4d6640f 100644 --- a/fake_home/.zshrc +++ b/fake_home/.zshrc @@ -80,6 +80,9 @@ function getdot { cd - } +source ~/.shell_aliases +source ~/.zsh_local + if which starship &> /dev/null; then eval "$(starship init zsh)" fi @@ -88,9 +91,6 @@ if test -f ~/.cargo/env; then source ~/.cargo/env fi -source ~/.shell_aliases -source ~/.zsh_local - export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion From 801d44ca919159967f99940f5c4c64330456c2a0 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 14:18:08 -0500 Subject: [PATCH 20/28] Add custom username handler to starship Also add a .gitignore --- .gitignore | 2 ++ fake_home/.config/starship.toml | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7f993be --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea/ +*.swp diff --git a/fake_home/.config/starship.toml b/fake_home/.config/starship.toml index 6815efa..9d1fa2c 100644 --- a/fake_home/.config/starship.toml +++ b/fake_home/.config/starship.toml @@ -1,7 +1,6 @@ add_newline = true format = """ -[\\[sage\\]](bold red) \ -$username\ +${custom.username}\ $hostname\ $shlvl\ $kubernetes\ @@ -50,7 +49,6 @@ $gcloud\ $openstack\ $env_var\ $crystal\ -$custom\ $line_break\ $lua\ $jobs\ @@ -106,3 +104,8 @@ discharging_symbol = " " [dotnet] format = 'via [$symbol($version) (◎ $tfm )]($style)' + +[custom.username] +command = 'echo "[$(whoami | sed "s/vaillancourt//")]"' +when = true +style = 'bold red' From 94ffef797db76302e1b5c1341455f1240579b6b0 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 14:31:07 -0500 Subject: [PATCH 21/28] Explicit git status and cleaner hostname styling --- fake_home/.config/starship.toml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/fake_home/.config/starship.toml b/fake_home/.config/starship.toml index 9d1fa2c..2138f06 100644 --- a/fake_home/.config/starship.toml +++ b/fake_home/.config/starship.toml @@ -1,5 +1,6 @@ add_newline = true format = """ +$git_status\ ${custom.username}\ $hostname\ $shlvl\ @@ -9,7 +10,6 @@ $git_branch\ $git_commit\ $git_state\ $git_metrics\ -$git_status\ $hg_branch\ $vcsh\ $java\ @@ -109,3 +109,21 @@ format = 'via [$symbol($version) (◎ $tfm )]($style)' command = 'echo "[$(whoami | sed "s/vaillancourt//")]"' when = true style = 'bold red' + +[hostname] +ssh_symbol = '🌐' +format = '[$ssh_symbol](bold blue) [$hostname](bold dimmed green) ' + +[git_status] +conflicted = "=conflicted " +ahead = "⇡ahead " +behind = "⇣behind " +diverged = "⇕diverged " +untracked = "?untracked " +stashed = "\\$stashed " +modified = "!modified " +staged = "[++($count)](green)" +renamed = "»renamed " +deleted = "✘deleted " +format = "[$all_status]($style)\n" +style = 'red dimmed' From b8f38ee429a65ac795935e9a11222c802cb20d53 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 15:00:04 -0500 Subject: [PATCH 22/28] Add stv and ishelp to shell_aliases Fix pushdot and getdot functions --- fake_home/.shell_aliases | 18 ++++++++++++++++++ fake_home/.zshrc | 6 ++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/fake_home/.shell_aliases b/fake_home/.shell_aliases index ecd2d20..3fe6e92 100755 --- a/fake_home/.shell_aliases +++ b/fake_home/.shell_aliases @@ -1,5 +1,23 @@ #!/bin/bash +function ishelp { + [[ "$1" == "help" ]] || [[ "$1" == "-h" ]] || [[ "$1" == "--help" ]] +} + +function stv { + local stash=0 + if ishelp $1; then + echo "Show the diff for the given stash. Default to 0" + return + fi + if [[ "${1:0:1}" == "^" ]]; then + stash=${#1} + elif [[ "$1" != "" ]]; then + stash="$1" + fi + git stash show -p stash@{$stash} +} + function hearch { history 0 | sed 's/[0-9 ]*//' | grep "$@" } diff --git a/fake_home/.zshrc b/fake_home/.zshrc index 4d6640f..990b271 100644 --- a/fake_home/.zshrc +++ b/fake_home/.zshrc @@ -1,3 +1,5 @@ +export SCRIPT_DIR="${0:A:h}" + if test -f /usr/share/doc/fzf/examples/completion.zsh &> /dev/null; then source /usr/share/doc/fzf/examples/completion.zsh fi @@ -65,7 +67,7 @@ if [ "$TERM" = "linux" ]; then fi function pushdot { - cd ~/.dotfiles && + cd "$SCRIPT_DIR" || return 1 if [ $# -eq 0 ]; then git commit -a && git push -u origin master & else @@ -75,7 +77,7 @@ function pushdot { } function getdot { - cd ~/.dotfiles && + cd "$SCRIPT_DIR" || return 1 git pull cd - } From e6a24f177ca543820d40ddb63a10d7cba95e4676 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 15:01:00 -0500 Subject: [PATCH 23/28] Use main as branch name --- fake_home/.zshrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fake_home/.zshrc b/fake_home/.zshrc index 990b271..30167ee 100644 --- a/fake_home/.zshrc +++ b/fake_home/.zshrc @@ -69,9 +69,9 @@ fi function pushdot { cd "$SCRIPT_DIR" || return 1 if [ $# -eq 0 ]; then - git commit -a && git push -u origin master & + git commit -a && git push -u origin main & else - git commit -a -m "$1" && git push -u origin master | /dev/null & + git commit -a -m "$1" && git push -u origin main | /dev/null & fi cd - } From 74a178045e24e4c21f3605284d249bc8bab18912 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 15:09:02 -0500 Subject: [PATCH 24/28] Use copy.sh-injected DOT_DIR instead of SCRIPT_DIR --- copy.sh | 5 ++++- fake_home/.zshrc | 12 +++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/copy.sh b/copy.sh index 6cc5c6c..d99dea7 100755 --- a/copy.sh +++ b/copy.sh @@ -23,7 +23,10 @@ echo "$dotfiles" | while read -r dotfile; do ln -sf "$dotfile" "$new" done -touch "$HOME/.zsh_local" +if ! grep DOT_DIR $HOME/.zsh_local; then + echo "export DOT_DIR=\"$SCRIPT_DIR\"" >> $HOME/.zsh_local +fi + if [[ "$1" == "--files-only" ]]; then exit 0 fi diff --git a/fake_home/.zshrc b/fake_home/.zshrc index 30167ee..d3aad88 100644 --- a/fake_home/.zshrc +++ b/fake_home/.zshrc @@ -1,5 +1,3 @@ -export SCRIPT_DIR="${0:A:h}" - if test -f /usr/share/doc/fzf/examples/completion.zsh &> /dev/null; then source /usr/share/doc/fzf/examples/completion.zsh fi @@ -66,8 +64,11 @@ if [ "$TERM" = "linux" ]; then SetTtyColors fi +source ~/.shell_aliases +source ~/.zsh_local + function pushdot { - cd "$SCRIPT_DIR" || return 1 + cd "$DOT_DIR" || return 1 if [ $# -eq 0 ]; then git commit -a && git push -u origin main & else @@ -77,14 +78,11 @@ function pushdot { } function getdot { - cd "$SCRIPT_DIR" || return 1 + cd "$DOT_DIR" || return 1 git pull cd - } -source ~/.shell_aliases -source ~/.zsh_local - if which starship &> /dev/null; then eval "$(starship init zsh)" fi From 06fad42045d437df4dfd959bb8cbf43ea333534f Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 16:04:46 -0500 Subject: [PATCH 25/28] No xfce4-terminal borders Hide bat check message --- fake_home/.config/xfce4/terminal/terminalrc | 2 +- fake_home/.shell_aliases | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fake_home/.config/xfce4/terminal/terminalrc b/fake_home/.config/xfce4/terminal/terminalrc index e697d7a..39dc60f 100644 --- a/fake_home/.config/xfce4/terminal/terminalrc +++ b/fake_home/.config/xfce4/terminal/terminalrc @@ -1,7 +1,7 @@ [Configuration] MiscAlwaysShowTabs=FALSE MiscBell=FALSE -MiscBordersDefault=TRUE +MiscBordersDefault=FALSE MiscCursorBlinks=FALSE MiscCursorShape=TERMINAL_CURSOR_SHAPE_BLOCK MiscDefaultGeometry=80x24 diff --git a/fake_home/.shell_aliases b/fake_home/.shell_aliases index 3fe6e92..50778a0 100755 --- a/fake_home/.shell_aliases +++ b/fake_home/.shell_aliases @@ -65,7 +65,7 @@ function ww { ws $(rg --no-line-number --no-filename . ~/wiki | sed 's/[^a-zA-Z0-9]\+/\n/g' | grep -v "^$" | sort -f | uniq -ci | sort -hr | fzf -i | cut -c 9-) } -if command -v bat; then +if command -v bat &> /dev/null; then alias cat="bat -p" fi export FZF_DEFAULT_COMMAND='fd --type f' From a7d7e9d9b8886c0981d55161b6163603a6ce1859 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 16:05:37 -0500 Subject: [PATCH 26/28] Don't background pushdot --- fake_home/.zshrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fake_home/.zshrc b/fake_home/.zshrc index d3aad88..cf90898 100644 --- a/fake_home/.zshrc +++ b/fake_home/.zshrc @@ -70,9 +70,9 @@ source ~/.zsh_local function pushdot { cd "$DOT_DIR" || return 1 if [ $# -eq 0 ]; then - git commit -a && git push -u origin main & + git commit -a && git push -u origin main else - git commit -a -m "$1" && git push -u origin main | /dev/null & + git commit -a -m "$1" && git push -u origin main fi cd - } From cb46ae470483b3a6b926c71373797c4bf032a95e Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 16:06:02 -0500 Subject: [PATCH 27/28] Add term menubar back --- fake_home/.config/xfce4/terminal/terminalrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fake_home/.config/xfce4/terminal/terminalrc b/fake_home/.config/xfce4/terminal/terminalrc index 39dc60f..cc00249 100644 --- a/fake_home/.config/xfce4/terminal/terminalrc +++ b/fake_home/.config/xfce4/terminal/terminalrc @@ -6,7 +6,7 @@ MiscCursorBlinks=FALSE MiscCursorShape=TERMINAL_CURSOR_SHAPE_BLOCK MiscDefaultGeometry=80x24 MiscInheritGeometry=FALSE -MiscMenubarDefault=FALSE +MiscMenubarDefault=TRUE MiscMouseAutohide=FALSE MiscToolbarDefault=FALSE MiscConfirmClose=TRUE From bb2dd4c1f159ce01de7b60b1242a9794f4ed7b12 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 13 Dec 2023 16:07:28 -0500 Subject: [PATCH 28/28] Hide menubar, show border Multi-arg pushdot messages --- fake_home/.config/xfce4/terminal/terminalrc | 4 ++-- fake_home/.zshrc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fake_home/.config/xfce4/terminal/terminalrc b/fake_home/.config/xfce4/terminal/terminalrc index cc00249..e697d7a 100644 --- a/fake_home/.config/xfce4/terminal/terminalrc +++ b/fake_home/.config/xfce4/terminal/terminalrc @@ -1,12 +1,12 @@ [Configuration] MiscAlwaysShowTabs=FALSE MiscBell=FALSE -MiscBordersDefault=FALSE +MiscBordersDefault=TRUE MiscCursorBlinks=FALSE MiscCursorShape=TERMINAL_CURSOR_SHAPE_BLOCK MiscDefaultGeometry=80x24 MiscInheritGeometry=FALSE -MiscMenubarDefault=TRUE +MiscMenubarDefault=FALSE MiscMouseAutohide=FALSE MiscToolbarDefault=FALSE MiscConfirmClose=TRUE diff --git a/fake_home/.zshrc b/fake_home/.zshrc index cf90898..540c1f9 100644 --- a/fake_home/.zshrc +++ b/fake_home/.zshrc @@ -72,7 +72,7 @@ function pushdot { if [ $# -eq 0 ]; then git commit -a && git push -u origin main else - git commit -a -m "$1" && git push -u origin main + git commit -a -m "$@" && git push -u origin main fi cd - }