-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemacs.fish
43 lines (39 loc) · 1.04 KB
/
emacs.fish
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/fish
# fish configurations for Emacs and its vterm-mode
# For Emacs Tramp
if test "$TERM" = "dumb"
function fish_prompt
echo "\$ "
end
function fish_right_prompt; end
function fish_greeting; end
function fish_title; end
end
function vterm_printf;
if begin; [ -n "$TMUX" ] ; and string match -q -r "screen|tmux" "$TERM"; end
# tell tmux to pass the escape sequences through
printf "\ePtmux;\e\e]%s\007\e\\" "$argv"
else if string match -q -- "screen*" "$TERM"
# GNU screen (screen, screen-256color, screen-256color-bce)
printf "\eP\e]%s\007\e\\" "$argv"
else
printf "\e]%s\e\\" "$argv"
end
end
if [ "$INSIDE_EMACS" = 'vterm' ]
function clear
vterm_printf "51;Evterm-clear-scrollback";
tput clear;
end
function fish_title
hostname
echo ":"
pwd
end
function fish_greeting; end
function fish_right_prompt; end
function fish_prompt
echo (pwd) '> '
end
set -g fish_key_bindings fish_default_key_bindings
end