diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Xresources | 21 | ||||
-rw-r--r-- | bashrc | 257 | ||||
-rw-r--r-- | gitconfig | 37 | ||||
-rw-r--r-- | gitignore_global | 56 | ||||
-rw-r--r-- | taskrc | 314 | ||||
-rw-r--r-- | tmux.conf | 219 | ||||
-rw-r--r-- | vim/.netrwhist | 3 | ||||
-rw-r--r-- | vim/UltiSnips/markdown.snippets | 3 | ||||
-rw-r--r-- | vim/autoload/plug.vim | 2812 | ||||
-rw-r--r-- | vim/colors/blackboard.vim | 99 | ||||
-rw-r--r-- | vim/colors/blank.vim | 327 | ||||
-rw-r--r-- | vim/colors/blue_alt.vim | 56 | ||||
-rw-r--r-- | vim/colors/distinguished.vim | 179 | ||||
-rw-r--r-- | vim/colors/grb256.vim | 32 | ||||
-rw-r--r-- | vim/colors/gruber-darker.vim | 228 | ||||
-rw-r--r-- | vim/colors/hipster.vim | 102 | ||||
-rw-r--r-- | vim/colors/nofrils-acme.vim | 189 | ||||
-rw-r--r-- | vim/colors/nofrils-dark.vim | 189 | ||||
-rw-r--r-- | vim/colors/nofrils-light.vim | 189 | ||||
-rw-r--r-- | vim/colors/nofrils-sepia.vim | 189 | ||||
-rw-r--r-- | vim/colors/tfl-subtle.vim | 91 | ||||
-rw-r--r-- | vim/colors/tfl.vim | 93 | ||||
-rw-r--r-- | vim/colors/wombat256mod.vim | 96 | ||||
-rw-r--r-- | vim/spell/en.utf-8.add | 13 | ||||
-rw-r--r-- | vim/spell/en.utf-8.add.spl | bin | 0 -> 171 bytes | |||
-rw-r--r-- | vim/vimrc | 473 | ||||
-rw-r--r-- | xmodmap | 3 | ||||
-rw-r--r-- | xprofile | 20 |
29 files changed, 6291 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2c66cd4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +vim/plugged diff --git a/Xresources b/Xresources new file mode 100644 index 0000000..4c775ac --- /dev/null +++ b/Xresources @@ -0,0 +1,21 @@ +Xft.dpi: 192 + +!Theme Three +*background: rgb:00/00/00 +*foreground: rgb:cf/cf/cf +*color0: rgb:00/00/00 +*color1: rgb:e0/10/10 +*color2: rgb:20/ad/20 +*color3: rgb:d4/c2/4f +*color4: rgb:23/1b/b8 +*color5: rgb:9c/38/85 +*color6: rgb:1d/bd/b8 +*color7: rgb:fe/fe/fe +*color8: rgb:6a/6a/6a +*color9: rgb:e8/3a/3d +*color10: rgb:35/e9/56 +*color11: rgb:ff/ff/2f +*color12: rgb:3a/53/f0 +*color13: rgb:e6/28/ba +*color14: rgb:1c/f5/f5 +*color15: rgb:ff/ff/ff @@ -0,0 +1,257 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples + +# If not running interactively, don't do anything +case $- in + *i*) ;; + *) return;; +esac + +# secrets +source ~/secrets + +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# If set, the pattern "**" used in a pathname expansion context will +# match all files and zero or more directories and subdirectories. +#shopt -s globstar + +# make less more friendly for non-text input files, see lesspipe(1) +#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + xterm-color|*-256color) color_prompt=yes;; +esac + +# uncomment for a colored prompt, if the terminal has the capability; turned +# off by default to not distract the user: the focus in a terminal window +# should be on the output of commands, not on the prompt +#force_color_prompt=yes + +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt= + fi +fi + +if [ "$color_prompt" = yes ]; then + PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' +else + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +fi +unset color_prompt force_color_prompt + +# If this is an xterm set the title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + #alias dir='dir --color=auto' + #alias vdir='vdir --color=auto' + + #alias grep='grep --color=auto' + #alias fgrep='fgrep --color=auto' + #alias egrep='egrep --color=auto' +fi + +# colored GCC warnings and errors +#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' + +# some more ls aliases +#alias ll='ls -l' +#alias la='ls -A' +#alias l='ls -CF' + +# Alias definitions. +# You may want to put all your additions into a separate file like +# ~/.bash_aliases, instead of adding them here directly. +# See /usr/share/doc/bash-doc/examples in the bash-doc package. + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi + +# aliases +alias pacget="pacman -Slq | fzf --multi --preview 'pacman -Si {1}' | xargs -ro sudo pacman -S" +alias pacdel="pacman -Qq | fzf --multi --preview 'pacman -Qi {1}' | xargs -ro sudo pacman -Rns" +alias gloga='git log --oneline --decorate --graph --all' +alias batnote='batnote-source-code' +alias am='append_to_masterlist' +alias vi='vim' +alias ls='ls --color=auto' +alias h='hey_openai' +alias hd='openai_data' +alias xclip='xclip -selection c' +alias notes="cd ~/Documents/Notes/" +alias blog="cd ~/code/html/yulqen.org/" +alias bud="cd ~/Budget/ledger/hledger/" +alias getip="curl ifconfig.me" +alias tprojects="task rc.list.all.projects=1 projects" +alias ttags="task rc.list.all.tags=1 tags" +alias tkilled="task +killlist list" +alias ttagged="task tags.any: list" +alias tuntagged="task tags.none: list" +alias ttoday="task ml_due_or_scheduled_today" +alias tl="/home/lemon/Documents/Notes/todo/todo.sh list" +alias t="/home/lemon/Documents/Notes/todo/todo.sh" + +# Environment variables +export LEDGER_FILE="$HOME/Budget/ledger/hledger/budget.ledger" +export TERM="screen-256color" +export LESS="-iMRS -x2" +export NOTES_DIR="~/Documents/Notes" +export RANGER_LOAD_DEFAULT_RC="FALSE" +export FZF_DEFAULT_COMMAND="rg --files --hidden --glob '!.git' " +export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" +export FZF_ALT_C_COMMAND="$FZF_DEFAULT_COMMAND" +export FZF_DEFAULT_OPTS="--color info:108,prompt:109,spinner:108,pointer:168,marker:168" + +# fzf +#source /usr/share/fzf/key-bindings.bash +#source /usr/share/fzf/completion.bash + +# Functions + +############################################################## +# Quick way to create a new blog post with Hugo from wherever +# on the filesystem. +# Used ChatGPT to get the substitution and escaping correct. +# Called with a single string argument. +# ############################################################ + +function newpost() { + if [[ $# -ne 1 ]]; then echo "Give me the title!"; return; fi + title="$1" + # convert title to lowercase and replace spaces with hyphens for the slug + slug=$(echo "$title" | tr '[:upper:]' '[:lower:]' | tr ' ' '-') + # create the new post file with Hugo + cd $HOME/code/html/yulqen.org + post_path="content/blog/$slug.md" + hugo new "$post_path" + # update the front matter with the original title string + echo "Looking for $post_path..." + awk -v title="$title" '{gsub(/title: .*/, "title: \""title"\"")}1' "$post_path" > tmp && mv tmp "$post_path" + vim $post_path +} + +################################################################### +# To output in cat, just call todj. +# To enable editing the files in vim, call todj vim. +# You can use less or any other tool to display the text if you wish +# Arguments: +# None +# Output: +# Writes to stdout or opens program passed as first argument +################################################################### +todj () { + CMD=${1:-"cat"} + $CMD $(find /home/lemon/Documents/Notes/journal -name "*$(date '+%Y-%m-%d')*") +} + +######################################################################### +# This function takes two arguments as strings. The idea is to enable +# passing file data into the function, such as a csv file or some code. +# Call like this openai_data "Please optimise the following function in +# python" "$(</path/to/file)" This is supposed to be a good way to read a +# file's contents in bash +# Arguments: +# Text prompt +# File contents +# Output: +# Writes to stdout +######################################################################### +openai_data() { + if [[ $# -ne 2 ]]; then echo "Give me two params!"; return; fi + + text_prompt="$1" + data="$2" + prompt="${text_prompt}: ${data}" + json=$(jq -n --arg p "$data" '{model: "gpt-3.5-turbo", messages: [{role: "user", content: $p}], temperature: 0.7}') + local gpt=$(curl https://api.openai.com/v1/chat/completions -s \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_KEY" \ + -H "OpenAI-Organization: $OPENAI_ORG_ID" \ + -d "$json") + echo $gpt | jq -r '.choices[0].message.content' +} + +################################################################################ +# A straight forward request to the OpenAI GPT-3 model. +# Takes a single string argument and returns a simple response. +# hey_openai "What is the best way to open and interate through a file in Perl?" +# Arguments: +# Text prompt +# Output: +# Writes to stdout +################################################################################ +hey_openai() { + prompt="$1" + local gpt=$(curl https://api.openai.com/v1/chat/completions -s \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_KEY" \ + -H "OpenAI-Organization: $OPENAI_ORG_ID" \ + -d "{ + \"model\": \"gpt-3.5-turbo\", + \"messages\": [{\"role\": \"user\", \"content\": \"$prompt\"}], + \"temperature\": 0.7 + }") + echo $gpt | jq -r '.choices[0].message.content' +} + +append_to_masterlist() { + ml=~/Documents/Notes/todo/masterlist.txt + echo "$1" >> "$ml" + cat "$ml" +} + +[ -f ~/.fzf.bash ] && source ~/.fzf.bash + +. "$HOME/.cargo/env" + +# Setting PATH +export PATH=~/bin/:$PATH +export PATH=~/.local/bin/:$PATH diff --git a/gitconfig b/gitconfig new file mode 100644 index 0000000..1885d56 --- /dev/null +++ b/gitconfig @@ -0,0 +1,37 @@ +[user] + email = y@yulqen.org + name = Matthew Lemon +[core] + excludesfile = /home/lemon/.gitignore_global + quotepath = false + editor = /usr/bin/vim +[alias] + co = checkout + ci = commit + br = branch + p = push origin master + # friendly statuses + st = status -sb --ignore-submodules=all + # Add all unstaged changes/removals and commit. All you gotta do here is pass the commit message. + # Example: git ac 'My commit message' + ac = !git add -A && git commit -m + # Pretty looking log + lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit + d = difftool +[push] + default = simple +[diff] + tool = vimdiff +[difftool] + prompt = false +[color] + ui = true + branch = true + diff = true + interactive = true + status = true + log = false +[pull] + rebase = false +[init] + defaultBranch = master diff --git a/gitignore_global b/gitignore_global new file mode 100644 index 0000000..461b29f --- /dev/null +++ b/gitignore_global @@ -0,0 +1,56 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] + +# C extensions +*.so + +# Distribution / packaging +.Python +.idea/ +venv/ +.venv/ +#bin/ +build/ +develop-eggs/ +eggs/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +.tox/ +.coverage +.cache +nosetests.xml +coverage.xml + +# Translations +*.mo + +# Mr Developer +.mr.developer.cfg +.project +.pydevproject + +# Rope +.ropeproject + +# Django stuff: +*.log +*.pot + +# Sphinx documentation +docs/_build/ +.pdb-pyhist +.mypy_cache/ +.venv +*.un~ @@ -0,0 +1,314 @@ +# [Created by task 2.5.1 5/22/2016 09:24:00] +# Taskwarrior program configuration file. +# For more documentation, see http://taskwarrior.org or try 'man task', 'man task-color', +# 'man task-sync' or 'man taskrc' +# +# CALENDAR +calendar.details=full +calendar.holidays=sparse + +editor=vim + +default.project=Inbox + +#verbose=1 +verbose=header,footnote,label,new-id,affected,edit,special,project + +# +# +# Here is an example of entries that use the default, override and blank values +# variable=foo -- By specifying a value, this overrides the default +# variable= -- By specifying no value, this means no default +# #variable=foo -- By commenting out the line, or deleting it, this uses the default + +# Use the command 'task show' to see all defaults and overrides +# +# HOLIDAYS +#include /usr/share/doc/task/rc/holidays.en-GB.rc +#include /usr/share/taskwarrior/holidays.en-GB.rc +holiday.easter22.name=Easter 2022 +holiday.easter22.start=2022-04-09 +holiday.easter22.end=2022-04-12 + +# Files +data.location=~/.task + + +# calendar +weekstart=Monday + +# Color theme (uncomment one to use) +#include /usr/local/share/doc/taskwarrior/rc/light-16.theme +#include /usr/local/share/doc/taskwarrior/rc/light-256.theme +#include /usr/share/taskwarrior/dark-16.theme +#include /usr/share/doc/task/rc/dark-256.theme +#include /usr/share/doc/task/rc/dark-red-256.theme +#include /usr/share/taskwarrior/dark-red-256.theme +#include /usr/share/taskwarrior/dark-green-256.theme +#include /usr/share/taskwarrior/dark-blue-256.theme +include /usr/share/taskwarrior/dark-blue-256.theme +#include /usr/share/taskwarrior/dark-violets-256.theme +#include /usr/share/taskwarrior/dark-yellow-green.theme +#include /usr/share/taskwarrior/dark-gray-256.theme +#include /usr/share/taskwarrior/dark-gray-blue-256.theme +#include /usr/share/taskwarrior/solarized-dark-256.theme +#include /usr/share/doc/task/rc/solarized-light-256.theme +#include /usr/local/share/doc/taskwarrior/rc/no-color.theme +#include /home/lemon/.task/solarized-16.theme +#include /home/lemon/.task/solarized-dark-256.theme +# +# colour +color.burndown.done=black on green +color.burndown.pending=black on rgb510 +color.burndown.started=black on yellow +color.calendar.due.today=on red +color.calendar.overdue=bold red +color.calendar.today=blue +color.calendar.due=cyan +color.blocked=underline grey10 on grey3 +color.blocking=color5 +color.due= +color.tagged= +color.tag.waiting=blue +color.tag.next=cyan +color=on +color.project.Inbox=black on cyan +color.alternate=on rgb253 + +# Task server - essential config! +taskd.certificate=\/home\/lemon\/.task\/Matthew_Lemon.cert.pem +taskd.key=\/home\/lemon\/.task\/Matthew_Lemon.key.pem +taskd.ca=\/home\/lemon\/.task\/ca.cert.pem +taskd.server=16693433.xyz:53589 +#taskd.trust=ignore hostname +#taskd.credentials=Public\/matt lemon\/65ed83f1-a2ec-48d2-ad74-9625cc58b030 +#taskd.credentials=Public\/Matthew Lemon\/bb8f1075-3435-452a-ad98-a5da868abbaf +taskd.credentials=Public\/Matthew Lemon\/51f50856-8333-445e-9c81-273df1ff148a + +# Tasksh report stuff +uda.reviewed.type=date +uda.reviewed.label=Reviewed +report._reviewed.description=Tasksh review report. Adjust the filter to your needs. +report._reviewed.columns=uuid +report._reviewed.sort=reviewed+,modified+ +report._reviewed.filter=( reviewed.none: or reviewed.before:now-1week ) and ( +PENDING or +WAITING ) + +# Inbox report +report.in.columns = id,description +report.in.description = Inbox +report.in.filter = status:pending limit:page (+in) +report.in.labels = ID,Description + +# changing urgency of priorities +urgency.uda.priority.L.coefficient=-1.8 + +# some UDAs for me +urgency.user.tag.trivial.coefficient=-5.5 +urgency.user.tag.bug.coefficient=+1.5 +urgency.user.tag.reference.coefficient=-3.2 +urgency.user.tag.idea.coefficient=-3.0 +urgency.user.project.h.chore.coefficient=-3.0 +urgency.user.project.h.admin.coefficient=-0.5 +urgency.user.project.h.buy.coefficient=-4.0 +urgency.user.project.h.diy.coefficient=-5.0 +urgency.user.project=-0.0 +urgency.user.tag.link.coefficient=-5.0 +urgency.user.tag.idea.coefficient=-5.0 +urgency.user.tag.home.coefficient=+1.8 +urgency.user.tag.waiting.coefficient=-2.0 +# UDA for bash script (inspection_planning.sh) +uda.wb.type=date +uda.wb.label=Week Beginning +# killlist is everything that should be removed - bottom +urgency.user.tag.killlist.coefficient=-5.1 + +# F*ck annotations having any effect on urgency! +urgency.annotations.coefficient=0 + +# Changing coefficients +#urgency.annotations.coefficient=0.5 +urgency.tags.coefficient=0 +urgency.blocking.coefficient=+2.0 +urgency.due.coefficient=1.1 + +#urgency.project.coefficient=1 +#urgency.age.coefficient=1 +#urgency.due.coefficient=6.0 +#urgency.project.coefficnent=1.0 + +# Colours +#color.project.code.dbasik=green +#color.tag.next=black on bright yellow +color.tag.killlist=rgb104 on black +#color.due.today=red on yellow +#color.overdue=bold red +##color.active=bold yellow +#color.calendar.weekend=bold +#color.scheduled=bold magenta +#color.tag.dft=white on rgb100 +#color.tag.prep=rgb150 on rgb020 +color.alternate= +#color.tag.bug=red on cyan +#rule.color.merge=no + +# 2022 HOLIDAYS +holiday.en-nyd.name=New Year's Day BH +holiday.en-nyd.date=20220103 +holiday.en-gf.name=Good Friday +holiday.en-gf.date=goodfriday +holiday.en-es.name=Easter Sunday +holiday.en-es.date=easter +holiday.en-em.name=Easter Monday +holiday.en-em.date=eastermonday +#holiday.en-GB4.name=Early May Bank Holiday +#holiday.en-GB4.date=20190506 +#holiday.en-GB5.name=Spring Bank Holiday +#holiday.en-GB5.date=20190527 +#holiday.en-GB6.name=August Bank Holiday +#holiday.en-GB6.date=20190826 +#holiday.en-GB7.name=Christmas Day +#holiday.en-GB7.date=20191225 +#holiday.en-GB8.name=Boxing Day +#holiday.en-GB8.date=20191226 +#holiday.en-GB9.name=New Year's Day +#holiday.en-GB9.date=20200101 + +# next report ("task") + +# Don't ask for confirmation +confirmation=no + +# RECURRANCE MUST BE ONE FOR ONE MACHINE +recurrence=on +recurrence.limit=1 + + # Context +context.work=project:w +context.work.write=project:Inbox +context.work.read=(project:w or project:Inbox) + +context.home=project:h +context.home.write=project:Inbox +context.home.read=(project:h or project:Inbox) +# context.code=project:code +# context.work=-code +dft +# context.nowork=-dft +context.nocode=project.not:code +# context.home=(project.not:code) -dft + + +# REPORTS +report.waiting.columns=id,start.active,entry.age,depends.indicator,priority,project,tags,recur.indicator,wait,wait.remaining,scheduled,due,until,description.count + +# basic for putting on my own web site +report.ml_basic.columns=due,description.count +report.ml_basic.description="Description-only for putting on my own site" +report.ml_basic.filter=status:pending +report.ml_basic.sort=due,urgency + +# Due or scheduled today +report.ml_due_or_scheduled_today.columns=id,entry.age,depends,priority,project,tags.count,recur,scheduled.countdown,due.relative,until.remaining,description.count,urgency +report.ml_due_or_scheduled_today.description="Due or scheduled today" +report.ml_due_or_scheduled_today.filter=(due:today or scheduled:today) and status:pending +report.ml_due_or_scheduled_today.sort=due,urgency +# +# Due or scheduled tomorrow +report.ml_due_or_scheduled_tomorrow.columns=id,entry.age,depends,priority,project,tags.count,recur,scheduled.countdown,due.relative,until.remaining,description.count,urgency +report.ml_due_or_scheduled_tomorrow.description="Due or scheduled tomorrow" +report.ml_due_or_scheduled_tomorrow.filter=(due.is:tomorrow or scheduled.is:tomorrow) and status:pending +report.ml_due_or_scheduled_tomorrow.sort=due,urgency + +# Due within 5 days, including waiting +report.ml_due_within_5_days.columns=id,entry.age,depends,priority,project,tags.count,recur,scheduled.countdown,due.relative,until.remaining,description.count,urgency +report.ml_due_within_5_days.description="Due within 5 days, including waiting" +report.ml_due_within_5_days.filter=(+WAITING and (due.before:today+5days)) or (status:pending) and (due.before:today+5days) +report.ml_due_within_5_days.sort=due,urgency + + +# Report all +report.all.column=id,status.short,uuid.short,start.active,entry.age,end.age,depends.indicator,priority,project.parent,tags.count,recur.indicator,wait.remaining,scheduled.remaining,due,until,remaining,description +report.all.labels=ID,St,UUID,A,Age,Done,D,P,Project,Tags,R,Wait,Sch,Due,Until,Description +report.all.description="All Tasks (amended)" +report.all.sort=entry- + +# how to filter out a project from next - but this also means you can't filter +# it at all +#report.next.columns=id,start.age,entry.age,depends,priority,project,tags.count,recur,scheduled.countdown,due.relative,until.remaining,description.count,urgency +#report.next.filter=status:pending and (+next or scheduled.before:today or due.before:today or scheduled.today or due.today) +#report.next.filter=project.not:code.bcompiler status:pending limit:page + +# Next/default +report.next.description="Next" +report.next.columns=id,start.age,entry.age,depends,priority,project,tags,recur,scheduled.formatted,due.relative,until.remaining,description.truncated_count,urgency +report.next.filter=status:pending limit:page -idea -killlist project.not:h.buy + +# mlscheduled +report.ml_scheduled.description='Modified list of scheduled tasks' +report.ml_scheduled.columns=id,project.indented,tags.count,scheduled,due,description.count,priority,urgency +report.ml_scheduled.labels=ID,Project,Tags,Scheduled,Due,Description,Priority,Urgency +report.ml_scheduled.sort=scheduled+/,priority- +report.ml_scheduled.filter=status:pending and +SCHEDULED and -BLOCKED + +# inspection_prep +report.ml_inspection_prep.description="List of all tasks related to inspection planning" +report.ml_inspection_prep.columns=id,project.indented,description.count,scheduled,due +report.ml_inspection_prep.labels=ID,Project,Task,Scheduled,Due +report.ml_inspection_prep.filter=+inspection -inspection_followup status:pending +report.ml_inspection_prep.sort=project+/,due+,scheduled+ + +# inspection_followup +report.ml_inspection_followup.description="List of all tasks related to inspection follow-up" +report.ml_inspection_followup.columns=id,project.indented,description.count,scheduled,due +report.ml_inspection_followup.labels=ID,Project,Task,Scheduled,Due +report.ml_inspection_followup.filter=+inspection_followup status:pending + +# upcoming +report.ml_upcoming.description=Pending and Waiting coming up +report.ml_upcoming.columns=id,status,wait.remaining,entry,tags,scheduled,due,description.count +report.ml_upcoming.labels=ID,Status,Wait,Age,Tags,Sched,Due,Description +report.ml_upcoming.sort=status+,wait+,scheduled+,due+ +report.ml_upcoming.filter=status:pending + +# nextmonth +report.ml_nextmonth.description=Next month +report.ml_nextmonth.columns=id,status,wait.remaining,entry,tags,scheduled,due,description.count +report.ml_nextmonth.labels=ID,Status,Wait,Age,Tags,Sched,Due,Description +report.ml_nextmonth.sort=status+,wait+,scheduled+,due+ +report.ml_nextmonth.filter=scheduled.after:yesterday and scheduled.before:4weeks +#context=work + +# completed in last week +report.ml_comp_lastweek.description=Tasks completed in the last week +report.ml_comp_lastweek.columns=uuid.short,project.full,description.combined,end.relative +report.ml_comp_lastweek.labels=UUID,Project,Task,Completed +report.ml_comp_lastweek.sort=end- +report.ml_comp_lastweek.filter=end.after:today-7day + +# completed in last month +report.ml_comp_lastmonth.description=Tasks completed in the last month +report.ml_comp_lastmonth.columns=uuid.short,project.full,description.combined,end.relative +report.ml_comp_lastmonth.labels=UUID,Project,Task,Completed +report.ml_comp_lastmonth.sort=end- +report.ml_comp_lastmonth.filter=end.after:today-31day + +# deleted in the last month +report.ml_deleted_last_month.description=Tasks deleted in last month +report.ml_deleted_last_month.columns=status.short,uuid.short,project.full,tags.list,description.count,end.formatted +report.ml_deleted_last_month.labels=Status,UUID,Project,Tags,Description,Deleted +report.ml_deleted_last_month.sort=end- +report.ml_deleted_last_month.filter=end.after:today-30day status:deleted + + +# all projects used +# THIS IS THE COMMAND THAT WORKS: task rc.list.all.projects=1 projects +# BUT DOESN'T WORK HERE - NOT TRIED TOO HARD +#report.ml_all_projects_used.description=All projects +#report.ml_all_projects_used.columns=project.full +#report.ml_all_projects_used.labels=Project +#report.ml_all_projects_used.sort=project+ +#report.ml_all_projects_used.filter=rc.list.all.projects=1 projects + +# regex on +regex=on + +news.version=2.6.0 diff --git a/tmux.conf b/tmux.conf new file mode 100644 index 0000000..a7d6c20 --- /dev/null +++ b/tmux.conf @@ -0,0 +1,219 @@ +# I got some additional config in 2022 from https://findelabs.com/post/openbsd-with-tmux/ +# unbind some default keybindings +unbind C-b + +#set-option -sa terminal-features ',screen-256color:RGB' +set-option -g focus-events on + +# set shell +#set -g default-shell '/bin/ksh' + +# command sequence for nested tmux sessions +bind-key a send-prefix + +# set prefix key to ctrl-a +set -g prefix C-a + +set-option -g status-interval 60 + +# lower command delay +set -sg escape-time 1 + +# force tmux to use xterm +#set -g default-terminal "xterm-256color" +#set -g default-terminal "tmux-256color" +set -g default-terminal "screen-256color" + +# set from advice in neovim :checkhealth +#set-option -sa terminal-overrides ',screen-256color:RGB' + +# start first window and pane at 1, not zero +set -g base-index 1 +set -g pane-base-index 1 + +# bind r to reloading the config file +bind r source-file ~/.tmux.conf \; display "Reloaded tmux config file." + +# pass through a ctrl-a if you press it twice +bind C-a send-prefix + +# better mnemonics for splitting panes! +bind | split-window -h +bind - split-window -v + +# vim / xmonad style bindings for pane movement +bind -r h select-pane -L +bind -r j select-pane -D +bind -r k select-pane -U +bind -r l select-pane -R + +# vim / xmonad style bindings for window movement +bind -r C-h select-window -t :- +bind -r C-l select-window -t :+ + +# history limit to 10K lines +set -g history-limit 10000 + +# shift-movement keys will resize panes +bind -r H resize-pane -L 5 +bind -r J resize-pane -D 5 +bind -r K resize-pane -U 5 +bind -r L resize-pane -R 5 + +# make mouse useful in copy mode +set -g mouse on + +# ctl-left/right keys +set-window-option -g xterm-keys on + +# Configure Ctrl+Arrow keys to create and navigate through windows +bind -n C-Left previous-window +bind -n C-Right next-window +bind -n C-Up new-window +bind -n C-Down confirm-before -p "kill-window #P? (y/n)" kill-window + +# Set visual notifications - these are quite nippy +setw -g monitor-activity off +set -g visual-activity off + +# disable mouse support (at least while we're learning) +# setw -g mode-mouse off +# set -g mouse-select-pane off +# set -g mouse-resize-pane off +# set -g mouse-select-window off +# +# copy and paste +unbind p +bind p paste-buffer +#bind -t vi-copy 'v' begin-selection +#bind -t vi-copy 'y' copy-selection +# new copy and paste (needed for st terminal) = https://www.rushiagr.com/blog/2016/06/16/everything-you-need-to-know-about-tmux-copy-pasting-ubuntu/ + +bind-key -T copy-mode-vi v send-keys -X begin-selection +bind-key -T copy-mode-vi y send-keys -X copy-selection +bind-key -T copy-mode-vi r send-keys -X rectangle-toggle + +# also copy to system clipboard +#bind -T vi-copy y copy-pipe "xclip -sel clip -i" + +# enable copy and paste with the mouse! +set -g mouse off + +# geohot colors +set -g status-position bottom +set -g status-bg colour234 +set -g status-fg colour137 +set -g status-style dim +set -g status-left '' +#set -g status-right '#[fg=colour233,bg=colour241,bold] %d/%m #[fg=colour233,bg=colour245,bold] %H:%M:%S ' +set -g status-right '[#(TZ="Europe/London" date +"%%Y-%%m-%%d %%H:%%M")]' +set -g status-right-length 50 +set -g status-left-length 20 + +setw -g window-status-current-style fg=colour81 +setw -g window-status-current-style bg=colour238 +setw -g window-status-current-style bold +setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour255]#W#[fg=colour50]#F ' + +setw -g window-status-style fg=colour138 +setw -g window-status-style bg=colour235 +setw -g window-status-style none +setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F ' + +setw -g window-status-bell-style bold +setw -g window-status-bell-style fg=colour255 +setw -g window-status-bell-style bg=colour1 + + +# fiddle with colors of status bar +# set color for status bar +#set-option -g status-bg colour240 +#set-option -g status-bg black +#set-option -g status-fg yellow +#set -g status-position bottom +#set -g status-style "bg=colour1" +#set -g status-style "fg=colour137" +##set -g status-fg colour137 +##set -g status-attr dim +##set -g status-left '' +#set -g status-left-length 30 +#set -g status-right '#[fg=colour233,bg=colour241,bold] %d/%m #[fg=colour233,bg=colour245,bold] %H:%M:%S ' +##set -g status-right-length 5 +##set -g status-left-length 20 + +# show hostname and IP address on the left side of status bar +#set-option -g status-left-length 100 +#set -g status-left ' #( sysctl -n vm.loadavg ) ' - this isn't useful + +# show session name, window, pane number, date and time on right side +set -g status-right-length 100 + +##setw -g window-status-current-bg colour238 +##setw -g window-status-current-style bold +#setw -g window-status-current-format ' #[bg=colour237]#I#[fg=colour250]:#[fg=colour255]#[bg=colour237]#W#[fg=colour50]#F ' +## +#setw -g window-status-style "fg=colour61" +#setw -g window-status-style "bg=colour235" +#setw -g window-status-attr none +#setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F ' +# +#setw -g window-status-bell-attr bold +#setw -g window-status-bell-fg colour255 +#setw -g window-status-bell-bg colour1 +## +## fuck with border colours +#set -g pane-border-fg yellow +#set -g pane-active-border-fg red +# +# +## fiddle with colors of inactive windows +#setw -g window-status-fg cyan + +# vim mode keys +setw -g mode-keys vi + +# battery information in status bar +set -g status-interval 40 +set -g status-right "#[fg=colour155]#(apm -l)%% | #[fg=colour45]%d %b %R" + +# +## Smart pane switching with awareness of Vim splits. +## See: https://github.com/christoomey/vim-tmux-navigator +#is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ +# | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" +#bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L' +#bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D' +#bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U' +#bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R' +#tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")' +#if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \ +# "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'" +#if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \ +# "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'" +# +#bind-key -T copy-mode-vi 'C-h' select-pane -L +#bind-key -T copy-mode-vi 'C-j' select-pane -D +#bind-key -T copy-mode-vi 'C-k' select-pane -U +#bind-key -T copy-mode-vi 'C-l' select-pane -R +#bind-key -T copy-mode-vi 'C-\' select-pane -l +# +# +# try different, vimlike copy-mode +unbind [ +bind Escape copy-mode +unbind p +bind p paste-buffer + + +#List of plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'tmux-plugins/tmux-resurrect' +set -g @plugin 'tmux-plugins/tmux-yank' + +set -g @resurrect-save 'Q' +set -g @resurrect-restore 'R' + +run-shell ~/.tmux-resurrect/resurrect.tmux +# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +run '~/.tmux/plugins/tpm/tpm' diff --git a/vim/.netrwhist b/vim/.netrwhist new file mode 100644 index 0000000..cb60582 --- /dev/null +++ b/vim/.netrwhist @@ -0,0 +1,3 @@ +let g:netrw_dirhistmax =10 +let g:netrw_dirhistcnt =1 +let g:netrw_dirhist_1='/home/lemon' diff --git a/vim/UltiSnips/markdown.snippets b/vim/UltiSnips/markdown.snippets new file mode 100644 index 0000000..f20bf95 --- /dev/null +++ b/vim/UltiSnips/markdown.snippets @@ -0,0 +1,3 @@ +snippet swowdev "Test snippet" +- @~SWOWdev (`date +"%c"`): $0 +endsnippet diff --git a/vim/autoload/plug.vim b/vim/autoload/plug.vim new file mode 100644 index 0000000..9c3011f --- /dev/null +++ b/vim/autoload/plug.vim @@ -0,0 +1,2812 @@ +" vim-plug: Vim plugin manager +" ============================ +" +" Download plug.vim and put it in ~/.vim/autoload +" +" curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ +" https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim +" +" Edit your .vimrc +" +" call plug#begin('~/.vim/plugged') +" +" " Make sure you use single quotes +" +" " Shorthand notation; fetches https://github.com/junegunn/vim-easy-align +" Plug 'junegunn/vim-easy-align' +" +" " Any valid git URL is allowed +" Plug 'https://github.com/junegunn/vim-github-dashboard.git' +" +" " Multiple Plug commands can be written in a single line using | separators +" Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' +" +" " On-demand loading +" Plug 'preservim/nerdtree', { 'on': 'NERDTreeToggle' } +" Plug 'tpope/vim-fireplace', { 'for': 'clojure' } +" +" " Using a non-default branch +" Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' } +" +" " Using a tagged release; wildcard allowed (requires git 1.9.2 or above) +" Plug 'fatih/vim-go', { 'tag': '*' } +" +" " Plugin options +" Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' } +" +" " Plugin outside ~/.vim/plugged with post-update hook +" Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } +" +" " Unmanaged plugin (manually installed and updated) +" Plug '~/my-prototype-plugin' +" +" " Initialize plugin system +" call plug#end() +" +" Then reload .vimrc and :PlugInstall to install plugins. +" +" Plug options: +" +"| Option | Description | +"| ----------------------- | ------------------------------------------------ | +"| `branch`/`tag`/`commit` | Branch/tag/commit of the repository to use | +"| `rtp` | Subdirectory that contains Vim plugin | +"| `dir` | Custom directory for the plugin | +"| `as` | Use different name for the plugin | +"| `do` | Post-update hook (string or funcref) | +"| `on` | On-demand loading: Commands or `<Plug>`-mappings | +"| `for` | On-demand loading: File types | +"| `frozen` | Do not update unless explicitly specified | +" +" More information: https://github.com/junegunn/vim-plug +" +" +" Copyright (c) 2017 Junegunn Choi +" +" MIT License +" +" Permission is hereby granted, free of charge, to any person obtaining +" a copy of this software and associated documentation files (the +" "Software"), to deal in the Software without restriction, including +" without limitation the rights to use, copy, modify, merge, publish, +" distribute, 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 PARTICULAR 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +" WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +if exists('g:loaded_plug') + finish +endif +let g:loaded_plug = 1 + +let s:cpo_save = &cpo +set cpo&vim + +let s:plug_src = 'https://github.com/junegunn/vim-plug.git' +let s:plug_tab = get(s:, 'plug_tab', -1) +let s:plug_buf = get(s:, 'plug_buf', -1) +let s:mac_gui = has('gui_macvim') && has('gui_running') +let s:is_win = has('win32') +let s:nvim = has('nvim-0.2') || (has('nvim') && exists('*jobwait') && !s:is_win) +let s:vim8 = has('patch-8.0.0039') && exists('*job_start') +if s:is_win && &shellslash + set noshellslash + let s:me = resolve(expand('<sfile>:p')) + set shellslash +else + let s:me = resolve(expand('<sfile>:p')) +endif +let s:base_spec = { 'branch': '', 'frozen': 0 } +let s:TYPE = { +\ 'string': type(''), +\ 'list': type([]), +\ 'dict': type({}), +\ 'funcref': type(function('call')) +\ } +let s:loaded = get(s:, 'loaded', {}) +let s:triggers = get(s:, 'triggers', {}) + +function! s:is_powershell(shell) + return a:shell =~# 'powershell\(\.exe\)\?$' || a:shell =~# 'pwsh\(\.exe\)\?$' +endfunction + +function! s:isabsolute(dir) abort + return a:dir =~# '^/' || (has('win32') && a:dir =~? '^\%(\\\|[A-Z]:\)') +endfunction + +function! s:git_dir(dir) abort + let gitdir = s:trim(a:dir) . '/.git' + if isdirectory(gitdir) + return gitdir + endif + if !filereadable(gitdir) + return '' + endif + let gitdir = matchstr(get(readfile(gitdir), 0, ''), '^gitdir: \zs.*') + if len(gitdir) && !s:isabsolute(gitdir) + let gitdir = a:dir . '/' . gitdir + endif + return isdirectory(gitdir) ? gitdir : '' +endfunction + +function! s:git_origin_url(dir) abort + let gitdir = s:git_dir(a:dir) + let config = gitdir . '/config' + if empty(gitdir) || !filereadable(config) + return '' + endif + return matchstr(join(readfile(config)), '\[remote "origin"\].\{-}url\s*=\s*\zs\S*\ze') +endfunction + +function! s:git_revision(dir) abort + let gitdir = s:git_dir(a:dir) + let head = gitdir . '/HEAD' + if empty(gitdir) || !filereadable(head) + return '' + endif + + let line = get(readfile(head), 0, '') + let ref = matchstr(line, '^ref: \zs.*') + if empty(ref) + return line + endif + + if filereadable(gitdir . '/' . ref) + return get(readfile(gitdir . '/' . ref), 0, '') + endif + + if filereadable(gitdir . '/packed-refs') + for line in readfile(gitdir . '/packed-refs') + if line =~# ' ' . ref + return matchstr(line, '^[0-9a-f]*') + endif + endfor + endif + + return '' +endfunction + +function! s:git_local_branch(dir) abort + let gitdir = s:git_dir(a:dir) + let head = gitdir . '/HEAD' + if empty(gitdir) || !filereadable(head) + return '' + endif + let branch = matchstr(get(readfile(head), 0, ''), '^ref: refs/heads/\zs.*') + return len(branch) ? branch : 'HEAD' +endfunction + +function! s:git_origin_branch(spec) + if len(a:spec.branch) + return a:spec.branch + endif + + " The file may not be present if this is a local repository + let gitdir = s:git_dir(a:spec.dir) + let origin_head = gitdir.'/refs/remotes/origin/HEAD' + if len(gitdir) && filereadable(origin_head) + return matchstr(get(readfile(origin_head), 0, ''), + \ '^ref: refs/remotes/origin/\zs.*') + endif + + " The command may not return the name of a branch in detached HEAD state + let result = s:lines(s:system('git symbolic-ref --short HEAD', a:spec.dir)) + return v:shell_error ? '' : result[-1] +endfunction + +if s:is_win + function! s:plug_call(fn, ...) + let shellslash = &shellslash + try + set noshellslash + return call(a:fn, a:000) + finally + let &shellslash = shellslash + endtry + endfunction +else + function! s:plug_call(fn, ...) + return call(a:fn, a:000) + endfunction +endif + +function! s:plug_getcwd() + return s:plug_call('getcwd') +endfunction + +function! s:plug_fnamemodify(fname, mods) + return s:plug_call('fnamemodify', a:fname, a:mods) +endfunction + +function! s:plug_expand(fmt) + return s:plug_call('expand', a:fmt, 1) +endfunction + +function! s:plug_tempname() + return s:plug_call('tempname') +endfunction + +function! plug#begin(...) + if a:0 > 0 + let s:plug_home_org = a:1 + let home = s:path(s:plug_fnamemodify(s:plug_expand(a:1), ':p')) + elseif exists('g:plug_home') + let home = s:path(g:plug_home) + elseif has('nvim') + let home = stdpath('data') . '/plugged' + elseif !empty(&rtp) + let home = s:path(split(&rtp, ',')[0]) . '/plugged' + else + return s:err('Unable to determine plug home. Try calling plug#begin() with a path argument.') + endif + if s:plug_fnamemodify(home, ':t') ==# 'plugin' && s:plug_fnamemodify(home, ':h') ==# s:first_rtp + return s:err('Invalid plug home. '.home.' is a standard Vim runtime path and is not allowed.') + endif + + let g:plug_home = home + let g:plugs = {} + let g:plugs_order = [] + let s:triggers = {} + + call s:define_commands() + return 1 +endfunction + +function! s:define_commands() + command! -nargs=+ -bar Plug call plug#(<args>) + if !executable('git') + return s:err('`git` executable not found. Most commands will not be available. To suppress this message, prepend `silent!` to `call plug#begin(...)`.') + endif + if has('win32') + \ && &shellslash + \ && (&shell =~# 'cmd\(\.exe\)\?$' || s:is_powershell(&shell)) + return s:err('vim-plug does not support shell, ' . &shell . ', when shellslash is set.') + endif + if !has('nvim') + \ && (has('win32') || has('win32unix')) + \ && !has('multi_byte') + return s:err('Vim needs +multi_byte feature on Windows to run shell commands. Enable +iconv for best results.') + endif + command! -nargs=* -bar -bang -complete=customlist,s:names PlugInstall call s:install(<bang>0, [<f-args>]) + command! -nargs=* -bar -bang -complete=customlist,s:names PlugUpdate call s:update(<bang>0, [<f-args>]) + command! -nargs=0 -bar -bang PlugClean call s:clean(<bang>0) + command! -nargs=0 -bar PlugUpgrade if s:upgrade() | execute 'source' s:esc(s:me) | endif + command! -nargs=0 -bar PlugStatus call s:status() + command! -nargs=0 -bar PlugDiff call s:diff() + command! -nargs=? -bar -bang -complete=file PlugSnapshot call s:snapshot(<bang>0, <f-args>) +endfunction + +function! s:to_a(v) + return type(a:v) == s:TYPE.list ? a:v : [a:v] +endfunction + +function! s:to_s(v) + return type(a:v) == s:TYPE.string ? a:v : join(a:v, "\n") . "\n" +endfunction + +function! s:glob(from, pattern) + return s:lines(globpath(a:from, a:pattern)) +endfunction + +function! s:source(from, ...) + let found = 0 + for pattern in a:000 + for vim in s:glob(a:from, pattern) + execute 'source' s:esc(vim) + let found = 1 + endfor + endfor + return found +endfunction + +function! s:assoc(dict, key, val) + let a:dict[a:key] = add(get(a:dict, a:key, []), a:val) +endfunction + +function! s:ask(message, ...) + call inputsave() + echohl WarningMsg + let answer = input(a:message.(a:0 ? ' (y/N/a) ' : ' (y/N) ')) + echohl None + call inputrestore() + echo "\r" + return (a:0 && answer =~? '^a') ? 2 : (answer =~? '^y') ? 1 : 0 +endfunction + +function! s:ask_no_interrupt(...) + try + return call('s:ask', a:000) + catch + return 0 + endtry +endfunction + +function! s:lazy(plug, opt) + return has_key(a:plug, a:opt) && + \ (empty(s:to_a(a:plug[a:opt])) || + \ !isdirectory(a:plug.dir) || + \ len(s:glob(s:rtp(a:plug), 'plugin')) || + \ len(s:glob(s:rtp(a:plug), 'after/plugin'))) +endfunction + +function! plug#end() + if !exists('g:plugs') + return s:err('plug#end() called without calling plug#begin() first') + endif + + if exists('#PlugLOD') + augroup PlugLOD + autocmd! + augroup END + augroup! PlugLOD + endif + let lod = { 'ft': {}, 'map': {}, 'cmd': {} } + + if get(g:, 'did_load_filetypes', 0) + filetype off + endif + for name in g:plugs_order + if !has_key(g:plugs, name) + continue + endif + let plug = g:plugs[name] + if get(s:loaded, name, 0) || !s:lazy(plug, 'on') && !s:lazy(plug, 'for') + let s:loaded[name] = 1 + continue + endif + + if has_key(plug, 'on') + let s:triggers[name] = { 'map': [], 'cmd': [] } + for cmd in s:to_a(plug.on) + if cmd =~? '^<Plug>.\+' + if empty(mapcheck(cmd)) && empty(mapcheck(cmd, 'i')) + call s:assoc(lod.map, cmd, name) + endif + call add(s:triggers[name].map, cmd) + elseif cmd =~# '^[A-Z]' + let cmd = substitute(cmd, '!*$', '', '') + if exists(':'.cmd) != 2 + call s:assoc(lod.cmd, cmd, name) + endif + call add(s:triggers[name].cmd, cmd) + else + call s:err('Invalid `on` option: '.cmd. + \ '. Should start with an uppercase letter or `<Plug>`.') + endif + endfor + endif + + if has_key(plug, 'for') + let types = s:to_a(plug.for) + if !empty(types) + augroup filetypedetect + call s:source(s:rtp(plug), 'ftdetect/**/*.vim', 'after/ftdetect/**/*.vim') + augroup END + endif + for type in types + call s:assoc(lod.ft, type, name) + endfor + endif + endfor + + for [cmd, names] in items(lod.cmd) + execute printf( + \ 'command! -nargs=* -range -bang -complete=file %s call s:lod_cmd(%s, "<bang>", <line1>, <line2>, <q-args>, %s)', + \ cmd, string(cmd), string(names)) + endfor + + for [map, names] in items(lod.map) + for [mode, map_prefix, key_prefix] in + \ [['i', '<C-\><C-O>', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']] + execute printf( + \ '%snoremap <silent> %s %s:<C-U>call <SID>lod_map(%s, %s, %s, "%s")<CR>', + \ mode, map, map_prefix, string(map), string(names), mode != 'i', key_prefix) + endfor + endfor + + for [ft, names] in items(lod.ft) + augroup PlugLOD + execute printf('autocmd FileType %s call <SID>lod_ft(%s, %s)', + \ ft, string(ft), string(names)) + augroup END + endfor + + call s:reorg_rtp() + filetype plugin indent on + if has('vim_starting') + if has('syntax') && !exists('g:syntax_on') + syntax enable + end + else + call s:reload_plugins() + endif +endfunction + +function! s:loaded_names() + return filter(copy(g:plugs_order), 'get(s:loaded, v:val, 0)') +endfunction + +function! s:load_plugin(spec) + call s:source(s:rtp(a:spec), 'plugin/**/*.vim', 'after/plugin/**/*.vim') +endfunction + +function! s:reload_plugins() + for name in s:loaded_names() + call s:load_plugin(g:plugs[name]) + endfor +endfunction + +function! s:trim(str) + return substitute(a:str, '[\/]\+$', '', '') +endfunction + +function! s:version_requirement(val, min) + for idx in range(0, len(a:min) - 1) + let v = get(a:val, idx, 0) + if v < a:min[idx] | return 0 + elseif v > a:min[idx] | return 1 + endif + endfor + return 1 +endfunction + +function! s:git_version_requirement(...) + if !exists('s:git_version') + let s:git_version = map(split(split(s:system(['git', '--version']))[2], '\.'), 'str2nr(v:val)') + endif + return s:version_requirement(s:git_version, a:000) +endfunction + +function! s:progress_opt(base) + return a:base && !s:is_win && + \ s:git_version_requirement(1, 7, 1) ? '--progress' : '' +endfunction + +function! s:rtp(spec) + return s:path(a:spec.dir . get(a:spec, 'rtp', '')) +endfunction + +if s:is_win + function! s:path(path) + return s:trim(substitute(a:path, '/', '\', 'g')) + endfunction + + function! s:dirpath(path) + return s:path(a:path) . '\' + endfunction + + function! s:is_local_plug(repo) + return a:repo =~? '^[a-z]:\|^[%~]' + endfunction + + " Copied from fzf + function! s:wrap_cmds(cmds) + let cmds = [ + \ '@echo off', + \ 'setlocal enabledelayedexpansion'] + \ + (type(a:cmds) == type([]) ? a:cmds : [a:cmds]) + \ + ['endlocal'] + if has('iconv') + if !exists('s:codepage') + let s:codepage = libcallnr('kernel32.dll', 'GetACP', 0) + endif + return map(cmds, printf('iconv(v:val."\r", "%s", "cp%d")', &encoding, s:codepage)) + endif + return map(cmds, 'v:val."\r"') + endfunction + + function! s:batchfile(cmd) + let batchfile = s:plug_tempname().'.bat' + call writefile(s:wrap_cmds(a:cmd), batchfile) + let cmd = plug#shellescape(batchfile, {'shell': &shell, 'script': 0}) + if s:is_powershell(&shell) + let cmd = '& ' . cmd + endif + return [batchfile, cmd] + endfunction +else + function! s:path(path) + return s:trim(a:path) + endfunction + + function! s:dirpath(path) + return substitute(a:path, '[/\\]*$', '/', '') + endfunction + + function! s:is_local_plug(repo) + return a:repo[0] =~ '[/$~]' + endfunction +endif + +function! s:err(msg) + echohl ErrorMsg + echom '[vim-plug] '.a:msg + echohl None +endfunction + +function! s:warn(cmd, msg) + echohl WarningMsg + execute a:cmd 'a:msg' + echohl None +endfunction + +function! s:esc(path) + return escape(a:path, ' ') +endfunction + +function! s:escrtp(path) + return escape(a:path, ' ,') +endfunction + +function! s:remove_rtp() + for name in s:loaded_names() + let rtp = s:rtp(g:plugs[name]) + execute 'set rtp-='.s:escrtp(rtp) + let after = globpath(rtp, 'after') + if isdirectory(after) + execute 'set rtp-='.s:escrtp(after) + endif + endfor +endfunction + +function! s:reorg_rtp() + if !empty(s:first_rtp) + execute 'set rtp-='.s:first_rtp + execute 'set rtp-='.s:last_rtp + endif + + " &rtp is modified from outside + if exists('s:prtp') && s:prtp !=# &rtp + call s:remove_rtp() + unlet! s:middle + endif + + let s:middle = get(s:, 'middle', &rtp) + let rtps = map(s:loaded_names(), 's:rtp(g:plugs[v:val])') + let afters = filter(map(copy(rtps), 'globpath(v:val, "after")'), '!empty(v:val)') + let rtp = join(map(rtps, 'escape(v:val, ",")'), ',') + \ . ','.s:middle.',' + \ . join(map(afters, 'escape(v:val, ",")'), ',') + let &rtp = substitute(substitute(rtp, ',,*', ',', 'g'), '^,\|,$', '', 'g') + let s:prtp = &rtp + + if !empty(s:first_rtp) + execute 'set rtp^='.s:first_rtp + execute 'set rtp+='.s:last_rtp + endif +endfunction + +function! s:doautocmd(...) + if exists('#'.join(a:000, '#')) + execute 'doautocmd' ((v:version > 703 || has('patch442')) ? '<nomodeline>' : '') join(a:000) + endif +endfunction + +function! s:dobufread(names) + for name in a:names + let path = s:rtp(g:plugs[name]) + for dir in ['ftdetect', 'ftplugin', 'after/ftdetect', 'after/ftplugin'] + if len(finddir(dir, path)) + if exists('#BufRead') + doautocmd BufRead + endif + return + endif + endfor + endfor +endfunction + +function! plug#load(...) + if a:0 == 0 + return s:err('Argument missing: plugin name(s) required') + endif + if !exists('g:plugs') + return s:err('plug#begin was not called') + endif + let names = a:0 == 1 && type(a:1) == s:TYPE.list ? a:1 : a:000 + let unknowns = filter(copy(names), '!has_key(g:plugs, v:val)') + if !empty(unknowns) + let s = len(unknowns) > 1 ? 's' : '' + return s:err(printf('Unknown plugin%s: %s', s, join(unknowns, ', '))) + end + let unloaded = filter(copy(names), '!get(s:loaded, v:val, 0)') + if !empty(unloaded) + for name in unloaded + call s:lod([name], ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) + endfor + call s:dobufread(unloaded) + return 1 + end + return 0 +endfunction + +function! s:remove_triggers(name) + if !has_key(s:triggers, a:name) + return + endif + for cmd in s:triggers[a:name].cmd + execute 'silent! delc' cmd + endfor + for map in s:triggers[a:name].map + execute 'silent! unmap' map + execute 'silent! iunmap' map + endfor + call remove(s:triggers, a:name) +endfunction + +function! s:lod(names, types, ...) + for name in a:names + call s:remove_triggers(name) + let s:loaded[name] = 1 + endfor + call s:reorg_rtp() + + for name in a:names + let rtp = s:rtp(g:plugs[name]) + for dir in a:types + call s:source(rtp, dir.'/**/*.vim') + endfor + if a:0 + if !s:source(rtp, a:1) && !empty(s:glob(rtp, a:2)) + execute 'runtime' a:1 + endif + call s:source(rtp, a:2) + endif + call s:doautocmd('User', name) + endfor +endfunction + +function! s:lod_ft(pat, names) + let syn = 'syntax/'.a:pat.'.vim' + call s:lod(a:names, ['plugin', 'after/plugin'], syn, 'after/'.syn) + execute 'autocmd! PlugLOD FileType' a:pat + call s:doautocmd('filetypeplugin', 'FileType') + call s:doautocmd('filetypeindent', 'FileType') +endfunction + +function! s:lod_cmd(cmd, bang, l1, l2, args, names) + call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) + call s:dobufread(a:names) + execute printf('%s%s%s %s', (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args) +endfunction + +function! s:lod_map(map, names, with_prefix, prefix) + call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) + call s:dobufread(a:names) + let extra = '' + while 1 + let c = getchar(0) + if c == 0 + break + endif + let extra .= nr2char(c) + endwhile + + if a:with_prefix + let prefix = v:count ? v:count : '' + let prefix .= '"'.v:register.a:prefix + if mode(1) == 'no' + if v:operator == 'c' + let prefix = "\<esc>" . prefix + endif + let prefix .= v:operator + endif + call feedkeys(prefix, 'n') + endif + call feedkeys(substitute(a:map, '^<Plug>', "\<Plug>", '') . extra) +endfunction + +function! plug#(repo, ...) + if a:0 > 1 + return s:err('Invalid number of arguments (1..2)') + endif + + try + let repo = s:trim(a:repo) + let opts = a:0 == 1 ? s:parse_options(a:1) : s:base_spec + let name = get(opts, 'as', s:plug_fnamemodify(repo, ':t:s?\.git$??')) + let spec = extend(s:infer_properties(name, repo), opts) + if !has_key(g:plugs, name) + call add(g:plugs_order, name) + endif + let g:plugs[name] = spec + let s:loaded[name] = get(s:loaded, name, 0) + catch + return s:err(repo . ' ' . v:exception) + endtry +endfunction + +function! s:parse_options(arg) + let opts = copy(s:base_spec) + let type = type(a:arg) + let opt_errfmt = 'Invalid argument for "%s" option of :Plug (expected: %s)' + if type == s:TYPE.string + if empty(a:arg) + throw printf(opt_errfmt, 'tag', 'string') + endif + let opts.tag = a:arg + elseif type == s:TYPE.dict + for opt in ['branch', 'tag', 'commit', 'rtp', 'dir', 'as'] + if has_key(a:arg, opt) + \ && (type(a:arg[opt]) != s:TYPE.string || empty(a:arg[opt])) + throw printf(opt_errfmt, opt, 'string') + endif + endfor + for opt in ['on', 'for'] + if has_key(a:arg, opt) + \ && type(a:arg[opt]) != s:TYPE.list + \ && (type(a:arg[opt]) != s:TYPE.string || empty(a:arg[opt])) + throw printf(opt_errfmt, opt, 'string or list') + endif + endfor + if has_key(a:arg, 'do') + \ && type(a:arg.do) != s:TYPE.funcref + \ && (type(a:arg.do) != s:TYPE.string || empty(a:arg.do)) + throw printf(opt_errfmt, 'do', 'string or funcref') + endif + call extend(opts, a:arg) + if has_key(opts, 'dir') + let opts.dir = s:dirpath(s:plug_expand(opts.dir)) + endif + else + throw 'Invalid argument type (expected: string or dictionary)' + endif + return opts +endfunction + +function! s:infer_properties(name, repo) + let repo = a:repo + if s:is_local_plug(repo) + return { 'dir': s:dirpath(s:plug_expand(repo)) } + else + if repo =~ ':' + let uri = repo + else + if repo !~ '/' + throw printf('Invalid argument: %s (implicit `vim-scripts'' expansion is deprecated)', repo) + endif + let fmt = get(g:, 'plug_url_format', 'https://git::@github.com/%s.git') + let uri = printf(fmt, repo) + endif + return { 'dir': s:dirpath(g:plug_home.'/'.a:name), 'uri': uri } + endif +endfunction + +function! s:install(force, names) + call s:update_impl(0, a:force, a:names) +endfunction + +function! s:update(force, names) + call s:update_impl(1, a:force, a:names) +endfunction + +function! plug#helptags() + if !exists('g:plugs') + return s:err('plug#begin was not called') + endif + for spec in values(g:plugs) + let docd = join([s:rtp(spec), 'doc'], '/') + if isdirectory(docd) + silent! execute 'helptags' s:esc(docd) + endif + endfor + return 1 +endfunction + +function! s:syntax() + syntax clear + syntax region plug1 start=/\%1l/ end=/\%2l/ contains=plugNumber + syntax region plug2 start=/\%2l/ end=/\%3l/ contains=plugBracket,plugX + syn match plugNumber /[0-9]\+[0-9.]*/ contained + syn match plugBracket /[[\]]/ contained + syn match plugX /x/ contained + syn match plugDash /^-\{1}\ / + syn match plugPlus /^+/ + syn match plugStar /^*/ + syn match plugMessage /\(^- \)\@<=.*/ + syn match plugName /\(^- \)\@<=[^ ]*:/ + syn match plugSha /\%(: \)\@<=[0-9a-f]\{4,}$/ + syn match plugTag /(tag: [^)]\+)/ + syn match plugInstall /\(^+ \)\@<=[^:]*/ + syn match plugUpdate /\(^* \)\@<=[^:]*/ + syn match plugCommit /^ \X*[0-9a-f]\{7,9} .*/ contains=plugRelDate,plugEdge,plugTag + syn match plugEdge /^ \X\+$/ + syn match plugEdge /^ \X*/ contained nextgroup=plugSha + syn match plugSha /[0-9a-f]\{7,9}/ contained + syn match plugRelDate /([^)]*)$/ contained + syn match plugNotLoaded /(not loaded)$/ + syn match plugError /^x.*/ + syn region plugDeleted start=/^\~ .*/ end=/^\ze\S/ + syn match plugH2 /^.*:\n-\+$/ + syn match plugH2 /^-\{2,}/ + syn keyword Function PlugInstall PlugStatus PlugUpdate PlugClean + hi def link plug1 Title + hi def link plug2 Repeat + hi def link plugH2 Type + hi def link plugX Exception + hi def link plugBracket Structure + hi def link plugNumber Number + + hi def link plugDash Special + hi def link plugPlus Constant + hi def link plugStar Boolean + + hi def link plugMessage Function + hi def link plugName Label + hi def link plugInstall Function + hi def link plugUpdate Type + + hi def link plugError Error + hi def link plugDeleted Ignore + hi def link plugRelDate Comment + hi def link plugEdge PreProc + hi def link plugSha Identifier + hi def link plugTag Constant + + hi def link plugNotLoaded Comment +endfunction + +function! s:lpad(str, len) + return a:str . repeat(' ', a:len - len(a:str)) +endfunction + +function! s:lines(msg) + return split(a:msg, "[\r\n]") +endfunction + +function! s:lastline(msg) + return get(s:lines(a:msg), -1, '') +endfunction + +function! s:new_window() + execute get(g:, 'plug_window', 'vertical topleft new') +endfunction + +function! s:plug_window_exists() + let buflist = tabpagebuflist(s:plug_tab) + return !empty(buflist) && index(buflist, s:plug_buf) >= 0 +endfunction + +function! s:switch_in() + if !s:plug_window_exists() + return 0 + endif + + if winbufnr(0) != s:plug_buf + let s:pos = [tabpagenr(), winnr(), winsaveview()] + execute 'normal!' s:plug_tab.'gt' + let winnr = bufwinnr(s:plug_buf) + execute winnr.'wincmd w' + call add(s:pos, winsaveview()) + else + let s:pos = [winsaveview()] + endif + + setlocal modifiable + return 1 +endfunction + +function! s:switch_out(...) + call winrestview(s:pos[-1]) + setlocal nomodifiable + if a:0 > 0 + execute a:1 + endif + + if len(s:pos) > 1 + execute 'normal!' s:pos[0].'gt' + execute s:pos[1] 'wincmd w' + call winrestview(s:pos[2]) + endif +endfunction + +function! s:finish_bindings() + nnoremap <silent> <buffer> R :call <SID>retry()<cr> + nnoremap <silent> <buffer> D :PlugDiff<cr> + nnoremap <silent> <buffer> S :PlugStatus<cr> + nnoremap <silent> <buffer> U :call <SID>status_update()<cr> + xnoremap <silent> <buffer> U :call <SID>status_update()<cr> + nnoremap <silent> <buffer> ]] :silent! call <SID>section('')<cr> + nnoremap <silent> <buffer> [[ :silent! call <SID>section('b')<cr> +endfunction + +function! s:prepare(...) + if empty(s:plug_getcwd()) + throw 'Invalid current working directory. Cannot proceed.' + endif + + for evar in ['$GIT_DIR', '$GIT_WORK_TREE'] + if exists(evar) + throw evar.' detected. Cannot proceed.' + endif + endfor + + call s:job_abort() + if s:switch_in() + if b:plug_preview == 1 + pc + endif + enew + else + call s:new_window() + endif + + nnoremap <silent> <buffer> q :call <SID>close_pane()<cr> + if a:0 == 0 + call s:finish_bindings() + endif + let b:plug_preview = -1 + let s:plug_tab = tabpagenr() + let s:plug_buf = winbufnr(0) + call s:assign_name() + + for k in ['<cr>', 'L', 'o', 'X', 'd', 'dd'] + execute 'silent! unmap <buffer>' k + endfor + setlocal buftype=nofile bufhidden=wipe nobuflisted nolist noswapfile nowrap cursorline modifiable nospell + if exists('+colorcolumn') + setlocal colorcolumn= + endif + setf vim-plug + if exists('g:syntax_on') + call s:syntax() + endif +endfunction + +function! s:close_pane() + if b:plug_preview == 1 + pc + let b:plug_preview = -1 + else + bd + endif +endfunction + +function! s:assign_name() + " Assign buffer name + let prefix = '[Plugins]' + let name = prefix + let idx = 2 + while bufexists(name) + let name = printf('%s (%s)', prefix, idx) + let idx = idx + 1 + endwhile + silent! execute 'f' fnameescape(name) +endfunction + +function! s:chsh(swap) + let prev = [&shell, &shellcmdflag, &shellredir] + if !s:is_win + set shell=sh + endif + if a:swap + if s:is_powershell(&shell) + let &shellredir = '2>&1 | Out-File -Encoding UTF8 %s' + elseif &shell =~# 'sh' || &shell =~# 'cmd\(\.exe\)\?$' + set shellredir=>%s\ 2>&1 + endif + endif + return prev +endfunction + +function! s:bang(cmd, ...) + let batchfile = '' + try + let [sh, shellcmdflag, shrd] = s:chsh(a:0) + " FIXME: Escaping is incomplete. We could use shellescape with eval, + " but it won't work on Windows. + let cmd = a:0 ? s:with_cd(a:cmd, a:1) : a:cmd + if s:is_win + let [batchfile, cmd] = s:batchfile(cmd) + endif + let g:_plug_bang = (s:is_win && has('gui_running') ? 'silent ' : '').'!'.escape(cmd, '#!%') + execute "normal! :execute g:_plug_bang\<cr>\<cr>" + finally + unlet g:_plug_bang + let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd] + if s:is_win && filereadable(batchfile) + call delete(batchfile) + endif + endtry + return v:shell_error ? 'Exit status: ' . v:shell_error : '' +endfunction + +function! s:regress_bar() + let bar = substitute(getline(2)[1:-2], '.*\zs=', 'x', '') + call s:progress_bar(2, bar, len(bar)) +endfunction + +function! s:is_updated(dir) + return !empty(s:system_chomp(['git', 'log', '--pretty=format:%h', 'HEAD...HEAD@{1}'], a:dir)) +endfunction + +function! s:do(pull, force, todo) + for [name, spec] in items(a:todo) + if !isdirectory(spec.dir) + continue + endif + let installed = has_key(s:update.new, name) + let updated = installed ? 0 : + \ (a:pull && index(s:update.errors, name) < 0 && s:is_updated(spec.dir)) + if a:force || installed || updated + execute 'cd' s:esc(spec.dir) + call append(3, '- Post-update hook for '. name .' ... ') + let error = '' + let type = type(spec.do) + if type == s:TYPE.string + if spec.do[0] == ':' + if !get(s:loaded, name, 0) + let s:loaded[name] = 1 + call s:reorg_rtp() + endif + call s:load_plugin(spec) + try + execute spec.do[1:] + catch + let error = v:exception + endtry + if !s:plug_window_exists() + cd - + throw 'Warning: vim-plug was terminated by the post-update hook of '.name + endif + else + let error = s:bang(spec.do) + endif + elseif type == s:TYPE.funcref + try + call s:load_plugin(spec) + let status = installed ? 'installed' : (updated ? 'updated' : 'unchanged') + call spec.do({ 'name': name, 'status': status, 'force': a:force }) + catch + let error = v:exception + endtry + else + let error = 'Invalid hook type' + endif + call s:switch_in() + call setline(4, empty(error) ? (getline(4) . 'OK') + \ : ('x' . getline(4)[1:] . error)) + if !empty(error) + call add(s:update.errors, name) + call s:regress_bar() + endif + cd - + endif + endfor +endfunction + +function! s:hash_match(a, b) + return stridx(a:a, a:b) == 0 || stridx(a:b, a:a) == 0 +endfunction + +function! s:checkout(spec) + let sha = a:spec.commit + let output = s:git_revision(a:spec.dir) + if !empty(output) && !s:hash_match(sha, s:lines(output)[0]) + let credential_helper = s:git_version_requirement(2) ? '-c credential.helper= ' : '' + let output = s:system( + \ 'git '.credential_helper.'fetch --depth 999999 && git checkout '.plug#shellescape(sha).' --', a:spec.dir) + endif + return output +endfunction + +function! s:finish(pull) + let new_frozen = len(filter(keys(s:update.new), 'g:plugs[v:val].frozen')) + if new_frozen + let s = new_frozen > 1 ? 's' : '' + call append(3, printf('- Installed %d frozen plugin%s', new_frozen, s)) + endif + call append(3, '- Finishing ... ') | 4 + redraw + call plug#helptags() + call plug#end() + call setline(4, getline(4) . 'Done!') + redraw + let msgs = [] + if !empty(s:update.errors) + call add(msgs, "Press 'R' to retry.") + endif + if a:pull && len(s:update.new) < len(filter(getline(5, '$'), + \ "v:val =~ '^- ' && v:val !~# 'Already up.to.date'")) + call add(msgs, "Press 'D' to see the updated changes.") + endif + echo join(msgs, ' ') + call s:finish_bindings() +endfunction + +function! s:retry() + if empty(s:update.errors) + return + endif + echo + call s:update_impl(s:update.pull, s:update.force, + \ extend(copy(s:update.errors), [s:update.threads])) +endfunction + +function! s:is_managed(name) + return has_key(g:plugs[a:name], 'uri') +endfunction + +function! s:names(...) + return sort(filter(keys(g:plugs), 'stridx(v:val, a:1) == 0 && s:is_managed(v:val)')) +endfunction + +function! s:check_ruby() + silent! ruby require 'thread'; VIM::command("let g:plug_ruby = '#{RUBY_VERSION}'") + if !exists('g:plug_ruby') + redraw! + return s:warn('echom', 'Warning: Ruby interface is broken') + endif + let ruby_version = split(g:plug_ruby, '\.') + unlet g:plug_ruby + return s:version_requirement(ruby_version, [1, 8, 7]) +endfunction + +function! s:update_impl(pull, force, args) abort + let sync = index(a:args, '--sync') >= 0 || has('vim_starting') + let args = filter(copy(a:args), 'v:val != "--sync"') + let threads = (len(args) > 0 && args[-1] =~ '^[1-9][0-9]*$') ? + \ remove(args, -1) : get(g:, 'plug_threads', 16) + + let managed = filter(copy(g:plugs), 's:is_managed(v:key)') + let todo = empty(args) ? filter(managed, '!v:val.frozen || !isdirectory(v:val.dir)') : + \ filter(managed, 'index(args, v:key) >= 0') + + if empty(todo) + return s:warn('echo', 'No plugin to '. (a:pull ? 'update' : 'install')) + endif + + if !s:is_win && s:git_version_requirement(2, 3) + let s:git_terminal_prompt = exists('$GIT_TERMINAL_PROMPT') ? $GIT_TERMINAL_PROMPT : '' + let $GIT_TERMINAL_PROMPT = 0 + for plug in values(todo) + let plug.uri = substitute(plug.uri, + \ '^https://git::@github\.com', 'https://github.com', '') + endfor + endif + + if !isdirectory(g:plug_home) + try + call mkdir(g:plug_home, 'p') + catch + return s:err(printf('Invalid plug directory: %s. '. + \ 'Try to call plug#begin with a valid directory', g:plug_home)) + endtry + endif + + if has('nvim') && !exists('*jobwait') && threads > 1 + call s:warn('echom', '[vim-plug] Update Neovim for parallel installer') + endif + + let use_job = s:nvim || s:vim8 + let python = (has('python') || has('python3')) && !use_job + let ruby = has('ruby') && !use_job && (v:version >= 703 || v:version == 702 && has('patch374')) && !(s:is_win && has('gui_running')) && threads > 1 && s:check_ruby() + + let s:update = { + \ 'start': reltime(), + \ 'all': todo, + \ 'todo': copy(todo), + \ 'errors': [], + \ 'pull': a:pull, + \ 'force': a:force, + \ 'new': {}, + \ 'threads': (python || ruby || use_job) ? min([len(todo), threads]) : 1, + \ 'bar': '', + \ 'fin': 0 + \ } + + call s:prepare(1) + call append(0, ['', '']) + normal! 2G + silent! redraw + + " Set remote name, overriding a possible user git config's clone.defaultRemoteName + let s:clone_opt = ['--origin', 'origin'] + if get(g:, 'plug_shallow', 1) + call extend(s:clone_opt, ['--depth', '1']) + if s:git_version_requirement(1, 7, 10) + call add(s:clone_opt, '--no-single-branch') + endif + endif + + if has('win32unix') || has('wsl') + call extend(s:clone_opt, ['-c', 'core.eol=lf', '-c', 'core.autocrlf=input']) + endif + + let s:submodule_opt = s:git_version_requirement(2, 8) ? ' --jobs='.threads : '' + + " Python version requirement (>= 2.7) + if python && !has('python3') && !ruby && !use_job && s:update.threads > 1 + redir => pyv + silent python import platform; print platform.python_version() + redir END + let python = s:version_requirement( + \ map(split(split(pyv)[0], '\.'), 'str2nr(v:val)'), [2, 6]) + endif + + if (python || ruby) && s:update.threads > 1 + try + let imd = &imd + if s:mac_gui + set noimd + endif + if ruby + call s:update_ruby() + else + call s:update_python() + endif + catch + let lines = getline(4, '$') + let printed = {} + silent! 4,$d _ + for line in lines + let name = s:extract_name(line, '.', '') + if empty(name) || !has_key(printed, name) + call append('$', line) + if !empty(name) + let printed[name] = 1 + if line[0] == 'x' && index(s:update.errors, name) < 0 + call add(s:update.errors, name) + end + endif + endif + endfor + finally + let &imd = imd + call s:update_finish() + endtry + else + call s:update_vim() + while use_job && sync + sleep 100m + if s:update.fin + break + endif + endwhile + endif +endfunction + +function! s:log4(name, msg) + call setline(4, printf('- %s (%s)', a:msg, a:name)) + redraw +endfunction + +function! s:update_finish() + if exists('s:git_terminal_prompt') + let $GIT_TERMINAL_PROMPT = s:git_terminal_prompt + endif + if s:switch_in() + call append(3, '- Updating ...') | 4 + for [name, spec] in items(filter(copy(s:update.all), 'index(s:update.errors, v:key) < 0 && (s:update.force || s:update.pull || has_key(s:update.new, v:key))')) + let [pos, _] = s:logpos(name) + if !pos + continue + endif + if has_key(spec, 'commit') + call s:log4(name, 'Checking out '.spec.commit) + let out = s:checkout(spec) + elseif has_key(spec, 'tag') + let tag = spec.tag + if tag =~ '\*' + let tags = s:lines(s:system('git tag --list '.plug#shellescape(tag).' --sort -version:refname 2>&1', spec.dir)) + if !v:shell_error && !empty(tags) + let tag = tags[0] + call s:log4(name, printf('Latest tag for %s -> %s', spec.tag, tag)) + call append(3, '') + endif + endif + call s:log4(name, 'Checking out '.tag) + let out = s:system('git checkout -q '.plug#shellescape(tag).' -- 2>&1', spec.dir) + else + let branch = s:git_origin_branch(spec) + call s:log4(name, 'Merging origin/'.s:esc(branch)) + let out = s:system('git checkout -q '.plug#shellescape(branch).' -- 2>&1' + \. (has_key(s:update.new, name) ? '' : ('&& git merge --ff-only '.plug#shellescape('origin/'.branch).' 2>&1')), spec.dir) + endif + if !v:shell_error && filereadable(spec.dir.'/.gitmodules') && + \ (s:update.force || has_key(s:update.new, name) || s:is_updated(spec.dir)) + call s:log4(name, 'Updating submodules. This may take a while.') + let out .= s:bang('git submodule update --init --recursive'.s:submodule_opt.' 2>&1', spec.dir) + endif + let msg = s:format_message(v:shell_error ? 'x': '-', name, out) + if v:shell_error + call add(s:update.errors, name) + call s:regress_bar() + silent execute pos 'd _' + call append(4, msg) | 4 + elseif !empty(out) + call setline(pos, msg[0]) + endif + redraw + endfor + silent 4 d _ + try + call s:do(s:update.pull, s:update.force, filter(copy(s:update.all), 'index(s:update.errors, v:key) < 0 && has_key(v:val, "do")')) + catch + call s:warn('echom', v:exception) + call s:warn('echo', '') + return + endtry + call s:finish(s:update.pull) + call setline(1, 'Updated. Elapsed time: ' . split(reltimestr(reltime(s:update.start)))[0] . ' sec.') + call s:switch_out('normal! gg') + endif +endfunction + +function! s:job_abort() + if (!s:nvim && !s:vim8) || !exists('s:jobs') + return + endif + + for [name, j] in items(s:jobs) + if s:nvim + silent! call jobstop(j.jobid) + elseif s:vim8 + silent! call job_stop(j.jobid) + endif + if j.new + call s:rm_rf(g:plugs[name].dir) + endif + endfor + let s:jobs = {} +endfunction + +function! s:last_non_empty_line(lines) + let len = len(a:lines) + for idx in range(len) + let line = a:lines[len-idx-1] + if !empty(line) + return line + endif + endfor + return '' +endfunction + +function! s:job_out_cb(self, data) abort + let self = a:self + let data = remove(self.lines, -1) . a:data + let lines = map(split(data, "\n", 1), 'split(v:val, "\r", 1)[-1]') + call extend(self.lines, lines) + " To reduce the number of buffer updates + let self.tick = get(self, 'tick', -1) + 1 + if !self.running || self.tick % len(s:jobs) == 0 + let bullet = self.running ? (self.new ? '+' : '*') : (self.error ? 'x' : '-') + let result = self.error ? join(self.lines, "\n") : s:last_non_empty_line(self.lines) + call s:log(bullet, self.name, result) + endif +endfunction + +function! s:job_exit_cb(self, data) abort + let a:self.running = 0 + let a:self.error = a:data != 0 + call s:reap(a:self.name) + call s:tick() +endfunction + +function! s:job_cb(fn, job, ch, data) + if !s:plug_window_exists() " plug window closed + return s:job_abort() + endif + call call(a:fn, [a:job, a:data]) +endfunction + +function! s:nvim_cb(job_id, data, event) dict abort + return (a:event == 'stdout' || a:event == 'stderr') ? + \ s:job_cb('s:job_out_cb', self, 0, join(a:data, "\n")) : + \ s:job_cb('s:job_exit_cb', self, 0, a:data) +endfunction + +function! s:spawn(name, cmd, opts) + let job = { 'name': a:name, 'running': 1, 'error': 0, 'lines': [''], + \ 'new': get(a:opts, 'new', 0) } + let s:jobs[a:name] = job + + if s:nvim + if has_key(a:opts, 'dir') + let job.cwd = a:opts.dir + endif + let argv = a:cmd + call extend(job, { + \ 'on_stdout': function('s:nvim_cb'), + \ 'on_stderr': function('s:nvim_cb'), + \ 'on_exit': function('s:nvim_cb'), + \ }) + let jid = s:plug_call('jobstart', argv, job) + if jid > 0 + let job.jobid = jid + else + let job.running = 0 + let job.error = 1 + let job.lines = [jid < 0 ? argv[0].' is not executable' : + \ 'Invalid arguments (or job table is full)'] + endif + elseif s:vim8 + let cmd = join(map(copy(a:cmd), 'plug#shellescape(v:val, {"script": 0})')) + if has_key(a:opts, 'dir') + let cmd = s:with_cd(cmd, a:opts.dir, 0) + endif + let argv = s:is_win ? ['cmd', '/s', '/c', '"'.cmd.'"'] : ['sh', '-c', cmd] + let jid = job_start(s:is_win ? join(argv, ' ') : argv, { + \ 'out_cb': function('s:job_cb', ['s:job_out_cb', job]), + \ 'err_cb': function('s:job_cb', ['s:job_out_cb', job]), + \ 'exit_cb': function('s:job_cb', ['s:job_exit_cb', job]), + \ 'err_mode': 'raw', + \ 'out_mode': 'raw' + \}) + if job_status(jid) == 'run' + let job.jobid = jid + else + let job.running = 0 + let job.error = 1 + let job.lines = ['Failed to start job'] + endif + else + let job.lines = s:lines(call('s:system', has_key(a:opts, 'dir') ? [a:cmd, a:opts.dir] : [a:cmd])) + let job.error = v:shell_error != 0 + let job.running = 0 + endif +endfunction + +function! s:reap(name) + let job = s:jobs[a:name] + if job.error + call add(s:update.errors, a:name) + elseif get(job, 'new', 0) + let s:update.new[a:name] = 1 + endif + let s:update.bar .= job.error ? 'x' : '=' + + let bullet = job.error ? 'x' : '-' + let result = job.error ? join(job.lines, "\n") : s:last_non_empty_line(job.lines) + call s:log(bullet, a:name, empty(result) ? 'OK' : result) + call s:bar() + + call remove(s:jobs, a:name) +endfunction + +function! s:bar() + if s:switch_in() + let total = len(s:update.all) + call setline(1, (s:update.pull ? 'Updating' : 'Installing'). + \ ' plugins ('.len(s:update.bar).'/'.total.')') + call s:progress_bar(2, s:update.bar, total) + call s:switch_out() + endif +endfunction + +function! s:logpos(name) + let max = line('$') + for i in range(4, max > 4 ? max : 4) + if getline(i) =~# '^[-+x*] '.a:name.':' + for j in range(i + 1, max > 5 ? max : 5) + if getline(j) !~ '^ ' + return [i, j - 1] + endif + endfor + return [i, i] + endif + endfor + return [0, 0] +endfunction + +function! s:log(bullet, name, lines) + if s:switch_in() + let [b, e] = s:logpos(a:name) + if b > 0 + silent execute printf('%d,%d d _', b, e) + if b > winheight('.') + let b = 4 + endif + else + let b = 4 + endif + " FIXME For some reason, nomodifiable is set after :d in vim8 + setlocal modifiable + call append(b - 1, s:format_message(a:bullet, a:name, a:lines)) + call s:switch_out() + endif +endfunction + +function! s:update_vim() + let s:jobs = {} + + call s:bar() + call s:tick() +endfunction + +function! s:tick() + let pull = s:update.pull + let prog = s:progress_opt(s:nvim || s:vim8) +while 1 " Without TCO, Vim stack is bound to explode + if empty(s:update.todo) + if empty(s:jobs) && !s:update.fin + call s:update_finish() + let s:update.fin = 1 + endif + return + endif + + let name = keys(s:update.todo)[0] + let spec = remove(s:update.todo, name) + let new = empty(globpath(spec.dir, '.git', 1)) + + call s:log(new ? '+' : '*', name, pull ? 'Updating ...' : 'Installing ...') + redraw + + let has_tag = has_key(spec, 'tag') + if !new + let [error, _] = s:git_validate(spec, 0) + if empty(error) + if pull + let cmd = s:git_version_requirement(2) ? ['git', '-c', 'credential.helper=', 'fetch'] : ['git', 'fetch'] + if has_tag && !empty(globpath(spec.dir, '.git/shallow')) + call extend(cmd, ['--depth', '99999999']) + endif + if !empty(prog) + call add(cmd, prog) + endif + call s:spawn(name, cmd, { 'dir': spec.dir }) + else + let s:jobs[name] = { 'running': 0, 'lines': ['Already installed'], 'error': 0 } + endif + else + let s:jobs[name] = { 'running': 0, 'lines': s:lines(error), 'error': 1 } + endif + else + let cmd = ['git', 'clone'] + if !has_tag + call extend(cmd, s:clone_opt) + endif + if !empty(prog) + call add(cmd, prog) + endif + call s:spawn(name, extend(cmd, [spec.uri, s:trim(spec.dir)]), { 'new': 1 }) + endif + + if !s:jobs[name].running + call s:reap(name) + endif + if len(s:jobs) >= s:update.threads + break + endif +endwhile +endfunction + +function! s:update_python() +let py_exe = has('python') ? 'python' : 'python3' +execute py_exe "<< EOF" +import datetime +import functools +import os +try: + import queue +except ImportError: + import Queue as queue +import random +import re +import shutil +import signal +import subprocess +import tempfile +import threading as thr +import time +import traceback +import vim + +G_NVIM = vim.eval("has('nvim')") == '1' +G_PULL = vim.eval('s:update.pull') == '1' +G_RETRIES = int(vim.eval('get(g:, "plug_retries", 2)')) + 1 +G_TIMEOUT = int(vim.eval('get(g:, "plug_timeout", 60)')) +G_CLONE_OPT = ' '.join(vim.eval('s:clone_opt')) +G_PROGRESS = vim.eval('s:progress_opt(1)') +G_LOG_PROB = 1.0 / int(vim.eval('s:update.threads')) +G_STOP = thr.Event() +G_IS_WIN = vim.eval('s:is_win') == '1' + +class PlugError(Exception): + def __init__(self, msg): + self.msg = msg +class CmdTimedOut(PlugError): + pass +class CmdFailed(PlugError): + pass +class InvalidURI(PlugError): + pass +class Action(object): + INSTALL, UPDATE, ERROR, DONE = ['+', '*', 'x', '-'] + +class Buffer(object): + def __init__(self, lock, num_plugs, is_pull): + self.bar = '' + self.event = 'Updating' if is_pull else 'Installing' + self.lock = lock + self.maxy = int(vim.eval('winheight(".")')) + self.num_plugs = num_plugs + + def __where(self, name): + """ Find first line with name in current buffer. Return line num. """ + found, lnum = False, 0 + matcher = re.compile('^[-+x*] {0}:'.format(name)) + for line in vim.current.buffer: + if matcher.search(line) is not None: + found = True + break + lnum += 1 + + if not found: + lnum = -1 + return lnum + + def header(self): + curbuf = vim.current.buffer + curbuf[0] = self.event + ' plugins ({0}/{1})'.format(len(self.bar), self.num_plugs) + + num_spaces = self.num_plugs - len(self.bar) + curbuf[1] = '[{0}{1}]'.format(self.bar, num_spaces * ' ') + + with self.lock: + vim.command('normal! 2G') + vim.command('redraw') + + def write(self, action, name, lines): + first, rest = lines[0], lines[1:] + msg = ['{0} {1}{2}{3}'.format(action, name, ': ' if first else '', first)] + msg.extend([' ' + line for line in rest]) + + try: + if action == Action.ERROR: + self.bar += 'x' + vim.command("call add(s:update.errors, '{0}')".format(name)) + elif action == Action.DONE: + self.bar += '=' + + curbuf = vim.current.buffer + lnum = self.__where(name) + if lnum != -1: # Found matching line num + del curbuf[lnum] + if lnum > self.maxy and action in set([Action.INSTALL, Action.UPDATE]): + lnum = 3 + else: + lnum = 3 + curbuf.append(msg, lnum) + + self.header() + except vim.error: + pass + +class Command(object): + CD = 'cd /d' if G_IS_WIN else 'cd' + + def __init__(self, cmd, cmd_dir=None, timeout=60, cb=None, clean=None): + self.cmd = cmd + if cmd_dir: + self.cmd = '{0} {1} && {2}'.format(Command.CD, cmd_dir, self.cmd) + self.timeout = timeout + self.callback = cb if cb else (lambda msg: None) + self.clean = clean if clean else (lambda: None) + self.proc = None + + @property + def alive(self): + """ Returns true only if command still running. """ + return self.proc and self.proc.poll() is None + + def execute(self, ntries=3): + """ Execute the command with ntries if CmdTimedOut. + Returns the output of the command if no Exception. + """ + attempt, finished, limit = 0, False, self.timeout + + while not finished: + try: + attempt += 1 + result = self.try_command() + finished = True + return result + except CmdTimedOut: + if attempt != ntries: + self.notify_retry() + self.timeout += limit + else: + raise + + def notify_retry(self): + """ Retry required for command, notify user. """ + for count in range(3, 0, -1): + if G_STOP.is_set(): + raise KeyboardInterrupt + msg = 'Timeout. Will retry in {0} second{1} ...'.format( + count, 's' if count != 1 else '') + self.callback([msg]) + time.sleep(1) + self.callback(['Retrying ...']) + + def try_command(self): + """ Execute a cmd & poll for callback. Returns list of output. + Raises CmdFailed -> return code for Popen isn't 0 + Raises CmdTimedOut -> command exceeded timeout without new output + """ + first_line = True + + try: + tfile = tempfile.NamedTemporaryFile(mode='w+b') + preexec_fn = not G_IS_WIN and os.setsid or None + self.proc = subprocess.Popen(self.cmd, stdout=tfile, + stderr=subprocess.STDOUT, + stdin=subprocess.PIPE, shell=True, + preexec_fn=preexec_fn) + thrd = thr.Thread(target=(lambda proc: proc.wait()), args=(self.proc,)) + thrd.start() + + thread_not_started = True + while thread_not_started: + try: + thrd.join(0.1) + thread_not_started = False + except RuntimeError: + pass + + while self.alive: + if G_STOP.is_set(): + raise KeyboardInterrupt + + if first_line or random.random() < G_LOG_PROB: + first_line = False + line = '' if G_IS_WIN else nonblock_read(tfile.name) + if line: + self.callback([line]) + + time_diff = time.time() - os.path.getmtime(tfile.name) + if time_diff > self.timeout: + raise CmdTimedOut(['Timeout!']) + + thrd.join(0.5) + + tfile.seek(0) + result = [line.decode('utf-8', 'replace').rstrip() for line in tfile] + + if self.proc.returncode != 0: + raise CmdFailed([''] + result) + + return result + except: + self.terminate() + raise + + def terminate(self): + """ Terminate process and cleanup. """ + if self.alive: + if G_IS_WIN: + os.kill(self.proc.pid, signal.SIGINT) + else: + os.killpg(self.proc.pid, signal.SIGTERM) + self.clean() + +class Plugin(object): + def __init__(self, name, args, buf_q, lock): + self.name = name + self.args = args + self.buf_q = buf_q + self.lock = lock + self.tag = args.get('tag', 0) + + def manage(self): + try: + if os.path.exists(self.args['dir']): + self.update() + else: + self.install() + with self.lock: + thread_vim_command("let s:update.new['{0}'] = 1".format(self.name)) + except PlugError as exc: + self.write(Action.ERROR, self.name, exc.msg) + except KeyboardInterrupt: + G_STOP.set() + self.write(Action.ERROR, self.name, ['Interrupted!']) + except: + # Any exception except those above print stack trace + msg = 'Trace:\n{0}'.format(traceback.format_exc().rstrip()) + self.write(Action.ERROR, self.name, msg.split('\n')) + raise + + def install(self): + target = self.args['dir'] + if target[-1] == '\\': + target = target[0:-1] + + def clean(target): + def _clean(): + try: + shutil.rmtree(target) + except OSError: + pass + return _clean + + self.write(Action.INSTALL, self.name, ['Installing ...']) + callback = functools.partial(self.write, Action.INSTALL, self.name) + cmd = 'git clone {0} {1} {2} {3} 2>&1'.format( + '' if self.tag else G_CLONE_OPT, G_PROGRESS, self.args['uri'], + esc(target)) + com = Command(cmd, None, G_TIMEOUT, callback, clean(target)) + result = com.execute(G_RETRIES) + self.write(Action.DONE, self.name, result[-1:]) + + def repo_uri(self): + cmd = 'git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url' + command = Command(cmd, self.args['dir'], G_TIMEOUT,) + result = command.execute(G_RETRIES) + return result[-1] + + def update(self): + actual_uri = self.repo_uri() + expect_uri = self.args['uri'] + regex = re.compile(r'^(?:\w+://)?(?:[^@/]*@)?([^:/]*(?::[0-9]*)?)[:/](.*?)(?:\.git)?/?$') + ma = regex.match(actual_uri) + mb = regex.match(expect_uri) + if ma is None or mb is None or ma.groups() != mb.groups(): + msg = ['', + 'Invalid URI: {0}'.format(actual_uri), + 'Expected {0}'.format(expect_uri), + 'PlugClean required.'] + raise InvalidURI(msg) + + if G_PULL: + self.write(Action.UPDATE, self.name, ['Updating ...']) + callback = functools.partial(self.write, Action.UPDATE, self.name) + fetch_opt = '--depth 99999999' if self.tag and os.path.isfile(os.path.join(self.args['dir'], '.git/shallow')) else '' + cmd = 'git fetch {0} {1} 2>&1'.format(fetch_opt, G_PROGRESS) + com = Command(cmd, self.args['dir'], G_TIMEOUT, callback) + result = com.execute(G_RETRIES) + self.write(Action.DONE, self.name, result[-1:]) + else: + self.write(Action.DONE, self.name, ['Already installed']) + + def write(self, action, name, msg): + self.buf_q.put((action, name, msg)) + +class PlugThread(thr.Thread): + def __init__(self, tname, args): + super(PlugThread, self).__init__() + self.tname = tname + self.args = args + + def run(self): + thr.current_thread().name = self.tname + buf_q, work_q, lock = self.args + + try: + while not G_STOP.is_set(): + name, args = work_q.get_nowait() + plug = Plugin(name, args, buf_q, lock) + plug.manage() + work_q.task_done() + except queue.Empty: + pass + +class RefreshThread(thr.Thread): + def __init__(self, lock): + super(RefreshThread, self).__init__() + self.lock = lock + self.running = True + + def run(self): + while self.running: + with self.lock: + thread_vim_command('noautocmd normal! a') + time.sleep(0.33) + + def stop(self): + self.running = False + +if G_NVIM: + def thread_vim_command(cmd): + vim.session.threadsafe_call(lambda: vim.command(cmd)) +else: + def thread_vim_command(cmd): + vim.command(cmd) + +def esc(name): + return '"' + name.replace('"', '\"') + '"' + +def nonblock_read(fname): + """ Read a file with nonblock flag. Return the last line. """ + fread = os.open(fname, os.O_RDONLY | os.O_NONBLOCK) + buf = os.read(fread, 100000).decode('utf-8', 'replace') + os.close(fread) + + line = buf.rstrip('\r\n') + left = max(line.rfind('\r'), line.rfind('\n')) + if left != -1: + left += 1 + line = line[left:] + + return line + +def main(): + thr.current_thread().name = 'main' + nthreads = int(vim.eval('s:update.threads')) + plugs = vim.eval('s:update.todo') + mac_gui = vim.eval('s:mac_gui') == '1' + + lock = thr.Lock() + buf = Buffer(lock, len(plugs), G_PULL) + buf_q, work_q = queue.Queue(), queue.Queue() + for work in plugs.items(): + work_q.put(work) + + start_cnt = thr.active_count() + for num in range(nthreads): + tname = 'PlugT-{0:02}'.format(num) + thread = PlugThread(tname, (buf_q, work_q, lock)) + thread.start() + if mac_gui: + rthread = RefreshThread(lock) + rthread.start() + + while not buf_q.empty() or thr.active_count() != start_cnt: + try: + action, name, msg = buf_q.get(True, 0.25) + buf.write(action, name, ['OK'] if not msg else msg) + buf_q.task_done() + except queue.Empty: + pass + except KeyboardInterrupt: + G_STOP.set() + + if mac_gui: + rthread.stop() + rthread.join() + +main() +EOF +endfunction + +function! s:update_ruby() + ruby << EOF + module PlugStream + SEP = ["\r", "\n", nil] + def get_line + buffer = '' + loop do + char = readchar rescue return + if SEP.include? char.chr + buffer << $/ + break + else + buffer << char + end + end + buffer + end + end unless defined?(PlugStream) + + def esc arg + %["#{arg.gsub('"', '\"')}"] + end + + def killall pid + pids = [pid] + if /mswin|mingw|bccwin/ =~ RUBY_PLATFORM + pids.each { |pid| Process.kill 'INT', pid.to_i rescue nil } + else + unless `which pgrep 2> /dev/null`.empty? + children = pids + until children.empty? + children = children.map { |pid| + `pgrep -P #{pid}`.lines.map { |l| l.chomp } + }.flatten + pids += children + end + end + pids.each { |pid| Process.kill 'TERM', pid.to_i rescue nil } + end + end + + def compare_git_uri a, b + regex = %r{^(?:\w+://)?(?:[^@/]*@)?([^:/]*(?::[0-9]*)?)[:/](.*?)(?:\.git)?/?$} + regex.match(a).to_a.drop(1) == regex.match(b).to_a.drop(1) + end + + require 'thread' + require 'fileutils' + require 'timeout' + running = true + iswin = VIM::evaluate('s:is_win').to_i == 1 + pull = VIM::evaluate('s:update.pull').to_i == 1 + base = VIM::evaluate('g:plug_home') + all = VIM::evaluate('s:update.todo') + limit = VIM::evaluate('get(g:, "plug_timeout", 60)') + tries = VIM::evaluate('get(g:, "plug_retries", 2)') + 1 + nthr = VIM::evaluate('s:update.threads').to_i + maxy = VIM::evaluate('winheight(".")').to_i + vim7 = VIM::evaluate('v:version').to_i <= 703 && RUBY_PLATFORM =~ /darwin/ + cd = iswin ? 'cd /d' : 'cd' + tot = VIM::evaluate('len(s:update.todo)') || 0 + bar = '' + skip = 'Already installed' + mtx = Mutex.new + take1 = proc { mtx.synchronize { running && all.shift } } + logh = proc { + cnt = bar.length + $curbuf[1] = "#{pull ? 'Updating' : 'Installing'} plugins (#{cnt}/#{tot})" + $curbuf[2] = '[' + bar.ljust(tot) + ']' + VIM::command('normal! 2G') + VIM::command('redraw') + } + where = proc { |name| (1..($curbuf.length)).find { |l| $curbuf[l] =~ /^[-+x*] #{name}:/ } } + log = proc { |name, result, type| + mtx.synchronize do + ing = ![true, false].include?(type) + bar += type ? '=' : 'x' unless ing + b = case type + when :install then '+' when :update then '*' + when true, nil then '-' else + VIM::command("call add(s:update.errors, '#{name}')") + 'x' + end + result = + if type || type.nil? + ["#{b} #{name}: #{result.lines.to_a.last || 'OK'}"] + elsif result =~ /^Interrupted|^Timeout/ + ["#{b} #{name}: #{result}"] + else + ["#{b} #{name}"] + result.lines.map { |l| " " << l } + end + if lnum = where.call(name) + $curbuf.delete lnum + lnum = 4 if ing && lnum > maxy + end + result.each_with_index do |line, offset| + $curbuf.append((lnum || 4) - 1 + offset, line.gsub(/\e\[./, '').chomp) + end + logh.call + end + } + bt = proc { |cmd, name, type, cleanup| + tried = timeout = 0 + begin + tried += 1 + timeout += limit + fd = nil + data = '' + if iswin + Timeout::timeout(timeout) do + tmp = VIM::evaluate('tempname()') + system("(#{cmd}) > #{tmp}") + data = File.read(tmp).chomp + File.unlink tmp rescue nil + end + else + fd = IO.popen(cmd).extend(PlugStream) + first_line = true + log_prob = 1.0 / nthr + while line = Timeout::timeout(timeout) { fd.get_line } + data << line + log.call name, line.chomp, type if name && (first_line || rand < log_prob) + first_line = false + end + fd.close + end + [$? == 0, data.chomp] + rescue Timeout::Error, Interrupt => e + if fd && !fd.closed? + killall fd.pid + fd.close + end + cleanup.call if cleanup + if e.is_a?(Timeout::Error) && tried < tries + 3.downto(1) do |countdown| + s = countdown > 1 ? 's' : '' + log.call name, "Timeout. Will retry in #{countdown} second#{s} ...", type + sleep 1 + end + log.call name, 'Retrying ...', type + retry + end + [false, e.is_a?(Interrupt) ? "Interrupted!" : "Timeout!"] + end + } + main = Thread.current + threads = [] + watcher = Thread.new { + if vim7 + while VIM::evaluate('getchar(1)') + sleep 0.1 + end + else + require 'io/console' # >= Ruby 1.9 + nil until IO.console.getch == 3.chr + end + mtx.synchronize do + running = false + threads.each { |t| t.raise Interrupt } unless vim7 + end + threads.each { |t| t.join rescue nil } + main.kill + } + refresh = Thread.new { + while true + mtx.synchronize do + break unless running + VIM::command('noautocmd normal! a') + end + sleep 0.2 + end + } if VIM::evaluate('s:mac_gui') == 1 + + clone_opt = VIM::evaluate('s:clone_opt').join(' ') + progress = VIM::evaluate('s:progress_opt(1)') + nthr.times do + mtx.synchronize do + threads << Thread.new { + while pair = take1.call + name = pair.first + dir, uri, tag = pair.last.values_at *%w[dir uri tag] + exists = File.directory? dir + ok, result = + if exists + chdir = "#{cd} #{iswin ? dir : esc(dir)}" + ret, data = bt.call "#{chdir} && git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url", nil, nil, nil + current_uri = data.lines.to_a.last + if !ret + if data =~ /^Interrupted|^Timeout/ + [false, data] + else + [false, [data.chomp, "PlugClean required."].join($/)] + end + elsif !compare_git_uri(current_uri, uri) + [false, ["Invalid URI: #{current_uri}", + "Expected: #{uri}", + "PlugClean required."].join($/)] + else + if pull + log.call name, 'Updating ...', :update + fetch_opt = (tag && File.exist?(File.join(dir, '.git/shallow'))) ? '--depth 99999999' : '' + bt.call "#{chdir} && git fetch #{fetch_opt} #{progress} 2>&1", name, :update, nil + else + [true, skip] + end + end + else + d = esc dir.sub(%r{[\\/]+$}, '') + log.call name, 'Installing ...', :install + bt.call "git clone #{clone_opt unless tag} #{progress} #{uri} #{d} 2>&1", name, :install, proc { + FileUtils.rm_rf dir + } + end + mtx.synchronize { VIM::command("let s:update.new['#{name}'] = 1") } if !exists && ok + log.call name, result, ok + end + } if running + end + end + threads.each { |t| t.join rescue nil } + logh.call + refresh.kill if refresh + watcher.kill +EOF +endfunction + +function! s:shellesc_cmd(arg, script) + let escaped = substitute('"'.a:arg.'"', '[&|<>()@^!"]', '^&', 'g') + return substitute(escaped, '%', (a:script ? '%' : '^') . '&', 'g') +endfunction + +function! s:shellesc_ps1(arg) + return "'".substitute(escape(a:arg, '\"'), "'", "''", 'g')."'" +endfunction + +function! s:shellesc_sh(arg) + return "'".substitute(a:arg, "'", "'\\\\''", 'g')."'" +endfunction + +" Escape the shell argument based on the shell. +" Vim and Neovim's shellescape() are insufficient. +" 1. shellslash determines whether to use single/double quotes. +" Double-quote escaping is fragile for cmd.exe. +" 2. It does not work for powershell. +" 3. It does not work for *sh shells if the command is executed +" via cmd.exe (ie. cmd.exe /c sh -c command command_args) +" 4. It does not support batchfile syntax. +" +" Accepts an optional dictionary with the following keys: +" - shell: same as Vim/Neovim 'shell' option. +" If unset, fallback to 'cmd.exe' on Windows or 'sh'. +" - script: If truthy and shell is cmd.exe, escape for batchfile syntax. +function! plug#shellescape(arg, ...) + if a:arg =~# '^[A-Za-z0-9_/:.-]\+$' + return a:arg + endif + let opts = a:0 > 0 && type(a:1) == s:TYPE.dict ? a:1 : {} + let shell = get(opts, 'shell', s:is_win ? 'cmd.exe' : 'sh') + let script = get(opts, 'script', 1) + if shell =~# 'cmd\(\.exe\)\?$' + return s:shellesc_cmd(a:arg, script) + elseif s:is_powershell(shell) + return s:shellesc_ps1(a:arg) + endif + return s:shellesc_sh(a:arg) +endfunction + +function! s:glob_dir(path) + return map(filter(s:glob(a:path, '**'), 'isdirectory(v:val)'), 's:dirpath(v:val)') +endfunction + +function! s:progress_bar(line, bar, total) + call setline(a:line, '[' . s:lpad(a:bar, a:total) . ']') +endfunction + +function! s:compare_git_uri(a, b) + " See `git help clone' + " https:// [user@] github.com[:port] / junegunn/vim-plug [.git] + " [git@] github.com[:port] : junegunn/vim-plug [.git] + " file:// / junegunn/vim-plug [/] + " / junegunn/vim-plug [/] + let pat = '^\%(\w\+://\)\='.'\%([^@/]*@\)\='.'\([^:/]*\%(:[0-9]*\)\=\)'.'[:/]'.'\(.\{-}\)'.'\%(\.git\)\=/\?$' + let ma = matchlist(a:a, pat) + let mb = matchlist(a:b, pat) + return ma[1:2] ==# mb[1:2] +endfunction + +function! s:format_message(bullet, name, message) + if a:bullet != 'x' + return [printf('%s %s: %s', a:bullet, a:name, s:lastline(a:message))] + else + let lines = map(s:lines(a:message), '" ".v:val') + return extend([printf('x %s:', a:name)], lines) + endif +endfunction + +function! s:with_cd(cmd, dir, ...) + let script = a:0 > 0 ? a:1 : 1 + return printf('cd%s %s && %s', s:is_win ? ' /d' : '', plug#shellescape(a:dir, {'script': script}), a:cmd) +endfunction + +function! s:system(cmd, ...) + let batchfile = '' + try + let [sh, shellcmdflag, shrd] = s:chsh(1) + if type(a:cmd) == s:TYPE.list + " Neovim's system() supports list argument to bypass the shell + " but it cannot set the working directory for the command. + " Assume that the command does not rely on the shell. + if has('nvim') && a:0 == 0 + return system(a:cmd) + endif + let cmd = join(map(copy(a:cmd), 'plug#shellescape(v:val, {"shell": &shell, "script": 0})')) + if s:is_powershell(&shell) + let cmd = '& ' . cmd + endif + else + let cmd = a:cmd + endif + if a:0 > 0 + let cmd = s:with_cd(cmd, a:1, type(a:cmd) != s:TYPE.list) + endif + if s:is_win && type(a:cmd) != s:TYPE.list + let [batchfile, cmd] = s:batchfile(cmd) + endif + return system(cmd) + finally + let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd] + if s:is_win && filereadable(batchfile) + call delete(batchfile) + endif + endtry +endfunction + +function! s:system_chomp(...) + let ret = call('s:system', a:000) + return v:shell_error ? '' : substitute(ret, '\n$', '', '') +endfunction + +function! s:git_validate(spec, check_branch) + let err = '' + if isdirectory(a:spec.dir) + let result = [s:git_local_branch(a:spec.dir), s:git_origin_url(a:spec.dir)] + let remote = result[-1] + if empty(remote) + let err = join([remote, 'PlugClean required.'], "\n") + elseif !s:compare_git_uri(remote, a:spec.uri) + let err = join(['Invalid URI: '.remote, + \ 'Expected: '.a:spec.uri, + \ 'PlugClean required.'], "\n") + elseif a:check_branch && has_key(a:spec, 'commit') + let sha = s:git_revision(a:spec.dir) + if empty(sha) + let err = join(add(result, 'PlugClean required.'), "\n") + elseif !s:hash_match(sha, a:spec.commit) + let err = join([printf('Invalid HEAD (expected: %s, actual: %s)', + \ a:spec.commit[:6], sha[:6]), + \ 'PlugUpdate required.'], "\n") + endif + elseif a:check_branch + let current_branch = result[0] + " Check tag + let origin_branch = s:git_origin_branch(a:spec) + if has_key(a:spec, 'tag') + let tag = s:system_chomp('git describe --exact-match --tags HEAD 2>&1', a:spec.dir) + if a:spec.tag !=# tag && a:spec.tag !~ '\*' + let err = printf('Invalid tag: %s (expected: %s). Try PlugUpdate.', + \ (empty(tag) ? 'N/A' : tag), a:spec.tag) + endif + " Check branch + elseif origin_branch !=# current_branch + let err = printf('Invalid branch: %s (expected: %s). Try PlugUpdate.', + \ current_branch, origin_branch) + endif + if empty(err) + let [ahead, behind] = split(s:lastline(s:system([ + \ 'git', 'rev-list', '--count', '--left-right', + \ printf('HEAD...origin/%s', origin_branch) + \ ], a:spec.dir)), '\t') + if !v:shell_error && ahead + if behind + " Only mention PlugClean if diverged, otherwise it's likely to be + " pushable (and probably not that messed up). + let err = printf( + \ "Diverged from origin/%s (%d commit(s) ahead and %d commit(s) behind!\n" + \ .'Backup local changes and run PlugClean and PlugUpdate to reinstall it.', origin_branch, ahead, behind) + else + let err = printf("Ahead of origin/%s by %d commit(s).\n" + \ .'Cannot update until local changes are pushed.', + \ origin_branch, ahead) + endif + endif + endif + endif + else + let err = 'Not found' + endif + return [err, err =~# 'PlugClean'] +endfunction + +function! s:rm_rf(dir) + if isdirectory(a:dir) + return s:system(s:is_win + \ ? 'rmdir /S /Q '.plug#shellescape(a:dir) + \ : ['rm', '-rf', a:dir]) + endif +endfunction + +function! s:clean(force) + call s:prepare() + call append(0, 'Searching for invalid plugins in '.g:plug_home) + call append(1, '') + + " List of valid directories + let dirs = [] + let errs = {} + let [cnt, total] = [0, len(g:plugs)] + for [name, spec] in items(g:plugs) + if !s:is_managed(name) + call add(dirs, spec.dir) + else + let [err, clean] = s:git_validate(spec, 1) + if clean + let errs[spec.dir] = s:lines(err)[0] + else + call add(dirs, spec.dir) + endif + endif + let cnt += 1 + call s:progress_bar(2, repeat('=', cnt), total) + normal! 2G + redraw + endfor + + let allowed = {} + for dir in dirs + let allowed[s:dirpath(s:plug_fnamemodify(dir, ':h:h'))] = 1 + let allowed[dir] = 1 + for child in s:glob_dir(dir) + let allowed[child] = 1 + endfor + endfor + + let todo = [] + let found = sort(s:glob_dir(g:plug_home)) + while !empty(found) + let f = remove(found, 0) + if !has_key(allowed, f) && isdirectory(f) + call add(todo, f) + call append(line('$'), '- ' . f) + if has_key(errs, f) + call append(line('$'), ' ' . errs[f]) + endif + let found = filter(found, 'stridx(v:val, f) != 0') + end + endwhile + + 4 + redraw + if empty(todo) + call append(line('$'), 'Already clean.') + else + let s:clean_count = 0 + call append(3, ['Directories to delete:', '']) + redraw! + if a:force || s:ask_no_interrupt('Delete all directories?') + call s:delete([6, line('$')], 1) + else + call setline(4, 'Cancelled.') + nnoremap <silent> <buffer> d :set opfunc=<sid>delete_op<cr>g@ + nmap <silent> <buffer> dd d_ + xnoremap <silent> <buffer> d :<c-u>call <sid>delete_op(visualmode(), 1)<cr> + echo 'Delete the lines (d{motion}) to delete the corresponding directories' + endif + endif + 4 + setlocal nomodifiable +endfunction + +function! s:delete_op(type, ...) + call s:delete(a:0 ? [line("'<"), line("'>")] : [line("'["), line("']")], 0) +endfunction + +function! s:delete(range, force) + let [l1, l2] = a:range + let force = a:force + let err_count = 0 + while l1 <= l2 + let line = getline(l1) + if line =~ '^- ' && isdirectory(line[2:]) + execute l1 + redraw! + let answer = force ? 1 : s:ask('Delete '.line[2:].'?', 1) + let force = force || answer > 1 + if answer + let err = s:rm_rf(line[2:]) + setlocal modifiable + if empty(err) + call setline(l1, '~'.line[1:]) + let s:clean_count += 1 + else + delete _ + call append(l1 - 1, s:format_message('x', line[1:], err)) + let l2 += len(s:lines(err)) + let err_count += 1 + endif + let msg = printf('Removed %d directories.', s:clean_count) + if err_count > 0 + let msg .= printf(' Failed to remove %d directories.', err_count) + endif + call setline(4, msg) + setlocal nomodifiable + endif + endif + let l1 += 1 + endwhile +endfunction + +function! s:upgrade() + echo 'Downloading the latest version of vim-plug' + redraw + let tmp = s:plug_tempname() + let new = tmp . '/plug.vim' + + try + let out = s:system(['git', 'clone', '--depth', '1', s:plug_src, tmp]) + if v:shell_error + return s:err('Error upgrading vim-plug: '. out) + endif + + if readfile(s:me) ==# readfile(new) + echo 'vim-plug is already up-to-date' + return 0 + else + call rename(s:me, s:me . '.old') + call rename(new, s:me) + unlet g:loaded_plug + echo 'vim-plug has been upgraded' + return 1 + endif + finally + silent! call s:rm_rf(tmp) + endtry +endfunction + +function! s:upgrade_specs() + for spec in values(g:plugs) + let spec.frozen = get(spec, 'frozen', 0) + endfor +endfunction + +function! s:status() + call s:prepare() + call append(0, 'Checking plugins') + call append(1, '') + + let ecnt = 0 + let unloaded = 0 + let [cnt, total] = [0, len(g:plugs)] + for [name, spec] in items(g:plugs) + let is_dir = isdirectory(spec.dir) + if has_key(spec, 'uri') + if is_dir + let [err, _] = s:git_validate(spec, 1) + let [valid, msg] = [empty(err), empty(err) ? 'OK' : err] + else + let [valid, msg] = [0, 'Not found. Try PlugInstall.'] + endif + else + if is_dir + let [valid, msg] = [1, 'OK'] + else + let [valid, msg] = [0, 'Not found.'] + endif + endif + let cnt += 1 + let ecnt += !valid + " `s:loaded` entry can be missing if PlugUpgraded + if is_dir && get(s:loaded, name, -1) == 0 + let unloaded = 1 + let msg .= ' (not loaded)' + endif + call s:progress_bar(2, repeat('=', cnt), total) + call append(3, s:format_message(valid ? '-' : 'x', name, msg)) + normal! 2G + redraw + endfor + call setline(1, 'Finished. '.ecnt.' error(s).') + normal! gg + setlocal nomodifiable + if unloaded + echo "Press 'L' on each line to load plugin, or 'U' to update" + nnoremap <silent> <buffer> L :call <SID>status_load(line('.'))<cr> + xnoremap <silent> <buffer> L :call <SID>status_load(line('.'))<cr> + end +endfunction + +function! s:extract_name(str, prefix, suffix) + return matchstr(a:str, '^'.a:prefix.' \zs[^:]\+\ze:.*'.a:suffix.'$') +endfunction + +function! s:status_load(lnum) + let line = getline(a:lnum) + let name = s:extract_name(line, '-', '(not loaded)') + if !empty(name) + call plug#load(name) + setlocal modifiable + call setline(a:lnum, substitute(line, ' (not loaded)$', '', '')) + setlocal nomodifiable + endif +endfunction + +function! s:status_update() range + let lines = getline(a:firstline, a:lastline) + let names = filter(map(lines, 's:extract_name(v:val, "[x-]", "")'), '!empty(v:val)') + if !empty(names) + echo + execute 'PlugUpdate' join(names) + endif +endfunction + +function! s:is_preview_window_open() + silent! wincmd P + if &previewwindow + wincmd p + return 1 + endif +endfunction + +function! s:find_name(lnum) + for lnum in reverse(range(1, a:lnum)) + let line = getline(lnum) + if empty(line) + return '' + endif + let name = s:extract_name(line, '-', '') + if !empty(name) + return name + endif + endfor + return '' +endfunction + +function! s:preview_commit() + if b:plug_preview < 0 + let b:plug_preview = !s:is_preview_window_open() + endif + + let sha = matchstr(getline('.'), '^ \X*\zs[0-9a-f]\{7,9}') + if empty(sha) + let name = matchstr(getline('.'), '^- \zs[^:]*\ze:$') + if empty(name) + return + endif + let title = 'HEAD@{1}..' + let command = 'git diff --no-color HEAD@{1}' + else + let title = sha + let command = 'git show --no-color --pretty=medium '.sha + let name = s:find_name(line('.')) + endif + + if empty(name) || !has_key(g:plugs, name) || !isdirectory(g:plugs[name].dir) + return + endif + + if exists('g:plug_pwindow') && !s:is_preview_window_open() + execute g:plug_pwindow + execute 'e' title + else + execute 'pedit' title + wincmd P + endif + setlocal previewwindow filetype=git buftype=nofile bufhidden=wipe nobuflisted modifiable + let batchfile = '' + try + let [sh, shellcmdflag, shrd] = s:chsh(1) + let cmd = 'cd '.plug#shellescape(g:plugs[name].dir).' && '.command + if s:is_win + let [batchfile, cmd] = s:batchfile(cmd) + endif + execute 'silent %!' cmd + finally + let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd] + if s:is_win && filereadable(batchfile) + call delete(batchfile) + endif + endtry + setlocal nomodifiable + nnoremap <silent> <buffer> q :q<cr> + wincmd p +endfunction + +function! s:section(flags) + call search('\(^[x-] \)\@<=[^:]\+:', a:flags) +endfunction + +function! s:format_git_log(line) + let indent = ' ' + let tokens = split(a:line, nr2char(1)) + if len(tokens) != 5 + return indent.substitute(a:line, '\s*$', '', '') + endif + let [graph, sha, refs, subject, date] = tokens + let tag = matchstr(refs, 'tag: [^,)]\+') + let tag = empty(tag) ? ' ' : ' ('.tag.') ' + return printf('%s%s%s%s%s (%s)', indent, graph, sha, tag, subject, date) +endfunction + +function! s:append_ul(lnum, text) + call append(a:lnum, ['', a:text, repeat('-', len(a:text))]) +endfunction + +function! s:diff() + call s:prepare() + call append(0, ['Collecting changes ...', '']) + let cnts = [0, 0] + let bar = '' + let total = filter(copy(g:plugs), 's:is_managed(v:key) && isdirectory(v:val.dir)') + call s:progress_bar(2, bar, len(total)) + for origin in [1, 0] + let plugs = reverse(sort(items(filter(copy(total), (origin ? '' : '!').'(has_key(v:val, "commit") || has_key(v:val, "tag"))')))) + if empty(plugs) + continue + endif + call s:append_ul(2, origin ? 'Pending updates:' : 'Last update:') + for [k, v] in plugs + let branch = s:git_origin_branch(v) + if len(branch) + let range = origin ? '..origin/'.branch : 'HEAD@{1}..' + let cmd = ['git', 'log', '--graph', '--color=never'] + if s:git_version_requirement(2, 10, 0) + call add(cmd, '--no-show-signature') + endif + call extend(cmd, ['--pretty=format:%x01%h%x01%d%x01%s%x01%cr', range]) + if has_key(v, 'rtp') + call extend(cmd, ['--', v.rtp]) + endif + let diff = s:system_chomp(cmd, v.dir) + if !empty(diff) + let ref = has_key(v, 'tag') ? (' (tag: '.v.tag.')') : has_key(v, 'commit') ? (' '.v.commit) : '' + call append(5, extend(['', '- '.k.':'.ref], map(s:lines(diff), 's:format_git_log(v:val)'))) + let cnts[origin] += 1 + endif + endif + let bar .= '=' + call s:progress_bar(2, bar, len(total)) + normal! 2G + redraw + endfor + if !cnts[origin] + call append(5, ['', 'N/A']) + endif + endfor + call setline(1, printf('%d plugin(s) updated.', cnts[0]) + \ . (cnts[1] ? printf(' %d plugin(s) have pending updates.', cnts[1]) : '')) + + if cnts[0] || cnts[1] + nnoremap <silent> <buffer> <plug>(plug-preview) :silent! call <SID>preview_commit()<cr> + if empty(maparg("\<cr>", 'n')) + nmap <buffer> <cr> <plug>(plug-preview) + endif + if empty(maparg('o', 'n')) + nmap <buffer> o <plug>(plug-preview) + endif + endif + if cnts[0] + nnoremap <silent> <buffer> X :call <SID>revert()<cr> + echo "Press 'X' on each block to revert the update" + endif + normal! gg + setlocal nomodifiable +endfunction + +function! s:revert() + if search('^Pending updates', 'bnW') + return + endif + + let name = s:find_name(line('.')) + if empty(name) || !has_key(g:plugs, name) || + \ input(printf('Revert the update of %s? (y/N) ', name)) !~? '^y' + return + endif + + call s:system('git reset --hard HEAD@{1} && git checkout '.plug#shellescape(g:plugs[name].branch).' --', g:plugs[name].dir) + setlocal modifiable + normal! "_dap + setlocal nomodifiable + echo 'Reverted' +endfunction + +function! s:snapshot(force, ...) abort + call s:prepare() + setf vim + call append(0, ['" Generated by vim-plug', + \ '" '.strftime("%c"), + \ '" :source this file in vim to restore the snapshot', + \ '" or execute: vim -S snapshot.vim', + \ '', '', 'PlugUpdate!']) + 1 + let anchor = line('$') - 3 + let names = sort(keys(filter(copy(g:plugs), + \'has_key(v:val, "uri") && isdirectory(v:val.dir)'))) + for name in reverse(names) + let sha = has_key(g:plugs[name], 'commit') ? g:plugs[name].commit : s:git_revision(g:plugs[name].dir) + if !empty(sha) + call append(anchor, printf("silent! let g:plugs['%s'].commit = '%s'", name, sha)) + redraw + endif + endfor + + if a:0 > 0 + let fn = s:plug_expand(a:1) + if filereadable(fn) && !(a:force || s:ask(a:1.' already exists. Overwrite?')) + return + endif + call writefile(getline(1, '$'), fn) + echo 'Saved as '.a:1 + silent execute 'e' s:esc(fn) + setf vim + endif +endfunction + +function! s:split_rtp() + return split(&rtp, '\\\@<!,') +endfunction + +let s:first_rtp = s:escrtp(get(s:split_rtp(), 0, '')) +let s:last_rtp = s:escrtp(get(s:split_rtp(), -1, '')) + +if exists('g:plugs') + let g:plugs_order = get(g:, 'plugs_order', keys(g:plugs)) + call s:upgrade_specs() + call s:define_commands() +endif + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/vim/colors/blackboard.vim b/vim/colors/blackboard.vim new file mode 100644 index 0000000..2ac839d --- /dev/null +++ b/vim/colors/blackboard.vim @@ -0,0 +1,99 @@ +" Vim color scheme +" +" Name: blackboard.vim +" Maintainer: Ben Wyrosdick <ben.wyrosdick@gmail.com> +" Last Change: 20 August 2009 +" License: public domain +" Version: 1.4 + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "blackboard" + +" Colours in use +" -------------- +" #FF5600 bright orange +" #FFDE00 yolk yellow +" #D8FA3C lemon yellow +" #61CE3C green +" #84A7C1 light blue +" #AEAEAE medium grey + +if has("gui_running") + "GUI Colors + highlight Normal guifg=White guibg=#0B1022 + highlight Cursor guifg=Black guibg=Yellow + highlight CursorLine guibg=#191E2F + highlight LineNr guibg=#323232 guifg=#888888 + highlight Folded guifg=#1d2652 guibg=#070a15 + highlight Pmenu guibg=#84A7C1 + highlight Visual guibg=#283A76 + + "General Colors + highlight Comment guifg=#AEAEAE + highlight Constant guifg=#D8FA3C + highlight Keyword guifg=#FFDE00 + highlight String guifg=#61CE3C + highlight Type guifg=#84A7C1 + highlight Identifier guifg=#61CE3C gui=NONE + highlight Function guifg=#FF5600 gui=NONE + highlight clear Search + highlight Search guibg=#1C3B79 + highlight PreProc guifg=#FF5600 + + " StatusLine + highlight StatusLine guifg=#000000 guibg=#ffffaf gui=italic + highlight StatusLineNC guifg=#000000 guibg=#ffffff gui=NONE + + "Invisible character colors + highlight NonText guifg=#4a4a59 + highlight SpecialKey guifg=#4a4a59 + + "HTML Colors + highlight link htmlTag Type + highlight link htmlEndTag htmlTag + highlight link htmlTagName htmlTag + + "Ruby Colors + highlight link rubyClass Keyword + highlight link rubyDefine Keyword + highlight link rubyConstant Type + highlight link rubySymbol Constant + highlight link rubyStringDelimiter rubyString + highlight link rubyInclude Keyword + highlight link rubyAttribute Keyword + highlight link rubyInstanceVariable Normal + + "Rails Colors + highlight link railsMethod Type + + "Sass colors + highlight link sassMixin Keyword + highlight link sassMixing Constant + + "Outliner colors + highlight OL1 guifg=#FF5600 + highlight OL2 guifg=#61CE3C + highlight OL3 guifg=#84A7C1 + highlight OL4 guifg=#D8FA3C + highlight BT1 guifg=#AEAEAE + highlight link BT2 BT1 + highlight link BT3 BT1 + highlight link BT4 BT1 + + "Markdown colors + highlight markdownCode guifg=#61CE3C guibg=#070a15 + highlight link markdownCodeBlock markdownCode + + "Git colors + highlight gitcommitSelectedFile guifg=#61CE3C + highlight gitcommitDiscardedFile guifg=#C23621 + highlight gitcommitWarning guifg=#C23621 + highlight gitcommitBranch guifg=#FFDE00 + highlight gitcommitHeader guifg=#84A7C1 + +end diff --git a/vim/colors/blank.vim b/vim/colors/blank.vim new file mode 100644 index 0000000..2b7790b --- /dev/null +++ b/vim/colors/blank.vim @@ -0,0 +1,327 @@ +set background=light +highlight clear +syntax reset + +let g:colors_name='blank-light' + +hi Normal ctermfg=black ctermbg=white +hi Cursor ctermfg=216 ctermbg=216 + +" hi Boolean ctermbg=NONE ctermfg=255 +" hi Character ctermbg=NONE ctermfg=255 +" hi ColorColumn ctermbg=234 ctermfg=255 +" hi Comment ctermbg=NONE ctermfg=240 +" hi Condtional ctermbg=NONE ctermfg=255 +" hi Constant ctermbg=NONE ctermfg=255 +" hi CursorColumn ctermbg=NONE ctermfg=255 +" hi Cursor ctermbg=NONE ctermfg=255 +" hi CursorLine ctermbg=233 ctermfg=255 cterm=bold +" hi Debug ctermbg=NONE ctermfg=255 +" hi Define ctermbg=NONE ctermfg=255 +" hi Delimiter ctermbg=NONE ctermfg=149 +" hi DiffAdd ctermbg=NONE ctermfg=255 +" hi DiffChange ctermbg=NONE ctermfg=255 +" hi DiffDelete ctermbg=NONE ctermfg=255 +" hi DiffText ctermbg=NONE ctermfg=255 +" hi Directory ctermbg=NONE ctermfg=255 +" hi Error ctermbg=NONE ctermfg=255 +" hi ErrorMsg ctermbg=NONE ctermfg=255 +" hi Exception ctermbg=NONE ctermfg=255 +" hi Float ctermbg=NONE ctermfg=255 +" hi FoldColumn ctermbg=NONE ctermfg=255 +" hi Folded ctermbg=NONE ctermfg=255 +" hi Function ctermbg=NONE ctermfg=255 +" hi Identifier ctermbg=NONE ctermfg=109 +" hi Include ctermbg=NONE ctermfg=255 +" hi IncSearch ctermbg=NONE ctermfg=255 +" hi Keyword ctermbg=NONE ctermfg=255 +" hi Label ctermbg=NONE ctermfg=255 +" hi LineNr ctermbg=232 ctermfg=237 +" hi Macro ctermbg=NONE ctermfg=255 +" hi MatchParen ctermbg=NONE ctermfg=255 +" hi ModeMsg ctermbg=NONE ctermfg=255 +" hi MoreMsg ctermbg=NONE ctermfg=255 +" hi NonText ctermbg=NONE ctermfg=255 +" hi Normal ctermbg=NONE ctermfg=244 +" hi Number ctermbg=NONE ctermfg=216 +" hi Operator ctermbg=NONE ctermfg=255 +" hi Pmenu ctermbg=NONE ctermfg=255 +" hi PmenuSbar ctermbg=NONE ctermfg=255 +" hi PmenuSel ctermbg=NONE ctermfg=45 cterm=bold +" hi PmenuThumb ctermbg=NONE ctermfg=255 +" hi PreCondit ctermbg=NONE ctermfg=255 +" hi PreProc ctermbg=NONE ctermfg=255 +" hi Question ctermbg=NONE ctermfg=255 +" hi Repeat ctermbg=NONE ctermfg=255 +" hi Search ctermbg=NONE ctermfg=186 +" hi SpecialChar ctermbg=NONE ctermfg=255 +" hi SpecialComment ctermbg=NONE ctermfg=255 +" hi Special ctermbg=NONE ctermfg=255 +" hi SpecialKey ctermbg=NONE ctermfg=255 +" hi SpellBad ctermbg=250 ctermfg=0 +" hi SpellCap ctermbg=NONE ctermfg=250 +" hi SpellLocal ctermbg=NONE ctermfg=250 +" hi SpellRare ctermbg=NONE ctermfg=250 +" hi Statement ctermbg=NONE ctermfg=250 +" hi StatusLine ctermfg=233 ctermbg=238 +" hi StatusLineNC ctermbg=NONE ctermfg=250 +" hi StorageClass ctermbg=NONE ctermfg=250 +" hi String ctermbg=NONE ctermfg=245 +" hi Structure ctermbg=NONE ctermfg=255 +" hi TabLineFill ctermbg=NONE ctermfg=255 +" hi Tag ctermbg=NONE ctermfg=255 +" hi Title ctermbg=NONE ctermfg=255 +" hi Todo ctermbg=NONE ctermfg=240 +" hi Type ctermbg=NONE ctermfg=103 +" hi Typedef ctermbg=NONE ctermfg=255 +" hi VertSplit ctermbg=NONE ctermfg=255 +" hi Visual ctermbg=NONE ctermfg=186 +" hi VisualNOS ctermbg=NONE ctermfg=255 +" hi WarningMsg ctermbg=NONE ctermfg=255 +" hi WildMenu ctermbg=NONE ctermfg=255 + +"hi def link diffCommon Statement +"hi def link diffRemoved DiffDelet +"hi def link diffChanged DiffChang +"hi def link diffAdded DiffAdd +" +" hi x016_Grey0 ctermfg=16 guifg=#000000 "rgb=0,0,0 +" hi x017_NavyBlue ctermfg=17 guifg=#00005f "rgb=0,0,95 +" hi x018_DarkBlue ctermfg=18 guifg=#000087 "rgb=0,0,135 +" hi x019_Blue3 ctermfg=19 guifg=#0000af "rgb=0,0,175 +" hi x020_Blue3 ctermfg=20 guifg=#0000d7 "rgb=0,0,215 +" hi x021_Blue1 ctermfg=21 guifg=#0000ff "rgb=0,0,255 +" hi x022_DarkGreen ctermfg=22 guifg=#005f00 "rgb=0,95,0 +" hi x023_DeepSkyBlue4 ctermfg=23 guifg=#005f5f "rgb=0,95,95 +" hi x024_DeepSkyBlue4 ctermfg=24 guifg=#005f87 "rgb=0,95,135 +" hi x025_DeepSkyBlue4 ctermfg=25 guifg=#005faf "rgb=0,95,175 +" hi x026_DodgerBlue3 ctermfg=26 guifg=#005fd7 "rgb=0,95,215 +" hi x027_DodgerBlue2 ctermfg=27 guifg=#005fff "rgb=0,95,255 +" hi x028_Green4 ctermfg=28 guifg=#008700 "rgb=0,135,0 +" hi x029_SpringGreen4 ctermfg=29 guifg=#00875f "rgb=0,135,95 +" hi x030_Turquoise4 ctermfg=30 guifg=#008787 "rgb=0,135,135 +" hi x031_DeepSkyBlue3 ctermfg=31 guifg=#0087af "rgb=0,135,175 +" hi x032_DeepSkyBlue3 ctermfg=32 guifg=#0087d7 "rgb=0,135,215 +" hi x033_DodgerBlue1 ctermfg=33 guifg=#0087ff "rgb=0,135,255 +" hi x034_Green3 ctermfg=34 guifg=#00af00 "rgb=0,175,0 +" hi x035_SpringGreen3 ctermfg=35 guifg=#00af5f "rgb=0,175,95 +" hi x036_DarkCyan ctermfg=36 guifg=#00af87 "rgb=0,175,135 +" hi x037_LightSeaGreen ctermfg=37 guifg=#00afaf "rgb=0,175,175 +" hi x038_DeepSkyBlue2 ctermfg=38 guifg=#00afd7 "rgb=0,175,215 +" hi x039_DeepSkyBlue1 ctermfg=39 guifg=#00afff "rgb=0,175,255 +" hi x040_Green3 ctermfg=40 guifg=#00d700 "rgb=0,215,0 +" hi x041_SpringGreen3 ctermfg=41 guifg=#00d75f "rgb=0,215,95 +" hi x042_SpringGreen2 ctermfg=42 guifg=#00d787 "rgb=0,215,135 +" hi x043_Cyan3 ctermfg=43 guifg=#00d7af "rgb=0,215,175 +" hi x044_DarkTurquoise ctermfg=44 guifg=#00d7d7 "rgb=0,215,215 +" hi x045_Turquoise2 ctermfg=45 guifg=#00d7ff "rgb=0,215,255 +" hi x046_Green1 ctermfg=46 guifg=#00ff00 "rgb=0,255,0 +" hi x047_SpringGreen2 ctermfg=47 guifg=#00ff5f "rgb=0,255,95 +" hi x048_SpringGreen1 ctermfg=48 guifg=#00ff87 "rgb=0,255,135 +" hi x049_MediumSpringGreen ctermfg=49 guifg=#00ffaf "rgb=0,255,175 +" hi x050_Cyan2 ctermfg=50 guifg=#00ffd7 "rgb=0,255,215 +" hi x051_Cyan1 ctermfg=51 guifg=#00ffff "rgb=0,255,255 +" hi x052_DarkRed ctermfg=52 guifg=#5f0000 "rgb=95,0,0 +" hi x053_DeepPink4 ctermfg=53 guifg=#5f005f "rgb=95,0,95 +" hi x054_Purple4 ctermfg=54 guifg=#5f0087 "rgb=95,0,135 +" hi x055_Purple4 ctermfg=55 guifg=#5f00af "rgb=95,0,175 +" hi x056_Purple3 ctermfg=56 guifg=#5f00d7 "rgb=95,0,215 +" hi x057_BlueViolet ctermfg=57 guifg=#5f00ff "rgb=95,0,255 +" hi x058_Orange4 ctermfg=58 guifg=#5f5f00 "rgb=95,95,0 +" hi x059_Grey37 ctermfg=59 guifg=#5f5f5f "rgb=95,95,95 +" hi x060_MediumPurple4 ctermfg=60 guifg=#5f5f87 "rgb=95,95,135 +" hi x061_SlateBlue3 ctermfg=61 guifg=#5f5faf "rgb=95,95,175 +" hi x062_SlateBlue3 ctermfg=62 guifg=#5f5fd7 "rgb=95,95,215 +" hi x063_RoyalBlue1 ctermfg=63 guifg=#5f5fff "rgb=95,95,255 +" hi x064_Chartreuse4 ctermfg=64 guifg=#5f8700 "rgb=95,135,0 +" hi x065_DarkSeaGreen4 ctermfg=65 guifg=#5f875f "rgb=95,135,95 +" hi x066_PaleTurquoise4 ctermfg=66 guifg=#5f8787 "rgb=95,135,135 +" hi x067_SteelBlue ctermfg=67 guifg=#5f87af "rgb=95,135,175 +" hi x068_SteelBlue3 ctermfg=68 guifg=#5f87d7 "rgb=95,135,215 +" hi x069_CornflowerBlue ctermfg=69 guifg=#5f87ff "rgb=95,135,255 +" hi x070_Chartreuse3 ctermfg=70 guifg=#5faf00 "rgb=95,175,0 +" hi x071_DarkSeaGreen4 ctermfg=71 guifg=#5faf5f "rgb=95,175,95 +" hi x072_CadetBlue ctermfg=72 guifg=#5faf87 "rgb=95,175,135 +" hi x073_CadetBlue ctermfg=73 guifg=#5fafaf "rgb=95,175,175 +" hi x074_SkyBlue3 ctermfg=74 guifg=#5fafd7 "rgb=95,175,215 +" hi x075_SteelBlue1 ctermfg=75 guifg=#5fafff "rgb=95,175,255 +" hi x076_Chartreuse3 ctermfg=76 guifg=#5fd700 "rgb=95,215,0 +" hi x077_PaleGreen3 ctermfg=77 guifg=#5fd75f "rgb=95,215,95 +" hi x078_SeaGreen3 ctermfg=78 guifg=#5fd787 "rgb=95,215,135 +" hi x079_Aquamarine3 ctermfg=79 guifg=#5fd7af "rgb=95,215,175 +" hi x080_MediumTurquoise ctermfg=80 guifg=#5fd7d7 "rgb=95,215,215 +" hi x081_SteelBlue1 ctermfg=81 guifg=#5fd7ff "rgb=95,215,255 +" hi x082_Chartreuse2 ctermfg=82 guifg=#5fff00 "rgb=95,255,0 +" hi x083_SeaGreen2 ctermfg=83 guifg=#5fff5f "rgb=95,255,95 +" hi x084_SeaGreen1 ctermfg=84 guifg=#5fff87 "rgb=95,255,135 +" hi x085_SeaGreen1 ctermfg=85 guifg=#5fffaf "rgb=95,255,175 +" hi x086_Aquamarine1 ctermfg=86 guifg=#5fffd7 "rgb=95,255,215 +" hi x087_DarkSlateGray2 ctermfg=87 guifg=#5fffff "rgb=95,255,255 +" hi x088_DarkRed ctermfg=88 guifg=#870000 "rgb=135,0,0 +" hi x089_DeepPink4 ctermfg=89 guifg=#87005f "rgb=135,0,95 +" hi x090_DarkMagenta ctermfg=90 guifg=#870087 "rgb=135,0,135 +" hi x091_DarkMagenta ctermfg=91 guifg=#8700af "rgb=135,0,175 +" hi x092_DarkViolet ctermfg=92 guifg=#8700d7 "rgb=135,0,215 +" hi x093_Purple ctermfg=93 guifg=#8700ff "rgb=135,0,255 +" hi x094_Orange4 ctermfg=94 guifg=#875f00 "rgb=135,95,0 +" hi x095_LightPink4 ctermfg=95 guifg=#875f5f "rgb=135,95,95 +" hi x096_Plum4 ctermfg=96 guifg=#875f87 "rgb=135,95,135 +" hi x097_MediumPurple3 ctermfg=97 guifg=#875faf "rgb=135,95,175 +" hi x098_MediumPurple3 ctermfg=98 guifg=#875fd7 "rgb=135,95,215 +" hi x099_SlateBlue1 ctermfg=99 guifg=#875fff "rgb=135,95,255 +" hi x100_Yellow4 ctermfg=100 guifg=#878700 "rgb=135,135,0 +" hi x101_Wheat4 ctermfg=101 guifg=#87875f "rgb=135,135,95 +" hi x102_Grey53 ctermfg=102 guifg=#878787 "rgb=135,135,135 +" hi x103_LightSlateGrey ctermfg=103 guifg=#8787af "rgb=135,135,175 +" hi x104_MediumPurple ctermfg=104 guifg=#8787d7 "rgb=135,135,215 +" hi x105_LightSlateBlue ctermfg=105 guifg=#8787ff "rgb=135,135,255 +" hi x106_Yellow4 ctermfg=106 guifg=#87af00 "rgb=135,175,0 +" hi x107_DarkOliveGreen3 ctermfg=107 guifg=#87af5f "rgb=135,175,95 +" hi x108_DarkSeaGreen ctermfg=108 guifg=#87af87 "rgb=135,175,135 +" hi x109_LightSkyBlue3 ctermfg=109 guifg=#87afaf "rgb=135,175,175 +" hi x110_LightSkyBlue3 ctermfg=110 guifg=#87afd7 "rgb=135,175,215 +" hi x111_SkyBlue2 ctermfg=111 guifg=#87afff "rgb=135,175,255 +" hi x112_Chartreuse2 ctermfg=112 guifg=#87d700 "rgb=135,215,0 +" hi x113_DarkOliveGreen3 ctermfg=113 guifg=#87d75f "rgb=135,215,95 +" hi x114_PaleGreen3 ctermfg=114 guifg=#87d787 "rgb=135,215,135 +" hi x115_DarkSeaGreen3 ctermfg=115 guifg=#87d7af "rgb=135,215,175 +" hi x116_DarkSlateGray3 ctermfg=116 guifg=#87d7d7 "rgb=135,215,215 +" hi x117_SkyBlue1 ctermfg=117 guifg=#87d7ff "rgb=135,215,255 +" hi x118_Chartreuse1 ctermfg=118 guifg=#87ff00 "rgb=135,255,0 +" hi x119_LightGreen ctermfg=119 guifg=#87ff5f "rgb=135,255,95 +" hi x120_LightGreen ctermfg=120 guifg=#87ff87 "rgb=135,255,135 +" hi x121_PaleGreen1 ctermfg=121 guifg=#87ffaf "rgb=135,255,175 +" hi x122_Aquamarine1 ctermfg=122 guifg=#87ffd7 "rgb=135,255,215 +" hi x123_DarkSlateGray1 ctermfg=123 guifg=#87ffff "rgb=135,255,255 +" hi x124_Red3 ctermfg=124 guifg=#af0000 "rgb=175,0,0 +" hi x125_DeepPink4 ctermfg=125 guifg=#af005f "rgb=175,0,95 +" hi x126_MediumVioletRed ctermfg=126 guifg=#af0087 "rgb=175,0,135 +" hi x127_Magenta3 ctermfg=127 guifg=#af00af "rgb=175,0,175 +" hi x128_DarkViolet ctermfg=128 guifg=#af00d7 "rgb=175,0,215 +" hi x129_Purple ctermfg=129 guifg=#af00ff "rgb=175,0,255 +" hi x130_DarkOrange3 ctermfg=130 guifg=#af5f00 "rgb=175,95,0 +" hi x131_IndianRed ctermfg=131 guifg=#af5f5f "rgb=175,95,95 +" hi x132_HotPink3 ctermfg=132 guifg=#af5f87 "rgb=175,95,135 +" hi x133_MediumOrchid3 ctermfg=133 guifg=#af5faf "rgb=175,95,175 +" hi x134_MediumOrchid ctermfg=134 guifg=#af5fd7 "rgb=175,95,215 +" hi x135_MediumPurple2 ctermfg=135 guifg=#af5fff "rgb=175,95,255 +" hi x136_DarkGoldenrod ctermfg=136 guifg=#af8700 "rgb=175,135,0 +" hi x137_LightSalmon3 ctermfg=137 guifg=#af875f "rgb=175,135,95 +" hi x138_RosyBrown ctermfg=138 guifg=#af8787 "rgb=175,135,135 +" hi x139_Grey63 ctermfg=139 guifg=#af87af "rgb=175,135,175 +" hi x140_MediumPurple2 ctermfg=140 guifg=#af87d7 "rgb=175,135,215 +" hi x141_MediumPurple1 ctermfg=141 guifg=#af87ff "rgb=175,135,255 +" hi x142_Gold3 ctermfg=142 guifg=#afaf00 "rgb=175,175,0 +" hi x143_DarkKhaki ctermfg=143 guifg=#afaf5f "rgb=175,175,95 +" hi x144_NavajoWhite3 ctermfg=144 guifg=#afaf87 "rgb=175,175,135 +" hi x145_Grey69 ctermfg=145 guifg=#afafaf "rgb=175,175,175 +" hi x146_LightSteelBlue3 ctermfg=146 guifg=#afafd7 "rgb=175,175,215 +" hi x147_LightSteelBlue ctermfg=147 guifg=#afafff "rgb=175,175,255 +" hi x148_Yellow3 ctermfg=148 guifg=#afd700 "rgb=175,215,0 +" hi x149_DarkOliveGreen3 ctermfg=149 guifg=#afd75f "rgb=175,215,95 +" hi x150_DarkSeaGreen3 ctermfg=150 guifg=#afd787 "rgb=175,215,135 +" hi x151_DarkSeaGreen2 ctermfg=151 guifg=#afd7af "rgb=175,215,175 +" hi x152_LightCyan3 ctermfg=152 guifg=#afd7d7 "rgb=175,215,215 +" hi x153_LightSkyBlue1 ctermfg=153 guifg=#afd7ff "rgb=175,215,255 +" hi x154_GreenYellow ctermfg=154 guifg=#afff00 "rgb=175,255,0 +" hi x155_DarkOliveGreen2 ctermfg=155 guifg=#afff5f "rgb=175,255,95 +" hi x156_PaleGreen1 ctermfg=156 guifg=#afff87 "rgb=175,255,135 +" hi x157_DarkSeaGreen2 ctermfg=157 guifg=#afffaf "rgb=175,255,175 +" hi x158_DarkSeaGreen1 ctermfg=158 guifg=#afffd7 "rgb=175,255,215 +" hi x159_PaleTurquoise1 ctermfg=159 guifg=#afffff "rgb=175,255,255 +" hi x160_Red3 ctermfg=160 guifg=#d70000 "rgb=215,0,0 +" hi x161_DeepPink3 ctermfg=161 guifg=#d7005f "rgb=215,0,95 +" hi x162_DeepPink3 ctermfg=162 guifg=#d70087 "rgb=215,0,135 +" hi x163_Magenta3 ctermfg=163 guifg=#d700af "rgb=215,0,175 +" hi x164_Magenta3 ctermfg=164 guifg=#d700d7 "rgb=215,0,215 +" hi x165_Magenta2 ctermfg=165 guifg=#d700ff "rgb=215,0,255 +" hi x166_DarkOrange3 ctermfg=166 guifg=#d75f00 "rgb=215,95,0 +" hi x167_IndianRed ctermfg=167 guifg=#d75f5f "rgb=215,95,95 +" hi x168_HotPink3 ctermfg=168 guifg=#d75f87 "rgb=215,95,135 +" hi x169_HotPink2 ctermfg=169 guifg=#d75faf "rgb=215,95,175 +" hi x170_Orchid ctermfg=170 guifg=#d75fd7 "rgb=215,95,215 +" hi x171_MediumOrchid1 ctermfg=171 guifg=#d75fff "rgb=215,95,255 +" hi x172_Orange3 ctermfg=172 guifg=#d78700 "rgb=215,135,0 +" hi x173_LightSalmon3 ctermfg=173 guifg=#d7875f "rgb=215,135,95 +" hi x174_LightPink3 ctermfg=174 guifg=#d78787 "rgb=215,135,135 +" hi x175_Pink3 ctermfg=175 guifg=#d787af "rgb=215,135,175 +" hi x176_Plum3 ctermfg=176 guifg=#d787d7 "rgb=215,135,215 +" hi x177_Violet ctermfg=177 guifg=#d787ff "rgb=215,135,255 +" hi x178_Gold3 ctermfg=178 guifg=#d7af00 "rgb=215,175,0 +" hi x179_LightGoldenrod3 ctermfg=179 guifg=#d7af5f "rgb=215,175,95 +" hi x180_Tan ctermfg=180 guifg=#d7af87 "rgb=215,175,135 +" hi x181_MistyRose3 ctermfg=181 guifg=#d7afaf "rgb=215,175,175 +" hi x182_Thistle3 ctermfg=182 guifg=#d7afd7 "rgb=215,175,215 +" hi x183_Plum2 ctermfg=183 guifg=#d7afff "rgb=215,175,255 +" hi x184_Yellow3 ctermfg=184 guifg=#d7d700 "rgb=215,215,0 +" hi x185_Khaki3 ctermfg=185 guifg=#d7d75f "rgb=215,215,95 +" hi x186_LightGoldenrod2 ctermfg=186 guifg=#d7d787 "rgb=215,215,135 +" hi x187_LightYellow3 ctermfg=187 guifg=#d7d7af "rgb=215,215,175 +" hi x188_Grey84 ctermfg=188 guifg=#d7d7d7 "rgb=215,215,215 +" hi x189_LightSteelBlue1 ctermfg=189 guifg=#d7d7ff "rgb=215,215,255 +" hi x190_Yellow2 ctermfg=190 guifg=#d7ff00 "rgb=215,255,0 +" hi x191_DarkOliveGreen1 ctermfg=191 guifg=#d7ff5f "rgb=215,255,95 +" hi x192_DarkOliveGreen1 ctermfg=192 guifg=#d7ff87 "rgb=215,255,135 +" hi x193_DarkSeaGreen1 ctermfg=193 guifg=#d7ffaf "rgb=215,255,175 +" hi x194_Honeydew2 ctermfg=194 guifg=#d7ffd7 "rgb=215,255,215 +" hi x195_LightCyan1 ctermfg=195 guifg=#d7ffff "rgb=215,255,255 +" hi x196_Red1 ctermfg=196 guifg=#ff0000 "rgb=255,0,0 +" hi x197_DeepPink2 ctermfg=197 guifg=#ff005f "rgb=255,0,95 +" hi x198_DeepPink1 ctermfg=198 guifg=#ff0087 "rgb=255,0,135 +" hi x199_DeepPink1 ctermfg=199 guifg=#ff00af "rgb=255,0,175 +" hi x200_Magenta2 ctermfg=200 guifg=#ff00d7 "rgb=255,0,215 +" hi x201_Magenta1 ctermfg=201 guifg=#ff00ff "rgb=255,0,255 +" hi x202_OrangeRed1 ctermfg=202 guifg=#ff5f00 "rgb=255,95,0 +" hi x203_IndianRed1 ctermfg=203 guifg=#ff5f5f "rgb=255,95,95 +" hi x204_IndianRed1 ctermfg=204 guifg=#ff5f87 "rgb=255,95,135 +" hi x205_HotPink ctermfg=205 guifg=#ff5faf "rgb=255,95,175 +" hi x206_HotPink ctermfg=206 guifg=#ff5fd7 "rgb=255,95,215 +" hi x207_MediumOrchid1 ctermfg=207 guifg=#ff5fff "rgb=255,95,255 +" hi x208_DarkOrange ctermfg=208 guifg=#ff8700 "rgb=255,135,0 +" hi x209_Salmon1 ctermfg=209 guifg=#ff875f "rgb=255,135,95 +" hi x210_LightCoral ctermfg=210 guifg=#ff8787 "rgb=255,135,135 +" hi x211_PaleVioletRed1 ctermfg=211 guifg=#ff87af "rgb=255,135,175 +" hi x212_Orchid2 ctermfg=212 guifg=#ff87d7 "rgb=255,135,215 +" hi x213_Orchid1 ctermfg=213 guifg=#ff87ff "rgb=255,135,255 +" hi x214_Orange1 ctermfg=214 guifg=#ffaf00 "rgb=255,175,0 +" hi x215_SandyBrown ctermfg=215 guifg=#ffaf5f "rgb=255,175,95 +" hi x216_LightSalmon1 ctermfg=216 guifg=#ffaf87 "rgb=255,175,135 +" hi x217_LightPink1 ctermfg=217 guifg=#ffafaf "rgb=255,175,175 +" hi x218_Pink1 ctermfg=218 guifg=#ffafd7 "rgb=255,175,215 +" hi x219_Plum1 ctermfg=219 guifg=#ffafff "rgb=255,175,255 +" hi x220_Gold1 ctermfg=220 guifg=#ffd700 "rgb=255,215,0 +" hi x221_LightGoldenrod2 ctermfg=221 guifg=#ffd75f "rgb=255,215,95 +" hi x222_LightGoldenrod2 ctermfg=222 guifg=#ffd787 "rgb=255,215,135 +" hi x223_NavajoWhite1 ctermfg=223 guifg=#ffd7af "rgb=255,215,175 +" hi x224_MistyRose1 ctermfg=224 guifg=#ffd7d7 "rgb=255,215,215 +" hi x225_Thistle1 ctermfg=225 guifg=#ffd7ff "rgb=255,215,255 +" hi x226_Yellow1 ctermfg=226 guifg=#ffff00 "rgb=255,255,0 +" hi x227_LightGoldenrod1 ctermfg=227 guifg=#ffff5f "rgb=255,255,95 +" hi x228_Khaki1 ctermfg=228 guifg=#ffff87 "rgb=255,255,135 +" hi x229_Wheat1 ctermfg=229 guifg=#ffffaf "rgb=255,255,175 +" hi x230_Cornsilk1 ctermfg=230 guifg=#ffffd7 "rgb=255,255,215 +" hi x231_Grey100 ctermfg=231 guifg=#ffffff "rgb=255,255,255 +" hi x232_Grey3 ctermfg=232 guifg=#080808 "rgb=8,8,8 +" hi x233_Grey7 ctermfg=233 guifg=#121212 "rgb=18,18,18 +" hi x234_Grey11 ctermfg=234 guifg=#1c1c1c "rgb=28,28,28 +" hi x235_Grey15 ctermfg=235 guifg=#262626 "rgb=38,38,38 +" hi x236_Grey19 ctermfg=236 guifg=#303030 "rgb=48,48,48 +" hi x237_Grey23 ctermfg=237 guifg=#3a3a3a "rgb=58,58,58 +" hi x238_Grey27 ctermfg=238 guifg=#444444 "rgb=68,68,68 +" hi x239_Grey30 ctermfg=239 guifg=#4e4e4e "rgb=78,78,78 +" hi x240_Grey35 ctermfg=240 guifg=#585858 "rgb=88,88,88 +" hi x241_Grey39 ctermfg=241 guifg=#626262 "rgb=98,98,98 +" hi x242_Grey42 ctermfg=242 guifg=#6c6c6c "rgb=108,108,108 +" hi x243_Grey46 ctermfg=243 guifg=#767676 "rgb=118,118,118 +" hi x244_Grey50 ctermfg=244 guifg=#808080 "rgb=128,128,128 +" hi x245_Grey54 ctermfg=245 guifg=#8a8a8a "rgb=138,138,138 +" hi x246_Grey58 ctermfg=246 guifg=#949494 "rgb=148,148,148 +" hi x247_Grey62 ctermfg=247 guifg=#9e9e9e "rgb=158,158,158 +" hi x248_Grey66 ctermfg=248 guifg=#a8a8a8 "rgb=168,168,168 +" hi x249_Grey70 ctermfg=249 guifg=#b2b2b2 "rgb=178,178,178 +" hi x250_Grey74 ctermfg=250 guifg=#bcbcbc "rgb=188,188,188 +" hi x251_Grey78 ctermfg=251 guifg=#c6c6c6 "rgb=198,198,198 +" hi x252_Grey82 ctermfg=252 guifg=#d0d0d0 "rgb=208,208,208 +" hi x253_Grey85 ctermfg=253 guifg=#dadada "rgb=218,218,218 +" hi x254_Grey89 ctermfg=254 guifg=#e4e4e4 "rgb=228,228,228 +" hi x255_Grey93 ctermfg=255 guifg=#eeeeee "rgb=238,238,238 diff --git a/vim/colors/blue_alt.vim b/vim/colors/blue_alt.vim new file mode 100644 index 0000000..5ad0278 --- /dev/null +++ b/vim/colors/blue_alt.vim @@ -0,0 +1,56 @@ +" local syntax file - set colors on a per-machine basis: +" vim: tw=0 ts=4 sw=4 +" Vim color file +" Maintainer: Steven Vertigan <steven@vertigan.wattle.id.au> +" Last Change: 2006 Sep 23 +" Revision #5: Switch main text from white to yellow for easier contrast, +" fixed some problems with terminal backgrounds. + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "blue_alt" +"hi Normal guifg=yellow guibg=darkBlue ctermfg=yellow ctermbg=darkBlue +hi Normal guifg=yellow guibg=darkBlue ctermfg=yellow ctermbg=darkBlue +hi NonText guifg=magenta ctermfg=lightMagenta +hi comment guifg=gray ctermfg=gray ctermbg=darkBlue gui=bold +hi constant guifg=cyan ctermfg=cyan +hi identifier guifg=gray ctermfg=red +hi statement guifg=white ctermfg=white ctermbg=darkBlue gui=none +hi preproc guifg=green ctermfg=green +hi type guifg=orange ctermfg=lightRed ctermbg=darkBlue +hi special guifg=magenta ctermfg=lightMagenta ctermbg=darkBlue +hi Underlined guifg=cyan ctermfg=cyan gui=underline cterm=underline +hi label guifg=yellow ctermfg=yellow +hi operator guifg=orange gui=bold ctermfg=lightRed ctermbg=darkBlue + +hi ErrorMsg guifg=orange guibg=darkBlue ctermfg=lightRed +hi WarningMsg guifg=cyan guibg=darkBlue ctermfg=cyan gui=bold +hi ModeMsg guifg=yellow gui=NONE ctermfg=yellow +hi MoreMsg guifg=yellow gui=NONE ctermfg=yellow +hi Error guifg=red guibg=darkBlue gui=underline ctermfg=red + +hi Todo guifg=black guibg=orange ctermfg=black ctermbg=darkYellow +hi Cursor guifg=black guibg=white ctermfg=black ctermbg=white +hi Search guifg=black guibg=orange ctermfg=black ctermbg=darkYellow +hi IncSearch guifg=black guibg=yellow ctermfg=black ctermbg=darkYellow +hi LineNr guifg=cyan ctermfg=cyan +hi title guifg=white gui=bold cterm=bold + +hi StatusLineNC gui=NONE guifg=black guibg=blue ctermfg=black ctermbg=blue +hi StatusLine gui=bold guifg=cyan guibg=blue ctermfg=cyan ctermbg=blue +hi VertSplit gui=none guifg=blue guibg=blue ctermfg=blue ctermbg=blue + +hi Visual term=reverse ctermfg=black ctermbg=darkCyan guifg=black guibg=darkCyan + +hi DiffChange guibg=darkGreen guifg=black ctermbg=darkGreen ctermfg=black +hi DiffText guibg=olivedrab guifg=black ctermbg=lightGreen ctermfg=black +hi DiffAdd guibg=slateblue guifg=black ctermbg=blue ctermfg=black +hi DiffDelete guibg=coral guifg=black ctermbg=cyan ctermfg=black + +hi Folded guibg=orange guifg=black ctermbg=yellow ctermfg=black +hi FoldColumn guibg=gray30 guifg=black ctermbg=gray ctermfg=black +hi cIf0 guifg=gray ctermfg=gray + diff --git a/vim/colors/distinguished.vim b/vim/colors/distinguished.vim new file mode 100644 index 0000000..30934e5 --- /dev/null +++ b/vim/colors/distinguished.vim @@ -0,0 +1,179 @@ +" Author: Kim Silkebækken <kim.silkebaekken+vim@gmail.com> +" Source repository: https://github.com/Lokaltog/vim-distinguished + +" Initialization {{{ + set background=dark + + hi clear + if exists('syntax_on') + syntax reset + endif + + let g:colors_name = 'distinguished' + + if ! has('gui_running') + if &t_Co != 256 + echoe 'The ' . g:colors_name . ' color scheme requires gvim or a 256-color terminal' + + finish + endif + endif +" }}} +" Color dictionary parser {{{ + function! s:ColorDictParser(color_dict) + for [group, group_colors] in items(a:color_dict) + exec 'hi ' . group + \ . ' ctermfg=' . (group_colors[0] == '' ? 'NONE' : group_colors[0]) + \ . ' ctermbg=' . (group_colors[1] == '' ? 'NONE' : group_colors[1]) + \ . ' cterm=' . (group_colors[2] == '' ? 'NONE' : group_colors[2]) + \ + \ . ' guifg=' . (group_colors[3] == '' ? 'NONE' : '#' . group_colors[3]) + \ . ' guibg=' . (group_colors[4] == '' ? 'NONE' : '#' . group_colors[4]) + \ . ' gui=' . (group_colors[5] == '' ? 'NONE' : group_colors[5]) + endfor + endfunction +" }}} + +" | Highlight group | CTFG | CTBG | CTAttributes | || | GUIFG | GUIBG | GUIAttributes | +" |--------------------------------|-------|-------|-----------------| || |---------|----------|-----------------| +call s:ColorDictParser({ + \ 'Normal' : [ 231, 16, '', 'ffffff', '000000', ''] + \ , 'Visual' : [ 240, 253, '', '585858', 'dadada', ''] + \ + \ , 'Cursor' : [ '', '', '', 'ffffff', 'dd4010', ''] + \ , 'lCursor' : [ '', '', '', 'ffffff', '89b6e2', ''] + \ + \ , 'CursorLine' : [ 16, 231, '', '', '3a3a3a', ''] + \ , 'CursorColumn' : [ 231, 237, '', 'ffffff', '3a3a3a', ''] + \ + \ , 'Folded' : [ 249, 234, '', 'b2b2b2', '1c1c1c', ''] + \ , 'FoldColumn' : [ 243, 234, '', '767676', '1c1c1c', ''] + \ , 'SignColumn' : [ 231, 233, 'bold', 'ffffff', '121212', 'bold'] + \ , 'ColorColumn' : [ '', 233, '', '', '262626', ''] + \ + \ , 'StatusLine' : [ 231, 236, 'bold', 'ffffff', '303030', 'bold'] + \ , 'StatusLineNC' : [ 244, 232, '', '808080', '080808', ''] + \ + \ , 'LineNr' : [ 243, 235, '', '767676', '262626', ''] + \ , 'VertSplit' : [ 240, '', '', '585858', '1c1c1c', ''] + \ + \ , 'WildMenu' : [ 234, 231, '', '1c1c1c', 'ffffff', ''] + \ , 'Directory' : [ 143, '', 'bold', 'afaf5f', '', 'bold'] + \ , 'Underlined' : [ 130, '', '', 'af5f00', '', ''] + \ + \ , 'Question' : [ 74, '', 'bold', '5fafd7', '', 'bold'] + \ , 'MoreMsg' : [ 214, '', 'bold', 'ffaf00', '', 'bold'] + \ , 'WarningMsg' : [ 202, '', 'bold', 'ff5f00', '', 'bold'] + \ , 'ErrorMsg' : [ 196, '', 'bold', 'ff0000', '', 'bold'] + \ + \ , 'Comment' : [ 243, 233, '', '767676', '121212', ''] + \ , 'vimCommentTitleLeader' : [ 250, 233, '', 'bcbcbc', '121212', ''] + \ , 'vimCommentTitle' : [ 250, 233, '', 'bcbcbc', '121212', ''] + \ , 'vimCommentString' : [ 245, 233, '', '8a8a8a', '121212', ''] + \ + \ , 'TabLine' : [ 231, 238, '', 'ffffff', '444444', ''] + \ , 'TabLineSel' : [ 255, '', 'bold', 'eeeeee', '', 'bold'] + \ , 'TabLineFill' : [ 240, 238, '', '585858', '444444', ''] + \ , 'TabLineNumber' : [ 160, 238, 'bold', 'd70000', '444444', 'bold'] + \ , 'TabLineClose' : [ 245, 238, 'bold', '8a8a8a', '444444', 'bold'] + \ + \ , 'SpellCap' : [ 231, 31, 'bold', 'ffffff', '0087af', 'bold'] + \ + \ , 'SpecialKey' : [ 239, '', '', '4e4e4e', '', ''] + \ , 'NonText' : [ 88, '', '', '870000', '', ''] + \ , 'MatchParen' : [ 231, 25, 'bold', 'ffffff', '005faf', 'bold'] + \ + \ , 'Constant' : [ 137, '', 'bold', 'af875f', '', 'bold'] + \ , 'Special' : [ 150, '', '', 'afd787', '', ''] + \ , 'Identifier' : [ 66, '', 'bold', '5f8787', '', 'bold'] + \ , 'Statement' : [ 186, '', 'bold', 'd7d787', '', 'bold'] + \ , 'PreProc' : [ 247, '', '', '9e9e9e', '', ''] + \ , 'Type' : [ 67, '', 'bold', '5f87af', '', 'bold'] + \ , 'String' : [ 143, '', '', 'afaf5f', '', ''] + \ , 'Number' : [ 173, '', '', 'd7875f', '', ''] + \ , 'Define' : [ 173, '', '', 'd7875f', '', ''] + \ , 'Error' : [ 208, 124, '', 'ff8700', 'af0000', ''] + \ , 'Function' : [ 179, '', '', 'd7af5f', '', ''] + \ , 'Include' : [ 173, '', '', 'd7875f', '', ''] + \ , 'PreCondit' : [ 173, '', '', 'd7875f', '', ''] + \ , 'Keyword' : [ 173, '', '', 'd7875f', '', ''] + \ , 'Search' : [ 231, 131, '', '000000', 'ffff5f', 'underline,bold'] + \ , 'Title' : [ 231, '', '', 'ffffff', '', ''] + \ , 'Delimiter' : [ 246, '', '', '949494', '', ''] + \ , 'StorageClass' : [ 187, '', '', 'd7d7af', '', ''] + \ + \ , 'TODO' : [ 228, 94, 'bold', 'ffff87', '875f00', 'bold'] + \ + \ , 'SyntasticWarning' : [ 220, 94, '', 'ffff87', '875f00', 'bold'] + \ , 'SyntasticError' : [ 202, 52, '', 'ffff87', '875f00', 'bold'] + \ + \ , 'Pmenu' : [ 248, 240, '', 'a8a8a8', '585858', ''] + \ , 'PmenuSel' : [ 253, 245, '', 'dadada', '8a8a8a', ''] + \ , 'PmenuSbar' : [ 253, 248, '', 'dadada', 'a8a8a8', ''] + \ + \ , 'phpEOL' : [ 245, '', '', 'dadada', '', ''] + \ , 'phpStringDelim' : [ 94, '', '', '875f00', '', ''] + \ , 'phpDelimiter' : [ 160, '', '', 'd70000', '', ''] + \ , 'phpFunctions' : [ 221, '', 'bold', 'ffd75f', '', 'bold'] + \ , 'phpBoolean' : [ 172, '', 'bold', 'd78700', '', 'bold'] + \ , 'phpOperator' : [ 215, '', '', 'ffaf5f', '', ''] + \ , 'phpMemberSelector' : [ 138, '', 'bold', 'af8787', '', 'bold'] + \ , 'phpParent' : [ 227, '', '', 'ffff5f', '', ''] + \ + \ , 'PHPClassTag' : [ 253, '', '', 'dadada', '', ''] + \ , 'PHPInterfaceTag' : [ 253, '', '', 'dadada', '', ''] + \ , 'PHPFunctionTag' : [ 222, '', 'bold', 'ffd787', '', 'bold'] + \ + \ , 'pythonDocString' : [ 240, 233, '', '585858', '121212', ''] + \ , 'pythonDocStringTitle' : [ 245, 233, '', 'dadada', '121212', ''] + \ , 'pythonRun' : [ 65, '', '', '5f875f', '', ''] + \ , 'pythonBuiltinObj' : [ 67, '', 'bold', '5f87af', '', 'bold'] + \ , 'pythonSelf' : [ 250, '', 'bold', 'bcbcbc', '', 'bold'] + \ , 'pythonFunction' : [ 179, '', 'bold', 'd7af5f', '', 'bold'] + \ , 'pythonClass' : [ 221, '', 'bold', 'ffd75f', '', 'bold'] + \ , 'pythonExClass' : [ 130, '', '', 'af5f00', '', ''] + \ , 'pythonException' : [ 130, '', 'bold', 'af5f00', '', 'bold'] + \ , 'pythonOperator' : [ 186, '', '', 'd7d787', '', ''] + \ , 'pythonPreCondit' : [ 152, '', 'bold', 'afd7d7', '', 'bold'] + \ , 'pythonDottedName' : [ 166, '', '', 'd75f00', '', ''] + \ , 'pythonDecorator' : [ 124, '', 'bold', 'af0000', '', 'bold'] + \ + \ , 'PythonInterfaceTag' : [ 109, '', '', '87afaf', '', ''] + \ , 'PythonClassTag' : [ 221, '', '', 'ffd75f', '', ''] + \ , 'PythonFunctionTag' : [ 109, '', '', '87afaf', '', ''] + \ , 'PythonVariableTag' : [ 253, '', '', 'dadada', '', ''] + \ , 'PythonMemberTag' : [ 145, '', '', 'afafaf', '', ''] + \ + \ , 'CTagsImport' : [ 109, '', '', '87afaf', '', ''] + \ , 'CTagsClass' : [ 221, '', '', 'ffd75f', '', ''] + \ , 'CTagsFunction' : [ 109, '', '', '87afaf', '', ''] + \ , 'CTagsGlobalVariable' : [ 253, '', '', 'dadada', '', ''] + \ , 'CTagsMember' : [ 145, '', '', 'afafaf', '', ''] + \ + \ , 'xmlTag' : [ 149, '', 'bold', 'afd75f', '', 'bold'] + \ , 'xmlTagName' : [ 250, '', '', 'bcbcbc', '', ''] + \ , 'xmlEndTag' : [ 209, '', 'bold', 'ff875f', '', 'bold'] + \ + \ , 'cssImportant' : [ 166, '', 'bold', 'd75f00', '', 'bold'] + \ + \ , 'DiffAdd' : [ 112, 22, '', '87d700', '005f00', ''] + \ , 'DiffChange' : [ 220, 94, '', 'ffd700', '875f00', ''] + \ , 'DiffDelete' : [ 160, '', '', 'd70000', '', ''] + \ , 'DiffText' : [ 220, 94, 'reverse,bold', 'ffd700', '875f00', 'reverse,bold'] + \ + \ , 'diffLine' : [ 68, '', 'bold', '5f87d7', '', 'bold'] + \ , 'diffFile' : [ 242, '', '', '6c6c6c', '', ''] + \ , 'diffNewFile' : [ 242, '', '', '6c6c6c', '', ''] +\ }) + +hi link htmlTag xmlTag +hi link htmlTagName xmlTagName +hi link htmlEndTag xmlEndTag + +hi link phpCommentTitle vimCommentTitle +hi link phpDocTags vimCommentString +hi link phpDocParam vimCommentTitle + +hi link diffAdded DiffAdd +hi link diffChanged DiffChange +hi link diffRemoved DiffDelete diff --git a/vim/colors/grb256.vim b/vim/colors/grb256.vim new file mode 100644 index 0000000..10c57c0 --- /dev/null +++ b/vim/colors/grb256.vim @@ -0,0 +1,32 @@ +" Based on +runtime colors/ir_black.vim + +let g:colors_name = "grb256" + +hi pythonSpaceError ctermbg=red guibg=red + +hi Comment ctermfg=darkgray + +hi StatusLine ctermbg=darkgrey ctermfg=white +hi StatusLineNC ctermbg=black ctermfg=lightgrey +hi VertSplit ctermbg=black ctermfg=lightgrey +hi LineNr ctermfg=darkgray +hi CursorLine guifg=NONE guibg=#121212 gui=NONE ctermfg=NONE ctermbg=234 +hi Function guifg=#FFD2A7 guibg=NONE gui=NONE ctermfg=yellow ctermbg=NONE cterm=NONE +hi Visual guifg=NONE guibg=#262D51 gui=NONE ctermfg=NONE ctermbg=236 cterm=NONE + +hi Error guifg=NONE guibg=NONE gui=undercurl ctermfg=16 ctermbg=red cterm=NONE guisp=#FF6C60 " undercurl color +hi ErrorMsg guifg=white guibg=#FF6C60 gui=BOLD ctermfg=16 ctermbg=red cterm=NONE +hi WarningMsg guifg=white guibg=#FF6C60 gui=BOLD ctermfg=16 ctermbg=red cterm=NONE +hi SpellBad guifg=white guibg=#FF6C60 gui=BOLD ctermfg=16 ctermbg=160 cterm=NONE + +" ir_black doesn't highlight operators for some reason +hi Operator guifg=#6699CC guibg=NONE gui=NONE ctermfg=lightblue ctermbg=NONE cterm=NONE + +highlight DiffAdd term=reverse cterm=bold ctermbg=lightgreen ctermfg=16 +highlight DiffChange term=reverse cterm=bold ctermbg=lightblue ctermfg=16 +highlight DiffText term=reverse cterm=bold ctermbg=lightgray ctermfg=16 +highlight DiffDelete term=reverse cterm=bold ctermbg=lightred ctermfg=16 + +highlight PmenuSel ctermfg=16 ctermbg=156 + diff --git a/vim/colors/gruber-darker.vim b/vim/colors/gruber-darker.vim new file mode 100644 index 0000000..1bd9d87 --- /dev/null +++ b/vim/colors/gruber-darker.vim @@ -0,0 +1,228 @@ +" GruberDarker Theme for Vim +" +" Adapted from an Emacs theme: +" https://github.com/rexim/gruber-darker-theme +" +" Colorscheme template: https://github.com/mhartington/oceanic-next/blob/master/colors/OceanicNext.vim +" -------------------------------------------- + +" {{{ Setup + set background=dark + hi clear + if exists("syntax_on") + syntax reset + endif + let g:colors_name="GruberDarker" +" }}} +" {{{ Italics + let g:gruber_terminal_italic = get(g:, 'gruber_terminal_italic', 0) + let s:italic = "" + if g:gruber_terminal_italic == 1 + let s:italic = "italic" + endif +"}}} +" {{{ Bold + let g:gruber_terminal_bold = get(g:, 'gruber_terminal_bold', 0) + let s:bold = "" + if g:gruber_terminal_bold == 1 + let s:bold = "bold" + endif +"}}} +" {{{ Colors + let s:gruberFG=['#e4e4ef', '253'] + let s:gruberFG1=['#f4f4ff', '254'] + let s:gruberFG2=['#f5f5ff', '240'] + let s:gruberFG3=['#65737e', '243'] + let s:gruberWhite=['#ffffff', '15'] + let s:gruberBlack=['#000000', '0'] + let s:gruberBG=['#181818', '233'] + let s:gruberBG1=['#282828', '235'] + let s:gruberBG2=['#453d41', '238'] + let s:gruberLightRed=['#c73c3f', '203'] + let s:gruberRed=['#f43841', '160'] + let s:gruberNiagara=['#96a6c8', '147'] + let s:gruberQuartz=['#95a99f', '108'] + let s:gruberGreen=['#73c936', '70'] + let s:gruberMain=['#ffdd33', '220'] + let s:gruberBrown=['#cc8c3c', '172'] + let s:gruberPurple=['#9e95c7', '98'] + let s:gruberLightBlue=['#0087d7', '32'] + let s:gruberBlue=['#0000d7', '20'] + let s:gruberGold=['#d7af00', '178'] + let s:none=['NONE', 'NONE'] + +" {{{ Highlight function +function! <sid>hi(group, fg, bg, attr, attrsp) + " fg, bg, attr, attrsp + if !empty(a:fg) + exec "hi " . a:group . " guifg=" . a:fg[0] + exec "hi " . a:group . " ctermfg=" . a:fg[1] + endif + if !empty(a:bg) + exec "hi " . a:group . " guibg=" . a:bg[0] + exec "hi " . a:group . " ctermbg=" . a:bg[1] + endif + if a:attr != "" + exec "hi " . a:group . " gui=" . a:attr + exec "hi " . a:group . " cterm=" . a:attr + endif + if !empty(a:attrsp) + exec "hi " . a:group . " guisp=" . a:attrsp[0] + endif +endfunction +" }}} +" {{{ call <sid>:hi(group, fg, bg, gui, guisp) +call <sid>hi('Bold', '', '', 'bold', '') +call <sid>hi('Debug', s:gruberFG2, '', '', '') +call <sid>hi('Directory', s:gruberLightBlue, '', '', '') +call <sid>hi('ErrorMsg', s:gruberWhite, s:gruberRed, '', '') +call <sid>hi('Exception', s:gruberBrown, '', '', '') +call <sid>hi('FoldColumn', s:gruberBrown, s:gruberFG2, '', '') +call <sid>hi('Folded', s:gruberBrown, s:gruberFG2, s:italic, '') +call <sid>hi('IncSearch', s:gruberBlack, s:gruberFG2, 'NONE', '') +call <sid>hi('Italic', '', '', s:italic, '') + +call <sid>hi('Macro', s:gruberFG, '', '', '') +call <sid>hi('MatchParen', s:gruberBG2, s:gruberMain, '', '') +call <sid>hi('ModeMsg', s:gruberFG2, '', '', '') +call <sid>hi('MoreMsg', s:gruberFG2, '', '', '') +call <sid>hi('Question', s:gruberNiagara, '', '', '') +call <sid>hi('Search', s:gruberBlack, s:gruberMain, '', '') +call <sid>hi('SpecialKey', s:gruberFG2, '', '', '') +call <sid>hi('TooLong', s:gruberFG2, '', '', '') +call <sid>hi('Underlined', s:gruberPurple, '', '', '') +call <sid>hi('Visual', '', s:gruberBG2, '', '') +call <sid>hi('VisualNOS', s:gruberRed, '', '', '') +call <sid>hi('WarningMsg', s:gruberRed, '', '', '') +call <sid>hi('WildMenu', s:gruberBlack, s:gruberMain, '', '') +call <sid>hi('Title', s:gruberQuartz, '', '', '') +call <sid>hi('Conceal', s:gruberFG, s:gruberBG, '', '') +call <sid>hi('Cursor', s:gruberBG, s:gruberFG, '', '') +call <sid>hi('NonText', s:gruberFG2, '', '', '') +call <sid>hi('Normal', s:gruberFG, s:gruberBG, '', '') +call <sid>hi('EndOfBuffer', s:gruberFG, s:gruberBG, '', '') +call <sid>hi('LineNr', s:gruberFG, s:gruberBG, '', '') +call <sid>hi('SignColumn', s:none, s:none, '', '') +call <sid>hi('VertSplit', s:gruberFG2, s:gruberBG1, '', '') +call <sid>hi('ColorColumn', '', s:gruberBG2, '', '') +call <sid>hi('CursorColumn', '', s:gruberBG2, '', '') +call <sid>hi('CursorLine', '', s:gruberBG2, 'NONE', '') +call <sid>hi('CursorLineNr', s:gruberMain, s:gruberBG, '', '') +call <sid>hi('PMenu', s:gruberFG, s:gruberBG1, '', '') +call <sid>hi('PMenuSel', s:gruberFG, s:gruberBG2, '', '') +call <sid>hi('PmenuSbar', '', s:gruberBG, '', '') +call <sid>hi('PmenuThumb', '', s:gruberBG, '', '') +call <sid>hi('helpExample', s:gruberMain, '', '', '') +call <sid>hi('helpCommand', s:gruberMain, '', '', '') + +" Standard syntax highlighting +call <sid>hi('Boolean', s:gruberQuartz, '', '', '') +call <sid>hi('Character', s:gruberGreen, '', '', '') +call <sid>hi('Comment', s:gruberBrown, '', s:italic, '') +call <sid>hi('Conditional', s:gruberMain, '', '', '') +call <sid>hi('Constant', s:gruberQuartz, '', '', '') +call <sid>hi('Define', s:gruberMain, '', '', '') +call <sid>hi('Delimiter', s:gruberFG, '', '', '') +call <sid>hi('Float', s:gruberQuartz, '', '', '') +call <sid>hi('Function', s:gruberNiagara, '', '', '') +call <sid>hi('Identifier', s:gruberNiagara, '', '', '') +call <sid>hi('Include', s:gruberMain, '', '', '') +call <sid>hi('Keyword', s:gruberMain, '', '', '') +call <sid>hi('Label', s:gruberFG, '', '', '') +call <sid>hi('Number', s:gruberQuartz, '', '', '') +call <sid>hi('Operator', s:gruberFG, '', '', '') +call <sid>hi('PreProc', s:gruberFG1, '', '', '') +call <sid>hi('Repeat', s:gruberMain, '', '', '') +call <sid>hi('Special', s:gruberMain, '', '', '') +call <sid>hi('SpecialChar', s:gruberMain, '', '', '') +call <sid>hi('Statement', s:gruberMain, '', '', '') +call <sid>hi('StorageClass', s:gruberMain, '', '', '') +call <sid>hi('String', s:gruberGreen, '', '', '') +call <sid>hi('Structure', s:gruberMain, '', '', '') +call <sid>hi('Todo', s:gruberBG, s:gruberMain, '', '') +call <sid>hi('Type', s:gruberQuartz, '', '', '') +call <sid>hi('Typedef', s:gruberQuartz, '', '', '') + +call <sid>hi('SpellBad', '', '', 'undercurl', '') +call <sid>hi('SpellLocal', '', '', 'undercurl', '') +call <sid>hi('SpellCap', '', '', 'undercurl', '') +call <sid>hi('SpellRare', '', '', 'undercurl', '') + +" Haskell Highlighting +call <sid>hi('hsTypeDef', s:gruberMain, '', '', '') +call <sid>hi('hsStructure', s:gruberMain, '', '', '') +call <sid>hi('hsStatement', s:gruberMain, '', '', '') +call <sid>hi('hsconditional', s:gruberMain, '', '', '') +call <sid>hi('hsconditional', s:gruberMain, '', '', '') +call <sid>hi('hsconditional', s:gruberMain, '', '', '') + +" Java Highlighting +" TODO Fix function definitions +call <sid>hi('javaConstant', s:gruberQuartz, '', '', '') +call <sid>hi('javaConditional', s:gruberMain, '', '', '') +call <sid>hi('javaOperator', s:gruberMain, '', '', '') +call <sid>hi('javaExceptions', s:gruberMain, '', '', '') +call <sid>hi('javaAssert', s:gruberMain, '', '', '') +call <sid>hi('javaClassDecl', s:gruberMain, '', '', '') +call <sid>hi('javaBraces', s:gruberFG, '', '', '') +call <sid>hi('javaLangObject', s:gruberFG, '', '', '') +call <sid>hi('javaType', s:gruberQuartz, '', '', '') + +" Python Highlighting +call <sid>hi('pythonRepeat', s:gruberMain, '', '', '') +call <sid>hi('pythonOperator', s:gruberMain, '', '', '') +call <sid>hi('pythonException', s:gruberMain, '', '', '') + + +call <sid>hi('markdownCode', s:gruberGreen, '', '', '') +call <sid>hi('markdownCodeBlock', s:gruberGreen, '', '', '') +call <sid>hi('markdownHeadingDelimiter', s:gruberNiagara, '', '', '') +call <sid>hi('markdownItalic', s:gruberPurple, '', s:italic, '') +call <sid>hi('markdownBold', s:gruberMain, '', s:bold, '') +call <sid>hi('markdownCodeDelimiter', s:gruberBrown, '', s:italic, '') +call <sid>hi('markdownError', s:gruberFG, s:gruberBG1, '', '') + +call <sid>hi('ALEErrorSign', s:gruberRed, s:gruberBG2, s:bold, '') +call <sid>hi('ALEWarningSign', s:gruberMain, s:gruberBG2, s:bold, '') +call <sid>hi('ALEInfoSign', s:gruberGreen, s:gruberBG2, s:bold, '') + +call <sid>hi('NERDTreeExecFile', s:gruberFG, '', '', '') +call <sid>hi('NERDTreeDirSlash', s:gruberNiagara, '', '', '') +call <sid>hi('NERDTreeOpenable', s:gruberNiagara, '', '', '') +call <sid>hi('NERDTreeFile', '', s:none, '', '') +call <sid>hi('NERDTreeFlags', s:gruberNiagara, '', '', '') + +call <sid>hi('vimfilerLeaf', s:gruberFG, '', '', '') +call <sid>hi('vimfilerNormalFile', s:gruberFG, s:gruberBG1, '', '') +call <sid>hi('vimfilerOpenedFile', s:gruberNiagara, '', '', '') +call <sid>hi('vimfilerClosedFile', s:gruberNiagara, '', '', '') + +" }}} + +let g:terminal_color_0=s:gruberBG1[0] +let g:terminal_color_8=s:gruberBG1[0] + +let g:terminal_color_1=s:gruberLightRed[0] +let g:terminal_color_9=s:gruberLightRed[0] + +let g:terminal_color_2=s:gruberGreen[0] +let g:terminal_color_10=s:gruberGreen[0] + +let g:terminal_color_3=s:gruberMain[0] +let g:terminal_color_11=s:gruberMain[0] + +let g:terminal_color_4=s:gruberNiagara[0] +let g:terminal_color_12=s:gruberNiagara[0] + +let g:terminal_color_5=s:gruberPurple[0] +let g:terminal_color_13=s:gruberPurple[0] + +let g:terminal_color_6=s:gruberNiagara[0] +let g:terminal_color_14=s:gruberNiagara[0] + +let g:terminal_color_7=s:gruberFG[0] +let g:terminal_color_15=s:gruberFG[0] + +let g:terminal_color_background=s:gruberBG1[0] +let g:terminal_color_foreground=s:gruberWhite[0] + diff --git a/vim/colors/hipster.vim b/vim/colors/hipster.vim new file mode 100644 index 0000000..973aeb1 --- /dev/null +++ b/vim/colors/hipster.vim @@ -0,0 +1,102 @@ +" --- hipster --- +" Author: Conner McDaniel (connermcd.com) +if version > 580 + hi clear + if exists("syntax_on") + syntax reset + endif +endif + +let g:colors_name = "hipster" +set t_Co=256 +set background=dark + +" Vim >= 7.0 specific colors +if version >= 700 +hi CursorLine guifg=NONE guibg=#32322f guisp=NONE gui=NONE ctermfg=NONE ctermbg=236 cterm=NONE +hi CursorLineNr guifg=#8a8a8a guibg=#32322f guisp=NONE gui=NONE ctermfg=245 ctermbg=236 cterm=NONE +hi MatchParen guifg=#eae788 guibg=#857b6f guisp=NONE gui=bold ctermfg=228 ctermbg=101 cterm=bold +hi PMenu guifg=#dddddd guibg=#423d35 guisp=#423d35 gui=NONE ctermfg=253 ctermbg=238 cterm=NONE +hi PMenuSbar guifg=NONE guibg=#848688 guisp=#848688 gui=NONE ctermfg=NONE ctermbg=102 cterm=NONE +hi PMenuSel guifg=#ffd700 guibg=#706070 guisp=#706070 gui=bold ctermfg=220 ctermbg=242 cterm=bold +hi PMenuThumb guifg=NONE guibg=#a4a5a8 guisp=#a4a5a8 gui=NONE ctermfg=NONE ctermbg=248 cterm=NONE +endif + +" General colors +hi Normal guifg=#f9f8ff guibg=#000000 guisp=NONE gui=NONE ctermfg=15 ctermbg=NONE cterm=NONE +hi Cursor guifg=NONE guibg=#cd6f5c guisp=#cd6f5c gui=NONE ctermfg=NONE ctermbg=173 cterm=NONE +hi Visual guifg=#c3c6ca guibg=#554d4b guisp=NONE gui=NONE ctermfg=251 ctermbg=239 cterm=NONE +hi Visualnos guifg=#c3c6ca guibg=#303030 guisp=NONE gui=NONE ctermfg=251 ctermbg=236 cterm=NONE +hi Search guifg=#000000 guibg=#8dabcd guisp=#8dabcd gui=NONE ctermfg=NONE ctermbg=110 cterm=NONE +hi Folded guifg=#857b6f guibg=#000000 guisp=NONE gui=NONE ctermfg=241 ctermbg=233 cterm=NONE +hi StatusLineNC guifg=NONE guibg=#262626 guisp=#262626 gui=NONE ctermfg=NONE ctermbg=235 cterm=NONE +hi VertSplit guifg=#444444 guibg=#444444 guisp=NONE gui=NONE ctermfg=238 ctermbg=238 cterm=NONE +" hi StatusLineNC guifg=#857b6f guibg=#444444 guisp=NONE gui=NONE ctermfg=241 ctermbg=238 cterm=NONE +hi LineNr guifg=#595959 guibg=NONE guisp=NONE gui=NONE ctermfg=240 ctermbg=NONE cterm=NONE +hi SpecialKey guifg=#87beeb guibg=NONE guisp=NONE gui=NONE ctermfg=117 ctermbg=NONE cterm=NONE +hi WarningMsg guifg=#bd4848 guibg=#f9f8ff guisp=#f9f8ff gui=bold ctermfg=131 ctermbg=15 cterm=bold +hi ErrorMsg guifg=#bd5353 guibg=NONE guisp=NONE gui=NONE ctermfg=131 ctermbg=NONE cterm=NONE +hi MoreMsg guifg=#ffff00 guibg=NONE guisp=NONE gui=NONE ctermfg=11 ctermbg=NONE cterm=NONE + +" Diff highlighting +hi DiffAdd guifg=NONE guibg=#301430 guisp=#3c664e gui=NONE ctermfg=NONE ctermbg=236 cterm=NONE +hi DiffDelete guifg=#ad3838 guibg=#301430 guisp=#301430 gui=NONE ctermfg=131 ctermbg=236 cterm=NONE +hi DiffChange guifg=NONE guibg=#7e8c2d guisp=#331833 gui=NONE ctermfg=NONE ctermbg=238 cterm=NONE + +" Syntax highlighting +hi Keyword guifg=#d6d69a guibg=NONE guisp=NONE gui=NONE ctermfg=186 ctermbg=NONE cterm=NONE +hi Function guifg=#bf9b76 guibg=NONE guisp=NONE gui=NONE ctermfg=137 ctermbg=NONE cterm=NONE +hi Constant guifg=#44807d guibg=NONE guisp=NONE gui=NONE ctermfg=66 ctermbg=NONE cterm=NONE +hi Number guifg=#386175 guibg=NONE guisp=NONE gui=NONE ctermfg=66 ctermbg=NONE cterm=NONE +hi PreProc guifg=#ad5234 guibg=NONE guisp=NONE gui=NONE ctermfg=131 ctermbg=NONE cterm=NONE +hi Statement guifg=#418db3 guibg=NONE guisp=NONE gui=NONE ctermfg=67 ctermbg=NONE cterm=NONE +hi Identifier guifg=#5f875f guibg=NONE guisp=NONE gui=NONE ctermfg=65 ctermbg=NONE cterm=NONE +hi Type guifg=#babaa2 guibg=NONE guisp=NONE gui=NONE ctermfg=144 ctermbg=NONE cterm=NONE +hi Special guifg=#7a490d guibg=NONE guisp=NONE gui=NONE ctermfg=3 ctermbg=NONE cterm=NONE +hi String guifg=#7e8c2d guibg=NONE guisp=NONE gui=NONE ctermfg=100 ctermbg=NONE cterm=NONE +hi Comment guifg=#576157 guibg=NONE guisp=NONE gui=NONE ctermfg=241 ctermbg=NONE cterm=NONE +hi Todo guifg=#a1481e guibg=NONE guisp=NONE gui=NONE ctermfg=130 ctermbg=NONE cterm=NONE + +" Linking +hi! link FoldColumn Folded +hi! link CursorColumn CursorLine +hi! link Search CursorLine +hi! link NonText LineNr +hi! link DiffText DiffChange +hi! link SpellBad ErrorMsg +hi! link SpellCap ErrorMsg +hi! link Error ErrorMsg +hi! link Question MoreMsg +hi! link htmlBold Special +hi! link htmlItalic Number +hi! link Title Function + +" Unhighlighted: +" CursorIM +" CursorColumn +" DiffText +" Directory +" FoldColumn +" IncSearch +" Menu +" ModeMsg +" MoreMsg +" NonText +" PmenuSbar +" PmenuThumb +" Question +" Scrollbar +" SignColumn +" SpellBad +" SpellLocal +" SpellRare +" TabLine +" TabLineFill +" TabLineSel +" Tooltip +" User1 +" User9 +" WildMenu +" Links + +" vim: ts=3:sw=3:et diff --git a/vim/colors/nofrils-acme.vim b/vim/colors/nofrils-acme.vim new file mode 100644 index 0000000..fd63ed5 --- /dev/null +++ b/vim/colors/nofrils-acme.vim @@ -0,0 +1,189 @@ +" Name: No Frils Acme Colorscheme +" Author: robertmeta (on Github) +" URL: https://github.com/robertmeta/nofrils +" (see this url for latest release & screenshots) +" License: OSI approved MIT license + +hi clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "nofrils-acme" + +if !exists("g:nofrils_strbackgrounds") + let g:nofrils_strbackgrounds = 0 +endif +if !exists("g:nofrils_heavycomments") + let g:nofrils_heavycomments = 0 +endif +if !exists("g:nofrils_heavylinenumbers") + let g:nofrils_heavylinenumbers = 0 +endif + +set background=light + +" Baseline +hi Normal term=NONE cterm=NONE ctermfg=black ctermbg=230 gui=NONE guifg=#000000 guibg=#ffffd7 + +" Faded +hi ColorColumn term=NONE cterm=NONE ctermfg=NONE ctermbg=253 gui=NONE guifg=NONE guibg=#dadada +hi Comment term=NONE cterm=NONE ctermfg=136 ctermbg=NONE gui=NONE guifg=#af8700 guibg=NONE +hi FoldColumn term=NONE cterm=NONE ctermfg=136 ctermbg=NONE gui=NONE guifg=#af8700 guibg=NONE +hi Folded term=NONE cterm=NONE ctermfg=240 ctermbg=NONE gui=NONE guifg=#585858 guibg=NONE +hi LineNr term=NONE cterm=NONE ctermfg=136 ctermbg=bg gui=NONE guifg=#af8700 guibg=NONE +hi NonText term=NONE cterm=NONE ctermfg=136 ctermbg=NONE gui=NONE guifg=#af8700 guibg=NONE +hi SignColumn term=NONE cterm=NONE ctermfg=240 ctermbg=bg gui=NONE guifg=#585858 guibg=bg +hi SpecialComment term=NONE cterm=NONE ctermfg=136 ctermbg=NONE gui=NONE guifg=#af8700 guibg=NONE +hi SpecialKey term=NONE cterm=NONE ctermfg=240 ctermbg=bg gui=NONE guifg=#585858 guibg=bg +hi StatusLineNC term=NONE cterm=NONE ctermfg=fg ctermbg=195 gui=NONE guifg=fg guibg=#d7ffff +hi VertSplit term=NONE cterm=NONE ctermfg=fg ctermbg=195 gui=NONE guifg=fg guibg=#d7ffff + +" Highlight +hi CursorColumn term=NONE cterm=NONE ctermfg=NONE ctermbg=228 gui=NONE guifg=NONE guibg=#ffff87 +hi CursorIM term=NONE cterm=NONE ctermfg=fg ctermbg=4 gui=NONE guifg=fg guibg=#00ffff +hi CursorLineNr term=NONE cterm=NONE ctermfg=0 ctermbg=228 gui=NONE guifg=NONE guibg=#ffff87 +hi CursorLine term=NONE cterm=NONE ctermfg=NONE ctermbg=228 gui=NONE guifg=NONE guibg=#ffff87 +hi Cursor term=NONE cterm=NONE ctermfg=fg ctermbg=4 gui=NONE guifg=fg guibg=#00ffff +hi Directory term=NONE cterm=NONE ctermfg=53 ctermbg=NONE gui=NONE guifg=#5f005f guibg=NONE +hi ErrorMsg term=NONE cterm=NONE ctermfg=9 ctermbg=white gui=NONE guifg=#ff5555 guibg=white +hi Error term=NONE cterm=NONE ctermfg=9 ctermbg=white gui=NONE guifg=#ff5555 guibg=white +hi IncSearch term=NONE cterm=NONE ctermfg=white ctermbg=2 gui=NONE guifg=white guibg=#008000 +hi Search term=NONE cterm=NONE ctermfg=white ctermbg=2 gui=NONE guifg=white guibg=#008000 +hi MatchParen term=NONE cterm=NONE ctermfg=15 ctermbg=4 gui=NONE guifg=#ffffff guibg=#000080 +hi ModeMsg term=NONE cterm=NONE ctermfg=53 ctermbg=NONE gui=NONE guifg=#5f005f guibg=NONE +hi MoreMsg term=NONE cterm=NONE ctermfg=53 ctermbg=NONE gui=NONE guifg=#5f005f guibg=NONE +hi PmenuSel term=NONE cterm=NONE ctermfg=fg ctermbg=13 gui=NONE guifg=fg guibg=#ff00ff +hi Question term=NONE cterm=NONE ctermfg=53 ctermbg=NONE gui=NONE guifg=#5f005f guibg=NONE +hi StatusLine term=NONE cterm=NONE ctermbg=183 ctermfg=fg gui=NONE guifg=white guibg=#000000 +hi Todo term=NONE cterm=NONE ctermfg=2 ctermbg=NONE gui=NONE guifg=#008000 guibg=NONE +hi WarningMsg term=NONE cterm=NONE ctermfg=9 ctermbg=white gui=NONE guifg=#ff5555 guibg=white +hi WildMenu term=NONE cterm=NONE ctermbg=fg ctermfg=183 gui=NONE guifg=#000000 guibg=white +hi Visual term=NONE cterm=NONE ctermfg=fg ctermbg=222 gui=NONE guifg=NONE guibg=#ffd787 +hi VisualNOS term=underline cterm=underline ctermfg=fg ctermbg=222 gui=underline guifg=NONE guibg=#ffd787 + +" Reversed +hi PmenuSbar term=reverse cterm=reverse ctermfg=NONE ctermbg=NONE gui=reverse guifg=NONE guibg=NONE +hi Pmenu term=reverse cterm=reverse ctermfg=NONE ctermbg=NONE gui=reverse guifg=NONE guibg=NONE +hi PmenuThumb term=reverse cterm=reverse ctermfg=NONE ctermbg=NONE gui=reverse guifg=NONE guibg=NONE +hi TabLineSel term=reverse cterm=reverse ctermfg=NONE ctermbg=NONE gui=reverse guifg=NONE guibg=NONE + +" Diff +hi DiffAdd term=NONE cterm=NONE ctermfg=2 ctermbg=NONE gui=NONE guifg=#008000 guibg=NONE +hi DiffChange term=NONE cterm=NONE ctermfg=94 ctermbg=NONE gui=NONE guifg=#875f00 guibg=NONE +hi DiffDelete term=NONE cterm=NONE ctermfg=1 ctermbg=NONE gui=NONE guifg=#800000 guibg=NONE +hi DiffText term=NONE cterm=NONE ctermfg=4 ctermbg=NONE gui=NONE guifg=#000080 guibg=NONE + +" Spell +hi SpellBad term=underline cterm=underline ctermfg=5 ctermbg=NONE gui=underline guifg=#cd00cd guibg=NONE +hi SpellCap term=underline cterm=underline ctermfg=5 ctermbg=NONE gui=underline guifg=#cd00cd guibg=NONE +hi SpellLocal term=underline cterm=underline ctermfg=5 ctermbg=NONE gui=underline guifg=#cd00cd guibg=NONE +hi SpellRare term=underline cterm=underline ctermfg=5 ctermbg=NONE gui=underline guifg=#cd00cd guibg=NONE + +" Vim Features +hi Menu term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Scrollbar term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi TabLineFill term=NONE cterm=NONE ctermfg=fg ctermbg=136 gui=NONE guifg=fg guibg=#af8700 +hi TabLine term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Tooltip term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + +" Syntax Highsepiaing (or lack there of) +hi Boolean term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Character term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Conceal term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Conditional term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Constant term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Debug term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Define term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Delimiter term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Directive term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Exception term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Float term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Format term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Function term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Identifier term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Ignore term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Include term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Keyword term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Label term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Macro term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Number term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Operator term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi PreCondit term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi PreProc term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Repeat term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi SpecialChar term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Special term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Statement term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi StorageClass term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi String term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Structure term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Tag term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Title term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Typedef term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Type term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Underlined term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + +" Sneak +hi SneakLabelMask term=NONE cterm=NONE ctermfg=black ctermbg=195 gui=NONE guifg=black guibg=#d7ffff +hi SneakTarget term=NONE cterm=NONE ctermfg=black ctermbg=195 gui=NONE guifg=black guibg=#d7ffff +hi SneakLabelTarget term=NONE cterm=NONE ctermfg=black ctermbg=183 gui=NONE guifg=black guibg=#d7afff +hi SneakScope term=NONE cterm=NONE ctermfg=black ctermbg=183 gui=NONE guifg=black guibg=#d7afff + +" Helper Functions +function! NofrilsFocusComments() + hi Comment term=NONE cterm=NONE ctermfg=black ctermbg=NONE gui=NONE guifg=#af8700 guibg=NONE + hi Normal term=NONE cterm=NONE ctermfg=136 ctermbg=230 gui=NONE guifg=#000000 guibg=#ffffd7 + hi LineNr term=NONE cterm=NONE ctermfg=136 ctermbg=bg gui=NONE guifg=#af8700 guibg=NONE + hi Character term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + hi String term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + + if g:nofrils_heavycomments + hi Comment term=NONE cterm=NONE ctermfg=89 ctermbg=NONE gui=NONE guifg=#87005F guibg=NONE + end +endfunction + +function! NofrilsFocusCode() + hi Comment term=NONE cterm=NONE ctermfg=136 ctermbg=NONE gui=NONE guifg=#af8700 guibg=NONE + hi Normal term=NONE cterm=NONE ctermfg=black ctermbg=230 gui=NONE guifg=#000000 guibg=#ffffd7 + hi LineNr term=NONE cterm=NONE ctermfg=136 ctermbg=bg gui=NONE guifg=#af8700 guibg=NONE + hi Character term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + hi String term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + + if g:nofrils_strbackgrounds + hi Character term=NONE cterm=NONE ctermfg=NONE ctermbg=white gui=NONE guifg=NONE guibg=white + hi String term=NONE cterm=NONE ctermfg=NONE ctermbg=white gui=NONE guifg=NONE guibg=white + end +endfunction + +function! NofrilsNormal() + hi Comment term=NONE cterm=NONE ctermfg=136 ctermbg=NONE gui=NONE guifg=#af8700 guibg=NONE + hi Normal term=NONE cterm=NONE ctermfg=black ctermbg=230 gui=NONE guifg=#000000 guibg=#ffffd7 + hi LineNr term=NONE cterm=NONE ctermfg=136 ctermbg=bg gui=NONE guifg=#af8700 guibg=NONE + hi Character term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + hi String term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + + " Optional Syntax Features + if g:nofrils_strbackgrounds + hi Character term=NONE cterm=NONE ctermfg=NONE ctermbg=white gui=NONE guifg=NONE guibg=white + hi String term=NONE cterm=NONE ctermfg=NONE ctermbg=white gui=NONE guifg=NONE guibg=white + end + if g:nofrils_heavycomments + hi Comment term=NONE cterm=NONE ctermfg=89 ctermbg=NONE gui=NONE guifg=#87005f guibg=NONE + end + if g:nofrils_heavylinenumbers + hi LineNr term=NONE cterm=NONE ctermfg=89 ctermbg=NONE gui=NONE guifg=#87005f guibg=NONE + end +endfunction + +" Command mappings +command! NofrilsDark :colo nofrils-dark +command! NofrilsLight :colo nofrils-light +command! NofrilsSepia :colo nofrils-sepia +command! NofrilsAcme :colo nofrils-acme +command! NofrilsFocusNormal :call NofrilsNormal() +command! NofrilsFocusCode :call NofrilsFocusCode() +command! NofrilsFocusComments :call NofrilsFocusComments() + +" Setup normal settings +call NofrilsNormal() diff --git a/vim/colors/nofrils-dark.vim b/vim/colors/nofrils-dark.vim new file mode 100644 index 0000000..eac53b9 --- /dev/null +++ b/vim/colors/nofrils-dark.vim @@ -0,0 +1,189 @@ +" Name: No Frils Dark Colorscheme +" Author: robertmeta (on Github) +" URL: https://github.com/robertmeta/nofrils +" (see this url for latest release & screenshots) +" License: OSI approved MIT license + +hi clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "nofrils-dark" + +if !exists("g:nofrils_strbackgrounds") + let g:nofrils_strbackgrounds = 0 +endif +if !exists("g:nofrils_heavycomments") + let g:nofrils_heavycomments = 0 +endif +if !exists("g:nofrils_heavylinenumbers") + let g:nofrils_heavylinenumbers = 0 +endif + +set background=dark + +" Baseline +hi Normal term=NONE cterm=NONE ctermfg=255 ctermbg=235 gui=NONE guifg=#eeeeee guibg=#262626 + +" Faded +hi ColorColumn term=NONE cterm=NONE ctermfg=NONE ctermbg=236 gui=NONE guifg=NONE guibg=#303030 +hi Comment term=NONE cterm=NONE ctermfg=242 ctermbg=NONE gui=NONE guifg=#6C6C6C guibg=NONE +hi FoldColumn term=NONE cterm=NONE ctermfg=242 ctermbg=NONE gui=NONE guifg=#6C6C6C guibg=NONE +hi Folded term=NONE cterm=NONE ctermfg=242 ctermbg=NONE gui=NONE guifg=#6C6C6C guibg=NONE +hi LineNr term=NONE cterm=NONE ctermfg=8 ctermbg=bg gui=NONE guifg=#808080 guibg=bg +hi NonText term=NONE cterm=NONE ctermfg=242 ctermbg=NONE gui=NONE guifg=#6C6C6C guibg=NONE +hi SignColumn term=NONE cterm=NONE ctermfg=242 ctermbg=NONE gui=NONE guifg=#6C6C6C guibg=NONE +hi SpecialComment term=NONE cterm=NONE ctermfg=242 ctermbg=NONE gui=NONE guifg=#6C6C6C guibg=NONE +hi SpecialKey term=NONE cterm=NONE ctermfg=242 ctermbg=NONE gui=NONE guifg=#6C6C6C guibg=NONE +hi StatusLineNC term=NONE cterm=NONE ctermfg=fg ctermbg=242 gui=NONE guifg=fg guibg=#6C6C6C +hi VertSplit term=NONE cterm=NONE ctermfg=black ctermbg=242 gui=NONE guifg=black guibg=#6C6C6C + +" Highlighted +hi CursorColumn term=NONE cterm=NONE ctermfg=NONE ctermbg=236 gui=NONE guifg=NONE guibg=#303030 +hi CursorIM term=NONE cterm=NONE ctermfg=black ctermbg=4 gui=NONE guifg=black guibg=#00FFFF +hi CursorLineNr term=NONE cterm=NONE ctermfg=NONE ctermbg=black gui=NONE guifg=NONE guibg=black +hi CursorLine term=NONE cterm=NONE ctermfg=NONE ctermbg=236 gui=NONE guifg=NONE guibg=#303030 +hi Cursor term=NONE cterm=NONE ctermfg=black ctermbg=4 gui=NONE guifg=black guibg=#00FFFF +hi Directory term=NONE cterm=NONE ctermfg=69 ctermbg=NONE gui=NONE guifg=#5F87FF guibg=NONE +hi ErrorMsg term=NONE cterm=NONE ctermfg=fg ctermbg=52 gui=NONE guifg=fg guibg=#5F0000 +hi Error term=NONE cterm=NONE ctermfg=fg ctermbg=52 gui=NONE guifg=fg guibg=#5F0000 +hi IncSearch term=NONE cterm=NONE ctermfg=black ctermbg=green gui=NONE guifg=black guibg=green +hi MatchParen term=NONE cterm=NONE ctermfg=15 ctermbg=4 gui=NONE guifg=#ffffff guibg=#000080 +hi ModeMsg term=NONE cterm=NONE ctermfg=69 ctermbg=NONE gui=NONE guifg=#5F87FF guibg=NONE +hi MoreMsg term=NONE cterm=NONE ctermfg=69 ctermbg=NONE gui=NONE guifg=#5F87FF guibg=NONE +hi PmenuSel term=NONE cterm=NONE ctermfg=black ctermbg=13 gui=NONE guifg=black guibg=#FF00FF +hi Question term=NONE cterm=NONE ctermfg=69 ctermbg=NONE gui=NONE guifg=#5F87FF guibg=NONE +hi Search term=NONE cterm=NONE ctermfg=black ctermbg=6 gui=NONE guifg=black guibg=#00CDCD +hi StatusLine term=NONE cterm=NONE ctermfg=black ctermbg=fg gui=NONE guifg=black guibg=fg +hi Todo term=NONE cterm=NONE ctermfg=10 ctermbg=NONE gui=NONE guifg=#00FF00 guibg=black +hi WarningMsg term=NONE cterm=NONE ctermfg=fg ctermbg=52 gui=NONE guifg=fg guibg=#5F0000 +hi WildMenu term=NONE cterm=NONE ctermfg=fg ctermbg=black gui=NONE guifg=fg guibg=black + +" Reversed +hi PmenuSbar term=reverse cterm=reverse ctermfg=NONE ctermbg=NONE gui=reverse guifg=NONE guibg=NONE +hi Pmenu term=reverse cterm=reverse ctermfg=NONE ctermbg=NONE gui=reverse guifg=NONE guibg=NONE +hi PmenuThumb term=reverse cterm=reverse ctermfg=NONE ctermbg=NONE gui=reverse guifg=NONE guibg=NONE +hi TabLineSel term=reverse cterm=reverse ctermfg=NONE ctermbg=NONE gui=reverse guifg=NONE guibg=NONE +hi Visual term=reverse cterm=reverse ctermfg=NONE ctermbg=NONE gui=reverse guifg=NONE guibg=NONE +hi VisualNOS term=reverse,underline cterm=reverse,underline ctermfg=NONE ctermbg=NONE gui=reverse,underline guifg=NONE guibg=NONE + +" Diff +hi DiffAdd term=NONE cterm=NONE ctermfg=2 ctermbg=NONE gui=NONE guifg=#008000 guibg=NONE +hi DiffChange term=NONE cterm=NONE ctermfg=3 ctermbg=NONE gui=NONE guifg=#808000 guibg=NONE +hi DiffDelete term=NONE cterm=NONE ctermfg=1 ctermbg=NONE gui=NONE guifg=#800000 guibg=NONE +hi DiffText term=NONE cterm=NONE ctermfg=4 ctermbg=NONE gui=NONE guifg=#000080 guibg=NONE + +" Spell +hi SpellBad term=underline cterm=underline ctermfg=13 ctermbg=NONE gui=underline guifg=#FF00FF guibg=NONE +hi SpellCap term=underline cterm=underline ctermfg=13 ctermbg=NONE gui=underline guifg=#FF00FF guibg=NONE +hi SpellLocal term=underline cterm=underline ctermfg=13 ctermbg=NONE gui=underline guifg=#FF00FF guibg=NONE +hi SpellRare term=underline cterm=underline ctermfg=13 ctermbg=NONE gui=underline guifg=#FF00FF guibg=NONE + +" Vim Features +hi Menu term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Scrollbar term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi TabLineFill term=NONE cterm=NONE ctermfg=fg ctermbg=242 gui=NONE guifg=fg guibg=#6C6C6C +hi TabLine term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Tooltip term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + +" Syntax Highlighting (or lack of) +hi Boolean term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Character term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Conceal term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Conditional term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Constant term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Debug term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Define term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Delimiter term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Directive term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Exception term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Float term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Format term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Function term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Identifier term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Ignore term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Include term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Keyword term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Label term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Macro term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Number term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Operator term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi PreCondit term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi PreProc term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Repeat term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi SpecialChar term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Special term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Statement term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi StorageClass term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi String term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Structure term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Tag term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Title term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Typedef term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Type term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Underlined term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + +" Sneak +hi SneakLabelMask term=NONE cterm=NONE ctermfg=black ctermbg=195 gui=NONE guifg=black guibg=#d7ffff +hi SneakTarget term=NONE cterm=NONE ctermfg=black ctermbg=195 gui=NONE guifg=black guibg=#d7ffff +hi SneakLabelTarget term=NONE cterm=NONE ctermfg=black ctermbg=183 gui=NONE guifg=black guibg=#d7afff +hi SneakScope term=NONE cterm=NONE ctermfg=black ctermbg=183 gui=NONE guifg=black guibg=#d7afff + +" Helper Functions +function! NofrilsFocusComments() + hi Comment term=NONE cterm=NONE ctermfg=255 ctermbg=235 gui=NONE guifg=#eeeeee guibg=#262626 + hi Normal term=NONE cterm=NONE ctermfg=242 ctermbg=235 gui=NONE guifg=#eeeeee guibg=#262626 + hi LineNr term=NONE cterm=NONE ctermfg=8 ctermbg=bg gui=NONE guifg=#808080 guibg=bg + hi Character term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + hi String term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + + if g:nofrils_heavycomments + hi Comment term=NONE cterm=NONE ctermfg=135 ctermbg=NONE gui=NONE guifg=#AF5FFF guibg=NONE + end +endfunction + +function! NofrilsFocusCode() + hi Comment term=NONE cterm=NONE ctermfg=242 ctermbg=235 gui=NONE guifg=#eeeeee guibg=#262626 + hi Normal term=NONE cterm=NONE ctermfg=255 ctermbg=235 gui=NONE guifg=#eeeeee guibg=#262626 + hi LineNr term=NONE cterm=NONE ctermfg=8 ctermbg=bg gui=NONE guifg=#808080 guibg=bg + hi Character term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + hi String term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + + if g:nofrils_strbackgrounds + hi Character term=NONE cterm=NONE ctermfg=NONE ctermbg=233 gui=NONE guifg=NONE guibg=#121212 + hi String term=NONE cterm=NONE ctermfg=NONE ctermbg=233 gui=NONE guifg=NONE guibg=#121212 + end +endfunction + +function! NofrilsNormal() + hi Comment term=NONE cterm=NONE ctermfg=242 ctermbg=NONE gui=NONE guifg=#6C6C6C guibg=NONE + hi Normal term=NONE cterm=NONE ctermfg=255 ctermbg=235 gui=NONE guifg=#eeeeee guibg=#262626 + hi LineNr term=NONE cterm=NONE ctermfg=8 ctermbg=bg gui=NONE guifg=#808080 guibg=bg + hi Character term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + hi String term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + + " Optional Syntax Features + if g:nofrils_strbackgrounds + hi Character term=NONE cterm=NONE ctermfg=NONE ctermbg=233 gui=NONE guifg=NONE guibg=#121212 + hi String term=NONE cterm=NONE ctermfg=NONE ctermbg=233 gui=NONE guifg=NONE guibg=#121212 + end + if g:nofrils_heavycomments + hi Comment term=NONE cterm=NONE ctermfg=135 ctermbg=NONE gui=NONE guifg=#AF5FFF guibg=NONE + end + if g:nofrils_heavylinenumbers + hi LineNr term=NONE cterm=NONE ctermfg=135 ctermbg=NONE gui=NONE guifg=#AF5FFF guibg=NONE + end +endfunction + +" Command mappings +command! NofrilsDark :colo nofrils-dark +command! NofrilsLight :colo nofrils-light +command! NofrilsSepia :colo nofrils-sepia +command! NofrilsAcme :colo nofrils-acme +command! NofrilsFocusNormal :call NofrilsNormal() +command! NofrilsFocusCode :call NofrilsFocusCode() +command! NofrilsFocusComments :call NofrilsFocusComments() + +" Setup normal settings +call NofrilsNormal() diff --git a/vim/colors/nofrils-light.vim b/vim/colors/nofrils-light.vim new file mode 100644 index 0000000..f046552 --- /dev/null +++ b/vim/colors/nofrils-light.vim @@ -0,0 +1,189 @@ +" Name: No Frils Light Colorscheme +" Author: robertmeta (on Github) +" URL: https://github.com/robertmeta/nofrils +" (see this url for latest release & screenshots) +" License: OSI approved MIT license + +hi clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "nofrils-light" + +if !exists("g:nofrils_strbackgrounds") + let g:nofrils_strbackgrounds = 0 +endif +if !exists("g:nofrils_heavycomments") + let g:nofrils_heavycomments = 0 +endif +if !exists("g:nofrils_heavylinenumbers") + let g:nofrils_heavylinenumbers = 0 +endif + +set background=light + +" Baseline +hi Normal term=NONE cterm=NONE ctermfg=black ctermbg=255 gui=NONE guifg=#000000 guibg=#E4E4E4 + +" Faded +hi ColorColumn term=NONE cterm=NONE ctermfg=NONE ctermbg=253 gui=NONE guifg=NONE guibg=#DADADA +hi Comment term=NONE cterm=NONE ctermfg=248 ctermbg=NONE gui=NONE guifg=#A8A8A8 guibg=NONE +hi FoldColumn term=NONE cterm=NONE ctermfg=248 ctermbg=NONE gui=NONE guifg=#A8A8A8 guibg=NONE +hi Folded term=NONE cterm=NONE ctermfg=240 ctermbg=NONE gui=NONE guifg=#585858 guibg=NONE +hi LineNr term=NONE cterm=NONE ctermfg=248 ctermbg=bg gui=NONE guifg=#A8A8A8 guibg=NONE +hi NonText term=NONE cterm=NONE ctermfg=248 ctermbg=NONE gui=NONE guifg=#A8A8A8 guibg=NONE +hi SignColumn term=NONE cterm=NONE ctermfg=240 ctermbg=bg gui=NONE guifg=#585858 guibg=bg +hi SpecialComment term=NONE cterm=NONE ctermfg=248 ctermbg=NONE gui=NONE guifg=#A8A8A8 guibg=NONE +hi SpecialKey term=NONE cterm=NONE ctermfg=240 ctermbg=bg gui=NONE guifg=#585858 guibg=bg +hi StatusLineNC term=NONE cterm=NONE ctermfg=fg ctermbg=248 gui=NONE guifg=fg guibg=#A8A8A8 +hi VertSplit term=NONE cterm=NONE ctermfg=fg ctermbg=248 gui=NONE guifg=fg guibg=#A8A8A8 + +" Highlighted +hi CursorColumn term=NONE cterm=NONE ctermfg=NONE ctermbg=253 gui=NONE guifg=NONE guibg=#DADADA +hi CursorIM term=NONE cterm=NONE ctermfg=fg ctermbg=4 gui=NONE guifg=fg guibg=#00FFFF +hi CursorLineNr term=NONE cterm=NONE ctermfg=NONE ctermbg=white gui=NONE guifg=NONE guibg=white +hi CursorLine term=NONE cterm=NONE ctermfg=NONE ctermbg=253 gui=NONE guifg=NONE guibg=#DADADA +hi Cursor term=NONE cterm=NONE ctermfg=fg ctermbg=4 gui=NONE guifg=fg guibg=#00FFFF +hi Directory term=NONE cterm=NONE ctermfg=53 ctermbg=NONE gui=NONE guifg=#5F005F guibg=NONE +hi ErrorMsg term=NONE cterm=NONE ctermfg=9 ctermbg=white gui=NONE guifg=#FF5555 guibg=white +hi Error term=NONE cterm=NONE ctermfg=9 ctermbg=white gui=NONE guifg=#FF5555 guibg=white +hi IncSearch term=NONE cterm=NONE ctermfg=white ctermbg=2 gui=NONE guifg=white guibg=#008000 +hi MatchParen term=NONE cterm=NONE ctermfg=15 ctermbg=4 gui=NONE guifg=#ffffff guibg=#000080 +hi ModeMsg term=NONE cterm=NONE ctermfg=53 ctermbg=NONE gui=NONE guifg=#5F005F guibg=NONE +hi MoreMsg term=NONE cterm=NONE ctermfg=53 ctermbg=NONE gui=NONE guifg=#5F005F guibg=NONE +hi PmenuSel term=NONE cterm=NONE ctermfg=fg ctermbg=13 gui=NONE guifg=fg guibg=#FF00FF +hi Question term=NONE cterm=NONE ctermfg=53 ctermbg=NONE gui=NONE guifg=#5F005F guibg=NONE +hi Search term=NONE cterm=NONE ctermfg=white ctermbg=6 gui=NONE guifg=white guibg=#00CDCD +hi StatusLine term=NONE cterm=NONE ctermfg=white ctermbg=black gui=NONE guifg=white guibg=#000000 +hi Todo term=NONE cterm=NONE ctermfg=2 ctermbg=NONE gui=NONE guifg=#008000 guibg=NONE +hi WarningMsg term=NONE cterm=NONE ctermfg=9 ctermbg=white gui=NONE guifg=#FF5555 guibg=white +hi WildMenu term=NONE cterm=NONE ctermfg=black ctermbg=white gui=NONE guifg=#000000 guibg=white + +" Reversed +hi PmenuSbar term=reverse cterm=reverse ctermfg=NONE ctermbg=NONE gui=reverse guifg=NONE guibg=NONE +hi Pmenu term=reverse cterm=reverse ctermfg=NONE ctermbg=NONE gui=reverse guifg=NONE guibg=NONE +hi PmenuThumb term=reverse cterm=reverse ctermfg=NONE ctermbg=NONE gui=reverse guifg=NONE guibg=NONE +hi TabLineSel term=reverse cterm=reverse ctermfg=NONE ctermbg=NONE gui=reverse guifg=NONE guibg=NONE +hi Visual term=reverse cterm=reverse ctermfg=NONE ctermbg=NONE gui=reverse guifg=NONE guibg=NONE +hi VisualNOS term=reverse,underline cterm=reverse,underline ctermfg=NONE ctermbg=NONE gui=reverse,underline guifg=NONE guibg=NONE + +" Diff +hi DiffAdd term=NONE cterm=NONE ctermfg=2 ctermbg=NONE gui=NONE guifg=#008000 guibg=NONE +hi DiffChange term=NONE cterm=NONE ctermfg=94 ctermbg=NONE gui=NONE guifg=#875f00 guibg=NONE +hi DiffDelete term=NONE cterm=NONE ctermfg=1 ctermbg=NONE gui=NONE guifg=#800000 guibg=NONE +hi DiffText term=NONE cterm=NONE ctermfg=4 ctermbg=NONE gui=NONE guifg=#000080 guibg=NONE + +" Spell +hi SpellBad term=underline cterm=underline ctermfg=5 ctermbg=NONE gui=underline guifg=#CD00CD guibg=NONE +hi SpellCap term=underline cterm=underline ctermfg=5 ctermbg=NONE gui=underline guifg=#CD00CD guibg=NONE +hi SpellLocal term=underline cterm=underline ctermfg=5 ctermbg=NONE gui=underline guifg=#CD00CD guibg=NONE +hi SpellRare term=underline cterm=underline ctermfg=5 ctermbg=NONE gui=underline guifg=#CD00CD guibg=NONE + +" Vim Features +hi Menu term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Scrollbar term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi TabLineFill term=NONE cterm=NONE ctermfg=fg ctermbg=248 gui=NONE guifg=fg guibg=#A8A8A8 +hi TabLine term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Tooltip term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + +" Syntax Highlighting (or lack there of) +hi Boolean term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Character term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Conceal term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Conditional term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Constant term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Debug term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Define term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Delimiter term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Directive term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Exception term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Float term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Format term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Function term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Identifier term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Ignore term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Include term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Keyword term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Label term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Macro term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Number term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Operator term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi PreCondit term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi PreProc term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Repeat term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi SpecialChar term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Special term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Statement term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi StorageClass term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi String term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Structure term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Tag term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Title term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Typedef term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Type term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Underlined term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + +" Sneak +hi SneakLabelMask term=NONE cterm=NONE ctermfg=black ctermbg=195 gui=NONE guifg=black guibg=#d7ffff +hi SneakTarget term=NONE cterm=NONE ctermfg=black ctermbg=195 gui=NONE guifg=black guibg=#d7ffff +hi SneakLabelTarget term=NONE cterm=NONE ctermfg=black ctermbg=183 gui=NONE guifg=black guibg=#d7afff +hi SneakScope term=NONE cterm=NONE ctermfg=black ctermbg=183 gui=NONE guifg=black guibg=#d7afff + +" Helper Functions +function! NofrilsFocusComments() + hi Comment term=NONE cterm=NONE ctermfg=black ctermbg=NONE gui=NONE guifg=#A8A8A8 guibg=NONE + hi Normal term=NONE cterm=NONE ctermfg=248 ctermbg=255 gui=NONE guifg=#000000 guibg=#E4E4E4 + hi LineNr term=NONE cterm=NONE ctermfg=248 ctermbg=bg gui=NONE guifg=#A8A8A8 guibg=NONE + hi Character term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + hi String term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + + if g:nofrils_heavycomments + hi Comment term=NONE cterm=NONE ctermfg=89 ctermbg=NONE gui=NONE guifg=#87005F guibg=NONE + end +endfunction + +function! NofrilsFocusCode() + hi Comment term=NONE cterm=NONE ctermfg=248 ctermbg=NONE gui=NONE guifg=#A8A8A8 guibg=NONE + hi Normal term=NONE cterm=NONE ctermfg=black ctermbg=255 gui=NONE guifg=#000000 guibg=#E4E4E4 + hi LineNr term=NONE cterm=NONE ctermfg=248 ctermbg=bg gui=NONE guifg=#A8A8A8 guibg=NONE + hi Character term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + hi String term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + + if g:nofrils_strbackgrounds + hi Character term=NONE cterm=NONE ctermfg=NONE ctermbg=253 gui=NONE guifg=NONE guibg=#DADADA + hi String term=NONE cterm=NONE ctermfg=NONE ctermbg=253 gui=NONE guifg=NONE guibg=#DADADA + end +endfunction + +function! NofrilsNormal() + hi Comment term=NONE cterm=NONE ctermfg=248 ctermbg=NONE gui=NONE guifg=#A8A8A8 guibg=NONE + hi Normal term=NONE cterm=NONE ctermfg=black ctermbg=255 gui=NONE guifg=#000000 guibg=#E4E4E4 + hi LineNr term=NONE cterm=NONE ctermfg=248 ctermbg=bg gui=NONE guifg=#A8A8A8 guibg=NONE + hi Character term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + hi String term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + + " Optional Syntax Features + if g:nofrils_strbackgrounds + hi Character term=NONE cterm=NONE ctermfg=NONE ctermbg=253 gui=NONE guifg=NONE guibg=#DADADA + hi String term=NONE cterm=NONE ctermfg=NONE ctermbg=253 gui=NONE guifg=NONE guibg=#DADADA + end + if g:nofrils_heavycomments + hi Comment term=NONE cterm=NONE ctermfg=89 ctermbg=NONE gui=NONE guifg=#87005F guibg=NONE + end + if g:nofrils_heavylinenumbers + hi LineNr term=NONE cterm=NONE ctermfg=89 ctermbg=NONE gui=NONE guifg=#87005F guibg=NONE + end +endfunction + +" Command mappings +command! NofrilsDark :colo nofrils-dark +command! NofrilsLight :colo nofrils-light +command! NofrilsSepia :colo nofrils-sepia +command! NofrilsAcme :colo nofrils-acme +command! NofrilsFocusNormal :call NofrilsNormal() +command! NofrilsFocusCode :call NofrilsFocusCode() +command! NofrilsFocusComments :call NofrilsFocusComments() + +" Setup normal settings +call NofrilsNormal() diff --git a/vim/colors/nofrils-sepia.vim b/vim/colors/nofrils-sepia.vim new file mode 100644 index 0000000..6f9215e --- /dev/null +++ b/vim/colors/nofrils-sepia.vim @@ -0,0 +1,189 @@ +" Name: No Frils Sepia Colorscheme +" Author: robertmeta (on Github) +" URL: https://github.com/robertmeta/nofrils +" (see this url for latest release & screenshots) +" License: OSI approved MIT license + +hi clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "nofrils-sepia" + +if !exists("g:nofrils_strbackgrounds") + let g:nofrils_strbackgrounds = 0 +endif +if !exists("g:nofrils_heavycomments") + let g:nofrils_heavycomments = 0 +endif +if !exists("g:nofrils_heavylinenumbers") + let g:nofrils_heavylinenumbers = 0 +endif + +set background=light + +" Baseline +hi Normal term=NONE cterm=NONE ctermfg=black ctermbg=223 gui=NONE guifg=#000000 guibg=#ffdfaf + +" Faded +hi ColorColumn term=NONE cterm=NONE ctermfg=NONE ctermbg=253 gui=NONE guifg=NONE guibg=#DADADA +hi Comment term=NONE cterm=NONE ctermfg=136 ctermbg=NONE gui=NONE guifg=#af8700 guibg=NONE +hi FoldColumn term=NONE cterm=NONE ctermfg=136 ctermbg=NONE gui=NONE guifg=#af8700 guibg=NONE +hi Folded term=NONE cterm=NONE ctermfg=240 ctermbg=NONE gui=NONE guifg=#585858 guibg=NONE +hi LineNr term=NONE cterm=NONE ctermfg=136 ctermbg=bg gui=NONE guifg=#af8700 guibg=NONE +hi NonText term=NONE cterm=NONE ctermfg=136 ctermbg=NONE gui=NONE guifg=#af8700 guibg=NONE +hi SignColumn term=NONE cterm=NONE ctermfg=240 ctermbg=bg gui=NONE guifg=#585858 guibg=bg +hi SpecialComment term=NONE cterm=NONE ctermfg=136 ctermbg=NONE gui=NONE guifg=#af8700 guibg=NONE +hi SpecialKey term=NONE cterm=NONE ctermfg=240 ctermbg=bg gui=NONE guifg=#585858 guibg=bg +hi StatusLineNC term=NONE cterm=NONE ctermfg=fg ctermbg=136 gui=NONE guifg=fg guibg=#af8700 +hi VertSplit term=NONE cterm=NONE ctermfg=fg ctermbg=136 gui=NONE guifg=fg guibg=#af8700 + +" Highlight +hi CursorColumn term=NONE cterm=NONE ctermfg=NONE ctermbg=225 gui=NONE guifg=NONE guibg=#ffdfff +hi CursorIM term=NONE cterm=NONE ctermfg=fg ctermbg=4 gui=NONE guifg=fg guibg=#00FFFF +hi CursorLineNr term=NONE cterm=NONE ctermfg=NONE ctermbg=225 gui=NONE guifg=NONE guibg=#ffdfff +hi CursorLine term=NONE cterm=NONE ctermfg=NONE ctermbg=225 gui=NONE guifg=NONE guibg=#ffdfff +hi Cursor term=NONE cterm=NONE ctermfg=fg ctermbg=4 gui=NONE guifg=fg guibg=#00FFFF +hi Directory term=NONE cterm=NONE ctermfg=53 ctermbg=NONE gui=NONE guifg=#5F005F guibg=NONE +hi ErrorMsg term=NONE cterm=NONE ctermfg=9 ctermbg=white gui=NONE guifg=#FF5555 guibg=white +hi Error term=NONE cterm=NONE ctermfg=9 ctermbg=white gui=NONE guifg=#FF5555 guibg=white +hi IncSearch term=NONE cterm=NONE ctermfg=white ctermbg=2 gui=NONE guifg=white guibg=#008000 +hi MatchParen term=NONE cterm=NONE ctermfg=15 ctermbg=4 gui=NONE guifg=#ffffff guibg=#000080 +hi ModeMsg term=NONE cterm=NONE ctermfg=53 ctermbg=NONE gui=NONE guifg=#5F005F guibg=NONE +hi MoreMsg term=NONE cterm=NONE ctermfg=53 ctermbg=NONE gui=NONE guifg=#5F005F guibg=NONE +hi PmenuSel term=NONE cterm=NONE ctermfg=fg ctermbg=13 gui=NONE guifg=fg guibg=#FF00FF +hi Question term=NONE cterm=NONE ctermfg=53 ctermbg=NONE gui=NONE guifg=#5F005F guibg=NONE +hi Search term=NONE cterm=NONE ctermfg=white ctermbg=6 gui=NONE guifg=white guibg=#00CDCD +hi StatusLine term=NONE cterm=NONE ctermfg=white ctermbg=fg gui=NONE guifg=white guibg=#000000 +hi Todo term=NONE cterm=NONE ctermfg=2 ctermbg=NONE gui=NONE guifg=#008000 guibg=NONE +hi WarningMsg term=NONE cterm=NONE ctermfg=9 ctermbg=white gui=NONE guifg=#FF5555 guibg=white +hi WildMenu term=NONE cterm=NONE ctermfg=fg ctermbg=white gui=NONE guifg=#000000 guibg=white + +" Reversed +hi PmenuSbar term=reverse cterm=reverse ctermfg=NONE ctermbg=NONE gui=reverse guifg=NONE guibg=NONE +hi Pmenu term=reverse cterm=reverse ctermfg=NONE ctermbg=NONE gui=reverse guifg=NONE guibg=NONE +hi PmenuThumb term=reverse cterm=reverse ctermfg=NONE ctermbg=NONE gui=reverse guifg=NONE guibg=NONE +hi TabLineSel term=reverse cterm=reverse ctermfg=NONE ctermbg=NONE gui=reverse guifg=NONE guibg=NONE +hi Visual term=reverse cterm=reverse ctermfg=NONE ctermbg=NONE gui=reverse guifg=NONE guibg=NONE +hi VisualNOS term=reverse,underline cterm=reverse,underline ctermfg=NONE ctermbg=NONE gui=reverse,underline guifg=NONE guibg=NONE + +" Diff +hi DiffAdd term=NONE cterm=NONE ctermfg=2 ctermbg=NONE gui=NONE guifg=#008000 guibg=NONE +hi DiffChange term=NONE cterm=NONE ctermfg=94 ctermbg=NONE gui=NONE guifg=#875f00 guibg=NONE +hi DiffDelete term=NONE cterm=NONE ctermfg=1 ctermbg=NONE gui=NONE guifg=#800000 guibg=NONE +hi DiffText term=NONE cterm=NONE ctermfg=4 ctermbg=NONE gui=NONE guifg=#000080 guibg=NONE + +" Spell +hi SpellBad term=underline cterm=underline ctermfg=5 ctermbg=NONE gui=underline guifg=#CD00CD guibg=NONE +hi SpellCap term=underline cterm=underline ctermfg=5 ctermbg=NONE gui=underline guifg=#CD00CD guibg=NONE +hi SpellLocal term=underline cterm=underline ctermfg=5 ctermbg=NONE gui=underline guifg=#CD00CD guibg=NONE +hi SpellRare term=underline cterm=underline ctermfg=5 ctermbg=NONE gui=underline guifg=#CD00CD guibg=NONE + +" Vim Features +hi Menu term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Scrollbar term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi TabLineFill term=NONE cterm=NONE ctermfg=fg ctermbg=136 gui=NONE guifg=fg guibg=#af8700 +hi TabLine term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Tooltip term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + +" Syntax Highsepiaing (or lack there of) +hi Boolean term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Character term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Conceal term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Conditional term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Constant term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Debug term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Define term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Delimiter term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Directive term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Exception term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Float term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Format term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Function term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Identifier term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Ignore term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Include term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Keyword term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Label term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Macro term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Number term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Operator term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi PreCondit term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi PreProc term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Repeat term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi SpecialChar term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Special term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Statement term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi StorageClass term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi String term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Structure term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Tag term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Title term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Typedef term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Type term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE +hi Underlined term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + +" Sneak +hi SneakLabelMask term=NONE cterm=NONE ctermfg=black ctermbg=195 gui=NONE guifg=black guibg=#d7ffff +hi SneakTarget term=NONE cterm=NONE ctermfg=black ctermbg=195 gui=NONE guifg=black guibg=#d7ffff +hi SneakLabelTarget term=NONE cterm=NONE ctermfg=black ctermbg=183 gui=NONE guifg=black guibg=#d7afff +hi SneakScope term=NONE cterm=NONE ctermfg=black ctermbg=183 gui=NONE guifg=black guibg=#d7afff + +" Helper Functions +function! NofrilsFocusComments() + hi Comment term=NONE cterm=NONE ctermfg=black ctermbg=NONE gui=NONE guifg=#af8700 guibg=NONE + hi Normal term=NONE cterm=NONE ctermfg=136 ctermbg=223 gui=NONE guifg=#000000 guibg=#ffdfaf + hi LineNr term=NONE cterm=NONE ctermfg=136 ctermbg=bg gui=NONE guifg=#af8700 guibg=NONE + hi Character term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + hi String term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + + if g:nofrils_heavycomments + hi Comment term=NONE cterm=NONE ctermfg=89 ctermbg=NONE gui=NONE guifg=#87005F guibg=NONE + end +endfunction + +function! NofrilsFocusCode() + hi Comment term=NONE cterm=NONE ctermfg=136 ctermbg=NONE gui=NONE guifg=#af8700 guibg=NONE + hi Normal term=NONE cterm=NONE ctermfg=black ctermbg=223 gui=NONE guifg=#000000 guibg=#ffdfaf + hi LineNr term=NONE cterm=NONE ctermfg=136 ctermbg=bg gui=NONE guifg=#af8700 guibg=NONE + hi Character term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + hi String term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + + if g:nofrils_strbackgrounds + hi Character term=NONE cterm=NONE ctermfg=NONE ctermbg=222 gui=NONE guifg=NONE guibg=#ffdf87 + hi String term=NONE cterm=NONE ctermfg=NONE ctermbg=222 gui=NONE guifg=NONE guibg=#ffdf87 + end +endfunction + +function! NofrilsNormal() + hi Comment term=NONE cterm=NONE ctermfg=136 ctermbg=NONE gui=NONE guifg=#af8700 guibg=NONE + hi Normal term=NONE cterm=NONE ctermfg=black ctermbg=223 gui=NONE guifg=#000000 guibg=#ffdfaf + hi LineNr term=NONE cterm=NONE ctermfg=136 ctermbg=bg gui=NONE guifg=#af8700 guibg=NONE + hi Character term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + hi String term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=NONE guibg=NONE + + " Optional Syntax Features + if g:nofrils_strbackgrounds + hi Character term=NONE cterm=NONE ctermfg=NONE ctermbg=222 gui=NONE guifg=NONE guibg=#DADADA + hi String term=NONE cterm=NONE ctermfg=NONE ctermbg=222 gui=NONE guifg=NONE guibg=#ffdf87 + end + if g:nofrils_heavycomments + hi Comment term=NONE cterm=NONE ctermfg=89 ctermbg=NONE gui=NONE guifg=#87005F guibg=NONE + end + if g:nofrils_heavylinenumbers + hi LineNr term=NONE cterm=NONE ctermfg=89 ctermbg=NONE gui=NONE guifg=#87005F guibg=NONE + end +endfunction + +" Command mappings +command! NofrilsDark :colo nofrils-dark +command! NofrilsLight :colo nofrils-light +command! NofrilsSepia :colo nofrils-sepia +command! NofrilsAcme :colo nofrils-acme +command! NofrilsFocusNormal :call NofrilsNormal() +command! NofrilsFocusCode :call NofrilsFocusCode() +command! NofrilsFocusComments :call NofrilsFocusComments() + +" Setup normal settings +call NofrilsNormal() diff --git a/vim/colors/tfl-subtle.vim b/vim/colors/tfl-subtle.vim new file mode 100644 index 0000000..957ec06 --- /dev/null +++ b/vim/colors/tfl-subtle.vim @@ -0,0 +1,91 @@ +"------------------------------------------------------------------------------ +" Project Name - VimConfig/source/color/tfl-subtle.vim +" Started On - Thu 5 Mar 00:09:14 GMT 2020 +" Last Change - Mon 2 Aug 16:50:12 BST 2021 +" Author E-Mail - terminalforlife@yahoo.com +" Author GitHub - https://github.com/terminalforlife +"------------------------------------------------------------------------------ + +set background=dark +highlight clear +syntax reset + +let g:colors_name='tfl-subtle' + +hi Boolean ctermbg=NONE ctermfg=255 +hi Character ctermbg=NONE ctermfg=255 +hi ColorColumn ctermbg=234 ctermfg=255 +hi Comment ctermbg=NONE ctermfg=240 +hi Condtional ctermbg=NONE ctermfg=255 +hi Constant ctermbg=NONE ctermfg=255 +hi CursorColumn ctermbg=NONE ctermfg=255 +hi Cursor ctermbg=NONE ctermfg=255 +hi CursorLine ctermbg=233 ctermfg=255 cterm=bold +hi Debug ctermbg=NONE ctermfg=255 +hi Define ctermbg=NONE ctermfg=255 +hi Delimiter ctermbg=NONE ctermfg=149 +hi DiffAdd ctermbg=NONE ctermfg=255 +hi DiffChange ctermbg=NONE ctermfg=255 +hi DiffDelete ctermbg=NONE ctermfg=255 +hi DiffText ctermbg=NONE ctermfg=255 +hi Directory ctermbg=NONE ctermfg=255 +hi Error ctermbg=NONE ctermfg=255 +hi ErrorMsg ctermbg=NONE ctermfg=255 +hi Exception ctermbg=NONE ctermfg=255 +hi Float ctermbg=NONE ctermfg=255 +hi FoldColumn ctermbg=NONE ctermfg=255 +hi Folded ctermbg=NONE ctermfg=255 +hi Function ctermbg=NONE ctermfg=255 +hi Identifier ctermbg=NONE ctermfg=109 +hi Include ctermbg=NONE ctermfg=255 +hi IncSearch ctermbg=NONE ctermfg=255 +hi Keyword ctermbg=NONE ctermfg=255 +hi Label ctermbg=NONE ctermfg=255 +hi LineNr ctermbg=232 ctermfg=237 +hi Macro ctermbg=NONE ctermfg=255 +hi MatchParen ctermbg=NONE ctermfg=255 +hi ModeMsg ctermbg=NONE ctermfg=255 +hi MoreMsg ctermbg=NONE ctermfg=255 +hi NonText ctermbg=NONE ctermfg=255 +hi Normal ctermbg=NONE ctermfg=244 +hi Number ctermbg=NONE ctermfg=216 +hi Operator ctermbg=NONE ctermfg=255 +hi Pmenu ctermbg=NONE ctermfg=255 +hi PmenuSbar ctermbg=NONE ctermfg=255 +hi PmenuSel ctermbg=NONE ctermfg=45 cterm=bold +hi PmenuThumb ctermbg=NONE ctermfg=255 +hi PreCondit ctermbg=NONE ctermfg=255 +hi PreProc ctermbg=NONE ctermfg=255 +hi Question ctermbg=NONE ctermfg=255 +hi Repeat ctermbg=NONE ctermfg=255 +hi Search ctermbg=NONE ctermfg=186 +hi SpecialChar ctermbg=NONE ctermfg=255 +hi SpecialComment ctermbg=NONE ctermfg=255 +hi Special ctermbg=NONE ctermfg=255 +hi SpecialKey ctermbg=NONE ctermfg=255 +hi SpellBad ctermbg=250 ctermfg=0 +hi SpellCap ctermbg=NONE ctermfg=250 +hi SpellLocal ctermbg=NONE ctermfg=250 +hi SpellRare ctermbg=NONE ctermfg=250 +hi Statement ctermbg=NONE ctermfg=250 +hi StatusLine ctermfg=233 ctermbg=238 +hi StatusLineNC ctermbg=NONE ctermfg=250 +hi StorageClass ctermbg=NONE ctermfg=250 +hi String ctermbg=NONE ctermfg=245 +hi Structure ctermbg=NONE ctermfg=255 +hi TabLineFill ctermbg=NONE ctermfg=255 +hi Tag ctermbg=NONE ctermfg=255 +hi Title ctermbg=NONE ctermfg=255 +hi Todo ctermbg=NONE ctermfg=240 +hi Type ctermbg=NONE ctermfg=103 +hi Typedef ctermbg=NONE ctermfg=255 +hi VertSplit ctermbg=NONE ctermfg=255 +hi Visual ctermbg=NONE ctermfg=186 +hi VisualNOS ctermbg=NONE ctermfg=255 +hi WarningMsg ctermbg=NONE ctermfg=255 +hi WildMenu ctermbg=NONE ctermfg=255 + +"hi def link diffCommon Statement +"hi def link diffRemoved DiffDelet +"hi def link diffChanged DiffChang +"hi def link diffAdded DiffAdd diff --git a/vim/colors/tfl.vim b/vim/colors/tfl.vim new file mode 100644 index 0000000..69bea98 --- /dev/null +++ b/vim/colors/tfl.vim @@ -0,0 +1,93 @@ +"------------------------------------------------------------------------------ +" Project Name - VimConfig/source/color/tfl.vim +" Started On - Tue 6 Mar 18:26:55 GMT 2018 +" Last Change - Fri 31 Jan 22:00:02 GMT 2020 +" Author E-Mail - terminalforlife@yahoo.com +" Author GitHub - https://github.com/terminalforlife +"------------------------------------------------------------------------------ +" Inspired by 256_noir. +"------------------------------------------------------------------------------ + +set background=dark +highlight clear +syntax reset + +let g:colors_name="tfl" + +hi Boolean ctermbg=NONE ctermfg=1 +hi Character ctermbg=NONE ctermfg=196 +hi ColorColumn ctermbg=235 ctermfg=250 +hi Comment ctermbg=NONE ctermfg=241 +hi Condtional ctermbg=NONE ctermfg=196 +hi Constant ctermbg=NONE ctermfg=252 +hi CursorColumn ctermbg=NONE ctermfg=NONE +hi Cursor ctermbg=NONE ctermfg=NONE +hi CursorLine ctermbg=237 cterm=bold +hi Debug ctermbg=255 ctermfg=NONE +hi Define ctermbg=NONE ctermfg=255 +hi Delimiter ctermbg=NONE ctermfg=250 +hi DiffAdd ctermbg=NONE ctermfg=255 +hi DiffChange ctermbg=NONE ctermfg=700 +hi DiffDelete ctermbg=NONE ctermfg=240 +hi DiffText ctermbg=NONE ctermfg=250 +hi Directory ctermbg=NONE ctermfg=255 +hi Error ctermbg=1 ctermfg=0 +hi ErrorMsg ctermbg=NONE ctermfg=255 +hi Exception ctermbg=NONE ctermfg=250 +hi Float ctermbg=NONE ctermfg=196 +hi FoldColumn ctermbg=NONE ctermfg=196 +hi Folded ctermbg=NONE ctermfg=196 +hi Function ctermbg=NONE ctermfg=196 +hi Identifier ctermbg=NONE ctermfg=158 +hi Include ctermbg=NONE ctermfg=255 +hi IncSearch ctermbg=255 ctermfg=0 +hi Keyword ctermbg=NONE ctermfg=255 +hi Label ctermbg=NONE ctermfg=255 +hi LineNr ctermbg=232 ctermfg=240 +hi Macro ctermbg=NONE ctermfg=yellow +hi MatchParen ctermbg=NONE ctermfg=70 +hi ModeMsg ctermbg=NONE ctermfg=250 +hi MoreMsg ctermbg=NONE ctermfg=250 +hi NonText ctermbg=NONE ctermfg=240 +hi Normal ctermbg=NONE ctermfg=255 +hi Number ctermbg=NONE ctermfg=255 +hi Operator ctermbg=NONE ctermfg=196 +hi Pmenu ctermbg=NONE ctermfg=255 +hi PmenuSbar ctermbg=NONE ctermfg=70 +hi PmenuSel ctermbg=NONE ctermfg=70 +hi PmenuThumb ctermbg=NONE ctermfg=232 +hi PreCondit ctermbg=NONE ctermfg=255 +hi PreProc ctermbg=NONE ctermfg=196 +hi Question ctermbg=NONE ctermfg=250 +hi Repeat ctermbg=NONE ctermfg=255 +hi Search ctermbg=255 ctermfg=0 +hi SpecialChar ctermbg=NONE ctermfg=255 +hi SpecialComment ctermbg=NONE ctermfg=250 +hi Special ctermbg=NONE ctermfg=255 +hi SpecialKey ctermfg=darkyellow ctermbg=NONE +hi SpellBad ctermbg=1 ctermfg=0 +hi SpellCap ctermbg=NONE ctermfg=255 +hi SpellLocal ctermbg=NONE ctermfg=255 +hi SpellRare ctermbg=NONE ctermfg=124 +hi Statement ctermbg=NONE ctermfg=230 +hi StatusLine ctermbg=white ctermfg=black +hi StatusLineNC ctermbg=238 ctermfg=black +hi StorageClass ctermbg=NONE ctermfg=255 +hi String ctermbg=NONE ctermfg=96 +hi Structure ctermbg=NONE ctermfg=255 +hi TabLineFill ctermbg=0 ctermfg=0 +hi Tag ctermbg=NONE ctermfg=196 +hi Title ctermbg=NONE ctermfg=250 +hi Todo ctermbg=NONE ctermfg=255 +hi Type ctermbg=NONE ctermfg=255 +hi Typedef ctermbg=NONE ctermfg=255 +hi VertSplit ctermbg=black ctermfg=black +hi Visual ctermbg=NONE ctermfg=2 +hi VisualNOS ctermbg=NONE ctermfg=70 +hi WarningMsg ctermbg=NONE ctermfg=196 +hi WildMenu ctermbg=NONE ctermfg=240 + +hi def link diffCommon Statement +hi def link diffRemoved DiffDelet +hi def link diffChanged DiffChang +hi def link diffAdded DiffAdd diff --git a/vim/colors/wombat256mod.vim b/vim/colors/wombat256mod.vim new file mode 100644 index 0000000..1137eb8 --- /dev/null +++ b/vim/colors/wombat256mod.vim @@ -0,0 +1,96 @@ +" Vim color file +" Original Maintainer: Lars H. Nielsen (dengmao@gmail.com) +" Last Change: 2010-07-23 +" +" Modified version of wombat for 256-color terminals by +" David Liang (bmdavll@gmail.com) +" based on version by +" Danila Bespalov (danila.bespalov@gmail.com) + +set background=dark + +if version > 580 + hi clear + if exists("syntax_on") + syntax reset + endif +endif + +let colors_name = "wombat256mod" + + +" General colors +hi Normal ctermfg=252 ctermbg=234 cterm=none guifg=#e3e0d7 guibg=#242424 gui=none +hi Cursor ctermfg=234 ctermbg=228 cterm=none guifg=#242424 guibg=#eae788 gui=none +hi Visual ctermfg=251 ctermbg=239 cterm=none guifg=#c3c6ca guibg=#554d4b gui=none +hi VisualNOS ctermfg=251 ctermbg=236 cterm=none guifg=#c3c6ca guibg=#303030 gui=none +hi Search ctermfg=177 ctermbg=241 cterm=none guifg=#d787ff guibg=#636066 gui=none +hi Folded ctermfg=103 ctermbg=237 cterm=none guifg=#a0a8b0 guibg=#3a4046 gui=none +hi Title ctermfg=230 cterm=bold guifg=#ffffd7 gui=bold +hi StatusLine ctermfg=230 ctermbg=238 cterm=none guifg=#ffffd7 guibg=#444444 gui=italic +hi VertSplit ctermfg=238 ctermbg=238 cterm=none guifg=#444444 guibg=#444444 gui=none +hi StatusLineNC ctermfg=241 ctermbg=238 cterm=none guifg=#857b6f guibg=#444444 gui=none +hi LineNr ctermfg=241 ctermbg=232 cterm=none guifg=#857b6f guibg=#080808 gui=none +hi SpecialKey ctermfg=241 ctermbg=235 cterm=none guifg=#626262 guibg=#2b2b2b gui=none +hi WarningMsg ctermfg=203 guifg=#ff5f55 +hi ErrorMsg ctermfg=196 ctermbg=236 cterm=bold guifg=#ff2026 guibg=#3a3a3a gui=bold + +" Vim >= 7.0 specific colors +if version >= 700 +hi CursorLine ctermbg=236 cterm=none guibg=#32322f +hi MatchParen ctermfg=228 ctermbg=101 cterm=bold guifg=#eae788 guibg=#857b6f gui=bold +hi Pmenu ctermfg=230 ctermbg=238 guifg=#ffffd7 guibg=#444444 +hi PmenuSel ctermfg=232 ctermbg=192 guifg=#080808 guibg=#cae982 +endif + +" Diff highlighting +hi DiffAdd ctermbg=17 guibg=#2a0d6a +hi DiffDelete ctermfg=234 ctermbg=60 cterm=none guifg=#242424 guibg=#3e3969 gui=none +hi DiffText ctermbg=53 cterm=none guibg=#73186e gui=none +hi DiffChange ctermbg=237 guibg=#382a37 + +"hi CursorIM +"hi Directory +"hi IncSearch +"hi Menu +"hi ModeMsg +"hi MoreMsg +"hi PmenuSbar +"hi PmenuThumb +"hi Question +"hi Scrollbar +"hi SignColumn +"hi SpellBad +"hi SpellCap +"hi SpellLocal +"hi SpellRare +"hi TabLine +"hi TabLineFill +"hi TabLineSel +"hi Tooltip +"hi User1 +"hi User9 +"hi WildMenu + + +" Syntax highlighting +hi Keyword ctermfg=111 cterm=none guifg=#88b8f6 gui=none +hi Statement ctermfg=111 cterm=none guifg=#88b8f6 gui=none +hi Constant ctermfg=173 cterm=none guifg=#e5786d gui=none +hi Number ctermfg=173 cterm=none guifg=#e5786d gui=none +hi PreProc ctermfg=173 cterm=none guifg=#e5786d gui=none +hi Function ctermfg=192 cterm=none guifg=#cae982 gui=none +hi Identifier ctermfg=192 cterm=none guifg=#cae982 gui=none +hi Type ctermfg=186 cterm=none guifg=#d4d987 gui=none +hi Special ctermfg=229 cterm=none guifg=#eadead gui=none +hi String ctermfg=113 cterm=none guifg=#95e454 gui=italic +hi Comment ctermfg=246 cterm=none guifg=#9c998e gui=italic +hi Todo ctermfg=101 cterm=none guifg=#857b6f gui=italic + + +" Links +hi! link FoldColumn Folded +hi! link CursorColumn CursorLine +hi! link NonText LineNr + +" vim:set ts=4 sw=4 noet: diff --git a/vim/spell/en.utf-8.add b/vim/spell/en.utf-8.add new file mode 100644 index 0000000..598f4ab --- /dev/null +++ b/vim/spell/en.utf-8.add @@ -0,0 +1,13 @@ +plugins +com +org +vimrc +sqlite +Anki +gov +Trello +Kanban +BAES +Vertiban +SWOW +Todo diff --git a/vim/spell/en.utf-8.add.spl b/vim/spell/en.utf-8.add.spl Binary files differnew file mode 100644 index 0000000..a12bace --- /dev/null +++ b/vim/spell/en.utf-8.add.spl diff --git a/vim/vimrc b/vim/vimrc new file mode 100644 index 0000000..d7e3050 --- /dev/null +++ b/vim/vimrc @@ -0,0 +1,473 @@ +set nocompatible +syntax on "turn syntax highlighting on +filetype plugin indent on "load plugin and indent files associated a detected filetype + +" macro to go to end of sentence and add a line break (for +" one-line-per-sentence vimming...) +let @s = ")i\<BS>\<CR>\<Esc>" + +" Open vimrc +nnoremap <leader>ev <C-w>s<C-w>j<C-w>L:e $MYVIMRC<cr> + +" leader +let maplocalleader = "\\" +let mapleader = " " + +" encryption method when using :X +set cm=blowfish2 + +" Underline the current line, based on its length. +noremap <silent> <leader>ul mmyypVr-<Esc>`m +" +" Show the 'list' characters. +noremap <silent> <leader>ls :set list!<CR> + +" Remove double- or single-quotes, or graves wrapped around a string. +noremap <silent> <leader>rdq mmF"xf"x`m +noremap <silent> <leader>rsq mmF'xf'x`m +noremap <silent> <leader>rg mmF`xf`x`m + +" Jump up or down by 10 lines. +noremap <silent> J 10j +noremap <silent> K 10k + +" Place timestamps, be it date (YYYY-MM-DD) or time (HH:MM:SS). +if (exists("*strftime")) + noremap <silent> <leader>date "=strftime("%F")<CR>p9h + noremap <silent> <leader>time "=strftime("%X")<CR>p7h +endif +" +" Execute the current line with BASH. +noremap <silent> <leader>rl :.w !bash<CR> + +" Run the current file with PERL, Python, BASH, or a Bourne Shell derivative. +noremap <silent> <leader>rpl :!clear; perl %<CR> +noremap <silent> <leader>rpy :!clear; python %<CR> +noremap <silent> <leader>rb :!clear; bash %<CR> +noremap <silent> <leader>rs :!clear; sh %<CR> + +" essential plugins +call plug#begin() +Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } +Plug 'junegunn/fzf.vim' +Plug 'sheerun/vim-polyglot' +Plug 'preservim/vim-markdown' +Plug 'mhinz/vim-signify' +Plug 'vim-test/vim-test' +Plug 'ledger/vim-ledger' +Plug 'jlanzarotta/bufexplorer' +Plug 'tpope/vim-fugitive' +Plug 'tpope/vim-dispatch' +Plug 'tpope/vim-commentary' +"Plug 'ycm-core/YouCompleteMe' +"Plug 'jayli/vim-easycomplete' +Plug 'rose-pine/vim' +Plug 'SirVer/UltiSnips' +Plug 'honza/vim-snippets' +Plug 'dense-analysis/ale' +Plug 'davidhalter/jedi-vim' +call plug#end() + +" easycomplete +"let g:easycomplete_tab_trigger="<c-space>" + +" jedi-vim +let g:jedi#goto_command = "<leader>d" +let g:jedi#goto_assignments_command = "<leader>g" +let g:jedi#goto_stubs_command = "<leader>s" +let g:jedi#goto_definitions_command = "" +let g:jedi#documentation_command = "K" +let g:jedi#usages_command = "<leader>n" +let g:jedi#completions_command = "<C-Space>" +let g:jedi#rename_command = "<leader>r" +let g:jedi#rename_command_keep_name = "<leader>R" + +" " YCM +" let g:ycm_enable_inlay_hints = 1 +" nnoremap <silent> <localleader>h <Plug>(YCMToggleInlayHints) +" nnoremap gd :YcmCompleter GoToDefinition<CR> +" nnoremap <leader>gr :YcmCompleter GoToReferences<CR> +" nnoremap K :YcmCompleter GetDoc<CR> +" " this will disable tab, allowing it to be used for ultisnips +" let g:ycm_key_list_select_completion = ['<C-n>', '<Down>'] +" let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>'] +" let g:ycm_python_interpreter_path = '.venv/bin/python3' +" let g:ycm_auto_trigger = 0 +" let g:ycm_enable_inlay_hints = 0 +" let g:ycm_python_sys_path = [] +" let g:ycm_show_diagnostics_ui = 0 +" let g:ycm_extra_conf_vim_data = [ +" \ 'g:ycm_python_interpreter_path', +" \ 'g:ycm_python_sys_path' +" \] +" let g:ycm_global_ycm_extra_conf = '~/.global_extra_conf.py' +" nnoremap <leader>jd :YcmCompleter GoTo<CR> +" imap <silent> <C-l> <Plug>(YCMToggleSignatureHelp)'. + + + +" snippets +" Trigger configuration. You need to change this to something other than <tab> if you use one of the following: +" - https://github.com/Valloric/YouCompleteMe +" - https://github.com/nvim-lua/completion-nvim +let g:UltiSnipsExpandTrigger="<tab>" +let g:UltiSnipsJumpForwardTrigger="<c-b>" +let g:UltiSnipsJumpBackwardTrigger="<c-z>" + +" If you want :UltiSnipsEdit to split your window. +let g:UltiSnipsEditSplit="vertical" + +" vim-test +nmap <silent> tn :TestNearest<CR> +nmap <silent> tf :TestFile<CR> +nmap <silent> ts :TestSuite<CR> +nmap <silent> <leader>tl :TestLast<CR> +nmap <silent> <leader>tv :TestVisit<CR> +let test#strategy = "basic" +let test#python#pytest#options = '-q -s' +let test#python#runner = 'pytest' +let test#vimterminal#term_position = "belowright" + +" to run tests automatically +"augroup test +" autocmd! +" autocmd BufWrite * if test#exists() | +" \ TestFile | +" \ endif +"augroup END + +set shell=/bin/sh +set hi=500 +set scrolloff=0 +set novisualbell +set relativenumber "show line numbers +set wildignore=**/__pycache*/** +set wildmenu "enable a menu that shows tab completion options in the status bar +set wildchar=<TAB> +set showmatch "highlights matching brackets on cursor hover +set ruler "show cursor position in status bar +set showcmd "shows the normal mode command before it gets executed +set encoding=utf-8 +set fileformats=unix,dos,mac +set nohlsearch "highlights searches +set incsearch "incremental search (searches character by character) +set ignorecase "ignores the case of a search +set smartindent +set autoindent +set smartcase "only ignores case if there are no capital letters in search (only works after ignorecase has been set) +set tabstop=4 "the amount of spaces that vim will equate to a tab character +set softtabstop=4 "like tabstop, but for editing operations (insert mode) +set splitbelow " split horiz below +set noswapfile +set splitright " split new to the right when doing vertical +set shiftwidth=4 "used for autoindent and << and >> operators in normal mode +set autoindent "copies indent from current line to the next line +set expandtab "tabs will expand to whitespace characters +set esckeys "allows function keys to be recognized in Insert mode +set ttimeoutlen=20 "timeout for a key code mapping +set timeoutlen=1000 "time(ms) to wait for key mappings +set hidden +set t_Co=256 +"set t_Co=0 - switches off all colours +set path+=** +set more +set colorcolumn=0 +set equalalways +set showmode +set nobackup +set listchars=tab:»→,trail:␣ +if executable('rg') + set grepprg=rg\ --color=never\ --vimgrep +endif + +" From Practical Vim p101 - Easy expansion of Active File Directory +cnoremap <expr> %% getcmdtype() == ':' ? expand('%:h').'/' : '%%' + +" i don't bother with folding, but it's here if i need it. +if has('folding') + set foldmethod=marker + set foldmarker=#\ {{{,#\ }}} + set viewoptions=folds,options,cursor,unix,slash +endif + +" from https://www.reddit.com/r/vim/comments/f5gi2g/vim_notetaking_automatic_link_creation_between/ +" copies a link from file from previous buffer for pasting into +" next buffer with "ap +function! s:copy_filename_as_mdlink() + let fname=expand("%") + let @a="[" . fname . "](./" . fname. ")" +endfunction +autocmd BufLeave * call s:copy_filename_as_mdlink() + +" Ultisnips +let g:UltiSnipsExpandTrigger="<tab>" +let g:UltiSnipsJumpForwardTrigger="<c-j>" +let g:UltiSnipsJumpBackwardTrigger="<c-k>" +set completefunc=UltiSnips#Complete + + +" vim-test +" use vim-dispatch to run tests in the quickfix window +" from Modern Vim Ch.4 +" the mappings below are from vim-test +" https://github.com/vim-test/vim-test +" dispatch opens send test output to quickfix window +let test#strategy = "basic" +let test#python#runner = "pytest" +let test#vim#term_position = "topleft 10" +let test#python#pytest#options = '--tb=short' +let test#go#runner = 'gotest' +"let test#go#gotest#options = '-v' +" To run mypy using vim-dispath -with Dispatch +autocmd FileType python let b:dispatch = 'mypy --ignore-missing-imports' + +" Set wrap option for Markdown files +autocmd FileType markdown setlocal linebreak + +" test +nmap <silent> tn :TestNearest<CR> +nmap <silent> ts :TestSuite<CR> +nmap <silent> tf :TestFile<CR> +nmap <silent> <S-F10> :TestLast<CR> +nmap <silent> t<C-g> :TestVisit<CR> + +" disable folding by default with vim-markdown +let g:vim_markdown_folding_disabled = 1 +" +" ALE ale config +let g:ale_enabled = 0 +let g:ale_echo_msg_format = '[%linter%] %s [%severity%]' +let g:ale_sign_error = '✘' +let g:ale_sign_warning = '⚠' +let g:ale_lint_on_text_changed = 0 +let g:ale_hover_cursor = 0 +let g:ale_virtualtext_cursor = 'disabled' +let g:ale_sign_column_always = 1 +let g:ale_open_list = 0 +let g:ale_set_highlights = 1 +let g:ale_set_signs = 1 +let g:ale_set_loclist = 1 +let g:ale_set_quickfix = 0 +let g:ale_echo_cursor = 1 +let g:ale_echo_msg_error_str = 'Error' +let g:ale_echo_msg_format = '%linter% - %code: %%s' +let g:ale_loclist_msg_format = '%linter% - %code: %%s' +let g:ale_echo_msg_warning_str = 'Warning' +let g:ale_linters = {'python': ['flake8', 'mypy'], +\ 'ocaml': ['merlin'], +\ 'cpp': ['clang'], +\ 'yaml': ['yamllint'], +\ 'c': ['clang'], +\ 'go': ['gopls', 'golint', 'gofmt'], + \} +let g:ale_fixers = { +\ 'python': ['isort', 'yapf', 'black'], +\ 'go': ['gofmt'], +\ 'rust': ['rustfmt'] +\ } +let g:ale_python_mypy_ignore_invalid_syntax = 1 +let g:ale_python_mypy_executable = 'mypy' +let g:ale_python_mypy_options = '--config-file mypy.ini' +" let g:ale_sign_error = '>>' +let g:ale_fix_on_save = 1 +let g:ale_linters_explicit = 0 + +" Python - keybindings +nnoremap <leader>Ts :setlocal makeprg=pytest\ -q\ %<cr> +nnoremap <leader>Tf :setlocal makeprg=flake8\ %<cr> +nnoremap <leader>Tb :setlocal makeprg=black\ %<cr> +nnoremap <leader>Tm :setlocal makeprg=mypy\ --ignore-missing-imports\ %<cr> +" then run the one set with this... +nnoremap <leader>Tt :make!<cr> + +" clear search highlights +nnoremap <leader><space> :noh<cr>:call clearmatches()<cr> + +" previews in netrw +let g:netrw_preview = 1 + +" journal stuff +autocmd BufNewFile,BufReadPost *.md map <leader>jj <Esc>:r! date +" - \%H:\%M: "<ENTER>kJA<Esc>$<space><Esc> +autocmd BufNewFile,BufReadPost *.md map <leader>jd <Esc>:r! date +"(\%Y-\%m-\%dT\%H:\%M)"<ENTER>i<backspace><space><Esc> + +syntax on "turn syntax highlighting on +filetype plugin indent on "load plugin and indent files associated a detected filetype +runtime macros/matchit.vim "allows jumping between brackets with % in normal mode + +" Go stuff +let g:go_highlight_fields = 1 +let g:go_highlight_functions = 1 +let g:go_highlight_function_calls = 1 +let g:go_highlight_extra_types = 1 +let g:go_highlight_operators = 1 +let g:go_doc_keywordprg_enabled = 1 +let g:go_list_height = 0 +let g:go_highlight_operators = 1 +let g:go_highlight_function_parameters = 1 +let g:go_doc_max_height = 50 +let g:go_doc_popup_window = 1 +let g:go_list_height = 10 + + +" vim-go debugger window settings +let g:go_debug_windows = { + \ 'vars': 'leftabove 40vnew', + \ 'stack': 'leftabove 20new', + \ 'goroutines': 'botright 10new', + \ 'out': 'botright 5new', +\ } + +" vim-go and gopls +let g:go_def_mode='gopls' +let g:go_info_mode='gopls' +let g:go_play_browser_command = 'firefox %URL% &' +let g:go_test_show_name = 1 +let g:go_auto_type_info = 1 +let test#go#runner = 'gotest' +let g:go_term_mode = "split" +let g:go_term_height = 50 +let g:go_highlight_fields = 1 +let g:go_highlight_functions = 1 + +"autocmd FileType go nmap <leader>r :w<CR>:split <bar> terminal go run %<CR> +autocmd FileType go nmap <leader>R :GoRun<CR> +" highlights the variable in the file for you.. +"let g:go_auto_sameids = 1 +" auto import... +let g:go_fmt_command = "goimports" +" automatic type info on cursor +let g:go_auto_type_info = 2 +let g:go_snippet_engine = "ultisnips" +au Filetype go nmap <leader>ga <Plug>(go-alternate-edit) +au Filetype go nmap <leader>gah <Plug>(go-alternate-split) +au Filetype go nmap <leader>gav <Plug>(go-alternate-vertical) +au Filetype go nmap <leader>gaf <Plug>(go-fmt) +au Filetype go nmap <leader>gal <Plug>(go-lint) +au Filetype go nmap <leader>gbx <Plug>(go-deps) +au FileType go nmap <F8> :GoTestFunc -short<cr> +au FileType go nmap <F10> :GoTest -short<cr> +au FileType go nmap <F9> :DlvToggleBreakpoint<CR> +au FileType go nmap <S-F9> :DlvTest<CR> +au FileType go nmap <F11> :DlvDebug<CR> +au FileType go nmap <S-F5> :GoRename<CR> + +" FZF +" This is the default extra key bindings +let g:fzf_action = { + \ 'ctrl-t': 'tab split', + \ 'ctrl-x': 'split', + \ 'ctrl-v': 'vsplit' } + +" - FZF Popup window (center of the screen) +let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6 } } + +" Customize fzf colors to match your color scheme +let g:fzf_colors = +\ { 'fg': ['fg', '#f8f8f2'], + \ 'bg': ['bg', '#282a36'], + \ 'hl': ['fg', '#bd93f9'], + \ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'], + \ 'bg+': ['bg', 'CursorLine', 'CursorColumn'], + \ 'hl+': ['fg', 'Statement'], + \ 'info': ['fg', '#ffb86c'], + \ 'prompt': ['fg', '#50fa7b'], + \ 'pointer': ['fg', 'Exception'], + \ 'marker': ['fg', 'Keyword'], + \ 'spinner': ['fg', '#ffb86c'], + \ 'header': ['fg', '#6272a4'] } +" More fzf settings +" (https://github.com/zenbro/dotfiles/blob/master/.nvimrc#L151-L187) + let g:fzf_nvim_statusline = 0 " disable statusline overwriting + + " copy the path of the current file into the system clipboard +"nnoremap <leader>y :let @+=expand('%:p')<CR>:call system("true")<CR>:let @"=@+<CR>:echo "File path copied to clipboard: " . @+<CR> +nnoremap <leader>y :let @*=expand('%:p')<CR>:call system("true")<CR>:let @+=@*<CR>:echo "File path copied to clipboard: " . @+<CR> + +" Alternatively, format is as Markdown link +nnoremap <leader>Y :let @+=printf("[%s](%s)", expand('%:t'), "file://" . expand('%:p'))<CR>:call system("true")<CR>:let @"=@+<CR>:echo "Markdown link copied to clipboard: " . @+<CR> + +" command history is :History: + nnoremap <C-s> :GFiles!<CR> + nnoremap <leader><C-p> :<C-u>FZF!<CR> + nnoremap <leader>t :Files<CR> + nnoremap <leader>o :Tags<CR> + nnoremap <leader>h :History<CR> + nnoremap <silent> <leader>0 :Files<CR> + nnoremap <silent> <leader>; :BLines<CR> + nnoremap <silent> <leader>l :Lines<CR> + nnoremap <silent> <leader>o :BTags<CR> + nnoremap <silent> <leader>bu :Buffers<CR> + nnoremap <silent> <leader>? :History:<CR> + " nnoremap <silent> <leader>/ :execute 'Ag ' . input('Ag/')<CR> + nnoremap <silent> <leader>ft :Filetypes<CR> + nnoremap <silent> <leader>CC :Commands<CR> + imap <C-x><C-f> <plug>(fzf-complete-file-ag) + imap <C-x><C-l> <plug>(fzf-complete-line) + +" remap :W to :w - :W was previous Windows in fzf +cnoreabbrev W w + +" ghetto note system +" Go to index of notes +nnoremap <leader>ni :e $NOTES_DIR/index.md<CR>:cd $NOTES_DIR<CR> +" Depends on grepprg being set to rg +command! -nargs=1 Ngrep grep "<args>" -g "*.md" $NOTES_DIR +nnoremap <leader>nn :Ngrep + +" open quicklist vertical +command! Vlist botright vertical copen | vertical resize 50 +nnoremap <leader>v :Vlist<CR> + +" Search with ripgrep +command! -bang -nargs=* Rg + \ call fzf#vim#grep( + \ 'rg --column --line-number --no-heading --color=always --ignore-case '.shellescape(<q-args>), 1, + \ <bang>0 ? fzf#vim#with_preview('up:60%') + \ : fzf#vim#with_preview('right:50%:hidden', '?'), + \ <bang>0) + +nnoremap <C-p>a :Rg + +"" Quick Editing vimrc +nnoremap <leader>ev <C-w>s<C-w>j<C-w>L:e $MYVIMRC<cr> + +syntax enable +let g:solarized_termcolors=256 +let g:gruvbox_termcolors=256 +let g:gruvbox_contrast_dark='hard' +let g:gruvbox_contrast_light='hard' +let g:gruvbox_hls_cursor='orange' +let g:gruvbox_sign_column='bg0' +let g:gruvbox_number_column='bg0' +let g:gruvbox_invert_signs='0' +let g:gruvbox_improved_strings='0' +set background=dark +"colorscheme hipster +colorscheme rosepine + +" manual highlights +" highlight Visual ctermfg=black ctermbg=LightMagenta +" highlight SignColumn ctermbg=black ctermfg=white +" highlight Comment ctermfg=DarkGray +" highlight DiffAdd term=bold ctermfg=yellow ctermbg=black +" highlight DiffDelete term=bold ctermfg=red ctermbg=black +" highlight DiffChange term=bold ctermfg=black ctermbg=DarkGreen + +augroup general + autocmd! + "keep equal proportions when windows resized + autocmd VimResized * wincmd = + "save cursor position in a file + autocmd BufReadPost * if line("'\"") > 1 && line("'\"") + \ <= line("$") | exe "normal! g'\"" | endif +augroup END + +augroup languages + autocmd! + autocmd BufNewFile,BufRead *.bash set syntax=sh + autocmd FileType python xnoremap <leader>r <esc>:'<,'>:w !python3<CR> + autocmd FileType go set noexpandtab + autocmd FileType html :syntax sync fromstart + autocmd FileType html,javascript,css,json,yaml,sh + \ setlocal ts=2 sts=2 sw=2 expandtab +augroup END @@ -0,0 +1,3 @@ +remove Lock = Caps_Lock +keysym Caps_Lock = Control_L +add Control = Control_L
\ No newline at end of file diff --git a/xprofile b/xprofile new file mode 100644 index 0000000..b3c7d8b --- /dev/null +++ b/xprofile @@ -0,0 +1,20 @@ +# This file is needed by gdm to configure the startup when using the dwm window manager + +# Calls a script which sets a random background +#~/.fehbg + +# Terminal st config is in Xresources so this needs to be called +xrdb ~/.Xresources + +xmodmap ~/.xmodmap & + +setxkbmap us & + +# xsetroot -solid gray + +# This gives us a nice status bar at the top +dwmstatus 2>&1 >/dev/null & + +# Start dwm +exec dwm + |