diff options
Diffstat (limited to 'minimal')
| -rw-r--r-- | minimal/.bash_aliases | 24 | ||||
| -rw-r--r-- | minimal/.bashrc | 42 | ||||
| -rw-r--r-- | minimal/.config/nvim/init.vim | 56 | ||||
| -rw-r--r-- | minimal/.config/tmux/tmux.conf | 62 | ||||
| l--------- | minimal/.git-prompt.sh | 1 | ||||
| -rw-r--r-- | minimal/.inputrc | 17 |
6 files changed, 202 insertions, 0 deletions
diff --git a/minimal/.bash_aliases b/minimal/.bash_aliases new file mode 100644 index 0000000..5fc24c5 --- /dev/null +++ b/minimal/.bash_aliases @@ -0,0 +1,24 @@ +alias e="$EDITOR" +alias aliases="$EDITOR ~/.bash_aliases && source ~/.bash_aliases" + +# color +alias diff='diff --color=always' +alias dir='dir --color=auto' +alias grep='grep --color=auto -i' # color case-insensitive + +# Sort files by ASCII value (override current locale) +alias ls='ls --color=auto --group-directories-first --classify' +alias la='ls -A' +alias ll='ls -l -h' +alias lla='ll -A' +alias ip='ip --color=auto' + +# https://missing.csail.mit.edu/2020/version-control/ +alias gitlogpretty='git log --all --graph --decorate --abbrev-commit' +# https://stackoverflow.com/a/15606995/7498073 +alias gitshowtrackedfiles='git ls-tree -r master --name-only' + +# Precautionary (one shouldn't rely on this!) +#alias rm='rm -I' # Promt before removing more than 3 files +#alias mv='mv -i' # Promt before overwrite +#alias cp='cp -i' # same diff --git a/minimal/.bashrc b/minimal/.bashrc new file mode 100644 index 0000000..761e585 --- /dev/null +++ b/minimal/.bashrc @@ -0,0 +1,42 @@ +# +# ~/.bashrc +# + +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +# Bash config +#export EDITOR=nvim +#HISTCONTROL=ignoreboth +#shopt -s histappend +#HISTSIZE=1000 +#HISTFILESIZE=2000 +#shopt -s checkwinsize + +# Alias definitions. +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +# Disable CTRL+S and CTRL+Q keybindings +# (used to pause and resume output to terminal) +# See: https://unix.stackexchange.com/a/137846/347754 +# https://unix.stackexchange.com/a/73499/347754 +stty -ixon + +# Prompt +# - user@host pwd (git prompt) +# Ref.: https://stackoverflow.com/a/15398153/7498073 +source ~/.git-prompt.sh +#PS1='[\u@\h \W]\$ ' +PS1='\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$ ' + +# less +LESS="-i" # ignore case +LESS+=" -S" # don't chop long lines +LESS+=" -j5" # Add 5 context lines +LESS+=" --RAW-CONTROL-CHARS" +export LESS + +# better `ls` (and other programs like `tree`) colors +#eval "$(dircolors)" diff --git a/minimal/.config/nvim/init.vim b/minimal/.config/nvim/init.vim new file mode 100644 index 0000000..7451e7c --- /dev/null +++ b/minimal/.config/nvim/init.vim @@ -0,0 +1,56 @@ +colorscheme industry +filetype plugin on + +" Command line: +set cmdheight=1 +set wildmenu +set wildignore+=*.o,.git,*.class + +" Search +set ignorecase +set smartcase + +" Screen +set nonumber +set scrolloff=5 " show a few lines of context +set colorcolumn=+1 " highlight column after 'textwidth' +" Add buffer number to the default status line with ruler +set statusline=%<%f\ %h%m%r%=b%02n\ \ %-14.(%l,%c%V%)\ %P + +" Indentation: 4 spaces +" See also: autoindent, smartindent, cindent, indentexpr +set tabstop=4 " Each '\t' takes 8 virtual (screen) columns +set shiftwidth=0 " (Auto)indentation. Also affects: >>, i_C-T, i_C-D +set expandtab " Expand inserted <Tab>s with <Space> +set smartindent " Smart indenting when starting a new line + +" Formatting: See fo-table +set formatoptions+=t " auto-wrap text (when inserting) +set formatoptions+=c " auto-wrap comments (when inserting) +set formatoptions+=q " Allow formatting of comments with "gq" +set formatoptions+=j " Removes comment leader when joining lines +set formatoptions+=l " Don't break long lines that are already typed +set formatoptions+=r " Insert current leader after <Enter> in Insert mode +set formatoptions+=p " Don't break honorifics like Prof. Smith +set formatoptions+=n " Recognize numbered lists +set formatoptions+=o " Automatically insert the current comment + " leader after `o`. + +" Wrap: Auto-break lines longer than 80 colums +set textwidth=80 +set wrap +set linebreak " Don't break words + +" Mouse +set mouse=a " Enable mouse for all modes + +" Buffers +set hidden " Allow for hidden modified buffers + +set splitbelow splitright + +" Mappings (F13 is <S-F1>, don't ask me why) +map <F7> :tabp<CR> +map <F8> :tabn<CR> +map <F19> :bNext<LF> +map <F20> :bnext<LF> diff --git a/minimal/.config/tmux/tmux.conf b/minimal/.config/tmux/tmux.conf new file mode 100644 index 0000000..be38e4c --- /dev/null +++ b/minimal/.config/tmux/tmux.conf @@ -0,0 +1,62 @@ +# Minimal tmux config +# Ref.: https://thevaluable.dev/tmux-config-mouseless/ + +# remap prefix from 'C-b' to 'C-a' +set-option -g prefix C-a +bind-key C-a send-prefix +unbind C-b + +# Start window numbering at 1 +set -g base-index 1 +setw -g pane-base-index 1 + +# Navigate history with vi keybindings +set-window-option -g mode-keys vi +set -g history-limit 10000 + +# From NeoVim advice: +# Fix 'escape-time' from 500ms to 10ms (better experience in Vim) +set-option -sg escape-time 10 +# focus-events (idk what this does) +set-option -g focus-events on + +# Vim friendly tmux config +# Ref.: https://gist.github.com/Lartza/6a7a62466a8a3e436234412d9b1c5066 + +setw -g monitor-activity on +set -g visual-activity on + +# FIXME: https://unix.stackexchange.com/a/131187/347754 +# y and p as in vim +bind Escape copy-mode +unbind p +bind p paste-buffer +bind-key -T copy-mode-vi 'v' send -X begin-selection +bind-key -T copy-mode-vi 'y' send -X copy-selection +#bind-key -T copy-mode-vi 'Space' send -X halfpage-down +#bind-key -T copy-mode-vi 'Bspace' send -X halfpage-up + +# extra commands for interacting with the ICCCM clipboard +#bind C-c run "tmux save-buffer - | xclip -i -sel clipboard" +#bind C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer" + +# New panes in the same window maintain the current path +# Thanks: https://unix.stackexchange.com/a/109255/347754 +bind % split-window -h -c "#{pane_current_path}" +bind '"' split-window -v -c "#{pane_current_path}" + +# moving between panes with vim movement keys +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R + +# moving between windows with vim movement keys +bind -r C-h select-window -t :- +bind -r C-l select-window -t :+ + +# resize panes with vim movement keys +bind -r H resize-pane -L 5 +bind -r J resize-pane -D 5 +bind -r K resize-pane -U 5 +bind -r L resize-pane -R 5 diff --git a/minimal/.git-prompt.sh b/minimal/.git-prompt.sh new file mode 120000 index 0000000..2714012 --- /dev/null +++ b/minimal/.git-prompt.sh @@ -0,0 +1 @@ +../extra/.git-prompt.sh
\ No newline at end of file diff --git a/minimal/.inputrc b/minimal/.inputrc new file mode 100644 index 0000000..fdff05d --- /dev/null +++ b/minimal/.inputrc @@ -0,0 +1,17 @@ +# Set up "vi input mode" in bash + +$include /etc/inputrc +set editing-mode vi +$if mode=vi + +set show-mode-in-prompt on +set vi-ins-mode-string \1\e[6 q\2 +set vi-cmd-mode-string \1\e[2 q\2 + +set keymap vi-command +Control-l: clear-screen + +set keymap vi-insert +Control-l: clear-screen + +$endif |
