├── npmrc ├── st ├── st-old ├── wallpaper.jpg ├── pam_environment ├── Xmodmap ├── picom.conf ├── iwd-main.conf ├── 30-touchpad.conf ├── bash_profile ├── 00-keyboard.conf ├── ssh-agent.service ├── betterlockscreen@.service ├── coc-settings.json ├── fzfbat ├── xprofile ├── gitconfig ├── xmonad ├── icons │ ├── full.xpm │ ├── mirror.xpm │ └── tall.xpm └── xmonad.hs ├── README.md ├── xmobarrc ├── vimspector.json ├── bashrc ├── libinput-gestures.conf ├── init.vim ├── vimrc └── lucius.vim /npmrc: -------------------------------------------------------------------------------- 1 | prefix=~/.npm-global 2 | -------------------------------------------------------------------------------- /st: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-man/dotfiles/HEAD/st -------------------------------------------------------------------------------- /st-old: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-man/dotfiles/HEAD/st-old -------------------------------------------------------------------------------- /wallpaper.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-man/dotfiles/HEAD/wallpaper.jpg -------------------------------------------------------------------------------- /pam_environment: -------------------------------------------------------------------------------- 1 | SSH_AUTH_SOCK DEFAULT="${XDG_RUNTIME_DIR}/ssh-agent.socket" 2 | -------------------------------------------------------------------------------- /Xmodmap: -------------------------------------------------------------------------------- 1 | pointer = 1 7 3 4 5 6 2 8 9 10 11 12 2 | keycode 0x60 = Insert Insert Insert 3 | -------------------------------------------------------------------------------- /picom.conf: -------------------------------------------------------------------------------- 1 | shadow = false; 2 | fading = false; 3 | backend = "glx"; 4 | vsync = true; 5 | -------------------------------------------------------------------------------- /iwd-main.conf: -------------------------------------------------------------------------------- 1 | [General] 2 | EnableNetworkConfiguration=true 3 | 4 | [Network] 5 | NameResolvingService=systemd 6 | -------------------------------------------------------------------------------- /30-touchpad.conf: -------------------------------------------------------------------------------- 1 | Section "InputClass" 2 | Identifier "touchpad" 3 | Driver "libinput" 4 | MatchIsTouchpad "on" 5 | Option "Tapping" "on" 6 | Option "TapButton1" "1" 7 | Option "TapButton2" "2" 8 | Option "TapButton3" "3" 9 | EndSection 10 | -------------------------------------------------------------------------------- /bash_profile: -------------------------------------------------------------------------------- 1 | # 2 | # ~/.bash_profile 3 | # 4 | 5 | [[ -f ~/.bashrc ]] && . ~/.bashrc 6 | export PATH="/home/owg1/.local/bin:$PATH" 7 | # https://github.com/White-Oak/arch-setup-for-dummies/blob/master/setting-up-ssh-agent.md 8 | export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" 9 | 10 | -------------------------------------------------------------------------------- /00-keyboard.conf: -------------------------------------------------------------------------------- 1 | # Written by systemd-localed(8), read by systemd-localed and Xorg. It's 2 | # probably wise not to edit this file manually. Use localectl(1) to 3 | # update this file. 4 | Section "InputClass" 5 | Identifier "system-keyboard" 6 | MatchIsKeyboard "on" 7 | Option "XkbLayout" "gb,se" 8 | EndSection 9 | -------------------------------------------------------------------------------- /ssh-agent.service: -------------------------------------------------------------------------------- 1 | # ~/.config/systemd/user/ssh-agent.service 2 | # Move pam_environment 3 | # systemctl enable --user ssh-agent 4 | 5 | [Unit] 6 | Description=SSH key agent 7 | 8 | [Service] 9 | Type=simple 10 | Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket 11 | # DISPLAY required for ssh-askpass to work 12 | Environment=DISPLAY=:0 13 | ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK 14 | 15 | [Install] 16 | WantedBy=default.target 17 | -------------------------------------------------------------------------------- /betterlockscreen@.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Lock screen when going to sleep/suspend 3 | Before=sleep.target 4 | Before=suspend.target 5 | 6 | [Service] 7 | User=%I 8 | Type=simple 9 | Environment=DISPLAY=:0 10 | EnvironmentFile=/home/owg1/.ssh-env 11 | ExecStartPre=/usr/bin/ssh-add -D 12 | ExecStart=/usr/bin/betterlockscreen --lock 13 | TimeoutSec=infinity 14 | ExecStartPost=/usr/bin/sleep 1 15 | 16 | [Install] 17 | WantedBy=sleep.target 18 | WantedBy=suspend.target 19 | -------------------------------------------------------------------------------- /coc-settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "suggest.triggerAfterInsertEnter": true, 3 | "suggest.timeout": 500, 4 | "suggest.minTriggerInputLength": 2, 5 | "coc.preferences.jumpCommand": "vsplit", 6 | "typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true, 7 | "typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": true, 8 | "typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": true, 9 | "tslint.autoFixOnSave": true, 10 | "sql.database":"postgresql" 11 | } 12 | -------------------------------------------------------------------------------- /fzfbat: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export BAT_THEME="Monokai Extended Origin" 3 | REGEX=':[0-9]+:[0-9]+:' 4 | if [[ $1 =~ $REGEX ]]; then 5 | filename=$(awk -F ':' '{print $1}' <<< $1) 6 | line=$(awk -F ':' '{print $2}' <<< $1) 7 | if [[ $line -gt 10 ]]; then 8 | end=$(($line+50)) 9 | start=$(($line-10)) 10 | else 11 | end=$(($line+50)) 12 | start=0 13 | fi 14 | bat --style=numbers --color=always --line-range $start:$end --highlight-line $line $filename 15 | else 16 | bat --style=numbers --color=always $@ 17 | fi 18 | -------------------------------------------------------------------------------- /xprofile: -------------------------------------------------------------------------------- 1 | xset -dpms 2 | xset s noblank 3 | xset s of 4 | xset r rate 250 44 5 | setxkbmap -layout "gb,se" -option caps:escape 6 | xmodmap ~/.Xmodmap 7 | copyq & 8 | udiskie -a & 9 | picom -b & 10 | nitrogen --restore & 11 | trayer --edge top --align right --SetDockType true --SetPartialStrut true --expand false --width 10 --height 18 --margin 105 --transparent true --alpha 0 --tint 0x111111 --iconspacing 10 & 12 | pamac-tray & 13 | nm-applet & 14 | pa-applet & 15 | libinput-gestures-setup start & 16 | /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & 17 | -------------------------------------------------------------------------------- /gitconfig: -------------------------------------------------------------------------------- 1 | [core] 2 | email = garland.owen@gmail.com 3 | name = Owen Garland 4 | editor = nvim 5 | excludesfile = ~/.gitignore 6 | [user] 7 | email = garland.owen@gmail.com 8 | name = Owen Garland 9 | [push] 10 | default = simple 11 | [pull] 12 | rebase = true 13 | [alias] 14 | showtool = "!f() { git difftool $1^ $1; }; f" 15 | added = difftool --cached 16 | [tag] 17 | sort = version:refname 18 | [diff] 19 | tool = icdiff 20 | [difftool] 21 | prompt = false 22 | [difftool "icdiff"] 23 | cmd = /usr/bin/icdiff --line-numbers $LOCAL $REMOTE 24 | [pager] 25 | difftool = true 26 | -------------------------------------------------------------------------------- /xmonad/icons/full.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * layout_full_xpm[] = { 3 | "20 20 2 1", 4 | " c None", 5 | ". c #626262", 6 | " ", 7 | " ", 8 | " ", 9 | " ", 10 | " ............... ", 11 | " . . ", 12 | " . . ", 13 | " . . ", 14 | " . . ", 15 | " . . ", 16 | " . . ", 17 | " . . ", 18 | " . . ", 19 | " . . ", 20 | " . . ", 21 | " . . ", 22 | " ............... ", 23 | " ", 24 | " ", 25 | " "}; 26 | -------------------------------------------------------------------------------- /xmonad/icons/mirror.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * layout_full_xpm[] = { 3 | "20 20 2 1", 4 | " c None", 5 | ". c #626262", 6 | " ", 7 | " ", 8 | " ", 9 | " ", 10 | " ............... ", 11 | " . . ", 12 | " . . ", 13 | " . . ", 14 | " . . ", 15 | " . . ", 16 | " ............... ", 17 | " . . . ", 18 | " . . . ", 19 | " . . . ", 20 | " . . . ", 21 | " . . . ", 22 | " ............... ", 23 | " ", 24 | " ", 25 | " "}; 26 | -------------------------------------------------------------------------------- /xmonad/icons/tall.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * layout_full_xpm[] = { 3 | "20 20 2 1", 4 | " c None", 5 | ". c #626262", 6 | " ", 7 | " ", 8 | " ", 9 | " ", 10 | " ............... ", 11 | " . . . ", 12 | " . . . ", 13 | " . . . ", 14 | " . . . ", 15 | " . . . ", 16 | " . ........ ", 17 | " . . . ", 18 | " . . . ", 19 | " . . . ", 20 | " . . . ", 21 | " . . . ", 22 | " ............... ", 23 | " ", 24 | " ", 25 | " "}; 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This is for my Manjaro systems. Install manjaro with the architect, and use cinammon as the DE, and ensure to have yay installed. This gives you a nice platform to bootstrap the rest of the setup from. 2 | 3 | All of the files except for the vim specific stuff (lucius, coc, vimspector) needs to just be moved to the home directory and prepended with a `.` so `xmonad/ -> ~/.xmonad/`, `bashrc -> .bashrc`. 4 | 5 | The only exception is the ssh-agent.service file which has commented instructions in. 6 | 7 | Vim will auto install fzf and rg and everything else. It takes two launches to get it all mind. 8 | 9 | Packages used: 10 | 11 | ``` 12 | bfs-git 13 | brave 14 | copyq 15 | gvim 16 | htop 17 | icdiff 18 | libinput-gestures 19 | nitrogen 20 | openssh 21 | pamac-gtk 22 | pass 23 | pass-clip 24 | pkgfile 25 | rofi 26 | trayer 27 | ttf-anonymous-pro 28 | xf86-input-synaptics 29 | xkb-switch 30 | yay 31 | iwd 32 | ``` 33 | 34 | Handy link for installing xmonad: https://brianbuccola.com/how-to-install-xmonad-and-xmobar-via-stack/ 35 | 36 | Short version, don't use arch repos, build yourself with Stack. 37 | -------------------------------------------------------------------------------- /xmobarrc: -------------------------------------------------------------------------------- 1 | Config { 2 | font = "Anonymous Pro Minus 13", 3 | -- font = "xft:Anonymous Pro Minus:size=10:antialias=true:autohint=true", 4 | bgColor = "#111111", 5 | fgColor = "#888888", 6 | position = TopH 20, 7 | commands = [Run StdinReader, 8 | Run BatteryP ["BAT0"] ["-t", "%"] 60, 9 | Run Date "%H:%M " "date" 10, 10 | Run Com "sh" ["-c", "mpc | head -n 1"] "mpd" 50, 11 | Run Com "sh" ["-c", "iwctl station wlan0 show | grep network | awk -F ' ' '{print $3}'"] "wifi" 60, 12 | Run Com "sh" ["-c", "iwconfig wlan0 | grep Signal | awk -F '=' '{print substr($3,0,3)}'"] "wifisignal" 60, 13 | Run Com "sh" ["-c", "cd Projects/departureboard; node build/xmobar.js"] "bus" 50, 14 | Run Com "sh" ["-c", "cd Projects/departureboard; node build/xmobarweather.js"] "weather" 60, 15 | Run Com "sh" ["-c", "cd Projects/SSA; bash propagation.sh"] "propagation" 3600, 16 | Run Kbd [("gb", "GB"), ("se", "SE")]], 17 | sepChar = "%", 18 | alignSep = "}{", 19 | template = "%StdinReader% : %mpd% } %bus% { %propagation% : %weather% : %wifi% %wifisignal% : %kbd% : %battery% : %date%" 20 | } 21 | -------------------------------------------------------------------------------- /vimspector.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": { 3 | "ts-node": { 4 | "adapter": "vscode-node", 5 | "configuration": { 6 | "stopOnEntry": false, 7 | "console": "integratedTerminal", 8 | "name": "Node Inspector", 9 | "type": "node", 10 | "request": "launch", 11 | "args": ["${workspaceRoot}/src/bin/server.ts"], 12 | "runtimeArgs": ["-r", "~/.npm-global/lib/node_modules/ts-node/register/index.js"], 13 | "cwd": "${workspaceRoot}", 14 | "protocol": "inspector", 15 | "internalConsoleOptions": "openOnSessionStart", 16 | "env": { 17 | "TS_NODE_IGNORE": "false", 18 | "TS_NODE_FILES": "true" 19 | } 20 | }, 21 | "breakpoints": { 22 | "exception": { 23 | "caught": "N", 24 | "uncaught": "N", 25 | "all": "N" 26 | } 27 | } 28 | }, 29 | "jest": { 30 | "adapter": "vscode-node", 31 | "configuration": { 32 | "stopOnEntry": false, 33 | "console": "integratedTerminal", 34 | "name": "Node Inspector", 35 | "type": "node", 36 | "request": "launch", 37 | "program": "${workspaceFolder}/node_modules/.bin/jest", 38 | "args": ["${fileBasenameNoExtension}"], 39 | "cwd": "${workspaceRoot}", 40 | "protocol": "inspector", 41 | "internalConsoleOptions": "openOnSessionStart" 42 | }, 43 | "breakpoints": { 44 | "exception": { 45 | "caught": "N", 46 | "uncaught": "N", 47 | "all": "N" 48 | } 49 | } 50 | } 51 | } 52 | } 53 | 54 | -------------------------------------------------------------------------------- /xmonad/xmonad.hs: -------------------------------------------------------------------------------- 1 | import XMonad 2 | import XMonad.Actions.CycleWS 3 | import XMonad.Layout.NoBorders 4 | import XMonad.Hooks.DynamicLog 5 | import XMonad.Util.Run(spawnPipe) 6 | import XMonad.Hooks.ManageHelpers 7 | import qualified XMonad.StackSet as W 8 | import XMonad.Util.EZConfig 9 | import XMonad.Layout.ResizableTile 10 | import XMonad.Actions.CopyWindow 11 | 12 | main = xmonad =<< statusBar "xmobar" myPP toggleStrutsKey myConfig 13 | 14 | myBorderColour = "#333333" 15 | myBorderWidth = 2 16 | myWorkspaces = ["1", "2", "3", "4", "5", "6", "7", "8", "9"] 17 | myTerminal = "st" 18 | 19 | myPP = xmobarPP { 20 | ppCurrent = (xmobarColor "#117FF5" ""), 21 | ppTitle = (\str -> ""), 22 | ppHidden = (xmobarColor "#626262" ""), 23 | ppHiddenNoWindows = (xmobarColor "#626262" ""), 24 | ppLayout = 25 | (\x -> case x of 26 | "ResizableTall" -> "" 27 | "Mirror ResizableTall" -> "" 28 | "Full" -> "" 29 | _ -> x 30 | ) 31 | } 32 | 33 | myKeys = [ 34 | 35 | -- Functions 36 | 37 | ((mod1Mask, xK_F1),spawn "amixer -D pulse set Master 1+ toggle"), 38 | ((mod1Mask, xK_F2),spawn "amixer -D pulse sset Master 5%-"), 39 | ((mod1Mask, xK_F3),spawn "amixer -D pulse sset Master 5%+"), 40 | ((mod1Mask, xK_F4),spawn "mpc prev"), 41 | ((mod1Mask, xK_F5),spawn "mpc toggle"), 42 | ((mod1Mask, xK_F6),spawn "mpc next"), 43 | ((mod1Mask, xK_F7),spawn "brightnessctl s 5%-"), 44 | ((mod1Mask, xK_F8),spawn "brightnessctl s 5%+"), 45 | ((mod1Mask, xK_F9),spawn "xkb-switch -n"), 46 | 47 | -- Applications 48 | ((mod1Mask, xK_w), spawn "brave"), 49 | ((mod1Mask, xK_p), spawn "rofi -show run"), 50 | ((mod1Mask, xK_o), spawn "pass clip --rofi"), 51 | ((mod1Mask, xK_End), spawn "betterlockscreen --lock"), 52 | ((mod1Mask, xK_v ), windows copyToAll), 53 | ((controlMask .|. mod1Mask, xK_v ), killAllOtherCopies), 54 | ((0, xK_F11), spawn "escrotum -s /tmp/shot.png; copyq write image/png - < /tmp/shot.png && copyq select 0"), 55 | ((controlMask, xK_F11), spawn "escrotum /tmp/shot.png; copyq write image/png - < /tmp/shot.png && copyq select 0"), 56 | 57 | -- Media keys (bluetooth headset) /usr/include/X11/XF86keysym.h 58 | ((0, 0x1008FF17), spawn "mpc next"), 59 | ((0, 0x1008ff14), spawn "mpc toggle"), 60 | ((0, 0x1008ff31), spawn "mpc toggle"), 61 | 62 | -- Adjust split 63 | ((mod1Mask, xK_j), sendMessage MirrorShrink), 64 | ((mod1Mask, xK_k), sendMessage MirrorExpand), 65 | 66 | -- Workspaces 67 | ((controlMask .|. mod1Mask, xK_l), nextWS), 68 | ((controlMask .|. mod1Mask, xK_h), prevWS), 69 | ((mod1Mask .|. shiftMask, xK_l), shiftToNext >> nextWS), 70 | ((mod1Mask .|. shiftMask, xK_h), shiftToPrev >> prevWS), 71 | 72 | -- Master pane count 73 | ((mod1Mask, xK_apostrophe), sendMessage(IncMasterN(-1))), 74 | ((mod1Mask, xK_semicolon), sendMessage(IncMasterN(1))) 75 | ] 76 | 77 | toggleStrutsKey XConfig{modMask = modm} = (modm, xK_b ) 78 | 79 | myManageHook = 80 | composeAll[ 81 | isFullscreen --> (doF W.focusDown <+> doFullFloat), 82 | className =? "mpv" --> doRectFloat (W.RationalRect 0.9 0.84 0.09 0.13) <+> doF copyToAll 83 | ] 84 | 85 | myResizable = smartBorders $ ResizableTall 1 (3/100) (1/2) [] 86 | 87 | myLayout = myResizable ||| Mirror myResizable ||| noBorders Full 88 | 89 | startup = do 90 | spawn "libinput-gestures-setup start &" 91 | spawn "picom -b --config ~/.picom.conf &" 92 | spawn "nitrogen --restore &" 93 | spawn "trayer --edge top --align right --SetDockType true --SetPartialStrut true --expand false --width 5 --height 18 --margin 600 --transparent true --alpha 0 --tint 0x111111 --iconspacing 10 &" 94 | spawn "copyq &" 95 | spawn "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &" 96 | spawn "xset -dpms" 97 | spawn "xset s noblank" 98 | spawn "xset s off" 99 | spawn "xset r rate 250 44" 100 | spawn "setxkbmap -layout 'gb,se' -option caps:escape" 101 | spawn "echo SSH_AUTH_SOCK=$SSH_AUTH_SOCK > .ssh-env" 102 | spawn "sleep 3; xmodmap /home/owg1/.Xmodmap" 103 | 104 | 105 | myConfig = def { 106 | terminal = myTerminal, 107 | borderWidth = myBorderWidth, 108 | normalBorderColor = myBorderColour, 109 | focusedBorderColor = myBorderColour, 110 | workspaces = myWorkspaces, 111 | manageHook = myManageHook, 112 | startupHook = startup, 113 | layoutHook = myLayout 114 | } `removeKeys` [(mod1Mask, xK_comma), (mod1Mask, xK_period), (mod1Mask, xK_k), (mod1Mask, xK_j)] 115 | `additionalKeys` myKeys 116 | -------------------------------------------------------------------------------- /bashrc: -------------------------------------------------------------------------------- 1 | # If not running interactively, don't do anything 2 | [[ $- != *i* ]] && return 3 | 4 | # Stop Ctl+S 5 | stty -ixon 6 | 7 | [ -r /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion 8 | PKGFILE_PROMPT_INSTALL_MISSING=y 9 | source /usr/share/doc/pkgfile/command-not-found.bash 10 | source /usr/share/git/completion/git-prompt.sh 11 | #source /home/owg1/.pythonvenv/bin/activate 12 | 13 | WHITE="\[\e[1;37m\]" 14 | BLUE="\[\e[1;34m\]" 15 | RED="\[\e[1;31m\]" 16 | PS1="$WHITE\W\$(__git_ps1 ' (%s)') $BLUEλ $WHITE" 17 | PS2='> ' 18 | PS3='> ' 19 | PS4='+ ' 20 | 21 | prompt_cmd () { 22 | LAST_STATUS=$? 23 | history -a; history -c; history -r; 24 | } 25 | 26 | export PROMPT_COMMAND=prompt_cmd 27 | 28 | alias pins="yay -Slq | fzf -m --preview 'cat <(yay -Si {1}) <(yay -Fl {1} | awk \"{print \$2}\")' | xargs -ro yay -S" 29 | alias spr="nc termbin.com 9999" 30 | alias vi=nvim 31 | alias pamcan="pacman" 32 | alias paste="xsel --clipboard | spr" 33 | alias ls="ls -lah --color --group-directories-first" 34 | alias entr="find . -not -path './node_modules/*' -not -name '*.swp' | entr sh -c" 35 | alias where="bfs ./ -exclude -name Music/ -name" 36 | alias rg="rg -p" 37 | alias less="less -R" 38 | alias orphans="pacman -Qdt" 39 | alias cleanorphans="pacman -Rns $(pacman -Qtdq)" 40 | alias explicit="pacman -Qet" 41 | alias mirrors="sudo pacman-mirrors --fasttrack && sudo pacman -Syy" 42 | alias json="python -m json.tool" 43 | alias build="npm --silent run build" 44 | alias test="npm --silent run test" 45 | alias start="npm --silent run start" 46 | alias nuke="rm -rf build node_modules/ && npm i && npm run build" 47 | alias psql="pgcli" 48 | alias vsink="pactl load-module module-null-sink sink_name=VirtualRx format=s16le channels=2 rate=48000 sink_properties=device.description='VirtualRx'" 49 | 50 | alias pr="gh pr create -w" 51 | alias diff="git difftool -- ':!package-lock.json'" 52 | alias show="git showtool" 53 | alias stat="git status" 54 | alias add="git add" 55 | alias commit="git commit -v" 56 | alias push='git push -u origin $(git rev-parse --abbrev-ref HEAD)' 57 | alias check="git checkout" 58 | alias stash="git stash -u" 59 | alias pop="git stash pop" 60 | alias pull="git pull" 61 | alias clone="git clone" 62 | alias merge="git merge" 63 | alias cherry="git cherry-pick" 64 | alias last="git difftool HEAD^ HEAD" 65 | alias fetch="git fetch" 66 | alias revert="git revert" 67 | alias bisect="git bisect" 68 | alias reflog="git reflog" 69 | alias apply="git apply" 70 | alias reset="git reset" 71 | alias rebase="git rebase -i master" 72 | alias clean="git clean -f" 73 | alias log="fzf_log" 74 | alias squash="git reset --soft HEAD~2 && git commit" 75 | alias theirs="git merge --strategy-option theirs" 76 | alias removelocal="git reset --hard @{u}" 77 | alias amend="git commit --amend -C @" 78 | 79 | export EDITOR=nvim 80 | export TERM=xterm-256color 81 | export PYTHON=python3.9.1 82 | export VOLTA_HOME=$HOME/.volta 83 | export PATH=$VOLTA_HOME/bin:~/.npm-global/bin:/home/owg1/.gem/ruby/2.5.0/bin:~/.poetry/bin:$PATH 84 | export DOCKER_BUILDKIT=1 85 | export COMPOSE_DOCKER_CLI_BUILD=1 86 | 87 | export HISTCONTROL=ignoredups:erasedups 88 | export HISTSIZE=-1 89 | export HISTFILESIZE=-1 90 | shopt -s histappend 91 | 92 | [ -f ~/.fzf.bash ] && source ~/.fzf.bash 93 | export FZF_DEFAULT_COMMAND='rg --files --no-ignore --hidden --follow -g "!{.git,output,node_modules,*.swp,dist,*.coffee}/*" 2> /dev/null' 94 | export FZF_ALT_C_COMMAND='bfs -type d -nohidden -exclude -name "Music" -exclude -name "Drive"' 95 | export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" 96 | export FZF_DEFAULT_OPTS='--bind J:down,K:up --reverse --ansi --multi --preview "fzfbat {}" --preview-window "up,70%,border-bottom"' 97 | bind -x '"\C-p": fvim' 98 | bind -m vi-insert '"\C-x\C-e": edit-and-execute-command' 99 | 100 | sf() { 101 | if [ "$#" -lt 1 ]; then echo "Supply string to search for!"; return 1; fi 102 | printf -v search "%q" "$*" 103 | include="tsx,vim,ts,yml,yaml,js,json,php,md,styl,pug,jade,html,config,py,cpp,c,go,hs,rb,conf,fa,lst,graphql,tf,proto" 104 | exclude="output,.config,.git,node_modules,vendor,build/,yarn.lock,*.sty,*.bst,*.coffee,dist" 105 | rg_command='rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --color "always" -g "*.{'$include'}" -g "!{'$exclude'}/*"' 106 | files=`eval $rg_command $search | fzf --ansi --multi --reverse | awk -F ':' '{print $1":"$2":"$3}'` 107 | [[ -n "$files" ]] && ${EDITOR:-nvim} $files 108 | } 109 | 110 | sfu() { 111 | if [ "$#" -lt 1 ]; then echo "Supply string to search for!"; return 1; fi 112 | printf -v search "%q" "$*" 113 | include="ts,yml,yaml,js,json,php,md,styl,pug,jade,html,config,py,cpp,c,go,hs,rb,conf,fa,lst,tf" 114 | exclude="output,.config,.git,node_modules,vendor,build,yarn.lock,*.sty,*.bst,*.coffee,dist" 115 | rg_command='rg -m1 --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --color "always" -g "*.{'$include'}" -g "!{'$exclude'}/*"' 116 | files=`eval $rg_command $search | fzf --ansi --multi --reverse | awk -F ':' '{print $1":"$2":"$3}'` 117 | [[ -n "$files" ]] && ${EDITOR:-nvim} $files 118 | } 119 | 120 | 121 | fc() { 122 | hash=$(git log --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" | fzf | awk '{print $1}') 123 | git checkout $hash 124 | } 125 | 126 | gc() { 127 | hash=$(git log --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" | fzf | awk '{print $1}') 128 | gopen $hash 129 | } 130 | 131 | fzf_log() { 132 | hash=$(git log --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" | fzf | awk '{print $1}') 133 | echo $hash | xclip 134 | git showtool $hash 135 | } 136 | 137 | tm() { 138 | [[ -n "$TMUX" ]] && change="switch-client" || change="attach-session" 139 | if [ $1 ]; then 140 | tmux $change -t "$1" 2>/dev/null || (tmux new-session -d -s $1 && tmux $change -t "$1"); return 141 | fi 142 | session=$(tmux list-sessions -F "#{session_name}" 2>/dev/null | fzf --exit-0) && tmux $change -t "$session" || echo "No sessions found." 143 | } 144 | 145 | vee() { 146 | nvim $(npm run build | grep error | awk -F " " '{print $1}' | sed s/\(/:/g | sed s/\,/:/g | sed s/\).*//) 147 | } 148 | 149 | branch() { 150 | local branches branch 151 | branches=$(git for-each-ref --count=30 --sort=-committerdate refs/heads/ --format="%(refname:short)") && 152 | branch=$(echo "$branches" | 153 | fzf-tmux -d $(( 2 + $(wc -l <<< "$branches") )) +m) && 154 | git checkout $(echo "$branch" | sed "s/.* //" | sed "s#remotes/[^/]*/##") 155 | } 156 | 157 | fvim() { 158 | local IFS=$'\n' 159 | local files=($(fzf-tmux --query="$1" --multi --select-1 --exit-0)) 160 | [[ -n "$files" ]] && ${EDITOR:-nvim} "${files[@]}" 161 | } 162 | 163 | c() { 164 | local cols sep google_history open 165 | cols=$(( COLUMNS / 3 )) 166 | sep='{::}' 167 | 168 | google_history="$HOME/.config/BraveSoftware/Brave-Browser/Default/History" 169 | open=xdg-open 170 | cp -f "$google_history" /tmp/h 171 | sqlite3 -separator $sep /tmp/h \ 172 | "select substr(title, 1, $cols), url 173 | from urls order by last_visit_time desc" | 174 | awk -F $sep '{printf "%-'$cols's \x1b[36m%s\x1b[m\n", $1, $2}' | 175 | fzf --ansi --multi | sed 's#.*\(https*://\)#\1#' | xargs $open > /dev/null 2> /dev/null 176 | } 177 | 178 | gopen() { 179 | project=$(git config --local remote.origin.url | sed s/git@github.com\:// | sed s/\.git//) 180 | url="http://github.com/$project/commit/$1" 181 | xdg-open $url 182 | } 183 | 184 | 185 | -------------------------------------------------------------------------------- /libinput-gestures.conf: -------------------------------------------------------------------------------- 1 | # Configuration file for libinput-gestures. 2 | # Mark Blakeney, Sep 2015 3 | # 4 | # The default configuration file exists at /etc/libinput-gestures.conf 5 | # but a user can create a personal custom configuration file at 6 | # ~/.config/libinput-gestures.conf. 7 | # 8 | # Lines starting with '#' and blank lines are ignored. Currently 9 | # "gesture" and "device" configuration keywords are supported as 10 | # described below. The keyword can optionally be appended with a ":" (to 11 | # maintain compatibility with original format configuration files). 12 | # 13 | # Each gesture line has 3 [or 4] arguments separated by whitespace: 14 | # 15 | # action motion [finger_count] command 16 | # 17 | # where action and motion is either: 18 | # swipe up 19 | # swipe down 20 | # swipe left 21 | # swipe right 22 | # swipe left_up 23 | # swipe left_down 24 | # swipe right_up 25 | # swipe right_down 26 | # pinch in 27 | # pinch out 28 | # pinch clockwise 29 | # pinch anticlockwise 30 | # 31 | # command is the remainder of the line and is any valid shell command + 32 | # arguments. 33 | # 34 | # finger_count is a single numeric digit and is optional (and is 35 | # typically 3 or 4). If specified then the command is executed when 36 | # exactly that number of fingers is used in the gesture. If not 37 | # specified then the command is executed when that gesture is executed 38 | # with any number of fingers. Gesture lines specified with finger_count 39 | # have priority over the same gesture specified without any 40 | # finger_count. 41 | # 42 | # Typically command will be xdotool, or wmctrl. See "man xdotool" for 43 | # the many things you can action with that tool. Note that unfortunately 44 | # xdotool does not work with native Wayland clients. 45 | 46 | ############################################################################### 47 | # SWIPE GESTURES: 48 | ############################################################################### 49 | 50 | # Note the default is an "internal" command that uses wmctrl to switch 51 | # workspaces and, unlike xdotool, works on both Xorg and Wayland (via 52 | # XWayland). It also can be configured for vertical and horizontal 53 | # switching over tabular workspaces, as per the example below. You can 54 | # also add "-w" to the internal command to allow wrapping workspaces. 55 | 56 | # Move to next workspace (works for GNOME/KDE/etc on Wayland and Xorg) 57 | gesture swipe up _internal ws_up 58 | 59 | # NOTE ABOUT FINGER COUNT: 60 | # The above command will configure this command for all fingers (i.e. 3 61 | # for 4) but to configure it for 3 fingers only, change it to: 62 | # gesture swipe up 3 _internal ws_up 63 | # Then you can configure something else for 4 fingers or leave 4 fingers 64 | # unconfigured. You can configure an explicit finger count like this for 65 | # all example commands in this configuration file. 66 | # 67 | # gesture swipe up xdotool key super+Page_Down 68 | 69 | # Move to prev workspace (works for GNOME/KDE/etc on Wayland and Xorg) 70 | gesture swipe down _internal ws_down 71 | # gesture swipe down xdotool key super+Page_Up 72 | 73 | # Browser go forward (works only for Xorg, and Xwayland clients) 74 | gesture swipe left xdotool key ctrl+alt+l 75 | 76 | # Browser go back (works only for Xorg, and Xwayland clients) 77 | gesture swipe right xdotool key ctrl+alt+h 78 | 79 | # NOTE: If you don't use "natural" scrolling direction for your touchpad 80 | # then you may want to swap the above default left/right and up/down 81 | # configurations. 82 | 83 | # Optional extended swipe gestures, e.g. for browser tab navigation: 84 | # 85 | # Jump to next open browser tab 86 | # gesture swipe right_up xdotool key control+Tab 87 | # 88 | # Jump to previous open browser tab 89 | # gesture swipe left_up xdotool key control+shift+Tab 90 | # 91 | # Close current browser tab 92 | # gesture swipe left_down xdotool key control+w 93 | # 94 | # Reopen and jump to last closed browser tab 95 | # gesture swipe right_down xdotool key control+shift+t 96 | 97 | # Example of 8 static workspaces, e.g. using KDE virtual-desktops, 98 | # arranged in 2 rows of 4 columns across using swipe up/down/left/right 99 | # to navigate in fixed planes. You can also add the "-w/--wrap" option 100 | # to allow wrapping in any direction. You must configure your virtual 101 | # desktops with the same column dimension. 102 | # gesture swipe up _internal --cols 4 ws_up 103 | # gesture swipe down _internal --cols 4 ws_down 104 | # gesture swipe left _internal --cols 4 ws_left 105 | # gesture swipe right _internal --cols 4 ws_right 106 | # 107 | # Example of 16 static workspaces, e.g. using KDE virtual-desktops, 108 | # arranged in 4 rows of 4 columns across using swipe up/down/left/right 109 | # to navigate in fixed planes, and also using swipe 110 | # left_up/left_down/right_up/right_down to navigate diagonally. You can 111 | # also add the "-w/--wrap" option to allow wrapping in any direction 112 | # and/or diagonally. You must configure your virtual desktops with the 113 | # same column dimension. 114 | # gesture swipe up _internal --cols 4 ws_up 115 | # gesture swipe down _internal --cols 4 ws_down 116 | # gesture swipe left _internal --cols 4 ws_left 117 | # gesture swipe right _internal --cols 4 ws_right 118 | # gesture swipe left_up _internal --cols 4 ws_left_up 119 | # gesture swipe left_down _internal --cols 4 ws_left_down 120 | # gesture swipe right_up _internal --cols 4 ws_right_up 121 | # gesture swipe right_down _internal --cols 4 ws_right_down 122 | 123 | # Example virtual desktop switching for Ubuntu Unity/Compiz. The 124 | # _internal command does not work for Compiz but you can explicitly 125 | # configure the swipe commands to work for a Compiz virtual 2 126 | # dimensional desktop as follows: 127 | # gesture swipe up xdotool key ctrl+alt+Up 128 | # gesture swipe down xdotool key ctrl+alt+Down 129 | # gesture swipe left xdotool key ctrl+alt+Left 130 | # gesture swipe right xdotool key ctrl+alt+Right 131 | 132 | # Example to change audio volume: 133 | # Note this only works on an Xorg desktop (not Wayland). 134 | # gesture swipe up xdotool key XF86AudioRaiseVolume 135 | # gesture swipe down xdotool key XF86AudioLowerVolume 136 | 137 | ############################################################################### 138 | # PINCH GESTURES: 139 | ############################################################################### 140 | 141 | # GNOME SHELL open/close overview (works for GNOME on Xorg only) 142 | gesture pinch in xdotool key super+s 143 | gesture pinch out xdotool key super+s 144 | 145 | # KDE Plasma open/close overview 146 | # gesture pinch in xdotool key ctrl+F9 147 | # gesture pinch out xdotool key ctrl+F9 148 | 149 | # GNOME SHELL open/close overview (works for GNOME on Wayland and Xorg) 150 | # Note since GNOME 3.24 on Wayland this is implemented natively so no 151 | # real point configuring for Wayland. 152 | # gesture pinch in dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:'Main.overview.toggle();' 153 | # gesture pinch out dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:'Main.overview.toggle();' 154 | 155 | # Optional extended pinch gestures: 156 | # gesture pinch clockwise 157 | # gesture pinch anticlockwise 158 | 159 | ############################################################################### 160 | # This application normally determines your touchpad device 161 | # automatically. Some users may have multiple touchpads but by default 162 | # we use only the first one found. However, you can choose to specify 163 | # the explicit device name to use. Run "libinput list-devices" to work 164 | # out the name of your device (from the "Device:" field). Then add a 165 | # device line specifying that name, e.g: 166 | # 167 | # device DLL0665:01 06CB:76AD Touchpad 168 | # 169 | # If the device name starts with a '/' then it is instead considered as 170 | # the explicit device path although since device paths can change 171 | # through reboots this is best to be a symlink. E.g. instead of specifying 172 | # /dev/input/event12, you should use the corresponding full path link 173 | # under /dev/input/by-path/ or /dev/input/by-id/. 174 | # 175 | # You can choose to use ALL touchpad devices by setting the device name 176 | # to "all". E.g. Do this if you have multiple touchpads which you want 177 | # to use in parallel. This reduces performance slightly so only set this 178 | # if you have to. 179 | # 180 | # device all 181 | 182 | ############################################################################### 183 | # You can set a minimum travel distance threshold before swipe gestures 184 | # are actioned using the swipe_threshold configuration command. 185 | # Specify this value in dots. The default is 0. 186 | # E.g. set it to 100 dots with "swipe_threshold 100". 187 | # swipe_threshold 0 188 | 189 | ############################################################################### 190 | # You can set a timeout on gestures from start to end. The default is 191 | # the value commented below. It can be any value in float secs >= 0. 192 | # 0 = no timeout. E.g. set it to 2 secs with "timeout 2". 193 | # timeout 1.5 194 | -------------------------------------------------------------------------------- /init.vim: -------------------------------------------------------------------------------- 1 | """ Auto Installation 2 | 3 | " Install plugins 4 | if empty(glob("~/.config/nvim/autoload/plug.vim")) 5 | silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs 6 | \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim 7 | auto VimEnter * PlugInstall 8 | endif 9 | 10 | " Install fzf and rg 11 | if !empty(glob("~/.fzf/bin/fzf")) 12 | if empty(glob("~/.fzf/bin/rg")) 13 | if system('uname')=~'Darwin' 14 | silent !curl -fLo /tmp/rg.tar.gz 15 | \ https://github.com/BurntSushi/ripgrep/releases/download/0.10.0/ripgrep-0.10.0-x86_64-apple-darwin.tar.gz 16 | silent !tar xzvf /tmp/rg.tar.gz --directory /tmp 17 | silent !cp /tmp/ripgrep-0.10.0-x86_64-apple-darwin/rg ~/.fzf/bin/rg 18 | else 19 | silent !curl -fLo /tmp/rg.tar.gz 20 | \ https://github.com/BurntSushi/ripgrep/releases/download/0.10.0/ripgrep-0.10.0-x86_64-unknown-linux-musl.tar.gz 21 | silent !tar xzvf /tmp/rg.tar.gz --directory /tmp 22 | silent !cp /tmp/ripgrep-0.10.0-x86_64-unknown-linux-musl/rg ~/.fzf/bin/rg 23 | endif 24 | endif 25 | endif 26 | 27 | " Install theme 28 | if empty(glob("~/.config/nvim/colors/lucius.vim")) 29 | silent !curl -fLo ~/.config/nvim/colors/lucius.vim --create-dirs 30 | \ https://raw.githubusercontent.com/bag-man/dotfiles/master/lucius.vim 31 | endif 32 | 33 | " Install coc-settings 34 | if empty(glob("~/.config/nvim/coc-settings.json")) 35 | silent !curl -fLo ~/.config/nvim/coc-settings.json --create-dirs 36 | \ https://raw.githubusercontent.com/bag-man/dotfiles/master/coc-settings.json 37 | endif 38 | 39 | " Create undo directory 40 | if !isdirectory($HOME . "/.config/nvim/undodir") 41 | call mkdir($HOME . "/.config/nvim/undodir", "p") 42 | endif 43 | 44 | " Create backup directory 45 | if !isdirectory($HOME . "/.config/nvim/backup") 46 | call mkdir($HOME . "/.config/nvim/backup", "p") 47 | endif 48 | 49 | """ Appearance 50 | 51 | " Syntax and lines 52 | syntax on 53 | set number relativenumber 54 | set nowrap 55 | set signcolumn=yes 56 | 57 | " Theme 58 | colorscheme lucius 59 | LuciusDarkLowContrast 60 | 61 | " Indentation 62 | set autoindent 63 | set expandtab 64 | set shiftwidth=2 65 | set softtabstop=2 66 | 67 | " Status 68 | set laststatus=2 69 | set statusline=%F 70 | set wildmenu 71 | set showcmd 72 | 73 | " Highlight 100's 74 | match Delimiter /\d\ze\%(\d\d\%(\d\{3}\)*\)\>/ 75 | 76 | """ Key modifiers 77 | 78 | " debugger keys 79 | " nnoremap :call vimspector#ToggleBreakpoint() 80 | " nnoremap :call vimspector#Continue() 81 | " nnoremap :call vimspector#Restart() 82 | " nnoremap :call vimspector#Reset() 83 | 84 | " terminal navigation 85 | tnoremap h 86 | tnoremap j 87 | tnoremap k 88 | tnoremap l 89 | 90 | " coc bindings 91 | nnoremap :call CocActionAsync('doHover') 92 | nnoremap :call CocActionAsync('showSignatureHelp') 93 | nnoremap :call CocActionAsync('rename') 94 | nnoremap :call CocAction('jumpReferences') 95 | nnoremap (coc-codeaction-selected)w 96 | 97 | " View git history for file 98 | nnoremap :AgitFile 99 | 100 | " Find word in project 101 | nnoremap :F 102 | 103 | nnoremap :call CocActionAsync('diagnosticNext', 'error') 104 | nnoremap :call CocActionAsync('jumpDefinition') 105 | 106 | " Generate UUID 107 | inoremap :exe 'norm a' . system('/usr/bin/newuuid')a 108 | nnoremap :exe 'norm a' . system('/usr/bin/newuuid') 109 | 110 | " Shortcuts for movement and manipulation 111 | nnoremap Oj 112 | nnoremap Y y$ 113 | map H ^ 114 | map L $ 115 | map £ g_ 116 | nnoremap M J 117 | 118 | " Clear search 119 | nnoremap :noh 120 | 121 | " Fix typo 122 | nnoremap q: :q 123 | 124 | " Center next item 125 | nnoremap n nzz 126 | 127 | " Write as sudo 128 | cnoremap w!! SudaWrite 129 | 130 | " View fzf buffers 131 | nnoremap :Buffers 132 | 133 | " Tab navigation 134 | nnoremap :tabnew 135 | inoremap :tabnewi 136 | nnoremap J :tabprev 137 | nnoremap K :tabnext 138 | 139 | " Open file from link 140 | nnoremap gt gf 141 | nnoremap gs :vertical wincmd f 142 | nnoremap gi f 143 | 144 | " Autocomplete navigation 145 | inoremap J coc#pum#visible() ? coc#pum#next(0) : "J" 146 | inoremap K coc#pum#visible() ? coc#pum#prev(0) : "K" 147 | inoremap coc#pum#visible() ? coc#pum#confirm() : coc#refresh() 148 | inoremap coc#pum#visible() ? coc#pum#confirm() : "\" 149 | 150 | " External item maps 151 | nnoremap cp :CopyRelativePath 152 | 153 | vnoremap gp :Sprunge 154 | nnoremap gp :Sprunge 155 | 156 | vnoremap go :Google 157 | nnoremap go :Google 158 | 159 | vnoremap gl :Git blame 160 | nnoremap gl :Git blame 161 | 162 | vnoremap gb :GBrowse! 163 | nnoremap gb :GBrowse! 164 | 165 | nnoremap ch :Gread 166 | 167 | " Open fold 168 | nnoremap za 169 | 170 | """ Behaviour modifiers 171 | 172 | set undofile 173 | set undodir=~/.config/nvim/undodir 174 | set backup 175 | set backupdir=~/.config/nvim/backup/ 176 | set writebackup 177 | set backupcopy=yes 178 | set clipboard^=unnamed 179 | set wildignore+=*/tmp/*,*.so,*.swp,*.zip 180 | set foldmethod=marker 181 | set backspace=indent,eol,start 182 | set wildmode=longest,list,full 183 | set completeopt=longest,menuone 184 | set mouse= 185 | set lazyredraw 186 | 187 | " js/ts filejumps 188 | set path=.,..,src,node_modules 189 | set suffixesadd=.js,.jsx,.ts,.tsx 190 | 191 | " Search settings 192 | set ignorecase 193 | set incsearch 194 | set smartcase 195 | set scrolloff=10 196 | set hlsearch 197 | 198 | " Spelling 199 | setlocal spell spelllang=en 200 | nnoremap ss :set spell! 201 | set nospell 202 | 203 | " Autocommands 204 | augroup AutoCommands 205 | autocmd! 206 | 207 | " Strip whitespace 208 | autocmd BufWritePre *.ts,*.erb,*.scss,*.rb,*.js,*.c,*.py,*.php :%s/\s\+$//e 209 | 210 | " Auto load vimrc on save 211 | autocmd BufWritePost ~/.config/nvimrc source % 212 | 213 | " Maintain cwd 214 | autocmd InsertEnter * let save_cwd = getcwd() | set autochdir 215 | autocmd InsertLeave * set noautochdir | execute 'cd' fnameescape(save_cwd) 216 | 217 | " Set spell on commits 218 | autocmd FileType gitcommit setlocal spell 219 | autocmd BufReadPost * 220 | \ if &ft != 'gitcommit' && line("'\"") > 0 && line("'\"") <= line("$") | 221 | \ exe "normal g`\"" | 222 | \ endif 223 | 224 | " Nerdtree config 225 | autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif 226 | 227 | " Rainbow brackets 228 | if !empty(glob("~/.config/nvim/plugged/rainbow_parentheses.vim/autoload/rainbow_parentheses.vim")) 229 | autocmd VimEnter * RainbowParenthesesToggle 230 | autocmd Syntax * RainbowParenthesesLoadRound 231 | autocmd Syntax * RainbowParenthesesLoadSquare 232 | autocmd Syntax * RainbowParenthesesLoadBraces 233 | syntax on 234 | endif 235 | 236 | autocmd FileType agit nmap J :tabprev 237 | autocmd FileType agit nmap K :tabnext 238 | 239 | " Coc errors 240 | highlight CocErrorHighlight ctermfg=Red guifg=#ff0000 241 | 242 | autocmd BufWinEnter,WinEnter term://* startinsert 243 | autocmd BufLeave term://* stopinsert 244 | 245 | autocmd FileType markdown let b:coc_suggest_disable = 1 246 | augroup END 247 | 248 | """ Plugins 249 | 250 | " NERDTree 251 | nnoremap :NERDTreeTabsToggle 252 | nnoremap :NERDTreeFind 253 | let NERDTreeChDirMode=2 254 | let g:NERDTreeDirArrowExpandable = '├' 255 | let g:NERDTreeDirArrowCollapsible = '└' 256 | let g:NERDTreeMapActivateNode = '' 257 | 258 | " Nuake 259 | tnoremap 260 | tnoremap :Nuake 261 | nnoremap + 3+ 262 | nnoremap _ 3- 263 | nnoremap :Nuake 264 | inoremap :Nuake 265 | let g:nuake_position = 'top' 266 | let g:nuake_size = 0.2 267 | let g:nuake_per_tab = 1 268 | 269 | " argwrap 270 | nnoremap a :ArgWrap 271 | let g:argwrap_padded_braces = '{' 272 | 273 | " fzf config 274 | nnoremap :Files 275 | let g:fzf_action = { 276 | \ 'ctrl-t': 'tab split', 277 | \ 'ctrl-i': 'split', 278 | \ 'ctrl-s': 'vsplit' } 279 | let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6 } } 280 | 281 | let g:rg_command = ' 282 | \ rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --color "always" 283 | \ -g "*.{tf,yml,yaml,vim,viml,tsx,ts,js,jsx,json,php,md,styl,pug,jade,html,config,py,cpp,c,go,hs,rb,conf,graphql,gql,sql,proto}" 284 | \ -g "!{.config,.git,node_modules,vendor,yarn.lock,*.sty,*.bst,build,dist,output}/*" ' 285 | 286 | command! -bang -nargs=* F call fzf#vim#grep(g:rg_command . shellescape(), 1, 0) 287 | command! -bang -nargs=* FU call fzf#vim#grep(g:rg_command . '-m1 ' . shellescape(), 1, 0) 288 | 289 | " vim-move 290 | let g:move_key_modifier = 'C' 291 | 292 | " Highlight jump points 293 | let g:qs_highlight_on_keys = ['f', 'F', 't', 'T'] 294 | 295 | " Agit 296 | let g:agit_enable_auto_refresh = 1 297 | 298 | " coc extensions 299 | let g:coc_global_extensions = ['coc-tsserver', 'coc-json', 'coc-pyright', 'coc-rls', 'coc-sql'] 300 | 301 | """ Plugins 302 | 303 | call plug#begin('~/.config/nvim/plugged') 304 | filetype plugin indent on 305 | 306 | " Features 307 | Plug 'scrooloose/nerdtree' " File tree browser 308 | Plug 'Xuyuanp/nerdtree-git-plugin' " Git for NerdTree 309 | Plug 'jistr/vim-nerdtree-tabs' " NerdTree independent of tabs 310 | Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } " Install fzf for user 311 | Plug 'junegunn/fzf.vim' " Fzf vim plugin 312 | Plug 'neoclide/coc.nvim', {'branch': 'release'} " Language server 313 | Plug 'bag-man/nuake' " Quake term 314 | " Plug 'puremourning/vimspector' " Debugger 315 | Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} 316 | 317 | " Small utilities 318 | Plug 'bag-man/copypath.vim' " copy path of file 319 | Plug 'can3p/incbool.vim' " Toggle true/false 320 | Plug 'kopischke/vim-fetch' " Use line numbers in file paths 321 | Plug 'matze/vim-move' " Move lines up and down 322 | Plug 'chilicuil/vim-sprunge' " Paste selection to sprunge 323 | Plug 'FooSoft/vim-argwrap' " Wrap arguments to multi-lines 324 | Plug 'szw/vim-g' " Google from Vim 325 | Plug 'google/vim-searchindex' " Number of search results 326 | Plug 'sickill/vim-pasta' " Paste format 327 | Plug 'cohama/agit.vim' " Git log 328 | Plug 'kamykn/spelunker.vim' " Clever spell check 329 | Plug 'lambdalisue/vim-suda' " Save as sudo 330 | 331 | " Languages 332 | " Plug 'leafgarland/typescript-vim' " TypeScript Syntax 333 | " Plug 'jparise/vim-graphql' " Syntax for graphql 334 | 335 | " tpope 336 | Plug 'tpope/vim-surround' " Operate on surrounding 337 | Plug 'tpope/vim-speeddating' " Increment dates 338 | Plug 'tpope/vim-repeat' " Repeat plugins 339 | Plug 'tpope/vim-commentary' " Comment out blocks 340 | Plug 'tpope/vim-fugitive' " Git integration 341 | Plug 'tpope/vim-abolish' " Flexible search 342 | Plug 'tpope/vim-jdaddy' " JSON text object 343 | Plug 'tpope/vim-rhubarb' " Github browse 344 | 345 | " Appearance 346 | Plug 'mkitt/tabline.vim' " Cleaner tabs 347 | Plug 'chrisbra/Colorizer' " Show hex codes as colours 348 | Plug 'kien/rainbow_parentheses.vim' " Colour matched brackets 349 | Plug 'unblevable/quick-scope' " Highlight jump characters 350 | Plug 'drzel/vim-in-proportion' " Maintain splits when windows gets resized 351 | Plug 'breuckelen/vim-resize' " Use Ctrl+arrows to resize splits 352 | 353 | " Text objects 354 | Plug 'wellle/targets.vim' " Additional text objects 355 | Plug 'michaeljsmith/vim-indent-object' " Indented text object 356 | Plug 'kana/vim-textobj-user' " Add additional text objects 357 | Plug 'jceb/vim-textobj-uri' " URL objects 358 | Plug 'glts/vim-textobj-comment' " Comment text objects 359 | Plug 'kana/vim-textobj-function' " Add function based text objects 360 | Plug 'bag-man/vim-textobj-function-javascript' " Add JS function object 361 | Plug 'reedes/vim-textobj-sentence' " Sentence object 362 | 363 | call plug#end() 364 | 365 | lua </ 75 | 76 | """ Key modifiers 77 | 78 | " debugger keys 79 | " nnoremap :call vimspector#ToggleBreakpoint() 80 | " nnoremap :call vimspector#Continue() 81 | " nnoremap :call vimspector#Restart() 82 | " nnoremap :call vimspector#Reset() 83 | 84 | " terminal navigation 85 | tnoremap h 86 | tnoremap j 87 | tnoremap k 88 | tnoremap l 89 | 90 | " coc bindings 91 | nnoremap :call CocActionAsync('doHover') 92 | nnoremap :call CocActionAsync('showSignatureHelp') 93 | nnoremap :call CocActionAsync('rename') 94 | nnoremap :call CocAction('jumpReferences') 95 | nnoremap :CocAction 96 | 97 | " View git history for file 98 | nnoremap :AgitFile 99 | 100 | " Find word in project 101 | nnoremap :F 102 | 103 | nnoremap :call CocActionAsync('diagnosticNext', 'error') 104 | nnoremap :call CocActionAsync('jumpDefinition') 105 | 106 | " Generate UUID 107 | inoremap :exe 'norm a' . system('/usr/bin/newuuid')a 108 | nnoremap :exe 'norm a' . system('/usr/bin/newuuid') 109 | 110 | " Shortcuts for movement and manipulation 111 | nnoremap Oj 112 | nnoremap Y y$ 113 | map H ^ 114 | map L $ 115 | map £ g_ 116 | nnoremap M J 117 | 118 | " Clear search 119 | nnoremap :noh 120 | 121 | " Fix typo 122 | nnoremap q: :q 123 | 124 | " Center next item 125 | nnoremap n nzz 126 | 127 | " Write as sudo 128 | cnoremap w!! w !sudo tee > /dev/null % 129 | 130 | " View fzf buffers 131 | nnoremap :Buffers 132 | 133 | " Tab navigation 134 | nnoremap :tabnew 135 | inoremap :tabnewi 136 | nnoremap J :tabprev 137 | nnoremap K :tabnext 138 | 139 | " Open file from link 140 | nnoremap gt gf 141 | nnoremap gs :vertical wincmd f 142 | nnoremap gi f 143 | 144 | " Autocomplete navigation 145 | inoremap J ((pumvisible())?("\"):("J")) 146 | inoremap K ((pumvisible())?("\"):("K")) 147 | 148 | " use for trigger completion and navigate to the next complete item 149 | function! s:check_back_space() abort 150 | let col = col('.') - 1 151 | return !col || getline('.')[col - 1] =~ '\s' 152 | endfunction 153 | inoremap 154 | \ pumvisible() ? "\" : 155 | \ check_back_space() ? "\" : 156 | \ coc#refresh() 157 | 158 | " External item maps 159 | nnoremap cp :CopyRelativePath 160 | 161 | vnoremap gp :Sprunge 162 | nnoremap gp :Sprunge 163 | 164 | vnoremap go :Google 165 | nnoremap go :Google 166 | 167 | vnoremap gl :Git blame 168 | nnoremap gl :Git blame 169 | 170 | vnoremap gb :GBrowse! 171 | nnoremap gb :GBrowse! 172 | 173 | nnoremap ch :Gread 174 | 175 | " Open fold 176 | nnoremap za 177 | 178 | """ Behaviour modifiers 179 | 180 | set undofile 181 | set undodir=~/.config/nvim/undodir 182 | set backup 183 | set backupdir=~/.config/nvim/backup/ 184 | set writebackup 185 | set backupcopy=yes 186 | set clipboard^=unnamed 187 | set wildignore+=*/tmp/*,*.so,*.swp,*.zip 188 | set foldmethod=marker 189 | set backspace=indent,eol,start 190 | set wildmode=longest,list,full 191 | set completeopt=longest,menuone 192 | set mouse= 193 | set lazyredraw 194 | 195 | " js/ts filejumps 196 | set path=.,..,src,node_modules 197 | set suffixesadd=.js,.jsx,.ts,.tsx 198 | 199 | " Search settings 200 | set ignorecase 201 | set incsearch 202 | set smartcase 203 | set scrolloff=10 204 | set hlsearch 205 | 206 | " Spelling 207 | setlocal spell spelllang=en 208 | nnoremap ss :set spell! 209 | set nospell 210 | 211 | " Autocommands 212 | augroup AutoCommands 213 | autocmd! 214 | 215 | " Strip whitespace 216 | autocmd BufWritePre *.ts,*.erb,*.scss,*.rb,*.js,*.c,*.py,*.php :%s/\s\+$//e 217 | 218 | " Auto load vimrc on save 219 | autocmd BufWritePost ~/.config/nvimrc source % 220 | 221 | " Maintain cwd 222 | autocmd InsertEnter * let save_cwd = getcwd() | set autochdir 223 | autocmd InsertLeave * set noautochdir | execute 'cd' fnameescape(save_cwd) 224 | 225 | " Set spell on commits 226 | autocmd FileType gitcommit setlocal spell 227 | autocmd BufReadPost * 228 | \ if &ft != 'gitcommit' && line("'\"") > 0 && line("'\"") <= line("$") | 229 | \ exe "normal g`\"" | 230 | \ endif 231 | 232 | " Nerdtree config 233 | autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif 234 | 235 | " Rainbow brackets 236 | if !empty(glob("~/.config/nvim/plugged/rainbow_parentheses.vim/autoload/rainbow_parentheses.vim")) 237 | autocmd VimEnter * RainbowParenthesesToggle 238 | autocmd Syntax * RainbowParenthesesLoadRound 239 | autocmd Syntax * RainbowParenthesesLoadSquare 240 | autocmd Syntax * RainbowParenthesesLoadBraces 241 | syntax on 242 | endif 243 | 244 | autocmd FileType agit nmap J :tabprev 245 | autocmd FileType agit nmap K :tabnext 246 | 247 | " Coc errors 248 | highlight CocErrorHighlight ctermfg=Red guifg=#ff0000 249 | 250 | autocmd BufWinEnter,WinEnter term://* startinsert 251 | autocmd BufLeave term://* stopinsert 252 | 253 | augroup END 254 | 255 | """ Plugins 256 | 257 | " NERDTree 258 | nnoremap :NERDTreeTabsToggle 259 | nnoremap :NERDTreeFind 260 | let NERDTreeChDirMode=2 261 | let g:NERDTreeDirArrowExpandable = '├' 262 | let g:NERDTreeDirArrowCollapsible = '└' 263 | let g:NERDTreeMapActivateNode = '' 264 | 265 | " Nuake 266 | tnoremap 267 | tnoremap :Nuake 268 | nnoremap + 3+ 269 | nnoremap _ 3- 270 | nnoremap :Nuake 271 | inoremap :Nuake 272 | let g:nuake_position = 'top' 273 | let g:nuake_size = 0.2 274 | let g:nuake_per_tab = 1 275 | 276 | " argwrap 277 | nnoremap a :ArgWrap 278 | let g:argwrap_padded_braces = '{' 279 | 280 | " fzf config 281 | nnoremap :Files 282 | let g:fzf_action = { 283 | \ 'ctrl-t': 'tab split', 284 | \ 'ctrl-i': 'split', 285 | \ 'ctrl-s': 'vsplit' } 286 | let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6 } } 287 | 288 | let g:rg_command = ' 289 | \ rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --color "always" 290 | \ -g "*.{tf,yml,yaml,vim,viml,tsx,ts,js,jsx,json,php,md,styl,pug,jade,html,config,py,cpp,c,go,hs,rb,conf,graphql,gql,sql,proto}" 291 | \ -g "!{.config,.git,node_modules,vendor,yarn.lock,*.sty,*.bst,build,dist,output}/*" ' 292 | 293 | command! -bang -nargs=* F call fzf#vim#grep(g:rg_command . shellescape(), 1, 0) 294 | command! -bang -nargs=* FU call fzf#vim#grep(g:rg_command . '-m1 ' . shellescape(), 1, 0) 295 | 296 | " vim-move 297 | let g:move_key_modifier = 'C' 298 | 299 | " Highlight jump points 300 | let g:qs_highlight_on_keys = ['f', 'F', 't', 'T'] 301 | 302 | " Agit 303 | let g:agit_enable_auto_refresh = 1 304 | 305 | " coc extensions 306 | let g:coc_global_extensions = ['coc-tsserver', 'coc-json', 'coc-pyright', 'coc-rls', 'coc-sql'] 307 | 308 | """ Plugins 309 | 310 | call plug#begin('~/.config/nvim/plugged') 311 | filetype plugin indent on 312 | 313 | " Features 314 | Plug 'scrooloose/nerdtree' " File tree browser 315 | Plug 'Xuyuanp/nerdtree-git-plugin' " Git for NerdTree 316 | Plug 'jistr/vim-nerdtree-tabs' " NerdTree independent of tabs 317 | Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } " Install fzf for user 318 | Plug 'junegunn/fzf.vim' " Fzf vim plugin 319 | Plug 'neoclide/coc.nvim', {'branch': 'release'} " Language server 320 | Plug 'bag-man/nuake' " Quake term 321 | " Plug 'puremourning/vimspector' " Debugger 322 | Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} 323 | 324 | " Small utilities 325 | Plug 'bag-man/copypath.vim' " copy path of file 326 | Plug 'can3p/incbool.vim' " Toggle true/false 327 | Plug 'kopischke/vim-fetch' " Use line numbers in file paths 328 | Plug 'matze/vim-move' " Move lines up and down 329 | Plug 'chilicuil/vim-sprunge' " Paste selection to sprunge 330 | Plug 'FooSoft/vim-argwrap' " Wrap arguments to multi-lines 331 | Plug 'szw/vim-g' " Google from Vim 332 | Plug 'google/vim-searchindex' " Number of search results 333 | Plug 'sickill/vim-pasta' " Paste format 334 | Plug 'cohama/agit.vim' " Git log 335 | Plug 'kamykn/spelunker.vim' " Clever spell check 336 | 337 | " Languages 338 | " Plug 'leafgarland/typescript-vim' " TypeScript Syntax 339 | " Plug 'jparise/vim-graphql' " Syntax for graphql 340 | 341 | " tpope 342 | Plug 'tpope/vim-surround' " Operate on surrounding 343 | Plug 'tpope/vim-speeddating' " Increment dates 344 | Plug 'tpope/vim-repeat' " Repeat plugins 345 | Plug 'tpope/vim-commentary' " Comment out blocks 346 | Plug 'tpope/vim-fugitive' " Git integration 347 | Plug 'tpope/vim-abolish' " Flexible search 348 | Plug 'tpope/vim-jdaddy' " JSON text object 349 | Plug 'tpope/vim-rhubarb' " Github browse 350 | 351 | " Appearance 352 | Plug 'mkitt/tabline.vim' " Cleaner tabs 353 | Plug 'chrisbra/Colorizer' " Show hex codes as colours 354 | Plug 'kien/rainbow_parentheses.vim' " Colour matched brackets 355 | Plug 'unblevable/quick-scope' " Highlight jump characters 356 | Plug 'drzel/vim-in-proportion' " Maintain splits when windows gets resized 357 | Plug 'breuckelen/vim-resize' " Use Ctrl+arrows to resize splits 358 | 359 | " Text objects 360 | Plug 'wellle/targets.vim' " Additional text objects 361 | Plug 'michaeljsmith/vim-indent-object' " Indented text object 362 | Plug 'kana/vim-textobj-user' " Add additional text objects 363 | Plug 'jceb/vim-textobj-uri' " URL objects 364 | Plug 'glts/vim-textobj-comment' " Comment text objects 365 | Plug 'kana/vim-textobj-function' " Add function based text objects 366 | Plug 'bag-man/vim-textobj-function-javascript' " Add JS function object 367 | Plug 'reedes/vim-textobj-sentence' " Sentence object 368 | 369 | call plug#end() 370 | 371 | lua < 4 | " Version: 8.1.5 5 | " ---------------------------------------------------------------------------- 6 | " 7 | " Light and dark color scheme for GUI and 256 color terminal. 8 | " 9 | " There are several options available to customize the color scheme to your 10 | " own tastes. This is particularly useful when you have to work in different 11 | " environments at different times (home, work, day, night, etc). 12 | " 13 | " The GUI and 256 color terminal versions of this color scheme are identical. 14 | " 15 | " You can set up the color scheme by manually setting the options you want or 16 | " by choosing one of the presets defined. These presets are loaded after you 17 | " first source the color scheme file and are all commands that start with 18 | " 'Lucius'. 19 | " 20 | " I have also started to create color schemes for different applications. I 21 | " have been using them for PuTTY, iTerm2, and Visual Studio, but will keep 22 | " adding more as I go along. You can find the files for these on Github: 23 | " 24 | " https://github.com/jonathanfilip/lucius 25 | " 26 | " You can also clone the following repository if you use Pathogen or something 27 | " similar. It holds the vim color scheme in a 'colors' directory: 28 | " 29 | " https://github.com/jonathanfilip/vim-lucius 30 | " 31 | " 32 | " 33 | " Presets: 34 | " 35 | " There are several presets available that will set all the options for you. 36 | " There are screenshots of each preset below: 37 | " 38 | " * LuciusDark (dark default): http://i.imgur.com/LsZbF.png 39 | " * LuciusDarkHighContrast: http://i.imgur.com/e70i9.png 40 | " * LuciusDarkLowContrast: http://i.imgur.com/Hmw8s.png 41 | " * LuciusBlack: http://i.imgur.com/iD4ri.png 42 | " * LuciusBlackHighContrast: http://i.imgur.com/lHvTJ.png 43 | " * LuciusBlackLowContrast: http://i.imgur.com/oZLkg.png 44 | " 45 | " * LuciusLight (light default): http://i.imgur.com/soYD8.png 46 | " * LuciusLightLowContrast: http://i.imgur.com/95I86.png 47 | " * LuciusWhite: http://i.imgur.com/wDzkz.png 48 | " * LuciusWhiteLowContrast: http://i.imgur.com/jlUf4.png 49 | " 50 | " To use the presets, you just need to set the color scheme first. In your 51 | " vimrc, you can just do this: 52 | " 53 | " colorscheme lucius 54 | " LuciusBlack 55 | " 56 | " You can still just set the background variable and then set the color 57 | " scheme. This will default to LuciusDark for 'dark' and LuciusLight for 58 | " 'light'. 59 | " 60 | " 61 | " Options: 62 | " 63 | " The presets available cover most of the options. You can, however, customize 64 | " things by setting the following variables yourself: 65 | " 66 | " g:lucius_style (default: 'dark') 67 | " 68 | " Set this option to either 'light' or 'dark' for your desired color scheme. 69 | " It has the same effect as setting the background. 70 | " 71 | " g:lucius_contrast (default: 'normal') 72 | " 73 | " This option determines the contrast to use for text/ui elements. It can be 74 | " set to 'low', 'normal', or 'high'. At this time there is no 'high' for the 75 | " light scheme. 76 | " 77 | " g:lucius_contrast_bg (default: 'normal') 78 | " 79 | " Setting this option makes the background a higher contrast. Current settings 80 | " are 'normal' and 'high'. 81 | " 82 | " g:lucius_use_bold (default: 1) 83 | " 84 | " Setting this will cause the color scheme to use bold fonts for some items. 85 | " 86 | " g:lucius_use_underline (default: 1) 87 | " 88 | " Setting this will cause the color scheme to use underlined fonts for some 89 | " items. 90 | " 91 | " g:lucius_no_term_bg (default: 0) 92 | " 93 | " Setting this will cause the color scheme to not set a background color in 94 | " the terminal (useful for transparency or terminals with different background 95 | " colors). 96 | " 97 | " ============================================================================ 98 | 99 | 100 | 101 | " ============================================================================ 102 | " Options: 103 | " ============================================================================ 104 | 105 | unlet! g:colors_name 106 | hi clear 107 | if exists("syntax_on") 108 | syntax reset 109 | endif 110 | 111 | if exists("g:lucius_style") 112 | let s:style = g:lucius_style 113 | else 114 | let s:style = &background 115 | endif 116 | 117 | if exists("g:lucius_contrast") 118 | let s:contrast = g:lucius_contrast 119 | else 120 | let s:contrast = "normal" 121 | endif 122 | 123 | if exists("g:lucius_contrast_bg") 124 | let s:contrast_bg = g:lucius_contrast_bg 125 | else 126 | let s:contrast_bg = "normal" 127 | endif 128 | 129 | if exists("g:lucius_use_bold") 130 | let s:use_bold = g:lucius_use_bold 131 | else 132 | let s:use_bold = 1 133 | endif 134 | 135 | if exists("g:lucius_use_underline") 136 | let s:use_underline = g:lucius_use_underline 137 | else 138 | let s:use_underline = 1 139 | endif 140 | 141 | if exists("g:lucius_no_term_bg") 142 | let s:no_term_bg = g:lucius_no_term_bg 143 | else 144 | let s:no_term_bg = 0 145 | endif 146 | 147 | 148 | " ============================================================================ 149 | " Color Map: 150 | " ============================================================================ 151 | 152 | let s:color_map = { 153 | \ 'bg': 'bg', 'fg': 'fg', 'NONE': 'NONE', 154 | \ '#000000': '16', '#00005f': '17', '#000087': '18', '#0000af': '19', 155 | \ '#0000d7': '20', '#0000ff': '21', '#005f00': '22', '#005f5f': '23', 156 | \ '#005f87': '24', '#005faf': '25', '#005fd7': '26', '#005fff': '27', 157 | \ '#008700': '28', '#00875f': '29', '#008787': '30', '#0087af': '31', 158 | \ '#0087d7': '32', '#0087ff': '33', '#00af00': '34', '#00af5f': '35', 159 | \ '#00af87': '36', '#00afaf': '37', '#00afd7': '38', '#00afff': '39', 160 | \ '#00d700': '40', '#00d75f': '41', '#00d787': '42', '#00d7af': '43', 161 | \ '#00d7d7': '44', '#00d7ff': '45', '#00ff00': '46', '#00ff5f': '47', 162 | \ '#00ff87': '48', '#00ffaf': '49', '#00ffd7': '50', '#00ffff': '51', 163 | \ '#5f0000': '52', '#5f005f': '53', '#5f0087': '54', '#5f00af': '55', 164 | \ '#5f00d7': '56', '#5f00ff': '57', '#5f5f00': '58', '#5f5f5f': '59', 165 | \ '#5f5f87': '60', '#5f5faf': '61', '#5f5fd7': '62', '#5f5fff': '63', 166 | \ '#5f8700': '64', '#5f875f': '65', '#5f8787': '66', '#5f87af': '67', 167 | \ '#5f87d7': '68', '#5f87ff': '69', '#5faf00': '70', '#5faf5f': '71', 168 | \ '#5faf87': '72', '#5fafaf': '73', '#5fafd7': '74', '#5fafff': '75', 169 | \ '#5fd700': '76', '#5fd75f': '77', '#5fd787': '78', '#5fd7af': '79', 170 | \ '#5fd7d7': '80', '#5fd7ff': '81', '#5fff00': '82', '#5fff5f': '83', 171 | \ '#5fff87': '84', '#5fffaf': '85', '#5fffd7': '86', '#5fffff': '87', 172 | \ '#870000': '88', '#87005f': '89', '#870087': '90', '#8700af': '91', 173 | \ '#8700d7': '92', '#8700ff': '93', '#875f00': '94', '#875f5f': '95', 174 | \ '#875f87': '96', '#875faf': '97', '#875fd7': '98', '#875fff': '99', 175 | \ '#878700': '100', '#87875f': '101', '#878787': '102', '#8787af': '103', 176 | \ '#8787d7': '104', '#8787ff': '105', '#87af00': '106', '#87af5f': '107', 177 | \ '#87af87': '108', '#87afaf': '109', '#87afd7': '110', '#87afff': '111', 178 | \ '#87d700': '112', '#87d75f': '113', '#87d787': '114', '#87d7af': '115', 179 | \ '#87d7d7': '116', '#87d7ff': '117', '#87ff00': '118', '#87ff5f': '119', 180 | \ '#87ff87': '120', '#87ffaf': '121', '#87ffd7': '122', '#87ffff': '123', 181 | \ '#af0000': '124', '#af005f': '125', '#af0087': '126', '#af00af': '127', 182 | \ '#af00d7': '128', '#af00ff': '129', '#af5f00': '130', '#af5f5f': '131', 183 | \ '#af5f87': '132', '#af5faf': '133', '#af5fd7': '134', '#af5fff': '135', 184 | \ '#af8700': '136', '#af875f': '137', '#af8787': '138', '#af87af': '139', 185 | \ '#af87d7': '140', '#af87ff': '141', '#afaf00': '142', '#afaf5f': '143', 186 | \ '#afaf87': '144', '#afafaf': '145', '#afafd7': '146', '#afafff': '147', 187 | \ '#afd700': '148', '#afd75f': '149', '#afd787': '150', '#afd7af': '151', 188 | \ '#afd7d7': '152', '#afd7ff': '153', '#afff00': '154', '#afff5f': '155', 189 | \ '#afff87': '156', '#afffaf': '157', '#afffd7': '158', '#afffff': '159', 190 | \ '#d70000': '160', '#d7005f': '161', '#d70087': '162', '#d700af': '163', 191 | \ '#d700d7': '164', '#d700ff': '165', '#d75f00': '166', '#d75f5f': '167', 192 | \ '#d75f87': '168', '#d75faf': '169', '#d75fd7': '170', '#d75fff': '171', 193 | \ '#d78700': '172', '#d7875f': '173', '#d78787': '174', '#d787af': '175', 194 | \ '#d787d7': '176', '#d787ff': '177', '#d7af00': '178', '#d7af5f': '179', 195 | \ '#d7af87': '180', '#d7afaf': '181', '#d7afd7': '182', '#d7afff': '183', 196 | \ '#d7d700': '184', '#d7d75f': '185', '#d7d787': '186', '#d7d7af': '187', 197 | \ '#d7d7d7': '188', '#d7d7ff': '189', '#d7ff00': '190', '#d7ff5f': '191', 198 | \ '#d7ff87': '192', '#d7ffaf': '193', '#d7ffd7': '194', '#d7ffff': '195', 199 | \ '#ff0000': '196', '#ff005f': '197', '#ff0087': '198', '#ff00af': '199', 200 | \ '#ff00d7': '200', '#ff00ff': '201', '#ff5f00': '202', '#ff5f5f': '203', 201 | \ '#ff5f87': '204', '#ff5faf': '205', '#ff5fd7': '206', '#ff5fff': '207', 202 | \ '#ff8700': '208', '#ff875f': '209', '#ff8787': '210', '#ff87af': '211', 203 | \ '#ff87d7': '212', '#ff87ff': '213', '#ffaf00': '214', '#ffaf5f': '215', 204 | \ '#ffaf87': '216', '#ffafaf': '217', '#ffafd7': '218', '#ffafff': '219', 205 | \ '#ffd700': '220', '#ffd75f': '221', '#ffd787': '222', '#ffd7af': '223', 206 | \ '#ffd7d7': '224', '#ffd7ff': '225', '#ffff00': '226', '#ffff5f': '227', 207 | \ '#ffff87': '228', '#ffffaf': '229', '#ffffd7': '230', '#ffffff': '231', 208 | \ '#080808': '232', '#121212': '233', '#1c1c1c': '234', '#262626': '235', 209 | \ '#303030': '236', '#3a3a3a': '237', '#444444': '238', '#4e4e4e': '239', 210 | \ '#585858': '240', '#626262': '241', '#6c6c6c': '242', '#767676': '243', 211 | \ '#808080': '244', '#8a8a8a': '245', '#949494': '246', '#9e9e9e': '247', 212 | \ '#a8a8a8': '248', '#b2b2b2': '249', '#bcbcbc': '250', '#c6c6c6': '251', 213 | \ '#d0d0d0': '252', '#dadada': '253', '#e4e4e4': '254', '#eeeeee': '255', 214 | \ } 215 | 216 | 217 | " ============================================================================ 218 | " Functions: 219 | " ============================================================================ 220 | 221 | function! s:AddCterm(name) 222 | exec "let l:gfg = synIDattr(synIDtrans(hlID('" . a:name . 223 | \ "')), 'fg', 'gui')" 224 | exec "let l:gbg = synIDattr(synIDtrans(hlID('" . a:name . 225 | \ "')), 'bg', 'gui')" 226 | let l:gfg = l:gfg == "" ? "NONE" : l:gfg 227 | let l:gbg = l:gbg == "" ? "NONE" : l:gbg 228 | exec "hi " . a:name . " ctermfg=" . s:color_map[l:gfg] . 229 | \ " ctermbg=" . s:color_map[l:gbg] 230 | endfunction 231 | 232 | function! s:AddSpCterm(name) 233 | exec "let l:gsp = synIDattr(synIDtrans(hlID('" . a:name . 234 | \ "')), 'sp', 'gui')" 235 | let l:gsp = l:gsp == "" ? "NONE" : l:gsp 236 | exec "hi " . a:name . " ctermfg=" . s:color_map[l:gsp] 237 | endfunction 238 | 239 | 240 | " ============================================================================ 241 | " Text Groups: 242 | " ============================================================================ 243 | 244 | let s:normal_items = [ 245 | \ "ColorColumn", "Comment", "Constant", "Cursor", "CursorColumn", 246 | \ "CursorIM", "CursorLine", "CursorLineNr", "DiffAdd", "DiffChange", 247 | \ "DiffDelete", "Directory", "Error", "ErrorMsg", "Identifier", 248 | \ "IncSearch", "LineNr", "MatchParen", "ModeMsg", "MoreMsg", 249 | \ "NonText", "Pmenu", "PmenuSbar", "PmenuSel", 250 | \ "PmenuThumb", "PreProc", "Question", "Search", "SignColumn", 251 | \ "Special", "SpecialKey", "Statement", "StatusLineNC", "StatusLineTermNC", "TabLine", 252 | \ "TabLineFill", "Todo", "Type", "VertSplit", "Visual", 253 | \ "WarningMsg", "WildMenu", 254 | \ ] 255 | 256 | let s:bold_items = [ 257 | \ "DiffText", "FoldColumn", "Folded", "StatusLine", "StatusLineTerm", "TabLineSel", 258 | \ "Title", "CursorLineNr", 259 | \ ] 260 | 261 | let s:underline_items = [ 262 | \ "Underlined", "VisualNOS" 263 | \ ] 264 | 265 | let s:undercurl_items = [ 266 | \ "SpellBad", "SpellCap", "SpellLocal", "SpellRare" 267 | \ ] 268 | 269 | 270 | " ============================================================================ 271 | " Color Definitions: 272 | " ============================================================================ 273 | 274 | " ---------------------------------------------------------------------------- 275 | " 'Normal' Colors: 276 | " ---------------------------------------------------------------------------- 277 | 278 | hi clear Normal 279 | hi Normal gui=none cterm=none term=none 280 | 281 | if s:style == "light" 282 | if s:contrast == "high" 283 | hi Normal guifg=#000000 284 | elseif s:contrast == "low" 285 | hi Normal guifg=#626262 286 | else 287 | hi Normal guifg=#444444 288 | endif 289 | else 290 | if s:contrast == "high" 291 | hi Normal guifg=#eeeeee 292 | elseif s:contrast == "low" 293 | hi Normal guifg=#bcbcbc 294 | else 295 | hi Normal guifg=#d7d7d7 296 | endif 297 | endif 298 | 299 | if s:style == "light" 300 | if s:contrast_bg == "high" 301 | hi Normal guibg=#ffffff 302 | else 303 | hi Normal guibg=#eeeeee 304 | endif 305 | else 306 | if s:contrast_bg == "high" 307 | hi Normal guibg=#121212 308 | else 309 | hi Normal guibg=#303030 310 | endif 311 | endif 312 | 313 | call s:AddCterm("Normal") 314 | 315 | 316 | " ---------------------------------------------------------------------------- 317 | " Extra setup 318 | " ---------------------------------------------------------------------------- 319 | 320 | exec "set background=" . s:style 321 | 322 | " Clear default settings 323 | for s:item in s:normal_items + s:bold_items + s:underline_items + s:undercurl_items 324 | exec "hi " . s:item . " guifg=NONE guibg=NONE gui=none" 325 | \ . " ctermfg=NONE ctermbg=NONE cterm=none term=none" 326 | endfor 327 | 328 | let g:colors_name="lucius" 329 | 330 | 331 | " ---------------------------------------------------------------------------- 332 | " Text Markup: 333 | " ---------------------------------------------------------------------------- 334 | 335 | if s:style == "light" 336 | hi NonText guifg=#afafd7 337 | hi SpecialKey guifg=#afd7af 338 | if s:contrast == "low" 339 | hi Comment guifg=#9e9e9e 340 | hi Constant guifg=#d78700 341 | hi Directory guifg=#00af87 342 | hi Identifier guifg=#00af00 343 | hi PreProc guifg=#00afaf 344 | hi Special guifg=#af00af 345 | hi Statement guifg=#0087d7 346 | hi Title guifg=#0087d7 347 | hi Type guifg=#0087af 348 | else 349 | hi Comment guifg=#808080 350 | hi Constant guifg=#af5f00 351 | hi Directory guifg=#00875f 352 | hi Identifier guifg=#008700 353 | hi PreProc guifg=#008787 354 | hi Special guifg=#870087 355 | hi Statement guifg=#005faf 356 | hi Title guifg=#005faf 357 | hi Type guifg=#005f87 358 | endif 359 | else 360 | hi NonText guifg=#5f5f87 361 | hi SpecialKey guifg=#5f875f 362 | if s:contrast == "low" 363 | hi Comment guifg=#6c6c6c 364 | hi Constant guifg=#afaf87 365 | hi Directory guifg=#87af87 366 | hi Identifier guifg=#87af5f 367 | hi PreProc guifg=#5faf87 368 | hi Special guifg=#af87af 369 | hi Statement guifg=#5fafd7 370 | hi Title guifg=#00afd7 371 | hi Type guifg=#5fafaf 372 | elseif s:contrast == "high" 373 | hi Comment guifg=#8a8a8a 374 | hi Constant guifg=#ffffd7 375 | hi Directory guifg=#d7ffd7 376 | hi Identifier guifg=#d7ffaf 377 | hi PreProc guifg=#afffd7 378 | hi Special guifg=#ffd7ff 379 | hi Statement guifg=#afffff 380 | hi Title guifg=#87d7ff 381 | hi Type guifg=#afffff 382 | else 383 | hi Comment guifg=#808080 384 | hi Constant guifg=#d7d7af 385 | hi Directory guifg=#afd7af 386 | hi Identifier guifg=#afd787 387 | hi PreProc guifg=#87d7af 388 | hi Special guifg=#d7afd7 389 | hi Statement guifg=#87d7ff 390 | hi Title guifg=#5fafd7 391 | hi Type guifg=#87d7d7 392 | endif 393 | endif 394 | 395 | 396 | " ---------------------------------------------------------------------------- 397 | " Highlighting: 398 | " ---------------------------------------------------------------------------- 399 | 400 | hi Cursor guifg=bg 401 | hi CursorColumn guifg=NONE 402 | hi CursorIM guifg=bg 403 | hi CursorLine guifg=NONE 404 | hi Visual guifg=NONE 405 | hi VisualNOS guifg=fg guibg=NONE 406 | if s:style == "light" 407 | hi CursorColumn guibg=#dadada 408 | hi CursorLine guibg=#dadada 409 | hi IncSearch guifg=fg guibg=#5fd7d7 410 | hi MatchParen guifg=NONE guibg=#5fd7d7 411 | hi Search guifg=fg guibg=#ffaf00 412 | hi Visual guibg=#afd7ff 413 | if s:contrast == "low" 414 | hi Cursor guibg=#87afd7 415 | hi CursorIM guibg=#87afd7 416 | hi Error guifg=#d70000 guibg=#ffd7d7 417 | hi Todo guifg=#af8700 guibg=#ffffaf 418 | else 419 | hi Cursor guibg=#5f87af 420 | hi CursorIM guibg=#5f87af 421 | hi Error guifg=#af0000 guibg=#d7afaf 422 | hi Todo guifg=#875f00 guibg=#ffffaf 423 | endif 424 | else 425 | hi CursorColumn guibg=#444444 426 | hi CursorLine guibg=#444444 427 | hi IncSearch guifg=bg 428 | hi MatchParen guifg=bg 429 | hi Search guifg=bg 430 | hi Visual guibg=#005f87 431 | if s:contrast == "low" 432 | hi Cursor guibg=#5f87af 433 | hi CursorIM guibg=#5f87af 434 | hi Error guifg=#d75f5f guibg=#870000 435 | hi IncSearch guibg=#00afaf 436 | hi MatchParen guibg=#87af5f 437 | hi Search guifg=#ff8787 438 | hi Todo guifg=#afaf00 guibg=#5f5f00 439 | elseif s:contrast == "high" 440 | hi Cursor guibg=#afd7ff 441 | hi CursorIM guibg=#afd7ff 442 | hi Error guifg=#ffafaf guibg=#af0000 443 | hi IncSearch guibg=#87ffff 444 | hi MatchParen guibg=#d7ff87 445 | hi Search guibg=#ffaf5f 446 | hi Todo guifg=#ffff87 guibg=#87875f 447 | else 448 | hi Cursor guibg=#87afd7 449 | hi CursorIM guibg=#87afd7 450 | hi Error guifg=#ff8787 guibg=#870000 451 | hi IncSearch guibg=#5fd7d7 452 | hi MatchParen guibg=#afd75f 453 | hi Search guifg=#ff8787 454 | hi Todo guifg=#d7d75f guibg=#5f5f00 455 | endif 456 | endif 457 | 458 | 459 | " ---------------------------------------------------------------------------- 460 | " Messages: 461 | " ---------------------------------------------------------------------------- 462 | 463 | hi Question guifg=fg 464 | if s:style == "light" 465 | if s:contrast == "low" 466 | hi ErrorMsg guifg=#d70000 467 | hi ModeMsg guifg=#0087ff 468 | hi MoreMsg guifg=#0087ff 469 | hi WarningMsg guifg=#d78700 470 | else 471 | hi ErrorMsg guifg=#af0000 472 | hi ModeMsg guifg=#005faf 473 | hi MoreMsg guifg=#005faf 474 | hi WarningMsg guifg=#af5f00 475 | endif 476 | else 477 | if s:contrast == "low" 478 | hi ErrorMsg guifg=#d75f5f 479 | hi ModeMsg guifg=#87afaf 480 | hi MoreMsg guifg=#87afaf 481 | hi WarningMsg guifg=#af875f 482 | elseif s:contrast == "high" 483 | hi ErrorMsg guifg=#ff8787 484 | hi ModeMsg guifg=#afffff 485 | hi MoreMsg guifg=#afffff 486 | hi WarningMsg guifg=#ffaf87 487 | else 488 | hi ErrorMsg guifg=#ff5f5f 489 | hi ModeMsg guifg=#afd7d7 490 | hi MoreMsg guifg=#afd7d7 491 | hi WarningMsg guifg=#d7875f 492 | endif 493 | endif 494 | 495 | 496 | " ---------------------------------------------------------------------------- 497 | " UI: 498 | " ---------------------------------------------------------------------------- 499 | 500 | hi ColorColumn guifg=NONE 501 | hi Pmenu guifg=bg 502 | hi PmenuSel guifg=fg 503 | hi PmenuThumb guifg=fg 504 | hi StatusLine guifg=bg 505 | hi TabLine guifg=bg 506 | hi TabLineSel guifg=fg 507 | hi WildMenu guifg=fg 508 | if s:style == "light" 509 | hi ColorColumn guibg=#e4e4e4 510 | hi CursorLineNr guifg=#626262 guibg=#dadada 511 | hi FoldColumn guibg=#bcbcbc 512 | hi Folded guibg=#bcbcbc 513 | hi LineNr guifg=#9e9e9e guibg=#dadada 514 | hi PmenuSel guibg=#afd7ff 515 | hi SignColumn guibg=#d0d0d0 516 | hi StatusLineNC guifg=#dadada 517 | hi StatusLineNC guifg=#dadada 518 | hi TabLineFill guifg=#dadada 519 | hi VertSplit guifg=#e4e4e4 520 | hi WildMenu guibg=#afd7ff 521 | if s:contrast == "low" 522 | hi FoldColumn guifg=#808080 523 | hi Folded guifg=#808080 524 | hi Pmenu guibg=#9e9e9e 525 | hi PmenuSbar guifg=#9e9e9e guibg=#626262 526 | hi PmenuThumb guibg=#9e9e9e 527 | hi SignColumn guifg=#808080 528 | hi StatusLine guibg=#9e9e9e 529 | hi StatusLineNC guibg=#9e9e9e 530 | hi TabLine guibg=#9e9e9e 531 | hi TabLineFill guibg=#9e9e9e 532 | hi TabLineSel guibg=#afd7ff 533 | hi VertSplit guibg=#9e9e9e 534 | else 535 | hi FoldColumn guifg=#626262 536 | hi Folded guifg=#626262 537 | hi Pmenu guibg=#808080 538 | hi PmenuSbar guifg=#808080 guibg=#444444 539 | hi PmenuThumb guibg=#9e9e9e 540 | hi SignColumn guifg=#626262 541 | hi StatusLine guibg=#808080 542 | hi StatusLineNC guibg=#808080 543 | hi TabLine guibg=#808080 544 | hi TabLineFill guibg=#808080 545 | hi TabLineSel guibg=#afd7ff 546 | hi VertSplit guibg=#808080 547 | endif 548 | else 549 | hi ColorColumn guibg=#3a3a3a 550 | hi CursorLineNr guifg=#9e9e9e guibg=#444444 551 | hi FoldColumn guibg=#4e4e4e 552 | hi Folded guibg=#4e4e4e 553 | hi LineNr guifg=#626262 guibg=NONE 554 | hi PmenuSel guibg=#005f87 555 | hi SignColumn guibg=#4e4e4e 556 | hi StatusLineNC guifg=#9e9e9e 557 | hi TabLineFill guifg=#9e9e9e 558 | hi VertSplit guifg=#626262 559 | hi WildMenu guibg=#005f87 560 | if s:contrast == "low" 561 | hi FoldColumn guifg=#a8a8a8 562 | hi Folded guifg=#a8a8a8 563 | hi Pmenu guibg=#8a8a8a 564 | hi PmenuSbar guifg=#8a8a8a guibg=#bcbcbc 565 | hi PmenuThumb guibg=#585858 566 | hi SignColumn guibg=NONE 567 | hi StatusLine guifg=#ffffff guibg=#444444 568 | hi StatusLineNC guibg=#444444 569 | hi StatusLineTerm guifg=#ffffff guibg=#444444 570 | hi StatusLineTermNC guibg=#444444 571 | hi TabLine guifg=#9e9e9e guibg=#444444 572 | hi TabLineFill guifg=#9e9e9e guibg=#444444 573 | hi TabLineSel guifg=#ffffff guibg=#444444 574 | hi VertSplit guibg=NONE 575 | hi Pmenu guibg=#444444 guifg=#9e9e9e 576 | elseif s:contrast == "high" 577 | hi FoldColumn guifg=#c6c6c6 578 | hi Folded guifg=#c6c6c6 579 | hi Pmenu guibg=#bcbcbc 580 | hi PmenuSbar guifg=#bcbcbc guibg=#dadada 581 | hi PmenuThumb guibg=#8a8a8a 582 | hi SignColumn guifg=#bcbcbc 583 | hi StatusLine guibg=#bcbcbc 584 | hi StatusLineNC guibg=#bcbcbc 585 | hi TabLine guibg=#bcbcbc 586 | hi TabLineFill guibg=#bcbcbc 587 | hi TabLineSel guibg=#0087af 588 | hi VertSplit guibg=#bcbcbc 589 | else 590 | hi FoldColumn guifg=#bcbcbc 591 | hi Folded guifg=#bcbcbc 592 | hi Pmenu guibg=#b2b2b2 593 | hi PmenuSbar guifg=#b2b2b2 guibg=#d0d0d0 594 | hi PmenuThumb guibg=#808080 595 | hi SignColumn guifg=#b2b2b2 596 | hi StatusLine guibg=#b2b2b2 597 | hi StatusLineNC guibg=#b2b2b2 598 | hi TabLine guibg=#b2b2b2 599 | hi TabLineFill guibg=#b2b2b2 600 | hi TabLineSel guibg=#005f87 601 | hi VertSplit guibg=#b2b2b2 602 | endif 603 | endif 604 | 605 | 606 | " ---------------------------------------------------------------------------- 607 | " Diff: 608 | " ---------------------------------------------------------------------------- 609 | 610 | hi DiffAdd guifg=fg 611 | hi DiffChange guifg=fg 612 | hi DiffDelete guifg=fg 613 | 614 | if s:style == "light" 615 | hi DiffAdd guibg=#afd7af 616 | hi DiffChange guibg=#d7d7af 617 | hi DiffDelete guibg=#d7afaf 618 | hi DiffText guibg=#d7d7af 619 | if s:contrast == "low" 620 | hi DiffText guifg=#ff8700 621 | else 622 | hi DiffText guifg=#d75f00 623 | endif 624 | else 625 | hi DiffAdd guibg=#5f875f 626 | hi DiffChange guibg=#87875f 627 | hi DiffDelete guibg=#875f5f 628 | hi DiffText guibg=#87875f 629 | if s:contrast == "low" 630 | hi DiffText guifg=#d7d75f 631 | else 632 | hi DiffText guifg=#ffff87 633 | endif 634 | endif 635 | 636 | 637 | " ---------------------------------------------------------------------------- 638 | " Spelling: 639 | " ---------------------------------------------------------------------------- 640 | 641 | if s:style == "light" 642 | hi SpellBad guisp=#d70000 643 | hi SpellCap guisp=#00afd7 644 | hi SpellLocal guisp=#d7af00 645 | hi SpellRare guisp=#5faf00 646 | else 647 | hi SpellBad guisp=#ff5f5f 648 | hi SpellCap guisp=#5fafd7 649 | hi SpellLocal guisp=#d7af5f 650 | hi SpellRare guisp=#5faf5f 651 | endif 652 | 653 | 654 | " ---------------------------------------------------------------------------- 655 | " Miscellaneous: 656 | " ---------------------------------------------------------------------------- 657 | 658 | hi Ignore guifg=bg 659 | hi Underlined guifg=fg 660 | 661 | 662 | " ============================================================================ 663 | " Text Emphasis: 664 | " ============================================================================ 665 | 666 | if s:use_bold == 1 667 | for s:item in s:bold_items 668 | exec "hi " . s:item . " gui=bold cterm=bold term=none" 669 | endfor 670 | endif 671 | 672 | if s:use_underline == 1 673 | for s:item in s:underline_items 674 | exec "hi " . s:item . " gui=underline cterm=underline term=none" 675 | endfor 676 | for s:item in s:undercurl_items 677 | exec "hi " . s:item . " cterm=underline" 678 | endfor 679 | endif 680 | 681 | for s:item in s:undercurl_items 682 | exec "hi " . s:item . " gui=undercurl term=none" 683 | endfor 684 | 685 | 686 | " ============================================================================ 687 | " Cterm Colors: 688 | " ============================================================================ 689 | 690 | for s:item in s:normal_items + s:bold_items + s:underline_items 691 | call s:AddCterm(s:item) 692 | endfor 693 | 694 | for s:item in s:undercurl_items 695 | call s:AddSpCterm(s:item) 696 | endfor 697 | 698 | if s:no_term_bg == 1 699 | hi Normal ctermbg=NONE 700 | endif 701 | 702 | 703 | " ============================================================================ 704 | " Alternative Bold Definitions: 705 | " ============================================================================ 706 | 707 | let s:alternative_bold_items = ["Identifier", "PreProc", "Statement", 708 | \ "Special", "Constant", "Type"] 709 | 710 | for s:item in s:alternative_bold_items 711 | exec "let s:temp_gui_fg = synIDattr(synIDtrans(hlID('" . s:item . 712 | \ "')), 'fg', 'gui')" 713 | exec "let s:temp_cterm_fg = synIDattr(synIDtrans(hlID('" . s:item . 714 | \ "')), 'fg', 'cterm')" 715 | exec "hi B" . s:item . " guifg=" . s:temp_gui_fg . " ctermfg=" . 716 | \ s:temp_cterm_fg . " gui=bold cterm=bold term=none" 717 | endfor 718 | 719 | 720 | " ============================================================================ 721 | " Plugin Specific Colors: 722 | " ============================================================================ 723 | 724 | " Tagbar: 725 | hi link TagbarAccessPublic Constant 726 | hi link TagbarAccessProtected Type 727 | hi link TagbarAccessPrivate PreProc 728 | 729 | " Vimwiki: 730 | hi link VimwikiHeader1 BIdentifier 731 | hi link VimwikiHeader2 BPreProc 732 | hi link VimwikiHeader3 BStatement 733 | hi link VimwikiHeader4 BSpecial 734 | hi link VimwikiHeader5 BConstant 735 | hi link VimwikiHeader6 BType 736 | 737 | 738 | " ============================================================================ 739 | " Preset Commands: 740 | " ============================================================================ 741 | 742 | function! SetLucius(style, contrast, contrast_bg) 743 | let g:lucius_style = a:style 744 | let g:lucius_contrast = a:contrast 745 | let g:lucius_contrast_bg = a:contrast_bg 746 | endfunction 747 | 748 | command! LuciusLight call SetLucius("light", "normal", "normal") 749 | \ | colorscheme lucius 750 | command! LuciusLightLowContrast call SetLucius("light", "low", "normal") 751 | \ | colorscheme lucius 752 | command! LuciusLightHighContrast call SetLucius("light", "high", "normal") 753 | \ | colorscheme lucius 754 | 755 | command! LuciusWhite call SetLucius("light", "normal", "high") 756 | \ | colorscheme lucius 757 | command! LuciusWhiteLowContrast call SetLucius("light", "low", "high") 758 | \ | colorscheme lucius 759 | command! LuciusWhiteHighContrast call SetLucius("light", "high", "high") 760 | \ | colorscheme lucius 761 | 762 | command! LuciusDark call SetLucius("dark", "normal", "normal") 763 | \ | colorscheme lucius 764 | command! LuciusDarkLowContrast call SetLucius("dark", "low", "normal") 765 | \ | colorscheme lucius 766 | command! LuciusDarkHighContrast call SetLucius("dark", "high", "normal") 767 | \ | colorscheme lucius 768 | 769 | command! LuciusBlack call SetLucius("dark", "normal", "high") 770 | \ | colorscheme lucius 771 | command! LuciusBlackLowContrast call SetLucius("dark", "low", "high") 772 | \ | colorscheme lucius 773 | command! LuciusBlackHighContrast call SetLucius("dark", "high", "high") 774 | \ | colorscheme lucius 775 | 776 | " vim: tw=78 777 | 778 | 779 | --------------------------------------------------------------------------------