diff --git a/.config/remote.bashrc b/.config/remote.bashrc new file mode 100644 index 0000000..0811d77 --- /dev/null +++ b/.config/remote.bashrc @@ -0,0 +1,161 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples + +# If not running interactively, don't do anything +case $- in + *i*) ;; + *) return;; +esac + +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# If set, the pattern "**" used in a pathname expansion context will +# match all files and zero or more directories and subdirectories. +#shopt -s globstar + +# make less more friendly for non-text input files, see lesspipe(1) +#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + xterm-color|*-256color) color_prompt=yes;; +esac + +# uncomment for a colored prompt, if the terminal has the capability; turned +# off by default to not distract the user: the focus in a terminal window +# should be on the output of commands, not on the prompt +#force_color_prompt=yes + +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt= + fi +fi + +if [ "$color_prompt" = yes ]; then + PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' +else + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +fi +unset color_prompt force_color_prompt + +# If this is an xterm set the title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + +# enable color support of ls and also add handy aliases +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' + +# Alias definitions. +# You may want to put all your additions into a separate file like +# ~/.bash_aliases, instead of adding them here directly. +# See /usr/share/doc/bash-doc/examples in the bash-doc package. + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if ! shopt -oq posix; then + 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 +fi + +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion +source ~/.nvm/nvm.sh + + +# Append to original bashrc for minimal setup +# echo $DOTFILES/wsl/.bashrc >> ~/.bashrc +bind 'set show-mode-in-prompt on' +set -o vi + +alias sv="sudo vim" +alias v="vim" + +alias sdocker="sudo docker" +alias scompose="sudo docker compose up -d" +alias sdockerps="sudo docker ps" +alias netl="netstat -tulnp" + +alias apt="sudo apt" +alias apts="apt search" +alias apti="sudo apt install" +aptr() { + sudo apt remove $1 || sudo apt autoremove +} +alias aptu="sudo apt upgrade && sudo apt update" + +alias l="ls -lah" +alias ll="ls -l" +alias la="ls -lA" + +bind 'set vi-ins-mode-string "sh"' +bind 'set vi-cmd-mode-string "vi"' + + + +PS2=" > " +update_ps1() { + local last_status=$? + if [[ $last_status -eq 0 ]]; then + PS1="\[\e[0;33m\]  \[\e[0;35m\][\A] \[\e[0;32m\]\u @ \h \[\e[0;34m\]in \w \[\e[0;32m\]✔\n \$ \[\e[0m\]" + else + PS1="\[\e[0;33m\]  \[\e[0;35m\][\A] \[\e[0;32m\]\u @ \h \[\e[0;34m\]in \w \[\e[0;31m\]✘\n \$ \[\e[0m\]" + fi +} + +PROMPT_COMMAND=update_ps1 diff --git a/.config/vim/noxdg.vimrc b/.config/vim/noxdg.vimrc new file mode 100644 index 0000000..376cc2a --- /dev/null +++ b/.config/vim/noxdg.vimrc @@ -0,0 +1,106 @@ +" $VIMRUNTIME refers to the versioned system directory where Vim stores its +" system runtime files -- /usr/share/vim/vim. +" +" Vim will load $VIMRUNTIME/defaults.vim if the user does not have a vimrc. +" This happens after /etc/vim/vimrc(.local) are loaded, so it will override +" any settings in these files. +" +" If you don't want that to happen, uncomment the below line to prevent +" defaults.vim from being loaded. +" let g:skip_defaults_vim = 1 +" +" If you would rather _use_ default.vim's settings, but have the system or +" user vimrc override its settings, then uncomment the line below. +" source $VIMRUNTIME/defaults.vim + +" All Debian-specific settings are defined in $VIMRUNTIME/debian.vim and +" sourced by the call to :runtime you can find below. If you wish to change +" any of those settings, you should do it in this file or +" /etc/vim/vimrc.local, since debian.vim will be overwritten everytime an +" upgrade of the vim packages is performed. It is recommended to make changes +" after sourcing debian.vim so your settings take precedence. + +runtime! debian.vim + +" Uncomment the next line to make Vim more Vi-compatible +" NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes +" numerous options, so any other options should be set AFTER changing +" 'compatible'. +"set compatible + +" Vim5 and later versions support syntax highlighting. Uncommenting the next +" line enables syntax highlighting by default. +syntax on + +" If using a dark background within the editing area and syntax highlighting +" turn on this option as well +"set background=dark + +" Uncomment the following to have Vim jump to the last position when +" reopening a file +"au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif + +" Uncomment the following to have Vim load indentation rules and plugins +" according to the detected filetype. +"filetype plugin indent on + +" The following are commented out as they cause vim to behave a lot +" differently from regular Vi. They are highly recommended though. +set showcmd " Show (partial) command in status line. +set showmatch " Show matching brackets. +set ignorecase " Do case insensitive matching +set smartcase " Do smart case matching +set incsearch " Incremental search +"set autowrite " Automatically save before commands like :next and :make +" set hidden " Hide buffers when they are abandoned +"set mouse=a " Enable mouse usage (all modes) + +" Source a global configuration file if available +if filereadable("/etc/vim/vimrc.local") + source /etc/vim/vimrc.local +endif + +" This is a minimal setup of vimrc +" ln -sf $DOTFILES/.config/vim/vimrc $XDG_CONFIG_HOME/vim/vimrc + +" Colemak Keys + +" Arrow remap +noremap n j +noremap e k +noremap i l +noremap N J +noremap E K +noremap I L + +" Similar position to i +noremap l i +noremap L I +" ne[k]st +noremap k n +noremap K N +" [j]ump +noremap j e +noremap J E + +" Normal minimal setup + +noremap Y y$ +set expandtab +set tabstop=4 +set shiftwidth=4 +set autoindent +set smartindent +set wrap +set scrolloff=3 +set hlsearch +set incsearch +set ignorecase +set smartcase + +set number +set relativenumber + +set laststatus=2 +set showcmd +set statusline=%<%f\ %h%m%r\ %=\ [%l,%v]\ [%p%%]\ [\ %Y]\ [󱑉\ %{strftime('%H:%M:%S')}]