Merge branch 'main' of gitlab.com:elitherl/dotfiles into main

This commit is contained in:
Evie Litherland-Smith 2023-03-20 09:55:14 +00:00
commit d4d9ef94a5
52 changed files with 966 additions and 234 deletions

29
.bashrc
View file

@ -1,17 +1,4 @@
#!/bin/bash
# vim: ft=sh # vim: ft=sh
# Return if called by load leveller
# if [[ -n "$LOADL_ACTIVE" ]] ; then
# return
# fi
# If not running interactively, don't do anything
# case $- in
# *i*) ;;
# *) return;;
# esac
# Source global definitions # Source global definitions
if [ -f /etc/bashrc ]; then if [ -f /etc/bashrc ]; then
. /etc/bashrc . /etc/bashrc
@ -20,6 +7,12 @@ fi
# set PATH so it includes user's private bin if it exists # set PATH so it includes user's private bin if it exists
grep "$HOME/.local/bin" "$PATH" > /dev/null 2>&1 || export PATH="$HOME/.local/bin:$PATH" grep "$HOME/.local/bin" "$PATH" > /dev/null 2>&1 || export PATH="$HOME/.local/bin:$PATH"
# set PATH so it includes homebrew bin directories if they exist
HOMEBREW_BIN="/opt/homebrew/bin"
HOMEBREW_SBIN="/opt/homebrew/sbin"
grep "$HOMEBREW_SBIN" "$PATH" > /dev/null 2>&1 || export PATH="$HOMEBREW_SBIN:$PATH"
grep "$HOMEBREW_BIN" "$PATH" > /dev/null 2>&1 || export PATH="$HOMEBREW_BIN:$PATH"
# enable color support of ls and also add handy aliases # enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
@ -43,16 +36,24 @@ alias ll='ls -alF'
alias la='ls -A' alias la='ls -A'
alias l='ls -CF' alias l='ls -CF'
command -v nvim > /dev/null 2>&1 && export EDITOR=nvim || export EDITOR=vi command -v nvim > /dev/null 2>&1 && export EDITOR=nvim || export EDITOR=vi
command -v xed > /dev/null 2>&1 && export VISUAL=xed || export VISUAL=vi command -v xed > /dev/null 2>&1 && export VISUAL=xed || export VISUAL=vi
alias lg="lazygit"
alias nvimdiff="nvim -d"
alias vim="nvim"
alias vimdiff="nvim -d"
if [ -f "$HOME/.bashrc.local" ] ; then if [ -f "$HOME/.bashrc.local" ] ; then
source "$HOME/.bashrc.local" source "$HOME/.bashrc.local"
fi fi
export PYENV_ROOT="$HOME/.pyenv" export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH" command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
command -v pyenv >/dev/null && eval "$(pyenv init -)" command -v pyenv >/dev/null && eval "$(pyenv init -)"
command -v direnv > /dev/null 2>&1 && eval "$(direnv hook bash)" command -v direnv > /dev/null 2>&1 && eval "$(direnv hook bash)"
command -v starship > /dev/null 2>&1 && eval "$(starship init bash)" command -v starship > /dev/null 2>&1 && eval "$(starship init bash)"
command -v glab > /dev/null && source <(glab completion -s bash)
command -v gh > /dev/null && source <(gh completion -s bash)

3
.gitignore vendored
View file

@ -13,3 +13,6 @@ config/gtk-3.0/bookmarks
config/xfce4/xfconf/xfce-perchannel-xml config/xfce4/xfconf/xfce-perchannel-xml
config/i3/config.d config/i3/config.d
config/nvim/.venv config/nvim/.venv
config/pypoetry/poetry.lock
config/pypoetry/pyproject.toml
squashfs-root

2
.inputrc Normal file
View file

@ -0,0 +1,2 @@
$include /etc/inputrc
set completion-ignore-case On

5
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,5 @@
repos:
- repo: https://github.com/JohnnyMorganz/StyLua
rev: v0.16.1
hooks:
- id: stylua

9
.profile Normal file
View file

@ -0,0 +1,9 @@
# ~/.profile: executed by Bourne-compatible login shells.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
mesg n 2> /dev/null || true

61
.zshrc Normal file
View file

@ -0,0 +1,61 @@
# vim: ft=zsh
# Source global definitions
if [ -f /etc/zshrc ]; then
. /etc/zshrc
fi
# set PATH so it includes user's private bin if it exists
LOCAL_BIN="$HOME/.local/bin"
grep "$LOCAL_BIN" "$PATH" > /dev/null 2>&1 || export PATH="$LOCAL_BIN:$PATH"
# set PATH so it includes homebrew bin directories if they exist
HOMEBREW_BIN="/opt/homebrew/bin"
HOMEBREW_SBIN="/opt/homebrew/sbin"
grep "$HOMEBREW_SBIN" "$PATH" > /dev/null 2>&1 || export PATH="$HOMEBREW_SBIN:$PATH"
grep "$HOMEBREW_BIN" "$PATH" > /dev/null 2>&1 || export PATH="$HOMEBREW_BIN:$PATH"
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# colored GCC warnings and errors
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
# set LANG to be something sensible
export LANG="en_GB.utf-8"
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
command -v nvim > /dev/null 2>&1 && export EDITOR=nvim || export EDITOR=vi
command -v xed > /dev/null 2>&1 && export VISUAL=xed || export VISUAL=vi
alias lg="lazygit"
alias nvimdiff="nvim -d"
alias vim="nvim"
alias vimdiff="nvim -d"
if [ -f "$HOME/.zshrc.local" ] ; then
source "$HOME/.zshrc.local"
fi
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
command -v pyenv >/dev/null && eval "$(pyenv init -)"
command -v direnv > /dev/null 2>&1 && eval "$(direnv hook zsh)"
command -v starship > /dev/null 2>&1 && eval "$(starship init zsh)"
autoload -U compinit; compinit
command -v glab > /dev/null && source <(glab completion -s zsh); compdef _glab glab
command -v gh > /dev/null && source <(gh completion -s zsh); compdef _gh gh

View file

@ -10,57 +10,62 @@ THEMES_ITEMS := $(wildcard themes/*)
THEMES_TARGETS := $(THEMES_ITEMS:themes/%=$(THEMES_DIR)/%) THEMES_TARGETS := $(THEMES_ITEMS:themes/%=$(THEMES_DIR)/%)
LAZY_REPO := https://github.com/folke/lazy.nvim.git LAZY_REPO := https://github.com/folke/lazy.nvim.git
LAZY_DIR := $(HOME)/.local/share/nvim/lazy/lazy.nvim
PYENV_DIR := $(if $(PYENV_ROOT), $(PYENV_ROOT), $(HOME)/.pyenv) PYENV_DIR := $(if $(PYENV_ROOT), $(PYENV_ROOT), $(HOME)/.pyenv)
POETRY_DIR := $(HOME)/.local/share/pypoetry
.PHONY: all clean check link unlink install uninstall pacman .PHONY: default all clean check directories link configure install
all: link install default: directories link configure
clean: unlink uninstall all: default install
clean:
for link in $(CONFIG_TARGETS); do rm "$$link"; done
for link in $(SSH_TARGETS); do rm "$$link"; done
for link in $(THEMES_TARGETS); do rm "$$link"; done
rm -rf $(LAZY_DIR)
rm $(HOME)/.profile
rm $(HOME)/.inputrc
rm $(HOME)/.bashrc
rm $(HOME)/.zshrc
rmdir $(HOME)/.ssh/sockets
rm -rf config/nvim/.venv
check: check:
echo "Placeholder" echo "Placeholder"
link: $(CONFIG_TARGETS) $(SSH_TARGETS) $(THEMES_TARGETS) $(HOME)/.bashrc $(HOME)/.ssh/sockets directories: $(CONFIG_DIR) $(SSH_DIR) $(THEMES_DIR) $(HOME)/.ssh/sockets $(HOME)/.local/bin
unlink: $(CONFIG_DIR) $(SSH_DIR) $(THEMES_DIR) $(HOME)/.ssh/sockets $(HOME)/.local/bin:
for link in $(CONFIG_TARGETS); do rm "$$link"; done mkdir -p $@
for link in $(SSH_TARGETS); do rm "$$link"; done
for link in $(THEMES_TARGETS); do rm "$$link"; done
rmdir $(HOME)/.ssh/sockets
install: $(LAZY_DIR) $(PYENV_DIR) $(POETRY_DIR) config/nvim/.venv link: $(CONFIG_TARGETS) $(SSH_TARGETS) $(THEMES_TARGETS) $(HOME)/.profile $(HOME)/.inputrc $(HOME)/.bashrc $(HOME)/.zshrc
uninstall:
rm -rf $(LAZY_DIR)
rm -rf $(PYENV_DIR)
rm -rf $(POETRY_DIR)
rm -rf config/nvim/.venv
$(CONFIG_TARGETS): $(CONFIG_DIR)/%: config/% $(CONFIG_TARGETS): $(CONFIG_DIR)/%: config/%
$(SSH_TARGETS): $(SSH_DIR)/%: ssh/% $(SSH_TARGETS): $(SSH_DIR)/%: ssh/%
$(THEMES_TARGETS): $(THEMES_DIR)/%: themes/% $(THEMES_TARGETS): $(THEMES_DIR)/%: themes/%
$(HOME)/.profile: $(HOME)/%: %
$(HOME)/.inputrc: $(HOME)/%: %
$(HOME)/.bashrc: $(HOME)/%: % $(HOME)/.bashrc: $(HOME)/%: %
$(CONFIG_TARGETS) $(SSH_TARGETS) $(THEMES_TARGETS) $(HOME)/.bashrc: $(HOME)/.zshrc: $(HOME)/%: %
ln -s $(PWD)/$? -t $$(dirname $@) $(CONFIG_TARGETS) $(SSH_TARGETS) $(THEMES_TARGETS) $(HOME)/.profile $(HOME)/.inputrc $(HOME)/.bashrc $(HOME)/.zshrc:
ln -s $(PWD)/$? $@
$(LAZY_DIR): configure: config/git/user_email config/nvim/.venv
git clone --depth 1 $(LAZY_REPO) $@
$(PYENV_DIR): config/git/user_email:
bash packages/pyenv.sh echo "Missing user_email; Add your email to $$(readlink -f config/git)/user_email"
$(POETRY_DIR):
python3 packages/poetry.py
config/nvim/.venv: config/nvim/.venv:
python3 -m venv $@ python3 -m venv $@
$@/bin/python3 -m pip install -U pip wheel $@/bin/python3 -m pip install -U pip wheel
$@/bin/python3 -m pip install --use-pep517 pynvim $@/bin/python3 -m pip install --use-pep517 pynvim
install: $(LAZY_DIR)
command -v direnv > /dev/null || bin_path=$(HOME)/.local/bin bash packages/direnv.sh
command -v pipx > /dev/null || bash packages/pipx.sh
command -v poetry > /dev/null || python3 packages/poetry.py
command -v pyenv > /dev/null || bash packages/pyenv.sh
command -v starship > /dev/null || sh packages/starship.sh -b $(HOME)/.local/bin
$(CONFIG_DIR) $(SSH_DIR) $(THEMES_DIR) $(HOME)/.ssh/sockets: $(LAZY_DIR):
mkdir -p $@ git clone --depth 1 $(LAZY_REPO) $@

Binary file not shown.

View file

@ -17,7 +17,7 @@
# #
# If this option is set to mouse or keyboard, the monitor option # If this option is set to mouse or keyboard, the monitor option
# will be ignored. # will be ignored.
follow = none follow = mouse
### Geometry ### ### Geometry ###
@ -30,7 +30,7 @@
height = 300 height = 300
# Position the notification in the top right corner # Position the notification in the top right corner
origin = bottom-right origin = top-right
# Offset from the origin # Offset from the origin
offset = 30x40 offset = 30x40
@ -297,14 +297,14 @@
foreground = "#CAD3F5" foreground = "#CAD3F5"
timeout = 5 timeout = 5
# Icon for notifications with low urgency, uncomment to enable # Icon for notifications with low urgency, uncomment to enable
icon = /usr/share/icons/Arc-X-D/status/16/dialog-information.png # icon = /usr/share/icons/Arc-X-D/status/16/dialog-information.png
[urgency_normal] [urgency_normal]
background = "#24273A" background = "#24273A"
foreground = "#CAD3F5" foreground = "#CAD3F5"
timeout = 5 timeout = 5
# Icon for notifications with normal urgency, uncomment to enable # Icon for notifications with normal urgency, uncomment to enable
icon = /usr/share/icons/Arc-X-D/status/16/dialog-question.png # icon = /usr/share/icons/Arc-X-D/status/16/dialog-question.png
[urgency_critical] [urgency_critical]
background = "#24273A" background = "#24273A"
@ -312,7 +312,7 @@
frame_color = "#F5A97F" frame_color = "#F5A97F"
timeout = 120 timeout = 120
# Icon for notifications with critical urgency, uncomment to enable # Icon for notifications with critical urgency, uncomment to enable
icon = /usr/share/icons/Arc-X-D/status/16/dialog-warning.png # icon = /usr/share/icons/Arc-X-D/status/16/dialog-warning.png
# Every section that isn't one of the above is interpreted as a rules to # Every section that isn't one of the above is interpreted as a rules to
# override settings for certain messages. # override settings for certain messages.

View file

@ -0,0 +1,177 @@
# fish completion for gh -*- shell-script -*-
function __gh_debug
set -l file "$BASH_COMP_DEBUG_FILE"
if test -n "$file"
echo "$argv" >> $file
end
end
function __gh_perform_completion
__gh_debug "Starting __gh_perform_completion"
# Extract all args except the last one
set -l args (commandline -opc)
# Extract the last arg and escape it in case it is a space
set -l lastArg (string escape -- (commandline -ct))
__gh_debug "args: $args"
__gh_debug "last arg: $lastArg"
# Disable ActiveHelp which is not supported for fish shell
set -l requestComp "GH_ACTIVE_HELP=0 $args[1] __complete $args[2..-1] $lastArg"
__gh_debug "Calling $requestComp"
set -l results (eval $requestComp 2> /dev/null)
# Some programs may output extra empty lines after the directive.
# Let's ignore them or else it will break completion.
# Ref: https://github.com/spf13/cobra/issues/1279
for line in $results[-1..1]
if test (string trim -- $line) = ""
# Found an empty line, remove it
set results $results[1..-2]
else
# Found non-empty line, we have our proper output
break
end
end
set -l comps $results[1..-2]
set -l directiveLine $results[-1]
# For Fish, when completing a flag with an = (e.g., <program> -n=<TAB>)
# completions must be prefixed with the flag
set -l flagPrefix (string match -r -- '-.*=' "$lastArg")
__gh_debug "Comps: $comps"
__gh_debug "DirectiveLine: $directiveLine"
__gh_debug "flagPrefix: $flagPrefix"
for comp in $comps
printf "%s%s\n" "$flagPrefix" "$comp"
end
printf "%s\n" "$directiveLine"
end
# This function does two things:
# - Obtain the completions and store them in the global __gh_comp_results
# - Return false if file completion should be performed
function __gh_prepare_completions
__gh_debug ""
__gh_debug "========= starting completion logic =========="
# Start fresh
set --erase __gh_comp_results
set -l results (__gh_perform_completion)
__gh_debug "Completion results: $results"
if test -z "$results"
__gh_debug "No completion, probably due to a failure"
# Might as well do file completion, in case it helps
return 1
end
set -l directive (string sub --start 2 $results[-1])
set --global __gh_comp_results $results[1..-2]
__gh_debug "Completions are: $__gh_comp_results"
__gh_debug "Directive is: $directive"
set -l shellCompDirectiveError 1
set -l shellCompDirectiveNoSpace 2
set -l shellCompDirectiveNoFileComp 4
set -l shellCompDirectiveFilterFileExt 8
set -l shellCompDirectiveFilterDirs 16
if test -z "$directive"
set directive 0
end
set -l compErr (math (math --scale 0 $directive / $shellCompDirectiveError) % 2)
if test $compErr -eq 1
__gh_debug "Received error directive: aborting."
# Might as well do file completion, in case it helps
return 1
end
set -l filefilter (math (math --scale 0 $directive / $shellCompDirectiveFilterFileExt) % 2)
set -l dirfilter (math (math --scale 0 $directive / $shellCompDirectiveFilterDirs) % 2)
if test $filefilter -eq 1; or test $dirfilter -eq 1
__gh_debug "File extension filtering or directory filtering not supported"
# Do full file completion instead
return 1
end
set -l nospace (math (math --scale 0 $directive / $shellCompDirectiveNoSpace) % 2)
set -l nofiles (math (math --scale 0 $directive / $shellCompDirectiveNoFileComp) % 2)
__gh_debug "nospace: $nospace, nofiles: $nofiles"
# If we want to prevent a space, or if file completion is NOT disabled,
# we need to count the number of valid completions.
# To do so, we will filter on prefix as the completions we have received
# may not already be filtered so as to allow fish to match on different
# criteria than the prefix.
if test $nospace -ne 0; or test $nofiles -eq 0
set -l prefix (commandline -t | string escape --style=regex)
__gh_debug "prefix: $prefix"
set -l completions (string match -r -- "^$prefix.*" $__gh_comp_results)
set --global __gh_comp_results $completions
__gh_debug "Filtered completions are: $__gh_comp_results"
# Important not to quote the variable for count to work
set -l numComps (count $__gh_comp_results)
__gh_debug "numComps: $numComps"
if test $numComps -eq 1; and test $nospace -ne 0
# We must first split on \t to get rid of the descriptions to be
# able to check what the actual completion will be.
# We don't need descriptions anyway since there is only a single
# real completion which the shell will expand immediately.
set -l split (string split --max 1 \t $__gh_comp_results[1])
# Fish won't add a space if the completion ends with any
# of the following characters: @=/:.,
set -l lastChar (string sub -s -1 -- $split)
if not string match -r -q "[@=/:.,]" -- "$lastChar"
# In other cases, to support the "nospace" directive we trick the shell
# by outputting an extra, longer completion.
__gh_debug "Adding second completion to perform nospace directive"
set --global __gh_comp_results $split[1] $split[1].
__gh_debug "Completions are now: $__gh_comp_results"
end
end
if test $numComps -eq 0; and test $nofiles -eq 0
# To be consistent with bash and zsh, we only trigger file
# completion when there are no other completions
__gh_debug "Requesting file completion"
return 1
end
end
return 0
end
# Since Fish completions are only loaded once the user triggers them, we trigger them ourselves
# so we can properly delete any completions provided by another script.
# Only do this if the program can be found, or else fish may print some errors; besides,
# the existing completions will only be loaded if the program can be found.
if type -q "gh"
# The space after the program name is essential to trigger completion for the program
# and not completion of the program name itself.
# Also, we use '> /dev/null 2>&1' since '&>' is not supported in older versions of fish.
complete --do-complete "gh " > /dev/null 2>&1
end
# Remove any pre-existing completions for the program since we will be handling all of them.
complete -c gh -e
# The call to __gh_prepare_completions will setup __gh_comp_results
# which provides the program's completion choices.
complete -c gh -n '__gh_prepare_completions' -f -a '$__gh_comp_results'

View file

@ -0,0 +1,176 @@
# fish completion for glab -*- shell-script -*-
function __glab_debug
set -l file "$BASH_COMP_DEBUG_FILE"
if test -n "$file"
echo "$argv" >> $file
end
end
function __glab_perform_completion
__glab_debug "Starting __glab_perform_completion"
# Extract all args except the last one
set -l args (commandline -opc)
# Extract the last arg and escape it in case it is a space
set -l lastArg (string escape -- (commandline -ct))
__glab_debug "args: $args"
__glab_debug "last arg: $lastArg"
set -l requestComp "$args[1] __complete $args[2..-1] $lastArg"
__glab_debug "Calling $requestComp"
set -l results (eval $requestComp 2> /dev/null)
# Some programs may output extra empty lines after the directive.
# Let's ignore them or else it will break completion.
# Ref: https://github.com/spf13/cobra/issues/1279
for line in $results[-1..1]
if test (string trim -- $line) = ""
# Found an empty line, remove it
set results $results[1..-2]
else
# Found non-empty line, we have our proper output
break
end
end
set -l comps $results[1..-2]
set -l directiveLine $results[-1]
# For Fish, when completing a flag with an = (e.g., <program> -n=<TAB>)
# completions must be prefixed with the flag
set -l flagPrefix (string match -r -- '-.*=' "$lastArg")
__glab_debug "Comps: $comps"
__glab_debug "DirectiveLine: $directiveLine"
__glab_debug "flagPrefix: $flagPrefix"
for comp in $comps
printf "%s%s\n" "$flagPrefix" "$comp"
end
printf "%s\n" "$directiveLine"
end
# This function does two things:
# - Obtain the completions and store them in the global __glab_comp_results
# - Return false if file completion should be performed
function __glab_prepare_completions
__glab_debug ""
__glab_debug "========= starting completion logic =========="
# Start fresh
set --erase __glab_comp_results
set -l results (__glab_perform_completion)
__glab_debug "Completion results: $results"
if test -z "$results"
__glab_debug "No completion, probably due to a failure"
# Might as well do file completion, in case it helps
return 1
end
set -l directive (string sub --start 2 $results[-1])
set --global __glab_comp_results $results[1..-2]
__glab_debug "Completions are: $__glab_comp_results"
__glab_debug "Directive is: $directive"
set -l shellCompDirectiveError 1
set -l shellCompDirectiveNoSpace 2
set -l shellCompDirectiveNoFileComp 4
set -l shellCompDirectiveFilterFileExt 8
set -l shellCompDirectiveFilterDirs 16
if test -z "$directive"
set directive 0
end
set -l compErr (math (math --scale 0 $directive / $shellCompDirectiveError) % 2)
if test $compErr -eq 1
__glab_debug "Received error directive: aborting."
# Might as well do file completion, in case it helps
return 1
end
set -l filefilter (math (math --scale 0 $directive / $shellCompDirectiveFilterFileExt) % 2)
set -l dirfilter (math (math --scale 0 $directive / $shellCompDirectiveFilterDirs) % 2)
if test $filefilter -eq 1; or test $dirfilter -eq 1
__glab_debug "File extension filtering or directory filtering not supported"
# Do full file completion instead
return 1
end
set -l nospace (math (math --scale 0 $directive / $shellCompDirectiveNoSpace) % 2)
set -l nofiles (math (math --scale 0 $directive / $shellCompDirectiveNoFileComp) % 2)
__glab_debug "nospace: $nospace, nofiles: $nofiles"
# If we want to prevent a space, or if file completion is NOT disabled,
# we need to count the number of valid completions.
# To do so, we will filter on prefix as the completions we have received
# may not already be filtered so as to allow fish to match on different
# criteria than the prefix.
if test $nospace -ne 0; or test $nofiles -eq 0
set -l prefix (commandline -t | string escape --style=regex)
__glab_debug "prefix: $prefix"
set -l completions (string match -r -- "^$prefix.*" $__glab_comp_results)
set --global __glab_comp_results $completions
__glab_debug "Filtered completions are: $__glab_comp_results"
# Important not to quote the variable for count to work
set -l numComps (count $__glab_comp_results)
__glab_debug "numComps: $numComps"
if test $numComps -eq 1; and test $nospace -ne 0
# We must first split on \t to get rid of the descriptions to be
# able to check what the actual completion will be.
# We don't need descriptions anyway since there is only a single
# real completion which the shell will expand immediately.
set -l split (string split --max 1 \t $__glab_comp_results[1])
# Fish won't add a space if the completion ends with any
# of the following characters: @=/:.,
set -l lastChar (string sub -s -1 -- $split)
if not string match -r -q "[@=/:.,]" -- "$lastChar"
# In other cases, to support the "nospace" directive we trick the shell
# by outputting an extra, longer completion.
__glab_debug "Adding second completion to perform nospace directive"
set --global __glab_comp_results $split[1] $split[1].
__glab_debug "Completions are now: $__glab_comp_results"
end
end
if test $numComps -eq 0; and test $nofiles -eq 0
# To be consistent with bash and zsh, we only trigger file
# completion when there are no other completions
__glab_debug "Requesting file completion"
return 1
end
end
return 0
end
# Since Fish completions are only loaded once the user triggers them, we trigger them ourselves
# so we can properly delete any completions provided by another script.
# Only do this if the program can be found, or else fish may print some errors; besides,
# the existing completions will only be loaded if the program can be found.
if type -q "glab"
# The space after the program name is essential to trigger completion for the program
# and not completion of the program name itself.
# Also, we use '> /dev/null 2>&1' since '&>' is not supported in older versions of fish.
complete --do-complete "glab " > /dev/null 2>&1
end
# Remove any pre-existing completions for the program since we will be handling all of them.
complete -c glab -e
# The call to __glab_prepare_completions will setup __glab_comp_results
# which provides the program's completion choices.
complete -c glab -n '__glab_prepare_completions' -f -a '$__glab_comp_results'

View file

@ -1,4 +1,5 @@
if status is-interactive if status is-interactive
set -gx PYENV_ROOT $HOME/.pyenv set -gx PYENV_ROOT $HOME/.pyenv
set -g fish_user_paths $PYENV_ROOT/bin $fish_user_paths set -g fish_user_paths $PYENV_ROOT/bin $fish_user_paths
pyenv init - | source
end end

View file

@ -1,3 +1,4 @@
# vim: ft=gitconfig
[include] [include]
path = user_email path = user_email

View file

@ -67,6 +67,7 @@ bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3 bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4 bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5 bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
# switch to workspace with numpad keys # switch to workspace with numpad keys
bindcode $mod+87 workspace 1 bindcode $mod+87 workspace 1
@ -74,6 +75,7 @@ bindcode $mod+88 workspace 2
bindcode $mod+89 workspace 3 bindcode $mod+89 workspace 3
bindcode $mod+83 workspace 4 bindcode $mod+83 workspace 4
bindcode $mod+84 workspace 5 bindcode $mod+84 workspace 5
bindcode $mod+85 workspace 6
# switch to workspace with numlock numpad keys # switch to workspace with numlock numpad keys
bindcode $mod+Mod2+87 workspace $ws1 bindcode $mod+Mod2+87 workspace $ws1
@ -81,6 +83,7 @@ bindcode $mod+Mod2+88 workspace $ws2
bindcode $mod+Mod2+89 workspace $ws3 bindcode $mod+Mod2+89 workspace $ws3
bindcode $mod+Mod2+83 workspace $ws4 bindcode $mod+Mod2+83 workspace $ws4
bindcode $mod+Mod2+84 workspace $ws5 bindcode $mod+Mod2+84 workspace $ws5
bindcode $mod+Mod2+85 workspace $ws6
# move focused container to workspace # move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $ws1 bindsym $mod+Shift+1 move container to workspace $ws1
@ -88,6 +91,7 @@ bindsym $mod+Shift+2 move container to workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3 bindsym $mod+Shift+3 move container to workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4 bindsym $mod+Shift+4 move container to workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5 bindsym $mod+Shift+5 move container to workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6
# move focused container to workspace with numpad keys # move focused container to workspace with numpad keys
bindcode $mod+Shift+Mod2+87 move container to workspace $ws1 bindcode $mod+Shift+Mod2+87 move container to workspace $ws1
@ -95,6 +99,7 @@ bindcode $mod+Shift+Mod2+88 move container to workspace $ws2
bindcode $mod+Shift+Mod2+89 move container to workspace $ws3 bindcode $mod+Shift+Mod2+89 move container to workspace $ws3
bindcode $mod+Shift+Mod2+83 move container to workspace $ws4 bindcode $mod+Shift+Mod2+83 move container to workspace $ws4
bindcode $mod+Shift+Mod2+84 move container to workspace $ws5 bindcode $mod+Shift+Mod2+84 move container to workspace $ws5
bindcode $mod+Shift+Mod2+85 move container to workspace $ws6
# move focused container to workspace with numpad keys # move focused container to workspace with numpad keys
bindcode $mod+Shift+87 move container to workspace $ws1 bindcode $mod+Shift+87 move container to workspace $ws1
@ -102,6 +107,7 @@ bindcode $mod+Shift+88 move container to workspace $ws2
bindcode $mod+Shift+89 move container to workspace $ws3 bindcode $mod+Shift+89 move container to workspace $ws3
bindcode $mod+Shift+83 move container to workspace $ws4 bindcode $mod+Shift+83 move container to workspace $ws4
bindcode $mod+Shift+84 move container to workspace $ws5 bindcode $mod+Shift+84 move container to workspace $ws5
bindcode $mod+Shift+85 move container to workspace $ws6
# resize window (you can also use the mouse for that): # resize window (you can also use the mouse for that):
mode "resize" { mode "resize" {
@ -259,6 +265,7 @@ set $ws2 "2:"
set $ws3 "3:" set $ws3 "3:"
set $ws4 "4:" set $ws4 "4:"
set $ws5 "5:" set $ws5 "5:"
set $ws6 "6:🔑"
# use workspaces on different displays: # use workspaces on different displays:
# where you have to replace VGA-0/HDMI-0 with the names for your displays # where you have to replace VGA-0/HDMI-0 with the names for your displays
@ -268,20 +275,24 @@ set $ws5 "5:"
#workspace $ws3 output HDMI-1 #workspace $ws3 output HDMI-1
#workspace $ws4 output HDMI-1 #workspace $ws4 output HDMI-1
#workspace $ws5 output HDMI-1 #workspace $ws5 output HDMI-1
#workspace $ws6 output HDMI-1
# bind program to workspace and focus to them on startup: # bind program to workspace and focus to them on startup:
assign [class="wezterm"] $ws1 assign [class="wezterm"] $ws1
assign [class="(?i)firefox"] $ws2 assign [class="(?i)firefox"] $ws2
assign [class="Thunar"] $ws3 assign [class="Thunar"] $ws3
assign [class="thunderbird"] $ws4 assign [class="thunderbird"] $ws4
assign [class="Mailspring"] $ws4
assign [class="Element"] $ws5
assign [class="Signal"] $ws5
assign [class="TelegramDesktop"] $ws5 assign [class="TelegramDesktop"] $ws5
assign [class="Bitwarden"] $ws6
# automatic set focus new window if it opens on another workspace than the current: # automatic set focus new window if it opens on another workspace than the current:
for_window [class=wezterm] focus for_window [class=wezterm] focus
for_window [class=(?i)firefox] focus for_window [class=(?i)firefox] focus
for_window [class=Thunar] focus for_window [class=Thunar] focus
for_window [class=Thunderbird] focus for_window [class=Thunderbird] focus
for_window [class=TelegramDesktop] focus
############## ##############
# compositor # # compositor #

View file

@ -0,0 +1,8 @@
return {
-- optionally use on_attach to set keymaps when aerial has attached to a buffer
on_attach = function(bufnr)
-- Jump forwards/backwards with '{' and '}'
vim.keymap.set("n", "{", "<cmd>AerialPrev<CR>", { buffer = bufnr })
vim.keymap.set("n", "}", "<cmd>AerialNext<CR>", { buffer = bufnr })
end,
}

View file

@ -0,0 +1 @@
return { theme = "catppuccin" }

View file

@ -3,6 +3,9 @@ return {
term_colors = true, term_colors = true,
-- transparent_background = true, -- transparent_background = true,
integrations = { integrations = {
barbecue = {
dim_dirname = true,
},
dashboard = true, dashboard = true,
gitsigns = true, gitsigns = true,
indent_blankline = { indent_blankline = {
@ -10,11 +13,16 @@ return {
colored_indent_levels = true, colored_indent_levels = true,
}, },
cmp = true, cmp = true,
mason = true,
native_lsp = { native_lsp = {
enabled = true, enabled = true,
}, },
notify = true, notify = true,
nvimtree = true, nvimtree = true,
navic = {
enabled = false,
custom_bg = "NONE",
},
treesitter = true, treesitter = true,
treesitter_context = true, treesitter_context = true,
telescope = true, telescope = true,

View file

@ -24,9 +24,9 @@ return {
{ {
icon = "", icon = "",
icon_hl = "@variable", icon_hl = "@variable",
desc = "Git", desc = "Git DiffView",
group = "Label", group = "Label",
action = "Git", action = "DiffviewOpen",
key = "g", key = "g",
}, },
{ {

View file

@ -1,12 +1,4 @@
return { return {
show_current_context = true, show_current_context = true,
show_current_context_start = false, show_current_context_start = false,
char_highlight_list = {
"IndentBlanklineIndent1",
"IndentBlanklineIndent2",
"IndentBlanklineIndent3",
"IndentBlanklineIndent4",
"IndentBlanklineIndent5",
"IndentBlanklineIndent6",
},
} }

View file

@ -1,25 +1,65 @@
vim.opt.title = true -- Opt
vim.opt.cmdheight = 0
vim.g.python3_host_prog = vim.fn.stdpath "config" .. "/.venv/bin/python"
vim.g.python_indent = {
open_paren = "shiftwidth()",
nested_paren = "shiftwidth()",
continue = "shiftwidth()",
closed_paren_align_last_line = "v:false",
}
vim.opt.laststatus = 3
vim.opt.mouse = "nv"
vim.opt.shiftwidth = 4 vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.number = true vim.opt.number = true
vim.opt.relativenumber = true vim.opt.relativenumber = true
vim.opt.listchars = { trail = ".", tab = ">_" } vim.opt.listchars = { lead = ".", trail = ".", tab = ">-" }
vim.opt.list = true vim.opt.list = true
vim.opt.wrap = true
vim.opt.linebreak = true
vim.opt.autoread = true
vim.opt.expandtab = true
vim.opt.autoindent = true
vim.opt.smartindent = true
vim.opt.splitbelow = true vim.opt.splitbelow = true
vim.opt.splitright = true vim.opt.splitright = true
require "config.keymaps"
-- Global
vim.g.python3_host_prog = vim.fn.stdpath "config" .. "/.venv/bin/python"
vim.g.loaded_ruby_provider = 0
vim.g.loaded_perl_provider = 0
-- Keymaps
vim.keymap.set("i", "jk", "<esc>")
vim.keymap.set("n", "<leader>l", "<cmd>Lazy<CR>")
vim.keymap.set("n", "<leader>m", "<cmd>Mason<CR>")
vim.keymap.set("n", "<leader>s", "<cmd>Dashboard<CR>")
vim.keymap.set("n", "<leader>z", "<cmd>ZenMode<CR>")
vim.keymap.set("n", "<leader>g", "<cmd>Git<CR>")
vim.keymap.set({ "n", "t" }, "<A-h>", "<CMD>NavigatorLeft<CR>")
vim.keymap.set({ "n", "t" }, "<A-l>", "<CMD>NavigatorRight<CR>")
vim.keymap.set({ "n", "t" }, "<A-k>", "<CMD>NavigatorUp<CR>")
vim.keymap.set({ "n", "t" }, "<A-j>", "<CMD>NavigatorDown<CR>")
vim.keymap.set({ "n", "t" }, "<A-p>", "<CMD>NavigatorPrevious<CR>")
-- Telescope
vim.keymap.set("n", "<leader>;", "<cmd>Telescope builtin<cr>")
vim.keymap.set("n", "<leader>ff", "<cmd>Telescope find_files<cr>")
vim.keymap.set("n", "<leader>fb", "<cmd>Telescope buffers<cr>")
vim.keymap.set("n", "<leader>fl", "<cmd>Telescope lsp_document_symbols<cr>")
vim.keymap.set("n", "<leader>fe", "<cmd>Telescope diagnostics<cr>")
vim.keymap.set("n", "<leader>fs", "<cmd>Telescope treesitter<cr>")
vim.keymap.set("n", "<leader>fz", "<cmd>Telescope current_buffer_fuzzy_find<cr>")
-- Neotree
vim.keymap.set("n", "<leader>n", "<cmd>Neotree toggle<cr>")
vim.keymap.set("n", "<leader>\\", "<cmd>Neotree reveal<cr>")
-- Aerial
vim.keymap.set("n", "<leader>a", "<cmd>AerialToggle!<CR>")
-- diffview
vim.keymap.set("n", "<leader>do", "<cmd>DiffviewOpen<cr>")
vim.keymap.set("n", "<leader>dc", "<cmd>DiffviewClose<cr>")
vim.keymap.set("n", "<leader>dh", "<cmd>DiffviewFileHistory<cr>")
vim.keymap.set("n", "<leader>df", "<cmd>DiffviewFileHistory %<cr>")
-- Trouble
vim.keymap.set("n", "<leader>xx", "<cmd>TroubleToggle<cr>")
vim.keymap.set("n", "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<cr>")
vim.keymap.set("n", "<leader>xd", "<cmd>TroubleToggle document_diagnostics<cr>")
vim.keymap.set("n", "<leader>xq", "<cmd>TroubleToggle quickfix<cr>")
vim.keymap.set("n", "<leader>xl", "<cmd>TroubleToggle loclist<cr>")
-- nvim-test
vim.keymap.set("n", "<leader>ts", "<cmd>TestSuite<cr>")
vim.keymap.set("n", "<leader>tf", "<cmd>TestFile<cr>")
vim.keymap.set("n", "<leader>te", "<cmd>TestEdit<cr>")
vim.keymap.set("n", "<leader>tn", "<cmd>TestNearest<cr>")
vim.keymap.set("n", "<leader>tl", "<cmd>TestLast<cr>")
vim.keymap.set("n", "<leader>tv", "<cmd>TestVisit<cr>")
vim.keymap.set("n", "<leader>ti", "<cmd>TestInfo<cr>")

View file

@ -1,50 +0,0 @@
vim.keymap.set("i", "jk", "<esc>")
vim.keymap.set("n", "<leader>l", "<cmd>Lazy<CR>")
vim.keymap.set("n", "<leader>m", "<cmd>Mason<CR>")
vim.keymap.set({ "n", "t" }, "<A-h>", "<CMD>NavigatorLeft<CR>")
vim.keymap.set({ "n", "t" }, "<A-l>", "<CMD>NavigatorRight<CR>")
vim.keymap.set({ "n", "t" }, "<A-k>", "<CMD>NavigatorUp<CR>")
vim.keymap.set({ "n", "t" }, "<A-j>", "<CMD>NavigatorDown<CR>")
vim.keymap.set({ "n", "t" }, "<A-p>", "<CMD>NavigatorPrevious<CR>")
-- Telescope
vim.keymap.set("n", "<leader>;", "<cmd>Telescope builtin<cr>")
vim.keymap.set("n", "<leader>ff", "<cmd>Telescope find_files<cr>")
vim.keymap.set("n", "<leader>fb", "<cmd>Telescope buffers<cr>")
vim.keymap.set("n", "<leader>fg", "<cmd>Telescope live_grep<cr>")
vim.keymap.set("n", "<leader>fl", "<cmd>Telescope lsp_document_symbols<cr>")
vim.keymap.set("n", "<leader>fe", "<cmd>Telescope diagnostics<cr>")
vim.keymap.set("n", "<leader>fs", "<cmd>Telescope treesitter<cr>")
vim.keymap.set("n", "<leader>fz", "<cmd>Telescope current_buffer_fuzzy_find<cr>")
-- Neotree
vim.keymap.set("n", "<leader>n", "<cmd>Neotree toggle<cr>")
vim.keymap.set("n", "<leader>\\", "<cmd>Neotree reveal<cr>")
-- Git
vim.keymap.set("n", "<leader>gg", "<cmd>Git<cr>")
vim.keymap.set("n", "<leader>gc", "<cmd>Git commit<cr>")
vim.keymap.set("n", "<leader>gl", "<cmd>Git pull<cr>")
vim.keymap.set("n", "<leader>gp", "<cmd>Git push<cr>")
-- diffview
vim.keymap.set("n", "<leader>do", "<cmd>DiffviewOpen<cr>")
vim.keymap.set("n", "<leader>dc", "<cmd>DiffviewClose<cr>")
vim.keymap.set("n", "<leader>dh", "<cmd>DiffviewFileHistory<cr>")
vim.keymap.set("n", "<leader>df", "<cmd>DiffviewFileHistory %<cr>")
-- Trouble
vim.keymap.set("n", "<leader>xx", "<cmd>TroubleToggle<cr>")
vim.keymap.set("n", "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<cr>")
vim.keymap.set("n", "<leader>xd", "<cmd>TroubleToggle document_diagnostics<cr>")
vim.keymap.set("n", "<leader>xq", "<cmd>TroubleToggle quickfix<cr>")
vim.keymap.set("n", "<leader>xl", "<cmd>TroubleToggle loclist<cr>")
-- nvim-test
vim.keymap.set("n", "<leader>ts", "<cmd>TestSuite<cr>")
vim.keymap.set("n", "<leader>tf", "<cmd>TestFile<cr>")
vim.keymap.set("n", "<leader>te", "<cmd>TestEdit<cr>")
vim.keymap.set("n", "<leader>tn", "<cmd>TestNearest<cr>")
vim.keymap.set("n", "<leader>tl", "<cmd>TestLast<cr>")
vim.keymap.set("n", "<leader>tv", "<cmd>TestVisit<cr>")
vim.keymap.set("n", "<leader>ti", "<cmd>TestInfo<cr>")

View file

@ -8,4 +8,9 @@ return {
"habamax", "habamax",
}, },
}, },
ui = {
icons = {
lazy = "💤 ",
},
},
} }

View file

@ -0,0 +1,5 @@
return {
disable_in_macro = true,
disable_in_visualblock = true,
check_ts = true,
}

View file

@ -0,0 +1 @@
return {highlight = true}

View file

@ -4,4 +4,31 @@ return {
additional_vim_regex_highlighting = false, additional_vim_regex_highlighting = false,
disable = { "fortran" }, disable = { "fortran" },
}, },
incremental_selection = {
enable = true,
keymaps = {
init_selection = "gnn",
node_incremental = "gnr",
scope_incremental = "gnc",
node_decremental = "gnm",
},
},
indent = {
enable = true,
-- disable = { "python" },
},
refactor = {
smart_rename = {
enable = true,
keymaps = {
smart_rename = "grr",
},
},
navigation = {
enable = true,
keymaps = {
goto_definition_lsp_fallback = "gnd",
},
},
},
} }

View file

@ -0,0 +1,4 @@
return {
context = 10,
treesitter = true,
}

View file

@ -0,0 +1,27 @@
return {
window = {
options = {
signcolumn = "no", -- disable signcolumn
number = false, -- disable number column
relativenumber = false, -- disable relative numbers
cursorline = false, -- disable cursorline
cursorcolumn = false, -- disable cursor column
foldcolumn = "0", -- disable fold column
list = false, -- disable whitespace characters
},
},
plugins = {
options = {
enabled = true,
},
twilight = { enabled = true },
gitsigns = { enabled = true },
tmux = { enabled = true },
},
on_open = function (win)
vim.wo.scrolloff = 999
end,
on_close = function (win)
vim.wo.scrolloff = 0
end
}

View file

@ -1,5 +1,6 @@
local cmp = require "cmp" local cmp = require "cmp"
local luasnip = require "luasnip" local luasnip = require "luasnip"
local cmp_autopairs = require "nvim-autopairs.completion.cmp"
require("luasnip.loaders.from_vscode").lazy_load() require("luasnip.loaders.from_vscode").lazy_load()
@ -38,8 +39,6 @@ cmp.setup {
}, },
sources = { sources = {
{ name = "nvim_lsp" }, { name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "latex_symbols" },
}, },
} }
@ -47,8 +46,11 @@ cmp.setup {
cmp.setup.filetype("gitcommit", { cmp.setup.filetype("gitcommit", {
sources = { sources = {
{ name = "git" }, { name = "git" },
{ name = "spell" },
{ name = "commit" }, { name = "commit" },
{ name = "buffer" }, { name = "buffer" },
{ name = "luasnip" },
{ name = "latex_symbols" },
}, },
}) })
@ -56,6 +58,8 @@ cmp.setup.filetype("markdown", {
sources = { sources = {
{ name = "spell" }, { name = "spell" },
{ name = "buffer" }, { name = "buffer" },
{ name = "luasnip" },
{ name = "latex_symbols" },
}, },
}) })
@ -73,3 +77,5 @@ cmp.setup.cmdline(":", {
{ name = "cmdline" }, { name = "cmdline" },
}, },
}) })
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())

View file

@ -2,6 +2,7 @@ local null_ls = require "null-ls"
return { return {
null_ls.builtins.code_actions.gitsigns, null_ls.builtins.code_actions.gitsigns,
null_ls.builtins.diagnostics.zsh, null_ls.builtins.diagnostics.zsh,
null_ls.builtins.diagnostics.mypy,
null_ls.builtins.formatting.trim_whitespace, null_ls.builtins.formatting.trim_whitespace,
null_ls.builtins.hover.dictionary, null_ls.builtins.hover.dictionary,
} }

View file

@ -0,0 +1,17 @@
return {
"stevearc/aerial.nvim",
name = "aerial",
cmd = {
"AerialOpen",
"AerialOpenAll",
"AerialNext",
"AerialPrev",
"AerialGo",
"AerialInfo",
"AerialToggle",
},
config = function()
require("aerial").setup(require "config.aerial")
vim.keymap.set("n", "<leader>fa", "<cmd>Telescope aerial<cr>")
end,
}

View file

@ -0,0 +1,11 @@
return {
"utilyre/barbecue.nvim",
name = "barbecue",
version = "*",
dependencies = {
"SmiteshP/nvim-navic",
"nvim-tree/nvim-web-devicons",
},
event = { "BufReadPre", "BufNewFile" },
opts = require "config.barbecue",
}

View file

@ -1,6 +1,7 @@
return { return {
"glepnir/dashboard-nvim", "glepnir/dashboard-nvim",
event = "VimEnter", event = "VimEnter",
cmd = "Dashboard",
dependencies = { "nvim-tree/nvim-web-devicons" }, dependencies = { "nvim-tree/nvim-web-devicons" },
config = function() require("dashboard").setup(require "config.dashboard") end, config = function() require("dashboard").setup(require "config.dashboard") end,
} }

View file

@ -2,8 +2,8 @@ return {
"sindrets/diffview.nvim", "sindrets/diffview.nvim",
dependencies = { "nvim-lua/plenary.nvim", "nvim-tree/nvim-web-devicons" }, dependencies = { "nvim-lua/plenary.nvim", "nvim-tree/nvim-web-devicons" },
cmd = { cmd = {
"DiffviewOpen",
"DiffviewFileHistory", "DiffviewFileHistory",
"DiffviewOpen",
}, },
config = function() require("diffview").setup(require "config.diffview") end, config = function() require("diffview").setup(require "config.diffview") end,
} }

View file

@ -1,5 +1,6 @@
return { return {
"feline-nvim/feline.nvim", "feline-nvim/feline.nvim",
dependencies = { require "plugins.catppuccin" }, dependencies = { require "plugins.catppuccin" },
event = { "BufReadPre", "BufNewFile" },
config = function() require("feline").setup(require "config.feline") end, config = function() require("feline").setup(require "config.feline") end,
} }

View file

@ -1,13 +1,5 @@
return { return {
{
"tpope/vim-fugitive", "tpope/vim-fugitive",
}, cmd = {"G", "Git"},
{ lazy = true,
"tpope/vim-rhubarb",
dependencies = "tpope/vim-fugitive",
},
{
"shumphrey/fugitive-gitlab.vim",
dependencies = "tpope/vim-fugitive",
},
} }

View file

@ -4,10 +4,10 @@ return {
event = { "BufReadPre", "BufNewFile" }, event = { "BufReadPre", "BufNewFile" },
cmd = { cmd = {
"LspLog", "LspLog",
"LspInfo",
"LspStop", "LspStop",
"LspStart", "LspStart",
"LspRestart", "LspRestart",
"LspInfo",
}, },
dependencies = { dependencies = {
{ "hrsh7th/nvim-cmp" }, { "hrsh7th/nvim-cmp" },

View file

@ -1,7 +1,9 @@
return { return {
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
lazy = false, cmd = {
"Mason",
},
config = function() require("mason").setup(require "config.mason") end, config = function() require("mason").setup(require "config.mason") end,
}, },
{ {

View file

@ -0,0 +1,9 @@
return {
"windwp/nvim-autopairs",
lazy = true,
dependencies = {
"nvim-treesitter/nvim-treesitter",
"hrsh7th/nvim-cmp",
},
config = function() require("nvim-autopairs").setup(require "config.nvim-autopairs") end,
}

View file

@ -0,0 +1,6 @@
return {
"SmiteshP/nvim-navic",
dependencies = "neovim/nvim-lspconfig",
lazy = true,
opts = require "config.nvim-navic",
}

View file

@ -1,13 +1,13 @@
return { return {
"klen/nvim-test", "klen/nvim-test",
cmd = { cmd = {
"TestSuite",
"TestFile", "TestFile",
"TestEdit", "TestEdit",
"TestNearest", "TestNearest",
"TestLast", "TestLast",
"TestVisit", "TestVisit",
"TestInfo", "TestInfo",
"TestSuite",
}, },
config = function() require("nvim-test").setup(require "config.nvim_test") end, config = function() require("nvim-test").setup(require "config.nvim_test") end,
} }

View file

@ -1,29 +1,16 @@
return { return {
-- Telescope plugin
{
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
branch = "0.1.x", branch = "0.1.x",
dependencies = {
{ "nvim-lua/plenary.nvim" },
},
cmd = "Telescope", cmd = "Telescope",
config = function() config = function() require("telescope").setup(require "config.telescope") end,
require("telescope").setup(require "config.telescope") dependencies = {
require("telescope").load_extension "notify" {
require("telescope").load_extension "fzf" "nvim-lua/plenary.nvim",
require("telescope").load_extension "lazy"
require("telescope").load_extension "luasnip"
require("telescope").load_extension "git_diffs"
require("telescope").load_extension "command_center"
require("telescope").load_extension "http"
end,
},
-- Additional telescope extensions
{ {
"nvim-telescope/telescope-fzf-native.nvim", "nvim-telescope/telescope-fzf-native.nvim",
build = "make", build = "make",
dependencies = { "nvim-telescope/telescope.nvim" }, dependencies = { "nvim-telescope/telescope.nvim" },
lazy = true, config = function() require("telescope").load_extension "fzf" end,
}, },
{ {
"tsakirist/telescope-lazy.nvim", "tsakirist/telescope-lazy.nvim",
@ -31,7 +18,7 @@ return {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
"folke/lazy.nvim", "folke/lazy.nvim",
}, },
lazy = true, config = function() require("telescope").load_extension "lazy" end,
}, },
{ {
"benfowler/telescope-luasnip.nvim", "benfowler/telescope-luasnip.nvim",
@ -39,7 +26,7 @@ return {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
"L3MON4D3/LuaSnip", "L3MON4D3/LuaSnip",
}, },
lazy = true, config = function() require("telescope").load_extension "luasnip" end,
}, },
{ {
"paopaol/telescope-git-diffs.nvim", "paopaol/telescope-git-diffs.nvim",
@ -47,16 +34,23 @@ return {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
"sindrets/diffview.nvim", "sindrets/diffview.nvim",
}, },
lazy = true, config = function() require("telescope").load_extension "git_diffs" end,
}, },
{ {
"FeiyouG/command_center.nvim", "FeiyouG/command_center.nvim",
dependencies = { "nvim-telescope/telescope.nvim" }, dependencies = { "nvim-telescope/telescope.nvim" },
lazy = true, config = function() require("telescope").load_extension "command_center" end,
}, },
{ {
"barrett-ruth/telescope-http.nvim", "barrett-ruth/telescope-http.nvim",
dependencies = { "savq/paq-nvim", "nvim-telescope/telescope.nvim" }, dependencies = { "savq/paq-nvim", "nvim-telescope/telescope.nvim" },
lazy = true, config = function() require("telescope").load_extension "http" end,
},
{
"aaronhallaert/advanced-git-search.nvim",
dependencies = { "nvim-telescope/telescope.nvim" },
config = function() require("telescope").load_extension "advanced_git_search" end,
},
},
}, },
} }

View file

@ -2,12 +2,15 @@ return {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
event = { "BufReadPre", "BufNewFile" }, event = { "BufReadPre", "BufNewFile" },
cmd = { cmd = {
"TSEnable",
"TSToggle", "TSToggle",
"TSBufEnable", "TSBufEnable",
"TSBufToggle", "TSBufToggle",
"TSInstall", "TSInstall",
"TSUpdate", "TSUpdate",
"TSEnable",
}, },
config = function() require("nvim-treesitter.configs").setup(require "config.treesitter") end, config = function() require("nvim-treesitter.configs").setup(require "config.treesitter") end,
dependencies = {
"nvim-treesitter/nvim-treesitter-refactor",
},
} }

View file

@ -0,0 +1,13 @@
return {
"folke/zen-mode.nvim",
cmd = "ZenMode",
config = function() require("zen-mode").setup(require "config.zen_mode") end,
dependencies = {
"folke/twilight.nvim",
cmd = "Twilight",
config = function() require("twilight").setup(require "config.twilight") end,
dependencies = {
"nvim-treesitter",
},
},
}

View file

@ -286,24 +286,24 @@ function M.get()
-- ######## Left -- ######## Left
-- treesitter position -- treesitter position
components.active[1][14] = { -- components.active[1][14] = {
provider = function() -- provider = function()
-- if not require("vim.treesitter.language").require_language("lua") then -- -- if not require("vim.treesitter.language").require_language("lua") then
-- -- return ""
-- -- end
-- local pos = require("nvim-treesitter").statusline {
-- indicator_size = 50,
-- transform_fn = function(line) return line:gsub("%s*[%[%(%{]+.*$", "") end,
-- }
-- if pos and pos ~= "" then return pos end
-- return "" -- return ""
-- end -- end,
local pos = require("nvim-treesitter").statusline { -- hl = {
indicator_size = 50, -- fg = sett.extras,
transform_fn = function(line) return line:gsub("%s*[%[%(%{]+.*$", "") end, -- bg = sett.bkg,
} -- },
if pos and pos ~= "" then return pos end -- left_sep = invi_sep,
return "" -- }
end,
hl = {
fg = sett.extras,
bg = sett.bkg,
},
left_sep = invi_sep,
}
-- ######## Right -- ######## Right

View file

@ -18,14 +18,15 @@ M.setup = function(scheme)
}, #tabs + 1) }, #tabs + 1)
local elements = {} local elements = {}
table.insert(elements, "ResetAttributes") table.insert(elements, "ResetAttributes")
table.insert(elements, { Background = { Color = colours[tab.tab_index + 1] } })
table.insert(elements, { Foreground = { Color = text_fg } })
table.insert(elements, { Text = " " })
if tab.is_active then if tab.is_active then
table.insert(elements, { Attribute = { Underline = "Single" } }) table.insert(elements, { Attribute = { Underline = "Single" } })
table.insert(elements, { Attribute = { Intensity = "Bold" } }) table.insert(elements, { Attribute = { Intensity = "Bold" } })
end end
if hover then table.insert(elements, { Attribute = { Italic = true } }) end if hover then table.insert(elements, { Attribute = { Italic = true } }) end
table.insert(elements, { Background = { Color = colours[tab.tab_index + 1] } }) table.insert(elements, { Text = title })
table.insert(elements, { Foreground = { Color = text_fg } })
table.insert(elements, { Text = " " .. title })
table.insert(elements, "ResetAttributes") table.insert(elements, "ResetAttributes")
table.insert(elements, { Background = { Color = colours[tab.tab_index + 2] } }) table.insert(elements, { Background = { Color = colours[tab.tab_index + 2] } })
table.insert(elements, { Foreground = { Color = colours[tab.tab_index + 1] } }) table.insert(elements, { Foreground = { Color = colours[tab.tab_index + 1] } })

109
packages/direnv.sh Executable file
View file

@ -0,0 +1,109 @@
#!/usr/bin/env bash
#
# A good old bash | curl script for direnv.
#
set -euo pipefail
{ # Prevent execution if this script was only partially downloaded
log() {
echo "[installer] $*" >&2
}
die() {
log "$@"
exit 1
}
at_exit() {
ret=$?
if [[ $ret -gt 0 ]]; then
log "the script failed with error $ret.\n" \
"\n" \
"To report installation errors, submit an issue to\n" \
" https://github.com/direnv/direnv/issues/new/choose"
fi
exit "$ret"
}
trap at_exit EXIT
kernel=$(uname -s | tr "[:upper:]" "[:lower:]")
case "${kernel}" in
mingw*)
kernel=windows
;;
esac
case "$(uname -m)" in
x86_64)
machine=amd64
;;
i686 | i386)
machine=386
;;
aarch64 | arm64)
machine=arm64
;;
*)
die "Machine $(uname -m) not supported by the installer.\n" \
"Go to https://direnv for alternate installation methods."
;;
esac
log "kernel=$kernel machine=$machine"
: "${use_sudo:=}"
: "${bin_path:=}"
if [[ -z "$bin_path" ]]; then
log "bin_path is not set, you can set bin_path to specify the installation path"
log "e.g. export bin_path=/path/to/installation before installing"
log "looking for a writeable path from PATH environment variable"
for path in $(echo "$PATH" | tr ':' '\n'); do
if [[ -w $path ]]; then
bin_path=$path
break
fi
done
fi
if [[ -z "$bin_path" ]]; then
die "did not find a writeable path in $PATH"
fi
echo "bin_path=$bin_path"
if [[ -n "${version:-}" ]]; then
release="tags/${version}"
else
release="latest"
fi
echo "release=$release"
log "looking for a download URL"
download_url=$(
curl -fL "https://api.github.com/repos/direnv/direnv/releases/$release" \
| grep browser_download_url \
| cut -d '"' -f 4 \
| grep "direnv.$kernel.$machine"
)
echo "download_url=$download_url"
log "downloading"
curl -o "$bin_path/direnv" -fL "$download_url"
chmod a+x "$bin_path/direnv"
cat <<DONE
The direnv binary is now available in:
$bin_path/direnv
The last step is to configure your shell to use it. For example for bash, add
the following lines at the end of your ~/.bashrc:
eval "\$(direnv hook bash)"
Then restart the shell.
For other shells, see https://direnv.net/docs/hook.html
Thanks!
DONE
}

20
packages/pipx.sh Executable file
View file

@ -0,0 +1,20 @@
#!/bin/bash
command -v python3 > /dev/null || {
echo "python3 executable not found, exiting"
exit 1
}
python3 -c "import sys; assert sys.version_info[0] >= 3 and sys.version_info[1] >= 7" || {
echo python3 --version
echo "python version too old, requires >=3.7"
exit 1
}
USERSITE=$(python3 -c "import site; print(site._get_path(site._getuserbase()))")
mkdir -p $USERSITE
if [[ ! -e "$USERSITE/pipx" ]]
then
python3 -m pip install --user pipx
fi

View file

@ -7,6 +7,7 @@
index_main() { index_main() {
set -e set -e
curl -s -S -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash curl -s -S -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
echo "suggested install to build python: base-devel openssl zlib xz tk"
} }
index_main index_main

View file

@ -1,9 +0,0 @@
python
python-pip
python-pynvim
python-virtualenv
base-devel
openssl
zlib
xz
tk

26
ssh/config.d/ukaea.conf Normal file
View file

@ -0,0 +1,26 @@
# vim: ft=sshconfig
Host heimdall
HostName heimdall003.jet.uk
Host heimdall???
HostName %h.jet.uk
Host batch
User cxsbatch
HostName heimdall115.jetdata.eu
Host jdc
HostName 10.40.4.103
Host freia
HostName freia022.hpc.l
Host freia???
HostName %h.hpc.l
Host heimdall* jdc* freia* batch
User elitherl
ForwardX11 yes
ForwardX11Timeout 0
Compression yes

8
ssh/config.d/xenia.conf Normal file
View file

@ -0,0 +1,8 @@
# vim: ft=sshconfig
Host xenia
User xenia
HostName 192.168.1.230
Port 30
ForwardX11 no
ForwardAgent yes