Clean up fish directory.

Reorganize stuff into files, add a few headers. Remove unused stuff, and
move some functionality to scripts.
This commit is contained in:
Érico Rolim 2020-02-16 02:18:41 -03:00
parent 1c099809c6
commit 1ff0aa550b
12 changed files with 72 additions and 35 deletions

View File

@ -1,2 +0,0 @@
alias arduino-uno='arduino-cli compile --fqbn arduino:avr:uno'
alias arduino-leonardo='arduino-cli compile --fqbn arduino:avr:leonardo'

View File

@ -1,17 +0,0 @@
function openocdfast -a interface target
openocd -f interface/$interface.cfg -f target/$target.cfg
end
function openocdstlink -a target
openocdfast stlink $target
end
function openocdcmsis -a target
openocdfast cmsis-dap $target
end
alias arm-ugdb='ugdb --gdb arm-none-eabi-gdb'
function arm-ugdb-tmux
tmux new-window -n ugdb-arm ugdb --gdb arm-none-eabi-gdb $argv
end

View File

@ -1,6 +0,0 @@
alias set-can='sudo ip link set up can0 type can bitrate 500000'
alias can0dump='candump can0'
function can0filt
candump can0,$0:7ff
end

View File

@ -1,12 +1,16 @@
# ericonr's fish config related to development in general
alias jpnb='jupyter-notebook'
alias cformat='clang-format -i -style=webkit'
# Aliases for getting make and cargo to use temporary directories for building.
# Helps in keepign the SSD fresh.
alias maketmp='make BUILD_DIR=/tmp/(basename (pwd))'
alias cargotmp='env CARGO_TARGET_DIR=/tmp/cargo/(basename (pwd)) cargo'
function statusgit --argument show
function statusgit --argument show \
--description "Show git status for all directories in the current directory. Requires omf."
if test -z $show
set show_status false
else
@ -60,3 +64,4 @@ function statusgit --argument show
cd -
end
end

View File

@ -0,0 +1,38 @@
# ericonr's fish config related to embedded development
## Functions for programming with openocd
function openocdfast -a interface target
openocd -f interface/$interface.cfg -f target/$target.cfg
end
function openocdstlink -a target
openocdfast stlink $target
end
function openocdcmsis -a target
openocdfast cmsis-dap $target
end
## Alias and function for debugging arm-none-eabi stuff with ugdb
alias arm-ugdb='ugdb --gdb arm-none-eabi-gdb'
function arm-ugdb-tmux
tmux new-window -n ugdb-arm ugdb --gdb arm-none-eabi-gdb $argv
end
## Settings and alias for using the esp-idf tools from Espressif (ESP32)
set -x ESPIDF /opt/esp-idf
alias esp-idf='$ESPIDF/tools/idf.py -B /tmp/esp/(basename (pwd))'
## Aliases and function for can-utils related stuff
alias set-can='sudo ip link set up can0 type can bitrate 500000'
alias can0dump='candump can0'
function can0filt
candump can0,$0:7ff
end

View File

@ -1,4 +1,7 @@
# ericonr's fish config for Golang environment variables
set -x GOPATH $HOME/.cache/go
set -x GOBIN $HOME/.local/bin
set -x GOTMPDIR /tmp/go-tmp
set -x GOCACHE /tmp/go-build

View File

@ -1,8 +1,10 @@
# ericonr's fish config related to text editing
set -x VISUAL nvim
alias clem='emacsclient -n'
alias sudoclem='sudo emacsclient -n'
alias temacs="emacs -nw"
alias stemacs="sudo emacs -nw"
function mdbat --argument-names file
mdcat $file | bat -p

View File

@ -1,19 +1,23 @@
# ericonr's fish config for everyday utilities
## Aliases for single column ls
alias lk='ls -1'
alias kl='ls -1'
alias cp='cp --reflink=auto --sparse=always'
alias pre='cd ../'
alias weather='curl wttr.in/'
## Aliases for quick grepping
alias rgmod='lsmod | rg -i'
alias rgps='ps aux | rg -i'
function randpw -a digits
function randpw -a digits \
--description "Generates a random password with the specified number of digits, and copies it into the Wayland buffer."
openssl rand -base64 $digits | wl-copy
end
function pdfunlock
function pdfunlock --description "Unlocks all PDF files in a directory."
# command taken from https://mandrivausers.org/index.php?/topic/79354-saving-pdf-file-without-password-solved/
echo "Password: $argv[1]"

View File

@ -1,3 +1,5 @@
# ericonr's fish config related to xrandr
function list-display --description 'List available display interfaces from xrandr.'
xrandr | sed -n '/connected/p'
end
@ -17,3 +19,4 @@ function conf-display --argument-names width height interface
end
end

View File

@ -1,8 +1,9 @@
# ericonr's initial fish config
# taken from https://fishshell.com/docs/current/commands.html#contains
for i in ~/.local/bin ~/.cargo/bin /opt/hipSYCL/CUDA/bin
for i in ~/.local/bin ~/.cargo/bin
if not contains $i $PATH
set PATH $PATH $i
end
end
set -x VISUAL nvim

View File

@ -1 +1 @@
source ("/usr/bin/starship" init fish --print-full-init | psub)
source ("starship" init fish --print-full-init | psub)

6
script/.local/bin/cp Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
# Uses copy setttings beneficial to Btrfs
/usr/bin/env cp --reflink=auto --sparse=always "$@"