Compare commits
5 Commits
10e72f2b02
...
74e2032202
Author | SHA1 | Date |
---|---|---|
urosm | 74e2032202 | |
urosm | 3c6fb05bbc | |
urosm | e419d10a3c | |
urosm | 596932ca27 | |
urosm | 1c3c2ca149 |
77
bashrc
77
bashrc
|
@ -1,39 +1,37 @@
|
||||||
# check interactive
|
# ~/.bashrc
|
||||||
case $- in
|
|
||||||
*i*) ;;
|
# if not running interactively, don't do anything
|
||||||
*) return ;;
|
[ -z "$PS1" ] && return
|
||||||
esac
|
|
||||||
|
# check the window size after each command and, if necessary,
|
||||||
|
# update the values of LINES and COLUMNS.
|
||||||
|
shopt -s checkwinsize
|
||||||
|
|
||||||
# history
|
# history
|
||||||
shopt -s histappend
|
shopt -s histappend
|
||||||
HISTCONTROL=ignoreboth
|
PROMPT_COMMAND="history -a"
|
||||||
HISTSIZE=1000
|
|
||||||
HISTFILESIZE=2000
|
|
||||||
|
|
||||||
# prompt
|
# set the title to user@host:dir
|
||||||
r="\[\e[00m\]"
|
|
||||||
b="\[\e[01m\]"
|
|
||||||
c4="\[\e[34m\]"
|
|
||||||
c7="\[\e[37m\]"
|
|
||||||
|
|
||||||
PS1="${b}\u@\h:$c4\w$c7\$$r "
|
|
||||||
|
|
||||||
unset e r b c4 c5 c7
|
|
||||||
|
|
||||||
# title
|
|
||||||
PS1="\[\e]0;\u@\h:\w\a\]$PS1"
|
PS1="\[\e]0;\u@\h:\w\a\]$PS1"
|
||||||
|
|
||||||
# functions
|
# readline
|
||||||
# stat
|
bind "set editing-mode vi"
|
||||||
st() {
|
bind "set keyseq-timeout 50"
|
||||||
find "${1-.}" -maxdepth 1 -printf '%m %u %g %y %P\n' |
|
bind "set show-mode-in-prompt on"
|
||||||
sort -V -k 4,5 | column -t -N 'i,u,g,t,n' -l 5 -R 'i,u' -d
|
bind "set vi-ins-mode-string \1\e[35m\2+\1\e[0m\2"
|
||||||
}
|
bind "set vi-cmd-mode-string :"
|
||||||
|
|
||||||
# color
|
bind "set keymap vi-command"
|
||||||
case "$TERM" in
|
bind "j:history-substring-search-forward"
|
||||||
foot) export TERMCOLOR=truecolor;;
|
bind "k:history-substring-search-backward"
|
||||||
esac
|
bind "set keymap vi-insert"
|
||||||
|
bind '"\e[A":history-substring-search-backward'
|
||||||
|
bind '"\e[B":history-substring-search-forward'
|
||||||
|
|
||||||
|
bind "set show-all-if-ambiguous on"
|
||||||
|
bind "set completion-display-width 0"
|
||||||
|
bind "set colored-stats on"
|
||||||
|
bind "set visible-stats on"
|
||||||
|
|
||||||
# aliases
|
# aliases
|
||||||
# exit
|
# exit
|
||||||
|
@ -48,9 +46,9 @@ alias ls="ls --color"
|
||||||
alias ll="ls -AFv1 --group-directories-first"
|
alias ll="ls -AFv1 --group-directories-first"
|
||||||
|
|
||||||
# nvim
|
# nvim
|
||||||
alias :e="$EDITOR"
|
alias :e="nvim"
|
||||||
|
|
||||||
# bash completion
|
# enable bash completion in interactive shells
|
||||||
if ! shopt -oq posix; then
|
if ! shopt -oq posix; then
|
||||||
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||||||
. /usr/share/bash-completion/bash_completion
|
. /usr/share/bash-completion/bash_completion
|
||||||
|
@ -58,20 +56,3 @@ if ! shopt -oq posix; then
|
||||||
. /etc/bash_completion
|
. /etc/bash_completion
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# osc 7
|
|
||||||
osc7_cwd() {
|
|
||||||
local strlen=${#PWD}
|
|
||||||
local encoded=""
|
|
||||||
local pos c o
|
|
||||||
for ((pos = 0; pos < strlen; pos++)); do
|
|
||||||
c=${PWD:$pos:1}
|
|
||||||
case "$c" in
|
|
||||||
[-/:_.!\'\(\)~[:alnum:]]) o="${c}" ;;
|
|
||||||
*) printf -v o '%%%02X' "'${c}" ;;
|
|
||||||
esac
|
|
||||||
encoded+="${o}"
|
|
||||||
done
|
|
||||||
printf '\e]7;file://%s%s\e\\' "${HOSTNAME}" "${encoded}"
|
|
||||||
}
|
|
||||||
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }osc7_cwd
|
|
||||||
|
|
14
profile
14
profile
|
@ -1,11 +1,18 @@
|
||||||
# .profile
|
# ~/.profile
|
||||||
|
|
||||||
|
# if running bash
|
||||||
if [ -n "$BASH_VERSION" ]; then
|
if [ -n "$BASH_VERSION" ]; then
|
||||||
|
# include .bashrc if it exists
|
||||||
if [ -f "$HOME/.bashrc" ]; then
|
if [ -f "$HOME/.bashrc" ]; then
|
||||||
. "$HOME/.bashrc"
|
. "$HOME/.bashrc"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# set PATH so it includes user's private bin if it exists
|
||||||
|
if [ -d "$HOME/bin" ] ; then
|
||||||
|
PATH="$HOME/bin:$PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
# set PATH so it includes user's private bin if it exists
|
# set PATH so it includes user's private bin if it exists
|
||||||
if [ -d "$HOME/.local/bin" ]; then
|
if [ -d "$HOME/.local/bin" ]; then
|
||||||
PATH="$HOME/.local/bin:$PATH"
|
PATH="$HOME/.local/bin:$PATH"
|
||||||
|
@ -81,16 +88,11 @@ if [ "$(tty)" = "/dev/tty1" ] && command -v sway &>/dev/null; then
|
||||||
# locale
|
# locale
|
||||||
export LANG=sl_SI.UTF-8
|
export LANG=sl_SI.UTF-8
|
||||||
export LC_MESSAGES=en_US.UTF-8
|
export LC_MESSAGES=en_US.UTF-8
|
||||||
|
|
||||||
# defaults
|
# defaults
|
||||||
export EDITOR=nvim
|
export EDITOR=nvim
|
||||||
export VISUAL=nvim
|
export VISUAL=nvim
|
||||||
export TERMINAL=footclient
|
export TERMINAL=footclient
|
||||||
export BROWSER=firefox
|
export BROWSER=firefox
|
||||||
|
|
||||||
# wayland
|
|
||||||
# export WLR_DRM_NO_ATOMIC=1
|
|
||||||
|
|
||||||
# run sway
|
# run sway
|
||||||
exec systemd-cat --identifier=sway sway
|
exec systemd-cat --identifier=sway sway
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
$include /etc/inputrc
|
|
||||||
|
|
||||||
# vi mode
|
|
||||||
set editing-mode vi
|
|
||||||
set show-mode-in-prompt on
|
|
||||||
set vi-ins-mode-string "\1\e[01;31m\2+\1\e[0m\2"
|
|
||||||
set vi-cmd-mode-string "\1\e[01m\2:\1\e[0m\2"
|
|
||||||
|
|
||||||
set keyseq-timeout 50
|
|
||||||
|
|
||||||
# history search
|
|
||||||
$if mode=vi
|
|
||||||
set keymap vi-command
|
|
||||||
"j": history-substring-search-forward
|
|
||||||
"k": history-substring-search-backward
|
|
||||||
set keymap vi-insert
|
|
||||||
"\e[A": history-substring-search-backward
|
|
||||||
"\e[B": history-substring-search-forward
|
|
||||||
$endif
|
|
||||||
|
|
||||||
# faster completion
|
|
||||||
"\t":menu-complete
|
|
||||||
"\e[Z":menu-complete-backward
|
|
||||||
set completion-ignore-case on
|
|
||||||
set show-all-if-ambiguous on
|
|
||||||
set completion-display-width 0
|
|
||||||
|
|
||||||
# color
|
|
||||||
set colored-stats on
|
|
||||||
set visible-stats on
|
|
|
@ -1,21 +0,0 @@
|
||||||
startup_message off
|
|
||||||
maptimeout 5
|
|
||||||
# hardstatus
|
|
||||||
hardstatus off
|
|
||||||
hardstatus alwayslastline
|
|
||||||
hardstatus string "%{= b} %S %?%E%{m}%?ESC%{b}%=%?%-Lw%?%{m}%n%f %t%?(%u)%?%{-}%?%+Lw%?%= %D %M %d %c"
|
|
||||||
# caption
|
|
||||||
caption always
|
|
||||||
caption string "%?%F%{= m}%:%{= b}%?%=> %n%f %t%? (%u)%? <%="
|
|
||||||
# rendition
|
|
||||||
rendition so "=00"
|
|
||||||
|
|
||||||
bind h focus left
|
|
||||||
bind j focus down
|
|
||||||
bind k focus up
|
|
||||||
bind l focus right
|
|
||||||
|
|
||||||
altscreen on
|
|
||||||
nonblock on
|
|
||||||
|
|
||||||
termcapinfo foot* ti@:te@
|
|
Loading…
Reference in New Issue