diff --git a/.directory b/.directory deleted file mode 100644 index bf50a0f..0000000 --- a/.directory +++ /dev/null @@ -1,6 +0,0 @@ -[Dolphin] -Timestamp=2016,11,20,7,37,13 -Version=3 - -[Settings] -HiddenFilesShown=true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a2de22d --- /dev/null +++ b/.gitignore @@ -0,0 +1,122 @@ + +# Created by https://www.toptal.com/developers/gitignore/api/puppet,emacs,code,vim,linux +# Edit at https://www.toptal.com/developers/gitignore?templates=puppet,emacs,code,vim,linux + +### Application ### +modules +.resource_types +info.rb +.rerun.json + +### Code ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +### Emacs ### +# -*- mode: gitignore; -*- +*~ +\#*\# +/.emacs.desktop +/.emacs.desktop.lock +*.elc +auto-save-list +tramp +.\#* + +# Org-mode +.org-id-locations +*_archive + +# flymake-mode +*_flymake.* + +# eshell files +/eshell/history +/eshell/lastdir + +# elpa packages +/elpa/ + +# reftex files +*.rel + +# AUCTeX auto folder +/auto/ + +# cask packages +.cask/ +dist/ + +# Flycheck +flycheck_*.el + +# server auth directory +/server/ + +# projectiles files +.projectile + +# directory configuration +.dir-locals.el + +# network security +/network-security.data + + +### Linux ### + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### Puppet ### +# gitignore template for Puppet modules +# website: https://forge.puppet.com/ + +# Built packages +pkg/* + +# Should run on multiple platforms so don't check in +Gemfile.lock + +# Tests +spec/fixtures/* +coverage/* + +# Third-party +vendor/* +.bundle/* + +### Vim ### +# Swap +[._]*.s[a-v][a-z] +!*.svg # comment out if you don't need vector files +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim +Sessionx.vim + +# Temporary +.netrwhist +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +# End of https://www.toptal.com/developers/gitignore/api/puppet,emacs,code,vim,linux \ No newline at end of file diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index e2f7e4d..0000000 --- a/.gitmodules +++ /dev/null @@ -1,75 +0,0 @@ -[submodule "dotfiles/vim/bundle/auto-pairs"] - path = dotfiles/vim/bundle/auto-pairs - url = git://github.com/jiangmiao/auto-pairs.git -[submodule "dotfiles/vim/bundle/calendar.vim"] - path = dotfiles/vim/bundle/calendar.vim - url = https://github.com/itchyny/calendar.vim -[submodule "dotfiles/vim/bundle/ctrlp.vim"] - path = dotfiles/vim/bundle/ctrlp.vim - url = https://github.com/kien/ctrlp.vim.git -[submodule "dotfiles/vim/bundle/indentLine"] - path = dotfiles/vim/bundle/indentLine - url = https://github.com/Yggdroot/indentLine.git -[submodule "dotfiles/vim/bundle/nerdcommenter"] - path = dotfiles/vim/bundle/nerdcommenter - url = https://github.com/scrooloose/nerdcommenter.git -[submodule "dotfiles/vim/bundle/nerdtree"] - path = dotfiles/vim/bundle/nerdtree - url = https://github.com/scrooloose/nerdtree.git -[submodule "dotfiles/vim/bundle/pdv"] - path = dotfiles/vim/bundle/pdv - url = https://github.com/tobyS/pdv.git -[submodule "dotfiles/vim/bundle/sparkup"] - path = dotfiles/vim/bundle/sparkup - url = https://github.com/rstacruz/sparkup.git -[submodule "dotfiles/vim/bundle/unite.vim"] - path = dotfiles/vim/bundle/unite.vim - url = https://github.com/Shougo/unite.vim.git -[submodule "dotfiles/vim/bundle/vdebug"] - path = dotfiles/vim/bundle/vdebug - url = https://github.com/joonty/vdebug.git -[submodule "dotfiles/vim/bundle/vim-airline"] - path = dotfiles/vim/bundle/vim-airline - url = https://github.com/vim-airline/vim-airline -[submodule "dotfiles/vim/bundle/vim-easy-align"] - path = dotfiles/vim/bundle/vim-easy-align - url = https://github.com/junegunn/vim-easy-align.git -[submodule "dotfiles/vim/bundle/vim-fugitive"] - path = dotfiles/vim/bundle/vim-fugitive - url = git://github.com/tpope/vim-fugitive.git -[submodule "dotfiles/vim/bundle/vim-gitgutter"] - path = dotfiles/vim/bundle/vim-gitgutter - url = git://github.com/airblade/vim-gitgutter.git -[submodule "dotfiles/vim/bundle/vim-grammarous"] - path = dotfiles/vim/bundle/vim-grammarous - url = https://github.com/rhysd/vim-grammarous.git -[submodule "dotfiles/vim/bundle/vim-indent-guides"] - path = dotfiles/vim/bundle/vim-indent-guides - url = git://github.com/nathanaelkane/vim-indent-guides.git -[submodule "dotfiles/vim/bundle/vim-multiple-cursors"] - path = dotfiles/vim/bundle/vim-multiple-cursors - url = https://github.com/terryma/vim-multiple-cursors.git -[submodule "dotfiles/vim/bundle/vim-surround"] - path = dotfiles/vim/bundle/vim-surround - url = git://github.com/tpope/vim-surround.git -[submodule "dotfiles/vim/bundle/vim-tmux-navigator"] - path = dotfiles/vim/bundle/vim-tmux-navigator - url = https://github.com/christoomey/vim-tmux-navigator.git -[submodule "dotfiles/vim/bundle/vimwiki"] - path = dotfiles/vim/bundle/vimwiki - url = https://github.com/vimwiki/vimwiki.git -[submodule "dotfiles/vim/bundle/vmustache"] - path = dotfiles/vim/bundle/vmustache - url = https://github.com/tobyS/vmustache.git -[submodule "dotfiles/vim/bundle/ultisnips"] - path = dotfiles/vim/bundle/ultisnips - url = https://github.com/SirVer/ultisnips.git -[submodule "dotfiles/vim/bundle/vim-airline-themes"] - path = dotfiles/vim/bundle/vim-airline-themes - url = https://github.com/vim-airline/vim-airline-themes.git -[submodule "dotfiles\\vim\\bundle\\ultisnips"] - path = dotfiles\\vim\\bundle\\ultisnips - url = https://github.com/SirVer/ultisnips.git -[submodule "dotfiles\\vim\\bundle\\vim-airline-themes"] - path = dotfiles\\vim\\bundle\\vim-airline-themes - url = https://github.com/vim-airline/vim-airline-themes.git diff --git a/Puppetfile b/Puppetfile new file mode 100644 index 0000000..a1fad57 --- /dev/null +++ b/Puppetfile @@ -0,0 +1,15 @@ +# +# Puppet std lib +# +mod 'puppetlabs-stdlib', '6.3.0' + +# +# Docker modules +# +mod 'puppetlabs-apt', '7.4.2' +mod 'puppetlabs-docker', '3.10.0' + +# +# VSC Repo to install all the git repos +# +mod 'puppetlabs-vcsrepo', '3.1.1' diff --git a/bolt.yaml b/bolt.yaml new file mode 100644 index 0000000..e69de29 diff --git a/data/common.yaml b/data/common.yaml new file mode 100644 index 0000000..ba53922 --- /dev/null +++ b/data/common.yaml @@ -0,0 +1,4 @@ +--- +user: ade +user_name: Ade Attwood +email: code@adeattwood.co.uk diff --git a/dotfiles/.directory b/dotfiles/.directory deleted file mode 100644 index fe3fb17..0000000 --- a/dotfiles/.directory +++ /dev/null @@ -1,6 +0,0 @@ -[Dolphin] -Timestamp=2016,11,18,5,34,12 -Version=3 - -[Settings] -HiddenFilesShown=true diff --git a/dotfiles/Xresources b/dotfiles/Xresources deleted file mode 100644 index 65f139f..0000000 --- a/dotfiles/Xresources +++ /dev/null @@ -1,67 +0,0 @@ -!xrdb -merge ~/.Xresources -! Use a nice truetype font and size by default... -xterm*faceName: DejaVu Sans Mono Book -!xterm*faceSize: 11 -xterm*faceSize: 10 - -! Every shell is a login shell by default (for inclusion of all necessary environment variables) -!xterm*loginshell: true - -! I like a LOT of scrollback... -xterm*savelines: 16384 - -! double-click to select whole URLs :D -xterm*charClass: 33:48,36-47:48,58-59:48,61:48,63-64:48,95:48,126:48 - -xterm*termName: xterm-256color - -! Base16 Railscasts -! Scheme: Ryan Bates (http://railscasts.com) - -#define base00 #2b2b2b -#define base01 #272935 -#define base02 #3a4055 -#define base03 #5a647e -#define base04 #d4cfc9 -#define base05 #e6e1dc -#define base06 #f4f1ed -#define base07 #f9f7f3 -#define base08 #da4939 -#define base09 #cc7833 -#define base0A #ffc66d -#define base0B #a5c261 -#define base0C #519f50 -#define base0D #6d9cbe -#define base0E #b6b3eb -#define base0F #bc9458 - -*.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: base08 -*.color10: base0B -*.color11: base0A -*.color12: base0D -*.color13: base0E -*.color14: base0C -*.color15: base07 - -! Note: colors beyond 15 might not be loaded (e.g., xterm, urxvt), -! use 'shell' template to set these if necessary -*.color16: base09 -*.color17: base0F -*.color18: base01 -*.color19: base02 -*.color20: base04 -*.color21: base06 diff --git a/dotfiles/bashrc b/dotfiles/bashrc deleted file mode 100644 index 831d2a3..0000000 --- a/dotfiles/bashrc +++ /dev/null @@ -1,149 +0,0 @@ -# costume user bin dir -export PATH=$PATH:~/.composer/vendor/bin - -# ~/.bashrc: executed by bash(1) for non-login shells. -# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) -# for examples - -# If not running interactively, don't do anything -case $- in - *i*) ;; - *) return;; -esac - -# don't put duplicate lines or lines starting with space in the history. -# See bash(1) for more options -HISTCONTROL=ignoreboth - -# append to the history file, don't overwrite it -shopt -s histappend - -# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) -HISTSIZE=1000 -HISTFILESIZE=2000 - -# check the window size after each command and, if necessary, -# update the values of LINES and COLUMNS. -shopt -s checkwinsize - -# If set, the pattern "**" used in a pathname expansion context will -# match all files and zero or more directories and subdirectories. -#shopt -s globstar - -# make less more friendly for non-text input files, see lesspipe(1) -[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" - -# set variable identifying the chroot you work in (used in the prompt below) -if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then - debian_chroot=$(cat /etc/debian_chroot) -fi - -# set a fancy prompt (non-color, unless we know we "want" color) -case "$TERM" in - xterm-color|*-256color) color_prompt=yes;; -esac - -# uncomment for a colored prompt, if the terminal has the capability; turned -# off by default to not distract the user: the focus in a terminal window -# should be on the output of commands, not on the prompt -force_color_prompt=yes - -if [ -n "$force_color_prompt" ]; then - if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then - # We have color support; assume it's compliant with Ecma-48 - # (ISO/IEC-6429). (Lack of such support is extremely rare, and such - # a case would tend to support setf rather than setaf.) - color_prompt=yes - else - color_prompt= - fi -fi - -if [ "$color_prompt" = yes ]; then - PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' -else - PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' -fi -unset color_prompt force_color_prompt - -# If this is an xterm set the title to user@host:dir -case "$TERM" in -xterm*|rxvt*) - PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" - ;; -*) - ;; -esac - -# enable color support of ls and also add handy aliases -if [ -x /usr/bin/dircolors ]; then - test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" - alias ls='ls --color=auto' - #alias dir='dir --color=auto' - #alias vdir='vdir --color=auto' - - alias grep='grep --color=auto' - alias fgrep='fgrep --color=auto' - alias egrep='egrep --color=auto' -fi - -# colored GCC warnings and errors -#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' - -# some more ls aliases -alias ll='ls -alF' -alias la='ls -A' -alias l='ls -CF' - -# Add an "alert" alias for long running commands. Use like so: -# sleep 10; alert -alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' - -# Alias definitions. -# You may want to put all your additions into a separate file like -# ~/.bash_aliases, instead of adding them here directly. -# See /usr/share/doc/bash-doc/examples in the bash-doc package. - -if [ -f ~/.bash_aliases ]; then - . ~/.bash_aliases -fi - -# enable programmable completion features (you don't need to enable -# this, if it's already enabled in /etc/bash.bashrc and /etc/profile -# sources /etc/bash.bashrc). -if ! shopt -oq posix; then - if [ -f /usr/share/bash-completion/bash_completion ]; then - . /usr/share/bash-completion/bash_completion - elif [ -f /etc/bash_completion ]; then - . /etc/bash_completion - fi -fi - -# map esc to caps lock -xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape' - - -export PHPBREW_SET_PROMPT=1 -source "$HOME/.phpbrew/bashrc" - -export PATH="$HOME/.rbenv/bin:$PATH" -eval "$(rbenv init -)" -export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH" - - -export base00="#2b303b" -export base01="#343d46" -export base02="#4f5b66" -export base03="#65737e" -export base04="#a7adba" -export base05="#c0c5ce" -export base06="#dfe1e8" -export base07="#eff1f5" -export base08="#bf616a" -export base09="#d08770" -export base0A="#ebcb8b" -export base0B="#a3be8c" -export base0C="#96b5b4" -export base0D="#8fa1b3" -export base0E="#b48ead" -export base0F="#ab7967" diff --git a/dotfiles/bin/a2restart b/dotfiles/bin/a2restart deleted file mode 100755 index ee4d24f..0000000 --- a/dotfiles/bin/a2restart +++ /dev/null @@ -1,3 +0,0 @@ -! /bin/bash - -sudo service apache2 restart diff --git a/dotfiles/bin/tmux-mysql b/dotfiles/bin/tmux-mysql deleted file mode 100755 index 3f5cc87..0000000 --- a/dotfiles/bin/tmux-mysql +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -tmux new-window -tmux rename-window 'MySql' -tmux send-keys "mysql -uroot -proot" C-m -tmux send-keys "pager vim -" C-m -tmux split-window -h diff --git a/dotfiles/bin/tmux-phpservers b/dotfiles/bin/tmux-phpservers deleted file mode 100755 index 65e14be..0000000 --- a/dotfiles/bin/tmux-phpservers +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -tmux new-window -tmux rename-window 'Servers' - -tmux send-keys "php -S http://localhost:8080" - -tmux split-window -h - -tmux send-keys "cd ~/.selenium-server" C-m -tmux send-keys "java -jar ~/.selenium-server/selenium-server-standalone-2.53.1.jar -Dwebdriver.chrome.drive=chromedriver" diff --git a/dotfiles/composer/composer.json b/dotfiles/composer/composer.json deleted file mode 100644 index 955590b..0000000 --- a/dotfiles/composer/composer.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "require": { - "phpunit/phpunit": "^5.3" - } -} diff --git a/dotfiles/selenium-server/chromedriver b/dotfiles/selenium-server/chromedriver deleted file mode 100755 index 935d4db..0000000 Binary files a/dotfiles/selenium-server/chromedriver and /dev/null differ diff --git a/dotfiles/selenium-server/chromedriver.exe b/dotfiles/selenium-server/chromedriver.exe deleted file mode 100644 index c312e1b..0000000 Binary files a/dotfiles/selenium-server/chromedriver.exe and /dev/null differ diff --git a/dotfiles/selenium-server/selenium-server-standalone-2.44.0.jar b/dotfiles/selenium-server/selenium-server-standalone-2.44.0.jar deleted file mode 100644 index 2c1b22c..0000000 Binary files a/dotfiles/selenium-server/selenium-server-standalone-2.44.0.jar and /dev/null differ diff --git a/dotfiles/selenium-server/selenium-server-standalone-2.53.1.jar b/dotfiles/selenium-server/selenium-server-standalone-2.53.1.jar deleted file mode 100644 index 5c3c4fd..0000000 Binary files a/dotfiles/selenium-server/selenium-server-standalone-2.53.1.jar and /dev/null differ diff --git a/dotfiles/selenium-server/selenium-server-standalone-3.0.1.jar b/dotfiles/selenium-server/selenium-server-standalone-3.0.1.jar deleted file mode 100644 index d9fd93e..0000000 Binary files a/dotfiles/selenium-server/selenium-server-standalone-3.0.1.jar and /dev/null differ diff --git a/dotfiles/tmux.conf b/dotfiles/tmux.conf deleted file mode 100644 index 3588841..0000000 --- a/dotfiles/tmux.conf +++ /dev/null @@ -1,134 +0,0 @@ -# split windows like vim -# vim's definition of a horizontal/vertical split is reversed from tmux's -bind s split-window -v -bind v split-window -h - -# Smart pane switching with awareness of vim splits -# See: https://github.com/christoomey/vim-tmux-navigator -is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"' -bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L" -bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D" -bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U" -bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R" -bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l" - -# resize panes like vim -# feel free to change the "1" to however many lines you want to resize by, only -# one at a time can be slow -bind < resize-pane -L 1 -bind > resize-pane -R 1 -bind - resize-pane -D 1 -bind + resize-pane -U 1 - -# bind : to command-prompt like vim -# this is the default in tmux already -bind : command-prompt - -# vi-style controls for copy mode -setw -g mode-keys vi - -# set 256 color to use color scheme -set -g default-terminal "xterm-256color" -set -g terminal-overrides 'xteram*:colors=256' - -# set windows so they dont resize to the smallest -setw -g aggressive-resize on - -###################### -### DESIGN CHANGES ### -###################### - -# panes -set -g pane-border-fg black -set -g pane-active-border-fg brightred - -## Status bar design -# status line -set -g status-utf8 on -set -g status-justify left -set -g status-bg default -set -g status-fg colour12 -set -g status-interval 2 - -# messaging -set -g message-fg black -set -g message-bg yellow -set -g message-command-fg blue -set -g message-command-bg black - -#window mode -setw -g mode-bg colour6 -setw -g mode-fg colour0 - -# window status -setw -g window-status-format " #F#I:#W#F " -setw -g window-status-current-format " #F#I:#W#F " -setw -g window-status-format "#[fg=magenta]#[bg=black] #I #[bg=cyan]#[fg=colour8] #W " -setw -g window-status-current-format "#[bg=brightmagenta]#[fg=colour8] #I #[fg=colour8]#[bg=colour14] #W " -setw -g window-status-current-bg colour0 -setw -g window-status-current-fg colour11 -setw -g window-status-current-attr dim -setw -g window-status-bg green -setw -g window-status-fg black -setw -g window-status-attr reverse - -# Info on left (I don't have a session display for now) -set -g status-left '' - -# loud or quiet? -set-option -g visual-activity off -set-option -g visual-bell off -set-option -g visual-silence off -set-window-option -g monitor-activity off -set-option -g bell-action none - -#set -g default-terminal "screen-256color" - -# The modes { -setw -g clock-mode-colour colour135 -setw -g mode-attr bold -setw -g mode-fg colour196 -setw -g mode-bg colour238 - -# } -# The panes { - -set -g pane-border-bg colour235 -set -g pane-border-fg colour238 -set -g pane-active-border-bg colour236 -set -g pane-active-border-fg colour51 - -# } -# The statusbar { - -set -g status-position bottom -set -g status-bg colour234 -set -g status-fg colour137 -set -g status-attr dim -set -g status-left '' -set -g status-right '#[fg=colour233,bg=colour241,bold] %d/%m #[fg=colour233,bg=colour245,bold] %H:%M:%S ' -set -g status-right-length 50 -set -g status-left-length 20 - -setw -g window-status-current-fg colour81 -setw -g window-status-current-bg colour238 -setw -g window-status-current-attr bold -setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour255]#W#[fg=colour50]#F ' - -setw -g window-status-fg colour138 -setw -g window-status-bg colour235 -setw -g window-status-attr none -setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F ' - -setw -g window-status-bell-attr bold -setw -g window-status-bell-fg colour255 -setw -g window-status-bell-bg colour1 - -# } -# The messages { - -set -g message-attr bold -set -g message-fg colour232 -set -g message-bg colour166 - -# } diff --git a/dotfiles/tmuxinator/fullScreenDev.yml b/dotfiles/tmuxinator/fullScreenDev.yml deleted file mode 100644 index a01bf73..0000000 --- a/dotfiles/tmuxinator/fullScreenDev.yml +++ /dev/null @@ -1,36 +0,0 @@ -# ~/.tmuxinator/fullScreenDev.yml - -name: fullScreenDev -root: <%= @args[0] %> - -# Optional tmux socket -# socket_name: foo - -# Runs before everything. Use it to start daemons etc. -# pre: sudo /etc/rc.d/mysqld start - -# Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions. -# pre_window: rbenv shell 2.0.0-p247 - -# Pass command line options to tmux. Useful for specifying a different tmux.conf. -# tmux_options: -f ~/.tmux.mac.conf - -# Change the command to call tmux. This can be used by derivatives/wrappers like byobu. -# tmux_command: byobu - -# Specifies (by name or index) which window will be selected on project startup. If not set, the first window is used. -# startup_window: logs - -# Controls whether the tmux session should be attached to automatically. Defaults to true. -# attach: false - -# Runs after everything. Use it to attach to tmux with custom options etc. -# post: tmux -CC attach -t myLaravel - -windows: - - editor: - layout: a989,283x58,0,0{212x58,0,0,0,70x58,213,0[70x29,213,0,1,70x28,213,30,2]} - panes: - - vim --servername vim - - vifm - - diff --git a/dotfiles/tmuxinator/php.yml b/dotfiles/tmuxinator/php.yml deleted file mode 100644 index 1813114..0000000 --- a/dotfiles/tmuxinator/php.yml +++ /dev/null @@ -1,38 +0,0 @@ -# ~/.tmuxinator/php.yml - -name: php -root: <%= @args[0] %> - -# Optional tmux socket -# socket_name: foo - -# Runs before everything. Use it to start daemons etc. -# pre: sudo /etc/rc.d/mysqld start - -# Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions. -# pre_window: rbenv shell 2.0.0-p247 - -# Pass command line options to tmux. Useful for specifying a different tmux.conf. -# tmux_options: -f ~/.tmux.mac.conf - -# Change the command to call tmux. This can be used by derivatives/wrappers like byobu. -# tmux_command: byobu - -# Specifies (by name or index) which window will be selected on project startup. If not set, the first window is used. -# startup_window: logs - -# Controls whether the tmux session should be attached to automatically. Defaults to true. -# attach: false - -# Runs after everything. Use it to attach to tmux with custom options etc. -# post: tmux -CC attach -t php - -windows: - - editor: - layout: 2178,136x55,0,0[136x45,0,0,0,136x9,0,46,4] - panes: - - vim - - - - git: - - browser: google-chrome http://localhost - - Tasks: diff --git a/dotfiles/tmuxinator/rails.yml b/dotfiles/tmuxinator/rails.yml deleted file mode 100644 index b387ffc..0000000 --- a/dotfiles/tmuxinator/rails.yml +++ /dev/null @@ -1,37 +0,0 @@ -# ~/.tmuxinator/rails.yml - -name: rails -root: <%= @args[0] %> - -# Optional tmux socket -# socket_name: foo - -# Runs before everything. Use it to start daemons etc. -# pre: sudo /etc/rc.d/mysqld start - -# Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions. -# pre_window: rbenv shell 2.0.0-p247 - -# Pass command line options to tmux. Useful for specifying a different tmux.conf. -# tmux_options: -f ~/.tmux.mac.conf - -# Change the command to call tmux. This can be used by derivatives/wrappers like byobu. -# tmux_command: byobu - -# Specifies (by name or index) which window will be selected on project startup. If not set, the first window is used. -# startup_window: logs - -# Controls whether the tmux session should be attached to automatically. Defaults to true. -# attach: false - -# Runs after everything. Use it to attach to tmux with custom options etc. -# post: tmux -CC attach -t rails - -windows: - - editor: - layout: 2178,136x55,0,0[136x45,0,0,0,136x9,0,46,4] - panes: - - vim - - - - git: - - server: rails s diff --git a/dotfiles/tmuxinator/webDev.yml b/dotfiles/tmuxinator/webDev.yml deleted file mode 100644 index c44e6b4..0000000 --- a/dotfiles/tmuxinator/webDev.yml +++ /dev/null @@ -1,38 +0,0 @@ -# ~/.tmuxinator/webDev.yml - -name: webDev -root: <%= @args[0] %> - -# Optional tmux socket -# socket_name: foo - -# Runs before everything. Use it to start daemons etc. -# pre: sudo /etc/rc.d/mysqld start - -# Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions. -# pre_window: rbenv shell 2.0.0-p247 - -# Pass command line options to tmux. Useful for specifying a different tmux.conf. -# tmux_options: -f ~/.tmux.mac.conf - -# Change the command to call tmux. This can be used by derivatives/wrappers like byobu. -# tmux_command: byobu - -# Specifies (by name or index) which window will be selected on project startup. If not set, the first window is used. -# startup_window: logs - -# Controls whether the tmux session should be attached to automatically. Defaults to true. -# attach: false - -# Runs after everything. Use it to attach to tmux with custom options etc. -# post: tmux -CC attach -t webDev - -windows: - - editor: - layout: 2178,136x55,0,0[136x45,0,0,0,136x9,0,46,4] - panes: - - vim - - - - git: - - browser: google-chrome http://localhost - - Tasks: diff --git a/dotfiles/vim/UltiSnips/php_html.snippets b/dotfiles/vim/UltiSnips/php_html.snippets deleted file mode 100644 index ef0a306..0000000 --- a/dotfiles/vim/UltiSnips/php_html.snippets +++ /dev/null @@ -1,43 +0,0 @@ -snippet php "php tag" i - -endsnippet - -snippet phpe "php echo tag" i - -endsnippet - -snippet phpif "php if statment" b - - $2 - -endsnippet - -snippet phpife "php if else statment" b - - $2 - - $3 - -endsnippet - -snippet phpifeif "php if else if statment" b - - $2 - - $4 - - $5 - -endsnippet - -snippet phpfe "php foreach" b -${3:$value}): ?> - $4 - -endsnippet - -snippet phpf "php for loop" b - - $3 - -endsnippet diff --git a/dotfiles/vim/bundle/auto-pairs b/dotfiles/vim/bundle/auto-pairs deleted file mode 160000 index 5979999..0000000 --- a/dotfiles/vim/bundle/auto-pairs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5979999a17c7330abfe1d73fd3c8d72f09d77334 diff --git a/dotfiles/vim/bundle/calendar.vim b/dotfiles/vim/bundle/calendar.vim deleted file mode 160000 index f49bd33..0000000 --- a/dotfiles/vim/bundle/calendar.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f49bd337a4643bb58df0fa4df230d60bdfeef022 diff --git a/dotfiles/vim/bundle/ctrlp.vim b/dotfiles/vim/bundle/ctrlp.vim deleted file mode 160000 index 564176f..0000000 --- a/dotfiles/vim/bundle/ctrlp.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 564176f01d7f3f7f8ab452ff4e1f5314de7b0981 diff --git a/dotfiles/vim/bundle/indentLine b/dotfiles/vim/bundle/indentLine deleted file mode 160000 index 2a26173..0000000 --- a/dotfiles/vim/bundle/indentLine +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2a2617310b0fb4c0daf02be2ba465fada257f2d0 diff --git a/dotfiles/vim/bundle/nerdcommenter b/dotfiles/vim/bundle/nerdcommenter deleted file mode 160000 index 1f4bfd5..0000000 --- a/dotfiles/vim/bundle/nerdcommenter +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1f4bfd59920c101a30a74a07b824608a6e65f3fe diff --git a/dotfiles/vim/bundle/nerdtree b/dotfiles/vim/bundle/nerdtree deleted file mode 160000 index 15445be..0000000 --- a/dotfiles/vim/bundle/nerdtree +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 15445be5fb2559829ac7a1f05af5d713586e8ec9 diff --git a/dotfiles/vim/bundle/pdv b/dotfiles/vim/bundle/pdv deleted file mode 160000 index 0e4b5aa..0000000 --- a/dotfiles/vim/bundle/pdv +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0e4b5aa689400246069953147ce53905c912087d diff --git a/dotfiles/vim/bundle/sparkup b/dotfiles/vim/bundle/sparkup deleted file mode 160000 index d400a57..0000000 --- a/dotfiles/vim/bundle/sparkup +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d400a570bf64b0c216aa7c8e1795820b911a7404 diff --git a/dotfiles/vim/bundle/ultisnips b/dotfiles/vim/bundle/ultisnips deleted file mode 160000 index 9a670c5..0000000 --- a/dotfiles/vim/bundle/ultisnips +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9a670c502b5a920a7155c2894a321beaf58b1c26 diff --git a/dotfiles/vim/bundle/unite.vim b/dotfiles/vim/bundle/unite.vim deleted file mode 160000 index 5fd81fe..0000000 --- a/dotfiles/vim/bundle/unite.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5fd81feec7ff3f94173ecb10e3dee98aaef26e5d diff --git a/dotfiles/vim/bundle/vdebug b/dotfiles/vim/bundle/vdebug deleted file mode 160000 index 24495d1..0000000 --- a/dotfiles/vim/bundle/vdebug +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 24495d14a7af9b7c707c5ca5e0b30d28eb024df1 diff --git a/dotfiles/vim/bundle/vim-airline b/dotfiles/vim/bundle/vim-airline deleted file mode 160000 index 70c16f4..0000000 --- a/dotfiles/vim/bundle/vim-airline +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 70c16f4c46f11395bbbc30b2f0a6822669e7df87 diff --git a/dotfiles/vim/bundle/vim-airline-themes b/dotfiles/vim/bundle/vim-airline-themes deleted file mode 160000 index e03e9f6..0000000 --- a/dotfiles/vim/bundle/vim-airline-themes +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e03e9f62d25f9afb04c88ec6ca66cf2098242016 diff --git a/dotfiles/vim/bundle/vim-easy-align b/dotfiles/vim/bundle/vim-easy-align deleted file mode 160000 index 0cb6b98..0000000 --- a/dotfiles/vim/bundle/vim-easy-align +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0cb6b98fc155717b0a56c110551ac57d1d951ddb diff --git a/dotfiles/vim/bundle/vim-fugitive b/dotfiles/vim/bundle/vim-fugitive deleted file mode 160000 index 3439f99..0000000 --- a/dotfiles/vim/bundle/vim-fugitive +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3439f999b138254e4bb56187fc91f91f545b4b12 diff --git a/dotfiles/vim/bundle/vim-gitgutter b/dotfiles/vim/bundle/vim-gitgutter deleted file mode 160000 index 377c71d..0000000 --- a/dotfiles/vim/bundle/vim-gitgutter +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 377c71d9823be32c021a597d8d18c3234ed567c1 diff --git a/dotfiles/vim/bundle/vim-grammarous b/dotfiles/vim/bundle/vim-grammarous deleted file mode 160000 index f9bbf94..0000000 --- a/dotfiles/vim/bundle/vim-grammarous +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f9bbf94e9a89fd6bd69aef6f372a3f66a2bc3be7 diff --git a/dotfiles/vim/bundle/vim-indent-guides b/dotfiles/vim/bundle/vim-indent-guides deleted file mode 160000 index 018298e..0000000 --- a/dotfiles/vim/bundle/vim-indent-guides +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 018298ead9d3aa9cd3b4ae222f81022a33978b09 diff --git a/dotfiles/vim/bundle/vim-multiple-cursors b/dotfiles/vim/bundle/vim-multiple-cursors deleted file mode 160000 index 25b567b..0000000 --- a/dotfiles/vim/bundle/vim-multiple-cursors +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 25b567baf712a7e9bc8f3c9ca816bd579363109b diff --git a/dotfiles/vim/bundle/vim-surround b/dotfiles/vim/bundle/vim-surround deleted file mode 160000 index 2d05440..0000000 --- a/dotfiles/vim/bundle/vim-surround +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2d05440ad23f97a7874ebd9b5de3a0e65d25d85c diff --git a/dotfiles/vim/bundle/vim-tmux-navigator b/dotfiles/vim/bundle/vim-tmux-navigator deleted file mode 160000 index e13914d..0000000 --- a/dotfiles/vim/bundle/vim-tmux-navigator +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e13914d89e9413cfa449f0c3daff18691356f2d1 diff --git a/dotfiles/vim/bundle/vimwiki b/dotfiles/vim/bundle/vimwiki deleted file mode 160000 index 4831384..0000000 --- a/dotfiles/vim/bundle/vimwiki +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4831384ab9f1c40c9e433857d958c4d9a7beb8ec diff --git a/dotfiles/vim/bundle/vmustache b/dotfiles/vim/bundle/vmustache deleted file mode 160000 index d39f77b..0000000 --- a/dotfiles/vim/bundle/vmustache +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d39f77bafef57ba7af304c74b3cfc91a83fd86e0 diff --git a/dotfiles/vimrc b/dotfiles/vimrc deleted file mode 100644 index af834cd..0000000 --- a/dotfiles/vimrc +++ /dev/null @@ -1,175 +0,0 @@ -" important -" -------------------------------------------------------------------------------- -call pathogen#infect() -set nocompatible -set runtimepath^=~/.vim/bundle/ctrlp.vim -filetype plugin on -set t_Co=256 -" -------------------------------------------------------------------------------- -" not sorted -" -------------------------------------------------------------------------------- -autocmd BufNewFile,BufRead *.phtml set ft=html -" -------------------------------------------------------------------------------- - -" -------------------------------------------------------------------------------- -set showmatch -set incsearch -set hlsearch -" -------------------------------------------------------------------------------- -" tags -" -------------------------------------------------------------------------------- -" -------------------------------------------------------------------------------- -" displaying text -" -------------------------------------------------------------------------------- -set linebreak -set nowrap -set nu -set rnu -" -------------------------------------------------------------------------------- -" highlighting and spelling -" -------------------------------------------------------------------------------- -set cursorline -syntax on -" -------------------------------------------------------------------------------- -" multiple windows -" -------------------------------------------------------------------------------- -set laststatus=2 -" -------------------------------------------------------------------------------- -" multiple tab pages -" -------------------------------------------------------------------------------- -" -------------------------------------------------------------------------------- -" terminal -" -------------------------------------------------------------------------------- -set title -" -------------------------------------------------------------------------------- -" using the mouse -" -------------------------------------------------------------------------------- -"set mouse=a -" -------------------------------------------------------------------------------- -" printing -" -------------------------------------------------------------------------------- -" -------------------------------------------------------------------------------- -" messages and info -" -------------------------------------------------------------------------------- -set ruler -set showcmd -" -------------------------------------------------------------------------------- -" selecting text -" -------------------------------------------------------------------------------- -" -------------------------------------------------------------------------------- -" editing text -" -------------------------------------------------------------------------------- -set matchpairs+=<:> -" -------------------------------------------------------------------------------- -" tabs and indenting -" -------------------------------------------------------------------------------- -set tabstop=4 -set shiftwidth=4 -set expandtab -set autoindent -filetype plugin indent on -" -------------------------------------------------------------------------------- -" folding -" -------------------------------------------------------------------------------- -set foldmethod=indent -set foldlevel=1 -set foldnestmax=2 -"set nofen -" -------------------------------------------------------------------------------- -" diff mode -" -------------------------------------------------------------------------------- -" -------------------------------------------------------------------------------- -" mapping -" -------------------------------------------------------------------------------- -inoremap EE $a -inoremap ;; $a; -inoremap jj :w -nnoremap p :set pasteo"*]p:set nopaste" -nnoremap b :ls:b -nmap o :NERDTreeToggle -nmap s ]sz= -nmap r :BLReloadPage -nnoremap :vertical resize +5 -noremap :vertical resize -5 -nnoremap :resize +5 -nnoremap :resize -5 -nnoremap d :call pdv#DocumentWithSnip() -nnoremap t :! vendor/bin/phpunit -nnoremap tf :! vendor/bin/phpunit % -" -------------------------------------------------------------------------------- -" reading and writing files -" -------------------------------------------------------------------------------- -set autoread -" -------------------------------------------------------------------------------- -" the swap file -" -------------------------------------------------------------------------------- -set noswapfile -" -------------------------------------------------------------------------------- -" command line editing -" -------------------------------------------------------------------------------- -" -------------------------------------------------------------------------------- -" executing external commands -" -------------------------------------------------------------------------------- -" -------------------------------------------------------------------------------- -" running make and jumping to errors -" -------------------------------------------------------------------------------- -" -------------------------------------------------------------------------------- -" language specific -" -------------------------------------------------------------------------------- -" -------------------------------------------------------------------------------- -" multi-byte characters -" -------------------------------------------------------------------------------- -set fileencoding=utf-8 -set encoding=utf-8 -" -------------------------------------------------------------------------------- -" variousexecute -" -------------------------------------------------------------------------------- -" -------------------------------------------------------------------------------- -" plugins -" -------------------------------------------------------------------------------- - -" ultisnips -let g:UltiSnipsSnippetsDir = "~/.vim/UltiSnips" -let g:snips_author = "AdeAttwood" -let g:snips_email = "attwood16@googlemail.com" - -" vimwiki -let g:vimwiki_list = [{ -\ 'path': '$HOME/vimwiki/', -\ 'template_path': '$HOME/vimwiki/templates', -\ 'template_default': 'default', -\ 'template_ext': '.html', -\ 'auto_toc': 1}] - -au BufRead,BufNewFile *.wiki set filetype=vimwiki -function! ToggleCalendar() - execute ":Calendar" - if exists("g:calendar_open") - if g:calendar_open == 1 - execute "q" - unlet g:calendar_open - else - g:calendar_open = 1 - end - else - let g:calendar_open = 1 - end -endfunction - -autocmd FileType calendar nmap :call vimwiki#diary#calendar_action(b:calendar.day().get_day(), b:calendar.day().get_month(), b:calendar.day().get_year(), b:calendar.day().week(), "V") - -" vim-airline -let g:airline#extensions#branch#enabled=1 -let g:airline_theme='bubblegum' - -" browserlink -let g:bl_pagefiletype = ['html', 'javascript', 'css', 'scss', 'sass', 'php', 'phtml'] - -" pdv -let g:pdv_template_dir = $HOME ."/.vim/bundle/pdv/templates_snip" - -" indent-guides -let g:indent_guides_auto_colors = 1 -" -------------------------------------------------------------------------------- -" functions -" -------------------------------------------------------------------------------- diff --git a/dotfiles/vimrc_win b/dotfiles/vimrc_win deleted file mode 100644 index c64d79f..0000000 --- a/dotfiles/vimrc_win +++ /dev/null @@ -1,184 +0,0 @@ -" important -" -------------------------------------------------------------------------------- -call pathogen#infect() -set nocompatible -set runtimepath^=%homepath%\vimfiles\bundle\ctrlp.vim -filetype plugin off -set t_Co=256 -" -------------------------------------------------------------------------------- -" not sorted -" -------------------------------------------------------------------------------- -autocmd BufNewFile,BufRead *.phtml set ft=html -set guifont=Consolas:h12:cANSI -colorscheme desert -" -------------------------------------------------------------------------------- - -" -------------------------------------------------------------------------------- -set showmatch -set incsearch -set hlsearch -" -------------------------------------------------------------------------------- -" tags -" -------------------------------------------------------------------------------- -" -------------------------------------------------------------------------------- -" displaying text -" -------------------------------------------------------------------------------- -set linebreak -set nowrap -set nu -set rnu -" -------------------------------------------------------------------------------- -" highlighting and spelling -" -------------------------------------------------------------------------------- -set cursorline -syntax on -" -------------------------------------------------------------------------------- -" multiple windows -" -------------------------------------------------------------------------------- -set laststatus=2 -" -------------------------------------------------------------------------------- -" multiple tab pages -" -------------------------------------------------------------------------------- -" -------------------------------------------------------------------------------- -" terminal -" -------------------------------------------------------------------------------- -set title -" -------------------------------------------------------------------------------- -" using the mouse -" -------------------------------------------------------------------------------- -"set mouse=a -" -------------------------------------------------------------------------------- -" printing -" -------------------------------------------------------------------------------- -" -------------------------------------------------------------------------------- -" messages and info -" -------------------------------------------------------------------------------- -set ruler -set showcmd -" -------------------------------------------------------------------------------- -" selecting text -" -------------------------------------------------------------------------------- -" -------------------------------------------------------------------------------- -" editing text -" -------------------------------------------------------------------------------- -set matchpairs+=<:> -" -------------------------------------------------------------------------------- -" tabs and indenting -" -------------------------------------------------------------------------------- -set tabstop=4 -set shiftwidth=4 -set expandtab -set autoindent -filetype plugin indent on -" -------------------------------------------------------------------------------- -" folding -" -------------------------------------------------------------------------------- -set foldmethod=indent -set foldlevel=1 -set foldnestmax=2 -"set nofen -" -------------------------------------------------------------------------------- -" diff mode -" -------------------------------------------------------------------------------- -" -------------------------------------------------------------------------------- -" mapping -" -------------------------------------------------------------------------------- -inoremap EE $a -inoremap ;; $a; -inoremap jj :w -nnoremap p :set pasteo"*]p:set nopaste" -nnoremap b :ls:b -nmap o :NERDTreeToggle -nmap s ]sz= -nmap r :BLReloadPage -nnoremap :vertical resize +5 -noremap :vertical resize -5 -nnoremap :resize +5 -nnoremap :resize -5 -nnoremap d :call pdv#DocumentWithSnip() -nnoremap t :! vendor/bin/phpunit -nnoremap tf :! vendor/bin/phpunit % -" -------------------------------------------------------------------------------- -" reading and writing files -" -------------------------------------------------------------------------------- -set autoread -" -------------------------------------------------------------------------------- -" the swap file -" -------------------------------------------------------------------------------- -set noswapfile -" -------------------------------------------------------------------------------- -" command line editing -" -------------------------------------------------------------------------------- -" -------------------------------------------------------------------------------- -" executing external commands -" -------------------------------------------------------------------------------- -" -------------------------------------------------------------------------------- -" running make and jumping to errors -" -------------------------------------------------------------------------------- -" -------------------------------------------------------------------------------- -" language specific -" -------------------------------------------------------------------------------- -" -------------------------------------------------------------------------------- -" multi-byte characters -" -------------------------------------------------------------------------------- -set fileencoding=utf-8 -set encoding=utf-8 -" -------------------------------------------------------------------------------- -" variousexecute -" -------------------------------------------------------------------------------- -" -------------------------------------------------------------------------------- -" plugins -" -------------------------------------------------------------------------------- -" git gutter -"let g:gitgutter_git_executable="C:\tools\cmder\vendor\git-for-windows\bin\git.exe" -" -"let g:sparkupExecuteMapping='' -"let g:sparkupExecuteMapping = '' - -" ultisnips -let g:UltiSnipsJumpForwardTrigger="" -let g:UltiSnipsJumpBackwardTrigger="" -let g:UltiSnipsSnippetsDir = "%homepath%\vimfiles\UltiSnips" -let g:snips_author = "AdeAttwood" -let g:snips_email = "attwood16@googlemail.com" - -" vimwiki -let g:vimwiki_list = [{ -\ 'path': '%homepath%\vimwiki\', -\ 'template_path': '%homepath\vimwiki\templates', -\ 'template_default': 'default', -\ 'template_ext': '.html', -\ 'auto_toc': 1}] - -au BufRead,BufNewFile *.wiki set filetype=vimwiki -function! ToggleCalendar() - execute ":Calendar" - if exists("g:calendar_open") - if g:calendar_open == 1 - execute "q" - unlet g:calendar_open - else - g:calendar_open = 1 - end - else - let g:calendar_open = 1 - end -endfunction - -autocmd FileType calendar nmap :call vimwiki#diary#calendar_action(b:calendar.day().get_day(), b:calendar.day().get_month(), b:calendar.day().get_year(), b:calendar.day().week(), "V") - -" vim-airline -let g:airline#extensions#branch#enabled=1 -let g:airline_theme='bubblegum' - -" browserlink -let g:bl_pagefiletype = ['html', 'javascript', 'css', 'scss', 'sass', 'php', 'phtml'] - -" pdv -let g:pdv_template_dir = "C:/Users/ade/vimfiles/bundle/pdv/templates_snip" - -" indent-guides -let g:indent_guides_auto_colors = 1 -" -------------------------------------------------------------------------------- -" functions -" -------------------------------------------------------------------------------- diff --git a/dotfiles/zshrc b/dotfiles/zshrc deleted file mode 100644 index 18b0d64..0000000 --- a/dotfiles/zshrc +++ /dev/null @@ -1,91 +0,0 @@ -# If you come from bash you might have to change your $PATH. -# export PATH=$HOME/bin:/usr/local/bin:$PATH - -# Path to your oh-my-zsh installation. - export ZSH=/home/ade/.oh-my-zsh - -# Set name of the theme to load. Optionally, if you set this to "random" -# it'll load a random theme each time that oh-my-zsh is loaded. -# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes -#ZSH_THEME="robbyrussell" -#ZSH_THEME="bira" -#ZSH_THEME="crunch" -ZSH_THEME="awesomepanda" - -# Uncomment the following line to use case-sensitive completion. -# CASE_SENSITIVE="true" - -# Uncomment the following line to use hyphen-insensitive completion. Case -# sensitive completion must be off. _ and - will be interchangeable. -# HYPHEN_INSENSITIVE="true" - -# Uncomment the following line to disable bi-weekly auto-update checks. -# DISABLE_AUTO_UPDATE="true" - -# Uncomment the following line to change how often to auto-update (in days). -# export UPDATE_ZSH_DAYS=13 - -# Uncomment the following line to disable colors in ls. -# DISABLE_LS_COLORS="true" - -# Uncomment the following line to disable auto-setting terminal title. -# DISABLE_AUTO_TITLE="true" - -# Uncomment the following line to enable command auto-correction. -# ENABLE_CORRECTION="true" - -# Uncomment the following line to display red dots whilst waiting for completion. -# COMPLETION_WAITING_DOTS="true" - -# Uncomment the following line if you want to disable marking untracked files -# under VCS as dirty. This makes repository status check for large repositories -# much, much faster. -# DISABLE_UNTRACKED_FILES_DIRTY="true" - -# Uncomment the following line if you want to change the command execution time -# stamp shown in the history command output. -# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" -# HIST_STAMPS="mm/dd/yyyy" - -# Would you like to use another custom folder than $ZSH/custom? -# ZSH_CUSTOM=/path/to/new-custom-folder - -# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) -# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ -# Example format: plugins=(rails git textmate ruby lighthouse) -# Add wisely, as too many plugins slow down shell startup. -plugins=(git composer tmux debian) - -source $ZSH/oh-my-zsh.sh - -# User configuration - -# export MANPATH="/usr/local/man:$MANPATH" - -# You may need to manually set your language environment -# export LANG=en_US.UTF-8 - -# Preferred editor for local and remote sessions -# if [[ -n $SSH_CONNECTION ]]; then -# export EDITOR='vim' -# else -# export EDITOR='mvim' -# fi - -# Compilation flags -# export ARCHFLAGS="-arch x86_64" - -# ssh -# export SSH_KEY_PATH="~/.ssh/rsa_id" - -# Set personal aliases, overriding those provided by oh-my-zsh libs, -# plugins, and themes. Aliases can be placed here, though oh-my-zsh -# users are encouraged to define aliases within the ZSH_CUSTOM folder. -# For a full list of active aliases, run `alias`. -# -# Example aliases -# alias zshconfig="mate ~/.zshrc" -# alias ohmyzsh="mate ~/.oh-my-zsh" -# -#map ecs to caps lock -xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape' diff --git a/hiera.yaml b/hiera.yaml new file mode 100644 index 0000000..e902dad --- /dev/null +++ b/hiera.yaml @@ -0,0 +1,16 @@ +--- +version: 5 + +defaults: + datadir: 'data' + +hierarchy: + - name: 'Per-OS defaults' + data_hash: yaml_data + path: 'os/%{facts.os.family}.yaml' + + - name: 'Yaml backend' + data_hash: yaml_data + paths: + - 'nodes/%{trusted.certname}.yaml' + - 'common.yaml' diff --git a/install/install_unix.sh b/install/install_unix.sh deleted file mode 100755 index fcf042f..0000000 --- a/install/install_unix.sh +++ /dev/null @@ -1,34 +0,0 @@ -# Move to home dir -cd ~/ - -# Link dotfiles to the repo files -ln -sf ~/.dotfiles/dotfiles/bashrc ~/.bashrc -ln -sf ~/.dotfiles/dotfiles/tmux.conf ~/.tmux.conf -ln -sf ~/.dotfiles/dotfiles/vimrc ~/.vimrc -ln -sf ~/.dotfiles/dotfiles/Xresources ~/.Xresources -ln -sf ~/.dotfiles/dotfiles/zshrc ~/.zshrc - -# Link to the tmuxinator dir -rm -rf ~/.tmuxinator -ln -sf ~/.dotfiles/dotfiles/tmuxinator ~/.tmuxinator - -# Link bin files -sudo ln -sf ~/.dotfiles/dotfiles/bin/* /usr/local/bin - -# Link to vim plugin autoloader -mkdir -p ~/.vim/autoload -ln -sf ~/.dotfiles/dotfiles/vim/autoload/pathogen.vim ~/.vim/autoload/pathogen.vim - -# selenium server -rm -rf ~/.selenium-server -ln -sf ~/.dotfiles/dotfiles/selenium-server ~/.selenium-server - -# Install vim plugins -rm -rf ~/.vim/bundle -mkdir -p ~/.vim/bundle -cd ~/.dotfiles -git submodule init -git submodule update -ln -sf ~/.dotfiles/dotfiles/vim/bundle/* ~/.vim/bundle -cd ~/ -echo "All dotfiles have been installed" diff --git a/install/install_win10.bat b/install/install_win10.bat deleted file mode 100644 index ec52828..0000000 --- a/install/install_win10.bat +++ /dev/null @@ -1,14 +0,0 @@ -git clone https://github.com/AdeAttwood/Dotfiles.git %USERPROFILE%\_dotfiles - -:: vim - -chdir %homepath%\_dotfiles -git submodule init -git submodule update -chdir %homepath% - -mkdir %homepath%\vimfiles -mklink /D %homepath%\vimfiles\bundle %homepath%\_dotfiles\dotfiles\vim\bundle -mklink /D %homepath%\vimfiles\autoload %homepath%\_dotfiles\dotfiles\vim\autoload -mklink %homepath%\_vimrc %homepath%\_dotfiles\dotfiles\vimrc - diff --git a/manifests/root.pp b/manifests/root.pp new file mode 100644 index 0000000..6c659cb --- /dev/null +++ b/manifests/root.pp @@ -0,0 +1,25 @@ +# Disable filebucket by default for all File resources: +# https://github.com/puppetlabs/docs-archive/blob/master/pe/2015.3/release_notes.markdown#filebucket-resource-no-longer-created-by-default +File { backup => false } + +node default { + # + # Find the username + # + # This can be set in the hira data so you can still do things as your user + # when running puppet as root + # + $user = lookup('user', String, 'first', $id) + notify { "Running as ${id} for ${user} with home of ${user_home}": } + + # + # Install all the packages that the workstation needs to run + # + include core::packages + + # + # Install docker and docker-compose + # + class { 'docker': version => 'latest' } + class {'docker::compose': ensure => present } +} diff --git a/manifests/workstation.pp b/manifests/workstation.pp new file mode 100644 index 0000000..44480d4 --- /dev/null +++ b/manifests/workstation.pp @@ -0,0 +1,25 @@ +# Disable filebucket by default for all File resources: +# https://github.com/puppetlabs/docs-archive/blob/master/pe/2015.3/release_notes.markdown#filebucket-resource-no-longer-created-by-default +File { backup => false } + +node default { + # + # Find the username + # + # This can be set in the hira data so you can still do things as your user + # when running puppet as root + # + $user = lookup('user', String, 'first', $id) + notify { "Running as ${id} for ${user} with home of ${user_home}": } + + # + # Set up core components + # + include core::git + include core::zsh + include core::bin + include core::vim + include core::ssh + include core::tmux + include core::fonts +} diff --git a/scripts/apply b/scripts/apply new file mode 100755 index 0000000..3ab5e96 --- /dev/null +++ b/scripts/apply @@ -0,0 +1,4 @@ +#!/bin/sh + +bolt apply manifests/root.pp -vv --targets localhost --run-as root --sudo-password-prompt +bolt apply manifests/workstation.pp -vv --targets localhost diff --git a/dotfiles/bin/a2changedocumentroot b/site-modules/core/files/bin/a2changedocumentroot similarity index 100% rename from dotfiles/bin/a2changedocumentroot rename to site-modules/core/files/bin/a2changedocumentroot diff --git a/site-modules/core/files/bin/base16_theme b/site-modules/core/files/bin/base16_theme new file mode 100755 index 0000000..4f0836e --- /dev/null +++ b/site-modules/core/files/bin/base16_theme @@ -0,0 +1,131 @@ +#!/bin/sh +# base16-shell (https://github.com/chriskempson/base16-shell) +# Base16 Shell template by Chris Kempson (http://chriskempson.com) +# Ocean scheme by Chris Kempson (http://chriskempson.com) + +color00="2b/30/3b" # Base 00 - Black +color01="bf/61/6a" # Base 08 - Red +color02="a3/be/8c" # Base 0B - Green +color03="eb/cb/8b" # Base 0A - Yellow +color04="8f/a1/b3" # Base 0D - Blue +color05="b4/8e/ad" # Base 0E - Magenta +color06="96/b5/b4" # Base 0C - Cyan +color07="c0/c5/ce" # Base 05 - White +color08="65/73/7e" # 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="ef/f1/f5" # Base 07 - Bright White +color16="d0/87/70" # Base 09 +color17="ab/79/67" # Base 0F +color18="34/3d/46" # Base 01 +color19="4f/5b/66" # Base 02 +color20="a7/ad/ba" # Base 04 +color21="df/e1/e8" # Base 06 +color22="24/28/31" # Slightly darker Base 00 +color_foreground="c0/c5/ce" # Base 05 +color_background="2b/30/3b" # Base 00 + + +if [ -n "$TMUX" ]; then + # Tell tmux to pass the escape sequences through + # (Source: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324) + put_template() { printf '\033Ptmux;\033\033]4;%d;rgb:%s\033\033\\\033\\' $@; } + put_template_var() { printf '\033Ptmux;\033\033]%d;rgb:%s\033\033\\\033\\' $@; } + put_template_custom() { printf '\033Ptmux;\033\033]%s%s\033\033\\\033\\' $@; } +elif [ "${TERM%%[-.]*}" = "screen" ]; then + # GNU screen (screen, screen-256color, screen-256color-bce) + put_template() { printf '\033P\033]4;%d;rgb:%s\007\033\\' $@; } + put_template_var() { printf '\033P\033]%d;rgb:%s\007\033\\' $@; } + put_template_custom() { printf '\033P\033]%s%s\007\033\\' $@; } +elif [ "${TERM%%-*}" = "linux" ]; then + put_template() { [ $1 -lt 16 ] && printf "\e]P%x%s" $1 $(echo $2 | sed 's/\///g'); } + put_template_var() { true; } + put_template_custom() { true; } +else + put_template() { printf '\033]4;%d;rgb:%s\033\\' $@; } + put_template_var() { printf '\033]%d;rgb:%s\033\\' $@; } + put_template_custom() { printf '\033]%s%s\033\\' $@; } +fi + +# 16 color space +put_template 0 $color00 +put_template 1 $color01 +put_template 2 $color02 +put_template 3 $color03 +put_template 4 $color04 +put_template 5 $color05 +put_template 6 $color06 +put_template 7 $color07 +put_template 8 $color08 +put_template 9 $color09 +put_template 10 $color10 +put_template 11 $color11 +put_template 12 $color12 +put_template 13 $color13 +put_template 14 $color14 +put_template 15 $color15 + +# 256 color space +put_template 16 $color16 +put_template 17 $color17 +put_template 18 $color18 +put_template 19 $color19 +put_template 20 $color20 +put_template 21 $color21 +put_template 22 $color22 + +# foreground / background / cursor color +if [ -n "$ITERM_SESSION_ID" ]; then + # iTerm2 proprietary escape codes + put_template_custom Pg c0c5ce # foreground + put_template_custom Ph 2b303b # background + put_template_custom Pi c0c5ce # bold color + put_template_custom Pj 4f5b66 # selection color + put_template_custom Pk c0c5ce # selected text color + put_template_custom Pl c0c5ce # cursor + put_template_custom Pm 2b303b # cursor text +else + put_template_var 10 $color_foreground + if [ "$BASE16_SHELL_SET_BACKGROUND" != false ]; then + put_template_var 11 $color_background + if [ "${TERM%%-*}" = "rxvt" ]; then + put_template_var 708 $color_background # internal border (rxvt) + fi + fi + put_template_custom 12 ";7" # cursor (reverse video) +fi + +# clean up +unset -f put_template +unset -f put_template_var +unset -f put_template_custom +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 + + diff --git a/site-modules/core/files/bin/git-merge-to b/site-modules/core/files/bin/git-merge-to new file mode 100755 index 0000000..9d88cb2 --- /dev/null +++ b/site-modules/core/files/bin/git-merge-to @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +# +# Merges a git branch into a another branch. +# +# Author: Ade Attwood +# Created: 2018-11-11 +# + +set -e + +MERGE_BRANCH="$1"; + +main() { + local branch=$(git rev-parse --abbrev-ref HEAD); + echo "Merging $branch with $MERGE_BRANCH"; + + git checkout $MERGE_BRANCH; + git pull origin $MERGE_BRANCH + git merge --ff-only --log $branch; +} + +if [[ ! -z "$1" ]]; then + main; + exit 0; +fi + +cat << HELP +Git Merge To + +For the reverse of \`git merge\` + +The flow for the script is: + +- Change to the target branch +- Pull branch for the latest changes +- Merge the previous branch + +Usage: $0 + +HELP + +exit 1; diff --git a/site-modules/core/files/bin/git-server-tag b/site-modules/core/files/bin/git-server-tag new file mode 100755 index 0000000..32ee74d --- /dev/null +++ b/site-modules/core/files/bin/git-server-tag @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +# +# Creates a git tag when publishing code to a server. +# +# Author: Ade Attwood +# Created: 2018-11-11 +# + +set -e + +SERVER="$1"; + +main() { + local date=`date +%Y-%m-%d-%H-%M`; + local tag="$SERVER/$date"; + + git tag "$tag"; + + echo "Tag $tag has been created"; + echo "You can push the tag by running"; + echo " git push origin $tag"; +} + +if [[ ! -z "$1" ]]; then + main; + exit 0; +fi + +cat << HELP +Git Server Tag + +When publishing code to a server you can run this command +and it will create a git tag with the server name and +date time you published the code + +Example Tag: \`stage/2018-11-11-17-17\` + +Usage: $0 + +HELP + +exit 1; diff --git a/dotfiles/bin/kdeclipboard b/site-modules/core/files/bin/kdeclipboard similarity index 100% rename from dotfiles/bin/kdeclipboard rename to site-modules/core/files/bin/kdeclipboard diff --git a/site-modules/core/files/bin/knock b/site-modules/core/files/bin/knock new file mode 100755 index 0000000..96a912a --- /dev/null +++ b/site-modules/core/files/bin/knock @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# +# Sends a http request to a URL and a port. This is used to knock on port to +# open other ports. See: https://wiki.archlinux.org/index.php/Port_knocking +# +# Using this in your `.ssh/config` as a proxy command can be a nice way to +# automatically knock on ports before connecting with ssh. +# +# Example: +# +# ``` +# ProxyCommand bash -c '/home/ade/.dotfiles/bin/knock %h {port_number}; exec /bin/nc %h %p' +# ``` +# +# Author: Ade Attwood +# Created: 2019-07-11 +# + +# +# Set off the http request +# +curl --max-time 5 http://$1:$2 > /dev/null 2>&1 & + +# +# Wait for a fuw seconds +# +sleep 2.5 + +# +# Return a success code to carry on the ssh connection +# +exit 0; + diff --git a/dotfiles/bin/tmux-gendev b/site-modules/core/files/bin/tmux-gendev similarity index 100% rename from dotfiles/bin/tmux-gendev rename to site-modules/core/files/bin/tmux-gendev diff --git a/site-modules/core/files/bin/ubuntu.startup b/site-modules/core/files/bin/ubuntu.startup new file mode 100755 index 0000000..e004ae0 --- /dev/null +++ b/site-modules/core/files/bin/ubuntu.startup @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# +# Script that runs on the start up of ubuntu gnome shell +# +# Author: Ade Attwood +# Created: 2019-02-16 +# + +# +# Load local Xresources fix to #3 +# +[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources diff --git a/site-modules/core/files/bin/update-sys b/site-modules/core/files/bin/update-sys new file mode 100755 index 0000000..5a2307b --- /dev/null +++ b/site-modules/core/files/bin/update-sys @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# +# Updates a systems packages and the dotfiles +# +# Author: Ade Attwood +# + +set -e + +# +# Update apt packages +# +sudo apt-get update; +sudo apt-get upgrade; + +# +# Update dotfiles +# +dotfiles update diff --git a/site-modules/core/files/fonts/LigaFreeMono.ttf b/site-modules/core/files/fonts/LigaFreeMono.ttf new file mode 100644 index 0000000..42d4a47 Binary files /dev/null and b/site-modules/core/files/fonts/LigaFreeMono.ttf differ diff --git a/site-modules/core/files/oh-my-zsh/custom.zsh b/site-modules/core/files/oh-my-zsh/custom.zsh new file mode 100644 index 0000000..3fe1027 --- /dev/null +++ b/site-modules/core/files/oh-my-zsh/custom.zsh @@ -0,0 +1,12 @@ +# +# Set up +# +SCRIPT_PATH="${0:A:h}" + +# +# Source all the custom lib files +# +for config_file ($ZSH_CUSTOM/custom/*.zsh); do + source $config_file +done +unset config_file diff --git a/site-modules/core/files/oh-my-zsh/custom/compress.zsh b/site-modules/core/files/oh-my-zsh/custom/compress.zsh new file mode 100644 index 0000000..2bb9614 --- /dev/null +++ b/site-modules/core/files/oh-my-zsh/custom/compress.zsh @@ -0,0 +1,38 @@ +function compress() { + local compression_type="gz" + + if (( $# == 0 )); then + cat <<-'EOF' >&2 + Usage: compress [-option] [file ...] + + Options: + -t, --type The compression tool you would like use to compress the target + EOF + fi + + if [[ "$1" == "-t" ]] || [[ "$1" == "--type" ]]; then + compression_type="$1" + shift + fi + + while (( $# > 0 )); do + if [[ ! -f "$1" ]] && [[ ! -d "$1" ]]; then + echo "compress: '$1' is not a valid file or directory" >&2 + shift + continue + fi + + success=0 + + if [[ "$compression_type" == 'gz' ]] && [[ -d "$1" ]]; then + tar -czvf "$1.tar.gz" $1 + fi + + if [[ "$compression_type" == 'gz' ]] && [[ -f "$1" ]]; then + gzip $1 + fi + + (( success = $success > 0 ? $success : $? )) + shift + done +} diff --git a/site-modules/core/files/oh-my-zsh/custom/docker.zsh b/site-modules/core/files/oh-my-zsh/custom/docker.zsh new file mode 100644 index 0000000..eb40478 --- /dev/null +++ b/site-modules/core/files/oh-my-zsh/custom/docker.zsh @@ -0,0 +1,42 @@ +# +# Docker +# +alias dk="docker" +alias dkl="docker logs -f" +alias dkps="docker ps --format '{{.ID}} ~ {{.Names}} ~ {{.Status}} ~ {{.Image}}' | column -t -s'~'" +alias dkrm="docker rm" + +function dke() { + # + # Get the container name you want to execute in + # + local container="$1" + # + # Shift the params so we can pass the rest to the container + # + shift + # + # Run the command in the container + # + docker exec -it $container /bin/bash -c "$@" +} + +function dklogin() { + docker exec -it $1 /bin/sh -c "[ -e /bin/bash ] && /bin/bash || /bin/sh" +} + +function dktop() { + docker stats --format "table {{.Container}}\t{{.Name}}\t{{.CPUPerc}} {{.MemPerc}}\t{{.NetIO}}\t{{.BlockIO}}" +} + +# +# Docker Compose +# +alias dkc="docker-compose" +alias dkcdown="docker-compose down" +alias dkcup="docker-compose up -d" + +function dkcrestart() { + docker-compose stop $1 + docker-compose up -d $1 +} diff --git a/site-modules/core/files/oh-my-zsh/custom/git.zsh b/site-modules/core/files/oh-my-zsh/custom/git.zsh new file mode 100644 index 0000000..7f0f797 --- /dev/null +++ b/site-modules/core/files/oh-my-zsh/custom/git.zsh @@ -0,0 +1,22 @@ +source $ZSH/lib/git.zsh + +alias gcon="git diff --name-only --diff-filter=U" +alias gml="git merge --log" +alias gl="git --no-pager log --oneline --reverse --max-count=40" + +function git_get_fetch_url() { + git remote show origin -n | awk '/Fetch URL:/{print $3}' +} + +function gi() { + curl -sL https://www.gitignore.io/api/$@; +} + +function ggpushmr() { + if [[ -z "$1" ]]; then + echo "Error: Target branch to create your merge request against is missing" + exit 1 + fi + + ggpush -o merge_request.create -o merge_request.target="$1" -o merge_request.merge_when_pipeline_succeeds -o merge_request.remove_source_branch +} diff --git a/site-modules/core/files/oh-my-zsh/custom/kubectl.zsh b/site-modules/core/files/oh-my-zsh/custom/kubectl.zsh new file mode 100644 index 0000000..5b9f6d1 --- /dev/null +++ b/site-modules/core/files/oh-my-zsh/custom/kubectl.zsh @@ -0,0 +1,18 @@ +if (( $+commands[kubectl] )); then + __KUBECTL_COMPLETION_FILE="${ZSH_CACHE_DIR}/kubectl_completion" + + if [[ ! -f $__KUBECTL_COMPLETION_FILE ]]; then + kubectl completion zsh >! $__KUBECTL_COMPLETION_FILE + fi + + [[ -f $__KUBECTL_COMPLETION_FILE ]] && source $__KUBECTL_COMPLETION_FILE + + unset __KUBECTL_COMPLETION_FILE +fi + +# This command is used a LOT both below and in daily life +alias k=kubectl + +alias kube-get-url="kubectl cluster-info | grep 'Kubernetes master' | awk '/http/ {print \$NF}'" +alias kube-get-cert="kubectl get secret \`kubectl get secrets | grep default-token | cut -d \" \" -f1\` -o jsonpath=\"{['data']['ca\.crt']}\" | base64 --decode" +alias kube-get-token="kubectl get secret \`kubectl get secrets | grep default-token | cut -d \" \" -f1\` -o jsonpath=\"{['data']['token']}\" | base64 --decode" diff --git a/site-modules/core/files/oh-my-zsh/custom/make.zsh b/site-modules/core/files/oh-my-zsh/custom/make.zsh new file mode 100644 index 0000000..8b6e41f --- /dev/null +++ b/site-modules/core/files/oh-my-zsh/custom/make.zsh @@ -0,0 +1,9 @@ +# +# Make alias for working with makefiles +# +# + +alias m="make" +alias mi="make install" +alias mb="make build" + diff --git a/site-modules/core/files/oh-my-zsh/custom/mdman.zsh b/site-modules/core/files/oh-my-zsh/custom/mdman.zsh new file mode 100644 index 0000000..f7549db --- /dev/null +++ b/site-modules/core/files/oh-my-zsh/custom/mdman.zsh @@ -0,0 +1,37 @@ + +# +# Displays markdown files in a man format +# +# Arguments: +# 1. The path to the markdown file +# Examples: +# mdman ~/docs/file.md +# +function mdman() { + local file="$1"; + + local tmp="/tmp/mdman"; + local tmp_file="$tmp/$(basename $file).man"; + + if [[ -f "$tmp_file" ]]; then + man "$tmp_file"; + return + fi + + mkdir -p "$tmp"; + + if [[ ! -f "$file" ]]; then + file=`locate "$file.md"` + + if [[ ! -f "$file" ]]; then + echo "$file is not found"; + return 1; + fi + fi + + if [[ ! -f "$tmp_file" ]];then + pandoc -s -t man "$file" -o "$tmp_file"; + fi + + man "$tmp_file"; +} diff --git a/site-modules/core/files/oh-my-zsh/custom/shortcuts.zsh b/site-modules/core/files/oh-my-zsh/custom/shortcuts.zsh new file mode 100644 index 0000000..daa615c --- /dev/null +++ b/site-modules/core/files/oh-my-zsh/custom/shortcuts.zsh @@ -0,0 +1,25 @@ +# +# Short cuts to map directories to variables +# + +dotfiles=~/.dotfiles + +# +# Folder for the dev projects +# +sites=~/sites +development=~/development +dev=$development + +# +# Mail short cuts +# +mail=~/mail +mutt_scripts=~/.mutt/scripts + +# +# Zsh hash +# +hash -d s=~/sites +hash -d df=~/.dotfiles +hash -d d=~/development diff --git a/site-modules/core/files/oh-my-zsh/custom/tmux.zsh b/site-modules/core/files/oh-my-zsh/custom/tmux.zsh new file mode 100644 index 0000000..d7d6ef3 --- /dev/null +++ b/site-modules/core/files/oh-my-zsh/custom/tmux.zsh @@ -0,0 +1,4 @@ + +alias tmux="tmux -2" +alias ts='tmux switch-client -t' +alias td='tmux detach-client' diff --git a/site-modules/core/files/oh-my-zsh/custom/vagrant.zsh b/site-modules/core/files/oh-my-zsh/custom/vagrant.zsh new file mode 100644 index 0000000..d031267 --- /dev/null +++ b/site-modules/core/files/oh-my-zsh/custom/vagrant.zsh @@ -0,0 +1,9 @@ + +alias v="vagrant" +alias vba="vagrant box add" +alias vbl="vagrant box list" +alias vbu="vagrant box update" +alias vr="vagrant reload" +alias vssh="vagrant ssh" +alias vup="vagrant up" +alias vh="vagrant halt" diff --git a/site-modules/core/files/oh-my-zsh/custom/yii2.zsh b/site-modules/core/files/oh-my-zsh/custom/yii2.zsh new file mode 100644 index 0000000..57829cc --- /dev/null +++ b/site-modules/core/files/oh-my-zsh/custom/yii2.zsh @@ -0,0 +1,5 @@ + +alias y="php yii" +alias ym="php yii migrate/up" +alias ymd="php yii migrate/down" +alias ycc="php yii cache/flush-all" diff --git a/site-modules/core/files/oh-my-zsh/lib/misc.zsh b/site-modules/core/files/oh-my-zsh/lib/misc.zsh new file mode 100644 index 0000000..af1fc94 --- /dev/null +++ b/site-modules/core/files/oh-my-zsh/lib/misc.zsh @@ -0,0 +1,22 @@ +# +# Overrode to he misc lib file to manipulate oh my zsh before the plugins are +# loaded. If you need to run code after the plugins you can see +# $ZSH_CUSTOM/custom.zsh +# + +# +# Load in the original misc file +# +source $ZSH/lib/misc.zsh + +# +# Add all of the plugins in the custom plugins dir automatically with out +# defining them in the pugins array +# +for plugin ($ZSH_CUSTOM/plugins/*); do + plugin_name="$(basename $plugin)" + if [[ ! -n "${plugins[(r)$plugin_name]}" ]]; then + plugins+=($plugin_name) + fi +done +unset plugin plugin_name diff --git a/site-modules/core/files/oh-my-zsh/plugins/notmuch/README.md b/site-modules/core/files/oh-my-zsh/plugins/notmuch/README.md new file mode 100644 index 0000000..c332ecd --- /dev/null +++ b/site-modules/core/files/oh-my-zsh/plugins/notmuch/README.md @@ -0,0 +1,19 @@ +# Notmuch oh my zsh plugin + +| Command | Description | +| ---- | ---- | +| nm | Alias for notmuch | +| nmc | Alias for notmuch count | +| nmm | Moves a notmuch search term into a specified folder | +| nmnew | Prints out all of the new mail useing the tag of "unread" | +| nms | Alias for notmuch search | +| nmt | Alias for notmuch tag | + +## Converting the docs + +To convert the docs you need `pandoc` installed and out can use this command + +~~~ zsh +find ./docs -name "*.md" -exec sh -c 'pandoc -s -t man "${0}" -o "./man/$(basename ${0%.md})"' {} \; +~~~ + diff --git a/site-modules/core/files/oh-my-zsh/plugins/notmuch/docs/notmuch-move.md b/site-modules/core/files/oh-my-zsh/plugins/notmuch/docs/notmuch-move.md new file mode 100644 index 0000000..282ebe2 --- /dev/null +++ b/site-modules/core/files/oh-my-zsh/plugins/notmuch/docs/notmuch-move.md @@ -0,0 +1,48 @@ +--- +title: NOTMUCH_OH_MY_ZSH + +section: 1 + +header: notmuch-move + +footer: Versoin 1.0.0 + +date: 2019-01-01 + +author: + - Ade Attwood + +lang: en-GB +--- + +# NAME + +notmuch-move — Move a notmuch search into a new directory + +# SYNOPSIS + +notmuch-move \ \ + +# DESCRIPTION + +Moves all of the emails found by a search term into a new directory + +## Aguments + +1, The path to move the emails to + +.., The notmuch search term + +## Options + +-h, --help + +: Loads this man page + +# EXAMPLES + +notmuch-move ~/mail/local/INBOX.Trash from:junk@email.com and tag:to-delete + +# SEE ALSO + +**notmuch-search(1)**, **notmuch-search-terms(7)** diff --git a/site-modules/core/files/oh-my-zsh/plugins/notmuch/notmuch.plugin.zsh b/site-modules/core/files/oh-my-zsh/plugins/notmuch/notmuch.plugin.zsh new file mode 100755 index 0000000..ab8d6db --- /dev/null +++ b/site-modules/core/files/oh-my-zsh/plugins/notmuch/notmuch.plugin.zsh @@ -0,0 +1,38 @@ +# +# This is the main plugin file for the plugin +# +# AUTHOR: Ade Attwood +# + +# +# Move all of the emails matching a search term into a folder +# +function notmuch-move() { + + if [[ "$1" == "--help" ]] || [[ "$1" == "-h" ]]; then + mdman "$dotfiles/oh-my-zsh/custom/plugins/notmuch/docs/notmuch-move.md"; + return 0; + fi + + if [ -z "$2" ]; then + echo "No search"; + return 1; + fi + + local path="$1"; shift; + local search="$@"; + + /usr/bin/notmuch search --output=files "$search" \ + | /usr/bin/xargs -I{} /bin/mv "{}" "$path"; +} + +# +# Aliases +# +alias nm="notmuch" +alias nmc="notmuch count" +alias nmm="notmuch-move" +alias nmnew="notmuch search tag:untrad" +alias nms="notmuch search" +alias nmt="notmuch tag" + diff --git a/site-modules/core/files/scripts/npm-install-package b/site-modules/core/files/scripts/npm-install-package new file mode 100755 index 0000000..ac05b02 --- /dev/null +++ b/site-modules/core/files/scripts/npm-install-package @@ -0,0 +1,10 @@ +#! /bin/bash + +# Set NVM_DIR if it isn't already defined +[[ -z "$NVM_DIR" ]] && export NVM_DIR="$HOME/.nvm" + +# Load nvm if it exists +[[ -f "$NVM_DIR/nvm.sh" ]] && source "$NVM_DIR/nvm.sh" + +# Install the package +npm install -g "$1" \ No newline at end of file diff --git a/site-modules/core/files/tmux.conf b/site-modules/core/files/tmux.conf new file mode 100644 index 0000000..a999a62 --- /dev/null +++ b/site-modules/core/files/tmux.conf @@ -0,0 +1,153 @@ +# split windows like vim +# vim's definition of a horizontal/vertical split is reversed from tmux's +bind s split-window -v -c "#{pane_current_path}" +bind v split-window -h -c "#{pane_current_path}" + +# Smart pane switching with awareness of vim splits +# See: https://github.com/christoomey/vim-tmux-navigator +is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ + | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" +bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L" +bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D" +bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U" +bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R" +bind-key -T copy-mode-vi C-h select-pane -L +bind-key -T copy-mode-vi C-j select-pane -D +bind-key -T copy-mode-vi C-k select-pane -U +bind-key -T copy-mode-vi C-l select-pane -R + +# +# Set color term +# +set-option -sg escape-time 10 +set-option -g default-terminal "xterm-256color" + +# +# Set long history +# +set-option -g history-limit 5000 + +# resize panes like vim +# feel free to change the "1" to however many lines you want to resize by, only +# one at a time can be slow +bind < resize-pane -L 1 +bind > resize-pane -R 1 +bind - resize-pane -D 1 +bind + resize-pane -U 1 + +# bind : to command-prompt like vim +# this is the default in tmux already +bind : command-prompt + +# vi-style controls for copy mode +setw -g mode-keys vi + +# set windows so they dont resize to the smallest +setw -g aggressive-resize on + +# use mouse on +set -g mouse on +set-option -g mouse on + +set -g @open-S 'https://www.duckduckgo.com/' + +# Init plugins +run-shell ~/.tmux/plugins/tmux-copycat/copycat.tmux +run-shell ~/.tmux/plugins/tmux-open/open.tmux +run-shell ~/.tmux/plugins/tmux-yank/yank.tmux + +# Automatically renumber window numbers on closing a pane (tmux >= 1.7). +set -g renumber-windows on + +# Stay in copy mode on drag end. +# (Would use `bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X +# stop-selection` but it is a bit glitchy.) +unbind-key -T copy-mode-vi MouseDragEnd1Pane + +# Search back to last prompt. +bind-key b copy-mode\; send-keys -X start-of-line\; send-keys -X search-backward "⇒"\; send-keys -X next-word + +# Set `v` key to start selection like vim +bind-key -T copy-mode-vi 'v' send -X begin-selection + +# Start window and pane numbering at 1, (0 is too hard to reach). +set -g base-index 1 +set -g pane-base-index 1 + +# Needed as on tmux 1.9 and up (defaults to off). +# Added in tmux commit c7a121cfc0137c907b7bfb. +# Also need by vim plugin tmux-focus-events.vim +set -g focus-events on + +# Powerline Double Blue - Tmux Theme +# Created by Jim Myhrberg . +# +# Inspired by vim-powerline: https://github.com/Lokaltog/powerline +# +# Requires terminal to be using a powerline compatible font, find one here: +# https://github.com/Lokaltog/powerline-fonts +# +# Original code form https://github.com/jimeh/tmux-themepack/blob/1.0.0/powerline/double/blue.tmuxtheme +# This has now been modufied to set color styles for tmux >= 2.9 ish + + +# Status update interval +set -g status-interval 1 + +# Basic status bar colors +set -g status-fg colour238 +set -g status-bg colour233 + +# Left side of status bar +set -g status-left-style bg=colour233,fg=colour243 +set -g status-left-length 40 +set -g status-left "#[fg=colour232,bg=colour24,bold] #S #[fg=colour24,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" + +# Right side of status bar +set -g status-right-style bg=colour233,fg=colour243 +set -g status-right-length 150 +set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour24,bg=colour240]#[fg=colour232,bg=colour24,bold] #H " + +# Window status +set -g window-status-format " #I:#W#F " +set -g window-status-current-format "#[fg=colour233,bg=black]#[fg=colour33,nobold] #I:#W#F #[fg=colour233,bg=black,nobold]" + +# Current window status +set -g window-status-current-style bg=colour24,fg=colour233 + +# Window with activity status +set -g window-status-activity-style fg=colour233,bg=colour245 # fg and bg are flipped here due to a bug in tmux + +# Highlight active window. +#set -w -g window-status-current-bg red +set -g window-style 'bg=colour22' +set -g window-active-style 'bg=colour0' + +# Window separator +set -g window-status-separator "" + +# Window status alignment +set -g status-justify centre + +# Pane border +set -g pane-border-style bg=default,fg=colour238 + +# Active pane border +set -g pane-active-border-style bg=default,fg=colour24 + +# Pane number indicator +set -g display-panes-colour colour233 +set -g display-panes-active-colour colour245 + +# Clock mode +set -g clock-mode-colour colour24 +set -g clock-mode-style 24 + +# Message +set -g message-style bg=colour24,fg=black + +# Command message +set -g message-command-style bg=colour233,fg=black + +# Mode +set -g mode-style bg=colour24,fg=colour231 diff --git a/site-modules/core/files/vim/UltiSnips/all.snippets b/site-modules/core/files/vim/UltiSnips/all.snippets new file mode 100644 index 0000000..4f79d40 --- /dev/null +++ b/site-modules/core/files/vim/UltiSnips/all.snippets @@ -0,0 +1,24 @@ +snippet date "YYYY-MM-DD" w +`!v strftime("%Y-%m-%d")` +endsnippet + +snippet ddate "Month DD, YYYY" w +`!v strftime("%b %d, %Y")` +endsnippet + +snippet diso "ISO format datetime" w +`!v strftime("%Y-%m-%d %H:%M:%S%z")` +endsnippet + +snippet time "hh:mm" w +`!v strftime("%H:%M")` +endsnippet + +snippet datetime "YYYY-MM-DD hh:mm" w +`!v strftime("%Y-%m-%d %H:%M")` +endsnippet + +snippet uuid "Random UUID" w +`!p if not snip.c: import uuid; snip.rv = uuid.uuid4()` +endsnippet + diff --git a/site-modules/core/files/vim/UltiSnips/gitcommit.snippets b/site-modules/core/files/vim/UltiSnips/gitcommit.snippets new file mode 100644 index 0000000..1a9b80c --- /dev/null +++ b/site-modules/core/files/vim/UltiSnips/gitcommit.snippets @@ -0,0 +1,45 @@ +snippet fix "Bug fix commit message" b +fix(${1:category}): ${2:title} + +${3:description} + +fixes issue ${4:issue number} +endsnippet + +snippet feat "Feature commit message" b +feat(${1:category}): ${2:title} +endsnippet + +snippet chore "Chore commit message" b +chore(${1:category}): ${2:title} +endsnippet + +snippet ci "Continuous intergration commit message" b +ci(${1:category}): ${2:title} +endsnippet + +snippet docs "Documentation commit message" b +docs(${1:category}): ${2:title} +endsnippet + +snippet test "Test commit message" b +test(${1:category}): ${2:title} +endsnippet + +snippet style "Code styling commit message" b +style(${1:category}): ${2:title} +endsnippet + +snippet perf "Performance commit message" b +perf(${1:category}): ${2:title} +endsnippet + +snippet refactor "Refactor commit message" b +refactor(${1:category}): ${2:title} +endsnippet + +snippet bc "Breaking change" b +BREAKING CHANGE: ${0:Description} +endsnippet + + diff --git a/site-modules/core/files/vim/UltiSnips/go.snippets b/site-modules/core/files/vim/UltiSnips/go.snippets new file mode 100644 index 0000000..e7fa0b3 --- /dev/null +++ b/site-modules/core/files/vim/UltiSnips/go.snippets @@ -0,0 +1,77 @@ + +snippet /^import/ "Import declaration" r +import ( + "${1:package}" +) +endsnippet + +snippet struct "Struct declaration" b +type ${1:Struct} struct { + ${0:${VISUAL}} +} +endsnippet + +snippet interface "Interface declaration" b +type ${1:Interface} interface { + ${0:${VISUAL}} +} +endsnippet + +snippet if "If statement" b +if ${1:condition}${1/(.+)/ /}{ + ${0:${VISUAL}} +} +endsnippet + +snippet switch "Switch statement" b +switch ${1:expression}${1/(.+)/ /}{ +case$0 +} +endsnippet + +snippet /^main/ "Main function" r +func main() { + ${0:${VISUAL}} +} +endsnippet + +snippet /^meth/ "Method" r +func (${1:receiver} ${2:type}) ${3:name}(${4:params})${5/(.+)/ /}${5:type} { + ${0:${VISUAL}} +} +endsnippet + +snippet func "Function" b +func ${1:name}(${2:params})${3/(.+)/ /}${3:type} { + ${0:${VISUAL}} +} +endsnippet + +snippet map "Map type" b +map[${1:keytype}]${2:valtype} +endsnippet + +snippet : "Variable declaration :=" b +${1:name} := ${0:value} +endsnippet + +snippet var "Variable declaration" b +var ${1:name}${2/(.+)/ /}${2:type}${3: = ${0:value}} +endsnippet + +snippet vars "Variables declaration" b +var ( + ${1:name}${2/(.+)/ /}${2:type}${3: = ${0:value} } +) +endsnippet + +snippet json "JSON field" +\`json:"${1:displayName}"\` +endsnippet + +snippet err "Basic error handling" b +if err != nil { + log.${1:Fatal}(err) +} +endsnippet + diff --git a/dotfiles/vim/UltiSnips/html.snippets b/site-modules/core/files/vim/UltiSnips/html.snippets similarity index 100% rename from dotfiles/vim/UltiSnips/html.snippets rename to site-modules/core/files/vim/UltiSnips/html.snippets diff --git a/dotfiles/vim/UltiSnips/html_php.snippets b/site-modules/core/files/vim/UltiSnips/html_php.snippets similarity index 82% rename from dotfiles/vim/UltiSnips/html_php.snippets rename to site-modules/core/files/vim/UltiSnips/html_php.snippets index ef0a306..74fc4e5 100644 --- a/dotfiles/vim/UltiSnips/html_php.snippets +++ b/site-modules/core/files/vim/UltiSnips/html_php.snippets @@ -1,14 +1,14 @@ snippet php "php tag" i - + endsnippet snippet phpe "php echo tag" i - + endsnippet snippet phpif "php if statment" b - $2 + $0 endsnippet @@ -16,7 +16,7 @@ snippet phpife "php if else statment" b $2 - $3 + $0 endsnippet @@ -26,18 +26,22 @@ snippet phpifeif "php if else if statment" b $4 - $5 + $0 endsnippet snippet phpfe "php foreach" b ${3:$value}): ?> - $4 + $0 endsnippet snippet phpf "php for loop" b - $3 + $0 endsnippet + +snippet prdd "vardump in php tags" b + +endsnippet diff --git a/site-modules/core/files/vim/UltiSnips/javascript.snippets b/site-modules/core/files/vim/UltiSnips/javascript.snippets new file mode 100644 index 0000000..f569382 --- /dev/null +++ b/site-modules/core/files/vim/UltiSnips/javascript.snippets @@ -0,0 +1,93 @@ +snippet #! "shebang" +#!/usr/bin/env node +endsnippet + +snippet vreq "assign a CommonJS-style module to a var" +const ${0:${1/(.+\/)*(\w+)(-|\b|$)(\..+$)?/\u$2/g}} = require('$1'); +endsnippet + +snippet import "ES6 import" b +import {$0} from '$1'; +endsnippet + +snippet ex "module.exports" +module.exports = $0; +endsnippet + +snippet default "export default" b +export default $0 +endsnippet + +snippet cl "Console LOG" b +console.log($0); +endsnippet + +snippet cw "Console Warn" b +console.warn($0); +endsnippet + +snippet ce "Console Error" b +console.error($0); +endsnippet + +snippet rfc "React functional component" b +export const ${1:Name} = (${2:props})=> { + return ( + ${0:
Component
} + ); +}; + +$1.propTypes = {}; +endsnippet + +snippet rc "React component" b +export class ${1:Name} extends React.Component { + static propTypes = {}; + + state = {}; + + render() { + return ( + ${0:
Component
} + ); + } +} +endsnippet + +snippet raect "Adds react import statements" b +import React from 'react'; +import PropTypes from 'prop-types'; +endsnippet + +snippet useState "React.useState" w +const [$1, set${1/\w+\s*/\u$0/g}] = React.useState(${3:''});${0} +endsnippet + +snippet useEffect "useEffect" w +React.useEffect(() => { + $0 +}); +endsnippet + +snippet useContext "useContext" w +const $1 = React.useContext($2);${0} +endsnippet + +snippet useCallback "useCallback" w +React.useCallback( + () => { + $0 + }, + [$1], +); +endsnippet + +snippet useMemo "useMemo" w +const $1 = React.useMemo(() => { + ${0} +}, [$2]); +endsnippet + +snippet useRef "useRef" w +const $1 = React.useRef($2);${0} +endsnippet diff --git a/site-modules/core/files/vim/UltiSnips/markdown.snippets b/site-modules/core/files/vim/UltiSnips/markdown.snippets new file mode 100644 index 0000000..001e87f --- /dev/null +++ b/site-modules/core/files/vim/UltiSnips/markdown.snippets @@ -0,0 +1,42 @@ +snippet link "Link to something" +[${1:${VISUAL:Text}}](${3:http://${2:www.url.com}})$0 +endsnippet + +snippet img "Image" +![${1:pic alt}](${2:path}${3/.+/ "/}${3:opt title}${3/.+/"/})$0 +endsnippet + +snippet icode "Inline Code" i +\`$1\`$0 +endsnippet + +snippet code "Codeblock" b +\`\`\`${1:lang} +$2 +\`\`\` +$0 +endsnippet + +snippet table "A base table layout" b +|${0} | | | | | +|---|---|---|---|---| +| | | | | | +endsnippet + +snippet frontmatter "A basic frontmatter block" b +--- +title: ${1:Title} +comments: false +date: ${2:date} +tags: + - ${3:tags} +categories: + - ${4:categories} +--- + +${0} +endsnippet + +snippet more "A more comment tag for blogs" b + +endsnippet diff --git a/site-modules/core/files/vim/UltiSnips/pdv_templates/attribute.tpl b/site-modules/core/files/vim/UltiSnips/pdv_templates/attribute.tpl new file mode 100644 index 0000000..5556a10 --- /dev/null +++ b/site-modules/core/files/vim/UltiSnips/pdv_templates/attribute.tpl @@ -0,0 +1,5 @@ +/** + * ${1:{{name}}} + * + * @var ${2:{{type}}{{^type}}mixed{{/type}}} + */ diff --git a/site-modules/core/files/vim/UltiSnips/pdv_templates/class.tpl b/site-modules/core/files/vim/UltiSnips/pdv_templates/class.tpl new file mode 100644 index 0000000..78431c6 --- /dev/null +++ b/site-modules/core/files/vim/UltiSnips/pdv_templates/class.tpl @@ -0,0 +1,11 @@ +/** + * ${1:{{name}}} + * + * @category Project + * @package \{\{package\}\} + * @author Ade Attwood + * @copyright `!v strftime('%Y')` Practically.io{{#interfaces}} + * @see {{name}}{{/interfaces}}{{#parent}} + * @see {{name}}{{/parent}}{{#abstract}} + * @abstract {{/abstract}} + */ diff --git a/site-modules/core/files/vim/UltiSnips/pdv_templates/const.tpl b/site-modules/core/files/vim/UltiSnips/pdv_templates/const.tpl new file mode 100644 index 0000000..df89103 --- /dev/null +++ b/site-modules/core/files/vim/UltiSnips/pdv_templates/const.tpl @@ -0,0 +1,3 @@ +/** + * ${1:{{name}}} + */ diff --git a/site-modules/core/files/vim/UltiSnips/pdv_templates/function.tpl b/site-modules/core/files/vim/UltiSnips/pdv_templates/function.tpl new file mode 100644 index 0000000..1eea796 --- /dev/null +++ b/site-modules/core/files/vim/UltiSnips/pdv_templates/function.tpl @@ -0,0 +1,5 @@ +/** + * ${1:{{name}}}{{?func: vmustache#InitCounter("params", 1)}} + *{{#parameters}} + * @param ${{{?func: vmustache#IncrementCounter("params")}}:{{type}}{{^type}}mixed{{/type}}} ${{name}}${{{?func: vmustache#IncrementCounter("params")}}}{{/parameters}} + */ diff --git a/site-modules/core/files/vim/UltiSnips/pdv_templates/interface.tpl b/site-modules/core/files/vim/UltiSnips/pdv_templates/interface.tpl new file mode 100644 index 0000000..dc7aee1 --- /dev/null +++ b/site-modules/core/files/vim/UltiSnips/pdv_templates/interface.tpl @@ -0,0 +1,5 @@ +/** + * Interface: ${1:{{name}}} + *{{#parents}} + * @see {{name}}{{/parents}} + */ diff --git a/site-modules/core/files/vim/UltiSnips/pdv_templates/trait.tpl b/site-modules/core/files/vim/UltiSnips/pdv_templates/trait.tpl new file mode 100644 index 0000000..7c8e8f2 --- /dev/null +++ b/site-modules/core/files/vim/UltiSnips/pdv_templates/trait.tpl @@ -0,0 +1,3 @@ +/** + * Trait: ${1:{{name}}} + */ diff --git a/dotfiles/vim/UltiSnips/php.snippets b/site-modules/core/files/vim/UltiSnips/php.snippets similarity index 67% rename from dotfiles/vim/UltiSnips/php.snippets rename to site-modules/core/files/vim/UltiSnips/php.snippets index e561266..84c6fba 100644 --- a/dotfiles/vim/UltiSnips/php.snippets +++ b/site-modules/core/files/vim/UltiSnips/php.snippets @@ -1,101 +1,112 @@ snippet - "" i -->$1 +->$0 endsnippet snippet = "" i -=> +=>$0 endsnippet -snippet this "Description" b -$this->$1 +snippet this "Description" i +$this->$0 endsnippet -snippet pr "Dumb debug helper in HTML" -echo '
' . var_export($1, 1) . '
';$0 +snippet dd "Dumb debug helper in HTML" +echo '
' . var_dump($1, 1) . '
';$0 +endsnippet + +snippet dump "Symfony Dump" i +dump(${1:var}); +endsnippet + +snippet dumpd "Symfony Dump Die" i +dump(${1:var}); +die; +endsnippet + +snippet rdd "Revo die var" i +\revo\Revo::dieVar(${1:var}); +endsnippet + +snippet ai "Array item" i +'${1:key}' => ${0:value} +endsnippet + +snippet try "Try and catch block" b +try { + $0 +} catch (\Exception $e) {} endsnippet snippet pub "Public function" b /** * ${3:undocumented function} * - * @return ${4:void} + * @return $4 */ -public function ${1:name}(${2:$param}) +public function ${1:name}(${2:$param})${3:: ${4:void}} { - ${VISUAL}${5:return null;} - + ${VISUAL}$0 } -$0 endsnippet snippet pro "Protected function" b /** * ${3:undocumented function} * - * @return ${4:void} + * @return $4 */ -protected function ${1:name}(${2:$param}) +protected function ${1:name}(${2:$param})${3:: ${4:void}} { - ${VISUAL}${5:return null;} - + ${VISUAL}$0 } -$0 endsnippet snippet pri "Private function" b /** * ${3:undocumented function} * - * @return ${4:void} + * @return $4 */ -private function ${1:name}(${2:$param}) +private function ${1:name}(${2:$param})${3:: ${4:void}} { - ${VISUAL}${5:return null;} - + ${VISUAL}$0 } -$0 endsnippet snippet pubs "Public static function" b /** * ${3:undocumented function} * - * @return ${4:void} + * @return $4 */ -public static function ${1:name}(${2:$param}) +public static function ${1:name}(${2:$param})${3:: ${4:void}} { - ${VISUAL}${5:return null;} - + ${VISUAL}$0 } -$0 endsnippet snippet pros "Protected static function" b /** * ${3:undocumented function} * - * @return ${4:void} + * @return $4 */ -protected static function ${1:name}(${2:$param}) +protected static function ${1:name}(${2:$param})${3:: ${4:void}} { - ${VISUAL}${5:return null;} - + ${VISUAL}$0 } -$0 endsnippet snippet pris "Private static function" b /** * ${3:undocumented function} * - * @return ${4:void} + * @return $4 */ -private static function ${1:name}(${2:$param}) +private static function ${1:name}(${2:$param})${3:: ${4:void}} { - ${VISUAL}${5:return null;} - + ${VISUAL}$0 } -$0 endsnippet snippet new "New class instance" b @@ -115,6 +126,8 @@ endsnippet snippet class "Class declaration template" b wantToTest('${2:dis}'); + ${3://test} +} +endsnippet + +snippet utest "Unit test" b +public function ${1:name}(UnitTester $I): void +{ + $I->wantToTest('${2:dis}'); + ${3://test} +} +endsnippet + + +snippet atest "Acceptance test" b +public function ${1:name}(AcceptanceTester $I): void +{ + $I->wantToTest('${2:dis}'); + ${3://test} +} +endsnippet + +snippet _b+a "Before and After class" b +public function _before(${1:inject}) +{ +} + +public function _after($1) +{ +} +endsnippet + diff --git a/site-modules/core/files/vim/UltiSnips/php_html.snippets b/site-modules/core/files/vim/UltiSnips/php_html.snippets new file mode 100644 index 0000000..56b0f9d --- /dev/null +++ b/site-modules/core/files/vim/UltiSnips/php_html.snippets @@ -0,0 +1,65 @@ +snippet php "php tag" i + +endsnippet + +snippet phpe "php echo tag" i + +endsnippet + +snippet phpif "php if statment" b + + $0 + +endsnippet + +snippet phpife "php if else statment" b + + $2 + + $0 + +endsnippet + +snippet phpifeif "php if else if statment" b + + $2 + + $4 + + $0 + +endsnippet + +snippet phpfe "php foreach" b +${3:$value}): ?> + $0 + +endsnippet + +snippet phpf "php for loop" b + + $0 + +endsnippet + +snippet var-doc "Code for createing a vardoc" b +echo '
';
+echo '/**'.PHP_EOL;
+echo ' *'.PHP_EOL;
+$_type = gettype($this) == 'object' ? get_class($this) : gettype($this);
+echo " * @var $_type \\$this\n";
+foreach(get_defined_vars() as $name => $var) {
+    if (substr($name, 0, strlen('_')) !== '_' && $name !== 'this') {
+        if (is_array($var) && isset($var[0]) && gettype($var[0]) == 'object') {
+            $type = get_class($var[0]);
+            echo " * @var {$type}[] \$$name\n";
+            continue;
+        }
+        $type = gettype($var) == 'object' ? get_class($var) : gettype($var);
+        echo " * @var $type \$$name\n";
+    }
+}
+echo ' */'.PHP_EOL;
+echo "
"; +die; +endsnippet diff --git a/dotfiles/vim/UltiSnips/php_yii.snippets b/site-modules/core/files/vim/UltiSnips/php_yii.snippets similarity index 77% rename from dotfiles/vim/UltiSnips/php_yii.snippets rename to site-modules/core/files/vim/UltiSnips/php_yii.snippets index e0faa3b..bf0c79b 100644 --- a/dotfiles/vim/UltiSnips/php_yii.snippets +++ b/site-modules/core/files/vim/UltiSnips/php_yii.snippets @@ -2,7 +2,7 @@ snippet yiifk "migration foreign key" b /* * FOREIGN KEY : ${1:Table}.${2:Field} * REFERENCES : ${3:Reference Table}.${4:Reference Field} - */ + */ $this->addForeignKey( 'fk-$1-$2', '$1', @@ -12,3 +12,7 @@ $this->addForeignKey( 'CASCADE' ); endsnippet + +snippet yapp "Yii App" i +Yii::$app->${1:Command} +endsnippet diff --git a/site-modules/core/files/vim/UltiSnips/puppet.snippets b/site-modules/core/files/vim/UltiSnips/puppet.snippets new file mode 100644 index 0000000..fc7fb52 --- /dev/null +++ b/site-modules/core/files/vim/UltiSnips/puppet.snippets @@ -0,0 +1,66 @@ +# +# Python helper code for generating namespaces +# +# See: https://github.com/honza/vim-snippets/blob/master/UltiSnips/puppet.snippets +# + +global !p +import vim +import os.path +def get_module_namespace_and_basename(): + """This function will try to guess the current class or define name you are + trying to create. Note that for this to work you should be using the module + structure as per the style guide. Examples inputs and it's output + * /home/nikolavp/puppet/modules/collectd/manifests/init.pp -> collectd + * /home/nikolavp/puppet/modules/collectd/manfistes/mysql.pp -> collectd::mysql + """ + first_time = True + current_file_path_without_ext = vim.eval('expand("%:p:r")') or "" + if not current_file_path_without_ext: + return "name" + parts = os.path.split(current_file_path_without_ext) + namespace = '' + while parts[0] and parts[0] != '/': + if parts[1] == 'init' and first_time and not namespace: + first_time = False + parts = os.path.split(parts[0]) + continue + if parts[1] == 'manifests': + return os.path.split(parts[0])[1] + ('::' + namespace).rstrip(':') + else: + namespace = parts[1] + '::' + namespace + parts = os.path.split(parts[0]) + return "name" +endglobal + +# +# Snippets +# + +snippet class "Class declaration" b +class ${1:`!p snip.rv = get_module_namespace_and_basename()`} { + ${0:# Puppet code} +} +endsnippet + +snippet define "Definition" b +define ${1:`!p snip.rv = get_module_namespace_and_basename()`} { + ${0:# Puppet Code} +} +endsnippet + +snippet = "" i +=>$0 +endsnippet + +snippet ai "Array item" i +'${1:key}' => ${0:value} +endsnippet + +snippet alert "Alert Function" b +alert("${1:message}")$0 +endsnippet + +snippet info "Info Function" b +info("${1:message}")$0 +endsnippet diff --git a/site-modules/core/files/vim/UltiSnips/sh.snippets b/site-modules/core/files/vim/UltiSnips/sh.snippets new file mode 100644 index 0000000..d4e4856 --- /dev/null +++ b/site-modules/core/files/vim/UltiSnips/sh.snippets @@ -0,0 +1,35 @@ +global !p +import vim + +# Tests for the existence of a variable declared by Vim's filetype detection +# suggesting the type of shell script of the current file +def testShell(scope, shell): + return vim.eval("exists('" + scope + ":is_" + shell + "')") + +# Loops over the possible variables, checking for global variables +# first since they indicate an override by the user. +def getShell(): + for scope in ["g", "b"]: + for shell in ["bash", "posix", "sh", "kornshell"]: + if testShell(scope, shell) == "1": + if shell == "kornshell": + return "ksh" + if shell == "posix": + return "sh" + return shell + return "sh" +endglobal + +snippet #! +`!p snip.rv = '#!/bin/' + getShell() + "\n\n" ` +endsnippet + +snippet !env "#!/usr/bin/env (!env)" +`!p snip.rv = '#!/usr/bin/env ' + getShell() + "\n\n" ` +endsnippet + +snippet if "If Condition" b +if [ $1 ]; then + $0 +fi +endsnippet diff --git a/dotfiles/vim/UltiSnips/snippets.snippets b/site-modules/core/files/vim/UltiSnips/snippets.snippets similarity index 99% rename from dotfiles/vim/UltiSnips/snippets.snippets rename to site-modules/core/files/vim/UltiSnips/snippets.snippets index b4778e9..0543cdd 100644 --- a/dotfiles/vim/UltiSnips/snippets.snippets +++ b/site-modules/core/files/vim/UltiSnips/snippets.snippets @@ -15,3 +15,4 @@ endsnippet snippet vis "${VISUAL}" i \$\{VISUAL${1:${2:default}${3:/transform/}}\} endsnippet + diff --git a/site-modules/core/files/vim/UltiSnips/typescript.snippets b/site-modules/core/files/vim/UltiSnips/typescript.snippets new file mode 100644 index 0000000..4e2a0eb --- /dev/null +++ b/site-modules/core/files/vim/UltiSnips/typescript.snippets @@ -0,0 +1,31 @@ +extends javascript +priority 1 + +snippet rfc "React functional component" b +export interface $1Props {}; + +export const ${1:Name}:React.FC<$1Props> = (${2:props}) => { + return ( + ${0:
Component
} + ); +}; +endsnippet + +snippet rc "React component" b +export interface $1State {}; +export interface $1Props {}; + +export class ${1:Name} extends React.Component<$1Props, $1State> { + public state: $1State = {} + + public render(): JSX.Element { + return ( + ${0:
Component
} + ); + } +} +endsnippet + +snippet react "Adds react import statements" b +import * as React from 'react'; +endsnippet diff --git a/site-modules/core/files/vim/after/plugin/commandt.vim b/site-modules/core/files/vim/after/plugin/commandt.vim new file mode 100644 index 0000000..233d480 --- /dev/null +++ b/site-modules/core/files/vim/after/plugin/commandt.vim @@ -0,0 +1,28 @@ + + +function! s:GotoOrOpen(command_and_args) abort + let l:command_and_args = split(a:command_and_args, '\v^\w+ \zs') + let l:command = l:command_and_args[0] + let l:file = l:command_and_args[1] + + " + " Fix for switching to terminals in neo vim + " + if match(l:file, 'term:/') >= 0 + execute 'buffer ' . substitute(l:file, 'term:/', 'term://.//', '') + return + endif + + if buffer_exists(l:file) && match(l:command, 'edit') >= 0 + execute 'buffer ' . l:file + else + execute l:command . l:file + endif +endfunction + +command! -nargs=+ CommandTOpen call s:GotoOrOpen() + +let g:CommandTAcceptSelectionCommand = 'CommandTOpen edit' +let g:CommandTAcceptSelectionTabCommand = 'CommandTOpen tabe' +let g:CommandTAcceptSelectionSplitCommand = 'CommandTOpen sp' +let g:CommandTAcceptSelectionVSplitCommand = 'CommandTOpen vs' diff --git a/site-modules/core/files/vim/after/plugin/vim-jsx.vim b/site-modules/core/files/vim/after/plugin/vim-jsx.vim new file mode 100644 index 0000000..2c63207 --- /dev/null +++ b/site-modules/core/files/vim/after/plugin/vim-jsx.vim @@ -0,0 +1,4 @@ +" +" Sort vim-jsx settting js files to javascript.jsx +" +let g:jsx_ext_required=1 diff --git a/site-modules/core/files/vim/autoload/aa/buffer.vim b/site-modules/core/files/vim/autoload/aa/buffer.vim new file mode 100644 index 0000000..d988184 --- /dev/null +++ b/site-modules/core/files/vim/autoload/aa/buffer.vim @@ -0,0 +1,58 @@ +" +" Orignaly from google maktaba +" https://github.com/google/vim-maktaba/blob/master/autoload/maktaba/buffer.vim#L15 +" +" Gets the text of the current or last visual selection. +" Useful for visual mode mappings. +function! aa#buffer#GetVisualSelection() abort + let [l:lnum1, l:col1] = getpos("'<")[1:2] + let [l:lnum2, l:col2] = getpos("'>")[1:2] + " 'selection' is a rarely-used option for overriding whether the last + " character is included in the selection. Bizarrely, it always affects the + " last character even when selecting from the end backwards. + if &selection !=# 'inclusive' + let l:col2 -= 1 + endif + let l:lines = getline(l:lnum1, l:lnum2) + if !empty(l:lines) + " If there is only 1 line, the part after the selection must be removed + " first because `col2` is relative to the start of the line. + let l:lines[-1] = l:lines[-1][: l:col2 - 1] + let l:lines[0] = l:lines[0][l:col1 - 1 : ] + endif + return join(l:lines, "\n") +endfunction + +" +" Mainly taken form maktab. This just uses the pure vim implemetaion to +" replace lines +" +function! aa#buffer#Overwrite(startline, endline, lines) abort + " If lines already match, don't modify buffer. + if getline(a:startline, a:endline) == a:lines + return + endif + + " Lines being replaced minus lines being inserted. + let l:line_delta = len(a:lines) - (a:endline + 1 - a:startline) + " If there's a surplus (more to replace than insert), delete the last n lines. + if l:line_delta < 0 + let l:winview = winsaveview() + let l:keep_end = a:endline - (-l:line_delta) + execute string(l:keep_end + 1) . ',' . string(a:endline) . 'delete' + " Special case: Move the cursor up to track buffer changes if necessary. + " If we delete lines above the cursor, the cursor should NOT remain on the + " same line number. + if l:winview.lnum > a:endline + let l:winview.lnum += l:line_delta + endif + call winrestview(l:winview) + endif + " If there's a deficit (more to insert than replace), append the last n lines. + let l:lines = a:lines + if l:line_delta > 0 + call append(a:endline, a:lines[-l:line_delta : ]) + let l:lines = l:lines[ : -l:line_delta - 1] + endif + call setline(a:startline, l:lines) +endfunction diff --git a/site-modules/core/files/vim/autoload/aa/emmet.vim b/site-modules/core/files/vim/autoload/aa/emmet.vim new file mode 100644 index 0000000..1a2c2d4 --- /dev/null +++ b/site-modules/core/files/vim/autoload/aa/emmet.vim @@ -0,0 +1,21 @@ +function aa#emmet#init() + " + " Don't install emmet globally we want to only use it on selected languages + " + let g:user_emmet_install_global = 0 + + " + " Set Ctrl-E emmet trigger + " + "let g:user_emmet_leader_key='' + + " + " Add the emmet package + " + packadd emmet-vim + + " + " Install the package + " + EmmetInstall +endfunction diff --git a/site-modules/core/files/vim/autoload/aa/fold.vim b/site-modules/core/files/vim/autoload/aa/fold.vim new file mode 100644 index 0000000..58a150e --- /dev/null +++ b/site-modules/core/files/vim/autoload/aa/fold.vim @@ -0,0 +1,94 @@ +" +" Sets all the settings for different fold types +" +" a:type +" The type of fold you want to set. +" Valid options are 'marker', 'indent', 'diff', hunk and 'off' +" +function! aa#fold#set_fold(type) + if a:type == "marker" + setlocal foldenable + setlocal foldmethod=marker + setlocal foldlevel=0 + setlocal foldnestmax=99 + elseif a:type == "indent" + setlocal foldenable + setlocal foldmethod=indent + setlocal foldlevel=1 + setlocal foldnestmax=2 + elseif a:type == "diff" + setlocal foldenable + setlocal nomodeline formatoptions-=croq formatoptions+=tl + setlocal foldmethod=expr + setlocal foldexpr=aa#fold#diff_fold() + setlocal foldcolumn=3 + elseif a:type == "hunk" + setlocal foldenable + setlocal nomodeline formatoptions-=croq formatoptions+=tl + setlocal foldmethod=expr + setlocal foldexpr=aa#fold#diff_hunk_fold() + setlocal foldcolumn=3 + elseif a:type == 'off' + set nofoldenable + else + echoerr a:type . " is not a valid fold use 'off', 'marker' or 'indent'" + endif +endfunction + +" +" Get the competition list for `set_fold()` +" +function! aa#fold#command_complete(a, cm, cu) + return ['off', 'marker', 'indent', 'diff', 'hunk'] +endfunction + +" +" Get the fold text for displaying neat folds +" See: https://dhruvasagar.com/2013/03/28/vim-better-foldtext +" +function! aa#fold#fold_text() + let line = ' ' . substitute(getline(v:foldstart), '^\s*"\?\s*\|\s*"\?\s*{{' . '{\d*\s*', '', 'g') . ' ' + let lines_count = v:foldend - v:foldstart + 1 + let lines_count_text = '| ' . printf("%10s", lines_count . ' linesss') . ' |' + let foldchar = '-' + let foldtextstart = strpart('+' . repeat(foldchar, v:foldlevel*2) . line, 0, (winwidth(0)*2)/3) + let foldtextend = lines_count_text . repeat(foldchar, 8) + let foldtextlength = strlen(substitute(foldtextstart . foldtextend, '.', 'x', 'g')) + &foldcolumn + return foldtextstart . repeat(foldchar, winwidth(0)-foldtextlength) . foldtextend +endfunction + +" +" function for the `foldexpr` to fold git diffs +" +" Inspired from https://github.com/sgeb/vim-diff-fold +" +function! aa#fold#diff_fold() + let l:line=getline(v:lnum) + + if l:line =~# '^\(diff\|Index\)' + return '>1' + else + return '=' + endif +endfunction + +" +" function for the `foldexpr` to fold git diffs and hunks +" +" Inspired from https://github.com/sgeb/vim-diff-fold +" +function! aa#fold#diff_hunk_fold() + let l:line=getline(v:lnum) + + if l:line =~# '^\(diff\|Index\)' + return '>1' + elseif l:line =~# '^\(@@\|\d\)' + return '>2' + elseif l:line =~# '^\*\*\* \d\+,\d\+ \*\*\*\*$' + return '>2' + elseif l:line =~# '^--- \d\+,\d\+ ----$' + return '>2' + else + return '=' + endif +endfunction diff --git a/site-modules/core/files/vim/autoload/aa/functions.vim b/site-modules/core/files/vim/autoload/aa/functions.vim new file mode 100644 index 0000000..8c26eb4 --- /dev/null +++ b/site-modules/core/files/vim/autoload/aa/functions.vim @@ -0,0 +1,75 @@ +" +" Turn line numbers on +" +" This set all settings for relative number and enables git gutter +" +function! aa#functions#number_on(local) + if a:local == 1 + setlocal relativenumber + setlocal number + setlocal signcolumn=yes + else + set relativenumber + set number + set signcolumn=yes + endif + + if exists(':GitGutterEnable') + GitGutterEnable + endif + + let g:linenumber=1 +endfunction + +" +" Turn line numbers off +" +" Disables line numbers and git gutter +" +function! aa#functions#number_off(local) + if a:local == 1 + setlocal norelativenumber + setlocal nonumber + setlocal signcolumn=no + else + set norelativenumber + set nonumber + set signcolumn=no + endif + + + if exists(':GitGutterDisable') + GitGutterDisable + endif + + let g:linenumber=0 +endfunction + +" +" Toggles line numbers and all of the relevant settings +" +function! aa#functions#toggle_numbers() + if g:linenumber + call aa#functions#number_off(0) + else + call aa#functions#number_on(0) + end +endfunction + +" +" Display ruler if text is over a specified char length +" +" a:lengthLimit +" The char length when to show the column ruler +" +function! aa#functions#show_column_if_line_too_long(lengthLimit) + " See https://stackoverflow.com/questions/2075276/longest-line-in-vim#2982789 + let maxLineLength = max(map(getline(1,'$'), 'len(v:val)')) + + if maxLineLength > a:lengthLimit + highlight ColorColumn ctermbg=18 guibg=18 + execute "set colorcolumn=" . join(range((a:lengthLimit + 1),999), ",") + else + set colorcolumn="" + endif +endfunction diff --git a/site-modules/core/files/vim/autoload/aa/languagetool.vim b/site-modules/core/files/vim/autoload/aa/languagetool.vim new file mode 100644 index 0000000..8610e98 --- /dev/null +++ b/site-modules/core/files/vim/autoload/aa/languagetool.vim @@ -0,0 +1,6 @@ +function! aa#languagetool#init() + let g:languagetool_jar = "~/.local/share/LanguageTool-4.6/languagetool-commandline.jar" + let g:languagetool_lang = 'en-GB' + + packadd vim-LanguageTool +endfunction diff --git a/site-modules/core/files/vim/autoload/aa/supertab.vim b/site-modules/core/files/vim/autoload/aa/supertab.vim new file mode 100644 index 0000000..ecb75d8 --- /dev/null +++ b/site-modules/core/files/vim/autoload/aa/supertab.vim @@ -0,0 +1,36 @@ +function aa#supertab#expand() + if exists('g:UltiSnipsEnableSnipMate') + " + " Try to expand snippet or go to the next tab stop + " + call UltiSnips#ExpandSnippetOrJump() + if g:ulti_expand_or_jump_res != 0 + let g:ulti_expand_or_jump_res = 0 + return "" + endif + endif + + " + " If popup is open cycle through the items this will most likely be + " deoplete completion + " + if pumvisible() + return "\" + endif + + if exists('g:loaded_emmet_vim') + + " + " If there is an emmet expression expand it + " + if emmet#isExpandable() + call emmet#expandAbbr(0,"") + return "\" + endif + endif + + " + " If all else fails just tab along + " + return "\" +endfunction diff --git a/dotfiles/vim/autoload/pathogen.vim b/site-modules/core/files/vim/autoload/pathogen.vim similarity index 100% rename from dotfiles/vim/autoload/pathogen.vim rename to site-modules/core/files/vim/autoload/pathogen.vim diff --git a/site-modules/core/files/vim/coc-settings.json b/site-modules/core/files/vim/coc-settings.json new file mode 100644 index 0000000..0ed75b5 --- /dev/null +++ b/site-modules/core/files/vim/coc-settings.json @@ -0,0 +1,63 @@ +{ + "diagnostic.virtualText": true, + "diagnostic.enableHighlightLineNumber": false, + "diagnostic.errorSign": "❌", + "diagnostic.warningSign": "⚠", + "diagnostic.infoSign": "ℹ", + "diagnostic.hintSign": "ℹ", + "coc.preferences.hoverTarget": "preview", + "suggest.floatEnable": false, + "diagnostic.messageTarget": "echo", + "json.schemas": [ + { + "url": "https://git.baln.co.uk/general/conventional-tools/blob/master/src/config.schema.json" + } + ], + "yaml.schemas": { + "https://git.baln.co.uk/general/conventional-tools/raw/master/src/config.schema.json": "/.ctrc.yml" + }, + "cSpell.language": "en-GB", + "cSpell.dictionaryDefinitions": [ + {"name": "ade", "path": "/home/ade/.vim/spell/en.utf-8.add"} + ], + "cSpell.dictionaries": ["ade"], + "cSpell.enabledLanguageIds": [ + "asciidoc", + "c", + "cpp", + "csharp", + "css", + "git-commit", + "gitcommit", + "go", + "handlebars", + "haskell", + "html", + "jade", + "java", + "javascript", + "javascript.jsx", + "javascriptreact", + "json", + "jsonc", + "latex", + "less", + "markdown", + "php", + "plaintext", + "pug", + "python", + "restructuredtext", + "rust", + "scala", + "scss", + "text", + "typescript", + "typescript.jsx", + "typescriptreact", + "vim", + "yaml", + "yml" + ], + "cSpell.userWords": ["enviopemt", "loded"] +} diff --git a/site-modules/core/files/vim/colors/my_default.vim b/site-modules/core/files/vim/colors/my_default.vim new file mode 100644 index 0000000..705e7f5 --- /dev/null +++ b/site-modules/core/files/vim/colors/my_default.vim @@ -0,0 +1,28 @@ +" Maintainer: Ade Attwood +" Last Change: 2018-07-15 + +" This is a copy of the default colour theme with some edits to +" to the diff view and spelling + +" Set 'background' back to the default. +hi clear Normal +set bg& + +" Remove all existing highlighting and set the defaults. +hi clear + +" Load the syntax highlighting defaults, if it's enabled. +if exists("syntax_on") + syntax reset +endif + +" Add in colours for vim diff +highlight DiffAdd cterm=bold ctermfg=7 ctermbg=28 gui=none guifg=bg guibg=Red +highlight DiffDelete cterm=bold ctermfg=7 ctermbg=9 gui=none guifg=bg guibg=Red +highlight DiffChange cterm=bold ctermfg=7 ctermbg=17 gui=none guifg=bg guibg=Red +highlight DiffText cterm=bold ctermfg=7 ctermbg=20 gui=none guifg=bg guibg=Red + +" Change background colour of highlighted spell words +highlight SpellBad cterm=bold ctermfg=15 ctermbg=9 gui=none guifg=bg guibg=Red + +let colors_name = "my_default" diff --git a/site-modules/core/files/vim/ftdetect/javascript.vim b/site-modules/core/files/vim/ftdetect/javascript.vim new file mode 100644 index 0000000..5d916ba --- /dev/null +++ b/site-modules/core/files/vim/ftdetect/javascript.vim @@ -0,0 +1,29 @@ +" +" Change filetype to javascript.jsx if a js file imports `React` +" +function! s:ScanFile() + let n = 1 + let nmax = line('$') + if line('$') > 500 + let nmax = 500 + endif + while n < nmax + if getline(n) =~# "\\v" + return 1 + break + endif + let n = n + 1 + endwhile + return 0 +endfunction + +function! s:DetectJSX() + if match(&filetype, '\v') != -1 + return + endif + if s:ScanFile() + set filetype=javascript.jsx + endif +endfunction + +autocmd BufNewFile,BufRead *.js call s:DetectJSX() diff --git a/site-modules/core/files/vim/ftdetect/php.class.vim b/site-modules/core/files/vim/ftdetect/php.class.vim new file mode 100644 index 0000000..ea69184 --- /dev/null +++ b/site-modules/core/files/vim/ftdetect/php.class.vim @@ -0,0 +1,28 @@ +function! s:ScanFile() + let n = 1 + let nmax = line('$') + if line('$') > 500 + let nmax = 500 + endif + while n < nmax + if getline(n) =~ "^class [A-Z]" + return 1 + break + endif + let n = n + 1 + endwhile + return 0 +endfunction + +function! s:DetectPhpClass() + if match(&filetype, '\v') != -1 + return + endif + + if s:ScanFile() + set ft=php.class + return + endif +endfunction + +"autocmd BufNewFile,BufRead *.php call s:DetectPhpClass() diff --git a/site-modules/core/files/vim/ftdetect/typescript.vim b/site-modules/core/files/vim/ftdetect/typescript.vim new file mode 100644 index 0000000..07a4c2e --- /dev/null +++ b/site-modules/core/files/vim/ftdetect/typescript.vim @@ -0,0 +1,6 @@ +" +" Set tsx files to have the typescript.jsx filetype so I can use vim-jsx for +" syntax highlighting +" +autocmd BufNewFile,BufRead *.tsx set filetype=typescript.jsx +autocmd BufNewFile,BufRead *.ts set filetype=typescript diff --git a/site-modules/core/files/vim/ftplugin/diff.vim b/site-modules/core/files/vim/ftplugin/diff.vim new file mode 100644 index 0000000..8d5ce2d --- /dev/null +++ b/site-modules/core/files/vim/ftplugin/diff.vim @@ -0,0 +1,4 @@ +" +" Set default fold for diff files +" +call aa#fold#set_fold('diff') diff --git a/site-modules/core/files/vim/ftplugin/gitcommit.vim b/site-modules/core/files/vim/ftplugin/gitcommit.vim new file mode 100644 index 0000000..28e8bc7 --- /dev/null +++ b/site-modules/core/files/vim/ftplugin/gitcommit.vim @@ -0,0 +1,15 @@ +" +" Git commit message specific settings +" +" + +" +" Enable spell by default +" +setlocal spell + +" +" Make diff folds the default fold for commits. When running `git commit -v` +" all the file diffs will be folded +" +call aa#fold#set_fold('diff') diff --git a/site-modules/core/files/vim/ftplugin/mail.vim b/site-modules/core/files/vim/ftplugin/mail.vim new file mode 100644 index 0000000..27993ec --- /dev/null +++ b/site-modules/core/files/vim/ftplugin/mail.vim @@ -0,0 +1,6 @@ +" +" Mail commit message specific settings +" +" +setlocal spell + diff --git a/site-modules/core/files/vim/ftplugin/markdown.vim b/site-modules/core/files/vim/ftplugin/markdown.vim new file mode 100644 index 0000000..0ef14ed --- /dev/null +++ b/site-modules/core/files/vim/ftplugin/markdown.vim @@ -0,0 +1,7 @@ +" +" Markdown file type specific settings +" +" +setlocal spell + +call aa#languagetool#init() diff --git a/site-modules/core/files/vim/ftplugin/php.vim b/site-modules/core/files/vim/ftplugin/php.vim new file mode 100644 index 0000000..f0c321a --- /dev/null +++ b/site-modules/core/files/vim/ftplugin/php.vim @@ -0,0 +1,8 @@ +" +" Set flods to be indent on php class files +" +if &ft == "php.class" + call aa#fold#set_fold('indent') +else + call aa#emmet#init() +endif diff --git a/site-modules/core/files/vim/ftplugin/yaml.vim b/site-modules/core/files/vim/ftplugin/yaml.vim new file mode 100644 index 0000000..76f2592 --- /dev/null +++ b/site-modules/core/files/vim/ftplugin/yaml.vim @@ -0,0 +1,7 @@ +" +" Yaml file type specific settings +" +" + +setlocal tabstop=2 +setlocal shiftwidth=2 diff --git a/site-modules/core/files/vim/init.vim b/site-modules/core/files/vim/init.vim new file mode 100644 index 0000000..bceb07b --- /dev/null +++ b/site-modules/core/files/vim/init.vim @@ -0,0 +1,232 @@ +" Ade Attwood + +" Vimrc is ordered in the options style +" to view all the options run :options +" and get the docs on all the settings + +" +" Important +" +"call pathogen#infect() +set nocompatible +filetype plugin on +set clipboard=unnamedplus +"set t_Co=256 + +" +" Set leader as space bar +" +let mapleader="\" + + +" +" Not sorted and new +" +set listchars=tab:▸\ ,extends:❯,precedes:❮ +set pastetoggle= +set wildignore+=*/vendor/*,*/node_modules/*,*/runtime/*,*/public_html/* +set scrolloff=20 +set signcolumn=yes + +" +" Moving around, searching and pattern +" +set incsearch + +" +" Tags +" + +" +" Displaying text +" +set linebreak +set nowrap + +call aa#functions#number_on(0) +cabb tognum call aa#functions#toggle_numbers() + +" +" Highlighting and spelling +" +syntax on +set spelllang=en_gb +set cursorline +set nohlsearch + + +" +" Multiple windows +" +set laststatus=2 + + +" +" Multiple tab pages +" + +" +" Terminal +" + +" +" Using the mouse +" +set mouse=a + + +" +" Printing +" + +" +" Messages and info +" +set ruler +set showcmd + +" +" Selecting text +" + +" +" Editing text +" +set matchpairs+=<:> +set showmatch + +" +" Tabs and indenting +" +set tabstop=4 +set shiftwidth=4 +set expandtab +set autoindent +filetype plugin indent on + +" +" Folding +" +hi Folded ctermbg=0 +set foldtext=aa#fold#fold_text() + +command! -nargs=1 -complete=customlist,aa#fold#command_complete SetFold call aa#fold#set_fold() +call aa#fold#set_fold('marker') + +" +" Diff mode +" + +" +" Mapping +" +cabb Q q +cabb W w +cabb WQ wq +cabb Wq wq +cabb __html set ft=html +cabb __php set ft=php +cabb aa vi[:EasyAlign = +cabb ap vip:EasyAlign = +cabb evim e ~/.vimrc +cabb sortp vip:sort +imap I +imap A +inoremap Xlbce +inoremap ,, A, +inoremap ;; A; +inoremap jj :w +nmap s ]sz= +nnoremap +nnoremap d :call pdv#DocumentWithSnip() +nnoremap :resize -5 +nnoremap :vertical resize +5 +nnoremap :resize +5 +nnoremap f za +nnoremap q :q +noremap g :tab Gstatus +noremap p :CommandT +noremap :vertical resize -5 + +noremap [b :bp +noremap ]b :bn + +noremap [q :cprevious +noremap ]q :cnext + +noremap ]h :GitGutterNextHunk +noremap [h :GitGutterPrevHunk + +noremap :Run make build +noremap :Run make test +noremap :Run make test FILE="%" + +nnoremap h :set nohlsearch:nohlsearch +nnoremap / :set hlsearch:nohlsearch/\v\c +nnoremap ? :set hlsearch:nohlsearch? +nnoremap * :set hlsearch:nohlsearch* + +" +" Populate the command pallet with the `Ack` command followed by the visually +" selected text +" +vnoremap a :Ack =aa#buffer#GetVisualSelection() + +" +" Reading and writing files +" +set autoread + +" +" The swap file +" +set noswapfile + + +" +" Command line editing +" Executing external commands +" Running make and jumping to errors +" Language specific +" + +" +" Multi-byte characters +" +set fileencoding=utf-8 +set encoding=utf-8 + +" +" Various +" +autocmd BufNewFile,BufRead *.phtml set ft=html + + +" +" Plugins +" + +" vim-airline +let g:airline#extensions#branch#enabled=1 +let g:airline_theme='murmur' +let g:airline_powerline_fonts = 1 +let g:airline#extensions#tabline#show_buffers = 1 +let g:airline#extensions#tabline#show_splits = 0 +let g:airline#extensions#tabline#show_tabs = 1 + +" pdv +let g:pdv_template_dir = $HOME . "/.config/nvim/UltiSnips/pdv_templates" + +" indent-guides +let g:indent_guides_auto_colors = 1 + +" +" Text length markers +" +autocmd BufRead,TextChanged,TextChangedI *.pp,*.sh,*.bash,*.go,*.js,*.jsx,.ts,.tsx call aa#functions#show_column_if_line_too_long(80) +autocmd BufRead,TextChanged,TextChangedI *.php call aa#functions#show_column_if_line_too_long(120) + +" +" Custom gitlab +" +let g:fugitive_gitlab_domains = ['https://git.zportal.co.uk'] diff --git a/site-modules/core/files/vim/pack/bundle/opt/.gitignore b/site-modules/core/files/vim/pack/bundle/opt/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/site-modules/core/files/vim/pack/bundle/opt/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/site-modules/core/files/vim/pack/bundle/start/.gitignore b/site-modules/core/files/vim/pack/bundle/start/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/site-modules/core/files/vim/pack/bundle/start/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/site-modules/core/files/vim/plugin/active-highlight.vim b/site-modules/core/files/vim/plugin/active-highlight.vim new file mode 100644 index 0000000..b861437 --- /dev/null +++ b/site-modules/core/files/vim/plugin/active-highlight.vim @@ -0,0 +1,13 @@ +" +" Highlights the active window in neo Vim. `ActiveWindow` is only available +" in neovim so +" +if has('nvim') + hi ActiveWindow ctermbg=00 | hi InactiveWindow ctermbg=22 + set winhighlight=Normal:ActiveWindow,NormalNC:InactiveWindow + + au VimEnter,WinEnter,BufEnter,BufWinEnter,FocusGained,CompleteDone * hi ActiveWindow ctermbg=00 | hi InactiveWindow ctermbg=22 + au VimLeave,WinLeave,BufLeave,BufWinLeave,FocusLost * hi ActiveWindow ctermbg=22 | hi InactiveWindow ctermbg=22 +else + hi Normal ctermbg=None +endif diff --git a/site-modules/core/files/vim/plugin/colors.vim b/site-modules/core/files/vim/plugin/colors.vim new file mode 100644 index 0000000..c9ca962 --- /dev/null +++ b/site-modules/core/files/vim/plugin/colors.vim @@ -0,0 +1,32 @@ +" +" Set color theme +" +let base16colorspace=256 +colorscheme base16-eighties + +" +" Set tailing white space to errors +" +match ErrorMsg '\s\+$' + +" +" Fix jsx end tag highlighting +" +hi Tag ctermfg=04 +hi xmlTag ctermfg=04 +hi xmlTagName ctermfg=04 +hi xmlEndTag ctermfg=04 + +" +" Highlight comments to be italic this also targets the language client +" diagnostics. +" +highlight Comment cterm=italic gui=italic + +" +" Make coc diagnostics italic +" +highlight CocErrorSign cterm=italic gui=italic ctermfg=9 guifg=#ff0000 +highlight CocWarningSign cterm=italic gui=italic ctermfg=130 guifg=#ff922b +highlight CocInfoSign cterm=italic gui=italic ctermfg=11 guifg=#fab005 +highlight CocHintSign cterm=italic gui=italic ctermfg=12 guifg=#15aabf diff --git a/site-modules/core/files/vim/plugin/defer.vim b/site-modules/core/files/vim/plugin/defer.vim new file mode 100644 index 0000000..aa8760c --- /dev/null +++ b/site-modules/core/files/vim/plugin/defer.vim @@ -0,0 +1,40 @@ +" +" Defer command for starting work after vim has loaded +" +" This is biased from Greg Hurrell's Profiling and optimization screen cast in +" his implementation he is using the `CursorHold,CursorHoldI` auto command +" that didn't really work for me. This uses `timer_start` to set a timer when +" to start the work. This is then started on `VimEnter` when everything has +" loaded. There are two levels of defer one at `250ms` and `500ms` This is for +" calling functions that depend on something that has already been deferred. +" +" You can use this by adding a function to the user auto command `WincentSoftDefer` +" +" autocmd User WincentSoftDefer call s:do_work() +" + +function HardDefer(timer) + augroup WincentIdleboot + autocmd! + augroup END + + doautocmd User WincentHardDefer + autocmd! User WincentHardDefer +endfunction + +function SoftDefer(timer) + augroup WincentIdleboot + autocmd! + augroup END + + doautocmd User WincentSoftDefer + autocmd! User WincentSoftDefer +endfunction + +augroup WincentIdleboot + autocmd! + if has('vim_starting') + autocmd VimEnter * call timer_start(250, 'SoftDefer') + autocmd VimEnter * call timer_start(500, 'HardDefer') + endif +augroup END diff --git a/site-modules/core/files/vim/plugin/deoplete.vim b/site-modules/core/files/vim/plugin/deoplete.vim new file mode 100644 index 0000000..671ba55 --- /dev/null +++ b/site-modules/core/files/vim/plugin/deoplete.vim @@ -0,0 +1,13 @@ +" +" Add deoplete plugin +" +function s:deoplete_init() + if has('nvim') + packadd deoplete + call deoplete#enable() + + call deoplete#custom#source('ultisnips', 'rank', 9999) + endif +endfunction + +"au User WincentHardDefer call s:deoplete_init() diff --git a/site-modules/core/files/vim/plugin/emmet.vim b/site-modules/core/files/vim/plugin/emmet.vim new file mode 100644 index 0000000..3cc903f --- /dev/null +++ b/site-modules/core/files/vim/plugin/emmet.vim @@ -0,0 +1,12 @@ +" +" Init emmet on specified files +" +autocmd FileType html,css,scss,less,javascript.jsx,typescript.jsx call aa#emmet#init() + +"let g:user_emmet_leader_key='' + +" +" Make expand emment expreson like sparkup did +" + +"inoremap :call emmet#expandAbbr(3,"") diff --git a/site-modules/core/files/vim/plugin/format.vim b/site-modules/core/files/vim/plugin/format.vim new file mode 100644 index 0000000..e055ec4 --- /dev/null +++ b/site-modules/core/files/vim/plugin/format.vim @@ -0,0 +1,183 @@ +if exists('g:vim_formatter_loaded') + finish +end + +let g:vim_formatter_loaded = 1 + +" +" Set the global formatters definitions variable +" +if !exists('g:formatters') + let g:formatters = {} +endif + +" +" Get the prettier config for the current project +" +if filereadable('./.prettierrc.js') + let s:prettier_config = '.prettierrc.js' +elseif filereadable('./.prettierrc') + let s:prettier_config = '.prettierrc' +else + let s:prettier_config = '~/.dotfiles/.prettierrc.js' +endif + +" +" Set the base prettier command for formatting. This can be used on most of +" the file formats +" +let s:base_prettier_command = 'prettier --config ' . s:prettier_config . ' --stdin --stdin-filepath /tmp/formatted.' + +" +" Typescript formatter definition +" +let g:formatters['typescript'] = s:base_prettier_command . 'ts' +let g:formatters['typescript.jsx'] = s:base_prettier_command . 'tsx' + +" +" Javascript formatter definition +" +let g:formatters['javascript'] = s:base_prettier_command . 'js' +let g:formatters['javascript.jsx'] = s:base_prettier_command . 'jsx' + +" +" HTML formatter definition +" +let g:formatters['html'] = s:base_prettier_command . 'html' + +" +" Styling formatter definition +" +let g:formatters['css'] = s:base_prettier_command . 'css' +let g:formatters['scss'] = s:base_prettier_command . 'scss' +let g:formatters['less'] = s:base_prettier_command . 'less' + +" +" JSON formatter definition +" +let g:formatters['json'] = s:base_prettier_command . 'json' + +" +" YAML formatter definition +" +let g:formatters['yaml'] = s:base_prettier_command . 'yml' + +" +" Markdown formatter definition +" +let g:formatters['markdown'] = s:base_prettier_command . 'md' + +" +" Puppet formatter definition +" +let g:formatters['puppet'] = 'cat - > /tmp/format.pp && puppet-lint --no-autoloader_layout-check --fix /tmp/format.pp >/dev/null 2>&1 && cat /tmp/format.pp' + +" +" PHP formatter definition +" +" This will use the `ruleset.xml` in the root of the project if one can be +" found. If not then it will fall back to use psr2 coding standards +" +if filereadable('./ruleset.xml') + let g:formatters['php'] = 'phpcbf --standard=./ruleset.xml -' + let g:formatters['php.class'] = 'phpcbf --standard=./ruleset.xml -' +else + let g:formatters['php'] = 'phpcbf --standard=psr2 -' + let g:formatters['php.class'] = 'phpcbf --standard=psr2 -' +endif + +" +" Define if you want the plugin to format on save +" +if !exists('g:formatter_on_save') + let g:formatter_on_save = 1 +endif + +" +" Set the plugin to debug mode +" +if !exists('g:formatter_debug') + let g:formatter_debug = 1 +endif + +" +" Variable for enabling and disabling the formatters +" +if !exists('g:formatter_enabled') + let g:formatter_enabled = 1 +endif + +" +" Format the current buffers text biased on the file type and the formatters +" defined +" +function s:format() + " + " Exit is formatting has been disabled + " + if !g:formatter_enabled + return + endif + + " + " Trim white space before formatting + " + %s/\s\+$//e + + " + " Format the buffers content + " + let l:lines = s:format_text(join(getline(1, '$'), "\n"), &filetype) + + " + " Replace the lines of the formatted text with the text in the buffer + " + call aa#buffer#Overwrite(1, line('$'), lines) +endfunction + +" +" Formats defined lines biased on the type defined +" +" a:lines +" The text you want to format +" +" a:type +" The type formatter to use this will defined in the `g:formatters` variable +" +function s:format_text(lines, type) + let l:lines = a:lines + + " + " Just return the lines if there is no formatters defined + " + if !exists("g:formatters['" . a:type . "']") + if g:formatter_debug == 1 + echo '[formatter] No formatter defined for ' . a:type + endif + + return split(lines, "\n") + endif + + " + " Run the formatter command and return the output of the text + " + let l:command = g:formatters[a:type] + let l:formatted_lines = split(system(command, lines), "\n") + + " + " Return original lines if formatter command returns an error + " + if v:shell_error > 1 + echoerr '[formatter] ' . join(formatted_lines, "\n") + return split(lines, "\n") + endif + + return formatted_lines +endfunction + +" +" Defined the autocmd if the plugin is set to format on save +" +if g:formatter_on_save == 1 + autocmd BufWritePre * call s:format() +endif diff --git a/site-modules/core/files/vim/plugin/functions.vim b/site-modules/core/files/vim/plugin/functions.vim new file mode 100644 index 0000000..0026cfb --- /dev/null +++ b/site-modules/core/files/vim/plugin/functions.vim @@ -0,0 +1,77 @@ +" +" Trims all traling white space from every line in a file +" +function! s:aa_trim_white_space() + %s/\s\+$//e +endfunction + +command! -nargs=* -complete=file TrimWhiteSpace call s:aa_trim_white_space() + +" +" Creates a new file or directory updateing the UI with and clearing the +" command t cache. This function uses the nerd tree functions to create files +" or directory. For more info on this you can open nerdtree and press `m` then +" `a` to add a node. If it is a file the file will be opened in a new buffer +" +" a:path +" Path to file or directory. Dirs end in / +" +function! s:aa_new(path) + call g:NERDTreePath.Create(a:path) + + call commandt#Flush() + NERDTreeRefreshRoot + + if filereadable(expand(a:path)) + execute "e " . expand(a:path) + endif +endfunction + +command! -nargs=1 -complete=file New call s:aa_new() + +" +" Runs a shell command in the neovim terminal. This will open up a buffered +" terminal in a split at the bottom +" +" a:command +" The command you want the run in the terminal +" +function! s:aa_run(command) + if strlen($TMUX) > 0 + if (&columns > 180) + let l:split = '-h' + else + let l:split = '-v' + endif + + execute 'silent !tmux split-window -p 50 ' . l:split . ' && tmux send-keys "' . a:command . ' && exit" C-m' + return + endif + + if has('nvim') + if (&columns > 180) + execute 'VTerm ' . a:command . ' && exit' + else + execute 'HTerm ' . a:command . ' && exit' + endif + endif +endfunction + +command! -nargs=* -complete=shellcmd Run call s:aa_run() + + +" +" Git gutter alias commad commands to give them the same api as fugitive +" +command! GaddHunk :GitGutterStageHunk +command! GresetHunk :GitGutterUndoHunk + +" +" Browse command to open urls in a browser. This is to help fugitive `Gbrowse` +" open urls in a browser rather that other programmes +" +function! s:browse(uri) + silent exec "!brave-browser '".a:uri."'" +endfunction + +command! -nargs=1 Browse call s:browse() diff --git a/site-modules/core/files/vim/plugin/js.vim b/site-modules/core/files/vim/plugin/js.vim new file mode 100644 index 0000000..2963cf7 --- /dev/null +++ b/site-modules/core/files/vim/plugin/js.vim @@ -0,0 +1,4 @@ +" +" Enable js doc syntax +" +let g:javascript_plugin_jsdoc = 1 diff --git a/site-modules/core/files/vim/plugin/lsv.vim b/site-modules/core/files/vim/plugin/lsv.vim new file mode 100644 index 0000000..13c4401 --- /dev/null +++ b/site-modules/core/files/vim/plugin/lsv.vim @@ -0,0 +1,38 @@ +function! s:check_back_space() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' +endfunction + +inoremap pumvisible() ? coc#_select_confirm() : + \"\u\\=coc#on_enter()\" +nmap gd (coc-definition) +nnoremap K :call show_documentation() + +function! s:show_documentation() + if (index(['vim','help'], &filetype) >= 0) + execute 'h '.expand('') + else + call CocAction('doHover') + endif +endfunction + +function! s:open_as_preview(callstr) + " e.g. the string should look like: +call cursor(,) + let m = matchlist(a:callstr, '^+call cursor(\(\d\+\),\s*\(\d\+\))\s\+\(.*\)') + if len(m) < 4 " TODO: more robust error handling + echohl WarningMsg | echom "ERROR: Invalid callstr format" | echohl None + return + endif + let linenr = m[1] + let filename = expand(m[3]) + call quickui#preview#open(filename, { + \ 'cursor': linenr, + \ 'number' : 1, + \ 'persist': 0, + \ }) +endfunction + +command! -nargs=0 PreviewDefinition :call CocActionAsync('jumpDefinition', ':OpenAsPreview') +command! -nargs=* OpenAsPreview :call s:open_as_preview("") + +autocmd CursorHold * silent call CocActionAsync('highlight') diff --git a/site-modules/core/files/vim/plugin/nerdtree.vim b/site-modules/core/files/vim/plugin/nerdtree.vim new file mode 100644 index 0000000..7f9b8cb --- /dev/null +++ b/site-modules/core/files/vim/plugin/nerdtree.vim @@ -0,0 +1,34 @@ +" Check if NERDTree is open or active +function! s:isNERDTreeOpen() + return exists("t:NERDTreeBufName") && (bufwinnr(t:NERDTreeBufName) != -1) +endfunction + +" Call NERDTreeFind iff NERDTree is active, current window contains a modifiable +" file, and we're not in vimdiff +function! s:syncTree() + if &modifiable && s:isNERDTreeOpen() && strlen(expand('%')) > 0 && !&diff + NERDTreeFind + wincmd p + endif +endfunction + +function! ToggleNerdTree() + if s:isNERDTreeOpen() + NERDTreeClose + return + endif + + set eventignore=BufEnter + NERDTreeFind + set eventignore= +endfunction + + +function s:nerdtree_init() + nmap o :call ToggleNerdTree() + autocmd BufEnter * call s:syncTree() + packadd nerdtree +endfunction + + +au User WincentSoftDefer call s:nerdtree_init() diff --git a/site-modules/core/files/vim/plugin/term.vim b/site-modules/core/files/vim/plugin/term.vim new file mode 100644 index 0000000..2432e81 --- /dev/null +++ b/site-modules/core/files/vim/plugin/term.vim @@ -0,0 +1,78 @@ +" +" All of the good bits from `split_term` +" https://github.com/vimlab/split-term.vim/blob/master/plugin/split-term.vim +" + +let s:force_vertical = exists('g:split_term_vertical') ? 1 : 0 +let s:default_shell = exists('g:split_term_default_shell') ? g:split_term_default_shell : 0 + +au BufEnter * if &buftype == 'terminal' | :startinsert | endif + +" +" Set split directions +" +set splitbelow +set splitright + +" Opens up a new buffer, either vertical or horizontal. Count can be used to +" specify the number of visible columns or rows. +fun! s:openBuffer(count, vertical) + let cmd = a:vertical ? 'vnew' : 'new' + let cmd = a:count ? a:count . cmd : cmd + exe cmd +endf + +" Opens a new terminal buffer, but instead of doing so using 'enew' (same +" window), it uses :vnew and :new instead. Usually, I want to open a new +" terminal and not replace my current buffer. +fun! s:openSplitTerm(args, count, vertical) + let direction = s:force_vertical ? 1 : a:vertical + + call s:openBuffer(a:count, direction) + call s:openTerm(a:args) +endf + +" Opens a new terminal buffer, but instead of doing so using split buffer, it +" uses :tabnew instead. +fun! s:openTabTerm(args) + exe 'tabnew' + call s:openTerm(a:args) +endf + +" Open a new terminal in the active buffer, while defining default mappings +" for this plugin. +fun! s:openTerm(args) + let prevShell = &shell + if exists('g:split_term_default_shell') + exe 'set shell =' . s:default_shell + endif + + exe 'terminal' a:args + + + " + " Turn off line numbers in terminal mode + " + call aa#functions#number_off(1) + + exe 'startinsert' + + " + " Add teminal mappings + " + tnoremap + tnoremap 'pi' + tnoremap h + tnoremap j + tnoremap k + tnoremap l + + if exists('g:split_term_default_shell') + exe 'set shell =' . prevShell + endif +endf + +command! -count -nargs=* Term call s:openTerm() +command! -count -nargs=* VTerm call s:openSplitTerm(, , 1) +command! -count -nargs=* HTerm call s:openSplitTerm(, , 0) +command! -nargs=* TTerm call s:openTabTerm() diff --git a/site-modules/core/files/vim/plugin/ultisnips.vim b/site-modules/core/files/vim/plugin/ultisnips.vim new file mode 100644 index 0000000..f9b7ac0 --- /dev/null +++ b/site-modules/core/files/vim/plugin/ultisnips.vim @@ -0,0 +1,16 @@ +" +" Config for UltiSnips config +" + +let g:UltiSnipsSnippetsDir = "~/.vim/UltiSnips" +let g:UltiSnipsExpandTrigger="" +let g:UltiSnipsJumpForwardTrigger="" +let g:UltiSnipsJumpBackwardTrigger="" +let g:snips_author = "Ade Attwood" +let g:snips_email = "code@adeattwood.co.uk" + +" +" Run super tab script on UltiSnipsExpandTrigger to enable ultisnips and emmet +" on tab press +" +au InsertEnter * exec "inoremap " . g:UltiSnipsExpandTrigger . " =aa#supertab#expand()" diff --git a/site-modules/core/files/vim/spell/.gitignore b/site-modules/core/files/vim/spell/.gitignore new file mode 100644 index 0000000..6d535c0 --- /dev/null +++ b/site-modules/core/files/vim/spell/.gitignore @@ -0,0 +1 @@ +*.spl diff --git a/site-modules/core/files/vim/spell/en.utf-8.add b/site-modules/core/files/vim/spell/en.utf-8.add new file mode 100644 index 0000000..7490002 --- /dev/null +++ b/site-modules/core/files/vim/spell/en.utf-8.add @@ -0,0 +1,146 @@ +admin +admins +API +Bitbucket +Calver +changelog +Chnagelog +chnagelogs +cli +CLI +config +configs +csv +dotfiles +Github +javascript +Jira +json +preset +revo +Semver +wordpress +workflow +yii2 +Yii2 +Yii2's +Yii's +Yii +ENV +dev +creds +gmail +APP +localhost +Cron +vars +PHP +EXE +php +MYSQL +ssh +rsa +AUTH +auth +dropdown +adeattwood +lerna +org +linting +semver +commitlint +changelogs +ctrc +Gitlab +phpcs +baln +etc +changelogs +COC +vim +coc +intellisense +url +yaml +uninstall +ci +api +Gitbot +listr +frag +XYCoord +jsx +cakephp +CakePHP +mobiledetect +mobiledetectlib +plugin +sdk +aws +dereuromark +chargebee +dompdf +psy +psysh +phpmd +squizlabs +phpunit +codesniffer +autoload +psr +App +src +plugins +Tceg +cmd +PluginInstaller +postAutoloadDump +PDF's +webrot +webroot +abbrev +execa +conventionalcommits +oclif +prerelease +moduels +artifacts +docpress +prepper +yiisoft +fightbulc +kartik +select2 +twofactorauth +robthree +vlucas +phpdotenv +soundasleep +html2text +graphql +webonyx +chartjs +flysystem +creocoder +ralouphie +mimey +Attwood +codeception +symfony +auths +swiftmailer +behaviors +minio +openwhisk +workbox +precaching +precache +bitwarden +httpclient +veriphy +IDAML +codecept_data_dir +spec +registrypullsecret +configmap +kubernetes diff --git a/site-modules/core/files/zshrc b/site-modules/core/files/zshrc new file mode 100644 index 0000000..f240321 --- /dev/null +++ b/site-modules/core/files/zshrc @@ -0,0 +1,118 @@ +# Path to your oh-my-zsh installation. + +# +# Set oh-my-zsh path +# +export ZSH=$HOME/.oh-my-zsh + +# +# Disable applications setting the terminal title globally not just in +# oh-my-zsh as it was previously +# +export DISABLE_AUTO_TITLE=true + +# +# Configure oh-my-zsh +# +ZSH_THEME="pygmalion" +ENABLE_CORRECTION="false" +COMPLETION_WAITING_DOTS="true" + +# +# Set oh-my-zsh plug-ins +# +# More plug-ins are loaded in ~/.oh-my-zsh/custom/lib/misc.zsh file so we dint +# have to define all of the custom installed plug ins here. +# +plugins=(git golang composer npm tmux debian vagrant docker-compose extract emacs nvm) + +# +# map ecs to caps lock +# +xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape' + +# +# Change cursor shape +# +# Block ▇ printf '\033[1 q' +# Underline _ printf '\033[3 q' +# Beam | printf '\033[5 q' +# +printf '\033[5 q' + + +# +# Configure base16 shell for colors if the terminal is not running inside of +# emacs +# +##if [[ -z INSIDE_EMACS ]]; then + BASE16_SHELL="$HOME/.config/base16-shell/" + [ -n "$PS1" ] && \ + [ -s "$BASE16_SHELL/profile_helper.sh" ] && \ + eval "$("$BASE16_SHELL/profile_helper.sh")" + + $HOME/.dotfiles/bin/base16_theme; +##fi + +# +# Setup and export $PATH +# +if [ -d $HOME/.local/share/go ]; then + export PATH=$PATH:$HOME/.local/share/go/bin +fi + +if [ -d $HOME/.local/bin ]; then + export PATH=$PATH:$HOME/.local/bin +fi + +if [ -d $HOME/development/flutter ]; then + export PATH=$PATH:$HOME/development/flutter/bin +fi + +PPHP_VERSION=7.3 +if [ -d /usr/share/practically-php/php/$PPHP_VERSION/bin ]; then + export PATH=$PATH:/usr/share/practically-php/php/$PPHP_VERSION/bin +fi + +export PATH=$PATH:$HOME/.config/composer/vendor/bin + +# +# Set up golang +# +export GOPATH=$HOME/go + +# +# Init oh-my-zsh +# +source $ZSH/oh-my-zsh.sh + +# +# Import local alases if the file exists +# +if [ -f ~/.aliases ]; then + source ~/.aliases; +fi + +# +# Make vim and vi neovim +# +if type nvim > /dev/null 2>&1; then + alias vim='nvim' + alias vi='nvim' +fi + +# Load php env +export PHPENV_ROOT="/home/ade/.phpenv" +if [ -d "${PHPENV_ROOT}" ]; then + export PATH="${PHPENV_ROOT}/bin:${PATH}" + eval "$(phpenv init -)" +fi + +# conventional-tools autocomplete setup +CONVENTIONAL_TOOLS_AC_ZSH_SETUP_PATH=/home/ade/.cache/@baln/conventional-tools/autocomplete/zsh_setup && test -f $CONVENTIONAL_TOOLS_AC_ZSH_SETUP_PATH && source $CONVENTIONAL_TOOLS_AC_ZSH_SETUP_PATH; + +export ANDROID_HOME=$HOME/Android/Sdk +export PATH=$PATH:$ANDROID_HOME/emulator +export PATH=$PATH:$ANDROID_HOME/tools +export PATH=$PATH:$ANDROID_HOME/tools/bin +export PATH=$PATH:$ANDROID_HOME/platform-tools diff --git a/site-modules/core/lib/facter/user.rb b/site-modules/core/lib/facter/user.rb new file mode 100755 index 0000000..52c7865 --- /dev/null +++ b/site-modules/core/lib/facter/user.rb @@ -0,0 +1,6 @@ +Facter.add(:user_home) do + setcode do + Dir.home($user) + end +end + diff --git a/site-modules/core/lib/puppet/functions/each_file.rb b/site-modules/core/lib/puppet/functions/each_file.rb new file mode 100644 index 0000000..eb94c1b --- /dev/null +++ b/site-modules/core/lib/puppet/functions/each_file.rb @@ -0,0 +1,12 @@ +Puppet::Functions.create_function(:'each_file') do + dispatch :each_file do + param 'String', :path + block_param 'Callable[1, 1]', :block + end + + def each_file(path) + Dir.glob(path) do |filename| + yield(*filename) + end + end +end diff --git a/site-modules/core/manifests/bin.pp b/site-modules/core/manifests/bin.pp new file mode 100644 index 0000000..e251230 --- /dev/null +++ b/site-modules/core/manifests/bin.pp @@ -0,0 +1,19 @@ +# +# Links all of the bin files into `~/.local/bin` +# +# Author Ade Attwood +# Updated 2018-07-16 +# + +class core::bin { + file { "${user_home}/.local/bin": + ensure => 'directory', + owner => $user, + } + + exec { 'Link bin files': + path => '/usr/bin:/usr/sbin:/bin', + command => "mkdir -p ${user_home}/.local/bin \ + && ln -sf ${find_file('core/bin')}/* ${user_home}/.local/bin/", + } +} diff --git a/site-modules/core/manifests/fonts.pp b/site-modules/core/manifests/fonts.pp new file mode 100644 index 0000000..77f7a36 --- /dev/null +++ b/site-modules/core/manifests/fonts.pp @@ -0,0 +1,17 @@ +# +# Install the custom font +# +# Author Ade Attwood +# Updated 2018-11-11 +# + +class core::fonts { + file { "${user_home}/.local/share/fonts": + ensure => 'directory', + } + + file { "${user_home}/.local/share/fonts/LigaFreeMono.ttf": + ensure => 'link', + target => find_file('core/fonts/LigaFreeMono.ttf'), + } +} diff --git a/site-modules/core/manifests/git.pp b/site-modules/core/manifests/git.pp new file mode 100644 index 0000000..f1ff7ac --- /dev/null +++ b/site-modules/core/manifests/git.pp @@ -0,0 +1,6 @@ +class core::git { + file { "${user_home}/.gitconfig": + owner => $user, + content => template('core/git/gitconfig.erb') + } +} diff --git a/site-modules/core/manifests/packages.pp b/site-modules/core/manifests/packages.pp new file mode 100644 index 0000000..5c6fc3a --- /dev/null +++ b/site-modules/core/manifests/packages.pp @@ -0,0 +1,45 @@ +class core::packages { + # + # Main packages to in stall from the archives + # + package { [ + 'cmake', + 'filezilla', + 'firefox', + 'git', + 'mutt', + 'neovim', + 'notmuch-mutt', + 'notmuch', + 'offlineimap', + 'silversearcher-ag', + 'thunderbird', + 'tmux', + 'urlscan', + 'vim', + 'zsh', + 'build-essential', + 'chromium-browser', + 'keepass2', + 'python-dev', + 'ruby-dev', + 'software-properties-common', + ]: + ensure => installed, + } + + # core::packages::npm { [ + # 'grunt', + # 'intelephense', + # 'javascript-typescript-langserver', + # 'prettier', + # 'typescript-language-server', + # ]: } + + # + # Ruby gems to install globally + # + core::packages::gem { [ + 'neovim', + ]: } +} diff --git a/site-modules/core/manifests/packages/gem.pp b/site-modules/core/manifests/packages/gem.pp new file mode 100644 index 0000000..a2225b2 --- /dev/null +++ b/site-modules/core/manifests/packages/gem.pp @@ -0,0 +1,7 @@ +define core::packages::gem { + exec { "gem_install_${title}": + command => "gem install ${title}", + path => '/usr/bin:/usr/local/bin:/usr/sbin:/bin', + provider => shell, + } +} diff --git a/site-modules/core/manifests/packages/npm.pp b/site-modules/core/manifests/packages/npm.pp new file mode 100644 index 0000000..6c4af77 --- /dev/null +++ b/site-modules/core/manifests/packages/npm.pp @@ -0,0 +1,9 @@ +define core::packages::npm { + exec { "npm_install_${title}": + command => "${find_file('/core/scripts/npm-install-package')} ${title}", + #command => ". $HOME/.nvim/nvim.sh && npm install -g ${title}", + # path => '/usr/bin:/usr/local/bin:/usr/sbin:/bin', + provider => shell, + user => $user, + } +} diff --git a/site-modules/core/manifests/ssh.pp b/site-modules/core/manifests/ssh.pp new file mode 100644 index 0000000..b5cdf77 --- /dev/null +++ b/site-modules/core/manifests/ssh.pp @@ -0,0 +1,29 @@ +# +# Provisions all of my machines ssh keys for remote access +# +# Author Ade Attwood +# Updated 2018-09-03 +# + +class core::ssh { + ssh_authorized_key { 'Ade-Home-Workstation': + ensure => present, + user => $user, + type => 'ssh-rsa', + key => 'AAAAB3NzaC1yc2EAAAADAQABAAACAQDMTg++6fHLdQJxP2Q8q+INqXxAEsvJKZHadupjX8VMi1Pk8BYiYNy7cMdgmhg+KbGfBZLKTK5xbQb3261VMHUISOju0V/dwA2XwrX6yN+kuvK/nDkQsZbaDTQZhAz0RHXyHThpu5I8oAA3dzzFAdslnmJV0J4aYA0woOfxgYU3339o7RSKW8kR7fuWxLwfCO2SK3tlgfgiYHsQ5yHDUojbOGPwmvS7SXI6+U+x7ndZiTsCp/Dn+n+z8M5R2mfyk16Wz/N1+khbvuHllVGkpD0XXSR8BopxglZ6zZFuhR23ASjdmj/lSQvZoOhxgMYaapRuNj4cyp5tt2HEzoJVf9uhLvi3eW96FMaTSl/ALE+UTA3FGXPMB8aT7WbwiaQm6B2Y2SHDToI2HeUy5K6P6keijDxSkC0LCpifDAUyM61zcoi042kAWaJpu+7zB+A4sz1XeTjVA3VzMl98P9z3h612S97hbMACXC9ZHxA/Qgcm6P5ZJty9XUPJkybeOZ7K0QUdr0RUfnxX91ZtSDPwMPIK0KNcSuo5NbdR/U5Ke87zgaR15tZ2rXcL2m61uU1TSXo2VUd9XP9amLbgjEYT+bMYDTw31+THOn9v28YCdQSux3TNM3HnkrV541N9A3T6bz4LFyBB7yqSUzKSiNbP55a+rIOWN4BWejdc7yvJegxEdw==', + } + + ssh_authorized_key { 'Ade-Home-Laptop': + ensure => present, + user => $user, + type => 'ssh-rsa', + key => 'AAAAB3NzaC1yc2EAAAADAQABAAACAQDvQkUPiWwPI/FqOCdVkGRCWkbGQjhmjIv7FI5YJ8RuTaVVwoR3BDT/AOiKEanpSMk/BWsbbgLSgOF72JIH0Nrykm9kTOS4rmPOGt5RNOtYZ2kLm4hfzzvurUvIR0J8UDXYRoxQ4J+hakeLhcmNLBXahCF0L70a9eqPPQw7AWRrBDouGzymZVZJOtC1kcybzlU7KTU/zXd9/pdgH7967aShwc5OeJraXFZdqk6TEqH1CTkgF7K7KfeWU5uyGCGVA3Gf6De1CEnZ0SL9ZTkXOX2o9GcZ7ctWBTjjRLtvnJYtb0z5PgMxCqH7OAqgiwbzTx8tMGn+4HYe8mTSZC1XOxNQHZ1EiIX7pypfN0dBCEHDFoqnaDwtcMUHNE7pk1bcdz9eeh/RUAT9iDJB1EDIOuQl+vGPWNbzyGfL+klnyxIwnkd9PGY3YUurlVXAaFGxaKe1IIlNi5DwVE4zFhj9HSydrpKVz70pdpNTN7MglWYGRA8IawgWV72xfkKesR/vq3FzPKbM51aIhAjZOowurJ2LEMpOKbgDHvikwoXbjfIjRbVPa5n3Pw56l9Ixhu4KBmHY9iyjBRtumE1XDO8RIJQtkfm0kSnX5yld5wn2aZtvxHHFgskRtl6dFr1UqL0y/n56F/FfV4j/ZRQgTkBKx35sJANyXvpHdKKw4X2P8tAAEQ==', + } + + ssh_authorized_key { 'Ade-Work-Workstation': + ensure => present, + user => $user, + type => 'ssh-rsa', + key => 'AAAAB3NzaC1yc2EAAAABJQAAAQEA0SZ866Ih270Qs3H0SQVJpXkq6mzeklybEbDj2HI2TwSZuExxwqNsaHw+NDBW/dlrtEQz0SYUDGhdFEllgl8Cyv8wSqXh+yFYD1ZhdUvwVEr4t9SXbTMjnjJojMEZbzVXAimWVw8Y6Geuk7y9wpTVMi49dfjL44ZUQ/qwlkswIiMzF1raluz38G3r+O8DVVk08mw148g3y7+d+F2oPO252X8eKZ+GSfwbZ/u7hb0WdVFxBLRPUjHw4LZPNMrWFYblwu7FS/mNz6y68muUVz/qeCEn6ty2WnS7flHp5l4CIJ5Z6HcyAH3Gi7E3HrLwV1dCPYMueCaW8DQlLSX/4HnGXw==', + } +} diff --git a/site-modules/core/manifests/tmux.pp b/site-modules/core/manifests/tmux.pp new file mode 100644 index 0000000..3a99ee6 --- /dev/null +++ b/site-modules/core/manifests/tmux.pp @@ -0,0 +1,41 @@ +# +# Config for tmux terminal multiplexer +# +# Author Ade Attwood +# Updated 2018-07-16 +# + +class core::tmux { + exec { 'make tmux dir': + creates => "${user_home}/.tmux/plugins", + path => '/usr/bin:/usr/sbin:/bin', + command => "mkdir -p ${user_home}/.tmux/plugin", + } + + file { "${user_home}/.tmux.conf": + ensure => 'link', + owner => $user, + target => find_file('core/tmux.conf'), + } + + vcsrepo { "${user_home}/.tmux/plugins/tmux-yank": + ensure => latest, + source => 'git://github.com/tmux-plugins/tmux-yank.git', + provider => git, + revision => 'master', + } + + vcsrepo { "${user_home}/.tmux/plugins/tmux-open": + ensure => latest, + source => 'git://github.com/tmux-plugins/tmux-open.git', + provider => git, + revision => 'master', + } + + vcsrepo { "${user_home}/.tmux/plugins/tmux-copycat": + ensure => latest, + source => 'git://github.com/tmux-plugins/tmux-copycat.git', + provider => git, + revision => 'master', + } +} diff --git a/site-modules/core/manifests/vim.pp b/site-modules/core/manifests/vim.pp new file mode 100644 index 0000000..5574e69 --- /dev/null +++ b/site-modules/core/manifests/vim.pp @@ -0,0 +1,64 @@ +class core::vim { + file { "${user_home}/.vim": + ensure => 'link', + force => true, + owner => $user, + target => find_file('core/vim'), + } + + file { "${user_home}/.vimrc": + ensure => 'link', + force => true, + owner => $user, + target => find_file('core/vim/init.vim'), + } + + file { "${user_home}/.config/nvim": + ensure => 'link', + force => true, + owner => $user, + target => find_file('core/vim'), + } + + $plugins_start= { + 'base16-vim' => { url => 'https://github.com/chriskempson/base16-vim.git' }, + 'vim-easy-align' => { url => 'https://github.com/junegunn/vim-easy-align.git' }, + 'auto-pairs' => { url => 'git://github.com/jiangmiao/auto-pairs.git' }, + 'indent-line' => { url => 'https://github.com/Yggdroot/indentLine.git' }, + 'nerdcommenter' => { url => 'https://github.com/scrooloose/nerdcommenter.git' }, + 'pdv' => { url => 'https://github.com/tobyS/pdv.git' }, + 'vim-airline' => { url => 'https://github.com/vim-airline/vim-airline' }, + 'vim-fugitive' => { url => 'git://github.com/tpope/vim-fugitive.git' }, + 'vim-tmux-navigator' => { url => 'https://github.com/christoomey/vim-tmux-navigator.git' }, + 'ultisnips' => { url => 'https://github.com/SirVer/ultisnips.git' }, + 'vim-airline-themes' => { url => 'https://github.com/vim-airline/vim-airline-themes.git' }, + 'vim-javascript' => { url => 'https://github.com/pangloss/vim-javascript.git' }, + 'vim-jsx' => { url => 'https://github.com/mxw/vim-jsx.git' }, + 'command-t' => { url => 'https://github.com/wincent/command-t.git' }, + 'ferret' => { url => 'https://github.com/wincent/ferret.git' }, + # + # Nerdtree has now been loaded after vim start up + # + 'nerdtree' => { + ensure => 'absent', + url => 'https://github.com/scrooloose/nerdtree.git', + }, + } + + exec { 'Compile command t': + path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ], + command => 'ruby extconf.rb && make', + cwd => "${find_file('core/vim')}/pack/bundle/start/command-t/ruby/command-t/ext/command-t", + provider => 'shell', + #require => [Vim::Plugin_start[command-t]], + } + + create_resources(core::vim::plugin_start, $plugins_start) + + $plugins_opt= { + 'emmet-vim' => { url => 'https://github.com/mattn/emmet-vim.git' }, + 'nerdtree' => { url => 'https://github.com/scrooloose/nerdtree.git' }, + } + + create_resources(core::vim::plugin_opt, $plugins_opt) +} diff --git a/site-modules/core/manifests/vim/plugin_opt.pp b/site-modules/core/manifests/vim/plugin_opt.pp new file mode 100644 index 0000000..1182e1c --- /dev/null +++ b/site-modules/core/manifests/vim/plugin_opt.pp @@ -0,0 +1,8 @@ +define core::vim::plugin_opt($url, $provider = 'git', $ensure = 'latest', $revision = 'master') { + vcsrepo { "${user_home}/.config/nvim/pack/bundle/opt/${title}": + ensure => $ensure, + source => $url, + provider => $provider, + revision => $revision, + } +} diff --git a/site-modules/core/manifests/vim/plugin_start.pp b/site-modules/core/manifests/vim/plugin_start.pp new file mode 100644 index 0000000..a955830 --- /dev/null +++ b/site-modules/core/manifests/vim/plugin_start.pp @@ -0,0 +1,8 @@ +define core::vim::plugin_start($url, $provider = 'git', $ensure = 'latest', $revision = 'master') { + vcsrepo { "${user_home}/.config/nvim/pack/bundle/start/${title}": + ensure => $ensure, + source => $url, + provider => $provider, + revision => $revision, + } +} diff --git a/site-modules/core/manifests/zsh.pp b/site-modules/core/manifests/zsh.pp new file mode 100644 index 0000000..d796004 --- /dev/null +++ b/site-modules/core/manifests/zsh.pp @@ -0,0 +1,63 @@ +class core::zsh { + + exec { 'git clone ohmyzsh': + creates => "${user_home}/.oh-my-zsh", + path => '/usr/bin:/usr/sbin:/bin', + command => "git clone git://github.com/robbyrussell/oh-my-zsh.git ${user_home}/.oh-my-zsh", + } + + file { "${user_home}/.zshrc": + ensure => 'link', + owner => $user, + target => find_file('core/zshrc'), + } + + file { "${user_home}/.oh-my-zsh/custom/plugins": + ensure => 'directory', + owner => $user, + } + + file {"${user_home}/.oh-my-zsh/custom/custom": + ensure => 'link', + owner => $user, + target => find_file('core/oh-my-zsh/custom'), + require => [Exec['git clone ohmyzsh']], + force => true, + } + + file {"${user_home}/.oh-my-zsh/custom/lib": + ensure => 'link', + owner => $user, + target => find_file('core/oh-my-zsh/lib'), + require => [Exec['git clone ohmyzsh']], + force => true, + } + + file {"${user_home}/.oh-my-zsh/custom/custom.zsh": + ensure => 'link', + owner => $user, + target => find_file('core/oh-my-zsh/custom.zsh'), + require => [Exec['git clone ohmyzsh']], + force => true, + } + + file {"${user_home}/.oh-my-zsh/custom/plugins/notmuch": + ensure => 'link', + owner => $user, + target => find_file('core/oh-my-zsh/plugins/notmuch'), + require => [Exec['git clone ohmyzsh']], + force => true, + } + + vcsrepo { "${user_home}/.oh-my-zsh/custom/plugins/zsh-autosuggestions": + source => 'git://github.com/zsh-users/zsh-autosuggestions', + provider => 'git', + user => $user, + } + + vcsrepo { "${user_home}/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting": + source => 'git://github.com/zsh-users/zsh-syntax-highlighting.git', + provider => 'git', + user => $user, + } +} diff --git a/site-modules/core/templates/git/gitconfig.erb b/site-modules/core/templates/git/gitconfig.erb new file mode 100644 index 0000000..8e44dda --- /dev/null +++ b/site-modules/core/templates/git/gitconfig.erb @@ -0,0 +1,14 @@ +<%- $file = __FILE__ -%> +<%- $comment = '#' -%> +<%= scope.call_function('template', ["core/header.erb"]) %> + +[user] + email = <%= scope.call_function('lookup', ["email"]) %> + name = <%= scope.call_function('lookup', ["user_name"]) %> + +[core] + editor = nvim + autocrlf = input + +[rerere] + enabled = true diff --git a/site-modules/core/templates/header.erb b/site-modules/core/templates/header.erb new file mode 100644 index 0000000..a38a5f1 --- /dev/null +++ b/site-modules/core/templates/header.erb @@ -0,0 +1,8 @@ +<%= $comment %> +<%= $comment %> This file is managed by the puppet +<%= $comment %> +<%= $comment %> Do not edit this file directly changes will be overridden after apples configuration +<%= $comment %> +<%= $comment %> File: <%= $file %> +<%= $comment %> Updated: <%= File.mtime($file) %> +<%= $comment %>