Skip to content
Permalink
Browse files

emacs

  • Loading branch information...
neeasade committed Apr 29, 2019
1 parent c719c39 commit 2303184179b463d1aa42a34396ae734685a5aa17
Showing with 48 additions and 25 deletions.
  1. +4 −0 bin/bin/elisp
  2. +22 −6 shell/.sh.d/environment_emacs
  3. +14 −16 shell/.sh.d/functions
  4. +7 −2 shell/.sh.d/history
  5. +1 −1 templates/bspwm
@@ -11,6 +11,10 @@ if [ ! -z "$(uname | awk '$1 ~ /MINGW|MSYS/ {print $1}')" ]; then
fi

result="$($eclient --eval "(progn $@)")"
if [ $? -eq 1 ]; then
# we could not reach emacs.
exit 1
fi

if [ "$result" = "nil" ] || [ -z "$result" ]; then
exit 1
@@ -23,29 +23,45 @@ path_remove() {

to_term() {
cat <<EOF
$1() {
$TERMINAL -e $1
}
$1() {
setsid sh -c "( $TERMINAL -e '$1 \$@'; elisp '(ns/spawn-terminal)')" &
sleep 0.2
elisp "(run-at-time 0 nil 'delete-frame)" >/dev/null
}
EOF
}

if $ESHELL; then
# the elisp t is that we can reach emacs
if $ESHELL && silent elisp t; then
succ .emacs.d/scripts
PAGER="epager"

eval "$(to_term htop)"
eval "$(to_term nethack)"
for yeet in htop nethack cava; do
if has $yeet; then
eval "$(to_term $yeet)"
fi
done

sxhkd() {
path_remove "$HOME/.emacs.d/scripts"
$(type -a sxhkd | sort | awk 'END{print $3}')
}

man() {
elisp "(woman \"$*\") (Man-cleanup-manpage)"
}

clear() {
elisp "(run-at-time 0 nil 'comint-clear-buffer)" >/dev/null
}

ranger() {
elisp '(deer)'
}

# todo: if we are emacs and no background processes or anything
# alias exit --> kill buffer

# todo: sudo alias that can pass along PAGER var
# maybe something else if we think of it too
fi
@@ -19,6 +19,7 @@ shot_location() {
clean_shot
mkdir -p $HOME/Screenshots
mkdir -p $HOME/Last_Shot

echo "$HOME/Screenshots/$(date +%y-%m-%d-%H:%M:%S).png" > "$HOME/Last_Shot/.shot.txt"
echo "$HOME/Last_Shot/shot.png"
}
@@ -162,22 +163,19 @@ extract() { # Handy Extract Program

# manpages with colors
man() {
if $ESHELL; then
elisp "(woman \"$*\")"
else
settitle "$* - manual"
# removing standout means find highlights stay inverted..
#LESS_TERMCAP_so=$(printf '\e[38;5;246m') \

env LESS_TERMCAP_mb=$(printf '\e[01;31m') \
LESS_TERMCAP_md=$(printf '\e[01;38;5;74m') \
LESS_TERMCAP_me=$(printf '\e[0m') \
LESS_TERMCAP_se=$(printf '\e[0m') \
LESS_TERMCAP_ue=$(printf '\e[0m') \
LESS_TERMCAP_us=$(printf '\e[04;38;5;146m') \
man "$@"
defaulttitle
fi
settitle "$* - manual"
# removing standout means find highlights stay inverted..
#LESS_TERMCAP_so=$(printf '\e[38;5;246m') \

env LESS_TERMCAP_mb=$(printf '\e[01;31m') \
LESS_TERMCAP_md=$(printf '\e[01;38;5;74m') \
LESS_TERMCAP_me=$(printf '\e[0m') \
LESS_TERMCAP_se=$(printf '\e[0m') \
LESS_TERMCAP_ue=$(printf '\e[0m') \
LESS_TERMCAP_us=$(printf '\e[04;38;5;146m') \
man "$@"

defaulttitle
}

page() {
@@ -20,9 +20,14 @@ case "$cur_shell" in
SAVEHIST="$history_length"
HISTSIZE="$history_length"

setopt hist_ignore_dups
# setopt extended_history # record timestamp of command in HISTFILE
setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
setopt hist_ignore_dups # ignore duplicated commands history list
setopt hist_ignore_all_dups
setopt hist_ignore_space
setopt hist_ignore_space # ignore commands that start with space
# setopt hist_verify # show command with history expansion to user before running it
setopt inc_append_history # add commands to HISTFILE in order of execution
setopt share_history # share command history data
;;
mksh)
HISTFILE="$history_file"
@@ -33,7 +33,7 @@ bspc config pointer_modifier mod4
bspc config removal_adjustment false

# external rules
bspc config external_rules_command "{{{echo -n $(which external_rules.sh)}}}"
bspc config external_rules_command "$(which external_rules.sh)"

# to gap or not to gap
bspc config window_gap $(iif $gapped {{b_window_gap}} -{{b_border_width}})

0 comments on commit 2303184

Please sign in to comment.
You can’t perform that action at this time.