Bear 2 years ago
parent
commit
e55bc3c2df
48 changed files with 11504 additions and 0 deletions
  1. 19 0
      README.md
  2. 77 0
      Xresources
  3. 22 0
      bashrc
  4. 1 0
      dwm
  5. 10 0
      firefox/README.md
  6. BIN
      firefox/firefox.png
  7. 119 0
      firefox/userChrome.css
  8. 9 0
      i3wm/README.md
  9. BIN
      i3wm/Wallpaper.png
  10. 137 0
      i3wm/config
  11. BIN
      i3wm/dirty.png
  12. BIN
      i3wm/i3lock.png
  13. 12 0
      i3wm/lock.sh
  14. 902 0
      nvim/NeoSolarized.vim
  15. 16 0
      nvim/README.md
  16. 74 0
      nvim/init.vim
  17. BIN
      nvim/nvim.png
  18. 5 0
      polybar/README.md
  19. 47 0
      polybar/config
  20. BIN
      polybar/polybar.png
  21. 12 0
      scripts/README.md
  22. BIN
      scripts/currentbattery.png
  23. 8 0
      scripts/currentbattery.sh
  24. BIN
      scripts/time.png
  25. 5 0
      scripts/time.sh
  26. 57 0
      st/Makefile
  27. 12 0
      st/README.md
  28. 50 0
      st/arg.h
  29. 464 0
      st/config.def.h
  30. 458 0
      st/config.h
  31. 28 0
      st/config.mk
  32. BIN
      st/st
  33. 13 0
      st/st-clipboard-0.8.1.diff
  34. 88 0
      st/st-hidecursor-0.8.1.diff
  35. 348 0
      st/st-scrollback-0.8.diff
  36. 180 0
      st/st.1
  37. 2685 0
      st/st.c
  38. 2618 0
      st/st.c.orig
  39. 131 0
      st/st.h
  40. 222 0
      st/st.info
  41. BIN
      st/st.o
  42. BIN
      st/st.png
  43. 38 0
      st/win.h
  44. 1976 0
      st/x.c
  45. BIN
      st/x.o
  46. 7 0
      weechat/README.md
  47. 650 0
      weechat/weechat.conf
  48. 4 0
      xinitrc

+ 19 - 0
README.md

@@ -0,0 +1,19 @@
+# Dot-Files
+
+#### Configuration files and scripts to fully rice my setup.
+
+* dwm/ - dwm window manager configuration files and patch.
+* firefox/ - Configuration files for Firefox.
+* i3wm/ - i3wm window manager configuration file and script.
+* nvim/ - Neovim text editor configuration file and colors.
+* polybar/ - polybar status bar configuration file.
+* scripts/ - Miscellaneous scripts.
+* st/ - suckless terminal configuration files and patches.
+* weechat/ - Weechat IRC client configuration files.
+* bashrc - bash configuration file.
+* xinitrc - Xorg configuration file.
+* Xresource - Configuration file for urxvt-unicode and rofi.
+
+#### Dirty
+
+![dirty.png](https://git.dankpad.xyz/Bear/Dot-Files/raw/branch/master/dwm/dwm.png)

+ 77 - 0
Xresources

@@ -0,0 +1,77 @@
+! urxvt
+
+URxvt*scrollBar:		false
+URxvt*geometry:			80x21
+URxvt.internalBorder:		15
+
+! Perl extensions
+
+URxvt.perl-ext-common:		default,url-select,clipboard
+
+! URL-select
+
+URxvt.keysym.M-u:		perl:url-select:select_next
+URxvt.url-select.autocopy:	true
+URxvt.url-select.button:	1
+URxvt.url-select.launcher:	qutebrowser
+URxvt.url-select.underline:	true
+
+! Clipboard
+
+URxvt.keysym.Shift-Control-V:	perl:clipboard:paste
+URxvt.keysym.Shift-Control-C:	perl:clipboard:copy
+
+! Ctrl-shift disable popup
+
+URxvt.iso14755:		false
+URxvt.iso14755_52:	false
+
+! Colors and shit
+
+URxvt.font:		xft:Misc Tamsyn:size=10
+URxvt.letterSpace:	0
+URxvt*foreground:	#FFFFFF
+URxvt*background:	#232323
+
+! color0	black
+! color1	red
+! color2	green
+! color3	yellow
+! color4	blue
+! color5	purple
+! color6	cyan
+! color7	white
+
+URxvt*color0:	#073642
+URxvt*color1:	#DC322F
+URxvt*color2:	#859900
+URxvt*color3:	#B58900
+URxvt*color4:	#268BD2
+URxvt*color5:	#6C71C4
+URxvt*color6:	#2AA198
+URxvt*color7:	#FFFFFF
+
+! color8	black
+! color9	red
+! color10	green
+! color11	yellow
+! color12	blue
+! color13	purple
+! color14	cyan
+! color15	white
+
+URxvt*color8:	#FFFFFF
+URxvt*color9:	#DC322F
+URxvt*color10:	#859900
+URxvt*color11:	#B58900
+URxvt*color12:	#268BD2
+URxvt*color13:	#6C71C4
+URxvt*color14:	#2AA198
+URxvt*color15:	#FFFFFF
+
+! Rofi
+
+rofi.font:		Misc Tamsyn 10
+rofi.color-enabled: 	true
+rofi.color-window: 	#232323, #232323, #232323
+rofi.color-normal:	#232323, #FFFFFF, #232323, #FFFFFF, #232323

+ 22 - 0
bashrc

@@ -0,0 +1,22 @@
+#
+# ~/.bashrc
+#
+
+# If not running interactively, don't do anything
+[[ $- != *i* ]] && return
+
+# Colors
+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
+
+alias rm='rm -i'
+alias vim='nvim'
+
+PS1='\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w\[\033[00m\]> '

+ 1 - 0
dwm

@@ -0,0 +1 @@
+Subproject commit b69c870a3076d78ab595ed1cd4b41cf6b03b2610

+ 10 - 0
firefox/README.md

@@ -0,0 +1,10 @@
+# Firefox
+
+#### Configuration files for Firefox.
+
+* userChrome.css - Firefox styling CSS.
+
+
+#### Screenshots
+
+![Firefox](https://git.dankpad.xyz/Bear/Dot-Files/raw/branch/master/firefox/firefox.png)

BIN
firefox/firefox.png


+ 119 - 0
firefox/userChrome.css

@@ -0,0 +1,119 @@
+@namespace xul url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
+
+
+/*
+
+    Author: Bear
+    Compatibility: Firefox 64 (might work elsewhere, was just made specifically using Firefox 64)
+    Website: http://www.dankpad.xyz/
+
+    Inspiration from Twily (http://twily.info/).
+
+*/
+
+
+:root {
+
+    /* Tab Variables */
+    --bg-light: #FFFFFF; --bg-dark: #232323;
+    --fg-light: #232323; --fg-dark: #FFFFFF;
+    --tab-height: 24px; --tab-icon-size: 16px;
+    --tab-fonts: "Misc Tamsyn"; --tab-font-size: 14px; --tab-text-align: left;
+
+    /* URL Variables */
+    --url-background: var(--bg-dark); --url-color: var(--fg-dark);
+    --url-height: 24px;
+    --url-fonts: "Misc Tamsyn"; --url-font-size: 14px; --url-text-align: center;
+
+}
+
+
+/* Hidden Items */
+#library-button, #sidebar-button, #titlebar-buttonbox-container, #reload-button, #home-button, #back-button, #forward-button, 
+#close-icon, .tab-close-button, .tabs-newtab-button, #star-button, .urlbar-icon, .urlbar-history-dropmarker, #identity-box, 
+#PanelUI-menu-button, #new-tab-button, #alltabs-button, #PanelUI-button { display: none !important; }
+
+
+/* Hide Scrollbar */
+:-moz-any(#content,#appcontent) browser {
+ 
+    margin-right: -14px !important;
+    overflow-y: scroll;
+    margin-bottom: -14px !important;
+    overflow-x: scroll;
+
+}
+
+
+/* URL Bar Tweaks */
+/* START */
+
+
+    /* Merges Entire URL Bar */
+    #urlbar {
+
+        border: none !important; padding: 0 2px 0 8px !important;
+        background: var(--url-background) !important; color: var(--url-color) !important;
+        font-family: var(--url-fonts) !important; font-size: var(--url-font-size) !important;
+        text-align: var(--url-text-align) !important;
+        height: 100% !important;
+
+    }
+
+    /* Helps Merge URL Bar */
+    #nav-bar {
+
+        background-color: var(--bg-dark) !important;
+        background-image: none !important;
+
+    }
+
+    /* Sets URL Bar Height */
+    .urlbar-textbox-container .urlbar-input-box .textbox-input {
+
+        height: var(--url-height) !important;
+
+    }
+
+
+/* END */
+/* URL Bar Tweaks */
+
+
+/* Tab Tweaks */
+/* START */
+
+    /* Overall Tab Tweaks */
+    #tabbrowser-tabs {
+
+        background-color: var(--bg-dark) !important;
+        font-family: var(--tab-fonts); font-size: var(--tab-font-size);
+    
+    }
+    
+    /* Removes Selected Tab Overlay */
+    .tab-background[selected="true"] {
+
+        background-color: var(--bg-dark) !important;
+        background-image: none !important;
+    }
+
+    /* Active Tab Border Hide */
+    #navigator-toolbox {
+
+        --tabs-border-color: var(--bg-dark) !important;
+
+    }
+
+    /* Removes Tab Line Color and Sets Font */
+    .tabbrowser-tab:not([visuallyselected="false"]) {
+
+        background-color: var(--bg-dark) !important;
+        background-image: none !important;
+        --tab-line-color: none !important;
+        color: var(--bg-light) !important;
+
+    }
+
+/* END */
+/* Tab Tweaks */

+ 9 - 0
i3wm/README.md

@@ -0,0 +1,9 @@
+# i3wm
+
+#### Configuration files and scripts for i3wm.
+
+Any dependencies at the top of the file.
+
+* config - Configuration file for i3wm.
+* lock.sh - Lock script for i3lock.
+* currentbattery.sh - Shows the current battery information through dunst.

BIN
i3wm/Wallpaper.png


+ 137 - 0
i3wm/config

@@ -0,0 +1,137 @@
+# Dependencies:
+# * feh
+# * dunst
+# * rofi
+
+#Setting mod key to Windows/Super key
+set $mod Mod4
+
+# Font
+font pango:Misc Tamsyn 11
+
+# Window border width
+for_window [class="^.*"] border pixel 3
+
+# Terminal
+bindsym $mod+Return exec st
+
+# Kill focused window
+bindsym $mod+Shift+q kill
+
+# Start rofi with my tweak
+bindsym $mod+d exec rofi -show run -width 700 -lines 14
+
+# Change focus
+bindsym $mod+h focus left
+bindsym $mod+j focus down
+bindsym $mod+k focus up
+bindsym $mod+l focus right
+
+# Move focused window
+bindsym $mod+Shift+h move left
+bindsym $mod+Shift+j move down
+bindsym $mod+Shift+k move up
+bindsym $mod+Shift+l move right
+
+# Split horizontal
+bindsym $mod+b split h
+
+# Split vertical
+bindsym $mod+v split v
+
+# Fullscreen
+bindsym $mod+f fullscreen toggle
+
+# Change container layout
+bindsym $mod+s layout stacking
+bindsym $mod+t layout tabbed
+bindsym $mod+e layout toggle split
+
+# Workspaces
+set $workspace1 "1"
+set $workspace2 "2"
+set $workspace3 "3"
+set $workspace4 "4"
+set $workspace5 "5"
+set $workspace6 "6"
+set $workspace7 "7"
+set $workspace8 "8"
+set $workspace9 "9"
+set $workspace10 "10"
+
+# Switching workspaces
+bindsym $mod+1 workspace $workspace1 
+bindsym $mod+2 workspace $workspace2
+bindsym $mod+3 workspace $workspace3
+bindsym $mod+4 workspace $workspace4
+bindsym $mod+5 workspace $workspace5
+bindsym $mod+6 workspace $workspace6
+bindsym $mod+7 workspace $workspace7
+bindsym $mod+8 workspace $workspace8
+bindsym $mod+9 workspace $workspace9
+bindsym $mod+0 workspace $workspace10
+
+# Move focused container to workspace
+bindsym $mod+Shift+1 move container to workspace $workspace1
+bindsym $mod+Shift+2 move container to workspace $workspace2
+bindsym $mod+Shift+3 move container to workspace $workspace3
+bindsym $mod+Shift+4 move container to workspace $workspace4
+bindsym $mod+Shift+5 move container to workspace $workspace5
+bindsym $mod+Shift+6 move container to workspace $workspace6
+bindsym $mod+Shift+7 move container to workspace $workspace7
+bindsym $mod+Shift+8 move container to workspace $workspace8
+bindsym $mod+Shift+9 move container to workspace $workspace9
+bindsym $mod+Shift+0 move container to workspace $workspace10
+
+# Assign applications to workspaces
+assign [class="firefox"] $workspace1
+
+# Reload the configuration file
+bindsym $mod+Shift+c reload
+
+# Restart i3
+bindsym $mod+Shift+r restart
+
+# Exit i3
+bindsym $mod+Shift+e exit
+
+# Resize window
+mode "RESIZE" {
+        
+        bindsym h resize shrink width 10 px or 10 ppt
+        bindsym k resize grow height 10 px or 10 ppt
+        bindsym j resize shrink height 10 px or 10 ppt
+        bindsym l resize grow width 10 px or 10 ppt
+
+	# Exit resize mode
+        bindsym Return mode "default"
+        bindsym Escape mode "default"
+}
+
+# Resize
+bindsym $mod+r mode "resize"
+ 
+# Colors
+set $bg-color		 #FFFFFF  
+set $inactive-bg-color	 #232323  
+set $text-color		 #FFFFFF  
+set $inactive-text-color #B2B2B2  
+set $urgent-bg-color	 #DC322F  
+
+# Windows colors
+#			border			background		text			indicator	
+client.focused		$text-color		$bg-color		$text-color		#FFFFFF 
+client.unfocused	$inactive-bg-color	$inactive-bg-color	$inactive-text-color	#FFFFFF 
+client.focused_inactive	$inactive-bg-color	$inactive-bg-color	$inactive-text-color	#FFFFFF 
+client.urgent		$urgent-bg-color	$urgent-bg-color	$text-color		#FFFFFF 
+
+# Misc.
+bindsym XF86AudioLowerVolume exec amixer set Master unmute 10%-
+bindsym XF86AudioRaiseVolume exec amixer set Master unmute 10%+
+bindsym XF86AudioMute exec amixer set Master mute
+bindsym $mod+shift+m exec scrot 
+bindsym $mod+Tab workspace next
+bindsym $mod+Shift+Tab workspace prev
+bindsym $mod+x exec bash ~/.config/i3/lock.sh
+exec_always feh --bg-scale ~/Pictures/Wallpaper.png
+exec_always --no-startup-id dunst

BIN
i3wm/dirty.png


BIN
i3wm/i3lock.png


+ 12 - 0
i3wm/lock.sh

@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# Dependencies:
+# * scrot
+# * imagemagick
+
+scrot /tmp/screen.png
+convert /tmp/screen.png -scale 10% -scale 1000% /tmp/screen.png
+[[ -f $1 ]] && convert /tmp/screen.png $1 -gravity center -composite -matte /tmp/screen.png
+#dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop
+i3lock -u -i /tmp/screen.png
+rm /tmp/screen.png

+ 902 - 0
nvim/NeoSolarized.vim

@@ -0,0 +1,902 @@
+" Name:     NeoSolarized: Colorscheme for truecolor vim
+" Author:   iCyMind <icyminnd@gmail.com>
+" URL:      https://github.com/iCyMind/NeoSolarized
+" License:  MIT
+" Modified: Mon Sep 26 14:45:22 CST 2016
+
+" Usage "{{{
+"
+" ---------------------------------------------------------------------
+" ABOUT:
+" ---------------------------------------------------------------------
+" Solarized is a carefully designed selective contrast colorscheme with dual
+" light and dark modes that runs in both GUI, 256 and 16 color modes.
+"
+" But the origin solarized does not support truecolor terminal. NeoSolarized
+" is a fixed colorscheme for neovim/vim which running in truecolor supported
+" terminal.
+"
+" ---------------------------------------------------------------------
+" OPTIONS:
+" ---------------------------------------------------------------------
+" g:neosolarized_contrast
+" g:neosolarized_visibility
+" g:neosolarized_diffmode
+" g:neosolarized_termtrans
+" g:neosolarized_bold
+" g:neosolarized_underline
+" g:neosolarized_italic
+"
+" ---------------------------------------------------------------------
+" INSTALLATION:
+" ---------------------------------------------------------------------
+" move the NeoSolarized.vim to your VIMRUNTIME by manual or plugin manager
+"
+" MODIFY VIMRC:
+"
+" After either Option 1 or Option 2 above, put the following two lines in your
+" .vimrc:
+"
+"     syntax enable
+"     set background=dark
+"     colorscheme NeoSolarized
+"
+" or, for the light background mode of Solarized:
+"
+"     syntax enable
+"     set background=light
+"     colorscheme NeoSolarized
+"
+" I like to have a different background in GUI and terminal modes, so I can use
+" the following if-then. However, I find vim's background autodetection to be
+" pretty good and, at least with MacVim, I can leave this background value
+" assignment out entirely and get the same results.
+"
+"     if has('gui_running')
+"       set background=light
+"     else
+"       set background=dark
+"     endif
+"
+" See the Solarized homepage at http://ethanschoonover.com/solarized for
+" screenshots which will help you select either the light or dark background.
+"
+" ---------------------------------------------------------------------
+" COLOR VALUES
+" ---------------------------------------------------------------------
+" Download palettes and files from: http://ethanschoonover.com/solarized
+"
+" L\*a\*b values are canonical (White D65, Reference D50), other values are
+" matched in sRGB space.
+"
+" SOLARIZED HEX     16/8 TERMCOL  XTERM/HEX   L*A*B      sRGB        HSB
+" --------- ------- ---- -------  ----------- ---------- ----------- -----------
+" base03    #002b36  8/4 brblack  234 #1c1c1c 15 -12 -12   0  43  54 193 100  21
+" base02    #073642  0/4 black    235 #262626 20 -12 -12   7  54  66 192  90  26
+" base01    #586e75 10/7 brgreen  240 #4e4e4e 45 -07 -07  88 110 117 194  25  46
+" base00    #657b83 11/7 bryellow 241 #585858 50 -07 -07 101 123 131 195  23  51
+" base0     #839496 12/6 brblue   244 #808080 60 -06 -03 131 148 150 186  13  59
+" base1     #93a1a1 14/4 brcyan   245 #8a8a8a 65 -05 -02 147 161 161 180   9  63
+" base2     #eee8d5  7/7 white    254 #d7d7af 92 -00  10 238 232 213  44  11  93
+" base3     #fdf6e3 15/7 brwhite  230 #ffffd7 97  00  10 253 246 227  44  10  99
+" yellow    #b58900  3/3 yellow   136 #af8700 60  10  65 181 137   0  45 100  71
+" orange    #cb4b16  9/3 brred    166 #d75f00 50  50  55 203  75  22  18  89  80
+" red       #dc322f  1/1 red      160 #d70000 50  65  45 220  50  47   1  79  86
+" magenta   #d33682  5/5 magenta  125 #af005f 50  65 -05 211  54 130 331  74  83
+" violet    #6c71c4 13/5 brmagenta 61 #5f5faf 50  15 -45 108 113 196 237  45  77
+" blue      #268bd2  4/4 blue      33 #0087ff 55 -10 -45  38 139 210 205  82  82
+" cyan      #2aa198  6/6 cyan      37 #00afaf 60 -35 -05  42 161 152 175  74  63
+" green     #859900  2/2 green     64 #5f8700 60 -20  65 133 153   0  68 100  60
+"
+" ---------------------------------------------------------------------
+" COLORSCHEME HACKING
+" ---------------------------------------------------------------------
+"
+" Useful commands for testing colorschemes:
+" :source $VIMRUNTIME/syntax/hitest.vim
+" :help highlight-groups
+" :help cterm-colors
+" :help group-name
+"
+" Useful links for developing colorschemes:
+" http://www.vim.org/scripts/script.php?script_id=2937
+" http://vimcasts.org/episodes/creating-colorschemes-for-vim/
+" http://www.frexx.de/xterm-256-notes/"
+"
+" }}}
+
+" Default option values"{{{
+" ---------------------------------------------------------------------
+
+let g:neosolarized_contrast = get(g:, "neosolarized_contrast", "normal")
+let g:neosolarized_visibility = get(g:, "neosolarized_visibility", "normal")
+let g:neosolarized_diffmode = get(g:, "neosolarized_diffmode", "normal")
+let g:neosolarized_bold = get(g:, "neosolarized_bold", 1)
+let g:neosolarized_underline = get(g:, "neosolarized_underline", 1)
+let g:neosolarized_italic = get(g:, "neosolarized_italic", 0)
+let g:neosolarized_termtrans = get(g:, "neosolarized_termtrans", 0)
+let g:neosolarized_vertSplitBgTrans = get(g:, "neosolarized_vertSplitBgTrans", 1)
+
+"}}}
+
+" Colorscheme initialization "{{{
+" ---------------------------------------------------------------------
+hi clear
+if exists("syntax_on")
+  syntax reset
+endif
+let colors_name = "NeoSolarized"
+
+"}}}
+
+" GUI & CSApprox hexadecimal palettes"{{{
+" ---------------------------------------------------------------------
+"
+" Set gui and terminal at the same time.
+    let s:gui_mode       = "gui"
+    let s:gui_base03      = "#232323"
+    let s:gui_base02      = "#232323"
+    let s:gui_base01      = "#586E75"
+    let s:gui_base00      = "#FFFFFF"
+    let s:gui_base0       = "#FFFFFF"
+    let s:gui_base1       = "#93A1A1"
+    let s:gui_base2       = "#EEE8D5"
+    let s:gui_base3       = "#FDF6E3"
+    let s:gui_yellow      = "#b58900"
+    let s:gui_orange      = "#cb4b16"
+    let s:gui_red         = "#dc322f"
+    let s:gui_magenta     = "#d33682"
+    let s:gui_violet      = "#6c71c4"
+    let s:gui_blue        = "#268bd2"
+    let s:gui_cyan        = "#2aa198"
+    let s:gui_green       = "#859900" "experimental
+    "let s:green       = "#859900" "original
+
+    let s:term_mode       = "cterm"
+    let s:term_base03      = "8"
+    let s:term_base02      = "0"
+    let s:term_base01      = "10"
+    let s:term_base00      = "11"
+    let s:term_base0       = "12"
+    let s:term_base1       = "14"
+    let s:term_base2       = "7"
+    let s:term_base3       = "15"
+    let s:term_yellow      = "3"
+    let s:term_orange      = "9"
+    let s:term_red         = "1"
+    let s:term_magenta     = "5"
+    let s:term_violet      = "13"
+    let s:term_blue        = "4"
+    let s:term_cyan        = "6"
+    let s:term_green       = "2"
+
+"}}}
+
+" Formatting options and null values for passthrough effect "{{{
+" ---------------------------------------------------------------------
+    let s:gui_none        = "NONE"
+    let s:term_none       = "NONE"
+    let s:n               = "NONE"
+    let s:c               = ",undercurl"
+    let s:r               = ",reverse"
+    let s:s               = ",standout"
+    let s:ou              = ""
+    let s:ob              = ""
+"}}}
+
+" Background value based on termtrans setting "{{{
+" ---------------------------------------------------------------------
+if (has("gui_running") || g:neosolarized_termtrans == 0)
+    let s:gui_back        = s:gui_base03
+    let s:term_back        = s:term_base03
+else
+    let s:gui_back        = "NONE"
+    let s:term_back        = "NONE"
+endif
+"}}}
+
+" Alternate light scheme "{{{
+" ---------------------------------------------------------------------
+if &background == "light"
+    " GUI
+    let s:gui_temp03    =   s:gui_base03
+    let s:gui_temp02    =   s:gui_base02
+    let s:gui_temp01    =   s:gui_base01
+    let s:gui_temp00    =   s:gui_base00
+    let s:gui_base03    =   s:gui_base3
+    let s:gui_base02    =   s:gui_base2
+    let s:gui_base01    =   s:gui_base1
+    let s:gui_base00    =   s:gui_base0
+    let s:gui_base0     =   s:gui_temp00
+    let s:gui_base1     =   s:gui_temp01
+    let s:gui_base2     =   s:gui_temp02
+    let s:gui_base3     =   s:gui_temp03
+    if (s:gui_back != "NONE")
+        let s:gui_back  =   s:gui_base03
+    endif
+
+    " terminal
+    let s:term_temp03   =   s:term_base03
+    let s:term_temp02   =   s:term_base02
+    let s:term_temp01   =   s:term_base01
+    let s:term_temp00   =   s:term_base00
+    let s:term_base03   =   s:term_base3
+    let s:term_base02   =   s:term_base2
+    let s:term_base01   =   s:term_base1
+    let s:term_base00   =   s:term_base0
+    let s:term_base0    =   s:term_temp00
+    let s:term_base1    =   s:term_temp01
+    let s:term_base2    =   s:term_temp02
+    let s:term_base3    =   s:term_temp03
+    if (s:term_back != "NONE")
+        let s:term_back =   s:term_base03
+    endif
+endif
+"}}}
+
+" Optional contrast schemes "{{{
+" ---------------------------------------------------------------------
+if g:neosolarized_contrast == "high"
+    let s:gui_base01      = s:gui_base00
+    let s:gui_base00      = s:gui_base0
+    let s:gui_base0       = s:gui_base1
+    let s:gui_base1       = s:gui_base2
+    let s:gui_base2       = s:gui_base3
+    let s:gui_back        = s:gui_back
+
+    let s:term_base01      = s:term_base00
+    let s:term_base00      = s:term_base0
+    let s:term_base0       = s:term_base1
+    let s:term_base1       = s:term_base2
+    let s:term_base2       = s:term_base3
+    let s:term_back        = s:term_back
+endif
+if g:neosolarized_contrast == "low"
+    let s:gui_back        = s:gui_base02
+    let s:term_back        = s:term_base02
+    let s:ou          = ",underline"
+endif
+"}}}
+
+" Overrides dependent on user specified values and environment "{{{
+" ---------------------------------------------------------------------
+if (g:neosolarized_bold == 0 || &t_Co == 8 )
+    let s:b           = ""
+    let s:bb          = ",bold"
+else
+    let s:b           = ",bold"
+    let s:bb          = ""
+endif
+
+if g:neosolarized_underline == 0
+    let s:u           = ""
+else
+    let s:u           = ",underline"
+endif
+
+if g:neosolarized_italic == 0
+    let s:i           = ""
+else
+    let s:i           = ",italic"
+endif
+"}}}
+
+" Highlighting primitives"{{{
+" ---------------------------------------------------------------------
+
+exe "let s:bg_none      = ' "   .   "guibg=".s:gui_none     .   " ctermbg=".s:term_none      .   "'"
+exe "let s:bg_back      = ' "   .   "guibg=".s:gui_back     .   " ctermbg=".s:term_back      .   "'"
+exe "let s:bg_base03    = ' "   .   "guibg=".s:gui_base03   .   " ctermbg=".s:term_base03    .   "'"
+exe "let s:bg_base02    = ' "   .   "guibg=".s:gui_base02   .   " ctermbg=".s:term_base02    .   "'"
+exe "let s:bg_base01    = ' "   .   "guibg=".s:gui_base01   .   " ctermbg=".s:term_base01    .   "'"
+exe "let s:bg_base00    = ' "   .   "guibg=".s:gui_base00   .   " ctermbg=".s:term_base00    .   "'"
+exe "let s:bg_base0     = ' "   .   "guibg=".s:gui_base0    .   " ctermbg=".s:term_base0     .   "'"
+exe "let s:bg_base1     = ' "   .   "guibg=".s:gui_base1    .   " ctermbg=".s:term_base1     .   "'"
+exe "let s:bg_base2     = ' "   .   "guibg=".s:gui_base2    .   " ctermbg=".s:term_base2     .   "'"
+exe "let s:bg_base3     = ' "   .   "guibg=".s:gui_base3    .   " ctermbg=".s:term_base3     .   "'"
+exe "let s:bg_green     = ' "   .   "guibg=".s:gui_green    .   " ctermbg=".s:term_green     .   "'"
+exe "let s:bg_yellow    = ' "   .   "guibg=".s:gui_yellow   .   " ctermbg=".s:term_yellow    .   "'"
+exe "let s:bg_orange    = ' "   .   "guibg=".s:gui_orange   .   " ctermbg=".s:term_orange    .   "'"
+exe "let s:bg_red       = ' "   .   "guibg=".s:gui_red      .   " ctermbg=".s:term_red       .   "'"
+exe "let s:bg_magenta   = ' "   .   "guibg=".s:gui_magenta  .   " ctermbg=".s:term_magenta   .   "'"
+exe "let s:bg_violet    = ' "   .   "guibg=".s:gui_violet   .   " ctermbg=".s:term_violet    .   "'"
+exe "let s:bg_blue      = ' "   .   "guibg=".s:gui_blue     .   " ctermbg=".s:term_blue      .   "'"
+exe "let s:bg_cyan      = ' "   .   "guibg=".s:gui_cyan     .   " ctermbg=".s:term_cyan      .   "'"
+
+exe "let s:fg_none      = ' "   .   "guifg=".s:gui_none     .   " ctermfg=".s:term_none      .   "'"
+exe "let s:fg_back      = ' "   .   "guifg=".s:gui_back     .   " ctermfg=".s:term_back      .   "'"
+exe "let s:fg_base03    = ' "   .   "guifg=".s:gui_base03   .   " ctermfg=".s:term_base03    .   "'"
+exe "let s:fg_base02    = ' "   .   "guifg=".s:gui_base02   .   " ctermfg=".s:term_base02    .   "'"
+exe "let s:fg_base01    = ' "   .   "guifg=".s:gui_base01   .   " ctermfg=".s:term_base01    .   "'"
+exe "let s:fg_base00    = ' "   .   "guifg=".s:gui_base00   .   " ctermfg=".s:term_base00    .   "'"
+exe "let s:fg_base0     = ' "   .   "guifg=".s:gui_base0    .   " ctermfg=".s:term_base0     .   "'"
+exe "let s:fg_base1     = ' "   .   "guifg=".s:gui_base1    .   " ctermfg=".s:term_base1     .   "'"
+exe "let s:fg_base2     = ' "   .   "guifg=".s:gui_base2    .   " ctermfg=".s:term_base2     .   "'"
+exe "let s:fg_base3     = ' "   .   "guifg=".s:gui_base3    .   " ctermfg=".s:term_base3     .   "'"
+exe "let s:fg_green     = ' "   .   "guifg=".s:gui_green    .   " ctermfg=".s:term_green     .   "'"
+exe "let s:fg_yellow    = ' "   .   "guifg=".s:gui_yellow   .   " ctermfg=".s:term_yellow    .   "'"
+exe "let s:fg_orange    = ' "   .   "guifg=".s:gui_orange   .   " ctermfg=".s:term_orange    .   "'"
+exe "let s:fg_red       = ' "   .   "guifg=".s:gui_red      .   " ctermfg=".s:term_red       .   "'"
+exe "let s:fg_magenta   = ' "   .   "guifg=".s:gui_magenta  .   " ctermfg=".s:term_magenta   .   "'"
+exe "let s:fg_violet    = ' "   .   "guifg=".s:gui_violet   .   " ctermfg=".s:term_violet    .   "'"
+exe "let s:fg_blue      = ' "   .   "guifg=".s:gui_blue     .   " ctermfg=".s:term_blue      .   "'"
+exe "let s:fg_cyan      = ' "   .   "guifg=".s:gui_cyan     .   " ctermfg=".s:term_cyan      .   "'"
+
+exe "let s:fmt_none     = ' "   .   "gui=NONE"          .   " cterm=NONE"           .   "'"
+exe "let s:fmt_bold     = ' "   .   "gui=NONE".s:b      .   " cterm=NONE".s:b       .   "'"
+exe "let s:fmt_bldi     = ' "   .   "gui=NONE".s:b      .   " cterm=NONE".s:b       .   "'"
+exe "let s:fmt_undr     = ' "   .   "gui=NONE".s:u      .   " cterm=NONE".s:u       .   "'"
+exe "let s:fmt_undb     = ' "   .   "gui=NONE".s:u.s:b  .   " cterm=NONE".s:u.s:b   .   "'"
+exe "let s:fmt_undi     = ' "   .   "gui=NONE".s:u      .   " cterm=NONE".s:u       .   "'"
+exe "let s:fmt_uopt     = ' "   .   "gui=NONE".s:ou     .   " cterm=NONE".s:ou      .   "'"
+exe "let s:fmt_curl     = ' "   .   "gui=NONE".s:c      .   " cterm=NONE".s:c       .   "'"
+exe "let s:fmt_ital     = ' "   .   "gui=NONE".s:i      .   " cterm=NONE".s:i       .   "'"
+exe "let s:fmt_stnd     = ' "   .   "gui=NONE".s:s      .   " cterm=NONE".s:s       .   "'"
+exe "let s:fmt_revr     = ' "   .   "gui=NONE".s:r      .   " cterm=NONE".s:r       .   "'"
+exe "let s:fmt_revb     = ' "   .   "gui=NONE".s:r.s:b  .   " cterm=NONE".s:r.s:b   .   "'"
+" revbb (reverse bold for bright colors) is only set to actual bold in low
+" color terminals (t_co=8, such as OS X Terminal.app) and should only be used
+" with colors 8-15.
+exe "let s:fmt_revbb    = ' "   .   "gui=NONE".s:r.s:bb     .   " cterm=NONE".s:r.s:bb      .   "'"
+exe "let s:fmt_revbbu   = ' "   .   "gui=NONE".s:r.s:bb.s:u .   " cterm=NONE".s:r.s:bb.s:u  .   "'"
+
+if has("gui_running") || has("termguicolors") && &termguicolors
+    exe "let s:sp_none      = ' guisp="     .       s:gui_none      .   "'"
+    exe "let s:sp_back      = ' guisp="     .       s:gui_back      .   "'"
+    exe "let s:sp_base03    = ' guisp="     .       s:gui_base03    .   "'"
+    exe "let s:sp_base02    = ' guisp="     .       s:gui_base02    .   "'"
+    exe "let s:sp_base01    = ' guisp="     .       s:gui_base01    .   "'"
+    exe "let s:sp_base00    = ' guisp="     .       s:gui_base00    .   "'"
+    exe "let s:sp_base0     = ' guisp="     .       s:gui_base0     .   "'"
+    exe "let s:sp_base1     = ' guisp="     .       s:gui_base1     .   "'"
+    exe "let s:sp_base2     = ' guisp="     .       s:gui_base2     .   "'"
+    exe "let s:sp_base3     = ' guisp="     .       s:gui_base3     .   "'"
+    exe "let s:sp_green     = ' guisp="     .       s:gui_green     .   "'"
+    exe "let s:sp_yellow    = ' guisp="     .       s:gui_yellow    .   "'"
+    exe "let s:sp_orange    = ' guisp="     .       s:gui_orange    .   "'"
+    exe "let s:sp_red       = ' guisp="     .       s:gui_red       .   "'"
+    exe "let s:sp_magenta   = ' guisp="     .       s:gui_magenta   .   "'"
+    exe "let s:sp_violet    = ' guisp="     .       s:gui_violet    .   "'"
+    exe "let s:sp_blue      = ' guisp="     .       s:gui_blue      .   "'"
+    exe "let s:sp_cyan      = ' guisp="     .       s:gui_cyan      .   "'"
+else
+    let s:sp_none           =   ""
+    let s:sp_back           =   ""
+    let s:sp_base03         =   ""
+    let s:sp_base02         =   ""
+    let s:sp_base01         =   ""
+    let s:sp_base00         =   ""
+    let s:sp_base0          =   ""
+    let s:sp_base1          =   ""
+    let s:sp_base2          =   ""
+    let s:sp_base3          =   ""
+    let s:sp_green          =   ""
+    let s:sp_yellow         =   ""
+    let s:sp_orange         =   ""
+    let s:sp_red            =   ""
+    let s:sp_magenta        =   ""
+    let s:sp_violet         =   ""
+    let s:sp_blue           =   ""
+    let s:sp_cyan           =   ""
+endif
+
+"}}}
+
+" Basic highlighting"{{{
+" ---------------------------------------------------------------------
+" note that link syntax to avoid duplicate configuration doesn't work with the
+" exe compiled formats
+
+exe "hi! Normal"         .s:fmt_none   .s:fg_base0  .s:bg_back
+
+exe "hi! Comment"        .s:fmt_ital   .s:fg_blue .s:bg_none
+"       *Comment         any comment
+
+exe "hi! Constant"       .s:fmt_none   .s:fg_cyan   .s:bg_none
+"       *Constant        any constant
+"        String          a string constant: "this is a string"
+"        Character       a character constant: 'c', '\n'
+"        Number          a number constant: 234, 0xff
+"        Boolean         a boolean constant: TRUE, false
+"        Float           a floating point constant: 2.3e10
+
+exe "hi! Identifier"     .s:fmt_none   .s:fg_blue   .s:bg_none
+"       *Identifier      any variable name
+"        Function        function name (also: methods for classes)
+"
+exe "hi! Statement"      .s:fmt_none   .s:fg_green  .s:bg_none
+"       *Statement       any statement
+"        Conditional     if, then, else, endif, switch, etc.
+"        Repeat          for, do, while, etc.
+"        Label           case, default, etc.
+"        Operator        "sizeof", "+", "*", etc.
+"        Keyword         any other keyword
+"        Exception       try, catch, throw
+
+exe "hi! PreProc"        .s:fmt_none   .s:fg_orange .s:bg_none
+"       *PreProc         generic Preprocessor
+"        Include         preprocessor #include
+"        Define          preprocessor #define
+"        Macro           same as Define
+"        PreCondit       preprocessor #if, #else, #endif, etc.
+
+exe "hi! Type"           .s:fmt_none   .s:fg_yellow .s:bg_none
+"       *Type            int, long, char, etc.
+"        StorageClass    static, register, volatile, etc.
+"        Structure       struct, union, enum, etc.
+"        Typedef         A typedef
+
+exe "hi! Special"        .s:fmt_none   .s:fg_red    .s:bg_none
+"       *Special         any special symbol
+"        SpecialChar     special character in a constant
+"        Tag             you can use CTRL-] on this
+"        Delimiter       character that needs attention
+"        SpecialComment  special things inside a comment
+"        Debug           debugging statements
+
+exe "hi! Underlined"     .s:fmt_none   .s:fg_violet .s:bg_none
+"       *Underlined      text that stands out, HTML links
+
+exe "hi! Ignore"         .s:fmt_none   .s:fg_none   .s:bg_none
+"       *Ignore          left blank, hidden  |hl-Ignore|
+
+exe "hi! Error"          .s:fmt_bold   .s:fg_red    .s:bg_none
+"       *Error           any erroneous construct
+
+exe "hi! Todo"           .s:fmt_bold   .s:fg_magenta.s:bg_none
+"       *Todo            anything that needs extra attention; mostly the
+"                        keywords TODO FIXME and XXX
+"
+"}}}
+
+" Extended highlighting "{{{
+" ---------------------------------------------------------------------
+if  (g:neosolarized_visibility=="high")
+    exe "hi! SpecialKey" .s:fmt_revr   .s:fg_red    .s:bg_none
+    exe "hi! NonText"    .s:fmt_bold   .s:fg_red    .s:bg_none
+elseif  (g:neosolarized_visibility=="low")
+    exe "hi! SpecialKey" .s:fmt_bold   .s:fg_base02 .s:bg_none
+    exe "hi! NonText"    .s:fmt_bold   .s:fg_base02 .s:bg_none
+else
+    exe "hi! SpecialKey" .s:fmt_bold   .s:fg_base00 .s:bg_base02
+    exe "hi! NonText"    .s:fmt_bold   .s:fg_base00 .s:bg_none
+endif
+exe "hi! StatusLine"     .s:fmt_none   .s:fg_base1  .s:bg_base02 .s:fmt_revbb
+exe "hi! StatusLineNC"   .s:fmt_none   .s:fg_base00 .s:bg_base02 .s:fmt_revbb
+exe "hi! Visual"         .s:fmt_none   .s:fg_base01 .s:bg_base03 .s:fmt_revbb
+exe "hi! Directory"      .s:fmt_none   .s:fg_blue   .s:bg_none
+exe "hi! ErrorMsg"       .s:fmt_revr   .s:fg_red    .s:bg_none
+exe "hi! IncSearch"      .s:fmt_stnd   .s:fg_orange .s:bg_none
+exe "hi! Search"         .s:fmt_revr   .s:fg_yellow .s:bg_none
+exe "hi! MoreMsg"        .s:fmt_none   .s:fg_blue   .s:bg_none
+exe "hi! ModeMsg"        .s:fmt_none   .s:fg_blue   .s:bg_none
+exe "hi! LineNr"         .s:fmt_none   .s:fg_base01 .s:bg_base02
+exe "hi! Question"       .s:fmt_bold   .s:fg_cyan   .s:bg_none
+if (g:neosolarized_vertSplitBgTrans == 1)
+    exe "hi! VertSplit"  .s:fmt_none   .s:fg_base00 .s:bg_none
+else
+    exe "hi! VertSplit"  .s:fmt_none   .s:fg_base00 .s:bg_base00
+endif
+exe "hi! Title"          .s:fmt_bold   .s:fg_orange .s:bg_none
+exe "hi! VisualNOS"      .s:fmt_stnd   .s:fg_none   .s:bg_base02 .s:fmt_revbb
+exe "hi! WarningMsg"     .s:fmt_bold   .s:fg_red    .s:bg_none
+exe "hi! WildMenu"       .s:fmt_none   .s:fg_base2  .s:bg_base02 .s:fmt_revbb
+exe "hi! Folded"         .s:fmt_bold   .s:fg_base0  .s:bg_base02  .s:sp_base03
+exe "hi! FoldColumn"     .s:fmt_none   .s:fg_base0  .s:bg_base02
+
+if (g:neosolarized_diffmode=="high")
+    exe "hi! DiffAdd"        .s:fmt_revr   .s:fg_green  .s:bg_none
+    exe "hi! DiffChange"     .s:fmt_revr   .s:fg_yellow .s:bg_none
+    exe "hi! DiffDelete"     .s:fmt_revr   .s:fg_red    .s:bg_none
+    exe "hi! DiffText"       .s:fmt_revr   .s:fg_blue   .s:bg_none
+elseif  (g:neosolarized_diffmode=="low")
+    exe "hi! DiffAdd"        .s:fmt_undr   .s:fg_green  .s:bg_none   .s:sp_green
+    exe "hi! DiffChange"     .s:fmt_undr   .s:fg_yellow .s:bg_none   .s:sp_yellow
+    exe "hi! DiffDelete"     .s:fmt_bold   .s:fg_red    .s:bg_none
+    exe "hi! DiffText"       .s:fmt_undr   .s:fg_blue   .s:bg_none   .s:sp_blue
+else " normal
+    exe "hi! DiffAdd"        .s:fmt_bold   .s:fg_green  .s:bg_base02 .s:sp_green
+    exe "hi! DiffChange"     .s:fmt_bold   .s:fg_yellow .s:bg_base02 .s:sp_yellow
+    exe "hi! DiffDelete"     .s:fmt_bold   .s:fg_red    .s:bg_base02
+    exe "hi! DiffText"       .s:fmt_bold   .s:fg_blue   .s:bg_base02 .s:sp_blue
+endif
+
+exe "hi! SignColumn"     .s:fmt_none   .s:fg_base0  .s:bg_none
+exe "hi! Conceal"        .s:fmt_none   .s:fg_blue   .s:bg_none
+exe "hi! SpellBad"       .s:fmt_curl   .s:fg_none   .s:bg_none    .s:sp_red
+exe "hi! SpellCap"       .s:fmt_curl   .s:fg_none   .s:bg_none    .s:sp_violet
+exe "hi! SpellRare"      .s:fmt_curl   .s:fg_none   .s:bg_none    .s:sp_cyan
+exe "hi! SpellLocal"     .s:fmt_curl   .s:fg_none   .s:bg_none    .s:sp_yellow
+exe "hi! Pmenu"          .s:fmt_none   .s:fg_base0  .s:bg_base02  .s:fmt_revbb
+exe "hi! PmenuSel"       .s:fmt_none   .s:fg_base01 .s:bg_base2   .s:fmt_revbb
+exe "hi! PmenuSbar"      .s:fmt_none   .s:fg_base2  .s:bg_base0   .s:fmt_revbb
+exe "hi! PmenuThumb"     .s:fmt_none   .s:fg_base0  .s:bg_base03  .s:fmt_revbb
+exe "hi! TabLine"        .s:fmt_none   .s:fg_base0  .s:bg_base02  .s:sp_base0
+exe "hi! TabLineFill"    .s:fmt_none   .s:fg_base0  .s:bg_base02  .s:sp_base0
+exe "hi! TabLineSel"     .s:fmt_none   .s:fg_base01  .s:bg_base2  .s:sp_base0  .s:fmt_revr
+exe "hi! CursorColumn"   .s:fmt_none   .s:fg_none   .s:bg_base02
+exe "hi! CursorLine"     .s:fmt_uopt   .s:fg_none   .s:bg_base02  .s:sp_base1
+exe "hi! CursorLineNr"   .s:fmt_uopt   .s:fg_none   .s:bg_base02  .s:sp_base1
+exe "hi! ColorColumn"    .s:fmt_none   .s:fg_none   .s:bg_base02
+exe "hi! Cursor"         .s:fmt_none   .s:fg_base03 .s:bg_base0
+hi! link lCursor Cursor
+exe "hi! MatchParen"     .s:fmt_bold   .s:fg_red    .s:bg_base01
+
+"}}}
+
+" vim syntax highlighting "{{{
+" ---------------------------------------------------------------------
+"exe "hi! vimLineComment" . s:fg_base01 .s:bg_none   .s:fmt_ital
+"hi! link vimComment Comment
+"hi! link vimLineComment Comment
+hi! link vimVar Identifier
+hi! link vimFunc Function
+hi! link vimUserFunc Function
+hi! link helpSpecial Special
+hi! link vimSet Normal
+hi! link vimSetEqual Normal
+exe "hi! vimCommentString"  .s:fmt_none    .s:fg_violet .s:bg_none
+exe "hi! vimCommand"        .s:fmt_none    .s:fg_yellow .s:bg_none
+exe "hi! vimCmdSep"         .s:fmt_bold    .s:fg_blue   .s:bg_none
+exe "hi! helpExample"       .s:fmt_none    .s:fg_base1  .s:bg_none
+exe "hi! helpOption"        .s:fmt_none    .s:fg_cyan   .s:bg_none
+exe "hi! helpNote"          .s:fmt_none    .s:fg_magenta.s:bg_none
+exe "hi! helpVim"           .s:fmt_none    .s:fg_magenta.s:bg_none
+exe "hi! helpHyperTextJump" .s:fmt_undr    .s:fg_blue   .s:bg_none
+exe "hi! helpHyperTextEntry".s:fmt_none    .s:fg_green  .s:bg_none
+exe "hi! vimIsCommand"      .s:fmt_none    .s:fg_base00 .s:bg_none
+exe "hi! vimSynMtchOpt"     .s:fmt_none    .s:fg_yellow .s:bg_none
+exe "hi! vimSynType"        .s:fmt_none    .s:fg_cyan   .s:bg_none
+exe "hi! vimHiLink"         .s:fmt_none    .s:fg_blue   .s:bg_none
+exe "hi! vimHiGroup"        .s:fmt_none    .s:fg_blue   .s:bg_none
+exe "hi! vimGroup"          .s:fmt_undb    .s:fg_blue   .s:bg_none
+"}}}
+
+" diff highlighting "{{{
+" ---------------------------------------------------------------------
+hi! link diffAdded Statement
+hi! link diffLine Identifier
+"}}}
+
+" git & gitcommit highlighting "{{{
+"git
+"exe "hi! gitDateHeader"
+"exe "hi! gitIdentityHeader"
+"exe "hi! gitIdentityKeyword"
+"exe "hi! gitNotesHeader"
+"exe "hi! gitReflogHeader"
+"exe "hi! gitKeyword"
+"exe "hi! gitIdentity"
+"exe "hi! gitEmailDelimiter"
+"exe "hi! gitEmail"
+"exe "hi! gitDate"
+"exe "hi! gitMode"
+"exe "hi! gitHashAbbrev"
+"exe "hi! gitHash"
+"exe "hi! gitReflogMiddle"
+"exe "hi! gitReference"
+"exe "hi! gitStage"
+"exe "hi! gitType"
+"exe "hi! gitDiffAdded"
+"exe "hi! gitDiffRemoved"
+"gitcommit
+"exe "hi! gitcommitSummary"
+exe "hi! gitcommitComment"      .s:fmt_ital     .s:fg_base01    .s:bg_none
+hi! link gitcommitUntracked gitcommitComment
+hi! link gitcommitDiscarded gitcommitComment
+hi! link gitcommitSelected  gitcommitComment
+exe "hi! gitcommitUnmerged"     .s:fmt_bold     .s:fg_green     .s:bg_none
+exe "hi! gitcommitOnBranch"     .s:fmt_bold     .s:fg_base01    .s:bg_none
+exe "hi! gitcommitBranch"       .s:fmt_bold     .s:fg_magenta   .s:bg_none
+hi! link gitcommitNoBranch gitcommitBranch
+exe "hi! gitcommitDiscardedType".s:fmt_none     .s:fg_red       .s:bg_none
+exe "hi! gitcommitSelectedType" .s:fmt_none     .s:fg_green     .s:bg_none
+"exe "hi! gitcommitUnmergedType"
+"exe "hi! gitcommitType"
+"exe "hi! gitcommitNoChanges"
+"exe "hi! gitcommitHeader"
+exe "hi! gitcommitHeader"       .s:fmt_none     .s:fg_base01    .s:bg_none
+exe "hi! gitcommitUntrackedFile".s:fmt_bold     .s:fg_cyan      .s:bg_none
+exe "hi! gitcommitDiscardedFile".s:fmt_bold     .s:fg_red       .s:bg_none
+exe "hi! gitcommitSelectedFile" .s:fmt_bold     .s:fg_green     .s:bg_none
+exe "hi! gitcommitUnmergedFile" .s:fmt_bold     .s:fg_yellow    .s:bg_none
+exe "hi! gitcommitFile"         .s:fmt_bold     .s:fg_base0     .s:bg_none
+hi! link gitcommitDiscardedArrow gitcommitDiscardedFile
+hi! link gitcommitSelectedArrow  gitcommitSelectedFile
+hi! link gitcommitUnmergedArrow  gitcommitUnmergedFile
+"exe "hi! gitcommitArrow"
+"exe "hi! gitcommitOverflow"
+"exe "hi! gitcommitBlank"
+" }}}
+"
+" html highlighting "{{{
+" ---------------------------------------------------------------------
+exe "hi! htmlTag"           .s:fmt_none .s:fg_base01 .s:bg_none
+exe "hi! htmlEndTag"        .s:fmt_none .s:fg_base01 .s:bg_none
+exe "hi! htmlTagN"          .s:fmt_bold .s:fg_base1  .s:bg_none
+exe "hi! htmlTagName"       .s:fmt_bold .s:fg_blue   .s:bg_none
+exe "hi! htmlSpecialTagName".s:fmt_ital .s:fg_blue   .s:bg_none
+exe "hi! htmlArg"           .s:fmt_none .s:fg_base00 .s:bg_none
+exe "hi! javaScript"        .s:fmt_none .s:fg_yellow .s:bg_none
+"}}}
+
+" perl highlighting "{{{
+" ---------------------------------------------------------------------
+exe "hi! perlHereDoc"    . s:fg_base1  .s:bg_back   .s:fmt_none
+exe "hi! perlVarPlain"   . s:fg_yellow .s:bg_back   .s:fmt_none
+exe "hi! perlStatementFileDesc". s:fg_cyan.s:bg_back.s:fmt_none
+
+"}}}
+
+" tex highlighting "{{{
+" ---------------------------------------------------------------------
+exe "hi! texStatement"   . s:fg_cyan   .s:bg_back   .s:fmt_none
+exe "hi! texMathZoneX"   . s:fg_yellow .s:bg_back   .s:fmt_none
+exe "hi! texMathMatcher" . s:fg_yellow .s:bg_back   .s:fmt_none
+exe "hi! texMathMatcher" . s:fg_yellow .s:bg_back   .s:fmt_none
+exe "hi! texRefLabel"    . s:fg_yellow .s:bg_back   .s:fmt_none
+"}}}
+
+" ruby highlighting "{{{
+" ---------------------------------------------------------------------
+exe "hi! rubyDefine"     . s:fg_base1  .s:bg_back   .s:fmt_bold
+"rubyInclude
+"rubySharpBang
+"rubyAccess
+"rubyPredefinedVariable
+"rubyBoolean
+"rubyClassVariable
+"rubyBeginEnd
+"rubyRepeatModifier
+"hi! link rubyArrayDelimiter    Special  " [ , , ]
+"rubyCurlyBlock  { , , }
+
+"hi! link rubyClass             Keyword
+"hi! link rubyModule            Keyword
+"hi! link rubyKeyword           Keyword
+"hi! link rubyOperator          Operator
+"hi! link rubyIdentifier        Identifier
+"hi! link rubyInstanceVariable  Identifier
+"hi! link rubyGlobalVariable    Identifier
+"hi! link rubyClassVariable     Identifier
+"hi! link rubyConstant          Type
+"}}}
+
+" haskell syntax highlighting"{{{
+" ---------------------------------------------------------------------
+" For use with syntax/haskell.vim : Haskell Syntax File
+" http://www.vim.org/scripts/script.php?script_id=3034
+" See also Steffen Siering's github repository:
+" http://github.com/urso/dotrc/blob/master/vim/syntax/haskell.vim
+" ---------------------------------------------------------------------
+"
+" Treat True and False specially, see the plugin referenced above
+let hs_highlight_boolean=1
+" highlight delims, see the plugin referenced above
+let hs_highlight_delimiters=1
+
+exe "hi! cPreCondit". s:fg_orange.s:bg_none   .s:fmt_none
+
+exe "hi! VarId"    . s:fg_blue   .s:bg_none   .s:fmt_none
+exe "hi! ConId"    . s:fg_yellow .s:bg_none   .s:fmt_none
+exe "hi! hsImport" . s:fg_magenta.s:bg_none   .s:fmt_none
+exe "hi! hsString" . s:fg_base00 .s:bg_none   .s:fmt_none
+
+exe "hi! hsStructure"        . s:fg_cyan   .s:bg_none   .s:fmt_none
+exe "hi! hs_hlFunctionName"  . s:fg_blue   .s:bg_none
+exe "hi! hsStatement"        . s:fg_cyan   .s:bg_none   .s:fmt_none
+exe "hi! hsImportLabel"      . s:fg_cyan   .s:bg_none   .s:fmt_none
+exe "hi! hs_OpFunctionName"  . s:fg_yellow .s:bg_none   .s:fmt_none
+exe "hi! hs_DeclareFunction" . s:fg_orange .s:bg_none   .s:fmt_none
+exe "hi! hsVarSym"           . s:fg_cyan   .s:bg_none   .s:fmt_none
+exe "hi! hsType"             . s:fg_yellow .s:bg_none   .s:fmt_none
+exe "hi! hsTypedef"          . s:fg_cyan   .s:bg_none   .s:fmt_none
+exe "hi! hsModuleName"       . s:fg_green  .s:bg_none   .s:fmt_undr
+exe "hi! hsModuleStartLabel" . s:fg_magenta.s:bg_none   .s:fmt_none
+hi! link hsImportParams      Delimiter
+hi! link hsDelimTypeExport   Delimiter
+hi! link hsModuleStartLabel  hsStructure
+hi! link hsModuleWhereLabel  hsModuleStartLabel
+
+" following is for the haskell-conceal plugin
+" the first two items don't have an impact, but better safe
+exe "hi! hsNiceOperator"     . s:fg_cyan   .s:bg_none   .s:fmt_none
+exe "hi! hsniceoperator"     . s:fg_cyan   .s:bg_none   .s:fmt_none
+
+"}}}
+
+" pandoc markdown syntax highlighting "{{{
+" ---------------------------------------------------------------------
+
+"PandocHiLink pandocNormalBlock
+exe "hi! pandocTitleBlock"               .s:fg_blue   .s:bg_none   .s:fmt_none
+exe "hi! pandocTitleBlockTitle"          .s:fg_blue   .s:bg_none   .s:fmt_bold
+exe "hi! pandocTitleComment"             .s:fg_blue   .s:bg_none   .s:fmt_bold
+exe "hi! pandocComment"                  .s:fg_base01 .s:bg_none   .s:fmt_ital
+exe "hi! pandocVerbatimBlock"            .s:fg_yellow .s:bg_none   .s:fmt_none
+hi! link pandocVerbatimBlockDeep         pandocVerbatimBlock
+hi! link pandocCodeBlock                 pandocVerbatimBlock
+hi! link pandocCodeBlockDelim            pandocVerbatimBlock
+exe "hi! pandocBlockQuote"               .s:fg_blue   .s:bg_none   .s:fmt_none
+exe "hi! pandocBlockQuoteLeader1"        .s:fg_blue   .s:bg_none   .s:fmt_none
+exe "hi! pandocBlockQuoteLeader2"        .s:fg_cyan   .s:bg_none   .s:fmt_none
+exe "hi! pandocBlockQuoteLeader3"        .s:fg_yellow .s:bg_none   .s:fmt_none
+exe "hi! pandocBlockQuoteLeader4"        .s:fg_red    .s:bg_none   .s:fmt_none
+exe "hi! pandocBlockQuoteLeader5"        .s:fg_base0  .s:bg_none   .s:fmt_none
+exe "hi! pandocBlockQuoteLeader6"        .s:fg_base01 .s:bg_none   .s:fmt_none
+exe "hi! pandocListMarker"               .s:fg_magenta.s:bg_none   .s:fmt_none
+exe "hi! pandocListReference"            .s:fg_magenta.s:bg_none   .s:fmt_undr
+
+" Definitions
+" ---------------------------------------------------------------------
+let s:fg_pdef = s:fg_violet
+exe "hi! pandocDefinitionBlock"              .s:fg_pdef  .s:bg_none  .s:fmt_none
+exe "hi! pandocDefinitionTerm"               .s:fg_pdef  .s:bg_none  .s:fmt_stnd
+exe "hi! pandocDefinitionIndctr"             .s:fg_pdef  .s:bg_none  .s:fmt_bold
+exe "hi! pandocEmphasisDefinition"           .s:fg_pdef  .s:bg_none  .s:fmt_ital
+exe "hi! pandocEmphasisNestedDefinition"     .s:fg_pdef  .s:bg_none  .s:fmt_bldi
+exe "hi! pandocStrongEmphasisDefinition"     .s:fg_pdef  .s:bg_none  .s:fmt_bold
+exe "hi! pandocStrongEmphasisNestedDefinition"   .s:fg_pdef.s:bg_none.s:fmt_bldi
+exe "hi! pandocStrongEmphasisEmphasisDefinition" .s:fg_pdef.s:bg_none.s:fmt_bldi
+exe "hi! pandocStrikeoutDefinition"          .s:fg_pdef  .s:bg_none  .s:fmt_revr
+exe "hi! pandocVerbatimInlineDefinition"     .s:fg_pdef  .s:bg_none  .s:fmt_none
+exe "hi! pandocSuperscriptDefinition"        .s:fg_pdef  .s:bg_none  .s:fmt_none
+exe "hi! pandocSubscriptDefinition"          .s:fg_pdef  .s:bg_none  .s:fmt_none
+
+" Tables
+" ---------------------------------------------------------------------
+let s:fg_ptable = s:fg_blue
+exe "hi! pandocTable"                        .s:fg_ptable.s:bg_none  .s:fmt_none
+exe "hi! pandocTableStructure"               .s:fg_ptable.s:bg_none  .s:fmt_none
+hi! link pandocTableStructureTop             pandocTableStructre
+hi! link pandocTableStructureEnd             pandocTableStructre
+exe "hi! pandocTableZebraLight"              .s:fg_ptable.s:bg_base03.s:fmt_none
+exe "hi! pandocTableZebraDark"               .s:fg_ptable.s:bg_base02.s:fmt_none
+exe "hi! pandocEmphasisTable"                .s:fg_ptable.s:bg_none  .s:fmt_ital
+exe "hi! pandocEmphasisNestedTable"          .s:fg_ptable.s:bg_none  .s:fmt_bldi
+exe "hi! pandocStrongEmphasisTable"          .s:fg_ptable.s:bg_none  .s:fmt_bold
+exe "hi! pandocStrongEmphasisNestedTable"    .s:fg_ptable.s:bg_none  .s:fmt_bldi
+exe "hi! pandocStrongEmphasisEmphasisTable"  .s:fg_ptable.s:bg_none  .s:fmt_bldi
+exe "hi! pandocStrikeoutTable"               .s:fg_ptable.s:bg_none  .s:fmt_revr
+exe "hi! pandocVerbatimInlineTable"          .s:fg_ptable.s:bg_none  .s:fmt_none
+exe "hi! pandocSuperscriptTable"             .s:fg_ptable.s:bg_none  .s:fmt_none
+exe "hi! pandocSubscriptTable"               .s:fg_ptable.s:bg_none  .s:fmt_none
+
+" Headings
+" ---------------------------------------------------------------------
+let s:fg_phead = s:fg_orange
+exe "hi! pandocHeading"                      .s:fg_phead .s:bg_none.s:fmt_bold
+exe "hi! pandocHeadingMarker"                .s:fg_yellow.s:bg_none.s:fmt_bold
+exe "hi! pandocEmphasisHeading"              .s:fg_phead .s:bg_none.s:fmt_bldi
+exe "hi! pandocEmphasisNestedHeading"        .s:fg_phead .s:bg_none.s:fmt_bldi
+exe "hi! pandocStrongEmphasisHeading"        .s:fg_phead .s:bg_none.s:fmt_bold
+exe "hi! pandocStrongEmphasisNestedHeading"  .s:fg_phead .s:bg_none.s:fmt_bldi
+exe "hi! pandocStrongEmphasisEmphasisHeading".s:fg_phead .s:bg_none.s:fmt_bldi
+exe "hi! pandocStrikeoutHeading"             .s:fg_phead .s:bg_none.s:fmt_revr
+exe "hi! pandocVerbatimInlineHeading"        .s:fg_phead .s:bg_none.s:fmt_bold
+exe "hi! pandocSuperscriptHeading"           .s:fg_phead .s:bg_none.s:fmt_bold
+exe "hi! pandocSubscriptHeading"             .s:fg_phead .s:bg_none.s:fmt_bold
+
+" Links
+" ---------------------------------------------------------------------
+exe "hi! pandocLinkDelim"                .s:fg_base01 .s:bg_none   .s:fmt_none
+exe "hi! pandocLinkLabel"                .s:fg_blue   .s:bg_none   .s:fmt_undr
+exe "hi! pandocLinkText"                 .s:fg_blue   .s:bg_none   .s:fmt_undb
+exe "hi! pandocLinkURL"                  .s:fg_base00 .s:bg_none   .s:fmt_undr
+exe "hi! pandocLinkTitle"                .s:fg_base00 .s:bg_none   .s:fmt_undi
+exe "hi! pandocLinkTitleDelim"           .s:fg_base01 .s:bg_none   .s:fmt_undi   .s:sp_base00
+exe "hi! pandocLinkDefinition"           .s:fg_cyan   .s:bg_none   .s:fmt_undr   .s:sp_base00
+exe "hi! pandocLinkDefinitionID"         .s:fg_blue   .s:bg_none   .s:fmt_bold
+exe "hi! pandocImageCaption"             .s:fg_violet .s:bg_none   .s:fmt_undb
+exe "hi! pandocFootnoteLink"             .s:fg_green  .s:bg_none   .s:fmt_undr
+exe "hi! pandocFootnoteDefLink"          .s:fg_green  .s:bg_none   .s:fmt_bold
+exe "hi! pandocFootnoteInline"           .s:fg_green  .s:bg_none   .s:fmt_undb
+exe "hi! pandocFootnote"                 .s:fg_green  .s:bg_none   .s:fmt_none
+exe "hi! pandocCitationDelim"            .s:fg_magenta.s:bg_none   .s:fmt_none
+exe "hi! pandocCitation"                 .s:fg_magenta.s:bg_none   .s:fmt_none
+exe "hi! pandocCitationID"               .s:fg_magenta.s:bg_none   .s:fmt_undr
+exe "hi! pandocCitationRef"              .s:fg_magenta.s:bg_none   .s:fmt_none
+
+" Main Styles
+" ---------------------------------------------------------------------
+exe "hi! pandocStyleDelim"               .s:fg_base01 .s:bg_none  .s:fmt_none
+exe "hi! pandocEmphasis"                 .s:fg_base0  .s:bg_none  .s:fmt_ital
+exe "hi! pandocEmphasisNested"           .s:fg_base0  .s:bg_none  .s:fmt_bldi
+exe "hi! pandocStrongEmphasis"           .s:fg_base0  .s:bg_none  .s:fmt_bold
+exe "hi! pandocStrongEmphasisNested"     .s:fg_base0  .s:bg_none  .s:fmt_bldi
+exe "hi! pandocStrongEmphasisEmphasis"   .s:fg_base0  .s:bg_none  .s:fmt_bldi
+exe "hi! pandocStrikeout"                .s:fg_base01 .s:bg_none  .s:fmt_revr
+exe "hi! pandocVerbatimInline"           .s:fg_yellow .s:bg_none  .s:fmt_none
+exe "hi! pandocSuperscript"              .s:fg_violet .s:bg_none  .s:fmt_none
+exe "hi! pandocSubscript"                .s:fg_violet .s:bg_none  .s:fmt_none
+
+exe "hi! pandocRule"                     .s:fg_blue   .s:bg_none  .s:fmt_bold
+exe "hi! pandocRuleLine"                 .s:fg_blue   .s:bg_none  .s:fmt_bold
+exe "hi! pandocEscapePair"               .s:fg_red    .s:bg_none  .s:fmt_bold
+exe "hi! pandocCitationRef"              .s:fg_magenta.s:bg_none   .s:fmt_none
+exe "hi! pandocNonBreakingSpace"         . s:fg_red   .s:bg_none  .s:fmt_revr
+hi! link pandocEscapedCharacter          pandocEscapePair
+hi! link pandocLineBreak                 pandocEscapePair
+
+" Embedded Code
+" ---------------------------------------------------------------------
+exe "hi! pandocMetadataDelim"            .s:fg_base01 .s:bg_none   .s:fmt_none
+exe "hi! pandocMetadata"                 .s:fg_blue   .s:bg_none   .s:fmt_none
+exe "hi! pandocMetadataKey"              .s:fg_blue   .s:bg_none   .s:fmt_none
+exe "hi! pandocMetadata"                 .s:fg_blue   .s:bg_none   .s:fmt_bold
+hi! link pandocMetadataTitle             pandocMetadata
+
+"}}}
+
+" neomake highlighting "{{{
+" ---------------------------------------------------------------------
+exe "hi! NeomakeErrorSign"          . s:fg_orange   .s:bg_none   .s:fmt_none
+exe "hi! NeomakeWarningSign"        . s:fg_yellow   .s:bg_none   .s:fmt_none
+exe "hi! NeomakeMessageSign"        . s:fg_cyan     .s:bg_none   .s:fmt_none
+exe "hi! NeomakeNeomakeInfoSign"    . s:fg_green    .s:bg_none   .s:fmt_none
+
+"}}}
+
+" gitgutter highlighting "{{{
+" ---------------------------------------------------------------------
+exe "hi! GitGutterAdd"              . s:fg_green    .s:bg_none  .s:fmt_none
+exe "hi! GitGutterChange"           . s:fg_yellow   .s:bg_none  .s:fmt_none
+exe "hi! GitGutterDelete"           . s:fg_red      .s:bg_none  .s:fmt_none
+exe "hi! GitGutterChangeDelete"     . s:fg_red      .s:bg_none  .s:fmt_none
+" }}}"
+
+" signify highlighting "{{{
+" ---------------------------------------------------------------------
+exe "hi! SignifySignAdd"            . s:fg_green    .s:bg_none  .s:fmt_none
+exe "hi! SignifySignChange"         . s:fg_yellow   .s:bg_none  .s:fmt_none
+exe "hi! SignifySignDelete"         . s:fg_red      .s:bg_none  .s:fmt_none
+exe "hi! SignifySignChangeDelete"   . s:fg_red      .s:bg_none  .s:fmt_none
+" }}}"
+
+" ALE highlighting "{{{
+" ---------------------------------------------------------------------
+exe "hi! ALEErrorSign"          . s:fg_orange   .s:bg_none   .s:fmt_none
+exe "hi! ALEWarningSign"        . s:fg_yellow   .s:bg_none   .s:fmt_none
+" }}}"
+
+" NeoVim terminal buffer colours "{{{
+" ---------------------------------------------------------------------
+let g:terminal_color_0 = s:gui_base03
+let g:terminal_color_1 = s:gui_red
+let g:terminal_color_2 = s:gui_green
+let g:terminal_color_3 = s:gui_yellow
+let g:terminal_color_4 = s:gui_blue
+let g:terminal_color_5 = s:gui_magenta
+let g:terminal_color_6 = s:gui_cyan
+let g:terminal_color_7 = s:gui_base2
+let g:terminal_color_8 = s:gui_base02
+let g:terminal_color_9 = s:gui_orange
+let g:terminal_color_10 = s:gui_base01
+let g:terminal_color_11 = s:gui_base00
+let g:terminal_color_12 = s:gui_base0
+let g:terminal_color_13 = s:gui_violet
+let g:terminal_color_14 = s:gui_base1
+let g:terminal_color_15 = s:gui_base3
+"}}}
+
+" Utility autocommand "{{{
+" ---------------------------------------------------------------------
+" In cases where Solarized is initialized inside a terminal vim session and
+" then transferred to a gui session via the command `:gui`, the gui vim process
+" does not re-read the colorscheme (or .vimrc for that matter) so any `has_gui`
+" related code that sets gui specific values isn't executed.
+"
+" Currently, Solarized sets only the cterm or gui values for the colorscheme
+" depending on gui or terminal mode. It's possible that, if the following
+" autocommand method is deemed excessively poor form, that approach will be
+" used again and the autocommand below will be dropped.
+"
+" However it seems relatively benign in this case to include the autocommand
+" here. It fires only in cases where vim is transferring from terminal to gui
+" mode (detected with the script scope s:vmode variable). It also allows for
+" other potential terminal customizations that might make gui mode suboptimal.
+"
+autocmd GUIEnter * if (has('gui_running')) | exe "colorscheme " . g:colors_name | endif
+"}}}
+
+

+ 16 - 0
nvim/README.md

@@ -0,0 +1,16 @@
+# NeoVim
+
+#### Configuration file and colorscheme for NeoVim.
+
+* init.vim - Configuration file for NeoVim.
+* NeoSolarized - Premade Solarized theme for NeoVim with my tweaks.
+
+#### Plugins
+
+* deoplete
+* nerdtree
+* auto-pairs
+
+#### Screenshots
+
+![nvim](https://git.dankpad.xyz/Bear/Dot-Files/raw/branch/master/nvim/nvim.png)

+ 74 - 0
nvim/init.vim

@@ -0,0 +1,74 @@
+" General configuration
+
+set fcs=eob:\ 
+set number
+set nuw=5
+set nowrap
+set splitright
+set laststatus=0 ruler
+set noerrorbells
+set undofile
+set shiftwidth=4
+set undolevels=1000
+set undoreload=10000
+set termguicolors
+set background=dark
+colorscheme NeoSolarized
+
+
+" Disable arrow keys
+
+inoremap <Up> <NOP>
+inoremap <Down> <NOP>
+inoremap <Left> <NOP>
+inoremap <Right> <NOP>
+noremap <Up> <NOP>
+noremap <Down> <NOP>
+noremap <Left> <NOP>
+noremap <Right> <NOP>
+
+
+" Plugins
+
+call plug#begin('~/.local/share/nvim/plugged')
+Plug 'jiangmiao/auto-pairs'
+Plug 'scrooloose/nerdtree'
+Plug 'pangloss/vim-javascript'
+Plug 'iCyMind/NeoSolarized'
+Plug 'Shougo/deoplete.nvim', {'do': ':UpdateRemotePlugins'}
+Plug 'roxma/nvim-yarp'
+Plug 'roxma/vim-hug-neovim-rpc'
+call plug#end()
+
+
+" Editing NerdTree
+
+let g:NERDTreeDirArrowExpandable = '▸'
+let g:NERDTreeDirArrowCollapsible = '▾'
+let NERDTreeMinimalUI = 1
+hi VertSplit guifg=#333333
+map <C-n> :NERDTreeToggle<CR>
+autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
+
+
+" Starting deoplete
+
+let g:deoplete#enable_at_startup = 1
+
+
+" Launch arguements
+"
+autocmd vimenter * NERDTree | wincmd w
+
+
+" Editing cursorline
+set cul
+hi CursorLine guibg=#333333
+hi CursorLineNr guibg=#333333
+autocmd InsertEnter * hi CursorLine guibg=#333333
+autocmd InsertLeave * hi CursorLine guibg=#333333
+
+
+" Editing LineNr
+
+hi LineNr guifg=#FFFFFF

BIN
nvim/nvim.png


+ 5 - 0
polybar/README.md

@@ -0,0 +1,5 @@
+# polybar
+
+#### Configuration file for polybar.
+
+* config - Configuration file for polybar.

+ 47 - 0
polybar/config

@@ -0,0 +1,47 @@
+[bar/default]
+monitor = LVDS-1
+width = 100%
+height = 15
+
+background = #232323
+foreground = #FFFFFF
+font-0 = Misc Tamsyn:size=16
+
+modules-left = i3
+modules-right = date
+
+module-margin-left = 0
+module-margin-right = 0
+
+padding-left = 0
+padding-right = 1
+
+border-top-size = 3
+border-top-color = #232323
+
+[module/i3]
+type = internal/i3
+interval = 1.0
+index-sort = true
+wrapping-scroll = false
+
+format-background = #232323
+format-foreground = #FFFFFF
+format = <label-state> <label-mode>
+
+label-focused = %index%
+label-focused-padding = 1
+label-unfocused = %index%
+label-unfocused-padding = 1
+label-urgent = %index%
+label-urgent-padding = 1
+
+[module/date]
+type = internal/date
+interval = 1.0
+time = %H:%M
+
+format-background = #232323
+format-foreground = #FFFFFF
+
+label = %time%

BIN
polybar/polybar.png


+ 12 - 0
scripts/README.md

@@ -0,0 +1,12 @@
+# Scripts
+
+#### Miscellaneous scripts.
+
+* currentbattery.sh - Keybind to show battery information through dunst.
+* time.sh - Keybind to show time through dunst.
+
+#### Screenshots
+
+![time](https://git.dankpad.xyz/Bear/Dot-Files/raw/branch/master/scripts/time.png)
+
+![currentbattery](https://git.dankpad.xyz/Bear/Dot-Files/raw/branch/master/scripts/currentbattery.png)

BIN
scripts/currentbattery.png


+ 8 - 0
scripts/currentbattery.sh

@@ -0,0 +1,8 @@
+#! /bin/bash
+
+read -r BAT0 < /sys/class/power_supply/BAT0/capacity
+read -r BAT1 < /sys/class/power_supply/BAT1/capacity
+read -r BAT0Status < /sys/class/power_supply/BAT0/status
+read -r BAT1Status < /sys/class/power_supply/BAT1/status
+
+notify-send "Battery Information:" "\nBattery 1: $BAT0Status $BAT0%\nBattery 2: $BAT1Status $BAT1%"

BIN
scripts/time.png


+ 5 - 0
scripts/time.sh

@@ -0,0 +1,5 @@
+#! /bin/bash
+
+time=$(timedatectl | awk 'FNR==1 {print $5}')
+
+notify-send "Time:" "\n$time"

+ 57 - 0
st/Makefile

@@ -0,0 +1,57 @@
+# st - simple terminal
+# See LICENSE file for copyright and license details.
+.POSIX:
+
+include config.mk
+
+SRC = st.c x.c
+OBJ = $(SRC:.c=.o)
+
+all: options st
+
+options:
+	@echo st build options:
+	@echo "CFLAGS  = $(STCFLAGS)"
+	@echo "LDFLAGS = $(STLDFLAGS)"
+	@echo "CC      = $(CC)"
+
+config.h:
+	cp config.def.h config.h
+
+.c.o:
+	$(CC) $(STCFLAGS) -c $<
+
+st.o: config.h st.h win.h
+x.o: arg.h st.h win.h
+
+$(OBJ): config.h config.mk
+
+st: $(OBJ)
+	$(CC) -o $@ $(OBJ) $(STLDFLAGS)
+
+clean:
+	rm -f st $(OBJ) st-$(VERSION).tar.gz
+
+dist: clean
+	mkdir -p st-$(VERSION)
+	cp -R FAQ LEGACY TODO LICENSE Makefile README config.mk\
+		config.def.h st.info st.1 arg.h st.h win.h $(SRC)\
+		st-$(VERSION)
+	tar -cf - st-$(VERSION) | gzip > st-$(VERSION).tar.gz
+	rm -rf st-$(VERSION)
+
+install: st
+	mkdir -p $(DESTDIR)$(PREFIX)/bin
+	cp -f st $(DESTDIR)$(PREFIX)/bin
+	chmod 755 $(DESTDIR)$(PREFIX)/bin/st
+	mkdir -p $(DESTDIR)$(MANPREFIX)/man1
+	sed "s/VERSION/$(VERSION)/g" < st.1 > $(DESTDIR)$(MANPREFIX)/man1/st.1
+	chmod 644 $(DESTDIR)$(MANPREFIX)/man1/st.1
+	tic -sx st.info
+	@echo Please see the README file regarding the terminfo entry of st.
+
+uninstall:
+	rm -f $(DESTDIR)$(PREFIX)/bin/st
+	rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1
+
+.PHONY: all options clean dist install uninstall

+ 12 - 0
st/README.md

@@ -0,0 +1,12 @@
+# suckless terminal
+
+#### Configuration files and .diffs for suckless terminal.
+
+* config.h - Main configuration file.
+* st-clipboard-0.8.1.diff - Clipboard patch.
+* st-hidecursor-0.8.1.diff - Cursor hide patch.
+* st-scrollback-0.8.diff - Scrollback patch.
+
+#### Screenshots
+
+![st](https://git.dankpad.xyz/Bear/Dot-Files/raw/branch/master/st/st.png)

+ 50 - 0
st/arg.h

@@ -0,0 +1,50 @@
+/*
+ * Copy me if you can.
+ * by 20h
+ */
+
+#ifndef ARG_H__
+#define ARG_H__
+
+extern char *argv0;
+
+/* use main(int argc, char *argv[]) */
+#define ARGBEGIN	for (argv0 = *argv, argv++, argc--;\
+					argv[0] && argv[0][0] == '-'\
+					&& argv[0][1];\
+					argc--, argv++) {\
+				char argc_;\
+				char **argv_;\
+				int brk_;\
+				if (argv[0][1] == '-' && argv[0][2] == '\0') {\
+					argv++;\
+					argc--;\
+					break;\
+				}\
+				int i_;\
+				for (i_ = 1, brk_ = 0, argv_ = argv;\
+						argv[0][i_] && !brk_;\
+						i_++) {\
+					if (argv_ != argv)\
+						break;\
+					argc_ = argv[0][i_];\
+					switch (argc_)
+
+#define ARGEND			}\
+			}
+
+#define ARGC()		argc_
+
+#define EARGF(x)	((argv[0][i_+1] == '\0' && argv[1] == NULL)?\
+				((x), abort(), (char *)0) :\
+				(brk_ = 1, (argv[0][i_+1] != '\0')?\
+					(&argv[0][i_+1]) :\
+					(argc--, argv++, argv[0])))
+
+#define ARGF()		((argv[0][i_+1] == '\0' && argv[1] == NULL)?\
+				(char *)0 :\
+				(brk_ = 1, (argv[0][i_+1] != '\0')?\
+					(&argv[0][i_+1]) :\
+					(argc--, argv++, argv[0])))
+
+#endif

+ 464 - 0
st/config.def.h

@@ -0,0 +1,464 @@
+/* See LICENSE file for copyright and license details. */
+
+/*
+ * appearance
+ *
+ * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
+ */
+static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true";
+static int borderpx = 2;
+
+/*
+ * What program is execed by st depends of these precedence rules:
+ * 1: program passed with -e
+ * 2: utmp option
+ * 3: SHELL environment variable
+ * 4: value of shell in /etc/passwd
+ * 5: value of shell in config.h
+ */
+static char *shell = "/bin/sh";
+char *utmp = NULL;
+char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400";
+
+/* identification sequence returned in DA and DECID */
+char *vtiden = "\033[?6c";
+
+/* Kerning / character bounding-box multipliers */
+static float cwscale = 1.0;
+static float chscale = 1.0;
+
+/*
+ * word delimiter string
+ *
+ * More advanced example: " `'\"()[]{}"
+ */
+char *worddelimiters = " ";
+
+/* selection timeouts (in milliseconds) */
+static unsigned int doubleclicktimeout = 300;
+static unsigned int tripleclicktimeout = 600;
+
+/* alt screens */
+int allowaltscreen = 1;
+
+/* frames per second st should at maximum draw to the screen */
+static unsigned int xfps = 120;
+static unsigned int actionfps = 30;
+
+/*
+ * blinking timeout (set to 0 to disable blinking) for the terminal blinking
+ * attribute.
+ */
+static unsigned int blinktimeout = 800;
+
+/*
+ * thickness of underline and bar cursors
+ */
+static unsigned int cursorthickness = 2;
+
+/*
+ * bell volume. It must be a value between -100 and 100. Use 0 for disabling
+ * it
+ */
+static int bellvolume = 0;
+
+/* default TERM value */
+char *termname = "st-256color";
+
+/*
+ * spaces per tab
+ *
+ * When you are changing this value, don't forget to adapt the »it« value in
+ * the st.info and appropriately install the st.info in the environment where
+ * you use this st version.
+ *
+ *	it#$tabspaces,
+ *
+ * Secondly make sure your kernel is not expanding tabs. When running `stty
+ * -a` »tab0« should appear. You can tell the terminal to not expand tabs by
+ *  running following command:
+ *
+ *	stty tabs
+ */
+unsigned int tabspaces = 8;
+
+/* Terminal colors (16 first used in escape sequence) */
+static const char *colorname[] = {
+	/* 8 normal colors */
+	"black",
+	"red3",
+	"green3",
+	"yellow3",
+	"blue2",
+	"magenta3",
+	"cyan3",
+	"gray90",
+
+	/* 8 bright colors */
+	"gray50",
+	"red",
+	"green",
+	"yellow",
+	"#5c5cff",
+	"magenta",
+	"cyan",
+	"white",
+
+	[255] = 0,
+
+	/* more colors can be added after 255 to use with DefaultXX */
+	"#cccccc",
+	"#555555",
+};
+
+
+/*
+ * Default colors (colorname index)
+ * foreground, background, cursor, reverse cursor
+ */
+unsigned int defaultfg = 7;
+unsigned int defaultbg = 0;
+static unsigned int defaultcs = 256;
+static unsigned int defaultrcs = 257;
+
+/*
+ * Default shape of cursor
+ * 2: Block ("█")
+ * 4: Underline ("_")
+ * 6: Bar ("|")
+ * 7: Snowman ("☃")
+ */
+static unsigned int cursorshape = 2;
+
+/*
+ * Default columns and rows numbers
+ */
+
+static unsigned int cols = 80;
+static unsigned int rows = 24;
+
+/*
+ * Default colour and shape of the mouse cursor
+ */
+static unsigned int mouseshape = XC_xterm;
+static unsigned int mousefg = 7;
+static unsigned int mousebg = 0;
+
+/*
+ * Color used to display font attributes when fontconfig selected a font which
+ * doesn't match the ones requested.
+ */
+static unsigned int defaultattr = 11;
+
+/*
+ * Internal mouse shortcuts.
+ * Beware that overloading Button1 will disable the selection.
+ */
+static MouseShortcut mshortcuts[] = {
+	/* button               mask            string */
+	{ Button4,              XK_ANY_MOD,     "\031" },
+	{ Button5,              XK_ANY_MOD,     "\005" },
+};
+
+/* Internal keyboard shortcuts. */
+#define MODKEY Mod1Mask
+#define TERMMOD (ControlMask|ShiftMask)
+
+static Shortcut shortcuts[] = {
+	/* mask                 keysym          function        argument */
+	{ XK_ANY_MOD,           XK_Break,       sendbreak,      {.i =  0} },
+	{ ControlMask,          XK_Print,       toggleprinter,  {.i =  0} },
+	{ ShiftMask,            XK_Print,       printscreen,    {.i =  0} },
+	{ XK_ANY_MOD,           XK_Print,       printsel,       {.i =  0} },
+	{ TERMMOD,              XK_Prior,       zoom,           {.f = +1} },
+	{ TERMMOD,              XK_Next,        zoom,           {.f = -1} },
+	{ TERMMOD,              XK_Home,        zoomreset,      {.f =  0} },
+	{ TERMMOD,              XK_C,           clipcopy,       {.i =  0} },
+	{ TERMMOD,              XK_V,           clippaste,      {.i =  0} },
+	{ TERMMOD,              XK_Y,           selpaste,       {.i =  0} },
+	{ TERMMOD,              XK_Num_Lock,    numlock,        {.i =  0} },
+	{ TERMMOD,              XK_I,           iso14755,       {.i =  0} },
+	{ ShiftMask,            XK_Page_Up,     kscrollup,      {.i = -1} },
+	{ ShiftMask,            XK_Page_Down,   kscrolldown,    {.i = -1} },
+};
+
+/*
+ * Special keys (change & recompile st.info accordingly)
+ *
+ * Mask value:
+ * * Use XK_ANY_MOD to match the key no matter modifiers state
+ * * Use XK_NO_MOD to match the key alone (no modifiers)
+ * appkey value:
+ * * 0: no value
+ * * > 0: keypad application mode enabled
+ * *   = 2: term.numlock = 1
+ * * < 0: keypad application mode disabled
+ * appcursor value:
+ * * 0: no value
+ * * > 0: cursor application mode enabled
+ * * < 0: cursor application mode disabled
+ * crlf value
+ * * 0: no value
+ * * > 0: crlf mode is enabled
+ * * < 0: crlf mode is disabled
+ *
+ * Be careful with the order of the definitions because st searches in
+ * this table sequentially, so any XK_ANY_MOD must be in the last
+ * position for a key.
+ */
+
+/*
+ * If you want keys other than the X11 function keys (0xFD00 - 0xFFFF)
+ * to be mapped below, add them to this array.
+ */
+static KeySym mappedkeys[] = { -1 };
+
+/*
+ * State bits to ignore when matching key or button events.  By default,
+ * numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored.
+ */
+static uint ignoremod = Mod2Mask|XK_SWITCH_MOD;
+
+/*
+ * Override mouse-select while mask is active (when MODE_MOUSE is set).
+ * Note that if you want to use ShiftMask with selmasks, set this to an other
+ * modifier, set to 0 to not use it.
+ */
+static uint forceselmod = ShiftMask;
+
+/*
+ * This is the huge key array which defines all compatibility to the Linux
+ * world. Please decide about changes wisely.
+ */
+static Key key[] = {
+	/* keysym           mask            string      appkey appcursor */
+	{ XK_KP_Home,       ShiftMask,      "\033[2J",       0,   -1},
+	{ XK_KP_Home,       ShiftMask,      "\033[1;2H",     0,   +1},
+	{ XK_KP_Home,       XK_ANY_MOD,     "\033[H",        0,   -1},
+	{ XK_KP_Home,       XK_ANY_MOD,     "\033[1~",       0,   +1},
+	{ XK_KP_Up,         XK_ANY_MOD,     "\033Ox",       +1,    0},
+	{ XK_KP_Up,         XK_ANY_MOD,     "\033[A",        0,   -1},
+	{ XK_KP_Up,         XK_ANY_MOD,     "\033OA",        0,   +1},
+	{ XK_KP_Down,       XK_ANY_MOD,     "\033Or",       +1,    0},
+	{ XK_KP_Down,       XK_ANY_MOD,     "\033[B",        0,   -1},
+	{ XK_KP_Down,       XK_ANY_MOD,     "\033OB",        0,   +1},
+	{ XK_KP_Left,       XK_ANY_MOD,     "\033Ot",       +1,    0},
+	{ XK_KP_Left,       XK_ANY_MOD,     "\033[D",        0,   -1},
+	{ XK_KP_Left,       XK_ANY_MOD,     "\033OD",        0,   +1},
+	{ XK_KP_Right,      XK_ANY_MOD,     "\033Ov",       +1,    0},
+	{ XK_KP_Right,      XK_ANY_MOD,     "\033[C",        0,   -1},
+	{ XK_KP_Right,      XK_ANY_MOD,     "\033OC",        0,   +1},
+	{ XK_KP_Prior,      ShiftMask,      "\033[5;2~",     0,    0},
+	{ XK_KP_Prior,      XK_ANY_MOD,     "\033[5~",       0,    0},
+	{ XK_KP_Begin,      XK_ANY_MOD,     "\033[E",        0,    0},
+	{ XK_KP_End,        ControlMask,    "\033[J",       -1,    0},
+	{ XK_KP_End,        ControlMask,    "\033[1;5F",    +1,    0},
+	{ XK_KP_End,        ShiftMask,      "\033[K",       -1,    0},
+	{ XK_KP_End,        ShiftMask,      "\033[1;2F",    +1,    0},
+	{ XK_KP_End,        XK_ANY_MOD,     "\033[4~",       0,    0},
+	{ XK_KP_Next,       ShiftMask,      "\033[6;2~",     0,    0},
+	{ XK_KP_Next,       XK_ANY_MOD,     "\033[6~",       0,    0},
+	{ XK_KP_Insert,     ShiftMask,      "\033[2;2~",    +1,    0},
+	{ XK_KP_Insert,     ShiftMask,      "\033[4l",      -1,    0},
+	{ XK_KP_Insert,     ControlMask,    "\033[L",       -1,    0},
+	{ XK_KP_Insert,     ControlMask,    "\033[2;5~",    +1,    0},
+	{ XK_KP_Insert,     XK_ANY_MOD,     "\033[4h",      -1,    0},
+	{ XK_KP_Insert,     XK_ANY_MOD,     "\033[2~",      +1,    0},
+	{ XK_KP_Delete,     ControlMask,    "\033[M",       -1,    0},
+	{ XK_KP_Delete,     ControlMask,    "\033[3;5~",    +1,    0},
+	{ XK_KP_Delete,     ShiftMask,      "\033[2K",      -1,    0},
+	{ XK_KP_Delete,     ShiftMask,      "\033[3;2~",    +1,    0},
+	{ XK_KP_Delete,     XK_ANY_MOD,     "\033[P",       -1,    0},
+	{ XK_KP_Delete,     XK_ANY_MOD,     "\033[3~",      +1,    0},
+	{ XK_KP_Multiply,   XK_ANY_MOD,     "\033Oj",       +2,    0},
+	{ XK_KP_Add,        XK_ANY_MOD,     "\033Ok",       +2,    0},
+	{ XK_KP_Enter,      XK_ANY_MOD,     "\033OM",       +2,    0},
+	{ XK_KP_Enter,      XK_ANY_MOD,     "\r",           -1,    0},
+	{ XK_KP_Subtract,   XK_ANY_MOD,     "\033Om",       +2,    0},
+	{ XK_KP_Decimal,    XK_ANY_MOD,     "\033On",       +2,    0},
+	{ XK_KP_Divide,     XK_ANY_MOD,     "\033Oo",       +2,    0},
+	{ XK_KP_0,          XK_ANY_MOD,     "\033Op",       +2,    0},
+	{ XK_KP_1,          XK_ANY_MOD,     "\033Oq",       +2,    0},
+	{ XK_KP_2,          XK_ANY_MOD,     "\033Or",       +2,    0},
+	{ XK_KP_3,          XK_ANY_MOD,     "\033Os",       +2,    0},
+	{ XK_KP_4,          XK_ANY_MOD,     "\033Ot",       +2,    0},
+	{ XK_KP_5,          XK_ANY_MOD,     "\033Ou",       +2,    0},
+	{ XK_KP_6,          XK_ANY_MOD,     "\033Ov",       +2,    0},
+	{ XK_KP_7,          XK_ANY_MOD,     "\033Ow",       +2,    0},
+	{ XK_KP_8,          XK_ANY_MOD,     "\033Ox",       +2,    0},
+	{ XK_KP_9,          XK_ANY_MOD,     "\033Oy",       +2,    0},
+	{ XK_Up,            ShiftMask,      "\033[1;2A",     0,    0},
+	{ XK_Up,            Mod1Mask,       "\033[1;3A",     0,    0},
+	{ XK_Up,         ShiftMask|Mod1Mask,"\033[1;4A",     0,    0},
+	{ XK_Up,            ControlMask,    "\033[1;5A",     0,    0},
+	{ XK_Up,      ShiftMask|ControlMask,"\033[1;6A",     0,    0},
+	{ XK_Up,       ControlMask|Mod1Mask,"\033[1;7A",     0,    0},
+	{ XK_Up,ShiftMask|ControlMask|Mod1Mask,"\033[1;8A",  0,    0},
+	{ XK_Up,            XK_ANY_MOD,     "\033[A",        0,   -1},
+	{ XK_Up,            XK_ANY_MOD,     "\033OA",        0,   +1},
+	{ XK_Down,          ShiftMask,      "\033[1;2B",     0,    0},
+	{ XK_Down,          Mod1Mask,       "\033[1;3B",     0,    0},
+	{ XK_Down,       ShiftMask|Mod1Mask,"\033[1;4B",     0,    0},
+	{ XK_Down,          ControlMask,    "\033[1;5B",     0,    0},
+	{ XK_Down,    ShiftMask|ControlMask,"\033[1;6B",     0,    0},
+	{ XK_Down,     ControlMask|Mod1Mask,"\033[1;7B",     0,    0},
+	{ XK_Down,ShiftMask|ControlMask|Mod1Mask,"\033[1;8B",0,    0},
+	{ XK_Down,          XK_ANY_MOD,     "\033[B",        0,   -1},
+	{ XK_Down,          XK_ANY_MOD,     "\033OB",        0,   +1},
+	{ XK_Left,          ShiftMask,      "\033[1;2D",     0,    0},
+	{ XK_Left,          Mod1Mask,       "\033[1;3D",     0,    0},
+	{ XK_Left,       ShiftMask|Mod1Mask,"\033[1;4D",     0,    0},
+	{ XK_Left,          ControlMask,    "\033[1;5D",     0,    0},
+	{ XK_Left,    ShiftMask|ControlMask,"\033[1;6D",     0,    0},
+	{ XK_Left,     ControlMask|Mod1Mask,"\033[1;7D",     0,    0},
+	{ XK_Left,ShiftMask|ControlMask|Mod1Mask,"\033[1;8D",0,    0},
+	{ XK_Left,          XK_ANY_MOD,     "\033[D",        0,   -1},
+	{ XK_Left,          XK_ANY_MOD,     "\033OD",        0,   +1},
+	{ XK_Right,         ShiftMask,      "\033[1;2C",     0,    0},
+	{ XK_Right,         Mod1Mask,       "\033[1;3C",     0,    0},
+	{ XK_Right,      ShiftMask|Mod1Mask,"\033[1;4C",     0,    0},
+	{ XK_Right,         ControlMask,    "\033[1;5C",     0,    0},
+	{ XK_Right,   ShiftMask|ControlMask,"\033[1;6C",     0,    0},
+	{ XK_Right,    ControlMask|Mod1Mask,"\033[1;7C",     0,    0},
+	{ XK_Right,ShiftMask|ControlMask|Mod1Mask,"\033[1;8C",0,   0},
+	{ XK_Right,         XK_ANY_MOD,     "\033[C",        0,   -1},
+	{ XK_Right,         XK_ANY_MOD,     "\033OC",        0,   +1},
+	{ XK_ISO_Left_Tab,  ShiftMask,      "\033[Z",        0,    0},
+	{ XK_Return,        Mod1Mask,       "\033\r",        0,    0},
+	{ XK_Return,        XK_ANY_MOD,     "\r",            0,    0},
+	{ XK_Insert,        ShiftMask,      "\033[4l",      -1,    0},
+	{ XK_Insert,        ShiftMask,      "\033[2;2~",    +1,    0},
+	{ XK_Insert,        ControlMask,    "\033[L",       -1,    0},
+	{ XK_Insert,        ControlMask,    "\033[2;5~",    +1,    0},
+	{ XK_Insert,        XK_ANY_MOD,     "\033[4h",      -1,    0},
+	{ XK_Insert,        XK_ANY_MOD,     "\033[2~",      +1,    0},
+	{ XK_Delete,        ControlMask,    "\033[M",       -1,    0},
+	{ XK_Delete,        ControlMask,    "\033[3;5~",    +1,    0},
+	{ XK_Delete,        ShiftMask,      "\033[2K",      -1,    0},
+	{ XK_Delete,        ShiftMask,      "\033[3;2~",    +1,    0},
+	{ XK_Delete,        XK_ANY_MOD,     "\033[P",       -1,    0},
+	{ XK_Delete,        XK_ANY_MOD,     "\033[3~",      +1,    0},
+	{ XK_BackSpace,     XK_NO_MOD,      "\177",          0,    0},
+	{ XK_BackSpace,     Mod1Mask,       "\033\177",      0,    0},
+	{ XK_Home,          ShiftMask,      "\033[2J",       0,   -1},
+	{ XK_Home,          ShiftMask,      "\033[1;2H",     0,   +1},
+	{ XK_Home,          XK_ANY_MOD,     "\033[H",        0,   -1},
+	{ XK_Home,          XK_ANY_MOD,     "\033[1~",       0,   +1},
+	{ XK_End,           ControlMask,    "\033[J",       -1,    0},
+	{ XK_End,           ControlMask,    "\033[1;5F",    +1,    0},
+	{ XK_End,           ShiftMask,      "\033[K",       -1,    0},
+	{ XK_End,           ShiftMask,      "\033[1;2F",    +1,    0},
+	{ XK_End,           XK_ANY_MOD,     "\033[4~",       0,    0},
+	{ XK_Prior,         ControlMask,    "\033[5;5~",     0,    0},
+	{ XK_Prior,         ShiftMask,      "\033[5;2~",     0,    0},
+	{ XK_Prior,         XK_ANY_MOD,     "\033[5~",       0,    0},
+	{ XK_Next,          ControlMask,    "\033[6;5~",     0,    0},
+	{ XK_Next,          ShiftMask,      "\033[6;2~",     0,    0},
+	{ XK_Next,          XK_ANY_MOD,     "\033[6~",       0,    0},
+	{ XK_F1,            XK_NO_MOD,      "\033OP" ,       0,    0},
+	{ XK_F1, /* F13 */  ShiftMask,      "\033[1;2P",     0,    0},
+	{ XK_F1, /* F25 */  ControlMask,    "\033[1;5P",     0,    0},
+	{ XK_F1, /* F37 */  Mod4Mask,       "\033[1;6P",     0,    0},
+	{ XK_F1, /* F49 */  Mod1Mask,       "\033[1;3P",     0,    0},
+	{ XK_F1, /* F61 */  Mod3Mask,       "\033[1;4P",     0,    0},
+	{ XK_F2,            XK_NO_MOD,      "\033OQ" ,       0,    0},
+	{ XK_F2, /* F14 */  ShiftMask,      "\033[1;2Q",     0,    0},
+	{ XK_F2, /* F26 */  ControlMask,    "\033[1;5Q",     0,    0},
+	{ XK_F2, /* F38 */  Mod4Mask,       "\033[1;6Q",     0,    0},
+	{ XK_F2, /* F50 */  Mod1Mask,       "\033[1;3Q",     0,    0},
+	{ XK_F2, /* F62 */  Mod3Mask,       "\033[1;4Q",     0,    0},
+	{ XK_F3,            XK_NO_MOD,      "\033OR" ,       0,    0},
+	{ XK_F3, /* F15 */  ShiftMask,      "\033[1;2R",     0,    0},
+	{ XK_F3, /* F27 */  ControlMask,    "\033[1;5R",     0,    0},
+	{ XK_F3, /* F39 */  Mod4Mask,       "\033[1;6R",     0,    0},
+	{ XK_F3, /* F51 */  Mod1Mask,       "\033[1;3R",     0,    0},
+	{ XK_F3, /* F63 */  Mod3Mask,       "\033[1;4R",     0,    0},
+	{ XK_F4,            XK_NO_MOD,      "\033OS" ,       0,    0},
+	{ XK_F4, /* F16 */  ShiftMask,      "\033[1;2S",     0,    0},
+	{ XK_F4, /* F28 */  ControlMask,    "\033[1;5S",     0,    0},
+	{ XK_F4, /* F40 */  Mod4Mask,       "\033[1;6S",     0,    0},
+	{ XK_F4, /* F52 */  Mod1Mask,       "\033[1;3S",     0,    0},
+	{ XK_F5,            XK_NO_MOD,      "\033[15~",      0,    0},
+	{ XK_F5, /* F17 */  ShiftMask,      "\033[15;2~",    0,    0},
+	{ XK_F5, /* F29 */  ControlMask,    "\033[15;5~",    0,    0},
+	{ XK_F5, /* F41 */  Mod4Mask,       "\033[15;6~",    0,    0},
+	{ XK_F5, /* F53 */  Mod1Mask,       "\033[15;3~",    0,    0},
+	{ XK_F6,            XK_NO_MOD,      "\033[17~",      0,    0},
+	{ XK_F6, /* F18 */  ShiftMask,      "\033[17;2~",    0,    0},
+	{ XK_F6, /* F30 */  ControlMask,    "\033[17;5~",    0,    0},
+	{ XK_F6, /* F42 */  Mod4Mask,       "\033[17;6~",    0,    0},
+	{ XK_F6, /* F54 */  Mod1Mask,       "\033[17;3~",    0,    0},
+	{ XK_F7,            XK_NO_MOD,      "\033[18~",      0,    0},
+	{ XK_F7, /* F19 */  ShiftMask,      "\033[18;2~",    0,    0},
+	{ XK_F7, /* F31 */  ControlMask,    "\033[18;5~",    0,    0},
+	{ XK_F7, /* F43 */  Mod4Mask,       "\033[18;6~",    0,    0},
+	{ XK_F7, /* F55 */  Mod1Mask,       "\033[18;3~",    0,    0},
+	{ XK_F8,            XK_NO_MOD,      "\033[19~",      0,    0},
+	{ XK_F8, /* F20 */  ShiftMask,      "\033[19;2~",    0,    0},
+	{ XK_F8, /* F32 */  ControlMask,    "\033[19;5~",    0,    0},
+	{ XK_F8, /* F44 */  Mod4Mask,       "\033[19;6~",    0,    0},
+	{ XK_F8, /* F56 */  Mod1Mask,       "\033[19;3~",    0,    0},
+	{ XK_F9,            XK_NO_MOD,      "\033[20~",      0,    0},
+	{ XK_F9, /* F21 */  ShiftMask,      "\033[20;2~",    0,    0},
+	{ XK_F9, /* F33 */  ControlMask,    "\033[20;5~",    0,    0},
+	{ XK_F9, /* F45 */  Mod4Mask,       "\033[20;6~",    0,    0},
+	{ XK_F9, /* F57 */  Mod1Mask,       "\033[20;3~",    0,    0},
+	{ XK_F10,           XK_NO_MOD,      "\033[21~",      0,    0},
+	{ XK_F10, /* F22 */ ShiftMask,      "\033[21;2~",    0,    0},
+	{ XK_F10, /* F34 */ ControlMask,    "\033[21;5~",    0,    0},
+	{ XK_F10, /* F46 */ Mod4Mask,       "\033[21;6~",    0,    0},
+	{ XK_F10, /* F58 */ Mod1Mask,       "\033[21;3~",    0,    0},
+	{ XK_F11,           XK_NO_MOD,      "\033[23~",      0,    0},
+	{ XK_F11, /* F23 */ ShiftMask,      "\033[23;2~",    0,    0},
+	{ XK_F11, /* F35 */ ControlMask,    "\033[23;5~",    0,    0},
+	{ XK_F11, /* F47 */ Mod4Mask,       "\033[23;6~",    0,    0},
+	{ XK_F11, /* F59 */ Mod1Mask,       "\033[23;3~",    0,    0},
+	{ XK_F12,           XK_NO_MOD,      "\033[24~",      0,    0},
+	{ XK_F12, /* F24 */ ShiftMask,      "\033[24;2~",    0,    0},
+	{ XK_F12, /* F36 */ ControlMask,    "\033[24;5~",    0,    0},
+	{ XK_F12, /* F48 */ Mod4Mask,       "\033[24;6~",    0,    0},
+	{ XK_F12, /* F60 */ Mod1Mask,       "\033[24;3~",    0,    0},
+	{ XK_F13,           XK_NO_MOD,      "\033[1;2P",     0,    0},
+	{ XK_F14,           XK_NO_MOD,      "\033[1;2Q",     0,    0},
+	{ XK_F15,           XK_NO_MOD,      "\033[1;2R",     0,    0},
+	{ XK_F16,           XK_NO_MOD,      "\033[1;2S",     0,    0},
+	{ XK_F17,           XK_NO_MOD,      "\033[15;2~",    0,    0},
+	{ XK_F18,           XK_NO_MOD,      "\033[17;2~",    0,    0},
+	{ XK_F19,           XK_NO_MOD,      "\033[18;2~",    0,    0},
+	{ XK_F20,           XK_NO_MOD,      "\033[19;2~",    0,    0},
+	{ XK_F21,           XK_NO_MOD,      "\033[20;2~",    0,    0},
+	{ XK_F22,           XK_NO_MOD,      "\033[21;2~",    0,    0},
+	{ XK_F23,           XK_NO_MOD,      "\033[23;2~",    0,    0},
+	{ XK_F24,           XK_NO_MOD,      "\033[24;2~",    0,    0},
+	{ XK_F25,           XK_NO_MOD,      "\033[1;5P",     0,    0},
+	{ XK_F26,           XK_NO_MOD,      "\033[1;5Q",     0,    0},
+	{ XK_F27,           XK_NO_MOD,      "\033[1;5R",     0,    0},
+	{ XK_F28,           XK_NO_MOD,      "\033[1;5S",     0,    0},
+	{ XK_F29,           XK_NO_MOD,      "\033[15;5~",    0,    0},
+	{ XK_F30,           XK_NO_MOD,      "\033[17;5~",    0,    0},
+	{ XK_F31,           XK_NO_MOD,      "\033[18;5~",    0,    0},
+	{ XK_F32,           XK_NO_MOD,      "\033[19;5~",    0,    0},
+	{ XK_F33,           XK_NO_MOD,      "\033[20;5~",    0,    0},
+	{ XK_F34,           XK_NO_MOD,      "\033[21;5~",    0,    0},
+	{ XK_F35,           XK_NO_MOD,      "\033[23;5~",    0,    0},
+};
+
+/*
+ * Selection types' masks.
+ * Use the same masks as usual.
+ * Button1Mask is always unset, to make masks match between ButtonPress.
+ * ButtonRelease and MotionNotify.
+ * If no match is found, regular selection is used.
+ */
+static uint selmasks[] = {
+	[SEL_RECTANGULAR] = Mod1Mask,
+};
+
+/*
+ * Printable characters in ASCII, used to estimate the advance width
+ * of single wide characters.
+ */
+static char ascii_printable[] =
+	" !\"#$%&'()*+,-./0123456789:;<=>?"
+	"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
+	"`abcdefghijklmnopqrstuvwxyz{|}~";

+ 458 - 0
st/config.h

@@ -0,0 +1,458 @@
+/* See LICENSE file for copyright and license details. */
+
+/*
+ * appearance
+ *
+ * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
+ */
+static char *font = "Misc Tamsyn: size=14";
+static int borderpx = 15;
+
+/*
+ * What program is execed by st depends of these precedence rules:
+ * 1: program passed with -e
+ * 2: utmp option
+ * 3: SHELL environment variable
+ * 4: value of shell in /etc/passwd
+ * 5: value of shell in config.h
+ */
+static char *shell = "/bin/sh";
+char *utmp = NULL;
+char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400";
+
+/* identification sequence returned in DA and DECID */
+char *vtiden = "\033[?6c";
+
+/* Kerning / character bounding-box multipliers */
+static float cwscale = 1.0;
+static float chscale = 1.0;
+
+/*
+ * word delimiter string
+ *
+ * More advanced example: " `'\"()[]{}"
+ */
+char *worddelimiters = " ";
+
+/* selection timeouts (in milliseconds) */
+static unsigned int doubleclicktimeout = 300;
+static unsigned int tripleclicktimeout = 600;
+
+/* alt screens */
+int allowaltscreen = 1;
+
+/* frames per second st should at maximum draw to the screen */
+static unsigned int xfps = 120;
+static unsigned int actionfps = 30;
+
+/*
+ * blinking timeout (set to 0 to disable blinking) for the terminal blinking
+ * attribute.
+ */
+static unsigned int blinktimeout = 800;
+
+/*
+ * thickness of underline and bar cursors
+ */
+static unsigned int cursorthickness = 2;
+
+/*
+ * bell volume. It must be a value between -100 and 100. Use 0 for disabling
+ * it
+ */
+static int bellvolume = 0;
+
+/* default TERM value */
+char *termname = "st-256color";
+
+/*
+ * spaces per tab
+ *
+ * When you are changing this value, don't forget to adapt the »it« value in
+ * the st.info and appropriately install the st.info in the environment where
+ * you use this st version.
+ *
+ *	it#$tabspaces,
+ *
+ * Secondly make sure your kernel is not expanding tabs. When running `stty
+ * -a` »tab0« should appear. You can tell the terminal to not expand tabs by
+ *  running following command:
+ *
+ *	stty tabs
+ */
+unsigned int tabspaces = 8;
+
+/* Terminal colors (16 first used in escape sequence) */
+static const char *colorname[] = {
+	
+    /* My colors */
+    "#000000",	/* 0: Black */                                                                                        
+    "#DC322F",	/* 1: Red */
+    "#859900",	/* 2: Green */
+    "#B58900",	/* 3: Yellow */
+    "#268BD2",	/* 4: Blue */
+    "#D33682",	/* 5: Magenta */
+    "#2AA198",	/* 6: Cyan */
+    "#FFFFFF",	/* 7: White */
+    "#000000",	/* 8: Black */
+    "#DC322F",	/* 9: Red */
+    "#859900",	/* 10: Green */
+    "#B58900",	/* 11: Yellow */
+    "#268BD2",	/* 12: Blue */
+    "#D33682",	/* 13: Magenta */
+    "#2AA198",	/* 14: Cyan */
+    "#FFFFFF",	/* 15: White */
+
+};
+
+
+/*
+ * Default colors (colorname index)
+ * foreground, background, cursor, reverse cursor
+ */
+unsigned int defaultfg = 7;
+unsigned int defaultbg = 0;
+static unsigned int defaultcs = 7;
+static unsigned int defaultrcs = 7;
+
+/*
+ * Default shape of cursor
+ * 2: Block ("█")
+ * 4: Underline ("_")
+ * 6: Bar ("|")
+ * 7: Snowman ("☃")
+ */
+static unsigned int cursorshape = 2;
+
+/*
+ * Default columns and rows numbers
+ */
+
+static unsigned int cols = 80;
+static unsigned int rows = 24;
+
+/*
+ * Default colour and shape of the mouse cursor
+ */
+static unsigned int mouseshape = XC_xterm;
+static unsigned int mousefg = 7;
+static unsigned int mousebg = 0;
+
+/*
+ * Color used to display font attributes when fontconfig selected a font which
+ * doesn't match the ones requested.
+ */
+static unsigned int defaultattr = 11;
+
+/*
+ * Internal mouse shortcuts.
+ * Beware that overloading Button1 will disable the selection.
+ */
+static MouseShortcut mshortcuts[] = {
+	/* button               mask            string */
+	{ Button4,              XK_ANY_MOD,     "\031" },
+	{ Button5,              XK_ANY_MOD,     "\005" },
+};
+
+/* Internal keyboard shortcuts. */
+#define MODKEY Mod1Mask
+#define TERMMOD (ControlMask|ShiftMask)
+
+static Shortcut shortcuts[] = {
+	/* mask                 keysym          function        argument */
+	{ XK_ANY_MOD,           XK_Break,       sendbreak,      {.i =  0} },
+	{ ControlMask,          XK_Print,       toggleprinter,  {.i =  0} },
+	{ ShiftMask,            XK_Print,       printscreen,    {.i =  0} },
+	{ XK_ANY_MOD,           XK_Print,       printsel,       {.i =  0} },
+	{ TERMMOD,              XK_Prior,       zoom,           {.f = +1} },
+	{ TERMMOD,              XK_Next,        zoom,           {.f = -1} },
+	{ TERMMOD,              XK_Home,        zoomreset,      {.f =  0} },
+	{ TERMMOD,              XK_C,           clipcopy,       {.i =  0} },
+	{ TERMMOD,              XK_V,           clippaste,      {.i =  0} },
+	{ TERMMOD,              XK_Y,           selpaste,       {.i =  0} },
+	{ TERMMOD,              XK_Num_Lock,    numlock,        {.i =  0} },
+	{ TERMMOD,              XK_I,           iso14755,       {.i =  0} },
+	{ ShiftMask,            XK_Page_Up,     kscrollup,      {.i = -1} },
+	{ ShiftMask,            XK_Page_Down,   kscrolldown,    {.i = -1} },
+};
+
+/*
+ * Special keys (change & recompile st.info accordingly)
+ *
+ * Mask value:
+ * * Use XK_ANY_MOD to match the key no matter modifiers state
+ * * Use XK_NO_MOD to match the key alone (no modifiers)
+ * appkey value:
+ * * 0: no value
+ * * > 0: keypad application mode enabled
+ * *   = 2: term.numlock = 1
+ * * < 0: keypad application mode disabled
+ * appcursor value:
+ * * 0: no value
+ * * > 0: cursor application mode enabled
+ * * < 0: cursor application mode disabled
+ * crlf value
+ * * 0: no value
+ * * > 0: crlf mode is enabled
+ * * < 0: crlf mode is disabled
+ *
+ * Be careful with the order of the definitions because st searches in
+ * this table sequentially, so any XK_ANY_MOD must be in the last
+ * position for a key.
+ */
+
+/*
+ * If you want keys other than the X11 function keys (0xFD00 - 0xFFFF)
+ * to be mapped below, add them to this array.
+ */
+static KeySym mappedkeys[] = { -1 };
+
+/*
+ * State bits to ignore when matching key or button events.  By default,
+ * numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored.
+ */
+static uint ignoremod = Mod2Mask|XK_SWITCH_MOD;
+
+/*
+ * Override mouse-select while mask is active (when MODE_MOUSE is set).
+ * Note that if you want to use ShiftMask with selmasks, set this to an other
+ * modifier, set to 0 to not use it.
+ */
+static uint forceselmod = ShiftMask;
+
+/*
+ * This is the huge key array which defines all compatibility to the Linux
+ * world. Please decide about changes wisely.
+ */
+static Key key[] = {
+	/* keysym           mask            string      appkey appcursor */
+	{ XK_KP_Home,       ShiftMask,      "\033[2J",       0,   -1},
+	{ XK_KP_Home,       ShiftMask,      "\033[1;2H",     0,   +1},
+	{ XK_KP_Home,       XK_ANY_MOD,     "\033[H",        0,   -1},
+	{ XK_KP_Home,       XK_ANY_MOD,     "\033[1~",       0,   +1},
+	{ XK_KP_Up,         XK_ANY_MOD,     "\033Ox",       +1,    0},
+	{ XK_KP_Up,         XK_ANY_MOD,     "\033[A",        0,   -1},
+	{ XK_KP_Up,         XK_ANY_MOD,     "\033OA",        0,   +1},
+	{ XK_KP_Down,       XK_ANY_MOD,     "\033Or",       +1,    0},
+	{ XK_KP_Down,       XK_ANY_MOD,     "\033[B",        0,   -1},
+	{ XK_KP_Down,       XK_ANY_MOD,     "\033OB",        0,   +1},
+	{ XK_KP_Left,       XK_ANY_MOD,     "\033Ot",       +1,    0},
+	{ XK_KP_Left,       XK_ANY_MOD,     "\033[D",        0,   -1},
+	{ XK_KP_Left,       XK_ANY_MOD,     "\033OD",        0,   +1},
+	{ XK_KP_Right,      XK_ANY_MOD,     "\033Ov",       +1,    0},
+	{ XK_KP_Right,      XK_ANY_MOD,     "\033[C",        0,   -1},
+	{ XK_KP_Right,      XK_ANY_MOD,     "\033OC",        0,   +1},
+	{ XK_KP_Prior,      ShiftMask,      "\033[5;2~",     0,    0},
+	{ XK_KP_Prior,      XK_ANY_MOD,     "\033[5~",       0,    0},
+	{ XK_KP_Begin,      XK_ANY_MOD,     "\033[E",        0,    0},
+	{ XK_KP_End,        ControlMask,    "\033[J",       -1,    0},
+	{ XK_KP_End,        ControlMask,    "\033[1;5F",    +1,    0},
+	{ XK_KP_End,        ShiftMask,      "\033[K",       -1,    0},
+	{ XK_KP_End,        ShiftMask,      "\033[1;2F",    +1,    0},
+	{ XK_KP_End,        XK_ANY_MOD,     "\033[4~",       0,    0},
+	{ XK_KP_Next,       ShiftMask,      "\033[6;2~",     0,    0},
+	{ XK_KP_Next,       XK_ANY_MOD,     "\033[6~",       0,    0},
+	{ XK_KP_Insert,     ShiftMask,      "\033[2;2~",    +1,    0},
+	{ XK_KP_Insert,     ShiftMask,      "\033[4l",      -1,    0},
+	{ XK_KP_Insert,     ControlMask,    "\033[L",       -1,    0},
+	{ XK_KP_Insert,     ControlMask,    "\033[2;5~",    +1,    0},
+	{ XK_KP_Insert,     XK_ANY_MOD,     "\033[4h",      -1,    0},
+	{ XK_KP_Insert,     XK_ANY_MOD,     "\033[2~",      +1,    0},
+	{ XK_KP_Delete,     ControlMask,    "\033[M",       -1,    0},
+	{ XK_KP_Delete,     ControlMask,    "\033[3;5~",    +1,    0},
+	{ XK_KP_Delete,     ShiftMask,      "\033[2K",      -1,    0},
+	{ XK_KP_Delete,     ShiftMask,      "\033[3;2~",    +1,    0},
+	{ XK_KP_Delete,     XK_ANY_MOD,     "\033[P",       -1,    0},
+	{ XK_KP_Delete,     XK_ANY_MOD,     "\033[3~",      +1,    0},
+	{ XK_KP_Multiply,   XK_ANY_MOD,     "\033Oj",       +2,    0},
+	{ XK_KP_Add,        XK_ANY_MOD,     "\033Ok",       +2,    0},
+	{ XK_KP_Enter,      XK_ANY_MOD,     "\033OM",       +2,    0},
+	{ XK_KP_Enter,      XK_ANY_MOD,     "\r",           -1,    0},
+	{ XK_KP_Subtract,   XK_ANY_MOD,     "\033Om",       +2,    0},
+	{ XK_KP_Decimal,    XK_ANY_MOD,     "\033On",       +2,    0},
+	{ XK_KP_Divide,     XK_ANY_MOD,     "\033Oo",       +2,    0},
+	{ XK_KP_0,          XK_ANY_MOD,     "\033Op",       +2,    0},
+	{ XK_KP_1,          XK_ANY_MOD,     "\033Oq",       +2,    0},
+	{ XK_KP_2,          XK_ANY_MOD,     "\033Or",       +2,    0},
+	{ XK_KP_3,          XK_ANY_MOD,     "\033Os",       +2,    0},
+	{ XK_KP_4,          XK_ANY_MOD,     "\033Ot",       +2,    0},
+	{ XK_KP_5,          XK_ANY_MOD,     "\033Ou",       +2,    0},
+	{ XK_KP_6,          XK_ANY_MOD,     "\033Ov",       +2,    0},
+	{ XK_KP_7,          XK_ANY_MOD,     "\033Ow",       +2,    0},
+	{ XK_KP_8,          XK_ANY_MOD,     "\033Ox",       +2,    0},
+	{ XK_KP_9,          XK_ANY_MOD,     "\033Oy",       +2,    0},
+	{ XK_Up,            ShiftMask,      "\033[1;2A",     0,    0},
+	{ XK_Up,            Mod1Mask,       "\033[1;3A",     0,    0},
+	{ XK_Up,         ShiftMask|Mod1Mask,"\033[1;4A",     0,    0},
+	{ XK_Up,            ControlMask,    "\033[1;5A",     0,    0},
+	{ XK_Up,      ShiftMask|ControlMask,"\033[1;6A",     0,    0},
+	{ XK_Up,       ControlMask|Mod1Mask,"\033[1;7A",     0,    0},
+	{ XK_Up,ShiftMask|ControlMask|Mod1Mask,"\033[1;8A",  0,    0},
+	{ XK_Up,            XK_ANY_MOD,     "\033[A",        0,   -1},
+	{ XK_Up,            XK_ANY_MOD,     "\033OA",        0,   +1},
+	{ XK_Down,          ShiftMask,      "\033[1;2B",     0,    0},
+	{ XK_Down,          Mod1Mask,       "\033[1;3B",     0,    0},
+	{ XK_Down,       ShiftMask|Mod1Mask,"\033[1;4B",     0,    0},
+	{ XK_Down,          ControlMask,    "\033[1;5B",     0,    0},
+	{ XK_Down,    ShiftMask|ControlMask,"\033[1;6B",     0,    0},
+	{ XK_Down,     ControlMask|Mod1Mask,"\033[1;7B",     0,    0},
+	{ XK_Down,ShiftMask|ControlMask|Mod1Mask,"\033[1;8B",0,    0},
+	{ XK_Down,          XK_ANY_MOD,     "\033[B",        0,   -1},
+	{ XK_Down,          XK_ANY_MOD,     "\033OB",        0,   +1},
+	{ XK_Left,          ShiftMask,      "\033[1;2D",     0,    0},
+	{ XK_Left,          Mod1Mask,       "\033[1;3D",     0,    0},
+	{ XK_Left,       ShiftMask|Mod1Mask,"\033[1;4D",     0,    0},
+	{ XK_Left,          ControlMask,    "\033[1;5D",     0,    0},
+	{ XK_Left,    ShiftMask|ControlMask,"\033[1;6D",     0,    0},
+	{ XK_Left,     ControlMask|Mod1Mask,"\033[1;7D",     0,    0},
+	{ XK_Left,ShiftMask|ControlMask|Mod1Mask,"\033[1;8D",0,    0},
+	{ XK_Left,          XK_ANY_MOD,     "\033[D",        0,   -1},
+	{ XK_Left,          XK_ANY_MOD,     "\033OD",        0,   +1},
+	{ XK_Right,         ShiftMask,      "\033[1;2C",     0,    0},
+	{ XK_Right,         Mod1Mask,       "\033[1;3C",     0,    0},
+	{ XK_Right,      ShiftMask|Mod1Mask,"\033[1;4C",     0,    0},
+	{ XK_Right,         ControlMask,    "\033[1;5C",     0,    0},
+	{ XK_Right,   ShiftMask|ControlMask,"\033[1;6C",     0,    0},
+	{ XK_Right,    ControlMask|Mod1Mask,"\033[1;7C",     0,    0},
+	{ XK_Right,ShiftMask|ControlMask|Mod1Mask,"\033[1;8C",0,   0},
+	{ XK_Right,         XK_ANY_MOD,     "\033[C",        0,   -1},
+	{ XK_Right,         XK_ANY_MOD,     "\033OC",        0,   +1},
+	{ XK_ISO_Left_Tab,  ShiftMask,      "\033[Z",        0,    0},
+	{ XK_Return,        Mod1Mask,       "\033\r",        0,    0},
+	{ XK_Return,        XK_ANY_MOD,     "\r",            0,    0},
+	{ XK_Insert,        ShiftMask,      "\033[4l",      -1,    0},
+	{ XK_Insert,        ShiftMask,      "\033[2;2~",    +1,    0},
+	{ XK_Insert,        ControlMask,    "\033[L",       -1,    0},
+	{ XK_Insert,        ControlMask,    "\033[2;5~",    +1,    0},
+	{ XK_Insert,        XK_ANY_MOD,     "\033[4h",      -1,    0},
+	{ XK_Insert,        XK_ANY_MOD,     "\033[2~",      +1,    0},
+	{ XK_Delete,        ControlMask,    "\033[M",       -1,    0},
+	{ XK_Delete,        ControlMask,    "\033[3;5~",    +1,    0},
+	{ XK_Delete,        ShiftMask,      "\033[2K",      -1,    0},
+	{ XK_Delete,        ShiftMask,      "\033[3;2~",    +1,    0},
+	{ XK_Delete,        XK_ANY_MOD,     "\033[P",       -1,    0},
+	{ XK_Delete,        XK_ANY_MOD,     "\033[3~",      +1,    0},
+	{ XK_BackSpace,     XK_NO_MOD,      "\177",          0,    0},
+	{ XK_BackSpace,     Mod1Mask,       "\033\177",      0,    0},
+	{ XK_Home,          ShiftMask,      "\033[2J",       0,   -1},
+	{ XK_Home,          ShiftMask,      "\033[1;2H",     0,   +1},
+	{ XK_Home,          XK_ANY_MOD,     "\033[H",        0,   -1},
+	{ XK_Home,          XK_ANY_MOD,     "\033[1~",       0,   +1},
+	{ XK_End,           ControlMask,    "\033[J",       -1,    0},
+	{ XK_End,           ControlMask,    "\033[1;5F",    +1,    0},
+	{ XK_End,           ShiftMask,      "\033[K",       -1,    0},
+	{ XK_End,           ShiftMask,      "\033[1;2F",    +1,    0},
+	{ XK_End,           XK_ANY_MOD,     "\033[4~",       0,    0},
+	{ XK_Prior,         ControlMask,    "\033[5;5~",     0,    0},
+	{ XK_Prior,         ShiftMask,      "\033[5;2~",     0,    0},
+	{ XK_Prior,         XK_ANY_MOD,     "\033[5~",       0,    0},
+	{ XK_Next,          ControlMask,    "\033[6;5~",     0,    0},
+	{ XK_Next,          ShiftMask,      "\033[6;2~",     0,    0},
+	{ XK_Next,          XK_ANY_MOD,     "\033[6~",       0,    0},
+	{ XK_F1,            XK_NO_MOD,      "\033OP" ,       0,    0},
+	{ XK_F1, /* F13 */  ShiftMask,      "\033[1;2P",     0,    0},
+	{ XK_F1, /* F25 */  ControlMask,    "\033[1;5P",     0,    0},
+	{ XK_F1, /* F37 */  Mod4Mask,       "\033[1;6P",     0,    0},
+	{ XK_F1, /* F49 */  Mod1Mask,       "\033[1;3P",     0,    0},
+	{ XK_F1, /* F61 */  Mod3Mask,       "\033[1;4P",     0,    0},
+	{ XK_F2,            XK_NO_MOD,      "\033OQ" ,       0,    0},
+	{ XK_F2, /* F14 */  ShiftMask,      "\033[1;2Q",     0,    0},
+	{ XK_F2, /* F26 */  ControlMask,    "\033[1;5Q",     0,    0},
+	{ XK_F2, /* F38 */  Mod4Mask,       "\033[1;6Q",     0,    0},
+	{ XK_F2, /* F50 */  Mod1Mask,       "\033[1;3Q",     0,    0},
+	{ XK_F2, /* F62 */  Mod3Mask,       "\033[1;4Q",     0,    0},
+	{ XK_F3,            XK_NO_MOD,      "\033OR" ,       0,    0},
+	{ XK_F3, /* F15 */  ShiftMask,      "\033[1;2R",     0,    0},
+	{ XK_F3, /* F27 */  ControlMask,    "\033[1;5R",     0,    0},
+	{ XK_F3, /* F39 */  Mod4Mask,       "\033[1;6R",     0,    0},
+	{ XK_F3, /* F51 */  Mod1Mask,       "\033[1;3R",     0,    0},
+	{ XK_F3, /* F63 */  Mod3Mask,       "\033[1;4R",     0,    0},
+	{ XK_F4,            XK_NO_MOD,      "\033OS" ,       0,    0},
+	{ XK_F4, /* F16 */  ShiftMask,      "\033[1;2S",     0,    0},
+	{ XK_F4, /* F28 */  ControlMask,    "\033[1;5S",     0,    0},
+	{ XK_F4, /* F40 */  Mod4Mask,       "\033[1;6S",     0,    0},
+	{ XK_F4, /* F52 */  Mod1Mask,       "\033[1;3S",     0,    0},
+	{ XK_F5,            XK_NO_MOD,      "\033[15~",      0,    0},
+	{ XK_F5, /* F17 */  ShiftMask,      "\033[15;2~",    0,    0},
+	{ XK_F5, /* F29 */  ControlMask,    "\033[15;5~",    0,    0},
+	{ XK_F5, /* F41 */  Mod4Mask,       "\033[15;6~",    0,    0},
+	{ XK_F5, /* F53 */  Mod1Mask,       "\033[15;3~",    0,    0},
+	{ XK_F6,            XK_NO_MOD,      "\033[17~",      0,    0},
+	{ XK_F6, /* F18 */  ShiftMask,      "\033[17;2~",    0,    0},
+	{ XK_F6, /* F30 */  ControlMask,    "\033[17;5~",    0,    0},
+	{ XK_F6, /* F42 */  Mod4Mask,       "\033[17;6~",    0,    0},
+	{ XK_F6, /* F54 */  Mod1Mask,       "\033[17;3~",    0,    0},
+	{ XK_F7,            XK_NO_MOD,      "\033[18~",      0,    0},
+	{ XK_F7, /* F19 */  ShiftMask,      "\033[18;2~",    0,    0},
+	{ XK_F7, /* F31 */  ControlMask,    "\033[18;5~",    0,    0},
+	{ XK_F7, /* F43 */  Mod4Mask,       "\033[18;6~",    0,    0},
+	{ XK_F7, /* F55 */  Mod1Mask,       "\033[18;3~",    0,    0},
+	{ XK_F8,            XK_NO_MOD,      "\033[19~",      0,    0},
+	{ XK_F8, /* F20 */  ShiftMask,      "\033[19;2~",    0,    0},
+	{ XK_F8, /* F32 */  ControlMask,    "\033[19;5~",    0,    0},
+	{ XK_F8, /* F44 */  Mod4Mask,       "\033[19;6~",    0,    0},
+	{ XK_F8, /* F56 */  Mod1Mask,       "\033[19;3~",    0,    0},
+	{ XK_F9,            XK_NO_MOD,      "\033[20~",      0,    0},
+	{ XK_F9, /* F21 */  ShiftMask,      "\033[20;2~",    0,    0},
+	{ XK_F9, /* F33 */  ControlMask,    "\033[20;5~",    0,    0},
+	{ XK_F9, /* F45 */  Mod4Mask,       "\033[20;6~",    0,    0},
+	{ XK_F9, /* F57 */  Mod1Mask,       "\033[20;3~",    0,    0},
+	{ XK_F10,           XK_NO_MOD,      "\033[21~",      0,    0},
+	{ XK_F10, /* F22 */ ShiftMask,      "\033[21;2~",    0,    0},
+	{ XK_F10, /* F34 */ ControlMask,    "\033[21;5~",    0,    0},
+	{ XK_F10, /* F46 */ Mod4Mask,       "\033[21;6~",    0,    0},
+	{ XK_F10, /* F58 */ Mod1Mask,       "\033[21;3~",    0,    0},
+	{ XK_F11,           XK_NO_MOD,      "\033[23~",      0,    0},
+	{ XK_F11, /* F23 */ ShiftMask,      "\033[23;2~",    0,    0},
+	{ XK_F11, /* F35 */ ControlMask,    "\033[23;5~",    0,    0},
+	{ XK_F11, /* F47 */ Mod4Mask,       "\033[23;6~",    0,    0},
+	{ XK_F11, /* F59 */ Mod1Mask,       "\033[23;3~",    0,    0},
+	{ XK_F12,           XK_NO_MOD,      "\033[24~",      0,    0},
+	{ XK_F12, /* F24 */ ShiftMask,      "\033[24;2~",    0,    0},
+	{ XK_F12, /* F36 */ ControlMask,    "\033[24;5~",    0,    0},
+	{ XK_F12, /* F48 */ Mod4Mask,       "\033[24;6~",    0,    0},
+	{ XK_F12, /* F60 */ Mod1Mask,       "\033[24;3~",    0,    0},
+	{ XK_F13,           XK_NO_MOD,      "\033[1;2P",     0,    0},
+	{ XK_F14,           XK_NO_MOD,      "\033[1;2Q",     0,    0},
+	{ XK_F15,           XK_NO_MOD,      "\033[1;2R",     0,    0},
+	{ XK_F16,           XK_NO_MOD,      "\033[1;2S",     0,    0},
+	{ XK_F17,           XK_NO_MOD,      "\033[15;2~",    0,    0},
+	{ XK_F18,           XK_NO_MOD,      "\033[17;2~",    0,    0},
+	{ XK_F19,           XK_NO_MOD,      "\033[18;2~",    0,    0},
+	{ XK_F20,           XK_NO_MOD,      "\033[19;2~",    0,    0},
+	{ XK_F21,           XK_NO_MOD,      "\033[20;2~",    0,    0},
+	{ XK_F22,           XK_NO_MOD,      "\033[21;2~",    0,    0},
+	{ XK_F23,           XK_NO_MOD,      "\033[23;2~",    0,    0},
+	{ XK_F24,           XK_NO_MOD,      "\033[24;2~",    0,    0},
+	{ XK_F25,           XK_NO_MOD,      "\033[1;5P",     0,    0},
+	{ XK_F26,           XK_NO_MOD,      "\033[1;5Q",     0,    0},
+	{ XK_F27,           XK_NO_MOD,      "\033[1;5R",     0,    0},
+	{ XK_F28,           XK_NO_MOD,      "\033[1;5S",     0,    0},
+	{ XK_F29,           XK_NO_MOD,      "\033[15;5~",    0,    0},
+	{ XK_F30,           XK_NO_MOD,      "\033[17;5~",    0,    0},
+	{ XK_F31,           XK_NO_MOD,      "\033[18;5~",    0,    0},
+	{ XK_F32,           XK_NO_MOD,      "\033[19;5~",    0,    0},
+	{ XK_F33,           XK_NO_MOD,      "\033[20;5~",    0,    0},
+	{ XK_F34,           XK_NO_MOD,      "\033[21;5~",    0,    0},
+	{ XK_F35,           XK_NO_MOD,      "\033[23;5~",    0,    0},
+};
+
+/*
+ * Selection types' masks.
+ * Use the same masks as usual.
+ * Button1Mask is always unset, to make masks match between ButtonPress.
+ * ButtonRelease and MotionNotify.
+ * If no match is found, regular selection is used.
+ */
+static uint selmasks[] = {
+	[SEL_RECTANGULAR] = Mod1Mask,
+};
+
+/*
+ * Printable characters in ASCII, used to estimate the advance width
+ * of single wide characters.
+ */
+static char ascii_printable[] =
+	" !\"#$%&'()*+,-./0123456789:;<=>?"
+	"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
+	"`abcdefghijklmnopqrstuvwxyz{|}~";

+ 28 - 0
st/config.mk

@@ -0,0 +1,28 @@
+# st version
+VERSION = 0.8.1
+
+# Customize below to fit your system
+
+# paths
+PREFIX = /usr/local
+MANPREFIX = $(PREFIX)/share/man
+
+X11INC = /usr/X11R6/include
+X11LIB = /usr/X11R6/lib
+
+# includes and libs
+INCS = -I$(X11INC) \
+       `pkg-config --cflags fontconfig` \
+       `pkg-config --cflags freetype2`
+LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \
+       `pkg-config --libs fontconfig` \
+       `pkg-config --libs freetype2`
+
+# flags
+CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600
+STCFLAGS = $(INCS) $(CPPFLAGS) $(CFLAGS)
+STLDFLAGS = $(LIBS) $(LDFLAGS)
+
+# compiler and linker
+# CC = c99
+

BIN
st/st


+ 13 - 0
st/st-clipboard-0.8.1.diff

@@ -0,0 +1,13 @@
+diff --git a/x.c b/x.c
+index c343ba2..f2a4f65 100644
+--- a/x.c
++++ b/x.c
+@@ -627,6 +627,8 @@ setsel(char *str, Time t)
+ 	XSetSelectionOwner(xw.dpy, XA_PRIMARY, xw.win, t);
+ 	if (XGetSelectionOwner(xw.dpy, XA_PRIMARY) != xw.win)
+ 		selclear();
++
++	clipcopy(NULL);
+ }
+ 
+ void

+ 88 - 0
st/st-hidecursor-0.8.1.diff

@@ -0,0 +1,88 @@
+diff --git a/x.c b/x.c
+index c343ba2..a40de8c 100644
+--- a/x.c
++++ b/x.c
+@@ -96,6 +96,11 @@ typedef struct {
+ 	Draw draw;
+ 	Visual *vis;
+ 	XSetWindowAttributes attrs;
++	/* Here, we use the term *pointer* to differentiate the cursor
++	 * one sees when hovering the mouse over the terminal from, e.g.,
++	 * a green rectangle where text would be entered. */
++	Cursor vpointer, bpointer; /* visible and hidden pointers */
++	int pointerisvisible;
+ 	int scr;
+ 	int isfixed; /* is fixed geometry? */
+ 	int l, t; /* left and top offset */
+@@ -652,6 +657,13 @@ brelease(XEvent *e)
+ void
+ bmotion(XEvent *e)
+ {
++	if (!xw.pointerisvisible) {
++		XDefineCursor(xw.dpy, xw.win, xw.vpointer);
++		xw.pointerisvisible = 1;
++		if (!IS_SET(MODE_MOUSEMANY))
++			xsetpointermotion(0);
++	}
++
+ 	if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) {
+ 		mousereport(e);
+ 		return;
+@@ -997,10 +1009,10 @@ void
+ xinit(int cols, int rows)
+ {
+ 	XGCValues gcvalues;
+-	Cursor cursor;
+ 	Window parent;
+ 	pid_t thispid = getpid();
+ 	XColor xmousefg, xmousebg;
++	Pixmap blankpm;
+ 
+ 	if (!(xw.dpy = XOpenDisplay(NULL)))
+ 		die("Can't open display\n");
+@@ -1076,8 +1088,9 @@ xinit(int cols, int rows)
+ 		die("XCreateIC failed. Could not obtain input method.\n");
+ 
+ 	/* white cursor, black outline */
+-	cursor = XCreateFontCursor(xw.dpy, mouseshape);
+-	XDefineCursor(xw.dpy, xw.win, cursor);
++	xw.pointerisvisible = 1;
++	xw.vpointer = XCreateFontCursor(xw.dpy, mouseshape);
++	XDefineCursor(xw.dpy, xw.win, xw.vpointer);
+ 
+ 	if (XParseColor(xw.dpy, xw.cmap, colorname[mousefg], &xmousefg) == 0) {
+ 		xmousefg.red   = 0xffff;
+@@ -1091,7 +1104,10 @@ xinit(int cols, int rows)
+ 		xmousebg.blue  = 0x0000;
+ 	}
+ 
+-	XRecolorCursor(xw.dpy, cursor, &xmousefg, &xmousebg);
++	XRecolorCursor(xw.dpy, xw.vpointer, &xmousefg, &xmousebg);
++	blankpm = XCreateBitmapFromData(xw.dpy, xw.win, &(char){0}, 1, 1);
++	xw.bpointer = XCreatePixmapCursor(xw.dpy, blankpm, blankpm,
++					  &xmousefg, &xmousebg, 0, 0);
+ 
+ 	xw.xembed = XInternAtom(xw.dpy, "_XEMBED", False);
+ 	xw.wmdeletewin = XInternAtom(xw.dpy, "WM_DELETE_WINDOW", False);
+@@ -1574,6 +1590,8 @@ unmap(XEvent *ev)
+ void
+ xsetpointermotion(int set)
+ {
++	if (!set && !xw.pointerisvisible)
++		return;
+ 	MODBIT(xw.attrs.event_mask, set, PointerMotionMask);
+ 	XChangeWindowAttributes(xw.dpy, xw.win, CWEventMask, &xw.attrs);
+ }
+@@ -1692,6 +1710,12 @@ kpress(XEvent *ev)
+ 	Status status;
+ 	Shortcut *bp;
+ 
++	if (xw.pointerisvisible) {
++		XDefineCursor(xw.dpy, xw.win, xw.bpointer);
++		xsetpointermotion(1);
++		xw.pointerisvisible = 0;
++	}
++
+ 	if (IS_SET(MODE_KBDLOCK))
+ 		return;
+ 

+ 348 - 0
st/st-scrollback-0.8.diff

@@ -0,0 +1,348 @@
+diff --git a/config.def.h b/config.def.h
+index 82b1b09..27d42ca 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -178,6 +178,8 @@ static Shortcut shortcuts[] = {
+ 	{ TERMMOD,              XK_Y,           selpaste,       {.i =  0} },
+ 	{ TERMMOD,              XK_Num_Lock,    numlock,        {.i =  0} },
+ 	{ TERMMOD,              XK_I,           iso14755,       {.i =  0} },
++	{ ShiftMask,            XK_Page_Up,     kscrollup,      {.i = -1} },
++	{ ShiftMask,            XK_Page_Down,   kscrolldown,    {.i = -1} },
+ };
+ 
+ /*
+diff --git a/st.c b/st.c
+index 65a0cb6..1d8c12a 100644
+--- a/st.c
++++ b/st.c
+@@ -121,6 +121,9 @@ typedef struct {
+ 	int col;      /* nb col */
+ 	Line *line;   /* screen */
+ 	Line *alt;    /* alternate screen */
++	Line hist[HISTSIZE]; /* history buffer */
++	int histi;    /* history index */
++	int scr;      /* scroll back */
+ 	int *dirty;   /* dirtyness of lines */
+ 	TCursor c;    /* cursor */
+ 	int ocx;      /* old cursor col */
+@@ -188,8 +191,8 @@ static void tnewline(int);
+ static void tputtab(int);
+ static void tputc(Rune);
+ static void treset(void);
+-static void tscrollup(int, int);
+-static void tscrolldown(int, int);
++static void tscrollup(int, int, int);
++static void tscrolldown(int, int, int);
+ static void tsetattr(int *, int);
+ static void tsetchar(Rune, Glyph *, int, int);
+ static void tsetdirt(int, int);
+@@ -431,10 +434,10 @@ tlinelen(int y)
+ {
+ 	int i = term.col;
+ 
+-	if (term.line[y][i - 1].mode & ATTR_WRAP)
++	if (TLINE(y)[i - 1].mode & ATTR_WRAP)
+ 		return i;
+ 
+-	while (i > 0 && term.line[y][i - 1].u == ' ')
++	while (i > 0 && TLINE(y)[i - 1].u == ' ')
+ 		--i;
+ 
+ 	return i;
+@@ -543,7 +546,7 @@ selsnap(int *x, int *y, int direction)
+ 		 * Snap around if the word wraps around at the end or
+ 		 * beginning of a line.
+ 		 */
+-		prevgp = &term.line[*y][*x];
++		prevgp = &TLINE(*y)[*x];
+ 		prevdelim = ISDELIM(prevgp->u);
+ 		for (;;) {
+ 			newx = *x + direction;
+@@ -558,14 +561,14 @@ selsnap(int *x, int *y, int direction)
+ 					yt = *y, xt = *x;
+ 				else
+ 					yt = newy, xt = newx;
+-				if (!(term.line[yt][xt].mode & ATTR_WRAP))
++				if (!(TLINE(yt)[xt].mode & ATTR_WRAP))
+ 					break;
+ 			}
+ 
+ 			if (newx >= tlinelen(newy))
+ 				break;
+ 
+-			gp = &term.line[newy][newx];
++			gp = &TLINE(newy)[newx];
+ 			delim = ISDELIM(gp->u);
+ 			if (!(gp->mode & ATTR_WDUMMY) && (delim != prevdelim
+ 					|| (delim && gp->u != prevgp->u)))
+@@ -586,14 +589,14 @@ selsnap(int *x, int *y, int direction)
+ 		*x = (direction < 0) ? 0 : term.col - 1;
+ 		if (direction < 0) {
+ 			for (; *y > 0; *y += direction) {
+-				if (!(term.line[*y-1][term.col-1].mode
++				if (!(TLINE(*y-1)[term.col-1].mode
+ 						& ATTR_WRAP)) {
+ 					break;
+ 				}
+ 			}
+ 		} else if (direction > 0) {
+ 			for (; *y < term.row-1; *y += direction) {
+-				if (!(term.line[*y][term.col-1].mode
++				if (!(TLINE(*y)[term.col-1].mode
+ 						& ATTR_WRAP)) {
+ 					break;
+ 				}
+@@ -624,13 +627,13 @@ getsel(void)
+ 		}
+ 
+ 		if (sel.type == SEL_RECTANGULAR) {
+-			gp = &term.line[y][sel.nb.x];
++			gp = &TLINE(y)[sel.nb.x];
+ 			lastx = sel.ne.x;
+ 		} else {
+-			gp = &term.line[y][sel.nb.y == y ? sel.nb.x : 0];
++			gp = &TLINE(y)[sel.nb.y == y ? sel.nb.x : 0];
+ 			lastx = (sel.ne.y == y) ? sel.ne.x : term.col-1;
+ 		}
+-		last = &term.line[y][MIN(lastx, linelen-1)];
++		last = &TLINE(y)[MIN(lastx, linelen-1)];
+ 		while (last >= gp && last->u == ' ')
+ 			--last;
+ 
+@@ -836,6 +839,9 @@ ttyread(void)
+ 	if (buflen > 0)
+ 		memmove(buf, buf + written, buflen);
+ 
++	if (term.scr > 0 && term.scr < HISTSIZE-1)
++		term.scr++;
++
+ 	return ret;
+ }
+