Browse Source

Merge branch 'master' of ssh://git.jonathanh.co.uk:2222/jab2870/Dotfiles

master
Jonathan Hodgson 8 months ago
parent
commit
64c6291a20
  1. 80
      bin/.bin/screenrecord
  2. 15
      nvim/.config/nvim/after/plugin/lsp.vim
  3. 2
      nvim/.config/nvim/pack/bundle/opt/deoplete-lsp
  4. 2
      nvim/.config/nvim/pack/bundle/opt/deoplete.nvim
  5. 2
      nvim/.config/nvim/pack/bundle/opt/firenvim
  6. 2
      nvim/.config/nvim/pack/bundle/opt/fzf.vim
  7. 2
      nvim/.config/nvim/pack/bundle/opt/lexima.vim
  8. 2
      nvim/.config/nvim/pack/bundle/opt/nvim-lspconfig
  9. 2
      nvim/.config/nvim/pack/bundle/opt/ultisnips
  10. 2
      nvim/.config/nvim/pack/bundle/opt/vim-fugitive
  11. 2
      nvim/.config/nvim/pack/bundle/opt/vim-repeat
  12. 2
      nvim/.config/nvim/pack/bundle/opt/vim-snippets
  13. 2
      nvim/.config/nvim/pack/bundle/opt/vim-vinegar
  14. 3
      nvim/.config/nvim/plugin/deoplete.vim
  15. 3
      nvim/.config/nvim/plugin/settings.vim
  16. 12
      shells/shared/aliases
  17. 10
      shells/shared/environmentVariables
  18. 20
      shells/zsh/includes/currentwordcompletion.zsh
  19. 2
      shells/zsh/includes/keybindings.zsh
  20. 19
      shells/zsh/includes/navi.zsh
  21. 2
      shells/zsh/plugins/fzf-tab
  22. 2
      shells/zsh/plugins/git-fuzzy
  23. 9
      tridactyl/.config/tridactyl/tridactylrc

80
bin/.bin/screenrecord

@ -0,0 +1,80 @@
#!/bin/bash
# A simple wrapper around ffmpeg
#
# When run, a screenrecording will be made
# The file path will be put in the primary selection
# Will create notification containing file path
#
# If you have a project specified, it will put the sceenshot in that folder instead of /tmp
#
# Relies on ffmpeg for taking screenrecording
PIDFILE="/tmp/screenrecord.pid"
if [ -f "$PIDFILE" ]; then
pkill ffmpeg
exit
fi
echo $$ > "$PIDFILE"
path='/tmp'
command -v ffmpeg > /dev/null || ( echo -n "You need to install ffmpeg" && exit 1 )
#If a project is set we will put screenshots in the project's folder
command -v project > /dev/null && project=$(project current --path)
if [ -n "$project" ]; then
path="$project/screenrecordings"
#Make the directory if it doesn't exist
mkdir "$path" 2> /dev/null
fi
filename="$(date +"%Y-%m-%dT%H-%M-%SZ").mkv"
file="${path}/${filename}"
[ "$1" = "-w" ] && sleep "$2" && shift && shift
case $1 in
"select")
if [ -n "$WAYLAND_DISPLAY" ]; then
echo "Shouldn't get here"
echo "No wayland support yet" >&2
exit
else
echo "I get here"
ffmpeg -framerate 30 -f x11grab $(slop -l -c "0.41,0.62,0.42,0.2" -f "-video_size %wx%h -i :0.0+%x,%y") "$file"
fi
;;
*)
if [ -n "$WAYLAND_DISPLAY" ]; then
echo "No wayland support yet" >&2
exit
else
ffmpeg -framerate 30 -f x11grab -video_size "$(xdpyinfo | grep dimensions | awk '{print $2}')" -i :0.0 "$file"
fi
;;
esac
if [ -f "$file" ]; then
# Create a gif
ffmpeg -i "$file" -vf "fps=10,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 "${file%.*}".gif
if [ -n "$WAYLAND_DISPLAY" ]; then
# Copies the image to your clipboard (ctrl + v)
wl-copy < "${file%.*}.gif"
# Copies the filename to primary selection (shift + insert or middle mouse)
echo -n "${file%.*}.gif" | wl-copy --primary
else
# Copies the image to your clipboard (ctrl + v)
xclip -selection clipboard -target image/gif -i "${file%.*}.gif"
# Copies the filename to primary selection (shift + insert or middle mouse)
echo -n "${file%.*}.gif" | xclip -selection primary
fi
# Creates notification with file name
notify-send "New Screenrecording" "$file\n${file%.*}.gif"
fi
rm "$PIDFILE"

15
nvim/.config/nvim/after/plugin/lsp.vim

@ -3,18 +3,21 @@ if !has('nvim')
finish
endif
lua <<EOF
if ( vim.lsp == nil ) then
vim.api.nvim_command("finish")
end
-- Bash Language Server
require'nvim_lsp'.bashls.setup{}
require'lspconfig'.bashls.setup{}
-- Clang Language Server
require'nvim_lsp'.clangd.setup{}
require'lspconfig'.clangd.setup{}
-- Go Language Server
require'nvim_lsp'.gopls.setup{}
require'lspconfig'.gopls.setup{}
-- Python Language Server
require'nvim_lsp'.pyls.setup{}
--require'lspconfig'.pyls.setup{}
-- Vim Language Server
require'nvim_lsp'.vimls.setup{}
require'lspconfig'.vimls.setup{}
-- VUE Language Server
require'nvim_lsp'.vuels.setup{}
require'lspconfig'.vuels.setup{}
EOF
function! s:ConfigureBuffer()
nnoremap <buffer> <silent> <c-]> <cmd>lua vim.lsp.buf.definition()<CR>

2
nvim/.config/nvim/pack/bundle/opt/deoplete-lsp

@ -1 +1 @@
Subproject commit fb51bfebd8ac57282154d119f80368b4b94199b7
Subproject commit a716897b958d1f1c0809d92a70e8d849a3d652e2

2
nvim/.config/nvim/pack/bundle/opt/deoplete.nvim

@ -1 +1 @@
Subproject commit 51440bb8d9bc5e421d31d1a2a60a204468624e1b
Subproject commit 4caf12730256579921d77e80423b339b8128c5b6

2
nvim/.config/nvim/pack/bundle/opt/firenvim

@ -1 +1 @@
Subproject commit 5e6fac425119bcbd03a6b7e4d293de0c63cbc5ff
Subproject commit 22e7618fc338baea39c46d0c7369f134b7d18f44

2
nvim/.config/nvim/pack/bundle/opt/fzf.vim

@ -1 +1 @@
Subproject commit 7d45724fdd323d5eb7d39c8caa2e38e63c5e84a7
Subproject commit e34f6c129d39b90db44df1107c8b7dfacfd18946

2
nvim/.config/nvim/pack/bundle/opt/lexima.vim

@ -1 +1 @@
Subproject commit 89bf4dc13539131a29cf938074b3f1ce9d000bfd
Subproject commit 6b716e2118d842a26620387f0845e57cfd69ffaf

2
nvim/.config/nvim/pack/bundle/opt/nvim-lspconfig

@ -1 +1 @@
Subproject commit 60133c47e0fd82556d7ca092546ebfa8d047466e
Subproject commit ea72eaae8809c0e475a8248aa665034d7d4520db

2
nvim/.config/nvim/pack/bundle/opt/ultisnips

@ -1 +1 @@
Subproject commit c270950492d71bac0317d47d42cd0884eefe6490
Subproject commit 8803960a4e09daf1ad4d82e16a25bbdb4c78530e

2
nvim/.config/nvim/pack/bundle/opt/vim-fugitive

@ -1 +1 @@
Subproject commit 1a77f1c00e12e8460f39098ec3289c5433d32512
Subproject commit 6c53da0783a15d2dcde504ae299468ac69078ebe

2
nvim/.config/nvim/pack/bundle/opt/vim-repeat

@ -1 +1 @@
Subproject commit c947ad2b6a16983724a0153bdf7f66d7a80a32ca
Subproject commit 24afe922e6a05891756ecf331f39a1f6743d3d5a

2
nvim/.config/nvim/pack/bundle/opt/vim-snippets

@ -1 +1 @@
Subproject commit 0c5114e90837eac9af2150406f7821041e7e720b
Subproject commit 75309fc96c49725cf9bbd7bc881b7b342a60aa9a

2
nvim/.config/nvim/pack/bundle/opt/vim-vinegar

@ -1 +1 @@
Subproject commit 5fee9d230ec4a6a16c45f2c71482595e4d9a67bd
Subproject commit b245f3ab4580eba27616a5ce06a56d5f791e67bd

3
nvim/.config/nvim/plugin/deoplete.vim

@ -5,3 +5,6 @@ endif
" Make deoplete start at startup
let g:deoplete#enable_at_startup = 1
" Closes the preview window once a completion is done
autocmd CompleteDone * silent! pclose!

3
nvim/.config/nvim/plugin/settings.vim

@ -52,6 +52,9 @@ set formatoptions+=o
" Show the results of the substitute command as you type
set inccommand=nosplit
" Sets the default fold method to indent
set foldmethod=indent
if executable('rg')
set grepprg=rg\ --vimgrep\ --no-heading\ --color=never\ --glob=\"!shell-logs/*\"
set grepformat=%f:%l:%c:%m,%f:%l:%m

12
shells/shared/aliases

@ -33,6 +33,8 @@ alias imapfilter="imapfilter -c \"$XDG_CONFIG_HOME/imapfilter/config.lua\""
# Makes rem output color by default
alias rem="rem -@ -gaadd"
# Make df show human readable format
alias df="df -h"
####################
# Path Shortcuts #
@ -112,6 +114,7 @@ type -p exa > /dev/null && alias tree="exa -FT" || alias tree='tree -F -C'
# If nvim is available, alias vim to neovim
type -p nvim > /dev/null && alias vim="nvim"
type -p nvim > /dev/null && alias vimdiff="nvim -d"
# Trash instead of rm
type -p rmtrash > /dev/null && alias rm="rmtrash"
@ -124,6 +127,7 @@ type -p sc-im > /dev/null && alias sc="sc-im"
# versions
type -p mycli > /dev/null && alias mysql="echo \"You might want to use mycli instead\"; /usr/bin/mysql"
type -p pgcli > /dev/null && alias postgres="echo \"You might want to use pgcli instead\"; /usr/bin/postgres"
type -p ncdu > /dev/null && alias du="echo \"You might want to use ncdu instead\"; /usr/bin/du"
# These are the gnu coreutils mv and cp with a progress bar patched in
type -p mvg > /dev/null && alias mv="mvg -g"
@ -192,7 +196,7 @@ alias rot13="tr 'A-Za-z' 'N-ZA-Mn-za-m'"
# Make sqlmap put output in the current project folder
alias sqlmap="[ -L ~/Projects/current ] && sqlmap --output-dir=\"~/Projects/current/sqlmap\""
# Cd into the current project
alias pp="[ -L ~/Projects/current ] && cd \$(readlink ~/Projects/current) || cd ~/Projects"
alias pp="[ -L ~/Projects/current ] && cd \"\$(readlink ~/Projects/current)\" || cd ~/Projects"
# Automatically switch project based on current location
alias pa="project switch --auto"
# Change project using fzf
@ -209,6 +213,8 @@ if [ -f "$HOME/GitRepos/openssl-weak/openssl-1.0.2-chacha/apps/openssl" ]; then
alias weakopenssl="$HOME/GitRepos/openssl-weak/openssl-1.0.2-chacha/apps/openssl"
alias testssl="testssl --openssl=\"$HOME/GitRepos/openssl-weak/openssl-1.0.2-chacha/apps/openssl\""
alias verifySSL="verifySSL --openssl \"$HOME/GitRepos/openssl-weak/openssl-1.0.2-chacha/apps/openssl\""
else
alias testssl="docker run --rm -ti -v \$PWD:/data drwetter/testssl.sh"
fi
@ -281,6 +287,10 @@ alias chrome-curl="node $HOME/GitRepos/chrome-curl/index.js"
# Plays a youtube video or playlist - audio only
alias ytaudio='mpv --ytdl-format="bestaudio"'
alias asciicast2gif='docker run --rm -v $PWD:/data asciinema/asciicast2gif'
alias anboxPrepare='sudo modprobe -a binder && sudo mkdir /dev/binderfs && sudo chmod 755 /dev/binderfs && sudo mount -t binder none /dev/binderfs && mount | grep binderfs && sudo systemctl start systemd-networkd anbox-container-manager'
if type grc > /dev/null 2>&1; then
for cmd in "nmap" "ping" "traceroute" "mount" "netstat" "ps" "dig" "du" "df" "ip" "iptables" "lsblk" "id" "free" "tcpdump" "uptime" "showmount" "whois" ; do
alias "$cmd"="grc $(whence $cmd)"

10
shells/shared/environmentVariables

@ -18,7 +18,7 @@ for d in "$HOME"/.bin/*/; do
mypath+=":$d"
done
export PATH=~/Projects/current/bin:$mypath:$GOPATH/bin:$HOME/.local/share/bin:$PATH:.
export PATH=~/Projects/current/bin:$mypath:$GOPATH/bin:$HOME/.local/share/bin:$HOME/.config/composer/vendor/bin:$PATH:.
#Ruby things
if type -p ruby > /dev/null; then
@ -46,6 +46,14 @@ export LESS_TERMCAP_us=$'\e[1;32m'
export DOTFILES="$HOME/.dotfiles"
# Telemetry
export DO_NOT_TRACK=1 # Hopefully this will take on: https://consoledonottrack.com/
export MSSQL_CLI_TELEMETRY_OPTOUT=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export POWERSHELL_CLI_TELEMETRY_OPTOUT=1
#export GTK_THEME=Adapta-Nokto
if [ -n "$GTK_MODULES" ]
then
export GTK_MODULES="$GTK_MODULES:unity-gtk-module"

20
shells/zsh/includes/currentwordcompletion.zsh

@ -10,6 +10,25 @@ wordlistSelect() {
fd -a --type f --hidden --follow --color=always --exclude .git --exclude \*.md --exclude \*.gif --exclude \*.jpg --exclude \*.png --exclude \*.lua --exclude \*.jar --exclude \*.pl '' /usr/share/wordlists/ | fzf --preview 'bat --color=always {}'
}
regexSelect(){
(
echo -e "Name\tRegex\tNotes"
echo -ne "IP Address\t"
echo -n '(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])'
echo -e "\tRequires extended regex -E in grep"
echo -ne "URLs\t"
echo -n 'https?://[^\"\\'"'"'> ]+'
echo -e "\tRequires extended regex -E in grep"
echo -ne "AWS Keys\t"
echo -n '([^A-Z0-9]|^)(AKIA|A3T|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{12,}'
echo -e "\tRequires extended regex -E in grep"
) | column -t -s $'\t' | fzf --preview-window top:1 --preview 'echo {3}' --delimiter ' +' --header-lines 1 --with-nth 1,2 | awk -F ' +' '{print "\"" $2 "\""}'
}
word_replace(){
local ret=1
local word="$1"
@ -17,6 +36,7 @@ word_replace(){
case "$word" in
wl) wordlistSelect; return 0 ;;
myip) ip route | grep -oE '(dev|src) [^ ]+' | sed 'N;s/\n/,/;s/src //;s/dev //' | awk -F',' '{print $2 " " $1}' | sort -u | fzf -1 --no-preview | cut -d' ' -f1; return 0 ;;
regex) regexSelect; return 0 ;;
esac
return "$ret"
}

2
shells/zsh/includes/keybindings.zsh

@ -121,7 +121,7 @@ bindkey '\em' make_current_word_directory
swap_command(){
# Each group should be seperated by a colon with each item in a group
# seperated by a space
local groups="cd vim ls:ping mtr"
local groups="cd vim ls:ping mtr:mysql mycli postgres pgcli:du:ncdu"
local tokens=(${(z)LBUFFER})
local cmd="${tokens[1]}"
local newindex=0

19
shells/zsh/includes/navi.zsh

@ -0,0 +1,19 @@
#!/usr/bin/env zsh
#_call_navi() {
# local selected
# if [ -n "$LBUFFER" ]; then
# if selected="$(printf "%s" "$(navi --print --fzf-overrides '--no-select-1' --query "${LBUFFER}" </dev/tty)")"; then
# LBUFFER="$selected"
# fi
# else
# if selected="$(printf "%s" "$(navi --print </dev/tty)")"; then
# LBUFFER="$selected"
# fi
# fi
# zle redisplay
#}
#
#zle -N _call_navi
#
#bindkey '^n' _call_navi

2
shells/zsh/plugins/fzf-tab

@ -1 +1 @@
Subproject commit 83c98a4dbf703d58795e8d9482135b72c6a0a433
Subproject commit 89a33154707c09789177a893e5a8ebbb131d5d3d

2
shells/zsh/plugins/git-fuzzy

@ -1 +1 @@
Subproject commit 64b48d1d61fa830d9f157b5d59410b44c2088b72
Subproject commit 6bf6db61d3bd9a16203130587ccfbc02f4ca9a57

9
tridactyl/.config/tridactyl/tridactylrc

@ -9,7 +9,7 @@ colours dark
set newtab about:blank
set browser firefox-developer-edition
set allowautofocus false
"set allowautofocus false
set editorcmd $HOME/.bin/gnvim
set smoothscroll true
set newtabfocus page
@ -39,6 +39,9 @@ set searchurls.cve https://www.cvedetails.com/cve-details.php?t=1&cve_id=%s
set searchurls.cvep https://www.cvedetails.com/product-search.php?vendor_id=0&search=%s
set searchurls.video https://www.google.com/search?hl=en&q=intext%3A%22%s%22%20intitle%3A%22index.of%22%20%2B(wmv%7Cmpg%7Cavi%7Cmp4%7Cmkv%7Cmov)%20%2Dinurl%3A(jsp%7Cpl%7Cphp%7Chtml%7Caspx%7Chtm%7Ccf%7Cshtml)
set searchurls.audio https://www.google.com/search?hl=en&ei=cSj3X5L0HYXykwXRpKvYAg&q=intext%3A%22%s%22+intitle%3A%22index.of.%2F%22+%28ac3%7Cflac%7Cm4a%7Cmp3%7Cogg%7Cwav%7Cwma%29+-inurl%3A%28jsp%7Cpl%7Cphp%7Chtml%7Caspx%7Chtm%7Ccf%7Cshtml%29&oq=intext%3A%22test%22+intitle%3A%22index.of.%2F%22+%28ac3%7Cflac%7Cm4a%7Cmp3%7Cogg%7Cwav%7Cwma%29+-inurl%3A%28jsp%7Cpl%7Cphp%7Chtml%7Caspx%7Chtm%7Ccf%7Cshtml%29&gs_lcp=CgZwc3ktYWIQA1CGD1jzEGDBEmgAcAB4AIABAIgBAJIBAJgBAaABAaoBB2d3cy13aXrAAQE&sclient=psy-ab&ved=0ahUKEwjS8PamkYruAhUF-aQKHVHSCisQ4dUDCAw&uact=5
set searchurls.red https://www.reddit.com/search/?q=%s
set searchurls.sred https://www.reddit.com/r/%s1/
set searchurls.sreds https://www.reddit.com/r/%s1/search?q=%s2&restrict_sr=on
""""""""""""""
" Commands "
@ -81,8 +84,8 @@ bind <space>G composite js "git clone " + document.location.href.replace(/https?
bind <space>c composite hint_focus; !s xdotool key Menu
" Makes link hints only hint links on duck duck go
bindurl ^https://duckduckgo.com f hint -Jc [class=result__a]
bindurl ^https://duckduckgo.com F hint -Jbc [class=result__a]
""bindurl ^https://duckduckgo.com f hint -Jc [class=result__a]
""bindurl ^https://duckduckgo.com F hint -Jbc [class=result__a]
autocmd DocStart .*github\.com.* zoom 150

Loading…
Cancel
Save