Skip to content

Instantly share code, notes, and snippets.

@bezborodow
Last active March 7, 2024 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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 for Ruby
alias rtags='ctags -R --languages=ruby --exclude=.git --exclude=log . $(bundle list --paths)'
# Ctags for PHP
# https://github.com/shawncplus/phpcomplete.vim/wiki/Patched-ctags
alias phptags='ctags -R --fields=+aimS --languages=php'
# 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 < .index | cut -f1 -d\ )
else
dir=$(find . -maxdepth 1 -type d | fzf)
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
# `ls` colors for Mac
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
export LESS=--raw
# Octave
alias k="octave-cli -q"
# Arduino
alias a="arduino-cli"
# Local binaries
PATH=$PATH:$HOME/local/bin
# Homebrew
PATH=$PATH:/home/linuxbrew/.linuxbrew/bin
# Arduino
PATH=$PATH:$HOME/.config/composer/vendor/bin
# PostgreSQL
export PAGER="less -S"
# Python
export PYTHONPYCACHEPREFIX=/tmp/pycache
# Gaming cursor.
alias cursorlg="echo -e '+' |osd_cat -p middle -A center -d 0 -f '-*-helvetica-*-r-*-*-26-*-*-*-*-*-*-*' -O 0 -c '#f00' -o -65 -i 1"
alias cursorsm="echo -e '+' |osd_cat -p middle -A center -d 0 -f '-*-helvetica-*-r-*-*-11-*-*-*-*-*-*-*' -O 0 -c '#0f0' -o -27 -i 1"
alias cursor="echo -e '+' |osd_cat -p middle -A center -d 0 -f '-*-helvetica-*-r-*-*-11-*-*-*-*-*-*-*' -O 0 -c '#fff' -o -27 -i 1"
alias cursoroff="pkill osd_cat"
# example user config (see "hg help config" for more info)
[ui]
# name and email, e.g.
# username = Jane Doe <jdoe@example.com>
username = Damien Bezborodov <##########>
#merge = internal:merge
merge = vimdiff
[extensions]
# uncomment these lines to enable some popular extensions
# (see "hg help extensions" for more info)
#
# pager =
# progress =
color =
rebase =
shelve =
[merge-tools]
vimdiff.executable = vimdiff
vimdiff.args = -f -d $output -M $local $base $other -c "wincmd J" -c "set modifiable" -c "set write"
vimdiff.premerge = keep
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@
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
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>'
nmap <C-P> :FZF<CR>
let $FZF_DEFAULT_COMMAND = 'ag -g ""'
map <F1> <Nop>
imap <F1> <Nop>
@bezborodow
Copy link
Author

bezborodow commented Feb 15, 2017

cd
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

git clone https://github.com/mattn/emmet-vim.git ~/.vim/bundle/emmet-vim
git clone https://github.com/lervag/vimtex.git ~/.vim/bundle/vimtex
git clone https://github.com/junegunn/fzf.vim.git  ~/.vim/bundle/fzf.vim

https://github.com/mattn/emmet-vim
https://github.com/lervag/vimtex
https://github.com/junegunn/fzf.vim

No longer used:

git clone https://github.com/elixir-lang/vim-elixir.git ~/.vim/bundle/vim-elixir
# git clone https://github.com/posva/vim-vue.git ~/.vim/bundle/vim-vue
# git clone https://github.com/jwalton512/vim-blade.git ~/.vim/bundle/vim-blade

@bezborodow
Copy link
Author

bezborodow commented Jul 24, 2019

.bash_profile:

tmux

if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then
    exec tmux
fi

https://unix.stackexchange.com/questions/43601/how-can-i-set-my-default-shell-to-start-up-tmux

screen

if [ -z "$STY" ]; then
    screen  -DRUq
fi

@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