diff options
| -rw-r--r-- | .config/clangd/config.yaml | 4 | ||||
| -rw-r--r-- | .config/gdb/gdbinit | 15 | ||||
| -rw-r--r-- | .config/gdb/gdbinit.py | 55 | ||||
| -rw-r--r-- | .config/git/config##template | 12 | ||||
| -rw-r--r-- | .config/nvim/color-tweaks.vim | 1 | ||||
| -rw-r--r-- | .config/nvim/init.vim | 83 | ||||
| -rw-r--r-- | .config/picom.conf | 12 | ||||
| -rwxr-xr-x | .local/share/bin/delta | 4 | ||||
| -rwxr-xr-x | .local/share/bin/mk | 9 | ||||
| -rwxr-xr-x | .local/share/bin/prompt | 33 | ||||
| -rwxr-xr-x | .local/share/mode/switch.d/zathura | 4 | ||||
| -rw-r--r-- | .profile | 15 | ||||
| -rw-r--r-- | .zshrc | 21 |
13 files changed, 188 insertions, 80 deletions
diff --git a/.config/clangd/config.yaml b/.config/clangd/config.yaml index f4fa3e0..17947a1 100644 --- a/.config/clangd/config.yaml +++ b/.config/clangd/config.yaml @@ -1,9 +1,9 @@ CompileFlags: Add: - # ignore unknown (gcc) compiler flags - -Wno-unknown-warning-option - -Wno-gnu-folding-constant + - -fgnuc-version=8.0.0 Remove: - -m* - -f* - + BuiltinHeaders: QueryDriver diff --git a/.config/gdb/gdbinit b/.config/gdb/gdbinit index 919b13a..bf4a25d 100644 --- a/.config/gdb/gdbinit +++ b/.config/gdb/gdbinit @@ -1,9 +1,22 @@ +# load ./gdbinit.py python import sys, os sys.path.append(os.path.join(os.environ["XDG_CONFIG_HOME"], "gdb")) import gdbinit end -alias mk = !mk +# preferences +try set disassembly-flavor intel +set debuginfod enabled off +set confirm off +set extended-prompt \P +set history save on +set history size 10000000 +set history remove-duplicates 100 + +# aliases alias reset = monitor reset +# commands +alias mk = !mk +alias ls = !ls diff --git a/.config/gdb/gdbinit.py b/.config/gdb/gdbinit.py index a6ebfea..1a137c5 100644 --- a/.config/gdb/gdbinit.py +++ b/.config/gdb/gdbinit.py @@ -1,14 +1,53 @@ import gdb +import gdb.prompt -def try_execute(*args): +from subprocess import DEVNULL, check_output +from os import environ + +class TryCommand(gdb.Command): + """ + Try evaluating the argument(s) as a regular GDB command, but do not fail if the command fails. + """ + + def __init__(self): + super().__init__("try", gdb.COMMAND_USER) + + def invoke(self, argument, from_tty): + try: + gdb.execute(argument) + except gdb.error: + pass + +TryCommand() + +def custom_prompt() -> str: try: - gdb.execute(*args) - except gdb.error: - pass + env = environ + env["eo"] = "\\[" + env["ec"] = "\\]" + prompt = check_output(["prompt", "gdb"], text=True, env=env) + return prompt + except Exception: + return "(gdb) " + +# add custom prompt ("\P") escape code to extended-prompt +substitute_prompt = gdb.prompt.substitute_prompt +def new_substitute_prompt(prompt: str): + out = "" + escape = False + for char in prompt: + out += char + if not escape: + if char == "\\": + escape = True + continue + escape = False + + if char == "P": + out = out[:-2] + custom_prompt() -# x86 only -try_execute("set disassembly-flavor intel") + out = substitute_prompt(out) + return out -gdb.execute("set debuginfod enabled off") -gdb.execute("set confirm off") +gdb.prompt.substitute_prompt = new_substitute_prompt diff --git a/.config/git/config##template b/.config/git/config##template index 0a3418a..3c996ba 100644 --- a/.config/git/config##template +++ b/.config/git/config##template @@ -37,7 +37,13 @@ ec = !git conflict -z | xargs -0 -- $EDITOR ours = !git conflict -z | xargs -0 -- git checkout --ours theirs = !git conflict -z | xargs -0 -- git checkout --theirs + nuke = !git reset --hard && git clean -fxd [pager] - log = diff-highlight | less - show = diff-highlight | less - diff = diff-highlight | less + log = delta + show = delta + diff = delta + blame = delta +[delta] + tabs = 2 + side-by-side = false + syntax-theme = base16 diff --git a/.config/nvim/color-tweaks.vim b/.config/nvim/color-tweaks.vim index e456430..70ef552 100644 --- a/.config/nvim/color-tweaks.vim +++ b/.config/nvim/color-tweaks.vim @@ -37,5 +37,6 @@ hi CocWarningSign guibg=NONE " fix disappearing CocFadeOut hi! link Conceal Comment +hi! link WinSeparator LineNr hi! link NonText vimContinueComment diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 7152774..f3424ca 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -18,14 +18,16 @@ set mouse=a set cino=N-s,E-s,l1,g-1,j1 set linebreak " set wrap but don't wrap inside words set viminfo+='1000,n~/.local/nvim/viminfo -set guifont=monospace:h9:#e-subpixelantialias:#h-slight -set linespace=5 +set guifont=monospace:h7.5:#e-subpixelantialias +set linespace=3 set tabpagemax=999 set breakindent set breakindentopt+=list:-1 set showbreak=~\ set formatoptions+=mM set tags^=build/tags +set ssop-=options +set guicursor=n-v-c-sm:block,i-ci-ve:ver20,r-cr-o:hor05,t:block-TermCursor let g:sneak#label = 1 let g:which_key_map = {} let g:airline_powerline_fonts = 1 @@ -41,9 +43,10 @@ if exists("g:neovide") nmap <silent> <C--> :lua vim.g.neovide_scale_factor = vim.g.neovide_scale_factor - 0.1<CR> nmap <silent> <C-ScrollWheelDown> :lua vim.g.neovide_scale_factor = vim.g.neovide_scale_factor - 0.1<CR> nmap <silent> <C-0> :lua vim.g.neovide_scale_factor = 1<CR> - let g:neovide_scroll_animation_length = 0.18 + let g:smoothie_enabled = v:false + let g:neovide_scroll_animation_length = 0.16 let g:neovide_floating_shadow = v:false - let g:neovide_cursor_animation_length = 0.06 + let g:neovide_cursor_animation_length = 0.04 let g:neovide_cursor_trail_size = 0.0 let g:neovide_padding_top=10 let g:neovide_padding_left=10 @@ -77,6 +80,7 @@ Plug 'dkarter/bullets.vim' Plug 'editorconfig/editorconfig-vim' Plug 'rickhowe/diffunitsyntax' Plug 'lervag/file-line' +Plug 'vim-scripts/AnsiEsc.vim' " language plugins Plug 'lervag/vimtex' @@ -226,39 +230,44 @@ let g:Hexokinase_optOutPatterns = [ 'colour_names' ] " lightline let g:lightline = { - \ 'colorscheme': 'auto', - \ 'mode_map': { - \ 'n' : 'norm', - \ 'i' : 'ins', - \ 'R' : 'rep', - \ 'v' : 'vis', - \ 'V' : 'v-l', - \ "\<C-v>": 'v-b', - \ 'c' : 'cmd', - \ 's' : 'sel', - \ 'S' : 's-l', - \ "\<C-s>": 's-b', - \ 't': 'term' - \ }, - \ 'active': { - \ 'left': [ - \ [ 'mode', 'paste' ], - \ [ 'readonly', 'filename', 'modified'] - \ ], - \ 'right': [ - \ [ 'lineinfo' ] - \ ] - \ }, - \ 'inactive': { - \ 'left': [ - \ [ 'readonly', 'filename', 'modified'] - \ ], - \ 'right': [ ] - \ }, - \ } -let g:lightline.tabline = { - \ 'left': [ [ 'tabs' ] ], - \ 'right': [ ] } + \ 'colorscheme': 'auto', + \ 'mode_map': { + \ 'n' : 'norm', + \ 'i' : 'ins', + \ 'R' : 'rep', + \ 'v' : 'vis', + \ 'V' : 'v-l', + \ "\<C-v>": 'v-b', + \ 'c' : 'cmd', + \ 's' : 'sel', + \ 'S' : 's-l', + \ "\<C-s>": 's-b', + \ 't': 'term', + \ }, + \ 'active': { + \ 'left': [ + \ [ 'mode', 'paste' ], + \ [ 'readonly', 'filename', 'modified'], + \ ], + \ 'right': [ + \ [ 'lineinfo' ], + \ ], + \ }, + \ 'inactive': { + \ 'left': [ + \ [ 'readonly', 'filename', 'modified'], + \ ], + \ 'right': [ ], + \ }, + \ 'tabline': { + \ 'left': [ [ 'tabs' ] ], + \ 'right': [ ], + \ }, + \ 'subseparator': { + \ 'left': '', + \ 'right': '', + \ }, + \ } call lightline#init() " vimtex config diff --git a/.config/picom.conf b/.config/picom.conf index 0f59fde..c1a8080 100644 --- a/.config/picom.conf +++ b/.config/picom.conf @@ -8,7 +8,7 @@ corner-radius = 10; shadow = true; shadow-radius = 48; shadow-opacity = 0.4; -shadow-offset-y = -48; +shadow-offset-y = -36; shadow-offset-x = -48; fade = false; @@ -18,6 +18,10 @@ fade-delta = 16; rules = ( { + match = "class_i *= 'scrcpy'"; + corner-radius = 32; + }, + { match = "!I3_FLOATING_WINDOW@ = 1"; shadow = false; corner-radius = 0; @@ -27,6 +31,10 @@ rules = ( shadow = false; }, { + match = "window_type *= 'splash'"; + shadow = false; + }, + { match = "window_type *= 'notification'"; fade = true; corner-radius = 12; @@ -58,7 +66,7 @@ rules = ( triggers = [ "open" ]; preset = "slide-in"; direction = "up"; - duration = 0.175; + duration = 0.200; }, { triggers = [ "close" ]; diff --git a/.local/share/bin/delta b/.local/share/bin/delta new file mode 100755 index 0000000..83fb629 --- /dev/null +++ b/.local/share/bin/delta @@ -0,0 +1,4 @@ +#!/bin/sh +[ -e "$XDG_CACHE_HOME/mode/state/vars" ] && . "$XDG_CACHE_HOME/mode/state/vars" +[ "$mode" = "light" ] && theme="--light" || theme="--dark" +exec /bin/delta "$theme" "$@" diff --git a/.local/share/bin/mk b/.local/share/bin/mk index 54b6908..83baf01 100755 --- a/.local/share/bin/mk +++ b/.local/share/bin/mk @@ -27,16 +27,17 @@ mode_cmake() { # re-run configuration if fresh or CMakeLists was changed if [ ! -e "$builddir/build.ninja" ] || [ "CMakeLists.txt" -nt "$builddir/build.ninja" ] ; then - cmake --log-level WARNING -B "$builddir" + cmake --log-level WARNING -B "$builddir" || exit $? fi # build - cmake --build "$builddir" -- "$@" || exit $? + cmake --build "$builddir" -- "$@" + ec=$? # generate vim tags (continue after mk exits) - ninja -C "$builddir" -t deps | sed -n 's/^ \{4\}//p' | sort -u | ctags -L - -f "$builddir/tags" & + ninja -C "$builddir" -t deps | sed -n 's/^ \{4\}//p' | sort -u | ctags -L - -f "$builddir/tags" 2>/dev/null & - exit 0 + exit $ec } [ -e "CMakeLists.txt" ] && mode_cmake "$@" diff --git a/.local/share/bin/prompt b/.local/share/bin/prompt new file mode 100755 index 0000000..7dde932 --- /dev/null +++ b/.local/share/bin/prompt @@ -0,0 +1,33 @@ +#!/bin/sh +fmt_esc() { + printf "%s$1%s" "$eo" "$ec" +} + +fmt_segment() { + content="$1" + [ -z "$content" ] && return + printf '%s%s%s -> %s' "$(fmt_esc '\e[90m')" "${content}" "$(fmt_esc '\e[30m')" "$(fmt_esc '\e[0m')" +} + +fmt_environment() { + content="$1" + [ -z "$content" ] && return + printf '%s(%s%s%s)%s ' "$(fmt_esc '\e[30;40m')" "$(fmt_esc '\e[97m')" "$content" "$(fmt_esc '\e[30;40m')" "$(fmt_esc '\e[0m')" +} + +[ -n "$1" ] && fmt_environment "$1" +fmt_environment "$VIRTUAL_ENV_PROMPT" + +# only display hostname in prompt if connected over SSH +[ -n "$SSH_CLIENT" ] && fmt_segment "$(hostname)" + +# current working directory +here="$PWD" +[ "$here" = "$HOME" ] && here="~" +fmt_segment "$(basename "$here")" + +# git status +git rev-parse --is-inside-work-tree 1> /dev/null 2> /dev/null && fmt_segment "git $(git rev-parse --abbrev-ref HEAD 2> /dev/null)" + +# exit happily +exit 0 diff --git a/.local/share/mode/switch.d/zathura b/.local/share/mode/switch.d/zathura index 42d6d90..8d7e311 100755 --- a/.local/share/mode/switch.d/zathura +++ b/.local/share/mode/switch.d/zathura @@ -9,8 +9,8 @@ set completion-highlight-bg "$accent" set completion-highlight-fg "$accent_text" set default-bg "$bg" set default-fg "$fg" -set highlight-active-color "$accent" -set highlight-color "$accent_text" +set highlight-active-color "$(echo "$accent" | pastel set alpha 0.5 | pastel format rgb)" +set highlight-color "$(echo "$accent_text" | pastel set alpha 0.5 | pastel format rgb)" set inputbar-bg "$bg" set inputbar-fg "$fg" set notification-bg "$bg" @@ -16,7 +16,7 @@ alias sctl='systemctl --user' # one letters alias r='cd "$(lf -print-last-dir | head -n1)"' -alias v='nvim' +alias v='nvim -p' alias m='neomutt' alias y='yay' alias n='ncmpcpp' @@ -56,17 +56,21 @@ fi # other stuff export EDITOR=editor -export PAGER="less" +export PAGER="less --mouse --wheel-lines=3 -R" +alias less="$PAGER" +export DELTA_PAGER="$PAGER" export FZF_DEFAULT_COMMAND="find . -name '.?*' -prune -o -print" -export FZF_DEFAULT_OPTS="--color=bw,current-fg:regular:reverse,current-hl:underline:reverse,info:bright-black,hl:underline --layout=reverse --info=inline-right --no-separator --no-scrollbar --marker='' --pointer='' --highlight-line" +export FZF_DEFAULT_OPTS="--color=bw,current-fg:regular:reverse,info:bright-black,hl:underline --layout=reverse --info=inline-right --no-separator --no-scrollbar --marker='' --pointer='' --highlight-line" export GOPATH="$HOME/.local/go" [ -e "$XDG_CONFIG_HOME/gtk-4.0/env" ] && . "$XDG_CONFIG_HOME/gtk-4.0/env" export PASSWORD_STORE_ENABLE_EXTENSIONS=true export PASSWORD_STORE_EXTENSIONS_DIR="$XDG_DATA_HOME/pass-extensions" export MOZ_USE_XINPUT2=1 +export CMAKE_BUILD_TYPE=Debug export CMAKE_EXPORT_COMPILE_COMMANDS=1 export CMAKE_GENERATOR=Ninja export LIBVIRT_DEFAULT_URI='qemu:///system' +export WINEDEBUG='fixme-all,err-all' # LS_COLORS [ ! -e "$XDG_CACHE_HOME/dircolors" ] || [ "$XDG_CONFIG_HOME/dircolors" -nt "$XDG_CACHE_HOME/dircolors" ] && dircolors "$XDG_CONFIG_HOME/dircolors" > "$XDG_CACHE_HOME/dircolors" @@ -84,7 +88,6 @@ export PARALLEL_HOME="$XDG_CONFIG_HOME/parallel" export PYLINTHOME="$XDG_CACHE_HOME/pylint" export STACK_ROOT="$XDG_DATA_HOME/stack" export WINEPREFIX="$XDG_DATA_HOME/wineprefixes/default" -export HISTFILE="$XDG_DATA_HOME/zsh/history" export CUDA_CACHE_PATH="$XDG_CACHE_HOME/nv" export CONAN_USER_HOME="$XDG_CONFIG_HOME/conan" alias nvidia-settings='nvidia-settings --config="$XDG_CONFIG_HOME/nvidia/settings"' @@ -110,6 +113,10 @@ export GPG_ID_DEFAULT="1081FFE2B963ADB5BDCF4DA6D0E3BC76E355B6CC" export GPG_ID_GIT="$GPG_ID_DEFAULT" export GPG_ID_PASSWORD_STORE="A12ADDD26335FA960FE3C78A9FC7A0100BC4C971" +# GDB +! [ -d "$XDG_DATA_HOME/gdb" ] && mkdir -p "$XDG_DATA_HOME/gdb" +export GDBHISTFILE="$XDG_DATA_HOME/gdb/history" + # secrets [ -f "$HOME/.env" ] && . "$HOME/.env" @@ -26,28 +26,15 @@ compinit -d "$ZSH_COMPDUMP" export HISTFILE="$XDG_DATA_HOME/zsh/history" export HISTSIZE=10000000 export SAVEHIST=10000000 +setopt hist_ignore_space setopt share_history +setopt hist_ignore_dups # keybinds bindkey -e # emacs bindings bindkey '^[[Z' reverse-menu-complete # prompt -unset PROMPT setopt PROMPT_SUBST -prompt_segment() { - content="$1" - [ -z "$content" ] && return - echo "%{\e[90m%}${content}%{\e[30m%} -> %{\e[0m%}" -} -prompt_mod_git_info() { - git rev-parse --is-inside-work-tree 1> /dev/null 2> /dev/null || return - prompt_segment "git $(git rev-parse --abbrev-ref HEAD 2> /dev/null)" -} -# only display hostname in prompt if connected over SSH -[ -n "$SSH_CLIENT" ] && PROMPT+="$(prompt_segment '%m')" -# working directory -PROMPT+="$(prompt_segment '%c')" -# git info (if in repo) -PROMPT+="\$(prompt_mod_git_info)" - +export VIRTUAL_ENV_DISABLE_PROMPT=y +PROMPT='$(eo=%{ ec=%} prompt)' |