369-a3 and other fish functions

This commit is contained in:
2019-03-08 02:32:57 -05:00
parent 87f068cf4b
commit 70a2fbf2f3
14 changed files with 62 additions and 15 deletions

View File

@@ -19,6 +19,8 @@ bind \ce edit_command_buffer
bind \cr forward-word
# fish-specific
set -U fish_fxn_dir "/home/kevin/linux-config/fish/.config/fish/functions"
abbr ff "cd $fish_fxn_dir"
source /home/kevin/.config/fish/key_abbr.fish
abbr xf "fish_config"
abbr f. "cd .."
@@ -27,7 +29,6 @@ abbr f.. "cd ../.."
# spv
set -U spv_dir "/home/kevin/coding/spotify-lib-vis"
set -U mfs_dir "/home/kevin/coding/mf-site"
source $spv_dir/src/api-keys.sh
# set -U PATH /usr/local/sbin /usr/local/bin /usr/bin /usr/bin/site_perl /usr/bin/vendor_perl /usr/bin/core_perl /home/kevin/linux-config/scripts
# (ruby -e 'print Gem.user_dir')/bin
@@ -42,6 +43,7 @@ set -xU XSET_DELAY 200
# fxn abbr's
abbr ag "grep-aliases"
abbr bq "benq-brightness"
abbr cf "create-fish-function"
abbr ev "evince-silent"
# git {{{ #
@@ -60,7 +62,12 @@ abbr z "zathura-silent"
set -U BROWSER "chromium"
abbr hm "cd $mfs_dir && hugo serve -D --disableFastRender"
abbr ga2 "gdb-a2"
# 369
abbr grc "grep-c"
abbr grh "grep-headers"
abbr cs "carsim"
abbr rgh "rg-headers"
abbr r6 "run-a3"
# abbr cs "carsim"
# abbr ga2 "gdb-a2"

View File

@@ -46,7 +46,7 @@ function cd --description "Change directory"
set -g __fish_cd_direction prev
set -U last_dir $PWD
ls -a
lsd -a
end
return $cd_status

View File

@@ -0,0 +1,3 @@
function copy
$argv[1] $argv[2] | xclip -selection clipboard
end

View File

@@ -0,0 +1,5 @@
function create-fish-function
printf 'function %s\n \nend' $argv[1] > $fish_fxn_dir/$argv[1].fish
and cd $fish_fxn_dir
and $EDITOR $argv[1].fish
end

View File

@@ -0,0 +1,6 @@
function gdb-a3
# gdb -ex "b safeStopSign.c:96" -ex "run" \
gdb -ex "run" -ex "bt" \
# gdb -ex "run" \
--args ./sim -f /home/kevin/school/369/a3/a3/traceprogs/tr-simpleloop.ref -m 50 -s 3000 -a rand
end

View File

@@ -1,4 +1,5 @@
function grep-aliases
set key_aliases /home/kevin/linux-config/aliases/key_aliases
grep $argv[1] $key_aliases
# grep $argv[1] $key_aliases
rg "^$argv[1]" $key_aliases
end

View File

@@ -0,0 +1,3 @@
function rg-headers
rg $argv[1] *.h
end

View File

@@ -0,0 +1,3 @@
function rgc
rg $argv[1] *.c
end

View File

@@ -0,0 +1,7 @@
function run-a3
printf '\033c'
and bear make
and ./sim -f /home/kevin/school/369/a3/a3/traceprogs/tr-simpleloop.ref -m 50 -s 3000 -a rand
rm swapfile.*
end

View File

@@ -1,6 +1,7 @@
function scan-history
sudo systemctl start postgresql.service
and systemctl status postgresql.service
and $spv_dir/src/update-history.sh
# and systemctl status postgresql.service
and source $spv_dir/src/api-keys.sh
and $spv_dir/src/scripts/update-history.sh
and cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1
end