-
Notifications
You must be signed in to change notification settings - Fork 0
/
bashrc
68 lines (56 loc) · 1.65 KB
/
bashrc
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]
then
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
# Auto-start tmux
# https://unix.stackexchange.com/questions/43601/how-can-i-set-my-default-shell-to-start-up-tmux
if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then
exec tmux
fi
function is_ssh_fs_path() {
# TODO handle case if there are multiple sshfs paths
sshfs_path=$(mount -t fuse.sshfs | sed -e 's/.* on \(.*\) type .*/\1/');
curr_path=$(pwd);
if [ -z "$sshfs_path" ]; then
return 1;
fi
if [[ $curr_path == $sshfs_path* ]]; then
return 0;
else
return 1;
fi
}
function se() {
SESSION_DIR="$HOME/sessions"
if [ -z "$1" ]; then
ls $SESSION_DIR
else
MYVIMRC="$HOME/.vimrc" nvim -u $HOME/.vimrc -S $SESSION_DIR/$1.vim
fi
}
export TERM="screen-256color"
# Use python script for prompt text
export PROMPT_COMMAND='PS1="$(python3 ~/dotfiles/scripts/prompt.py)"'
# avoid duplicates..
export HISTCONTROL=ignoredups:erasedups
# set maximum size for history file
export HISTFILESIZE=-1
export HISTSIZE=-1
# append history entries..
shopt -s histappend
# After each command, save and reload history
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
alias vim='MYVIMRC="$HOME/.vimrc" nvim -u $HOME/.vimrc'
alias la='ls -la'
alias vimmin="nvim -u NONE"
alias diff="git diff --no-index"