Compare commits

7 Commits

Author SHA1 Message Date
a221982603 Merge branch 'master' of https://git.charlesreid1.com/dotfiles/rivanna
* 'master' of https://git.charlesreid1.com/dotfiles/rivanna:
  skip bootstrap.sh in bootstrap.sh
  fix rivanna dotfiles
2018-07-23 13:48:13 -07:00
9600c93ba4 updating queue info for rivanna 2018-07-23 13:47:45 -07:00
1a3324cb52 skip bootstrap.sh in bootstrap.sh 2018-07-23 15:30:36 -04:00
714e062d3f fix rivanna dotfiles 2018-07-23 15:29:27 -04:00
119c9b2754 Merge branch 'master' of https://git.charlesreid1.com/dotfiles/rivanna
* 'master' of https://git.charlesreid1.com/dotfiles/rivanna:
  ravenna->rivanna
  add links to rivana about/getting started pages
2018-07-23 12:24:59 -07:00
c8d9554dd9 add debian dotfiles 2018-07-23 12:23:41 -07:00
c632ae5d8e Merge branch 'rivanna-links' of dotfiles/rivanna into master 2018-07-18 19:39:37 +00:00
10 changed files with 855 additions and 0 deletions

136
.aliases Normal file
View File

@@ -0,0 +1,136 @@
#!/usr/bin/env bash
# lazy af
alias mk='make'
alias smk='snakemake'
alias smake='snakemake'
alias py='python3'
alias ipy='ipython --pylab'
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
alias ipaddr="dig +short myip.opendns.com @resolver1.opendns.com"
# one-letter aliases
# ---------------
alias h='echo ""; echo $HOSTNAME; echo ""'
alias p='echo -e ${PATH//:/\\n}'
alias e='exit'
alias u='cd ..'
alias v='vim'
# utility wrappers
# ---------------
alias pp='python setup.py build && python setup.py install'
alias sha1='openssl sha1'
alias du='du -kh'
alias dh='dh -kTh'
alias pc='pelican content'
# don't clobber
# -----------------
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# ls aliases
# --------------------
# Detect which `ls` flavor is in use
if ls --color > /dev/null 2>&1; then # GNU `ls`
colorflag="--color"
export LS_COLORS='no=00:fi=00:di=01;31:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'
groupflag="--group-directories-first"
else # macOS `ls`
colorflag="-G"
export LSCOLORS='BxBxhxDxfxhxhxhxhxcxcx'
groupflag=""
fi
alias ls="/bin/ls -1 ${colorflag} ${groupflag}"
alias sl='ls'
# List all files colorized in long format
alias l="/bin/ls -lhAF ${colorflag}"
alias ll="l"
# List all files colorized in long format, including dot files
alias la="l -a"
# List only directories
alias lsd="/bin/ls -lF ${colorflag} | grep --color=never '^d'"
alias lr='ls -r' # reverse
alias llr='ll -r' # reverse
alias lt='/bin/ls -lhAFt -G' # time
alias lt='ls -t' # time
alias llt='ll -t' # time
alias ltr='ls -tr' # reverse time
alias lltr='ll -tr' # reverse time
alias lk='ls -lSr' # by size (small to big)
# clear
# ---------------
alias clc='clear; pwd'
alias cl='clc; ll'
alias cll='clear; ll'
alias cls='clear; ls'
alias lcs='clear; ls'
alias csl='cls'
alias cla='clear; la'
alias c='clear'
# typo aliases
# ---------------
alias lll='ll'
alias mdkir='mkdir'
alias mdir='mkdir'
alias celar='clear'
alias cealr='clear'
# cd
# ---------------
alias back='cd $OLDPWD'
####################
# modified mathias
# Always enable colored `grep` output
# Note: `GREP_OPTIONS="--color=auto"` is deprecated, hence the alias usage.
alias grep='grep --color=auto'
# Get week number
alias week='date +%V'
# Print each PATH entry on a separate line
alias path='echo -e ${PATH//:/\\n}'

75
.bash_profile Executable file
View File

@@ -0,0 +1,75 @@
# This is the bash profile.
#
# This file sets PATH and bash options.
#
# to add your own non-committed machine-specific settings,
# use ~/.extras
# Must
EDITOR="vim"
GIT_EDITOR="vim"
# Python:
# Try not to have to deal with PYTHONPATH...
# Go
#export PATH="${HOME}/.local/bin:${PATH}"
# Pyenv
export PATH="${HOME}/.pyenv/bin:${PATH}"
#
# This ALWAYS complains when starting up the node.
# Don't add this to .bash_profile until the pyenv script is finished.
#
# only include this if you want to activate your env by default.
# you should also install a pyenv version!
eval "$(pyenv init -)"
#eval "$(pyenv virtualenv-init -)"
# Bash history
HISTFILE="$HOME/.bash_history"
HISTFILESIZE=1000000000
HISTIGNORE="ls:cls:clc:clear:pwd:l:ll:[ ]*"
HISTSIZE=1000000
HISTTIMEFORMAT=': %Y-%m-%d_%H:%M:%S; '
# Append to the Bash history file, rather than overwriting it
shopt -s histappend;
# Save Bash history
shopt -s cmdhist;
#############################
# modified mathias
# Load the shell dotfiles, and then some:
# * ~/.path can be used to extend `$PATH`.
# * ~/.extras can be used for other settings you dont want to commit.
for file in ~/.{path,bash_prompt,exports,aliases,functions,extras}; do
[ -r "$file" ] && [ -f "$file" ] && source "$file";
done;
unset file;
# Case-insensitive globbing (used in pathname expansion)
shopt -s nocaseglob;
# Autocorrect typos in path names when using `cd`
shopt -s cdspell;
# Enable tab completion for `g` by marking it as an alias for `git`
if type _git &> /dev/null && [ -f /usr/local/etc/bash_completion.d/git-completion.bash ]; then
complete -o default -o nospace -F _git g;
fi;
# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards
[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2- | tr ' ' '\n')" scp sftp ssh;

74
.bash_prompt Normal file
View File

@@ -0,0 +1,74 @@
#!/usr/bin/env bash
# Shell prompt based on the Solarized Dark theme.
# Screenshot: http://i.imgur.com/EkEtphC.png
# Heavily inspired by @necolass prompt: https://github.com/necolas/dotfiles
# iTerm → Profiles → Text → use 13pt Monaco with 1.1 vertical spacing.
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
export TERM='gnome-256color';
elif infocmp xterm-256color >/dev/null 2>&1; then
export TERM='xterm-256color';
fi;
if tput setaf 1 &> /dev/null; then
tput sgr0; # reset colors
bold=$(tput bold);
reset=$(tput sgr0);
# Solarized colors, taken from http://git.io/solarized-colors.
black=$(tput setaf 0);
blue=$(tput setaf 33);
cyan=$(tput setaf 37);
green=$(tput setaf 64);
orange=$(tput setaf 166);
purple=$(tput setaf 125);
red=$(tput setaf 124);
violet=$(tput setaf 61);
white=$(tput setaf 15);
yellow=$(tput setaf 136);
else
bold='';
reset="\e[0m";
black="\e[1;30m";
red="\e[1;31m";
green="\e[1;32m";
orange="\e[1;33m";
yellow="\e[1;33m";
blue="\e[1;34m";
purple="\e[1;35m";
violet="\e[1;35m";
cyan="\e[1;36m";
white="\e[1;37m";
fi;
# Ravenna is cyan
userStyle="${cyan}"
# Highlight the hostname when connected via SSH.
if [[ "${SSH_TTY}" ]]; then
hostStyle="${bold}${userStyle}";
else
hostStyle="${userStyle}";
fi;
# Root username is red
if [[ "${USER}" == "root" ]]; then
userStyle="${red}";
fi;
# Set the terminal title and prompt.
PS1="\[\033]0;\W\007\]"; # working directory base name
PS1+="\[${bold}\]\n"; # newline
PS1+="\[${userStyle}\]\u"; # username
PS1+="\[${white}\] on ";
PS1+="\[${hostStyle}\]\h"; # host
PS1+="\[${white}\] at ";
PS1+="[ \D{%Y-%m-%d} - \t ] in "; # date and time stamp
#PS1+="\[${green}\]\w"; # working directory full path
PS1+="\w"; # working directory full path
PS1+="\n";
PS1+="\[${white}\]\$ \[${reset}\]"; # `$` (and reset color)
export PS1;
PS2="\[${yellow}\]→ \[${reset}\]";
export PS2;

189
.gitconfig Normal file
View File

@@ -0,0 +1,189 @@
[user]
email = charlesreid1@gmail.com
name = Charles Reid
[credential]
helper = cache
[filter "media"]
clean = git-media-clean %f
smudge = git-media-smudge %f
[push]
default = simple
[alias]
# courtesy of https://stackoverflow.com/a/34467298
lg = !"git lg1"
lg1 = !"git lg1-specific --all"
lg2 = !"git lg2-specific --all"
lg3 = !"git lg3-specific --all"
lg1-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)'
lg2-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'
lg3-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset) %C(bold cyan)(committed: %cD)%C(reset) %C(auto)%d%C(reset)%n'' %C(white)%s%C(reset)%n'' %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)'
# View abbreviated SHA, description, and history graph of the latest 20 commits
l = log --pretty=oneline -n 20 --graph --abbrev-commit
# View the current working tree status using the short format
s = status -s
b = branch -v
bv = branch -v
ba = branch -a
r = remote -v
rv = remote -v
cdiff = diff --cached
# Show the diff between the latest commit and the current state
d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
# `git di $number` shows the diff between the state `$number` revisions ago and the current state
di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d"
# Pull in remote changes for the current repository and all its submodules
p = !"git pull; git submodule foreach git pull origin master"
# Clone a repository including all submodules
c = clone --recursive
# Commit all changes
ca = !git add -A && git commit -av
# Switch to a branch, creating it if necessary
go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f"
# Show verbose output about tags, branches or remotes
tags = tag -l
branches = branch -a
remotes = remote -v
# List aliases
aliases = config --get-regexp alias
# Amend the currently staged files to the latest commit
amend = commit --amend --reuse-message=HEAD
# Credit an author on the latest commit
credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f"
# Interactive rebase with the given number of latest commits
reb = "!r() { git rebase -i HEAD~$1; }; r"
# Remove the old tag with this name and tag the latest commit with it.
retag = "!r() { git tag -d $1 && git push origin :refs/tags/$1 && git tag $1; }; r"
# Find branches containing commit
fb = "!f() { git branch -a --contains $1; }; f"
# Find tags containing commit
ft = "!f() { git describe --always --contains $1; }; f"
# Find commits by source code
fc = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short -S$1; }; f"
# Find commits by commit message
fm = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f"
# List contributors with number of commits
contributors = shortlog --summary --numbered
[apply]
# Detect whitespace errors when applying a patch
whitespace = fix
[core]
# Use custom `.gitignore` and `.gitattributes`
excludesfile = ~/.gitignore
attributesfile = ~/.gitattributes
# Treat spaces before tabs and all kinds of trailing whitespace as an error
# [default] trailing-space: looks for spaces at the end of a line
# [default] space-before-tab: looks for spaces before tabs at the beginning of a line
whitespace = space-before-tab,-indent-with-non-tab,trailing-space
# Make `git rebase` safer on macOS
# More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/>
###trustctime = false
# Prevent showing files whose names contain non-ASCII symbols as unversioned.
# http://michael-kuehnel.de/git/2014/11/21/git-mac-osx-and-german-umlaute.html
precomposeunicode = false
# Speed up commands involving untracked files such as `git status`.
# https://git-scm.com/docs/git-update-index#_untracked_cache
untrackedCache = true
[color]
# Use colors in Git commands that are capable of colored output when
# outputting to the terminal. (This is the default setting in Git ≥ 1.8.4.)
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold # line info
old = red # deletions
new = green # additions
[color "status"]
added = yellow
changed = green
untracked = cyan
[diff]
# Detect copies as well as renames
renames = copies
[diff "bin"]
# Use `hexdump` to diff binary files
textconv = hexdump -v -C
[merge]
# Include summaries of merged commits in newly created merge commit messages
log = true
[push]
# Use the Git 1.x.x default to avoid errors on machines with old Git
# installations. To use `simple` instead, add this to your `~/.extra` file:
# `git config --global push.default simple`. See http://git.io/mMah-w.
default = matching
# Make `git push` push relevant annotated tags when pushing branches out.
followTags = true
# URL shorthands
[url "git@github.com:"]
insteadOf = "gh:"
pushInsteadOf = "github:"
pushInsteadOf = "git://github.com/"
[url "git://github.com/"]
insteadOf = "github:"
[url "git@gist.github.com:"]
insteadOf = "gst:"
pushInsteadOf = "gist:"
pushInsteadOf = "git://gist.github.com/"
[url "git://gist.github.com/"]
insteadOf = "gist:"

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
# This file is inteded to hold machine-specific, non-git-commited info
.extra

4
.hushlogin Normal file
View File

@@ -0,0 +1,4 @@
# The mere presence of this file in the home directory disables the system
# copyright notice, the date and time of the last login, the message of the
# day as well as other information that may otherwise appear on login.
# See `man login`.

63
.inputrc Normal file
View File

@@ -0,0 +1,63 @@
#########################
# modified mathias
# Make Tab autocomplete regardless of filename case
set completion-ignore-case on
# List all matches in case multiple possible completions are possible
set show-all-if-ambiguous on
# from http://dotfiles.org/~brendano/.inputrc
set blink-matching-paren on
# Use the text that has already been typed as the prefix for searching through
# commands (i.e. more intelligent Up/Down behavior)
"\e[A": history-search-backward
"\e[B": history-search-forward
"\eOA": history-search-backward
"\eOB": history-search-forward
# control + P and control + N - go forward/back thru history
"\C-p": history-search-backward
"\C-n": history-search-forward
"\M-p": history-search-backward
"\M-n": history-search-forward
"\M-?": dump-functions
## Change the mode of everything that uses readline
#set editing-mode vi
# Immediately add a trailing slash when autocompleting symlinks to directories
set mark-symlinked-directories on
# Do not autocomplete hidden files unless the pattern explicitly begins with a dot
set match-hidden-files off
# Show all autocomplete results at once
set page-completions off
# If there are more than 200 possible completions for a word, ask to show them all
set completion-query-items 200
# Show extra file information when completing, like `ls -F` does
set visible-stats on
# Be more intelligent when autocompleting by also looking at the text after
# the cursor. For example, when the current line is "cd ~/src/mozil", and
# the cursor is on the "z", pressing Tab will not autocomplete it to "cd
# ~/src/mozillail", but to "cd ~/src/mozilla". (This is supported by the
# Readline used by Bash 4.)
set skip-completed-text on
# Allow UTF-8 input and output, instead of showing stuff like $'\0123\0456'
set input-meta on
set output-meta on
set convert-meta off
# Use Alt/Meta + Delete to delete the preceding word
"\e[3;3~": kill-word

256
.vimrc Normal file
View File

@@ -0,0 +1,256 @@
" ==============================================
" vanilla vimrc
" ==============================================
set nocompatible " iMproved
filetype off " required
filetype plugin indent on
"setlocal spell spelllang=en_us
set nofoldenable " disable folding
" Turn off Esc+O key sequences (eliminates one-second delay when pressing O):
" https://superuser.com/questions/161178/why-does-vim-delay-for-a-second-whenever-i-use-the-o-command-open-a-new-line#161216
" if this is re-enabled i may stab someone.
set noesckeys
set ttimeoutlen=5
" you have to do this a second time
set nocompatible
" don't break words with wrap on
set linebreak
" don't make these keys do annoying things
nnoremap <F1> <nop>
nnoremap J mzJ`z
nnoremap n nzz
nnoremap } }zz
nnoremap <F1> <nop>
nnoremap Q <nop>
nnoremap K <nop>
" use j and k to move among display lines, not just file lines
noremap j gj
noremap k gk
" if compiled with autocmd, jump to last cursor position
if has("autocmd")
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
endif " has("autocmd")
" in Python, don't move comment hashtag to first column.
" smartindent unnecessary for python anyway.
" http://stackoverflow.com/questions/2063175/vim-insert-mode-comments-go-to-start-of-line
au! FileType python setl nosmartindent
" allow visual mode to go to blank space at end of lines
set virtualedit=block
" horizontal and vertical splits should go in right place
set splitbelow
set splitright
" turn on syntax highlighting
syntax on
set ic
" this highlights search items
set hls
" this highlights search items as they are typed
set incsearch
hi IncSearch cterm=none ctermfg=blue ctermbg=green
" make searches case-insensitive, unless they contain upper-case letters:
set ignorecase
set smartcase
" toggle search highlighting:
" space after search turns off highlights and clears messages
:nnoremap <silent> <Space> :nohlsearch<Bar>:echo<CR>
" turn off splash message
set shortmess+=I
" allow backspacing after first insert spot
set backspace=indent,eol,start
" murder that cursed blinking cursor
let &guicursor = &guicursor . ",a:blinkon0"
" Makefiles
au BufRead,BufNewFile Makefile*,*.make,*.mk set noexpandtab
" C++
au BufRead,BufNewFile *.cpp,*.cxx,*.cc,*.c,*.h,*.hpp,*.hxx,*.hh set tabstop=4 shiftwidth=4 softtabstop=4 nowrap
" Snakemake files: Snakefile, .rule, .settings, .snake, .smk
au BufNewFile,BufRead Snakefile set syntax=snakemake
au BufNewFile,BufRead *.rule set syntax=snakemake
au BufNewFile,BufRead *.settings set syntax=snakemake
au BufNewFile,BufRead *.snake set syntax=snakemake
au BufNewFile,BufRead *.smk set syntax=snakemake
" Yaml
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
" line numbering - make it more readable
set ruler
" eliminate line wrapping
set nowrap
" tabs are 4 spaces: the *correct* way
set tabstop=4 shiftwidth=4 expandtab
set nosmartindent " die die die
" color scheme stuff
colorscheme desert
"colorscheme solarized
" correct my common typos without me even noticing them:
abbreviate teh the
abbreviate hte the
abbreviate reccommend recommend
abbreviate reccomend recommend
abbreviate recomend recommend
abbreviate slef self
abbreviate paramters parameters
abbreviate exmaple example
"
" :e <tab> brings up longest; <tab> again shows list
set wildmode=longest,list
if exists('+autochdir')
" so :e is relative to current file
set autochdir
endif
" Running command :CD will change to current file's directory
com! CD cd %:p:h
" allow quit via double keypress
map XX :q!<CR>
map QQ :wq<CR>
map WQ :wq<CR>
map WW :w<CR>
if has("user_commands")
command! -bang -nargs=? -complete=file E e<bang> <args>
command! -bang -nargs=? -complete=file W w<bang> <args>
command! -bang -nargs=? -complete=file Wq wq<bang> <args>
command! -bang -nargs=? -complete=file WQ wq<bang> <args>
command! -bang Wa wa<bang>
command! -bang WA wa<bang>
command! -bang Q q<bang>
command! -bang QA qa<bang>
command! -bang Qa qa<bang>
endif
" don't autoindent markdown files
filetype plugin indent on
au filetype mkd call DisableIndent()
function! DisableIndent()
set autoindent&
set cindent&
set smartindent&
set indentexpr&
endfunction
" Persistent Undo
if has("persistent_undo")
set undodir=~/.vim/undodir
set undofile
endif
" Shift+Tab should de-indent
" Control + D is de-indent
inoremap <S-Tab> <C-d>
set autoindent
set backspace=2 " Fix broken backspace in some setups
set clipboard=unnamed " yank and paste with the system clipboard
set encoding=utf-8
set ruler " show where you are
set showcmd
set smartcase " case-sensitive search if any caps
set wildignore=log/**,node_modules/**,target/**,tmp/**,*.pyc
" keyboard shortcuts
let mapleader = ','
noremap <C-h> <C-w>h
noremap <C-j> <C-w>j
noremap <C-k> <C-w>k
noremap <C-l> <C-w>l
" in case you forgot to sudo
cnoremap w!! %!sudo tee > /dev/null %
" automatically rebalance windows on vim resize
autocmd VimResized * :wincmd =
" Fix Cursor in TMUX
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif
" Don't copy the contents of an overwritten selection.
vnoremap p "_dP
" Enhance command-line completion
set wildmenu
" Allow backspace in insert mode
set backspace=indent,eol,start
" Optimize for fast terminal connections
set ttyfast
" Dont add empty newlines at the end of files
set noeol
" Centralize backups, swapfiles and undo history
set backupdir=~/.vim/backups
set directory=~/.vim/swap
if exists("&undodir")
set undodir=~/.vim/undo
endif
" Dont create backups when editing files in certain directories
set backupskip=/tmp/*,/private/tmp/*
" Respect modeline in files
set modeline
set modelines=4
" Enable per-directory .vimrc files and disable unsafe commands in them
"""set exrc
"""set secure
" Enable line numbers
set number
" Enable syntax highlighting
syntax on
" Highlight current line
set cursorline
" Highlight searches
set hlsearch
" Ignore case of searches
set ignorecase
" Highlight dynamically as pattern is typed
set incsearch
" Always show status line
set laststatus=2
" Enable mouse in all modes
set mouse=a
" Disable error bells
set noerrorbells
" Dont reset cursor to start of line when moving around.
set nostartofline
" Show the cursor position
set ruler
" Dont show the intro message when starting Vim
set shortmess+=atI
" Show the current mode
set showmode
" Show the filename in the window titlebar
set title
" Show the (partial) command as its being typed
set showcmd
" Use relative line numbers
if exists("&relativenumber")
set relativenumber
au BufReadPost * set relativenumber
endif
" Start scrolling three lines before the horizontal window border
set scrolloff=7
" Strip trailing whitespace (,ss)
function! StripWhitespace()
let save_cursor = getpos(".")
let old_query = getreg('/')
:%s/\s\+$//e
call setpos('.', save_cursor)
call setreg('/', old_query)
endfunction
noremap <leader>ss :call StripWhitespace()<CR>
" Save a file as root (,W)
noremap <leader>W :w !sudo tee % > /dev/null<CR>
" Automatic commands
if has("autocmd")
" Enable file type detection
filetype on
" Treat .json files as .js
autocmd BufNewFile,BufRead *.json setfiletype json syntax=javascript
" Treat .md files as Markdown
autocmd BufNewFile,BufRead *.md setlocal filetype=markdown
endif
" Mark special characters
set listchars=nbsp:☠,tab:▸␣
"set listchars=tab:▸␣
set list

View File

@@ -10,6 +10,7 @@ git pull origin master;
function doIt() {
rsync \
--exclude ".git/" \
--exclude "bootstrap.sh" \
--exclude "cloud_init" \
--exclude "img" \
--exclude "tasks_sudo" \

55
queue.md Normal file
View File

@@ -0,0 +1,55 @@
# Rivanna queue system
https://arcs.virginia.edu/slurm
rivanna uses slurm for job management.
jobs are submitted using job scripts.
```
#!/bin/bash
#
#SBATCH --time=12:00:00
#SBATCH -A myaccount
module load gcc/7.1.0
./mycode
```
Other options:
* `-N` number of nodes
* `-n` number of tasks
* `--mem` memory per task
* `-p` partition
* `-A` account
Exporting variables:
* with current value:
```
#SBATCH --export=var1, var2, var3
```
* with specific value:
```
#SBATCH --export=variable1=value1,variable2=value2
```
Stdout and Stderr:
* To redirect stdout:
```
#SBATCH -o <outfile> or --output=<outfile>
```
* To redirect stderr:
```
#SBATCH -e <errfile> or --error=<errfile>
```