Skip to content

Instantly share code, notes, and snippets.

@bezborodow
Last active May 27, 2025 08:24
Show Gist options
  • Save bezborodow/51cb712c1f8d454d506a to your computer and use it in GitHub Desktop.
Save bezborodow/51cb712c1f8d454d506a to your computer and use it in GitHub Desktop.
Damo's UNIX Development Environment Preferences
# Bash prompt with colour-coded exit status
PS1="\e[0;36m\]\h \`if [ \$? = 0 ]; then echo '\e[01;32m\]\w\e[00m\]\$ '; else echo '\e[01;31m\]\w\e[00m\]\$ '; fi\`"
# Or for local machine:
# PS1="\e[0;46m\]\h\e[00m\] \`if [ \$? = 0 ]; then echo '\e[01;32m\]\w\e[00m\]\$ '; else echo '\e[01;31m\]\w\e[00m\]\$ '; fi\`";
# Ctags
alias rbtags='ctags -R --languages=ruby --exclude=.git --exclude=log . $(bundle list --paths)'
alias pytags='ctags -R --languages=python'
# Git shortcuts
alias gg='git grep -n'
alias gp='git push'
alias cg='cd $(git rev-parse --show-toplevel)' # https://blogboard.io/blog/knowledge/cd-to-git-root/
alias smd='pwd > $HOME/.config/cm-maindir'
alias cm='cd $(< $HOME/.config/cm-maindir)'
alias inst='sudo make install' # except on production servers!!
function lsi {
if [ -f ".index" ]; then
dir=$(fzf --accept-nth 1 < .index)
else
dir=$(fzf --walker=dir)
fi
if [ ! -z $dir ]; then
if [ -d $dir ]; then
cd $dir
pwd
fi
fi
}
alias tree='tree --gitignore'
alias ls='ls --color=auto'
alias grep='grep --color=auto'
# History size
export HISTFILESIZE=100000
export HISTSIZE=10000
HISTCONTROL=ignorespace
# Local binaries
PATH=$PATH:$HOME/local/bin
# PostgreSQL
export PAGER="less -S"
# Python
export PYTHONPYCACHEPREFIX=/tmp/pycache
hardstatus alwayslastline "%{b kw}%H %{r}%1` %{w}| %{g}%l %{w}| %{-b kw}%u %-Lw%{= rW}%50> %n%f %t %{-}%+Lw%<"
termcapinfo xterm* ti@:te@
# Don't retain output after quitting vim/less/etc
altscreen on
# More scrollback
scrollback 100000
set line-graphics = utf-8
syntax on
set tabstop=4
set shiftwidth=4
set expandtab
set autoindent
set smartindent
set ruler
set backspace=indent,eol,start
set hlsearch
set number
set mouse=n
filetype plugin on
filetype indent on
autocmd BufNewFile,BufRead Gemfile set filetype=ruby
autocmd FileType ruby setlocal tabstop=2 shiftwidth=2
autocmd FileType eruby setlocal tabstop=2 shiftwidth=2
autocmd FileType javascript setlocal tabstop=2 shiftwidth=2
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin()
Plug 'mattn/emmet-vim'
Plug 'lervag/vimtex'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
call plug#end()
let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclude-standard']
let g:vimtex_include_search_enabled = 0
let g:user_emmet_expandabbr_key = '<c-e>'
let $FZF_DEFAULT_COMMAND = 'ag -g ""'
nmap <C-P> :FZF<CR>
map <F1> <Nop>
imap <F1> <Nop>
Host *
ControlPath ~/.ssh/_ctrlmasters/%r@%h:%p
ControlMaster auto
ControlPersist 1m
@bezborodow
Copy link
Author

Emacs keybindings on the desktop:

gsettings set org.gnome.desktop.interface gtk-key-theme "Emacs"

@bezborodow
Copy link
Author

bezborodow commented Feb 28, 2024

OH GOD NO MORE NANO PLEASE NO MORE NOOBS DIE DIE DIE

sudo dnf remove -y nano-default-editor nano
sudo dnf install -y vim-default-editor

@bezborodow
Copy link
Author

bezborodow commented Feb 28, 2024

# Alright... if you slice it thin, then it tastes more tender!
Defaults:dbezborodov timestamp_timeout=720

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment