- Add ~/.config/vim/vimrc
+ Configure basic stuff
+ Activate spell checks
+ Activate syntax highlighting and ruler
+ Show whitespace characters
+ Add various snippets for mouse handling,
toggling line numbers, and search
+ Set `vim`-related directories inside
~/.config/vim and ~/.local/state/vim
- Integrate extra settings for Python files
in ~/.config/vim/after/ftplugin/python.vim
and ~/.config/vim/after/syntax/python.vim
- Add `vim` artifacts in ~/.config/git/ignore
52 lines
1 KiB
Shell
52 lines
1 KiB
Shell
#!/bin/sh
|
|
|
|
# Show system info each time a shell is started ...
|
|
|
|
|
|
# ... except:
|
|
[ -t 1 ] || return # If stdout is not a terminal
|
|
[ "${SHLVL:-1}" -gt 1 ] && return # In nested shells (e.g., ":terminal" in `vi`)
|
|
[ "${TERM:-}" = "dumb" ] && return # For tools opening shells (e.g., `emacs`)
|
|
|
|
|
|
_hostname=$(uname -n)
|
|
_os="$(uname -s) $(uname -r)"
|
|
_user=$(whoami)
|
|
_work_dir=$(echo "$PWD" | sed "s|^$HOME|~|")
|
|
|
|
|
|
if [ "$(id -u)" -eq 0 ]; then
|
|
_prompt="#"
|
|
else
|
|
_prompt="$"
|
|
fi
|
|
|
|
|
|
if [ -n "${SSH_CLIENT:-}" ] || [ -n "${SSH_TTY:-}" ]; then
|
|
_remote=" ssh"
|
|
else
|
|
_remote=" local"
|
|
fi
|
|
|
|
|
|
if _in_bash; then
|
|
_shell_type="bash"
|
|
elif _in_zsh; then
|
|
_shell_type="zsh"
|
|
else
|
|
_shell_type="non-bash/zsh shell"
|
|
fi
|
|
|
|
|
|
_info_line="$_user@$_hostname:$_work_dir$_prompt$_remote $_os $_shell_type"
|
|
_sep_line=$(echo "$_info_line" | sed 's/./─/g')
|
|
|
|
|
|
echo ""
|
|
echo "$_sep_line"
|
|
echo "$_info_line"
|
|
echo "$_sep_line"
|
|
echo ""
|
|
|
|
|
|
unset _hostname _os _user _work_dir _prompt _remote _shell_type _info_line _sep_line
|