mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-25 09:36:14 +01:00
Emacs changes
This commit is contained in:
parent
bd1cca59ca
commit
4cbad841cc
30
dot_bashrc
30
dot_bashrc
|
@ -40,28 +40,38 @@ vterm_prompt_end() {
|
|||
}
|
||||
PS1=$PS1'\[$(vterm_prompt_end)\]'
|
||||
|
||||
alias E="SUDO_EDITOR=\"emacsclient -a emacs\" sudoedit"
|
||||
alias e="emacsclient"
|
||||
if [[ ! -z "${INSIDE_EMACS+x}" ]] && [[ ! -z "${SSH_CONNECTION}" ]]
|
||||
then
|
||||
alias E="emacsclient-remote --sudo"
|
||||
alias e="emacsclient"
|
||||
else
|
||||
alias E="SUDO_EDITOR=\"emacsclient -a emacs\" sudoedit"
|
||||
alias e="emacsclient"
|
||||
fi
|
||||
|
||||
|
||||
[[ ! -z "${INSIDE_EMACS+x}" ]] && alias vim="e"
|
||||
|
||||
essh() {
|
||||
ssh() {
|
||||
if [[ ! -z "${INSIDE_EMACS+x}" ]]
|
||||
then
|
||||
#ssh -MNf -S ~/.ssh/controlmasters/%r@%h:%p $1 > /dev/null 2>&1
|
||||
|
||||
#ssh -S ~/.ssh/controlmasters/%r@%h:%p "rm ~/.ssh/emacs-server"
|
||||
ssh \
|
||||
-o 'SendEnv=INSIDE_EMACS' -o 'StreamLocalBindUnlink=yes' \
|
||||
-o "SendEnv INSIDE_EMACS" \
|
||||
-o "StreamLocalBindUnlink yes" \
|
||||
-o "ControlMaster auto" \
|
||||
-o "ControlPath ~/.ssh/controlmasters/%r@%h:%p" \
|
||||
-Nf \
|
||||
-R ~/.ssh/emacs-server:/run/user/1000/emacs/server \
|
||||
$1
|
||||
ssh \
|
||||
-S ~/.ssh/controlmasters/%r@%h:%p \
|
||||
-o 'SendEnv=INSIDE_EMACS' \
|
||||
$@
|
||||
else
|
||||
ssh $@
|
||||
fi
|
||||
}
|
||||
alias ssh="essh"
|
||||
|
||||
|
||||
#if [[ -d "/mnt/data3/Programs/bin" ]]; then
|
||||
# export PATH="/mnt/data3/Programs/bin:${PATH}"
|
||||
#fi
|
||||
|
@ -71,3 +81,5 @@ export PS1="\u@\[\e[37m\]\h\[\e[m\]:\[\e[32m\]\w\[\e[m\]\[\e[31m\]\\$\[\e[m\] "
|
|||
|
||||
export EDITOR="emacsclient"
|
||||
export BROWSER="firefox-nightly"
|
||||
|
||||
trap finish EXIT
|
||||
|
|
|
@ -377,4 +377,3 @@ it is not appropriate in some cases like terminals."
|
|||
(set-frame-parameter (selected-frame) 'alpha '(90 . 90))
|
||||
|
||||
(server-start)
|
||||
|
||||
|
|
|
@ -6,6 +6,9 @@ params=()
|
|||
sudo=0
|
||||
local=0
|
||||
|
||||
host=$(echo $SSH_CONNECTION | cut -d' ' -f3)
|
||||
port=$(echo $SSH_CONNECTION | cut -d' ' -f4)
|
||||
|
||||
for p in "${@}"; do
|
||||
if [[ "${p}" == "-n" ]]; then
|
||||
params+=( "${p}" )
|
||||
|
@ -26,12 +29,12 @@ for p in "${@}"; do
|
|||
|
||||
if [[ $(id -u) -eq 0 || ${sudo} -eq 1 ]]; then
|
||||
if [[ ${local} -eq 0 ]]; then
|
||||
params+=( "/ssh:$(cat /tmp/hostname)|sudo:$(hostname -f):"$(realpath -m "${p}") )
|
||||
params+=( "/ssh:${host}:${port}|sudo::"$(realpath -m "${p}") )
|
||||
else
|
||||
params+=( "/sudo:localhost:"$(realpath -m "${p}") )
|
||||
fi
|
||||
else
|
||||
params+=( "/ssh:$(cat /tmp/hostname):"$(realpath "${p}") )
|
||||
params+=( "/ssh:${host}:${port}:"$(realpath "${p}") )
|
||||
fi
|
||||
|
||||
IFS=${OLDIFS}
|
||||
|
|
0
private_dot_ssh/.keep
Normal file
0
private_dot_ssh/.keep
Normal file
Loading…
Reference in a new issue