Initial checkin
This commit is contained in:
commit
a5f2dd9208
15 changed files with 2041 additions and 0 deletions
21
.Xmodmap
Normal file
21
.Xmodmap
Normal file
|
@ -0,0 +1,21 @@
|
|||
keysym semicolon = semicolon colon odiaeresis Odiaeresis
|
||||
keysym apostrophe = apostrophe quotedbl adiaeresis Adiaeresis
|
||||
keysym bracketleft = bracketleft braceleft aring Aring
|
||||
|
||||
remove Lock = Caps_Lock
|
||||
!remove Control = Control_L
|
||||
!keysym Control_L = Caps_Lock
|
||||
keysym Caps_Lock = Control_L
|
||||
!add Lock = Caps_Lock
|
||||
add Control = Control_L
|
||||
|
||||
|
||||
remove Control = Control_R
|
||||
clear mod5
|
||||
clear mod1
|
||||
add mod1 = Alt_L
|
||||
add mod4 = Control_R
|
||||
add mod3 = Alt_R
|
||||
|
||||
keysym Alt_R = Mode_switch
|
||||
|
9
.Xresources
Normal file
9
.Xresources
Normal file
|
@ -0,0 +1,9 @@
|
|||
Xft.dpi: 96
|
||||
Xft.antialias: 1
|
||||
Xft.rgba: rgb
|
||||
Xft.hinting: 1
|
||||
Xft.autohint: 0
|
||||
Xft.hintstyle: hintslight
|
||||
Xft.lcdfilter: lcddefault
|
||||
|
||||
|
15
.agignore
Normal file
15
.agignore
Normal file
|
@ -0,0 +1,15 @@
|
|||
*~
|
||||
*.a
|
||||
*.class
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iwr
|
||||
*.iws
|
||||
*.la
|
||||
*.min.css
|
||||
*.min.js
|
||||
*.o
|
||||
*.out
|
||||
*.pyc
|
||||
*.so
|
||||
*.swp
|
23
.bash_aliases
Normal file
23
.bash_aliases
Normal file
|
@ -0,0 +1,23 @@
|
|||
alias ag='ag --pager less'
|
||||
alias cdiff='colordiff -u'
|
||||
alias dotgit='git --work-tree $HOME --git-dir $HOME/.dot_git'
|
||||
alias hs='history -a; history -n'
|
||||
alias l='less -n'
|
||||
alias lower="tr '[:upper:]' '[:lower:]'"
|
||||
alias pstree="pstree -Auh | less"
|
||||
alias tail='tail -n $LINES'
|
||||
alias timestamp='TZ=Z date "+%Y%m%dT%H%M%SZ"'
|
||||
alias tree='tree -C'
|
||||
alias upper="tr '[:lower:]' '[:upper:]'"
|
||||
alias vimdiff='vimdiff -R'
|
||||
alias vim='vim -X'
|
||||
|
||||
ls --group-directories-first >/dev/null 2>&1
|
||||
if [ $? -gt 0 ] ; then
|
||||
alias ls='ls --color=auto'
|
||||
else
|
||||
alias ls='ls --color=auto --group-directories-first'
|
||||
fi
|
||||
alias lsc='ls -C'
|
||||
|
||||
# vim: ft=sh
|
6
.bash_completion
Normal file
6
.bash_completion
Normal file
|
@ -0,0 +1,6 @@
|
|||
# Bazel
|
||||
[ -f /usr/local/lib/bazel/bin/bazel-complete.bash ] && source /usr/local/lib/bazel/bin/bazel-complete.bash
|
||||
|
||||
# Rust
|
||||
[ -f /usr/local/etc/bash_completion.d/cargo ] && source /usr/local/etc/bash_completion.d/cargo
|
||||
|
79
.bash_exports
Normal file
79
.bash_exports
Normal file
|
@ -0,0 +1,79 @@
|
|||
#!/bin/bash
|
||||
|
||||
mylib=$HOME/lib
|
||||
|
||||
export REALNAME="Daniel Lundin"
|
||||
export EMAIL="dln@eintr.org"
|
||||
|
||||
export SSH_AUTH_SOCK=$HOME/.ssh/ssh_auth_sock
|
||||
|
||||
## Shell stuff
|
||||
export PATH=$HOME/bin:$PATH:/bin:/sbin:/usr/sbin:/usr/local/sbin
|
||||
export LANG=en_US.UTF-8
|
||||
export HISTCONTROL=ignoreboth
|
||||
export HISTSIZE=3000
|
||||
export WORDCHARS='*?_[]~=&;!#$%^(){}'
|
||||
export EDITOR=vim
|
||||
|
||||
# ssh
|
||||
export SSH_AUTH_SOCK=$HOME/.ssh/ssh_auth_sock
|
||||
|
||||
## Parquet
|
||||
export PATH=$mylib/parquet-tools:$PATH
|
||||
|
||||
## Packer
|
||||
export PATH=$mylib/packer:$PATH
|
||||
|
||||
## Terraform
|
||||
export PATH=$mylib/terraform:$PATH
|
||||
|
||||
## Pager
|
||||
export LESS='-BNJFXRgiM -h512 -x2'
|
||||
export PAGER='less -nL'
|
||||
export ACK_PAGER='less -nLR'
|
||||
|
||||
## Git
|
||||
export GIT_AUTHOR_NAME=$REALNAME
|
||||
export GIT_AUTHOR_EMAIL=$EMAIL
|
||||
export GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME
|
||||
export GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL
|
||||
export GIT_PAGER='less -nBJFXRgiM -h512'
|
||||
|
||||
## Java
|
||||
export JAVA_HOME=/usr/lib/jvm/java-8-oracle/
|
||||
export IDEA_VM_OPTIONS="$HOME/Dropbox/dotfiles/idea.vmoptions"
|
||||
export IDEA_JDK=$HOME/lib/jdk-8u5-tuxjdk-b08
|
||||
|
||||
## CMake
|
||||
export CTEST_OUTPUT_ON_FAILURE=1
|
||||
|
||||
## GTest
|
||||
export GTEST_COLOR=1
|
||||
|
||||
## GCC
|
||||
export CGCC_FORCE_COLOR=1
|
||||
|
||||
## Go
|
||||
export GOROOT=$mylib/go
|
||||
export GOPATH=$HOME/workspace
|
||||
export GOSRC=$mylib/go/src
|
||||
export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
|
||||
|
||||
## Rust
|
||||
export PATH=$mylib/rust/bin:$PATH
|
||||
export PATH=$HOME/.vim/bundle/racer/target/release:$PATH
|
||||
export RUST_SRC_PATH=$HOME/workspace/src/github.com/rust-lang/rust/src
|
||||
|
||||
## grep
|
||||
export GREP_COLOR='38;5;232;48;5;214;1'
|
||||
|
||||
if [ "$TERM" != "dumb" ]; then
|
||||
if [ -x /usr/bin/pygmentize ]; then
|
||||
export LESSOPEN="|/usr/bin/pygmentize -f terminal256 -O style=tango %s"
|
||||
elif [ -x /usr/local/bin/lesspipe.sh ]; then
|
||||
export LESSOPEN="|/usr/local/bin/lesspipe.sh %s"
|
||||
elif [ -x /usr/bin/lesspipe.sh ]; then
|
||||
export LESSOPEN="|/usr/local/bin/lesspipe.sh %s"
|
||||
fi
|
||||
fi
|
||||
|
113
.bashrc
Normal file
113
.bashrc
Normal file
|
@ -0,0 +1,113 @@
|
|||
export DOTFILES="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)"
|
||||
export PATH=$DOTFILES/bin:$PATH
|
||||
|
||||
|
||||
# make less more friendly for non-text input files, see lesspipe(1)
|
||||
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
|
||||
export LESSCLOSE=''
|
||||
export LESSOPEN="|/usr/local/bin/lesspipe.sh %s"
|
||||
#export LESSOPEN="|less-pygmentize %s"
|
||||
|
||||
export LESS_TERMCAP_mb=$'\E[01;34PS1_PREFIX="\u@\h:"m'
|
||||
export LESS_TERMCAP_md=$'\E[01;34m'
|
||||
export LESS_TERMCAP_me=$'\E[0m'
|
||||
export LESS_TERMCAP_se=$'\E[0m'
|
||||
export LESS_TERMCAP_so=$'\E[01;44;33m'
|
||||
export LESS_TERMCAP_ue=$'\E[0m'
|
||||
export LESS_TERMCAP_us=$'\E[01;32m'
|
||||
|
||||
# git
|
||||
export GIT_PS1_SHOWDIRTYSTATE=1
|
||||
if [ -f "$HOME/.bash_completion_git" ] ; then
|
||||
source ~/.bash_completion_git
|
||||
fi
|
||||
|
||||
# Check for interactive shell.
|
||||
if [ -n "$PS1" ]; then
|
||||
if [ -f /etc/bash_completion ]; then
|
||||
. /etc/bash_completion
|
||||
fi
|
||||
fi
|
||||
unset bash bminor bmajor
|
||||
|
||||
# Bash settings
|
||||
export IGNOREEOF=1
|
||||
# bind '"\t":menu-complete' # cycle completion
|
||||
# set -o ignoreeof # don't exit on C-d
|
||||
shopt -s cdspell # spellcheck cd
|
||||
|
||||
shopt -s histappend # Save history
|
||||
PROMPT_COMMAND='history -a ; ${PROMPT_COMMAND}'
|
||||
|
||||
# check the window size after each command and, if necessary,
|
||||
# update the values of LINES and COLUMNS.
|
||||
shopt -s checkwinsize
|
||||
|
||||
|
||||
# acd_func 1.0.5, 10-nov-2004
|
||||
# petar marinov, http:/geocities.com/h2428, this is public domain
|
||||
|
||||
cd_func ()
|
||||
{
|
||||
local x2 the_new_dir adir index
|
||||
local -i cnt
|
||||
|
||||
if [[ $1 == "--" ]]; then
|
||||
dirs -v
|
||||
return 0
|
||||
fi
|
||||
|
||||
the_new_dir=$1
|
||||
[[ -z $1 ]] && the_new_dir=$HOME
|
||||
|
||||
if [[ ${the_new_dir:0:1} == '-' ]]; then
|
||||
# Extract dir N from dirs
|
||||
index=${the_new_dir:1}
|
||||
[[ -z $index ]] && index=1
|
||||
adir=$(dirs +$index)
|
||||
[[ -z $adir ]] && return 1
|
||||
the_new_dir=$adir
|
||||
fi
|
||||
|
||||
# '~' has to be substituted by ${HOME}
|
||||
[[ ${the_new_dir:0:1} == '~' ]] && the_new_dir="${HOME}${the_new_dir:1}"
|
||||
|
||||
# Now change to the new dir and add to the top of the stack
|
||||
pushd "${the_new_dir}" > /dev/null
|
||||
[[ $? -ne 0 ]] && return 1
|
||||
the_new_dir=$(pwd)
|
||||
|
||||
# Trim down everything beyond 11th entry
|
||||
popd -n +11 2>/dev/null 1>/dev/null
|
||||
|
||||
# Remove any other occurence of this dir, skipping the top of the stack
|
||||
for ((cnt=1; cnt <= 10; cnt++)); do
|
||||
x2=$(dirs +${cnt} 2>/dev/null)
|
||||
[[ $? -ne 0 ]] && return 0
|
||||
[[ ${x2:0:1} == '~' ]] && x2="${HOME}${x2:1}"
|
||||
if [[ "${x2}" == "${the_new_dir}" ]]; then
|
||||
popd -n +$cnt 2>/dev/null 1>/dev/null
|
||||
cnt=cnt-1
|
||||
fi
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
alias cd=cd_func
|
||||
|
||||
umask 2
|
||||
stty speed 115200 >> /dev/null 2>&1
|
||||
|
||||
|
||||
# OpenPGP applet support for YubiKey NEO
|
||||
#if [ ! -f /tmp/gpg-agent.env ]; then
|
||||
# killall gpg-agent;
|
||||
# eval $(gpg-agent --daemon --enable-ssh-support > /tmp/gpg-agent.env);
|
||||
#fi
|
||||
#. /tmp/gpg-agent.env
|
||||
|
||||
source $HOME/.bash_aliases
|
||||
source $HOME/.bash_exports
|
||||
source $HOME/.bash_prompt
|
||||
source $HOME/.bash_completion
|
118
.gitconfig
Normal file
118
.gitconfig
Normal file
|
@ -0,0 +1,118 @@
|
|||
[core]
|
||||
excludesfile = "~/.gitignore"
|
||||
editor = vim
|
||||
|
||||
[user]
|
||||
name = Daniel Lundin
|
||||
email = dln@eintr.org
|
||||
|
||||
[push]
|
||||
default = tracking
|
||||
|
||||
[branch "master"]
|
||||
rebase = true
|
||||
|
||||
[init]
|
||||
templatedir = ~/.git_template
|
||||
|
||||
[alias]
|
||||
b = branch -va
|
||||
f = fetch
|
||||
fa = fetch --all
|
||||
t = tag
|
||||
d = diff --stat -p -C
|
||||
ds = diff --staged --stat -p -C
|
||||
co = checkout
|
||||
st = status -sb
|
||||
stu = status -sb --untracked=no
|
||||
pullr = pull --rebase
|
||||
wc = whatchanged --abbrev-commit --date=relative --date-order --pretty='format:%Cgreen%h %Cblue%ar %Credby %an%Creset -- %s' -n 45
|
||||
|
||||
ll = log --graph --date=relative --topo-order --pretty='format:%C(yellow)%h%C(yellow)%d %Cblue%ar %Cgreenby %an%Creset -- %s'
|
||||
lla = log --graph --date=relative --topo-order --pretty='format:%Cgreen%h %Cblue%ar %Credby %an%Creset -- %s' --all
|
||||
gl = log --decorate --graph --abbrev-commit --color --color-words --topo-order --pretty=medium
|
||||
gla = log --decorate --graph --abbrev-commit --color --color-words --topo-order --pretty=medium --all
|
||||
sl = log --decorate --graph --abbrev-commit --color --topo-order --pretty=oneline
|
||||
sla = log --decorate --graph --abbrev-commit --color --topo-order --pretty=oneline --all
|
||||
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
|
||||
plog = !GIT_PAGER='less -n +/^commit\\ \\[0-9a-f\\]+' git log --color --patch-with-stat
|
||||
|
||||
cdiff = diff --color
|
||||
diffs = diff --staged --stat -p
|
||||
diffc = diff --staged --stat -p
|
||||
vimdiff = difftool -t vimdiff
|
||||
meld = difftool -d -t meld
|
||||
kdiff3 = difftool -d -t kdiff3
|
||||
|
||||
guilt = "!f(){ git log --pretty='format:%an <%ae>' $@ | sort | uniq -c | sort -rn; }; f"
|
||||
scat = show $1:`git ls-files --full-name $2`
|
||||
|
||||
[merge]
|
||||
tool = meld
|
||||
|
||||
[mergetool]
|
||||
prompt = false
|
||||
|
||||
[diff]
|
||||
renames = true
|
||||
tool = kdiff3
|
||||
|
||||
[difftool]
|
||||
prompt = false
|
||||
|
||||
[difftool "kdiff3"]
|
||||
cmd = kdiff3 $LOCAL $REMOTE
|
||||
trustExitCode = false
|
||||
|
||||
[difftool "p4merge"]
|
||||
cmd = p4merge $LOCAL $REMOTE
|
||||
|
||||
[color]
|
||||
ui = auto
|
||||
branch = auto
|
||||
diff = auto
|
||||
status = auto
|
||||
|
||||
[color "branch"]
|
||||
current = yellow reverse
|
||||
local = yellow
|
||||
remote = green
|
||||
|
||||
[color "diff"]
|
||||
meta = blue bold
|
||||
frag = magenta bold
|
||||
old = red
|
||||
new = green
|
||||
|
||||
[color "status"]
|
||||
added = blue bold
|
||||
changed = green bold
|
||||
untracked = cyan bold
|
||||
|
||||
[apply]
|
||||
whitespace = nowarn
|
||||
|
||||
[pack]
|
||||
threads = 0
|
||||
|
||||
[blame]
|
||||
date = relative
|
||||
|
||||
[tig]
|
||||
show-rev-graph = yes
|
||||
show-refs = yes
|
||||
line-graphics = yes
|
||||
|
||||
[tig "bind"]
|
||||
generic = G !echo
|
||||
stage = G !echo
|
||||
main = G !echo
|
||||
|
||||
[tig "color"]
|
||||
cursor = black green dim
|
||||
author = green default normal
|
||||
main-revgraph = yellow default normal
|
||||
pp-commit = magenta default bold
|
||||
diff-chunk = magenta default bold
|
||||
|
||||
# vim: ft=conf:
|
14
.gitignore
vendored
Normal file
14
.gitignore
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
*~
|
||||
*.a
|
||||
*.class
|
||||
/.idea
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iwr
|
||||
*.iws
|
||||
*.la
|
||||
*.o
|
||||
*.pyc
|
||||
*.so
|
||||
*.swp
|
||||
|
23
.inputrc
Normal file
23
.inputrc
Normal file
|
@ -0,0 +1,23 @@
|
|||
set meta-flag on
|
||||
set convert-meta off
|
||||
set output-meta on
|
||||
set completion-ignore-case on
|
||||
set visible-stats on
|
||||
set show-all-if-ambiguous on
|
||||
set completion-query-items 150
|
||||
|
||||
#"\es": menu-complete
|
||||
#"\eo": "\C-p\C-a\ef "
|
||||
"\C-p": history-search-backward
|
||||
"\C-n": history-search-forward
|
||||
# "\e[A": history-search-backward
|
||||
# "\e[B": history-search-forward
|
||||
|
||||
# those two are for rxvt
|
||||
"\e[7~":beginning-of-line
|
||||
"\e[8~":end-of-line
|
||||
|
||||
# on some xterm
|
||||
"\e[H": beginning-of-line
|
||||
"\e[F": end-of-line
|
||||
|
117
.tmux.conf
Normal file
117
.tmux.conf
Normal file
|
@ -0,0 +1,117 @@
|
|||
set -g prefix ^o
|
||||
|
||||
set -g base-index 1
|
||||
set -g display-panes-time 3000
|
||||
#set -s escape-time 7
|
||||
set -s escape-time 50
|
||||
set -g status-interval 60
|
||||
set -g terminal-overrides "xterm*:XT:smcup@:rmcup@:kUP5=\eOA:kDN5=\eOB:kLFT5=\eOD:kRIT5=\eOC"
|
||||
set -g terminal-overrides ",*:colors=256:smso=\e[3m:rmso=\e[23m:sitm=\e[3m:ritm=\e[23m"
|
||||
set -g default-terminal "xterm-256color"
|
||||
|
||||
set-option -g mouse
|
||||
#bind -n WheelUpPane copy-mode
|
||||
|
||||
set -g update-environment "WINDOWID SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION"
|
||||
setenv -g SSH_AUTH_SOCK $HOME/.ssh/ssh_auth_sock
|
||||
set -g default-command bash
|
||||
#set -g mouse-select-pane on
|
||||
set -g history-limit 50000
|
||||
|
||||
setw -g alternate-screen on
|
||||
setw -g aggressive-resize on
|
||||
setw -g automatic-rename off
|
||||
setw -g utf8 on
|
||||
setw -g mode-keys vi
|
||||
|
||||
# Status and Titles
|
||||
set -g status-left-length 30
|
||||
set -g status-right-length 90
|
||||
set -g set-titles off
|
||||
set -g set-titles-string "###I : #T"
|
||||
#set -g set-titles-string '#H:#S.#I.#P #W #T' # window number,program name, active(or not)
|
||||
|
||||
# Key bindings
|
||||
bind -n M-1 select-window -t 1
|
||||
bind -n M-- select-window -t 2
|
||||
bind -n M-2 select-window -t 2
|
||||
bind -n M-3 select-window -t 3
|
||||
bind -n M-4 select-window -t 4
|
||||
bind -n M-5 select-window -t 5
|
||||
bind -n M-6 select-window -t 6
|
||||
bind -n M-7 select-window -t 7
|
||||
bind -n M-8 select-window -t 8
|
||||
bind -n M-9 select-window -t 9
|
||||
bind -n M-0 select-window -t 10
|
||||
bind 1 select-window -t 1
|
||||
bind 2 select-window -t 2
|
||||
bind 3 select-window -t 3
|
||||
bind 4 select-window -t 4
|
||||
bind 5 select-window -t 5
|
||||
bind 6 select-window -t 6
|
||||
bind 7 select-window -t 7
|
||||
bind 8 select-window -t 8
|
||||
bind 9 select-window -t 9
|
||||
bind 0 select-window -t 10
|
||||
bind -n M-` last-window
|
||||
bind C-o last-window
|
||||
bind k next-window
|
||||
bind j previous-window
|
||||
bind l next-window
|
||||
bind h previous-window
|
||||
bind -n C-Right next-window
|
||||
bind -n C-Left previous-window
|
||||
bind C-k next-window
|
||||
bind C-l next-window
|
||||
bind C-j previous-window
|
||||
bind C-h previous-window
|
||||
bind C-s set-option -g status
|
||||
bind s split-window -h
|
||||
bind S split-window -v
|
||||
bind q kill-pane
|
||||
bind Tab select-pane -D
|
||||
bind C-p select-pane -U
|
||||
bind K confirm kill-server
|
||||
|
||||
# Colors (MonoLight)
|
||||
set -g status-fg "#cccccc"
|
||||
set -g status-bg "#222222"
|
||||
set -g status-left '#[bg="#999999",fg="#ffffff"] #I #[default]'
|
||||
set -g status-right '#[bg="#444444",fg="#cccccc"] #T #[bg="#555555"] | #(date +"%R") '
|
||||
|
||||
# Colors (Light)
|
||||
#set -g message-fg colour226
|
||||
#set -g message-bg colour52
|
||||
#set -g status-fg colour231
|
||||
#set -g status-bg colour244
|
||||
#set -g status-left-fg colour106
|
||||
#setw -g window-status-current-fg colour22
|
||||
#setw -g window-status-current-bg colour231
|
||||
#set -g status-left '#[bg=colour244,fg=colour252] #I #[default]'
|
||||
#set -g status-right '#[bg=colour244,fg=colour252] #T #[bg=colour244] | #(date +"%R") '
|
||||
|
||||
# Colors (Dark)
|
||||
#set -g message-fg colour226
|
||||
#set -g message-bg colour52
|
||||
#set -g status-fg colour239
|
||||
#set -g status-bg colour234
|
||||
#set -g status-left-fg colour106
|
||||
#setw -g window-status-current-fg colour247
|
||||
#setw -g window-status-current-bg colour234
|
||||
#set -g status-left '#[bg=colour235,fg=colour240] #I #[default]'
|
||||
#set -g status-right '#[bg=colour235,fg=colour240] #T #[bg=colour235] | #(date +"%R") '
|
||||
|
||||
# Startup
|
||||
new -d -s0 'exec bash'
|
||||
neww -d 'exec bash'
|
||||
neww -d 'exec bash'
|
||||
neww -d 'exec bash'
|
||||
neww -d 'exec bash'
|
||||
neww -d 'exec bash'
|
||||
neww -d 'exec bash'
|
||||
neww -d 'exec bash'
|
||||
neww -d 'exec bash'
|
||||
neww -d 'exec bash'
|
||||
selectw -t 1
|
||||
|
||||
# vim:set ft=tmux:
|
570
.vim/colors/dln-jellybeans.vim
Normal file
570
.vim/colors/dln-jellybeans.vim
Normal file
|
@ -0,0 +1,570 @@
|
|||
" Vim color file
|
||||
"
|
||||
" " __ _ _ _ "
|
||||
" " \ \ ___| | |_ _| |__ ___ __ _ _ __ ___ "
|
||||
" " \ \/ _ \ | | | | | _ \ / _ \/ _ | _ \/ __| "
|
||||
" " /\_/ / __/ | | |_| | |_| | __/ |_| | | | \__ \ "
|
||||
" " \___/ \___|_|_|\__ |____/ \___|\____|_| |_|___/ "
|
||||
" " \___/ "
|
||||
"
|
||||
" "A colorful, dark color scheme for Vim."
|
||||
"
|
||||
" File: jellybeans.vim
|
||||
" URL: github.com/nanotech/jellybeans.vim
|
||||
" Scripts URL: vim.org/scripts/script.php?script_id=2555
|
||||
" Maintainer: NanoTech (nanotech.nanotechcorp.net)
|
||||
" Version: 1.6~git
|
||||
" Last Change: January 15th, 2012
|
||||
" License: MIT
|
||||
" Contributors: Daniel Herbert (pocketninja)
|
||||
" Henry So, Jr. <henryso@panix.com>
|
||||
" David Liang <bmdavll at gmail dot com>
|
||||
" Rich Healey (richo)
|
||||
" Andrew Wong (w0ng)
|
||||
"
|
||||
" Copyright (c) 2009-2012 NanoTech
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any per‐
|
||||
" son obtaining a copy of this software and associated doc‐
|
||||
" umentation files (the “Software”), to deal in the Soft‐
|
||||
" ware without restriction, including without limitation
|
||||
" the rights to use, copy, modify, merge, publish, distrib‐
|
||||
" ute, sublicense, and/or sell copies of the Software, and
|
||||
" to permit persons to whom the Software is furnished to do
|
||||
" so, subject to the following conditions:
|
||||
"
|
||||
" The above copyright notice and this permission notice
|
||||
" shall be included in all copies or substantial portions
|
||||
" of the Software.
|
||||
"
|
||||
" THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY
|
||||
" KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
" THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICU‐
|
||||
" LAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON‐
|
||||
" TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON‐
|
||||
" NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
" THE SOFTWARE.
|
||||
|
||||
set background=dark
|
||||
|
||||
hi clear
|
||||
|
||||
if exists("syntax_on")
|
||||
syntax reset
|
||||
endif
|
||||
|
||||
let colors_name = "dln-jellybeans"
|
||||
|
||||
if has("gui_running") || &t_Co == 88 || &t_Co == 256
|
||||
let s:low_color = 0
|
||||
else
|
||||
let s:low_color = 1
|
||||
endif
|
||||
|
||||
" Color approximation functions by Henry So, Jr. and David Liang {{{
|
||||
" Added to jellybeans.vim by Daniel Herbert
|
||||
|
||||
" returns an approximate grey index for the given grey level
|
||||
fun! s:grey_number(x)
|
||||
if &t_Co == 88
|
||||
if a:x < 23
|
||||
return 0
|
||||
elseif a:x < 69
|
||||
return 1
|
||||
elseif a:x < 103
|
||||
return 2
|
||||
elseif a:x < 127
|
||||
return 3
|
||||
elseif a:x < 150
|
||||
return 4
|
||||
elseif a:x < 173
|
||||
return 5
|
||||
elseif a:x < 196
|
||||
return 6
|
||||
elseif a:x < 219
|
||||
return 7
|
||||
elseif a:x < 243
|
||||
return 8
|
||||
else
|
||||
return 9
|
||||
endif
|
||||
else
|
||||
if a:x < 14
|
||||
return 0
|
||||
else
|
||||
let l:n = (a:x - 8) / 10
|
||||
let l:m = (a:x - 8) % 10
|
||||
if l:m < 5
|
||||
return l:n
|
||||
else
|
||||
return l:n + 1
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endfun
|
||||
|
||||
" returns the actual grey level represented by the grey index
|
||||
fun! s:grey_level(n)
|
||||
if &t_Co == 88
|
||||
if a:n == 0
|
||||
return 0
|
||||
elseif a:n == 1
|
||||
return 46
|
||||
elseif a:n == 2
|
||||
return 92
|
||||
elseif a:n == 3
|
||||
return 115
|
||||
elseif a:n == 4
|
||||
return 139
|
||||
elseif a:n == 5
|
||||
return 162
|
||||
elseif a:n == 6
|
||||
return 185
|
||||
elseif a:n == 7
|
||||
return 208
|
||||
elseif a:n == 8
|
||||
return 231
|
||||
else
|
||||
return 255
|
||||
endif
|
||||
else
|
||||
if a:n == 0
|
||||
return 0
|
||||
else
|
||||
return 8 + (a:n * 10)
|
||||
endif
|
||||
endif
|
||||
endfun
|
||||
|
||||
" returns the palette index for the given grey index
|
||||
fun! s:grey_color(n)
|
||||
if &t_Co == 88
|
||||
if a:n == 0
|
||||
return 16
|
||||
elseif a:n == 9
|
||||
return 79
|
||||
else
|
||||
return 79 + a:n
|
||||
endif
|
||||
else
|
||||
if a:n == 0
|
||||
return 16
|
||||
elseif a:n == 25
|
||||
return 231
|
||||
else
|
||||
return 231 + a:n
|
||||
endif
|
||||
endif
|
||||
endfun
|
||||
|
||||
" returns an approximate color index for the given color level
|
||||
fun! s:rgb_number(x)
|
||||
if &t_Co == 88
|
||||
if a:x < 69
|
||||
return 0
|
||||
elseif a:x < 172
|
||||
return 1
|
||||
elseif a:x < 230
|
||||
return 2
|
||||
else
|
||||
return 3
|
||||
endif
|
||||
else
|
||||
if a:x < 75
|
||||
return 0
|
||||
else
|
||||
let l:n = (a:x - 55) / 40
|
||||
let l:m = (a:x - 55) % 40
|
||||
if l:m < 20
|
||||
return l:n
|
||||
else
|
||||
return l:n + 1
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endfun
|
||||
|
||||
" returns the actual color level for the given color index
|
||||
fun! s:rgb_level(n)
|
||||
if &t_Co == 88
|
||||
if a:n == 0
|
||||
return 0
|
||||
elseif a:n == 1
|
||||
return 139
|
||||
elseif a:n == 2
|
||||
return 205
|
||||
else
|
||||
return 255
|
||||
endif
|
||||
else
|
||||
if a:n == 0
|
||||
return 0
|
||||
else
|
||||
return 55 + (a:n * 40)
|
||||
endif
|
||||
endif
|
||||
endfun
|
||||
|
||||
" returns the palette index for the given R/G/B color indices
|
||||
fun! s:rgb_color(x, y, z)
|
||||
if &t_Co == 88
|
||||
return 16 + (a:x * 16) + (a:y * 4) + a:z
|
||||
else
|
||||
return 16 + (a:x * 36) + (a:y * 6) + a:z
|
||||
endif
|
||||
endfun
|
||||
|
||||
" returns the palette index to approximate the given R/G/B color levels
|
||||
fun! s:color(r, g, b)
|
||||
" get the closest grey
|
||||
let l:gx = s:grey_number(a:r)
|
||||
let l:gy = s:grey_number(a:g)
|
||||
let l:gz = s:grey_number(a:b)
|
||||
|
||||
" get the closest color
|
||||
let l:x = s:rgb_number(a:r)
|
||||
let l:y = s:rgb_number(a:g)
|
||||
let l:z = s:rgb_number(a:b)
|
||||
|
||||
if l:gx == l:gy && l:gy == l:gz
|
||||
" there are two possibilities
|
||||
let l:dgr = s:grey_level(l:gx) - a:r
|
||||
let l:dgg = s:grey_level(l:gy) - a:g
|
||||
let l:dgb = s:grey_level(l:gz) - a:b
|
||||
let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb)
|
||||
let l:dr = s:rgb_level(l:gx) - a:r
|
||||
let l:dg = s:rgb_level(l:gy) - a:g
|
||||
let l:db = s:rgb_level(l:gz) - a:b
|
||||
let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db)
|
||||
if l:dgrey < l:drgb
|
||||
" use the grey
|
||||
return s:grey_color(l:gx)
|
||||
else
|
||||
" use the color
|
||||
return s:rgb_color(l:x, l:y, l:z)
|
||||
endif
|
||||
else
|
||||
" only one possibility
|
||||
return s:rgb_color(l:x, l:y, l:z)
|
||||
endif
|
||||
endfun
|
||||
|
||||
" returns the palette index to approximate the 'rrggbb' hex string
|
||||
fun! s:rgb(rgb)
|
||||
let l:r = ("0x" . strpart(a:rgb, 0, 2)) + 0
|
||||
let l:g = ("0x" . strpart(a:rgb, 2, 2)) + 0
|
||||
let l:b = ("0x" . strpart(a:rgb, 4, 2)) + 0
|
||||
return s:color(l:r, l:g, l:b)
|
||||
endfun
|
||||
|
||||
" sets the highlighting for the given group
|
||||
fun! s:X(group, fg, bg, attr, lcfg, lcbg)
|
||||
if s:low_color
|
||||
let l:fge = empty(a:lcfg)
|
||||
let l:bge = empty(a:lcbg)
|
||||
|
||||
if !l:fge && !l:bge
|
||||
exec "hi ".a:group." ctermfg=".a:lcfg." ctermbg=".a:lcbg
|
||||
elseif !l:fge && l:bge
|
||||
exec "hi ".a:group." ctermfg=".a:lcfg." ctermbg=NONE"
|
||||
elseif l:fge && !l:bge
|
||||
exec "hi ".a:group." ctermfg=NONE ctermbg=".a:lcbg
|
||||
endif
|
||||
else
|
||||
let l:fge = empty(a:fg)
|
||||
let l:bge = empty(a:bg)
|
||||
|
||||
if !l:fge && !l:bge
|
||||
exec "hi ".a:group." guifg=#".a:fg." guibg=#".a:bg." ctermfg=".s:rgb(a:fg)." ctermbg=".s:rgb(a:bg)
|
||||
elseif !l:fge && l:bge
|
||||
exec "hi ".a:group." guifg=#".a:fg." guibg=NONE ctermfg=".s:rgb(a:fg)." ctermbg=NONE"
|
||||
elseif l:fge && !l:bge
|
||||
exec "hi ".a:group." guifg=NONE guibg=#".a:bg." ctermfg=NONE ctermbg=".s:rgb(a:bg)
|
||||
endif
|
||||
endif
|
||||
|
||||
if a:attr == ""
|
||||
exec "hi ".a:group." gui=none cterm=none"
|
||||
else
|
||||
" let l:noitalic = join(filter(split(a:attr, ","), "v:val !=? 'italic'"), ",")
|
||||
let l:noitalic = a:attr
|
||||
if empty(l:noitalic)
|
||||
let l:noitalic = "none"
|
||||
endif
|
||||
exec "hi ".a:group." gui=".a:attr." cterm=".l:noitalic
|
||||
endif
|
||||
endfun
|
||||
" }}}
|
||||
|
||||
if !exists("g:jellybeans_background_color")
|
||||
let g:jellybeans_background_color = "151515"
|
||||
end
|
||||
|
||||
call s:X("Normal","e8e8d3",g:jellybeans_background_color,"","White","")
|
||||
set background=dark
|
||||
|
||||
if !exists("g:jellybeans_use_lowcolor_black") || g:jellybeans_use_lowcolor_black
|
||||
let s:termBlack = "Black"
|
||||
else
|
||||
let s:termBlack = "Grey"
|
||||
endif
|
||||
|
||||
if version >= 700
|
||||
call s:X("CursorLine","","222222","","",s:termBlack)
|
||||
call s:X("CursorColumn","","1c1c1c","","",s:termBlack)
|
||||
call s:X("MatchParen","ffffff","556779","bold","","DarkCyan")
|
||||
|
||||
call s:X("TabLine","000000","b0b8c0","italic","",s:termBlack)
|
||||
call s:X("TabLineFill","9098a0","","","",s:termBlack)
|
||||
call s:X("TabLineSel","000000","f0f0f0","italic,bold",s:termBlack,"White")
|
||||
|
||||
" Auto-completion
|
||||
call s:X("Pmenu","ffffff","606060","","White",s:termBlack)
|
||||
call s:X("PmenuSel","101010","eeeeee","",s:termBlack,"White")
|
||||
endif
|
||||
|
||||
call s:X("Visual","","404040","","",s:termBlack)
|
||||
call s:X("Cursor",g:jellybeans_background_color,"b0d0f0","","","")
|
||||
|
||||
call s:X("LineNr","444444",g:jellybeans_background_color,"italic",s:termBlack,"")
|
||||
call s:X("CursorLineNr","ccc5c4","","none","White","")
|
||||
call s:X("Comment","888888","","italic","Grey","")
|
||||
call s:X("Todo","c7c7c7","","bold","White",s:termBlack)
|
||||
|
||||
call s:X("StatusLine","000000","dddddd","italic","","White")
|
||||
call s:X("StatusLineNC","ffffff","403c41","italic","White","Black")
|
||||
call s:X("VertSplit","777777","403c41","",s:termBlack,s:termBlack)
|
||||
call s:X("WildMenu","f0a0c0","302028","","Magenta","")
|
||||
|
||||
call s:X("Folded","a0a8b0","384048","italic",s:termBlack,"")
|
||||
call s:X("FoldColumn","535D66","1f1f1f","","",s:termBlack)
|
||||
call s:X("SignColumn","777777","333333","","",s:termBlack)
|
||||
call s:X("ColorColumn","","000000","","",s:termBlack)
|
||||
|
||||
call s:X("Title","70b950","","bold","Green","")
|
||||
|
||||
call s:X("Constant","cf6a4c","","","Red","")
|
||||
call s:X("Special","799d6a","","","Green","")
|
||||
call s:X("Delimiter","668799","","","Grey","")
|
||||
|
||||
call s:X("String","99ad6a","","","Green","")
|
||||
call s:X("StringDelimiter","556633","","","DarkGreen","")
|
||||
|
||||
call s:X("Identifier","c6b6ee","","","LightCyan","")
|
||||
call s:X("Structure","8fbfdc","","","LightCyan","")
|
||||
call s:X("Function","fad07a","","","Yellow","")
|
||||
call s:X("Statement","8197bf","","","DarkBlue","")
|
||||
call s:X("PreProc","8fbfdc","","","LightBlue","")
|
||||
|
||||
hi! link Operator Structure
|
||||
|
||||
call s:X("Type","ffb964","","","Yellow","")
|
||||
call s:X("NonText","606060",g:jellybeans_background_color,"",s:termBlack,"")
|
||||
|
||||
call s:X("SpecialKey","444444","1c1c1c","",s:termBlack,"")
|
||||
|
||||
call s:X("Search","f0a0c0","302028","underline","Magenta","")
|
||||
|
||||
call s:X("Directory","dad085","","","Yellow","")
|
||||
call s:X("ErrorMsg","","902020","","","DarkRed")
|
||||
hi! link Error ErrorMsg
|
||||
hi! link MoreMsg Special
|
||||
call s:X("Question","65C254","","","Green","")
|
||||
|
||||
|
||||
" Spell Checking
|
||||
|
||||
call s:X("SpellBad","","902020","underline","","DarkRed")
|
||||
call s:X("SpellCap","","0000df","underline","","Blue")
|
||||
call s:X("SpellRare","","540063","underline","","DarkMagenta")
|
||||
call s:X("SpellLocal","","2D7067","underline","","Green")
|
||||
|
||||
" Diff
|
||||
|
||||
hi! link diffRemoved Constant
|
||||
hi! link diffAdded String
|
||||
|
||||
" VimDiff
|
||||
|
||||
call s:X("DiffAdd","D2EBBE","437019","","White","DarkGreen")
|
||||
call s:X("DiffDelete","40000A","700009","","DarkRed","DarkRed")
|
||||
call s:X("DiffChange","","2B5B77","","White","DarkBlue")
|
||||
call s:X("DiffText","8fbfdc","000000","reverse","Yellow","")
|
||||
|
||||
" PHP
|
||||
|
||||
hi! link phpFunctions Function
|
||||
call s:X("StorageClass","c59f6f","","","Red","")
|
||||
hi! link phpSuperglobal Identifier
|
||||
hi! link phpQuoteSingle StringDelimiter
|
||||
hi! link phpQuoteDouble StringDelimiter
|
||||
hi! link phpBoolean Constant
|
||||
hi! link phpNull Constant
|
||||
hi! link phpArrayPair Operator
|
||||
hi! link phpOperator Normal
|
||||
hi! link phpRelation Normal
|
||||
hi! link phpVarSelector Identifier
|
||||
|
||||
" Python
|
||||
|
||||
hi! link pythonOperator Statement
|
||||
|
||||
" Ruby
|
||||
|
||||
hi! link rubySharpBang Comment
|
||||
call s:X("rubyClass","447799","","","DarkBlue","")
|
||||
call s:X("rubyIdentifier","c6b6fe","","","Cyan","")
|
||||
hi! link rubyConstant Type
|
||||
hi! link rubyFunction Function
|
||||
|
||||
call s:X("rubyInstanceVariable","c6b6fe","","","Cyan","")
|
||||
call s:X("rubySymbol","7697d6","","","Blue","")
|
||||
hi! link rubyGlobalVariable rubyInstanceVariable
|
||||
hi! link rubyModule rubyClass
|
||||
call s:X("rubyControl","7597c6","","","Blue","")
|
||||
|
||||
hi! link rubyString String
|
||||
hi! link rubyStringDelimiter StringDelimiter
|
||||
hi! link rubyInterpolationDelimiter Identifier
|
||||
|
||||
call s:X("rubyRegexpDelimiter","540063","","","Magenta","")
|
||||
call s:X("rubyRegexp","dd0093","","","DarkMagenta","")
|
||||
call s:X("rubyRegexpSpecial","a40073","","","Magenta","")
|
||||
|
||||
call s:X("rubyPredefinedIdentifier","de5577","","","Red","")
|
||||
|
||||
" Erlang
|
||||
|
||||
hi! link erlangAtom rubySymbol
|
||||
hi! link erlangBIF rubyPredefinedIdentifier
|
||||
hi! link erlangFunction rubyPredefinedIdentifier
|
||||
hi! link erlangDirective Statement
|
||||
hi! link erlangNode Identifier
|
||||
|
||||
" JavaScript
|
||||
|
||||
hi! link javaScriptValue Constant
|
||||
hi! link javaScriptRegexpString rubyRegexp
|
||||
|
||||
" CoffeeScript
|
||||
|
||||
hi! link coffeeRegExp javaScriptRegexpString
|
||||
|
||||
" Lua
|
||||
|
||||
hi! link luaOperator Conditional
|
||||
|
||||
" C
|
||||
|
||||
hi! link cFormat Identifier
|
||||
hi! link cOperator Constant
|
||||
|
||||
" Objective-C/Cocoa
|
||||
|
||||
hi! link objcClass Type
|
||||
hi! link cocoaClass objcClass
|
||||
hi! link objcSubclass objcClass
|
||||
hi! link objcSuperclass objcClass
|
||||
hi! link objcDirective rubyClass
|
||||
hi! link objcStatement Constant
|
||||
hi! link cocoaFunction Function
|
||||
hi! link objcMethodName Identifier
|
||||
hi! link objcMethodArg Normal
|
||||
hi! link objcMessageName Identifier
|
||||
|
||||
" Vimscript
|
||||
|
||||
hi! link vimOper Normal
|
||||
|
||||
" HTML
|
||||
|
||||
hi! link htmlTag Statement
|
||||
hi! link htmlEndTag htmlTag
|
||||
hi! link htmlTagName htmlTag
|
||||
|
||||
" XML
|
||||
|
||||
hi! link xmlTag Statement
|
||||
hi! link xmlEndTag xmlTag
|
||||
hi! link xmlTagName xmlTag
|
||||
hi! link xmlEqual xmlTag
|
||||
hi! link xmlEntity Special
|
||||
hi! link xmlEntityPunct xmlEntity
|
||||
hi! link xmlDocTypeDecl PreProc
|
||||
hi! link xmlDocTypeKeyword PreProc
|
||||
hi! link xmlProcessingDelim xmlAttrib
|
||||
|
||||
" Debugger.vim
|
||||
|
||||
call s:X("DbgCurrent","DEEBFE","345FA8","","White","DarkBlue")
|
||||
call s:X("DbgBreakPt","","4F0037","","","DarkMagenta")
|
||||
|
||||
" vim-indent-guides
|
||||
|
||||
if !exists("g:indent_guides_auto_colors")
|
||||
let g:indent_guides_auto_colors = 0
|
||||
endif
|
||||
call s:X("IndentGuidesOdd","","232323","","","")
|
||||
call s:X("IndentGuidesEven","","1b1b1b","","","")
|
||||
|
||||
" Plugins, etc.
|
||||
|
||||
hi! link TagListFileName Directory
|
||||
call s:X("PreciseJumpTarget","B9ED67","405026","","White","Green")
|
||||
|
||||
if !exists("g:jellybeans_background_color_256")
|
||||
let g:jellybeans_background_color_256=233
|
||||
end
|
||||
" Manual overrides for 256-color terminals. Dark colors auto-map badly.
|
||||
if !s:low_color
|
||||
hi StatusLineNC ctermbg=235
|
||||
hi Folded ctermbg=236
|
||||
hi FoldColumn ctermbg=234
|
||||
hi SignColumn ctermbg=236
|
||||
hi CursorColumn ctermbg=234
|
||||
hi CursorLine ctermbg=235
|
||||
hi SpecialKey ctermbg=234
|
||||
exec "hi NonText ctermbg=".g:jellybeans_background_color_256
|
||||
exec "hi LineNr ctermbg=".g:jellybeans_background_color_256
|
||||
hi DiffText ctermfg=81
|
||||
exec "hi Normal ctermbg=".g:jellybeans_background_color_256
|
||||
hi DbgBreakPt ctermbg=53
|
||||
hi IndentGuidesOdd ctermbg=235
|
||||
hi IndentGuidesEven ctermbg=234
|
||||
endif
|
||||
|
||||
if exists("g:jellybeans_overrides")
|
||||
fun! s:load_colors(defs)
|
||||
for [l:group, l:v] in items(a:defs)
|
||||
call s:X(l:group, get(l:v, 'guifg', ''), get(l:v, 'guibg', ''),
|
||||
\ get(l:v, 'attr', ''),
|
||||
\ get(l:v, 'ctermfg', ''), get(l:v, 'ctermbg', ''))
|
||||
if !s:low_color
|
||||
for l:prop in ['ctermfg', 'ctermbg']
|
||||
let l:override_key = '256'.l:prop
|
||||
if has_key(l:v, l:override_key)
|
||||
exec "hi ".l:group." ".l:prop."=".l:v[l:override_key]
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
unlet l:group
|
||||
unlet l:v
|
||||
endfor
|
||||
endfun
|
||||
call s:load_colors(g:jellybeans_overrides)
|
||||
delf s:load_colors
|
||||
endif
|
||||
|
||||
" delete functions {{{
|
||||
delf s:X
|
||||
delf s:rgb
|
||||
delf s:color
|
||||
delf s:rgb_color
|
||||
delf s:rgb_level
|
||||
delf s:rgb_number
|
||||
delf s:grey_color
|
||||
delf s:grey_level
|
||||
delf s:grey_number
|
||||
" }}}
|
569
.vim/colors/jellybeans.vim
Normal file
569
.vim/colors/jellybeans.vim
Normal file
|
@ -0,0 +1,569 @@
|
|||
" Vim color file
|
||||
"
|
||||
" " __ _ _ _ "
|
||||
" " \ \ ___| | |_ _| |__ ___ __ _ _ __ ___ "
|
||||
" " \ \/ _ \ | | | | | _ \ / _ \/ _ | _ \/ __| "
|
||||
" " /\_/ / __/ | | |_| | |_| | __/ |_| | | | \__ \ "
|
||||
" " \___/ \___|_|_|\__ |____/ \___|\____|_| |_|___/ "
|
||||
" " \___/ "
|
||||
"
|
||||
" "A colorful, dark color scheme for Vim."
|
||||
"
|
||||
" File: jellybeans.vim
|
||||
" URL: github.com/nanotech/jellybeans.vim
|
||||
" Scripts URL: vim.org/scripts/script.php?script_id=2555
|
||||
" Maintainer: NanoTech (nanotech.nanotechcorp.net)
|
||||
" Version: 1.6~git
|
||||
" Last Change: January 15th, 2012
|
||||
" License: MIT
|
||||
" Contributors: Daniel Herbert (pocketninja)
|
||||
" Henry So, Jr. <henryso@panix.com>
|
||||
" David Liang <bmdavll at gmail dot com>
|
||||
" Rich Healey (richo)
|
||||
" Andrew Wong (w0ng)
|
||||
"
|
||||
" Copyright (c) 2009-2012 NanoTech
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any per‐
|
||||
" son obtaining a copy of this software and associated doc‐
|
||||
" umentation files (the “Software”), to deal in the Soft‐
|
||||
" ware without restriction, including without limitation
|
||||
" the rights to use, copy, modify, merge, publish, distrib‐
|
||||
" ute, sublicense, and/or sell copies of the Software, and
|
||||
" to permit persons to whom the Software is furnished to do
|
||||
" so, subject to the following conditions:
|
||||
"
|
||||
" The above copyright notice and this permission notice
|
||||
" shall be included in all copies or substantial portions
|
||||
" of the Software.
|
||||
"
|
||||
" THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY
|
||||
" KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
" THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICU‐
|
||||
" LAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON‐
|
||||
" TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON‐
|
||||
" NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
" THE SOFTWARE.
|
||||
|
||||
set background=dark
|
||||
|
||||
hi clear
|
||||
|
||||
if exists("syntax_on")
|
||||
syntax reset
|
||||
endif
|
||||
|
||||
let colors_name = "jellybeans"
|
||||
|
||||
if has("gui_running") || &t_Co == 88 || &t_Co == 256
|
||||
let s:low_color = 0
|
||||
else
|
||||
let s:low_color = 1
|
||||
endif
|
||||
|
||||
" Color approximation functions by Henry So, Jr. and David Liang {{{
|
||||
" Added to jellybeans.vim by Daniel Herbert
|
||||
|
||||
" returns an approximate grey index for the given grey level
|
||||
fun! s:grey_number(x)
|
||||
if &t_Co == 88
|
||||
if a:x < 23
|
||||
return 0
|
||||
elseif a:x < 69
|
||||
return 1
|
||||
elseif a:x < 103
|
||||
return 2
|
||||
elseif a:x < 127
|
||||
return 3
|
||||
elseif a:x < 150
|
||||
return 4
|
||||
elseif a:x < 173
|
||||
return 5
|
||||
elseif a:x < 196
|
||||
return 6
|
||||
elseif a:x < 219
|
||||
return 7
|
||||
elseif a:x < 243
|
||||
return 8
|
||||
else
|
||||
return 9
|
||||
endif
|
||||
else
|
||||
if a:x < 14
|
||||
return 0
|
||||
else
|
||||
let l:n = (a:x - 8) / 10
|
||||
let l:m = (a:x - 8) % 10
|
||||
if l:m < 5
|
||||
return l:n
|
||||
else
|
||||
return l:n + 1
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endfun
|
||||
|
||||
" returns the actual grey level represented by the grey index
|
||||
fun! s:grey_level(n)
|
||||
if &t_Co == 88
|
||||
if a:n == 0
|
||||
return 0
|
||||
elseif a:n == 1
|
||||
return 46
|
||||
elseif a:n == 2
|
||||
return 92
|
||||
elseif a:n == 3
|
||||
return 115
|
||||
elseif a:n == 4
|
||||
return 139
|
||||
elseif a:n == 5
|
||||
return 162
|
||||
elseif a:n == 6
|
||||
return 185
|
||||
elseif a:n == 7
|
||||
return 208
|
||||
elseif a:n == 8
|
||||
return 231
|
||||
else
|
||||
return 255
|
||||
endif
|
||||
else
|
||||
if a:n == 0
|
||||
return 0
|
||||
else
|
||||
return 8 + (a:n * 10)
|
||||
endif
|
||||
endif
|
||||
endfun
|
||||
|
||||
" returns the palette index for the given grey index
|
||||
fun! s:grey_color(n)
|
||||
if &t_Co == 88
|
||||
if a:n == 0
|
||||
return 16
|
||||
elseif a:n == 9
|
||||
return 79
|
||||
else
|
||||
return 79 + a:n
|
||||
endif
|
||||
else
|
||||
if a:n == 0
|
||||
return 16
|
||||
elseif a:n == 25
|
||||
return 231
|
||||
else
|
||||
return 231 + a:n
|
||||
endif
|
||||
endif
|
||||
endfun
|
||||
|
||||
" returns an approximate color index for the given color level
|
||||
fun! s:rgb_number(x)
|
||||
if &t_Co == 88
|
||||
if a:x < 69
|
||||
return 0
|
||||
elseif a:x < 172
|
||||
return 1
|
||||
elseif a:x < 230
|
||||
return 2
|
||||
else
|
||||
return 3
|
||||
endif
|
||||
else
|
||||
if a:x < 75
|
||||
return 0
|
||||
else
|
||||
let l:n = (a:x - 55) / 40
|
||||
let l:m = (a:x - 55) % 40
|
||||
if l:m < 20
|
||||
return l:n
|
||||
else
|
||||
return l:n + 1
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endfun
|
||||
|
||||
" returns the actual color level for the given color index
|
||||
fun! s:rgb_level(n)
|
||||
if &t_Co == 88
|
||||
if a:n == 0
|
||||
return 0
|
||||
elseif a:n == 1
|
||||
return 139
|
||||
elseif a:n == 2
|
||||
return 205
|
||||
else
|
||||
return 255
|
||||
endif
|
||||
else
|
||||
if a:n == 0
|
||||
return 0
|
||||
else
|
||||
return 55 + (a:n * 40)
|
||||
endif
|
||||
endif
|
||||
endfun
|
||||
|
||||
" returns the palette index for the given R/G/B color indices
|
||||
fun! s:rgb_color(x, y, z)
|
||||
if &t_Co == 88
|
||||
return 16 + (a:x * 16) + (a:y * 4) + a:z
|
||||
else
|
||||
return 16 + (a:x * 36) + (a:y * 6) + a:z
|
||||
endif
|
||||
endfun
|
||||
|
||||
" returns the palette index to approximate the given R/G/B color levels
|
||||
fun! s:color(r, g, b)
|
||||
" get the closest grey
|
||||
let l:gx = s:grey_number(a:r)
|
||||
let l:gy = s:grey_number(a:g)
|
||||
let l:gz = s:grey_number(a:b)
|
||||
|
||||
" get the closest color
|
||||
let l:x = s:rgb_number(a:r)
|
||||
let l:y = s:rgb_number(a:g)
|
||||
let l:z = s:rgb_number(a:b)
|
||||
|
||||
if l:gx == l:gy && l:gy == l:gz
|
||||
" there are two possibilities
|
||||
let l:dgr = s:grey_level(l:gx) - a:r
|
||||
let l:dgg = s:grey_level(l:gy) - a:g
|
||||
let l:dgb = s:grey_level(l:gz) - a:b
|
||||
let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb)
|
||||
let l:dr = s:rgb_level(l:gx) - a:r
|
||||
let l:dg = s:rgb_level(l:gy) - a:g
|
||||
let l:db = s:rgb_level(l:gz) - a:b
|
||||
let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db)
|
||||
if l:dgrey < l:drgb
|
||||
" use the grey
|
||||
return s:grey_color(l:gx)
|
||||
else
|
||||
" use the color
|
||||
return s:rgb_color(l:x, l:y, l:z)
|
||||
endif
|
||||
else
|
||||
" only one possibility
|
||||
return s:rgb_color(l:x, l:y, l:z)
|
||||
endif
|
||||
endfun
|
||||
|
||||
" returns the palette index to approximate the 'rrggbb' hex string
|
||||
fun! s:rgb(rgb)
|
||||
let l:r = ("0x" . strpart(a:rgb, 0, 2)) + 0
|
||||
let l:g = ("0x" . strpart(a:rgb, 2, 2)) + 0
|
||||
let l:b = ("0x" . strpart(a:rgb, 4, 2)) + 0
|
||||
return s:color(l:r, l:g, l:b)
|
||||
endfun
|
||||
|
||||
" sets the highlighting for the given group
|
||||
fun! s:X(group, fg, bg, attr, lcfg, lcbg)
|
||||
if s:low_color
|
||||
let l:fge = empty(a:lcfg)
|
||||
let l:bge = empty(a:lcbg)
|
||||
|
||||
if !l:fge && !l:bge
|
||||
exec "hi ".a:group." ctermfg=".a:lcfg." ctermbg=".a:lcbg
|
||||
elseif !l:fge && l:bge
|
||||
exec "hi ".a:group." ctermfg=".a:lcfg." ctermbg=NONE"
|
||||
elseif l:fge && !l:bge
|
||||
exec "hi ".a:group." ctermfg=NONE ctermbg=".a:lcbg
|
||||
endif
|
||||
else
|
||||
let l:fge = empty(a:fg)
|
||||
let l:bge = empty(a:bg)
|
||||
|
||||
if !l:fge && !l:bge
|
||||
exec "hi ".a:group." guifg=#".a:fg." guibg=#".a:bg." ctermfg=".s:rgb(a:fg)." ctermbg=".s:rgb(a:bg)
|
||||
elseif !l:fge && l:bge
|
||||
exec "hi ".a:group." guifg=#".a:fg." guibg=NONE ctermfg=".s:rgb(a:fg)." ctermbg=NONE"
|
||||
elseif l:fge && !l:bge
|
||||
exec "hi ".a:group." guifg=NONE guibg=#".a:bg." ctermfg=NONE ctermbg=".s:rgb(a:bg)
|
||||
endif
|
||||
endif
|
||||
|
||||
if a:attr == ""
|
||||
exec "hi ".a:group." gui=none cterm=none"
|
||||
else
|
||||
let l:noitalic = join(filter(split(a:attr, ","), "v:val !=? 'italic'"), ",")
|
||||
if empty(l:noitalic)
|
||||
let l:noitalic = "none"
|
||||
endif
|
||||
exec "hi ".a:group." gui=".a:attr." cterm=".l:noitalic
|
||||
endif
|
||||
endfun
|
||||
" }}}
|
||||
|
||||
if !exists("g:jellybeans_background_color")
|
||||
let g:jellybeans_background_color = "151515"
|
||||
end
|
||||
|
||||
call s:X("Normal","e8e8d3",g:jellybeans_background_color,"","White","")
|
||||
set background=dark
|
||||
|
||||
if !exists("g:jellybeans_use_lowcolor_black") || g:jellybeans_use_lowcolor_black
|
||||
let s:termBlack = "Black"
|
||||
else
|
||||
let s:termBlack = "Grey"
|
||||
endif
|
||||
|
||||
if version >= 700
|
||||
call s:X("CursorLine","","1c1c1c","","",s:termBlack)
|
||||
call s:X("CursorColumn","","1c1c1c","","",s:termBlack)
|
||||
call s:X("MatchParen","ffffff","556779","bold","","DarkCyan")
|
||||
|
||||
call s:X("TabLine","000000","b0b8c0","italic","",s:termBlack)
|
||||
call s:X("TabLineFill","9098a0","","","",s:termBlack)
|
||||
call s:X("TabLineSel","000000","f0f0f0","italic,bold",s:termBlack,"White")
|
||||
|
||||
" Auto-completion
|
||||
call s:X("Pmenu","ffffff","606060","","White",s:termBlack)
|
||||
call s:X("PmenuSel","101010","eeeeee","",s:termBlack,"White")
|
||||
endif
|
||||
|
||||
call s:X("Visual","","404040","","",s:termBlack)
|
||||
call s:X("Cursor",g:jellybeans_background_color,"b0d0f0","","","")
|
||||
|
||||
call s:X("LineNr","605958",g:jellybeans_background_color,"none",s:termBlack,"")
|
||||
call s:X("CursorLineNr","ccc5c4","","none","White","")
|
||||
call s:X("Comment","888888","","italic","Grey","")
|
||||
call s:X("Todo","c7c7c7","","bold","White",s:termBlack)
|
||||
|
||||
call s:X("StatusLine","000000","dddddd","italic","","White")
|
||||
call s:X("StatusLineNC","ffffff","403c41","italic","White","Black")
|
||||
call s:X("VertSplit","777777","403c41","",s:termBlack,s:termBlack)
|
||||
call s:X("WildMenu","f0a0c0","302028","","Magenta","")
|
||||
|
||||
call s:X("Folded","a0a8b0","384048","italic",s:termBlack,"")
|
||||
call s:X("FoldColumn","535D66","1f1f1f","","",s:termBlack)
|
||||
call s:X("SignColumn","777777","333333","","",s:termBlack)
|
||||
call s:X("ColorColumn","","000000","","",s:termBlack)
|
||||
|
||||
call s:X("Title","70b950","","bold","Green","")
|
||||
|
||||
call s:X("Constant","cf6a4c","","","Red","")
|
||||
call s:X("Special","799d6a","","","Green","")
|
||||
call s:X("Delimiter","668799","","","Grey","")
|
||||
|
||||
call s:X("String","99ad6a","","","Green","")
|
||||
call s:X("StringDelimiter","556633","","","DarkGreen","")
|
||||
|
||||
call s:X("Identifier","c6b6ee","","","LightCyan","")
|
||||
call s:X("Structure","8fbfdc","","","LightCyan","")
|
||||
call s:X("Function","fad07a","","","Yellow","")
|
||||
call s:X("Statement","8197bf","","","DarkBlue","")
|
||||
call s:X("PreProc","8fbfdc","","","LightBlue","")
|
||||
|
||||
hi! link Operator Structure
|
||||
|
||||
call s:X("Type","ffb964","","","Yellow","")
|
||||
call s:X("NonText","606060",g:jellybeans_background_color,"",s:termBlack,"")
|
||||
|
||||
call s:X("SpecialKey","444444","1c1c1c","",s:termBlack,"")
|
||||
|
||||
call s:X("Search","f0a0c0","302028","underline","Magenta","")
|
||||
|
||||
call s:X("Directory","dad085","","","Yellow","")
|
||||
call s:X("ErrorMsg","","902020","","","DarkRed")
|
||||
hi! link Error ErrorMsg
|
||||
hi! link MoreMsg Special
|
||||
call s:X("Question","65C254","","","Green","")
|
||||
|
||||
|
||||
" Spell Checking
|
||||
|
||||
call s:X("SpellBad","","902020","underline","","DarkRed")
|
||||
call s:X("SpellCap","","0000df","underline","","Blue")
|
||||
call s:X("SpellRare","","540063","underline","","DarkMagenta")
|
||||
call s:X("SpellLocal","","2D7067","underline","","Green")
|
||||
|
||||
" Diff
|
||||
|
||||
hi! link diffRemoved Constant
|
||||
hi! link diffAdded String
|
||||
|
||||
" VimDiff
|
||||
|
||||
call s:X("DiffAdd","D2EBBE","437019","","White","DarkGreen")
|
||||
call s:X("DiffDelete","40000A","700009","","DarkRed","DarkRed")
|
||||
call s:X("DiffChange","","2B5B77","","White","DarkBlue")
|
||||
call s:X("DiffText","8fbfdc","000000","reverse","Yellow","")
|
||||
|
||||
" PHP
|
||||
|
||||
hi! link phpFunctions Function
|
||||
call s:X("StorageClass","c59f6f","","","Red","")
|
||||
hi! link phpSuperglobal Identifier
|
||||
hi! link phpQuoteSingle StringDelimiter
|
||||
hi! link phpQuoteDouble StringDelimiter
|
||||
hi! link phpBoolean Constant
|
||||
hi! link phpNull Constant
|
||||
hi! link phpArrayPair Operator
|
||||
hi! link phpOperator Normal
|
||||
hi! link phpRelation Normal
|
||||
hi! link phpVarSelector Identifier
|
||||
|
||||
" Python
|
||||
|
||||
hi! link pythonOperator Statement
|
||||
|
||||
" Ruby
|
||||
|
||||
hi! link rubySharpBang Comment
|
||||
call s:X("rubyClass","447799","","","DarkBlue","")
|
||||
call s:X("rubyIdentifier","c6b6fe","","","Cyan","")
|
||||
hi! link rubyConstant Type
|
||||
hi! link rubyFunction Function
|
||||
|
||||
call s:X("rubyInstanceVariable","c6b6fe","","","Cyan","")
|
||||
call s:X("rubySymbol","7697d6","","","Blue","")
|
||||
hi! link rubyGlobalVariable rubyInstanceVariable
|
||||
hi! link rubyModule rubyClass
|
||||
call s:X("rubyControl","7597c6","","","Blue","")
|
||||
|
||||
hi! link rubyString String
|
||||
hi! link rubyStringDelimiter StringDelimiter
|
||||
hi! link rubyInterpolationDelimiter Identifier
|
||||
|
||||
call s:X("rubyRegexpDelimiter","540063","","","Magenta","")
|
||||
call s:X("rubyRegexp","dd0093","","","DarkMagenta","")
|
||||
call s:X("rubyRegexpSpecial","a40073","","","Magenta","")
|
||||
|
||||
call s:X("rubyPredefinedIdentifier","de5577","","","Red","")
|
||||
|
||||
" Erlang
|
||||
|
||||
hi! link erlangAtom rubySymbol
|
||||
hi! link erlangBIF rubyPredefinedIdentifier
|
||||
hi! link erlangFunction rubyPredefinedIdentifier
|
||||
hi! link erlangDirective Statement
|
||||
hi! link erlangNode Identifier
|
||||
|
||||
" JavaScript
|
||||
|
||||
hi! link javaScriptValue Constant
|
||||
hi! link javaScriptRegexpString rubyRegexp
|
||||
|
||||
" CoffeeScript
|
||||
|
||||
hi! link coffeeRegExp javaScriptRegexpString
|
||||
|
||||
" Lua
|
||||
|
||||
hi! link luaOperator Conditional
|
||||
|
||||
" C
|
||||
|
||||
hi! link cFormat Identifier
|
||||
hi! link cOperator Constant
|
||||
|
||||
" Objective-C/Cocoa
|
||||
|
||||
hi! link objcClass Type
|
||||
hi! link cocoaClass objcClass
|
||||
hi! link objcSubclass objcClass
|
||||
hi! link objcSuperclass objcClass
|
||||
hi! link objcDirective rubyClass
|
||||
hi! link objcStatement Constant
|
||||
hi! link cocoaFunction Function
|
||||
hi! link objcMethodName Identifier
|
||||
hi! link objcMethodArg Normal
|
||||
hi! link objcMessageName Identifier
|
||||
|
||||
" Vimscript
|
||||
|
||||
hi! link vimOper Normal
|
||||
|
||||
" HTML
|
||||
|
||||
hi! link htmlTag Statement
|
||||
hi! link htmlEndTag htmlTag
|
||||
hi! link htmlTagName htmlTag
|
||||
|
||||
" XML
|
||||
|
||||
hi! link xmlTag Statement
|
||||
hi! link xmlEndTag xmlTag
|
||||
hi! link xmlTagName xmlTag
|
||||
hi! link xmlEqual xmlTag
|
||||
hi! link xmlEntity Special
|
||||
hi! link xmlEntityPunct xmlEntity
|
||||
hi! link xmlDocTypeDecl PreProc
|
||||
hi! link xmlDocTypeKeyword PreProc
|
||||
hi! link xmlProcessingDelim xmlAttrib
|
||||
|
||||
" Debugger.vim
|
||||
|
||||
call s:X("DbgCurrent","DEEBFE","345FA8","","White","DarkBlue")
|
||||
call s:X("DbgBreakPt","","4F0037","","","DarkMagenta")
|
||||
|
||||
" vim-indent-guides
|
||||
|
||||
if !exists("g:indent_guides_auto_colors")
|
||||
let g:indent_guides_auto_colors = 0
|
||||
endif
|
||||
call s:X("IndentGuidesOdd","","232323","","","")
|
||||
call s:X("IndentGuidesEven","","1b1b1b","","","")
|
||||
|
||||
" Plugins, etc.
|
||||
|
||||
hi! link TagListFileName Directory
|
||||
call s:X("PreciseJumpTarget","B9ED67","405026","","White","Green")
|
||||
|
||||
if !exists("g:jellybeans_background_color_256")
|
||||
let g:jellybeans_background_color_256=233
|
||||
end
|
||||
" Manual overrides for 256-color terminals. Dark colors auto-map badly.
|
||||
if !s:low_color
|
||||
hi StatusLineNC ctermbg=235
|
||||
hi Folded ctermbg=236
|
||||
hi FoldColumn ctermbg=234
|
||||
hi SignColumn ctermbg=236
|
||||
hi CursorColumn ctermbg=234
|
||||
hi CursorLine ctermbg=234
|
||||
hi SpecialKey ctermbg=234
|
||||
exec "hi NonText ctermbg=".g:jellybeans_background_color_256
|
||||
exec "hi LineNr ctermbg=".g:jellybeans_background_color_256
|
||||
hi DiffText ctermfg=81
|
||||
exec "hi Normal ctermbg=".g:jellybeans_background_color_256
|
||||
hi DbgBreakPt ctermbg=53
|
||||
hi IndentGuidesOdd ctermbg=235
|
||||
hi IndentGuidesEven ctermbg=234
|
||||
endif
|
||||
|
||||
if exists("g:jellybeans_overrides")
|
||||
fun! s:load_colors(defs)
|
||||
for [l:group, l:v] in items(a:defs)
|
||||
call s:X(l:group, get(l:v, 'guifg', ''), get(l:v, 'guibg', ''),
|
||||
\ get(l:v, 'attr', ''),
|
||||
\ get(l:v, 'ctermfg', ''), get(l:v, 'ctermbg', ''))
|
||||
if !s:low_color
|
||||
for l:prop in ['ctermfg', 'ctermbg']
|
||||
let l:override_key = '256'.l:prop
|
||||
if has_key(l:v, l:override_key)
|
||||
exec "hi ".l:group." ".l:prop."=".l:v[l:override_key]
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
unlet l:group
|
||||
unlet l:v
|
||||
endfor
|
||||
endfun
|
||||
call s:load_colors(g:jellybeans_overrides)
|
||||
delf s:load_colors
|
||||
endif
|
||||
|
||||
" delete functions {{{
|
||||
delf s:X
|
||||
delf s:rgb
|
||||
delf s:color
|
||||
delf s:rgb_color
|
||||
delf s:rgb_level
|
||||
delf s:rgb_number
|
||||
delf s:grey_color
|
||||
delf s:grey_level
|
||||
delf s:grey_number
|
||||
" }}}
|
340
.vimrc
Normal file
340
.vimrc
Normal file
|
@ -0,0 +1,340 @@
|
|||
"" Vundle
|
||||
set rtp+=~/.vim/bundle/Vundle.vim
|
||||
call vundle#begin()
|
||||
|
||||
" Plugins
|
||||
Plugin 'VundleVim/Vundle.vim'
|
||||
" Plugin 'bling/vim-airline'
|
||||
Plugin 'ctrlpvim/ctrlp.vim'
|
||||
Plugin 'ervandew/supertab'
|
||||
Plugin 'itchyny/lightline.vim'
|
||||
Plugin 'tomtom/tcomment_vim'
|
||||
Plugin 'Valloric/YouCompleteMe'
|
||||
|
||||
call vundle#end()
|
||||
|
||||
set timeoutlen=250
|
||||
set ttimeoutlen=200
|
||||
|
||||
filetype on " detect the type of file
|
||||
filetype plugin indent on " load filetype plugins
|
||||
syntax on
|
||||
|
||||
set history=1000 " How many lines of history to remember
|
||||
set viminfo='100,!,f1,\"100,:40,%,n~/.viminfo
|
||||
|
||||
set isk+=_,$,@,%,#,- " none of these should be word dividers, so make them not be
|
||||
set hidden
|
||||
set tabstop=2
|
||||
set shiftwidth=2
|
||||
set smarttab
|
||||
set expandtab
|
||||
set softtabstop=2
|
||||
set autoindent
|
||||
set copyindent
|
||||
set smartindent " Don't mess with comments
|
||||
set nojoinspaces
|
||||
|
||||
set autochdir
|
||||
set nocompatible
|
||||
set ttyfast
|
||||
set nofoldenable " disable folding
|
||||
|
||||
" Wordwrap
|
||||
" set formatoptions=l
|
||||
" formatoptions:
|
||||
" c - autowrap COMMENTS using textwidth
|
||||
" r - insert comment leader (?) on <enter>
|
||||
" o - insert comment leader on 'o' or 'O'
|
||||
" q - gq formats comments (?)
|
||||
" n - recon numbered lists
|
||||
" v - wrap on blanks
|
||||
" t - autowrap TEXT using textwidth
|
||||
set fo=croqnvt
|
||||
|
||||
set lbr
|
||||
set backspace=eol,start,indent
|
||||
"Backspace and cursor keys wrap to
|
||||
set whichwrap+=<,>,h,l
|
||||
set wrap
|
||||
|
||||
"" GUI
|
||||
set vb t_vb=
|
||||
set novisualbell
|
||||
set noerrorbells
|
||||
set ruler
|
||||
set number " line numbers
|
||||
set numberwidth=6
|
||||
set lz " lazy redraw
|
||||
set so=7 "scope
|
||||
set sidescroll=1
|
||||
set scrolloff=10
|
||||
set mouse=a
|
||||
set ttymouse=xterm
|
||||
set switchbuf=usetab
|
||||
set showtabline=1
|
||||
set selection=exclusive
|
||||
set shortmess=atI
|
||||
set wildmenu
|
||||
set wildmode=list:longest
|
||||
set wildignore=*.swp,*.bak,*.pyc,*.class
|
||||
set splitbelow " Preview window
|
||||
|
||||
"" Session
|
||||
let g:session_autosave = 'no'
|
||||
|
||||
"" Fancy status line.
|
||||
set laststatus=2
|
||||
|
||||
"" Powerline
|
||||
"set rtp+=/home/dln/.vim/bundle/powerline/powerline/bindings/vim
|
||||
|
||||
"" tmux window title
|
||||
autocmd BufEnter * let &titlestring = expand("%:t")
|
||||
if &term == "screen"
|
||||
set t_ts=k
|
||||
set t_fs=\
|
||||
endif
|
||||
if &term == "screen" || &term == "xterm"
|
||||
set title
|
||||
endif
|
||||
set t_se=23
|
||||
set t_ZH=[3m
|
||||
set t_ZR=[23m
|
||||
|
||||
"" Markers / Signature
|
||||
let g:SignatureMarkTextHL="Bookmark"
|
||||
|
||||
"" Minibuffer
|
||||
let g:miniBufExplModSelTarget = 1
|
||||
let g:miniBufExplorerMoreThanOne = 0
|
||||
let g:miniBufExplModSelTarget = 0
|
||||
let g:miniBufExplUseSingleClick = 1
|
||||
let g:miniBufExplMapWindowNavVim = 1
|
||||
let g:miniBufExplVSplit = 25
|
||||
let g:miniBufExplSplitBelow=1
|
||||
|
||||
"" X clipboard copy paste
|
||||
map <silent> ,v :r!xclip -o<cr>
|
||||
|
||||
|
||||
"" Searching
|
||||
set showmatch
|
||||
set incsearch
|
||||
set ignorecase
|
||||
set smartcase
|
||||
set hlsearch
|
||||
|
||||
"" Use ack for grepping
|
||||
set grepprg=ag
|
||||
let g:ackprg='ag -H --nocolor --nogroup'
|
||||
|
||||
"" Bookmarks
|
||||
let g:showmarks_enable=1
|
||||
let g:showmarks_include="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
|
||||
" Errormarker
|
||||
let errormarker_errorgroup = "ErrorMsg"
|
||||
let errormarker_warninggroup = "Todo"
|
||||
|
||||
"" Highlighting
|
||||
map ,H :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
|
||||
\ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<"
|
||||
\ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>
|
||||
|
||||
"" Hide some files
|
||||
let g:explHideFiles='^\.,.*\.class$,.*\.swp$,.*\.pyc$,.*\.swo$,\.DS_Store$,/tmp/v\d\d*'
|
||||
let g:explDetailedHelp=1
|
||||
|
||||
"" Backup
|
||||
set backup
|
||||
set backupdir=~/.vim/backup,~/.tmp,~/tmp,/var/tmp,/tmp"
|
||||
set directory=~/.vim/backup,~/.tmp,~/tmp,/var/tmp,/tmp"
|
||||
let myvar = strftime("%y%m%d-%H%M")
|
||||
let myvar = "set backupext=_". myvar
|
||||
execute myvar
|
||||
au BufWritePre * let &backupext = substitute(expand("%:p"), "\/", "_", "g")
|
||||
|
||||
"" CtrlP
|
||||
let g:ctrlp_match_window = 'top'
|
||||
" let g:ctrlp_custom_ignore = '\v[\/](.DS_Store|.sass-cache|.bundle|.git|.hg|.svn|node_modules|vendor|bower_components)$'
|
||||
" let g:ctrlp_custom_ignore = '\v[\/]\.(DS_Storegit|hg|svn|optimized|compiled|node_modules|bower_components)$'
|
||||
|
||||
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.class,*/target/*,*/.git/*"
|
||||
" let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
|
||||
let g:ctrlp_custom_ignore = 'node_modules$\|.lock$\|.gitkeep$\|tmp/\|bower_components$\|dist$'
|
||||
|
||||
|
||||
let g:ctrlp_working_path_mode = 'ra'
|
||||
|
||||
map <silent> <space> :CtrlPBuffer<cr>
|
||||
map <silent> ,` :CtrlPBuffer<cr>
|
||||
map <silent> ,; :CtrlPChange<cr>
|
||||
map <silent> ,e :CtrlPRoot<cr>
|
||||
map <silent> ,d :CtrlPCurWD<cr>
|
||||
map <silent> ,f :CtrlPMRUFiles<cr>
|
||||
map <silent> ,g :CtrlPLine<cr>
|
||||
map <silent> ,q :CtrlPQuickfix<cr>
|
||||
map <silent> ,/ :CtrlPLine<cr>
|
||||
map <silent> ,m :CtrlPBookmarkDir<cr>
|
||||
map <silent> ,<C-m> :CtrlPBookmarkDirAdd<cr>
|
||||
|
||||
"" Key bindings
|
||||
imap <silent> <c-w>
|
||||
inoremap <C-s> <esc>:w<cr>a
|
||||
nnoremap <C-s> :w<cr>a
|
||||
|
||||
|
||||
" C-Left, C-right
|
||||
map <silent> <esc>[1;5D <C-Left>
|
||||
map <silent> <esc>[1;5C <C-Right>
|
||||
nnoremap <C-Left> b
|
||||
vnoremap <C-S-Left> b
|
||||
nnoremap <C-S-Left> gh<C-O>b
|
||||
inoremap <C-S-Left> <C-\><C-O>gh<C-O>b
|
||||
nnoremap <C-Right> w
|
||||
vnoremap <C-S-Right> w
|
||||
nnoremap <C-S-Right> gh<C-O>w
|
||||
inoremap <C-S-Right> <C-\><C-O>gh<C-O>w
|
||||
|
||||
"" Comments
|
||||
map <silent> <c-/> :TComment<cr>
|
||||
imap <silent> <c-/> <c--><c-->
|
||||
|
||||
"" SCM Stuff
|
||||
let g:SCMDiffCommand = "git"
|
||||
let VCSCommandDeleteOnHide = 1
|
||||
let g:git_branch_status_nogit=""
|
||||
let g:git_branch_status_around="[]"
|
||||
let g:git_branch_status_text=""
|
||||
let g:git_branch_status_head_current=1
|
||||
|
||||
"" Buffer navigation
|
||||
map <silent> ` :b#<CR>
|
||||
|
||||
|
||||
"" "Turn off search highlight
|
||||
map <silent> <leader><cr> :noh<cr>
|
||||
nmap <silent> ,/ :let @/=""<CR>
|
||||
|
||||
""
|
||||
"" File types
|
||||
""
|
||||
|
||||
au BufNewFile,BufRead manifest setlocal ft=json
|
||||
au BufNewFile,BufRead *.aurora set filetype=python
|
||||
au BufNewFile,BufRead *.avdl setlocal ft=avro-idl
|
||||
au BufNewFile,BufRead *.avpr setlocal ft=json
|
||||
au BufNewFile,BufRead *.cql set syntax=cql
|
||||
au BufNewFile,BufRead *.go setlocal ft=go
|
||||
au BufNewFile,BufRead *.g setlocal ft=antlr
|
||||
au BufNewFile,BufRead *.js set ft=javascript
|
||||
au BufNewFile,BufRead *.json setfiletype json
|
||||
au BufNewFile,BufRead *.pig set filetype=pig syntax=pig
|
||||
au BufNewFile,BufRead *.template setfiletype json
|
||||
au BufNewFile,BufRead *.thrift setlocal ft=thrift
|
||||
au BufNewFile,BufRead *.upstart set filetype=upstart
|
||||
au BufNewFile,BufRead *.upstart.conf set filetype=upstart
|
||||
au BufNewFile,BufRead SCons* set filetype=python
|
||||
|
||||
"" JavaScript, Json
|
||||
let g:vim_json_syntax_conceal = 0
|
||||
|
||||
"" Scala
|
||||
autocmd BufNewFile,BufAdd,BufRead build.sbt setlocal ft=scala
|
||||
autocmd BufNewFile,BufAdd,BufRead *.scala setlocal ft=scala
|
||||
autocmd FileType scala setlocal expandtab shiftwidth=2 tabstop=2 softtabstop=2
|
||||
|
||||
"" Rust
|
||||
autocmd FileType rust setlocal expandtab shiftwidth=4 tabstop=4 softtabstop=4
|
||||
|
||||
"" Clojure
|
||||
let g:paredit_mode=0
|
||||
let g:clj_highlight_builtins=1 " Highlight Clojure's builtins
|
||||
let g:clj_paren_rainbow=1 " Rainbow parentheses'!
|
||||
|
||||
"" Python
|
||||
au FileType python
|
||||
\ setlocal efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m |
|
||||
\ setlocal makeprg=python\ % |
|
||||
\ setlocal tabstop=4 softtabstop=4 shiftwidth=4 |
|
||||
\ setlocal nosmartindent cinwords=if,elif,else,for,while,try,except,finally,def,class
|
||||
autocmd BufWritePre *.py normal m`:%s/\s\+$//e ``
|
||||
autocmd FileType python set omnifunc=pythoncomplete#Complete
|
||||
|
||||
" pydoc integration
|
||||
let g:pydoc_highlight = 0
|
||||
let python_highlight_all = 1
|
||||
let g:pcs_check_when_saving = 0
|
||||
let g:pymode_lint = 0
|
||||
let g:pymode_lint_checker = "pyflakes"
|
||||
|
||||
|
||||
" YouCompleteMe
|
||||
set completefunc=youcompleteme#Complete
|
||||
set completeopt=preview,menuone
|
||||
|
||||
" tags
|
||||
set tags=./tags;/
|
||||
|
||||
" C++
|
||||
|
||||
" Add highlighting for function definition in C++
|
||||
function! EnhanceCppSyntax()
|
||||
syn match cppFuncDef "::\~\?\zs\h\w*\ze([^)]*\()\s*\(const\)\?\)\?$"
|
||||
hi def link cppFuncDef Special
|
||||
endfunction
|
||||
autocmd Syntax cpp call EnhanceCppSyntax()
|
||||
autocmd FileType cpp setlocal expandtab shiftwidth=2 tabstop=2 softtabstop=2
|
||||
|
||||
" HTML
|
||||
au FileType html
|
||||
\ set makeprg=tidy\ -qe\ -access\ 3\ % |
|
||||
\ set errorformat=line\ %l\ column\ %c\ \-\ %m
|
||||
" let g:html_indent_tags .= '\|p'
|
||||
" let g:html_indent_tags .= '\|li'
|
||||
|
||||
|
||||
au FileType xml
|
||||
\ set makeprg=tidy\ -qe\ -access\ 3\ % |
|
||||
\ set errorformat=line\ %l\ column\ %c\ \-\ %m
|
||||
|
||||
""
|
||||
"" Color theme
|
||||
""
|
||||
if $TERM =~ '^xterm'
|
||||
set t_Co=256
|
||||
elseif $TERM =~ '^screen'
|
||||
set t_Co=256 " just guessing
|
||||
elseif $TERM =~ '^rxvt'
|
||||
set t_Co=256
|
||||
elseif $TERM =~ '^linux'
|
||||
set t_Co=8
|
||||
else
|
||||
set t_Co=16
|
||||
endif
|
||||
|
||||
if &term =~ "xterm" || &term =~ "screen" || &term == "screen"
|
||||
set t_Co=256
|
||||
if has("terminfo")
|
||||
let &t_Sf=nr2char(27).'[3%p1%dm'
|
||||
let &t_Sb=nr2char(27).'[4%p1%dm'
|
||||
else
|
||||
let &t_Sf=nr2char(27).'[3%dm'
|
||||
let &t_Sb=nr2char(27).'[4%dm'
|
||||
endif
|
||||
endif
|
||||
|
||||
" Show syntax highlight group in the status bar
|
||||
" map ,h :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
|
||||
" \ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<"
|
||||
" \ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>
|
||||
|
||||
" let g:jellybeans_background_color_256 = "234"
|
||||
let g:jellybeans_background_color_256 = "0"
|
||||
let g:jellybeans_use_lowcolor_black = 1
|
||||
let g:jellybeans_overrides = {
|
||||
\ 'Comment': { 'ctermfg': 'Yellow', 'ctermbg': '', 'attr': 'italic' },
|
||||
\}
|
||||
colorscheme dln-jellybeans
|
||||
|
24
.xinitrc
Executable file
24
.xinitrc
Executable file
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
|
||||
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
|
||||
[ -x "$f" ] && . "$f"
|
||||
done
|
||||
unset f
|
||||
fi
|
||||
|
||||
. $HOME/.bashrc
|
||||
|
||||
xsetroot -solid \#010101
|
||||
|
||||
xmodmap $DOTFILES/.Xmodmap
|
||||
setxkbmap -option ctrl:nocaps,grp:switch,grp_led:scroll us,se
|
||||
|
||||
if [ "$HOSTNAME" = "dredd" ]; then
|
||||
redshift -l 59.29:18.01 -t 5800:4500 &
|
||||
xautolock -time 3 -detectsleep -locker $DOTFILES/bin/lockscreen &
|
||||
(sleep 0.1 && xautolock -locknow) &
|
||||
fi
|
||||
|
||||
st -e tmux attach -t 0 &
|
||||
|
||||
exec dwm
|
Loading…
Reference in a new issue