diff options
Diffstat (limited to 'config')
| -rw-r--r-- | config/essentials/git/config | 2 | ||||
| -rw-r--r-- | config/essentials/shell/aliases.sh | 4 | ||||
| -rw-r--r-- | config/essentials/shell/functions.sh | 14 | ||||
| -rw-r--r-- | config/essentials/vis/visrc.lua | 29 | ||||
| -rw-r--r-- | config/home/.mbsyncrc | 50 | ||||
| -rw-r--r-- | config/home/.zshenv | 3 | 
6 files changed, 81 insertions, 21 deletions
diff --git a/config/essentials/git/config b/config/essentials/git/config index 99cf21e..2b2b202 100644 --- a/config/essentials/git/config +++ b/config/essentials/git/config @@ -9,7 +9,7 @@  [pull]  	rebase = false  [merge] -	ff = false +	ff = true  [alias]  	change-commits = "!f() { VAR1=$1; VAR='$'$1; OLD=$2; NEW=$3; echo \"Are you sure for replace $VAR  $OLD => $NEW ?(Y/N)\";read OK;if [ \"$OK\" = 'Y' ] ; then shift 3; git filter-branch  --env-filter \"if [ \\\"${VAR}\\\" = '$OLD' ]; then export $VAR1='$NEW';echo 'to $NEW'; fi\" $@; fi;};  f "  [commit] diff --git a/config/essentials/shell/aliases.sh b/config/essentials/shell/aliases.sh index ddc605a..7ddd2f2 100644 --- a/config/essentials/shell/aliases.sh +++ b/config/essentials/shell/aliases.sh @@ -147,7 +147,6 @@ alias mdb='mariadb -u admin -ppass admindb'  alias mdbw='mariadb -h 0.0.0.0 -u padmin -pbulbizarre padmindb'  alias mdbwa='mariadb -h 10.3.50.5 -u padmin -pbulbizarre padmindb'  alias tmux='pgrep tmux && tmux attach || tmux new-session' -alias wd='dict'  # ssh  alias sha='ssh-add' @@ -184,7 +183,7 @@ alias kll='killall'  alias pi='ping 9.9.9.9 -c4'  alias sba='source env/bin/activate || source bin/activate' -alias zsr='source ${ZDOTDIR:-~}/.zshrc && rehash' +alias zsr='exec zsh'  alias rh='rehash'  alias wf='doas wipefs -a'  alias dmci="doas make clean install" @@ -250,6 +249,7 @@ alias ehyb='vi ~/.config/hypr/binds.conf'  alias ewbj='vi ~/.config/waybar/config.jsonc'  alias ewbs='vi ~/.config/waybar/style.css'  alias cfd='vi config.def.h' +alias dump='vi ~/notes/dump.md'  # /# quick cd
jV}k:!sort -t "'" -k 2
  alias cdl='cd ~/dl'  alias cdoc='cd ~/docs' diff --git a/config/essentials/shell/functions.sh b/config/essentials/shell/functions.sh index 1b69fbd..27eb33e 100644 --- a/config/essentials/shell/functions.sh +++ b/config/essentials/shell/functions.sh @@ -364,17 +364,3 @@ ffconcat () {  	ffmpeg -y -f concat -safe 0 -i $tmp -c copy "$1"  	rm $tmp  } - -# wrap ssh and add key if exists -ssh() { -	if [ "$#" -gt 1 ]  -	then -		/usr/bin/ssh $@ -		return -	fi - -	grep -E "Host\s+$1" $HOME/.ssh/config > /dev/null 2>&1 && -		keyadd "$1" > /dev/null 2>&1 -	/usr/bin/ssh "$1" -} - diff --git a/config/essentials/vis/visrc.lua b/config/essentials/vis/visrc.lua index 7847784..a763edc 100644 --- a/config/essentials/vis/visrc.lua +++ b/config/essentials/vis/visrc.lua @@ -26,7 +26,6 @@ local format = require("format")  local fzfmru = require("fzf-mru")  fzfmru.fzfmru_path = 'grep "^' .. os.getenv("PWD") .. '" | fzf' -  -- todo:  -- c-scope  -- c-tags @@ -83,8 +82,12 @@ end, "Remove trailing whitespace")  --- MAPPINGS  ------------------------------------- -vis:map(m.NORMAL, "<C-p>", function() vis:command("fzf") end, "Open file with fzf") - +vis:map(m.NORMAL, " pf", function() +	vis:command("fzf") +end, "Open file with fzf") +vis:map(m.NORMAL, " pr", function() +	vis:command("fzfmru") +end, "Open file with fzf")  vis:map(m.NORMAL, " r", function()  	wrap_restore(vis.command, vis, "e $vis_filepath") @@ -120,14 +123,32 @@ vis.events.subscribe(vis.events.INIT, function()  end)  vis.events.subscribe(vis.events.WIN_OPEN, function(win) -- luacheck: no unused args +	-- automatically cd in parent dir of file +	if win.file and win.file.path then +		local dir = win.file.path:match(".*/") +		vis:command("cd " .. dir) +	end +  	win.options.relativenumbers = true  	if win.syntax == "bash" then  		map_keys(  			m.NORMAL, -			" v", +			";p",  			"V:x/^(\\s*)(.+)$/ c/\\1>\\&2 printf '\\2: %s\\\\n' \"$\\2\"/<Enter><Escape>",  			"Print variable"  		) +		map_keys(m.NORMAL, ";v", 'V:x/^(\\s*)(.+)$/ c/\\1"$(\\2)"/<Enter><Escape>', "Surround in variable") +		map_keys(m.NORMAL, ";|", "V:x/\\| / c/|\n\t/<Enter><Escape>", "Wrap one-line multi pipe command") +		map_keys( +			m.NORMAL, +			";e", +			'V:x/^(\\s*)(.+)$/ c/\\1[ "\\2" ] || exit 1/<Enter><Escape>', +			"Condition exit if empty" +		) +		map_keys(m.NORMAL, ";sc", ":-/\\<case\\>/,/\\<esac\\>/<Enter>", "Expand to case") +		map_keys(m.NORMAL, ";sw", ":-/\\<while/,/\\<done\\>/<Enter>", "Expand to while") +		map_keys(m.NORMAL, ";sf", ":-/\\<for\\>/,/\\<done\\>/<Enter>", "Expand to for") +		map_keys(m.NORMAL, ";si", ":-/\\<if\\>/,/\\<fi\\>/<Enter>", "Expand to if")  	end  end) diff --git a/config/home/.mbsyncrc b/config/home/.mbsyncrc new file mode 100644 index 0000000..aa8c521 --- /dev/null +++ b/config/home/.mbsyncrc @@ -0,0 +1,50 @@ + +IMAPStore luca@spacehb.net-remote +Host mail.spacehb.net +Port 993 +User luca@spacehb.net +PassCmd "pass websites/spacehb.net/luca@spacehb.net" +AuthMechs LOGIN +SSLType IMAPS +CertificateFile /etc/ssl/certs/ca-certificates.crt + +MaildirStore luca@spacehb.net-local +Subfolders Verbatim +Path /home/aluc/.local/share/mail/luca@spacehb.net/ +Inbox /home/aluc/.local/share/mail/luca@spacehb.net/INBOX + +Channel luca@spacehb.net +Expunge Both +Far :luca@spacehb.net-remote: +Near :luca@spacehb.net-local: +Patterns * !"[Gmail]/All Mail" !"*fts-flatcurve*" !"*virtual*" +Create Both +SyncState * +MaxMessages 0 +ExpireUnread no +# End profile + +IMAPStore billy@spacehb.net-remote +Host mail.spacehb.net +Port 993 +User billy@spacehb.net +PassCmd "pass websites/spacehb.net/billy@spacehb.net" +AuthMechs LOGIN +SSLType IMAPS +CertificateFile /etc/ssl/certs/ca-certificates.crt + +MaildirStore billy@spacehb.net-local +Subfolders Verbatim +Path /home/aluc/.local/share/mail/billy@spacehb.net/ +Inbox /home/aluc/.local/share/mail/billy@spacehb.net/INBOX + +Channel billy@spacehb.net +Expunge Both +Far :billy@spacehb.net-remote: +Near :billy@spacehb.net-local: +Patterns * !"[Gmail]/All Mail" !"*fts-flatcurve*" !"*virtual*" +Create Both +SyncState * +MaxMessages 0 +ExpireUnread no +# End profile diff --git a/config/home/.zshenv b/config/home/.zshenv index a87f01d..34a7c2f 100644 --- a/config/home/.zshenv +++ b/config/home/.zshenv @@ -96,3 +96,6 @@ export PATH="$PATH:$GOPATH/bin"  export PLAN9=/usr/lib/plan9  export PATH="$PATH:$PLAN9/bin" + +export SSH_ASKPASS=askpass +export SSH_ASKPASS_REQUIRE=prefer  | 
