diff options
| -rw-r--r-- | bin/fun.sh | 5 | ||||
| -rw-r--r-- | bin/navigation.sh | 43 | ||||
| -rw-r--r-- | dot-emacs | 52 | ||||
| -rw-r--r-- | dot-profile | 35 | ||||
| -rw-r--r-- | dot-tmux.conf | 67 |
5 files changed, 202 insertions, 0 deletions
diff --git a/bin/fun.sh b/bin/fun.sh new file mode 100644 index 0000000..3db38f2 --- /dev/null +++ b/bin/fun.sh @@ -0,0 +1,5 @@ +# +# Fun +# +alias rmatrix='echo -ne "\e[31m" ; while true ; do echo -ne "\e[$(($RANDOM % 2 + 1))m" ; tr -c "[:print:]" " " < /dev/urandom | dd count=1 bs=50 2> /dev/null ; done' +alias gmatrix='echo -ne "\e[32m" ; while true ; do echo -ne "\e[$(($RANDOM % 2 + 1))m" ; tr -c "[:print:]" " " < /dev/urandom | dd count=1 bs=50 2> /dev/null ; done'
\ No newline at end of file diff --git a/bin/navigation.sh b/bin/navigation.sh new file mode 100644 index 0000000..f98fb52 --- /dev/null +++ b/bin/navigation.sh @@ -0,0 +1,43 @@ +# +# Navigation +# +export MARKPATH=$HOME/.marks +function go { + #echo "$MARKPATH/$1" + if [[ ! -e "$MARKPATH/$1" ]]; then + echo "No such mark: $1" + elif [[ -h "$MARKPATH/$1" ]]; then + pushd "$(readlink "$MARKPATH/$1")" 2>/dev/null + elif [[ -x "$MARKPATH/$1" ]]; then + local cmd="$MARKPATH/$1" + shift + . $cmd $@ + fi +} +function mark { + mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$1" +} +function unmark { + rm "$MARKPATH/$1" +} +function marks { + for f in "$MARKPATH"/*; do + local name="$(basename "$f")" + if [[ -h "$f" ]]; then + local target="$(readlink "$f")" + echo "${name} -> ${target}" + elif [[ -x "$f" ]]; then + echo "${name}*" + fi + done +} +# Tab completion +_completemarks() { + local curw=${COMP_WORDS[COMP_CWORD]} + local wordlist=$(ls -p $MARKPATH) + local IFS=$'\n' + COMPREPLY=($(compgen -W "${wordlist[@]}" -- "$curw")) + return 0 +} + +complete -o filenames -F _completemarks go unmark diff --git a/dot-emacs b/dot-emacs new file mode 100644 index 0000000..b4837d6 --- /dev/null +++ b/dot-emacs @@ -0,0 +1,52 @@ +;; Switch off toolbar +(tool-bar-mode -1) + +;; Highlight current line +(global-hl-line-mode 1) + +;; Show line numbers by default +(global-linum-mode 1) + +;; Show line-number in the mode line +(line-number-mode 1) + +;; Show column-number in the mode line +(column-number-mode 1) + +;; set keys for Apple keyboard, for emacs in OS X +(setq mac-command-modifier 'control) ; make cmd key do Control +(setq mac-option-modifier 'meta) ; make opt key do Meta +(setq mac-control-modifier 'control) ; make Control key do Control. TODO: change to Super eventually +(setq ns-function-modifier 'hyper) ; make Fn key do Hyper + +;; redifine £ as # for Python coding, but allow £ as H-3 (Hyper-3 - Hyper mapped to Fn on Mac) +(define-key key-translation-map (kbd "£") "#") ; hash +(define-key key-translation-map (kbd "H-3") (kbd "£")) ; pound + +;; IDO for auto-completion +(ido-mode 1) +(setq ido-enable-flex-matching t) +(setq ido-everywhere t) ; enable IDO in C-x C-f also + +;; Faster startup: disable splash and go straight to *scratch* +(setq inhibit-startup-message t + inhibit-startup-echo-area-message t) + +;; Enable auto-indent globally +(define-key global-map (kbd "RET") 'newline-and-indent) + +;; +;; Custom managed variables from here on +;; +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(linum-format "%3d")) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + ) diff --git a/dot-profile b/dot-profile new file mode 100644 index 0000000..d6d3e87 --- /dev/null +++ b/dot-profile @@ -0,0 +1,35 @@ + +# MacPorts Installer addition on 2010-01-16_at_22:19:33: adding an appropriate PATH variable for use with MacPorts. +export PATH=/opt/local/bin:/opt/local/sbin:$PATH +# Finished adapting your PATH environment variable for use with MacPorts. + +. ~/bin/navigation.sh + +# Eternal bash history. +# --------------------- +export HISTFILESIZE= +export HISTSIZE= +export HISTTIMEFORMAT="[%F %T] " +# Change the file location because certain bash sessions truncate .bash_history file upon close. +export HISTFILE=~/.bash_eternal_history + +# Use MacPorts GNU commands instead of Mac BSD defaults +alias sort=/opt/local/libexec/gnubin/sort +alias ls='/opt/local/libexec/gnubin/ls --color=auto' +alias grep='grep --color=auto' +alias fgrep='fgrep --color=auto' +alias egrep='egrep --color=auto' + +# some more ls aliases +alias ll='ls -alF' +alias la='ls -A' +alias l='ls -CF' + +## +# Your previous /Users/mamago/.profile file was backed up as /Users/mamago/.profile.macports-saved_2014-11-02_at_10:11:49 +## + +# MacPorts Installer addition on 2014-11-02_at_10:11:49: adding an appropriate PATH variable for use with MacPorts. +export PATH="/opt/local/bin:/opt/local/sbin:$PATH" +# Finished adapting your PATH environment variable for use with MacPorts. + diff --git a/dot-tmux.conf b/dot-tmux.conf new file mode 100644 index 0000000..1d7dec6 --- /dev/null +++ b/dot-tmux.conf @@ -0,0 +1,67 @@ +# Default term to screen +set-option -g default-terminal screen + +# Start window numbering at 1 +set -g base-index 1 + +# Start pane numbering at 1 +setw -g pane-base-index 1 + +# Allow better key handling in terminal +setw -g xterm-keys on + +# Allow xterm titles in terminal window, terminal scrolling with scrollbar, and setting overrides of C-Up, C-Down, C-Left, C-Right +set -g terminal-overrides "xterm*:XT:smcup@:rmcup@:kUP5=\eOA:kDN5=\eOB:kLFT5=\eOD:kRIT5=\eOC" + +# Scroll History +set -g history-limit 30000 + +# Set titles on +set-option -g set-titles on +set-option -g set-titles-string '[#S:#I #H] #T' + +# From http://blog.niklasottosson.com/?p=574 +# Splitting windows into panes with h and v +bind-key h split-window -v +bind-key v split-window -h + +# Set up resize-pane keys +bind-key + resize-pane -D 3 +bind-key / resize-pane -L 3 +bind-key - resize-pane -U 3 +bind-key * resize-pane -R 3 + + +# Solarized color scheme from https://raw.github.com/seebi/tmux-colors-solarized + +#### COLOUR (Solarized 256) + +# default statusbar colors +set-option -g status-bg colour235 #base02 +set-option -g status-fg colour136 #yellow +set-option -g status-attr default + +# default window title colors +set-window-option -g window-status-fg colour244 #base0 +set-window-option -g window-status-bg default +#set-window-option -g window-status-attr dim + +# active window title colors +set-window-option -g window-status-current-fg colour166 #orange +set-window-option -g window-status-current-bg default +#set-window-option -g window-status-current-attr bright + +# pane border +set-option -g pane-border-fg colour247 +set-option -g pane-active-border-fg colour235 + +# message text +set-option -g message-bg colour235 #base02 +set-option -g message-fg colour166 #orange + +# pane number display +set-option -g display-panes-active-colour colour33 #blue +set-option -g display-panes-colour colour166 #orange + +# clock +set-window-option -g clock-mode-colour colour64 #green |
