remove trailing newlines, infinite histsize

This commit is contained in:
tavo-wasd 2023-10-18 13:45:42 -06:00
parent dfae0bb587
commit 33f4648c23
4 changed files with 8 additions and 4 deletions

View file

@ -10,4 +10,5 @@ snippet=$(ls "$snippets" | menu "Snippet:")
[ -z "$snippet" ] && exit
# Copy to clipboard and notify otherwise
cat "$snippets"/"$snippet" | xsel -ib && notify-send "Snippet" "'$snippet' copied to clipboard!"
printf '%s' "$(cat $snippets/$snippet)" |
xsel -ib && notify-send "Snippet" "'$snippet' copied to clipboard!"

View file

@ -6,7 +6,7 @@ alias \
cfg="cd $HOME/.config/ && ls" \
tmp="cd $HOME/Desktop/temp/ && ls" \
dsk="cd $HOME/Desktop/ && ls" \
prj="cd $HOME/Documents/projects/ && ls" \
prj="cd $HOME/Desktop/projects/ && ls" \
doc="cd $HOME/Documents/ && ls" \
dow="cd $HOME/Downloads/ && ls" \
mus="cd $HOME/Music/ && ls" \

View file

@ -10,6 +10,8 @@ PATH="$HOME/.local/bin${PATH:+:${PATH}}"
# Common
export \
HISTIZE= \
HISTFILESIZE= \
GITLAB="ssh://git@gitlab.com/tavo-wasd" \
BOOKMARKS="$HOME/Documents/bookmarks" \
BIB="$HOME/Documents/bibliography" \

View file

@ -24,9 +24,10 @@ fi
# Copy output of a command
copy_history() {
HISTTIMEFORMAT="%F %T "
history |
head -n -1 |
fzf --cycle --height=50% --border top --tac --prompt='⯈ ' |
sed 's/^\s*[0-9]*\s*//g' |
tr -d '\n' |
sed -z 's/^.*:[0-9]*\s*//g;s/\s*$//g' |
xsel -ib
}