From 76437e17a402701329abf71cbb8da030d00eb5b1 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Wed, 6 Jan 2016 11:55:04 -0600 Subject: [PATCH] initial commit --- .gitignore | 2 + aur/arch_setup.bash | 23 +++ colors/gen/gen.bash | 27 +++ colors/gen/schemes/donokai.yml | 19 ++ colors/link.bash | 12 ++ colors/shell | 125 ++++++++++++ colors/vim | 316 +++++++++++++++++++++++++++++ colors/xresources | 41 ++++ de/arch_setup.bash | 22 ++ de/bspwm_config | 28 +++ de/bspwmrc | 9 + de/link.bash | 10 + de/sxhkdrc | 176 ++++++++++++++++ fonts/arch_setup.bash | 20 ++ git/arch_setup.bash | 4 + git/gitconfig | 6 + git/link.bash | 8 + scripts/get_color.sh | 9 + scripts/set_sh_font.sh | 8 + scripts/sxhkd_helpers.sh | 0 sh/arch_setup.bash | 4 + sh/bash_profile | 6 + sh/bashrc | 58 ++++++ sh/link.bash | 16 ++ sh/tmux.conf | 0 term/arch_setup.bash | 4 + variables.bash | 14 ++ vim/arch_setup.bash | 17 ++ vim/config/.gitignore | 3 + vim/config/colors/current.vim | 1 + vim/config/init.vim | 356 +++++++++++++++++++++++++++++++++ vim/link.bash | 10 + x/.xinitrc | 52 +++++ x/arch_setup.bash | 4 + x/link.bash | 10 + x/xinitrc | 42 ++++ x/xresources | 20 ++ 37 files changed, 1482 insertions(+) create mode 100644 .gitignore create mode 100755 aur/arch_setup.bash create mode 100755 colors/gen/gen.bash create mode 100644 colors/gen/schemes/donokai.yml create mode 100755 colors/link.bash create mode 100644 colors/shell create mode 100644 colors/vim create mode 100644 colors/xresources create mode 100755 de/arch_setup.bash create mode 100755 de/bspwm_config create mode 100755 de/bspwmrc create mode 100755 de/link.bash create mode 100755 de/sxhkdrc create mode 100755 fonts/arch_setup.bash create mode 100644 git/arch_setup.bash create mode 100644 git/gitconfig create mode 100755 git/link.bash create mode 100644 scripts/get_color.sh create mode 100644 scripts/set_sh_font.sh create mode 100644 scripts/sxhkd_helpers.sh create mode 100755 sh/arch_setup.bash create mode 100644 sh/bash_profile create mode 100644 sh/bashrc create mode 100755 sh/link.bash create mode 100644 sh/tmux.conf create mode 100755 term/arch_setup.bash create mode 100644 variables.bash create mode 100755 vim/arch_setup.bash create mode 100644 vim/config/.gitignore create mode 120000 vim/config/colors/current.vim create mode 100644 vim/config/init.vim create mode 100755 vim/link.bash create mode 100644 x/.xinitrc create mode 100755 x/arch_setup.bash create mode 100755 x/link.bash create mode 100644 x/xinitrc create mode 100755 x/xresources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6f2c19e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +colors/gen/vendor +colors/gen/tmp diff --git a/aur/arch_setup.bash b/aur/arch_setup.bash new file mode 100755 index 0000000..a16c90c --- /dev/null +++ b/aur/arch_setup.bash @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )/.." && pwd) +source "$DIR/variables.bash" + +sudo pacman -S curl openssl perl expac yajl --noconfirm + +# receive cower's gpg key +gpg --recv-keys 1EB2638FF56C0C53 + +mkdir -p "$REPOSITORY_PATH" + +git clone https://aur.archlinux.org/cower.git "$REPOSITORY_PATH/cower" +git clone https://aur.archlinux.org/pacaur.git "$REPOSITORY_PATH/pacaur" + +cd "$REPOSITORY_PATH/cower" +makepkg -i --noconfirm +cd - + +cd "$REPOSITORY_PATH/pacaur" +makepkg -i --noconfirm +cd - + diff --git a/colors/gen/gen.bash b/colors/gen/gen.bash new file mode 100755 index 0000000..9847bdb --- /dev/null +++ b/colors/gen/gen.bash @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )/../.." && pwd) +source "$DIR/variables.bash" + +mkdir -p "$DOTFILES_PATH/colors/gen/vendor" + +B16_DIR="$DOTFILES_PATH/colors/gen/vendor/base16-builder" +if [ -d "$B16_DIR" ]; then + echo "Skipping repo pull down..." +else + git clone https://github.com/lytedev/base16-builder.git "$DOTFILES_PATH/colors/gen/vendor/base16-builder" +fi + +cd "$DOTFILES_PATH/colors/gen/schemes" +cp * "$DOTFILES_PATH/colors/gen/vendor/base16-builder/schemes" +cd - + +"$DOTFILES_PATH/colors/gen/vendor/base16-builder/base16" -t vim +"$DOTFILES_PATH/colors/gen/vendor/base16-builder/base16" -t xresources +"$DOTFILES_PATH/colors/gen/vendor/base16-builder/base16" -t shell + +COLORS_PATH=$DOTFILES_PATH/colors/gen/vendor/base16-builder/output +cp "$COLORS_PATH/xresources/base16-donokai.dark.xresources" "$DOTFILES_PATH/colors/xresources" +cp "$COLORS_PATH/vim/base16-donokai.vim" "$DOTFILES_PATH/colors/vim" +cp "$COLORS_PATH/shell/base16-donokai.dark.sh" "$DOTFILES_PATH/colors/shell" + diff --git a/colors/gen/schemes/donokai.yml b/colors/gen/schemes/donokai.yml new file mode 100644 index 0000000..af0ee0f --- /dev/null +++ b/colors/gen/schemes/donokai.yml @@ -0,0 +1,19 @@ +scheme: "Donokai" +author: "Wimer Hazenberg (http://www.monokai.nl)" +base00: "111111" +base01: "383830" +base02: "49483e" +base03: "75715e" +base04: "a59f85" +base05: "f8f8f2" +base06: "f5f4f1" +base07: "f9f8f5" +base08: "f92672" +base09: "fd971f" +base0A: "f4bf75" +base0B: "a6e22e" +base0C: "a1efe4" +base0D: "66d9ef" +base0E: "ae81ff" +base0F: "cc6633" + diff --git a/colors/link.bash b/colors/link.bash new file mode 100755 index 0000000..729ae55 --- /dev/null +++ b/colors/link.bash @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )/.." && pwd) +source "$DIR/variables.bash" + +rm -f ~/.Xresources.colors +rm -f "$DOTFILES_PATH/vim/config/colors/current.vim" +ln -s "$DOTFILES_PATH/colors/xresources" "$HOME/.Xresources.colors" +ln -s "$DOTFILES_PATH/colors/vim" "$DOTFILES_PATH/vim/config/colors/current.vim" + +xrdb ~/.Xresources + diff --git a/colors/shell b/colors/shell new file mode 100644 index 0000000..42b57c5 --- /dev/null +++ b/colors/shell @@ -0,0 +1,125 @@ +#!/bin/sh +# Base16 Donokai - Shell color setup script +# Wimer Hazenberg (http://www.monokai.nl) + +if [ "${TERM%%-*}" = 'linux' ]; then + # This script doesn't support linux console (use 'vconsole' template instead) + return 2>/dev/null || exit 0 +fi + +color00="11/11/11" # Base 00 - Black +color01="f9/26/72" # Base 08 - Red +color02="a6/e2/2e" # Base 0B - Green +color03="f4/bf/75" # Base 0A - Yellow +color04="66/d9/ef" # Base 0D - Blue +color05="ae/81/ff" # Base 0E - Magenta +color06="a1/ef/e4" # Base 0C - Cyan +color07="f8/f8/f2" # Base 05 - White +color08="75/71/5e" # Base 03 - Bright Black +color09=$color01 # Base 08 - Bright Red +color10=$color02 # Base 0B - Bright Green +color11=$color03 # Base 0A - Bright Yellow +color12=$color04 # Base 0D - Bright Blue +color13=$color05 # Base 0E - Bright Magenta +color14=$color06 # Base 0C - Bright Cyan +color15="f9/f8/f5" # Base 07 - Bright White +color16="fd/97/1f" # Base 09 +color17="cc/66/33" # Base 0F +color18="38/38/30" # Base 01 +color19="49/48/3e" # Base 02 +color20="a5/9f/85" # Base 04 +color21="f5/f4/f1" # Base 06 +color_foreground="f8/f8/f2" # Base 05 +color_background="11/11/11" # Base 00 +color_cursor="f8/f8/f2" # Base 05 + +if [ -n "$TMUX" ]; then + # tell tmux to pass the escape sequences through + # (Source: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324) + printf_template="\033Ptmux;\033\033]4;%d;rgb:%s\007\033\\" + printf_template_var="\033Ptmux;\033\033]%d;rgb:%s\007\033\\" + printf_template_custom="\033Ptmux;\033\033]%s%s\007\033\\" +elif [ "${TERM%%-*}" = "screen" ]; then + # GNU screen (screen, screen-256color, screen-256color-bce) + printf_template="\033P\033]4;%d;rgb:%s\007\033\\" + printf_template_var="\033P\033]%d;rgb:%s\007\033\\" + printf_template_custom="\033P\033]%s%s\007\033\\" +elif [[ $- != *i* ]]; then + # non-interactive + alias printf=/bin/false +else + printf_template="\033]4;%d;rgb:%s\033\\" + printf_template_var="\033]%d;rgb:%s\033\\" + printf_template_custom="\033]%s%s\033\\" +fi + +# 16 color space +printf $printf_template 0 $color00 +printf $printf_template 1 $color01 +printf $printf_template 2 $color02 +printf $printf_template 3 $color03 +printf $printf_template 4 $color04 +printf $printf_template 5 $color05 +printf $printf_template 6 $color06 +printf $printf_template 7 $color07 +printf $printf_template 8 $color08 +printf $printf_template 9 $color09 +printf $printf_template 10 $color10 +printf $printf_template 11 $color11 +printf $printf_template 12 $color12 +printf $printf_template 13 $color13 +printf $printf_template 14 $color14 +printf $printf_template 15 $color15 + +# 256 color space +printf $printf_template 16 $color16 +printf $printf_template 17 $color17 +printf $printf_template 18 $color18 +printf $printf_template 19 $color19 +printf $printf_template 20 $color20 +printf $printf_template 21 $color21 + +# foreground / background / cursor color +if [ -n "$ITERM_SESSION_ID" ]; then + # iTerm2 proprietary escape codes + printf $printf_template_custom Pg f8f8f2 # forground + printf $printf_template_custom Ph 111111 # background + printf $printf_template_custom Pi f8f8f2 # bold color + printf $printf_template_custom Pj 49483e # selection color + printf $printf_template_custom Pk f8f8f2 # selected text color + printf $printf_template_custom Pl f8f8f2 # cursor + printf $printf_template_custom Pm 111111 # cursor text +else + printf $printf_template_var 10 $color_foreground + printf $printf_template_var 11 $color_background + printf $printf_template_custom 12 ";7" # cursor (reverse video) +fi + +# clean up +unset printf_template +unset printf_template_var +unset color00 +unset color01 +unset color02 +unset color03 +unset color04 +unset color05 +unset color06 +unset color07 +unset color08 +unset color09 +unset color10 +unset color11 +unset color12 +unset color13 +unset color14 +unset color15 +unset color16 +unset color17 +unset color18 +unset color19 +unset color20 +unset color21 +unset color_foreground +unset color_background +unset color_cursor diff --git a/colors/vim b/colors/vim new file mode 100644 index 0000000..a1b330b --- /dev/null +++ b/colors/vim @@ -0,0 +1,316 @@ +" Base16 Donokai (https://github.com/chriskempson/base16) +" Scheme: Wimer Hazenberg (http://www.monokai.nl) + +" This enables the coresponding base16-shell script to run so that +" :colorscheme works in terminals supported by base16-shell scripts +" User must set this variable in .vimrc +" let g:base16_shell_path=base16-builder/output/shell/ +if !has('gui_running') + if exists("g:base16_shell_path") + execute "silent !/bin/sh ".g:base16_shell_path."/base16-donokai.".&background.".sh" + endif +endif + +" GUI color definitions +let s:gui00 = "111111" +let s:gui01 = "383830" +let s:gui02 = "49483e" +let s:gui03 = "75715e" +let s:gui04 = "a59f85" +let s:gui05 = "f8f8f2" +let s:gui06 = "f5f4f1" +let s:gui07 = "f9f8f5" +let s:gui08 = "f92672" +let s:gui09 = "fd971f" +let s:gui0A = "f4bf75" +let s:gui0B = "a6e22e" +let s:gui0C = "a1efe4" +let s:gui0D = "66d9ef" +let s:gui0E = "ae81ff" +let s:gui0F = "cc6633" + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists('base16colorspace') && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +" Theme setup +hi clear +syntax reset +let g:colors_name = "base16-donokai" + +" Highlighting function +fun hi(group, guifg, guibg, ctermfg, ctermbg, attr, guisp) + if a:guifg != "" + exec "hi " . a:group . " guifg=#" . s:gui(a:guifg) + endif + if a:guibg != "" + exec "hi " . a:group . " guibg=#" . s:gui(a:guibg) + endif + if a:ctermfg != "" + exec "hi " . a:group . " ctermfg=" . s:cterm(a:ctermfg) + endif + if a:ctermbg != "" + exec "hi " . a:group . " ctermbg=" . s:cterm(a:ctermbg) + endif + if a:attr != "" + exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr + endif + if a:guisp != "" + exec "hi " . a:group . " guisp=#" . a:guisp + endif +endfun + +" Return GUI color for light/dark variants +fun s:gui(color) + if &background == "dark" + return a:color + endif + + if a:color == s:gui00 + return s:gui07 + elseif a:color == s:gui01 + return s:gui06 + elseif a:color == s:gui02 + return s:gui05 + elseif a:color == s:gui03 + return s:gui04 + elseif a:color == s:gui04 + return s:gui03 + elseif a:color == s:gui05 + return s:gui02 + elseif a:color == s:gui06 + return s:gui01 + elseif a:color == s:gui07 + return s:gui00 + endif + + return a:color +endfun + +" Return terminal color for light/dark variants +fun s:cterm(color) + if &background == "dark" + return a:color + endif + + if a:color == s:cterm00 + return s:cterm07 + elseif a:color == s:cterm01 + return s:cterm06 + elseif a:color == s:cterm02 + return s:cterm05 + elseif a:color == s:cterm03 + return s:cterm04 + elseif a:color == s:cterm04 + return s:cterm03 + elseif a:color == s:cterm05 + return s:cterm02 + elseif a:color == s:cterm06 + return s:cterm01 + elseif a:color == s:cterm07 + return s:cterm00 + endif + + return a:color +endfun + +" Vim editor colors +call hi("Bold", "", "", "", "", "bold", "") +call hi("Debug", s:gui08, "", s:cterm08, "", "", "") +call hi("Directory", s:gui0D, "", s:cterm0D, "", "", "") +call hi("Error", s:gui00, s:gui08, s:cterm00, s:cterm08, "", "") +call hi("ErrorMsg", s:gui08, s:gui00, s:cterm08, s:cterm00, "", "") +call hi("Exception", s:gui08, "", s:cterm08, "", "", "") +call hi("FoldColumn", s:gui0C, s:gui01, s:cterm0C, s:cterm01, "", "") +call hi("Folded", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "") +call hi("IncSearch", s:gui01, s:gui09, s:cterm01, s:cterm09, "none", "") +call hi("Italic", "", "", "", "", "none", "") +call hi("Macro", s:gui08, "", s:cterm08, "", "", "") +call hi("MatchParen", s:gui00, s:gui03, s:cterm00, s:cterm03, "", "") +call hi("ModeMsg", s:gui0B, "", s:cterm0B, "", "", "") +call hi("MoreMsg", s:gui0B, "", s:cterm0B, "", "", "") +call hi("Question", s:gui0D, "", s:cterm0D, "", "", "") +call hi("Search", s:gui03, s:gui0A, s:cterm03, s:cterm0A, "", "") +call hi("SpecialKey", s:gui03, "", s:cterm03, "", "", "") +call hi("TooLong", s:gui08, "", s:cterm08, "", "", "") +call hi("Underlined", s:gui08, "", s:cterm08, "", "", "") +call hi("Visual", "", s:gui02, "", s:cterm02, "", "") +call hi("VisualNOS", s:gui08, "", s:cterm08, "", "", "") +call hi("WarningMsg", s:gui08, "", s:cterm08, "", "", "") +call hi("WildMenu", s:gui08, s:gui0A, s:cterm08, "", "", "") +call hi("Title", s:gui0D, "", s:cterm0D, "", "none", "") +call hi("Conceal", s:gui0D, s:gui00, s:cterm0D, s:cterm00, "", "") +call hi("Cursor", s:gui00, s:gui05, s:cterm00, s:cterm05, "", "") +call hi("NonText", s:gui03, "", s:cterm03, "", "", "") +call hi("Normal", s:gui05, s:gui00, s:cterm05, s:cterm00, "", "") +call hi("LineNr", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "") +call hi("SignColumn", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "") +call hi("StatusLine", s:gui04, s:gui02, s:cterm04, s:cterm02, "none", "") +call hi("StatusLineNC", s:gui03, s:gui01, s:cterm03, s:cterm01, "none", "") +call hi("VertSplit", s:gui02, s:gui02, s:cterm02, s:cterm02, "none", "") +call hi("ColorColumn", "", s:gui01, "", s:cterm01, "none", "") +call hi("CursorColumn", "", s:gui01, "", s:cterm01, "none", "") +call hi("CursorLine", "", s:gui01, "", s:cterm01, "none", "") +call hi("CursorLineNr", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "") +call hi("PMenu", s:gui04, s:gui01, s:cterm04, s:cterm01, "none", "") +call hi("PMenuSel", s:gui01, s:gui04, s:cterm01, s:cterm04, "", "") +call hi("TabLine", s:gui03, s:gui01, s:cterm03, s:cterm01, "none", "") +call hi("TabLineFill", s:gui03, s:gui01, s:cterm03, s:cterm01, "none", "") +call hi("TabLineSel", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "none", "") + +" Standard syntax highlighting +call hi("Boolean", s:gui09, "", s:cterm09, "", "", "") +call hi("Character", s:gui08, "", s:cterm08, "", "", "") +call hi("Comment", s:gui03, "", s:cterm03, "", "", "") +call hi("Conditional", s:gui0E, "", s:cterm0E, "", "", "") +call hi("Constant", s:gui09, "", s:cterm09, "", "", "") +call hi("Define", s:gui0E, "", s:cterm0E, "", "none", "") +call hi("Delimiter", s:gui0F, "", s:cterm0F, "", "", "") +call hi("Float", s:gui09, "", s:cterm09, "", "", "") +call hi("Function", s:gui0D, "", s:cterm0D, "", "", "") +call hi("Identifier", s:gui08, "", s:cterm08, "", "none", "") +call hi("Include", s:gui0D, "", s:cterm0D, "", "", "") +call hi("Keyword", s:gui0E, "", s:cterm0E, "", "", "") +call hi("Label", s:gui0A, "", s:cterm0A, "", "", "") +call hi("Number", s:gui09, "", s:cterm09, "", "", "") +call hi("Operator", s:gui05, "", s:cterm05, "", "none", "") +call hi("PreProc", s:gui0A, "", s:cterm0A, "", "", "") +call hi("Repeat", s:gui0A, "", s:cterm0A, "", "", "") +call hi("Special", s:gui0C, "", s:cterm0C, "", "", "") +call hi("SpecialChar", s:gui0F, "", s:cterm0F, "", "", "") +call hi("Statement", s:gui08, "", s:cterm08, "", "", "") +call hi("StorageClass", s:gui0A, "", s:cterm0A, "", "", "") +call hi("String", s:gui0B, "", s:cterm0B, "", "", "") +call hi("Structure", s:gui0E, "", s:cterm0E, "", "", "") +call hi("Tag", s:gui0A, "", s:cterm0A, "", "", "") +call hi("Todo", s:gui0A, s:gui01, s:cterm0A, s:cterm01, "", "") +call hi("Type", s:gui0A, "", s:cterm0A, "", "none", "") +call hi("Typedef", s:gui0A, "", s:cterm0A, "", "", "") + +" C highlighting +call hi("cOperator", s:gui0C, "", s:cterm0C, "", "", "") +call hi("cPreCondit", s:gui0E, "", s:cterm0E, "", "", "") + +" C# highlighting +call hi("csClass", s:gui0A, "", s:cterm0A, "", "", "") +call hi("csAttribute", s:gui0A, "", s:cterm0A, "", "", "") +call hi("csModifier", s:gui0E, "", s:cterm0E, "", "", "") +call hi("csType", s:gui08, "", s:cterm08, "", "", "") +call hi("csUnspecifiedStatement", s:gui0D, "", s:cterm0D, "", "", "") +call hi("csContextualStatement", s:gui0E, "", s:cterm0E, "", "", "") +call hi("csNewDecleration", s:gui08, "", s:cterm08, "", "", "") + +" CSS highlighting +call hi("cssBraces", s:gui05, "", s:cterm05, "", "", "") +call hi("cssClassName", s:gui0E, "", s:cterm0E, "", "", "") +call hi("cssColor", s:gui0C, "", s:cterm0C, "", "", "") + +" Diff highlighting +call hi("DiffAdd", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "", "") +call hi("DiffChange", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "") +call hi("DiffDelete", s:gui08, s:gui01, s:cterm08, s:cterm01, "", "") +call hi("DiffText", s:gui0D, s:gui01, s:cterm0D, s:cterm01, "", "") +call hi("DiffAdded", s:gui0B, s:gui00, s:cterm0B, s:cterm00, "", "") +call hi("DiffFile", s:gui08, s:gui00, s:cterm08, s:cterm00, "", "") +call hi("DiffNewFile", s:gui0B, s:gui00, s:cterm0B, s:cterm00, "", "") +call hi("DiffLine", s:gui0D, s:gui00, s:cterm0D, s:cterm00, "", "") +call hi("DiffRemoved", s:gui08, s:gui00, s:cterm08, s:cterm00, "", "") + +" Git highlighting +call hi("gitCommitOverflow", s:gui08, "", s:cterm08, "", "", "") +call hi("gitCommitSummary", s:gui0B, "", s:cterm0B, "", "", "") + +" GitGutter highlighting +call hi("GitGutterAdd", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "", "") +call hi("GitGutterChange", s:gui0D, s:gui01, s:cterm0D, s:cterm01, "", "") +call hi("GitGutterDelete", s:gui08, s:gui01, s:cterm08, s:cterm01, "", "") +call hi("GitGutterChangeDelete", s:gui0E, s:gui01, s:cterm0E, s:cterm01, "", "") + +" HTML highlighting +call hi("htmlBold", s:gui0A, "", s:cterm0A, "", "", "") +call hi("htmlItalic", s:gui0E, "", s:cterm0E, "", "", "") +call hi("htmlEndTag", s:gui05, "", s:cterm05, "", "", "") +call hi("htmlTag", s:gui05, "", s:cterm05, "", "", "") + +" JavaScript highlighting +call hi("javaScript", s:gui05, "", s:cterm05, "", "", "") +call hi("javaScriptBraces", s:gui05, "", s:cterm05, "", "", "") +call hi("javaScriptNumber", s:gui09, "", s:cterm09, "", "", "") + +" Markdown highlighting +call hi("markdownCode", s:gui0B, "", s:cterm0B, "", "", "") +call hi("markdownError", s:gui05, s:gui00, s:cterm05, s:cterm00, "", "") +call hi("markdownCodeBlock", s:gui0B, "", s:cterm0B, "", "", "") +call hi("markdownHeadingDelimiter", s:gui0D, "", s:cterm0D, "", "", "") + +" NERDTree highlighting +call hi("NERDTreeDirSlash", s:gui0D, "", s:cterm0D, "", "", "") +call hi("NERDTreeExecFile", s:gui05, "", s:cterm05, "", "", "") + +" PHP highlighting +call hi("phpMemberSelector", s:gui05, "", s:cterm05, "", "", "") +call hi("phpComparison", s:gui05, "", s:cterm05, "", "", "") +call hi("phpParent", s:gui05, "", s:cterm05, "", "", "") + +" Python highlighting +call hi("pythonOperator", s:gui0E, "", s:cterm0E, "", "", "") +call hi("pythonRepeat", s:gui0E, "", s:cterm0E, "", "", "") + +" Ruby highlighting +call hi("rubyAttribute", s:gui0D, "", s:cterm0D, "", "", "") +call hi("rubyConstant", s:gui0A, "", s:cterm0A, "", "", "") +call hi("rubyInterpolation", s:gui0B, "", s:cterm0B, "", "", "") +call hi("rubyInterpolationDelimiter", s:gui0F, "", s:cterm0F, "", "", "") +call hi("rubyRegexp", s:gui0C, "", s:cterm0C, "", "", "") +call hi("rubySymbol", s:gui0B, "", s:cterm0B, "", "", "") +call hi("rubyStringDelimiter", s:gui0B, "", s:cterm0B, "", "", "") + +" SASS highlighting +call hi("sassidChar", s:gui08, "", s:cterm08, "", "", "") +call hi("sassClassChar", s:gui09, "", s:cterm09, "", "", "") +call hi("sassInclude", s:gui0E, "", s:cterm0E, "", "", "") +call hi("sassMixing", s:gui0E, "", s:cterm0E, "", "", "") +call hi("sassMixinName", s:gui0D, "", s:cterm0D, "", "", "") + +" Signify highlighting +call hi("SignifySignAdd", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "", "") +call hi("SignifySignChange", s:gui0D, s:gui01, s:cterm0D, s:cterm01, "", "") +call hi("SignifySignDelete", s:gui08, s:gui01, s:cterm08, s:cterm01, "", "") + +" Spelling highlighting +call hi("SpellBad", "", s:gui00, "", s:cterm00, "undercurl", s:gui08) +call hi("SpellLocal", "", s:gui00, "", s:cterm00, "undercurl", s:gui0C) +call hi("SpellCap", "", s:gui00, "", s:cterm00, "undercurl", s:gui0D) +call hi("SpellRare", "", s:gui00, "", s:cterm00, "undercurl", s:gui0E) + +" Remove functions +delf hi +delf gui +delf cterm + +" Remove color variables +unlet s:gui00 s:gui01 s:gui02 s:gui03 s:gui04 s:gui05 s:gui06 s:gui07 s:gui08 s:gui09 s:gui0A s:gui0B s:gui0C s:gui0D s:gui0E s:gui0F +unlet s:cterm00 s:cterm01 s:cterm02 s:cterm03 s:cterm04 s:cterm05 s:cterm06 s:cterm07 s:cterm08 s:cterm09 s:cterm0A s:cterm0B s:cterm0C s:cterm0D s:cterm0E s:cterm0F diff --git a/colors/xresources b/colors/xresources new file mode 100644 index 0000000..2e09987 --- /dev/null +++ b/colors/xresources @@ -0,0 +1,41 @@ +! Base16 Donokai +! Scheme: Wimer Hazenberg (http://www.monokai.nl) + +#define base00 #111111 +#define base01 #383830 +#define base02 #49483e +#define base03 #75715e +#define base04 #a59f85 +#define base05 #f8f8f2 +#define base06 #f5f4f1 +#define base07 #f9f8f5 +#define base08 #f92672 +#define base09 #fd971f +#define base0A #f4bf75 +#define base0B #a6e22e +#define base0C #a1efe4 +#define base0D #66d9ef +#define base0E #ae81ff +#define base0F #cc6633 + +*foreground: base05 +*background: base00 +*cursorColor: base05 + +*color0: base00 +*color1: base08 +*color2: base0B +*color3: base0A +*color4: base0D +*color5: base0E +*color6: base0C +*color7: base05 + +*color8: base03 +*color9: base09 +*color10: base01 +*color11: base02 +*color12: base04 +*color13: base06 +*color14: base0F +*color15: base07 diff --git a/de/arch_setup.bash b/de/arch_setup.bash new file mode 100755 index 0000000..047c14c --- /dev/null +++ b/de/arch_setup.bash @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )/.." && pwd) +source "$DIR/variables.bash" + +sudo pacman -S xcb-util xcb-util-keysyms xcb-util-wm --noconfirm + +mkdir -p "$REPOSITORY_PATH" + +git clone https://github.com/baskerville/bspwm.git "$REPOSITORY_PATH/bspwm" +git clone https://github.com/baskerville/sxhkd.git "$REPOSITORY_PATH/sxhkd" + +cd "$REPOSITORY_PATH/bspwm" +make +sudo make install +cd - + +cd "$REPOSITORY_PATH/sxhkd" +make +sudo make install +cd - + diff --git a/de/bspwm_config b/de/bspwm_config new file mode 100755 index 0000000..0f352d5 --- /dev/null +++ b/de/bspwm_config @@ -0,0 +1,28 @@ +#!/usr/bin/env sh + +source "$DOTFILES_PATH/variables.bash" +source "$DOTFILES_PATH/scripts/get_color.sh" + +bspc config normal_border_color "#$(get_color 05)" +bspc config focused_border_color "#$(get_color 0D)" +bspc config active_border_color "#$(get_color 0D)" +bspc config border_width "$BORDER_WIDTH" +bspc config split_ratio 0.50 +bspc config borderless_monocle true +bspc config gapless_monocle true +bspc config focus_by_distance true + +bspc config window_gap "$WINDOW_GAP" + +MONITOR_COUNT=$(bspc query -M | wc -l | awk '{ printf $1 }') +PER_MONITOR=$((10 / MONITOR_COUNT)) +i=1 +for mon in $(bspc query -M); do + echo $mon + echo $i + max=$((i + PER_MONITOR - 1)) + echo $max + bspc monitor "$mon" -d $(seq $i $max) + i=$((max + 1)) +done + diff --git a/de/bspwmrc b/de/bspwmrc new file mode 100755 index 0000000..75a661e --- /dev/null +++ b/de/bspwmrc @@ -0,0 +1,9 @@ +#!/usr/bin/env sh + +source "$DOTFILES_PATH/variables.bash" + +source "$DOTFILES_PATH/de/bspwm_config" + +sxhkd & +urxvtd & + diff --git a/de/link.bash b/de/link.bash new file mode 100755 index 0000000..e4a6944 --- /dev/null +++ b/de/link.bash @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )/.." && pwd) +source "$DIR/variables.bash" + +rm -f "$HOME/.config/bspwm/bspwmrc" +rm -f "$HOME/.config/sxhkd/sxhkdrc" +ln -s "$DOTFILES_PATH/de/bspwmrc" "$HOME/.config/bspwm/bspwmrc" +ln -s "$DOTFILES_PATH/de/sxhkdrc" "$HOME/.config/sxhkd/sxhkdrc" + diff --git a/de/sxhkdrc b/de/sxhkdrc new file mode 100755 index 0000000..7525795 --- /dev/null +++ b/de/sxhkdrc @@ -0,0 +1,176 @@ +# node manager shortcuts + +# kill the node manager +super + ctrl + Escape + bspc quit + +# kill the current node +super + c + bspc node -c + +# swap layouts +#super + y +# bspc desktop -l next + +# balance node surface area on current desktop +super + b + bspc desktop -B + +# toggle floating/fullscreen modes for current node +super + {s,f} + bspc node -t {floating,fullscreen} + +# focus the last node/desktop +super + {grave,Tab} + bspc {node,desktop} -f last + +# swap positions with the previous node +super + apostrophe + bspc node -s last + +# swap the current node with the biggest node on the current desktop +super + m + bspc node -s biggest + +# move/swap between nodes using vim-style arrows +super + {_,shift + }{h,j,k,l} + bspc node -{f,s} {west,south,north,east} + +# swap previous/next desktops +super + bracket{left,right} + bspc desktop -f {prev,next} + +super + {p,n} + bspc desktop -f {prev,next} + +# rotate node placement on current desktop +super + r + bspc desktop -R 90 + +# preselect the splitting area for the current node +super + ctrl + {h,j,k,l} + bspc node -p {west,south,north,east} + +# clear the splitting area +super + ctrl + {_,shift + }space + bspc {node -p cancel,desktop -c} + +# expand the current node +super + alt + {h,j,k,l} + bspc node -e {left -10,down +10,up -10,right +10} + +# shrink the current node +super + alt + shift + {h,j,k,l} + bspc node -e {right -10,up +10,down -10,left +10} + +# set node split ratio +super + ctrl + {1-9,0} + bspc node -r 0.{1-9,10} + +# focus/move node to the selected desktop +super + {_,shift + }{1-9,0} + bspc {desktop -f,node -d} ^{1-9,10} + +# focus clicked node +~button1 + bspc pointer -g focus + +# mouse controls for node movement and resizing +super + button{1-3} + bspc pointer -g {move,resize_side,resize_corner} + +# simulate mouse2 +shift + super + button1 + bspc pointer -g resize_corner + +# ??? +super + !button{1-3} + bspc pointer -t %i %i + +# ??? +super + @button{1-3} + bspc pointer -u + +# change node gap and desktop padding +super + plus + bspc config -d focused node_gap $((`bspc config -d focused node_gap` + 5 )) + +super + equal + bspc config -m $(bspc query -M | head -n 1) top_padding $BAR_HEIGHT; bspc config -d focused node_gap $node_GAP + +super + minus + bspc config -d focused node_gap $((`bspc config -d focused node_gap` - 5 )) + +super + alt + r + bspc config -m $(bspc query -M | head -n 1) top_padding $BAR_HEIGHT; bspc config -d focused node_gap 0 + +super + alt + plus + bspwm_padding +5 + +super + alt + minus + bspwm_padding -5 + +# wm-independant shortcuts + +# spawn a transparent node +super + alt + t + urxvtc && compton-trans -c -o 0 + +# make current node transparent +super + t + compton-trans -c -o 0 + +# make current node fully opaque +super + shift + t + compton-trans -c -o 100 + +# swap sxhkx config with an alternate file and reload the new one +super + shift + alt + ctrl + r + if [ -e ~/.config/sxhkd/altsxhkdrc ]; then mv ~/.config/sxhkd/sxhkdrc ~/.config/sxhkd/origsxhkdrc && mv ~/.config/sxhkd/altsxhkdrc ~/.config/sxhkd/sxhkdrc && pkill -USR1 -x sxhkd; fi + +# spawn a terminal +super + Return + urxvtc + +# spawn the app launcher +super + space + dmenu_run -fn "$PRIMARY_FONT_FAMILY_WITH_SIZE" -i -nb "#$(get_color 00)" -sb "#$(get_color 00)" -sf "#$(get_color 0A)" -nf "#$(get_color 04)" -h "$BAR_HEIGHT" + +# make sxhkd reload its configuration files: +super + Escape + pkill -USR1 -x sxhkd + +# lock the desktop +super + ctrl + shift + l + slock + +# spawn gui file explorer +super + e + thunar + +# volumes controls and media navigation for media keys +{_,shift + }XF86AudioLowerVolume + ADJ={10,1} && amixer -c 1 sset Speaker $ADJ%- && amixer -c 1 sset Headphone $ADJ%- && amixer -c 1 sset Master $ADJ%- && update_bar_MasterVolume + +{_,shift + }XF86AudioRaiseVolume + ADJ={10,1} && amixer -c 1 sset Speaker $ADJ%+ && amixer -c 1 sset Headphone $ADJ%+ && amixer -c 1 sset Master $ADJ%+ && update_bar_MasterVolume + +XF86AudioMute + amixer -c 1 sset Master toggle && update_bar_MasterVolume + +XF86AudioPlay + mpc toggle + +XF86AudioNext + mpc next + +XF86AudioPrev + mpc prev + +# monitor brightness controls for monitor birghtness keys +{_,shift + }XF86MonBrightnessUp + add_percent_brightness {0.1,0.01} && update_bar_DisplayBrightness + +{_,shift + }XF86MonBrightnessDown + sub_percent_brightness {0.1,0.01} && update_bar_DisplayBrightness + diff --git a/fonts/arch_setup.bash b/fonts/arch_setup.bash new file mode 100755 index 0000000..82f80f8 --- /dev/null +++ b/fonts/arch_setup.bash @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )/.." && pwd) +source $DIR/variables.bash + +# sign keys for infinality +sudo pacman-key -r 962DDE58 +sudo pacman-key -f 962DDE58 +sudo pacman-key --lsign 962DDE58 +gpg --recv-keys AE6866C7962DDE58 + +sudo sh -c 'sed -i -e "/\[infinality-bundle\]/,+6d" /etc/pacman.conf' +sudo sh -c 'echo -e "[infinality-bundle]\nServer = http://bohoomil.com/repo/\$arch\n\n[infinality-bundle-fonts]\nServer = http://bohoomil.com/repo/fonts\n" >> /etc/pacman.conf' + +sudo pacman -Syy --noconfirm +sudo pacman -S infinality-bundle + +pacaur -S ttf-monaco --noconfirm --noedit +sudo pacman -S ttf-opensans ttf-dejavu --noconfirm + diff --git a/git/arch_setup.bash b/git/arch_setup.bash new file mode 100644 index 0000000..042bca7 --- /dev/null +++ b/git/arch_setup.bash @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +sudo pacman -S git --noconfirm + diff --git a/git/gitconfig b/git/gitconfig new file mode 100644 index 0000000..8d7ba4f --- /dev/null +++ b/git/gitconfig @@ -0,0 +1,6 @@ +[push] + default = matching +[user] + name = Daniel Flanagan + email = daniel@lytedev.io + diff --git a/git/link.bash b/git/link.bash new file mode 100755 index 0000000..006891d --- /dev/null +++ b/git/link.bash @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )/.." && pwd) +source "$DIR/variables.bash" + +rm -f "$HOME/.gitconfig" +ln -s "$DOTFILES_PATH/git/gitconfig" "$HOME/.gitconfig" + diff --git a/scripts/get_color.sh b/scripts/get_color.sh new file mode 100644 index 0000000..4d9ef70 --- /dev/null +++ b/scripts/get_color.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env sh + +get_color() +{ + XR_COLOR_DEF=$(grep "#define base$1 #" ~/.Xresources.colors) + echo ${XR_COLOR_DEF:16} +} +export -f get_color + diff --git a/scripts/set_sh_font.sh b/scripts/set_sh_font.sh new file mode 100644 index 0000000..0413745 --- /dev/null +++ b/scripts/set_sh_font.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env sh + +set_sh_font() +{ + echo "NOT IMPLEMENTED" +} +export -f set_sh_font + diff --git a/scripts/sxhkd_helpers.sh b/scripts/sxhkd_helpers.sh new file mode 100644 index 0000000..e69de29 diff --git a/sh/arch_setup.bash b/sh/arch_setup.bash new file mode 100755 index 0000000..a780a69 --- /dev/null +++ b/sh/arch_setup.bash @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +sudo pacman -S tmux --noconfirm + diff --git a/sh/bash_profile b/sh/bash_profile new file mode 100644 index 0000000..f918d82 --- /dev/null +++ b/sh/bash_profile @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +if [ -f ~/.bashrc ]; then + source ~/.bashrc +fi + diff --git a/sh/bashrc b/sh/bashrc new file mode 100644 index 0000000..d5c32eb --- /dev/null +++ b/sh/bashrc @@ -0,0 +1,58 @@ +export DOTFILES_PATH=$HOME/.dotfiles + +BASE16_SHELL="$DOTFILES_PATH/colors/shell" +[[ -s "$BASE16_SHELL" ]] && source "$BASE16_SHELL" + +# filesystem aliases +alias l="ls --color=auto" +alias ll="ls -l --color=auto" +alias la="ls -la --color=auto" + +# navigation aliases +alias cd..="cd .." +alias ..="cd .." +alias ...="cd ../.." +alias ....="cd ../../.." +alias .....="cd ../../../.." +alias ......="cd ../../../../.." + +# tmux aliases +alias tmnew="tmux new -s" +alias tmls="tmux list-sessions" +alias tmatt="tmux attach -t" + +# git aliases +alias gs="git status" +alias gpl="git pull" +alias gp="git push" +alias gac="git add -A && git commit -m" + +# networking aliases +alias p="ping 8.8.8.8" + +if command -v nvim >/dev/null 2>&1; then + alias vim="nvim" + alias ovim="\vim" +fi + +# prompt +COLOR_RESET='\e[0m' +PROMPT_SUCCESS_COLOR='\e[0;34m' +PROMPT_FAILURE_COLOR='\e[0;31m' +prompt_command_func() +{ + RET=$? + if [ $RET -eq 0 ]; then + STATUS_COLOR=$PROMPT_SUCCESS_COLOR + else + STATUS_COLOR=$PROMPT_FAILURE_COLOR + fi; + PS1="┌ $STATUS_COLOR\u@\h$COLOR_RESET \w \n└ " +} +export PROMPT_COMMAND="prompt_command_func" + +# allow a per-device script that is pulled in +if [ -a "$HOME/.bashrc_env" ]; then + . "$HOME/.bashrc_env" +fi + diff --git a/sh/link.bash b/sh/link.bash new file mode 100755 index 0000000..c79fb77 --- /dev/null +++ b/sh/link.bash @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )/.." && pwd) +source $DIR/variables.bash + +rm "$HOME/.bashrc" +rm "$HOME/.bash_profile" +rm "$HOME/.tmux.conf" +ln -s "$DOTFILES_PATH/sh/bashrc" "$HOME/.bashrc" +ln -s "$DOTFILES_PATH/sh/bash_profile" "$HOME/.bash_profile" +ln -s "$DOTFILES_PATH/sh/.tmux.conf" "$HOME/.tmux.conf" + +sed -i "/export DOTFILES_PATH/c export DOTFILES_PATH=\"$DIR\"" "$HOME/.bashrc" + +echo "You should re-source ~/.bashrc ;)" + diff --git a/sh/tmux.conf b/sh/tmux.conf new file mode 100644 index 0000000..e69de29 diff --git a/term/arch_setup.bash b/term/arch_setup.bash new file mode 100755 index 0000000..ac6b49b --- /dev/null +++ b/term/arch_setup.bash @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +sudo pacman -S rxvt-unicode --noconfirm + diff --git a/variables.bash b/variables.bash new file mode 100644 index 0000000..16f55b5 --- /dev/null +++ b/variables.bash @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# This script will seriously nuke your home directory. You should really read each of the scripts that will be executed in those process. + +DOTFILES_PATH=$HOME/.dotfiles +REPOSITORY_PATH=$HOME/Documents/Repositories +WINDOW_GAP=20 +BORDER_WIDTH=2 + +# load per-device bashrc_env if it exists +if [ -a "$HOME/.bashrc_env" ]; then + . "$HOME/.bashrc_env" +fi + diff --git a/vim/arch_setup.bash b/vim/arch_setup.bash new file mode 100755 index 0000000..4c6175f --- /dev/null +++ b/vim/arch_setup.bash @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )/.." && pwd) +source "$DIR/variables.bash" + +sudo pacman -S cmake vim unzip python2 python2-pip python python-pip xsel xclip --noconfirm + +sudo pip3 install neovim +sudo pip2 install neovim + +git clone https://github.com/neovim/neovim "$REPOSITORY_PATH/neovim" + +cd "$REPOSITORY_PATH/neovim" +make +sudo make install +cd - + diff --git a/vim/config/.gitignore b/vim/config/.gitignore new file mode 100644 index 0000000..9780597 --- /dev/null +++ b/vim/config/.gitignore @@ -0,0 +1,3 @@ +* +!init.vim +!./colors/*.vim diff --git a/vim/config/colors/current.vim b/vim/config/colors/current.vim new file mode 120000 index 0000000..286c0d2 --- /dev/null +++ b/vim/config/colors/current.vim @@ -0,0 +1 @@ +/home/daniel/.dotfiles/colors/vim \ No newline at end of file diff --git a/vim/config/init.vim b/vim/config/init.vim new file mode 100644 index 0000000..9458a9f --- /dev/null +++ b/vim/config/init.vim @@ -0,0 +1,356 @@ +" Based on dotfiles from @viccuad on GitHub - <3 + +" Plugins {{{ +" Get plugin manager if it doesn't exist +if empty(glob('~/.config/nvim/autoload/plug.vim')) + silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs + \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + autocmd VimEnter * PlugInstall +endif + +" Initialize plugin manager +if has("unix") + call plug#begin('~/.config/nvim/bundle') +endif + +" Pretty status line and tabs/buffers +Plug 'bling/vim-airline' + let g:airline_powerline_fonts = 0 + let g:airline#extensions#tabline#fnamemod = ':t' + set laststatus=2 " Always show statusline + set noshowmode " Hides default mode + let g:airline#extensions#tabline#enabled = 1 " Automatically displays all buffers when there's only one tab open + + let g:airline#extensions#tabline#left_sep = '' + let g:airline#extensions#tabline#left_alt_sep = '' + + let g:airline_right_alt_sep = '' + let g:airline_right_sep = '' + let g:airline_left_alt_sep= '' + let g:airline_left_sep = '' + +" Plugins that make text-wizarding much more fun +Plug 'majutsushi/tagbar' " shows a list of tags (requires ctags) +Plug 'tpope/vim-surround' +Plug 'tpope/vim-speeddating' +Plug 'tpope/vim-fugitive' +Plug 'airblade/vim-gitgutter' +" Plug 'kien/ctrlp.vim' +" " The \| escapes the regex OR operator and is the delimiter +" let g:ctrlp_custom_ignore = 'node_modules\|bower_components' +Plug 'junegunn/fzf', {'dir': '~/.fzf', 'do': './install --all'} +Plug 'junegunn/fzf.vim' +Plug 'scrooloose/nerdtree', {'on': ['NERDTreeToggle', 'NERDTree']} + let g:NERDSpaceDelims = 1 +Plug 'nathanaelkane/vim-indent-guides' +Plug 'scrooloose/syntastic' +Plug 'LargeFile' +Plug 'tpope/vim-commentary' +Plug 'junegunn/vim-easy-align' +Plug 'tmux-plugins/vim-tmux-focus-events' +Plug 'tasklist.vim' " , t will show TODOs and FIXMEs +Plug 'christoomey/vim-tmux-navigator' +Plug 'godlygeek/tabular' +Plug 'jez/vim-superman' + noremap K :SuperMan + +" Plugins for code completion and snippets +Plug 'Shougo/deoplete.nvim' + let g:deoplete#enable_at_startup = 1 +" Plug 'Valloric/YouCompleteMe', {'do': './install.sh --clang-completer'} " (NEEDS to be compiled, read the docs!) +" let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py' + +" TODO: Setup snippets? I honestly never use them... +" Plug 'SirVer/ultisnips' +" Plug 'honza/vim-snippets' +" let g:UltiSnipsSnippetDirectories=["snippets_UltiSnips"] +" function! g:UltiSnips_Complete() +" call UltiSnips#ExpandSnippet() +" if g:ulti_expand_res == 0 +" if pumvisible() +" return "\" +" else +" call UltiSnips#JumpForwards() +" if g:ulti_jump_forwards_res == 0 +" return "\" +" endif +" endif +" endif +" return "" +" endfunction +" au BufEnter * exec "inoremap " . g:UltiSnipsExpandTrigger . " =g:UltiSnips_Complete()" +" let g:UltiSnipsJumpForwardTrigger="" +" let g:UltiSnipsListSnippets="" + +" " this maps Enter key to to chose the current highlight item +" " and close the selection list, same as other IDEs: +" " CONFLICTS with some plugins like tpope/Endwise +" inoremap pumvisible() ? "\" : "\u\" + +" Filetype handling +Plug 'kchmck/vim-coffee-script', {'for': ['coffee', 'coffeescript', 'vue']} +Plug 'posva/vim-vue', {'for': ['vue']} +Plug 'elixir-lang/vim-elixir', {'for': ['elixir']} +Plug 'wavded/vim-stylus', {'for': ['styl', 'stylus', 'vue']} +Plug 'rust-lang/rust.vim', {'for': ['rs', 'rust']} +Plug 'plasticboy/vim-markdown', {'for': ['md', 'markdown']} +Plug 'digitaltoad/vim-jade', {'for': ['jade', 'vue']} +Plug 'freitass/todo.txt-vim', {'for': ['todo']} +Plug 'leafo/moonscript-vim', {'for': ['moon', 'moonscript']} + +Plug 'c.vim', {'for': 'c'} + let g:C_LocalTemplateFile = $HOME.'/.vim/snippets_Cvim/c-support/templates/Templates' " this allows for the templates to be versioned on .dotfiles + +Plug 'hdima/python-syntax', {'for': 'python'} + let python_highlight_all = 1 + " you can change between py v2 and v3 with :Python2Syntax and :Python3Syntax + +call plug#end() +" }}} + +" Filetype & languages {{{ +filetype on +filetype indent on +filetype plugin on + +" C language +let c_space_errors = 1 +let c_comment_strings = 0 " dont highlight strings inside C comments + +" Python language +let python_space_errors = 1 +autocmd FileType python setl tabstop=2 expandtab shiftwidth=2 softtabstop=2 + +" HamlC +autocmd BufRead,BufNewFile *.hamlc set ft=haml + +" Markdown instead of modula2 +autocmd BufNewFile,BufReadPost *.md setl filetype=markdown spell textwidth=0 wrapmargin=0 + +" TXT files +autocmd BufNewFile,BufReadPost *.txt setl spell textwidth=0 wrapmargin=0 +" }}} + +" Spaces and tabs {{{ +set tabstop=2 +set shiftwidth=2 +set softtabstop=2 +set expandtab +set autoindent smartindent +set listchars=tab:\ \ ,trail:· +set list +" }}} + +" Line wrap {{{ +" let &colorcolumn=join(range(81,400),",") " colors columns past 80 +set wrap +set linebreak +set breakindent +set textwidth=80 +set formatoptions=tcrql1j + " t autowrap to textwidth + " c autowrap comments to textwidth + " r autoinsert comment leader with + " q allow formatting of comments with gq + " l Long lines are not broken in insert mode: When a line was longer than 'textwidth' when the insert command started, Vim does not automatically format it. + " 1 Don't break a line after a one-letter word. It's broken before it instead (if possible). + " j Where it makes sense, remove a comment leader when joining lines +" }}} + +" Look and feel {{{ +set title +set synmaxcol=2048 +set number +"set relativenumber +set cursorline +"set cursorcolumn +set showcmd +set nowildmenu +set wildmode=longest,list,full +set cpoptions-=$ +set showmatch +set mouse=a +set mousehide +set backspace=indent,eol,start +set ruler +set lazyredraw +set scrolloff=8 +set sidescrolloff=8 +set splitright +set splitbelow +set noerrorbells +set visualbell +set vb t_vb= +set nobackup +set nowritebackup +set noswapfile +if has('autocmd') + autocmd GUIEnter * set visualbell t_vb= +endif +set timeout +set ttimeoutlen=200 + +set t_Co=256 +let base16colorspace=256 +set background=dark +colorscheme current +highlight ColorColumn ctermbg=235 guibg=#262626 + +highlight clear SignColumn + +if &term == 'xterm-256color' || &term == 'screen-256color' + let &t_SI = "\[5 q" + let &t_EI = "\[1 q" +endif + +if &term == 'rxvt-unicode-256color' + let &t_SI = "\[3 q" + let &t_EI = "\[1 q" +endif +" }}} + +" Persistence {{{ + +" No empty buffer on startup +autocmd VimEnter * nested if bufname('')=='' && line('$') == 1 && col('$')==1 && !&modified | bd % | endif + +set hidden +set shortmess=I +set history=1000 +set undofile +set undodir=$HOME/.config/nvim/undo +set undolevels=1000 +set undoreload=10000 +" }}} + +" Backup, Swap, Spell files {{{ +set backupdir=$HOME/.config/nvim/backup +set directory=$HOME/.config/nvim/backup +set spellfile=$HOME/.config/nvim/spell/en.utf-8.add +" }}} + +" Searching {{{ +set ignorecase +set smartcase +set incsearch +set hlsearch +set wrapscan +" }}} + +" Mappings {{{ +" make these commonly mistyped commands still work: +command! WQ wq +command! Wq wq +command! Wqa wqa +command! W w +command! Q q + +let mapleader = "\" + +" use tab key to cycle through the buffers: +nnoremap :bnext +nnoremap :bprevious + +" don't kill vim +nnoremap K + +" quick paragraph formatting +vmap Q gq +nmap Q gqap + +" launch fzf for the current git repo +nnoremap :GitFiles + +" use ctrl j and k to switch buffers as well +nnoremap k :bnext +nnoremap j :bprevious + +" fast word change +nnoremap c ciw +nnoremap C ciW + +" bash-like deletion +inoremap +inoremap + +" clear search higlight +nnoremap / :let @/ = "" + +" remap jk to escape in insert mode +inoremap jk +inoremap jj + +" use hjkl-movement between rows when soft wrapping: +nnoremap j gj +nnoremap k gk +vnoremap j gj +vnoremap k gk + +" workaround for an issue where nvim reads C-H as in normal mode +if has('nvim') + nmap :TmuxNavigateLeft +endif + +" move between tabs: +nmap 1 AirlineSelectTab1 +nmap 2 AirlineSelectTab2 +nmap 3 AirlineSelectTab3 +nmap 4 AirlineSelectTab4 +nmap 5 AirlineSelectTab5 +nmap 6 AirlineSelectTab6 +nmap 7 AirlineSelectTab7 +nmap 8 AirlineSelectTab8 +nmap 9 AirlineSelectTab9 + +" remove trailing whitespace: +map :%s/\s\+$//:let @/ = "" + +nnoremap + +" close buffer: +nnoremap w :bd +map :bd + +" toggle spell checking: +map :setlocal spell! + +" open urls, files, etc. example: http://google.com: +noremap o :!xdg-open +set isfname+=32 + +" previous c error (c.vim plugin): +map :cprevious + +" next c error (c.vim plugin) +map :cnext + +" keep that dumb window from popping up +map q: :q + +command! UseFoldMarkers set foldmethod=marker + +" compile & link c code (alt+ write + compile, ctrl+ compile + run) (c.vim plugin) +" +" }}} + +" Folding {{{ +set foldmethod=syntax +set foldlevel=99 +set foldnestmax=10 +set nofoldenable +set foldlevelstart=1 +" }}} + +" Launch {{{ +set encoding=utf8 +set autowrite +set autochdir +"autocmd BufEnter * silent! lcd %:p:h " automatically cd into the dir of the file. this breaks less +set autoread +set nomodeline + +" jump to the last position when reopening a file: +if has("autocmd") + au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif +endif +" }}} diff --git a/vim/link.bash b/vim/link.bash new file mode 100755 index 0000000..80bd647 --- /dev/null +++ b/vim/link.bash @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )/.." && pwd) +source "$DIR/variables.bash" + +rm -rf "$HOME/.config/nvim" +ln -s "$DOTFILES_PATH/vim/config" "$HOME/.config/nvim" + +nvim +PlugInstal +qall + diff --git a/x/.xinitrc b/x/.xinitrc new file mode 100644 index 0000000..1420934 --- /dev/null +++ b/x/.xinitrc @@ -0,0 +1,52 @@ +#!/bin/sh + +userresources=$HOME/.Xresources +usermodmap=$HOME/.Xmodmap +sysresources=/etc/X11/xinit/.Xresources +sysmodmap=/etc/X11/xinit/.Xmodmap + +# merge in defaults and keymaps + +if [ -f $sysresources ]; then + + + + + + + + xrdb -merge $sysresources + +fi + +if [ -f $sysmodmap ]; then + xmodmap $sysmodmap +fi + +if [ -f "$userresources" ]; then + + + + + + + + xrdb -merge "$userresources" + +fi + +if [ -f "$usermodmap" ]; then + xmodmap "$usermodmap" +fi + +# start some nice programs + +if [ -d /etc/X11/xinit/xinitrc.d ] ; then + for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do + [ -x "$f" ] && . "$f" + done + unset f +fi + +sxhkd & +exec bspwm diff --git a/x/arch_setup.bash b/x/arch_setup.bash new file mode 100755 index 0000000..a90fea6 --- /dev/null +++ b/x/arch_setup.bash @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +sudo pacman -S xorg-xinit xorg-server xorg-xrdb --noconfirm + diff --git a/x/link.bash b/x/link.bash new file mode 100755 index 0000000..26839d8 --- /dev/null +++ b/x/link.bash @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )/.." && pwd) +source "$DIR/variables.bash" + +rm "$HOME/.xinitrc" +rm "$HOME/.Xresources" +ln -s "$HOME/.dotfiles/x/xinitrc" "$HOME/.xinitrc" +ln -s "$HOME/.dotfiles/x/xresources" "$HOME/.Xresources" + diff --git a/x/xinitrc b/x/xinitrc new file mode 100644 index 0000000..6507bf6 --- /dev/null +++ b/x/xinitrc @@ -0,0 +1,42 @@ +#!/bin/sh + +userresources=$HOME/.Xresources +usercolors=$HOME/.Xresources.colors +userenv=$HOME/.Xresources.env +usermodmap=$HOME/.Xmodmap +sysresources=/etc/X11/xinit/.Xresources +sysmodmap=/etc/X11/xinit/.Xmodmap + +if [ -f $sysresources ]; then + xrdb -merge $sysresources +fi + +if [ -f $sysmodmap ]; then + xmodmap $sysmodmap +fi + +if [ -f "$userresources" ]; then + xrdb -merge "$userresources" +fi + +if [ -f "$usercolors" ]; then + xrdb -merge "$usercolors" +fi + +if [ -f "$userenv" ]; then + xrdb -merge "$userenv" +fi + +if [ -f "$usermodmap" ]; then + xmodmap "$usermodmap" +fi + +if [ -d /etc/X11/xinit/xinitrc.d ] ; then + for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do + [ -x "$f" ] && . "$f" + done + unset f +fi + +exec bspwm + diff --git a/x/xresources b/x/xresources new file mode 100755 index 0000000..011ec91 --- /dev/null +++ b/x/xresources @@ -0,0 +1,20 @@ +#define primaryfont xft:Monaco-9 +#define secondaryfont xft:Open Sans-9 +#define iconfont xft:stlarch-9 +#define primaryletterspace -2 + +*font: primaryfont +*faceName: primaryfont +*boldFont: primaryfont +*letterSpace: primaryletterspace +*scrollBar: false +*cursorUnderline: true +*cursorBlink: true +*termName: rxvt-unicode +*intensityStyles: true +*utf8: 2 + +*depth: 32 + +URxvt.internalBorder: 10 +