update .bashrc and gnome config

This commit is contained in:
dado
2025-06-29 18:58:18 +02:00
parent c83d1d8bda
commit 3ddb6a72ee
3 changed files with 598 additions and 121 deletions

139
.bashrc
View File

@@ -72,21 +72,12 @@ esac
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
# some more ls aliases
#alias ll='ls -l'
#alias la='ls -A'
#alias l='ls -CF'
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
# Alias definitions.
# You may want to put all your additions into a separate file like
@@ -108,34 +99,58 @@ fi
# fi
#fi
###################################################################################################################################################
# #
# PERSONAL SETTINGS #
# #
###################################################################################################################################################
#######################################################
# PERSONAL SETTINGS #
#######################################################
if [ -f /usr/bin/fastfetch ]; then
fastfetch
fi
# path
export PATH="$PATH:HOME/.local/bin:$HOME/bin:$HOME/.cargo/bin:$HOME/scripts/:$HOME/scripts/backup-ws"
# for setting history length see HISTSIZE and HISTFILESIZE in bash
HISTSIZE=-1
HISTFILESIZE=-1
# Expand the history size
export HISTFILESIZE=10000
export HISTSIZE=500
export HISTTIMEFORMAT="%F %T - " # add timestamp to history
# Don't put duplicate lines in the history and do not add lines that start with a space
export HISTCONTROL=erasedups:ignoredups:ignorespace
# Check the window size after each command and, if necessary, update the values of LINES and COLUMNS
shopt -s checkwinsize
# Causes bash to append to history instead of overwriting it so if you start a new terminal, you have old session history
shopt -s histappend
PROMPT_COMMAND='history -a'
# To get first completion and a listing you can add the following to bashrc
bind 'set show-all-if-ambiguous on'
bind 'TAB:menu-complete'
# Use bash-completion, if available
[[ $PS1 && -f /usr/share/bash-completion/bash_completion ]] && \
. /usr/share/bash-completion/bash_completion
# Enable bash programmable completion features in interactive shells
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
# alias
# set up XDG folders
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_STATE_HOME="$HOME/.local/state"
export XDG_CACHE_HOME="$HOME/.cache"
# alias
#######################################################
# GENERAL ALIAS #
#######################################################
# To temporarily bypass an alias, we precede the command with a \
# EG: the ls command is aliased, but to use the normal ls command you would type \ls
# https://github.com/ChrisTitusTech/mybash/blob/main/.bashrc
## BASH command
alias t='tail -f'
alias dud='du -d 1 -h 2> /dev/null | sort -hsr'
alias dus='du -sh * 2> /dev/null | sort -hsr'
@@ -150,25 +165,57 @@ alias rd='rmdir'
alias scp="scrcpy -S"
alias scl="screen -ls"
alias scr="screen -R"
alias scl="screen -ls"
alias nn="ncdu --color dark"
alias maps="telnet mapscii.me"
alias myip='curl ipinfo.io/ip'
alias mydns="dig dave.eu | grep -i server | sed -e 's/[;]//g' | sed -e 's/#.*//'"
alias mydns="dig debian.org | grep -i server | sed -e 's/[;]//g' | sed -e 's/#.*//'"
alias files_replace_space='for f in *\ *; do mv "$f" "${f// /_}"; done'
alias dtr="rm -rf .local/share/Trash/files/*"
alias et="rm -rf .local/share/Trash/files/*"
alias hugo-sync="hugo && rsync -avz --delete public/ novemila:/home/sistemostro/website/"
## ls
## Change directory aliases
alias home='cd ~'
alias cd..='cd ..'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias l='ls -CF'
## alias chmod commands
alias 000='chmod -R 000'
alias 644='chmod -R 644'
alias 666='chmod -R 666'
alias 755='chmod -R 755'
alias 777='chmod -R 777'
## Search command line history
alias h="history | grep "
## ls
#alias ls='ls -1FSsh'
alias ldot='ls -ld .*'
alias lt='ls -ltFh'
alias ll='exa -lgh'
alias lx='ls -lXBh' # sort by extension
alias lk='ls -lSrh' # sort by size
alias lt='ls -ltcrh' # sort by change time
alias la='ls -lturh' # sort by access time
alias ld='ls -ltrh' # sort by date
alias lf="ls -l | egrep -v '^d'" # files only
alias ldir="ls -l | egrep '^d'" # directories only
alias lla='ls -Al' # List and Hidden Files
## Search running processes
alias p="ps aux | grep "
## archives
alias mktar='tar -cvf'
alias mkbz2='tar -cvjf'
alias mkgz='tar -cvzf'
alias untar='tar -xvf'
alias unbz2='tar -xvjf'
alias ungz='tar -xvzf'
## apt
alias aac='sudo apt autoclean'
alias ac='sudo apt clean'
alias as='apt search'
@@ -181,26 +228,25 @@ alias aar='sudo apt autoremove'
alias upg='sudo apt update ; sudo apt upgrade ; sudo apt autoremove ; flatpak upgrade -y ; flatpak uninstall --unused -y'
## flatpak
alias fl='flatpak list'
alias fu='flatpak update'
alias fu='flatpak uninstall'
alias code="flatpak run com.vscodium.codium 2> /dev/null"
## docker
alias dex='docker exec -i -t'
alias di='docker images ls'
alias dv='docker volume ls'
alias dps='docker ps'
alias dpsa='docker ps -a'
alias dil='docker images ls'
alias dvl='docker volume ls'
alias dcd='docker compose down'
alias dcp='docker compose pull'
alias dcu='docker compose up -d'
alias dl='docker logs'
alias dlf='docker logs -f'
alias dps='docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Status}}\t{{.Ports}}"'
alias dpsa='docker ps -a --format "table {{.ID}}\t{{.Names}}\t{{.Status}}\t{{.Ports}}"'
alias ds='docker stats'
alias dspaf='docker system prune -af'
## tmux
alias ta='tmux attach -t'
alias tad='tmux attach -dt'
alias tkss='tmux kill-session -t'
@@ -209,20 +255,17 @@ alias tl='tmux list-sessions'
alias ts='tmux new-session -s'
## symlink
alias delete-broken-symlink='find . -maxdepth 1 -xtype l -delete'
alias view-broken-symlink='find . -maxdepth 1 -xtype l'
## vim
alias v="vim 2> /dev/null"
alias sv="sudo vim 2> /dev/null"
alias vi='TERM=xterm-sc vim'
alias vim='TERM=xterm-sc vim'
## git
alias g=git
alias g='git'
alias ga='git add'
alias gf='git fetch'
alias gp='git pull'
@@ -231,7 +274,6 @@ alias grmc='git rm --cached'
alias gs='git status -sb'
alias gm='git commit -m'
alias gcf='git config --list'
#alias gb='git branch'
#alias gbD='git branch -D'
#alias gba='git branch -a'
@@ -245,8 +287,7 @@ alias gcf='git config --list'
#alias grso='git remote show origin'
#alias grv='git remote -v'
# PS1
## PS1
DEFAULT="\[\033[0m\]"
RED="\[\033[1;31m\]"
GREEN="\[\033[0;32m\]"
@@ -262,13 +303,11 @@ parse_git_branch() {
export PS1="$GREEN[\A \d]$CYAN\u$BLUE@\h $DEFAULT(\!):$YELLOW\w $PURPLE\n\$(parse_git_branch)$DEFAULT > "
# editor
## editor
export EDITOR='vim'
export VISUAL='vim'
# language
## language
#LANG="it_IT.UTF-8"
#export LANG
export TERM=xterm-256color

48
.vimrc
View File

@@ -14,39 +14,39 @@ set expandtab
autocmd vimenter * hi Normal guibg=NONE ctermbg=NONE
set spell spelllang=it,en
syntax on " Enable type file detection. Vim will be able to try to detect the type of file in use.
filetype on " Enable plugins and load plugin for the detected file type.
set nocompatible " be iMproved, required
filetype on " Enable plugins and load plugin for the detected file type.
set nocompatible " be iMproved, required
filetype plugin indent on
set omnifunc=syntaxcomplete " Enable Omnicomplete features
filetype plugin on " Load an indent file for the detected file type.
set omnifunc=syntaxcomplete " Enable Omnicomplete features
filetype plugin on " Load an indent file for the detected file type.
filetype indent on
set foldenable
set autoindent " Automatically guesses the indentation given the previous one
set hlsearch " Automatically highlights search results, to hide them run :noh
set incsearch " Searches incrementally as you type.
set ruler " Shows the rulers
set showcmd " Shows current cursor info
set ignorecase " Ignores cases when searching
set noswapfile " Disables swap files
set undofile " Enable keeping history across sessions, don't forget to mkdir
set autoindent " Automatically guesses the indentation given the previous one
set hlsearch " Automatically highlights search results, to hide them run :noh
set incsearch " Searches incrementally as you type.
set ruler " Shows the rulers
set showcmd " Shows current cursor info
set ignorecase " Ignores cases when searching
set noswapfile " Disables swap files
set undofile " Enable keeping history across sessions, don't forget to mkdir
set undodir=~/.vim/undo/
set nofixeol " Do not insert a new line at the end of the file automatically
set backspace=indent,eol,start " Enable backspace key to delete stuffs properly
set nofixeol " Do not insert a new line at the end of the file automatically
set backspace=indent,eol,start " Enable backspace key to delete stuffs properly
set termguicolors
set relativenumber
set clipboard=unnamedplus
set cursorline " Highlight cursor line underneath the cursor horizontally.
set nobackup " Do not save backup files.
set incsearch " While searching though a file incrementally highlight matching characters as you type.
set ignorecase " Ignore capital letters during search.
set smartcase " This will allow you to search specifically for capital letters.
set showmode " Show the mode you are on the last line.
set showmatch " Show matching words during a search.
set wildmenu " Enable auto completion menu after pressing TAB.
set wildmode=list:longest " Make wildmenu behave like similar to Bash completion.
set cursorline " Highlight cursor line underneath the cursor horizontally.
set nobackup " Do not save backup files.
set incsearch " While searching though a file incrementally highlight matching characters as you type.
set ignorecase " Ignore capital letters during search.
set smartcase " This will allow you to search specifically for capital letters.
set showmode " Show the mode you are on the last line.
set showmatch " Show matching words during a search.
set wildmenu " Enable auto completion menu after pressing TAB.
set wildmode=list:longest " Make wildmenu behave like similar to Bash completion.
set foldenable
set foldmethod=indent
set ttyfast " Speed up scrolling in Vim
set ttyfast " Speed up scrolling in Vim
set encoding=UTF-8
set updatetime=300
set signcolumn=yes

File diff suppressed because one or more lines are too long