From a8f9a20b78428a753d9832ad07da44e28c1f27a6 Mon Sep 17 00:00:00 2001 From: Jeremy Hanna Date: Mon, 28 Nov 2022 11:19:40 -0500 Subject: [PATCH] Add current working macbook dotfiles --- .config/karabiner/karabiner.json | 126 ++++++--- .config/nvim/ftplugin/go.lua | 2 +- .config/nvim/ftplugin/python.lua | 2 + .config/nvim/ftplugin/rust.lua | 1 + .config/nvim/lua/config.lua | 35 ++- .vim/colors/allomancer.vim | 230 ++++++++++++++++ .vim/colors/seoul256.vim | 457 +++++++++++++++++++++++++++++++ .zshrc | 11 + 8 files changed, 806 insertions(+), 58 deletions(-) create mode 100644 .config/nvim/ftplugin/python.lua create mode 100644 .config/nvim/ftplugin/rust.lua create mode 100644 .vim/colors/allomancer.vim create mode 100644 .vim/colors/seoul256.vim diff --git a/.config/karabiner/karabiner.json b/.config/karabiner/karabiner.json index 779f0af..df63473 100644 --- a/.config/karabiner/karabiner.json +++ b/.config/karabiner/karabiner.json @@ -57,6 +57,19 @@ "ignore": false, "manipulate_caps_lock_led": false, "simple_modifications": [] + }, + { + "disable_built_in_keyboard_if_exists": false, + "fn_function_keys": [], + "identifiers": { + "is_keyboard": true, + "is_pointing_device": false, + "product_id": 638, + "vendor_id": 1452 + }, + "ignore": false, + "manipulate_caps_lock_led": true, + "simple_modifications": [] } ], "fn_function_keys": [ @@ -64,97 +77,121 @@ "from": { "key_code": "f1" }, - "to": { - "key_code": "display_brightness_decrement" - } + "to": [ + { + "key_code": "display_brightness_decrement" + } + ] }, { "from": { "key_code": "f2" }, - "to": { - "key_code": "display_brightness_increment" - } + "to": [ + { + "key_code": "display_brightness_increment" + } + ] }, { "from": { "key_code": "f3" }, - "to": { - "key_code": "mission_control" - } + "to": [ + { + "key_code": "mission_control" + } + ] }, { "from": { "key_code": "f4" }, - "to": { - "key_code": "launchpad" - } + "to": [ + { + "key_code": "launchpad" + } + ] }, { "from": { "key_code": "f5" }, - "to": { - "key_code": "illumination_decrement" - } + "to": [ + { + "key_code": "illumination_decrement" + } + ] }, { "from": { "key_code": "f6" }, - "to": { - "key_code": "illumination_increment" - } + "to": [ + { + "key_code": "illumination_increment" + } + ] }, { "from": { "key_code": "f7" }, - "to": { - "key_code": "rewind" - } + "to": [ + { + "key_code": "rewind" + } + ] }, { "from": { "key_code": "f8" }, - "to": { - "key_code": "play_or_pause" - } + "to": [ + { + "key_code": "play_or_pause" + } + ] }, { "from": { "key_code": "f9" }, - "to": { - "key_code": "fastforward" - } + "to": [ + { + "key_code": "fastforward" + } + ] }, { "from": { "key_code": "f10" }, - "to": { - "key_code": "mute" - } + "to": [ + { + "key_code": "mute" + } + ] }, { "from": { "key_code": "f11" }, - "to": { - "key_code": "volume_decrement" - } + "to": [ + { + "key_code": "volume_decrement" + } + ] }, { "from": { "key_code": "f12" }, - "to": { - "key_code": "volume_increment" - } + "to": [ + { + "key_code": "volume_increment" + } + ] } ], "name": "Laptop profile", @@ -167,22 +204,27 @@ "from": { "key_code": "backslash" }, - "to": { - "key_code": "delete_or_backspace" - } + "to": [ + { + "key_code": "delete_or_backspace" + } + ] }, { "from": { "key_code": "delete_or_backspace" }, - "to": { - "key_code": "backslash" - } + "to": [ + { + "key_code": "backslash" + } + ] } ], "virtual_hid_keyboard": { "caps_lock_delay_milliseconds": 0, "country_code": 0, + "indicate_sticky_modifier_keys_state": true, "keyboard_type": "ansi", "mouse_key_xy_scale": 100 } diff --git a/.config/nvim/ftplugin/go.lua b/.config/nvim/ftplugin/go.lua index 078ec81..4cc32e1 100644 --- a/.config/nvim/ftplugin/go.lua +++ b/.config/nvim/ftplugin/go.lua @@ -20,6 +20,6 @@ vim.b.comment_leader = '// ' -- execute tests on current directory package, -- ./ (dir) % (current filepath) p (path) . (reduce to relative) h (directory) -vim.api.nvim_set_keymap("n", "r", [[:!time go test -v ./%:p:.:h]]) +vim.api.nvim_set_keymap("n", "r", [[:!time go test -v ./%:p:.:h]], {}) -- autocmd BufWritePre *.go GoFmt " run vim-go GoFmt on save diff --git a/.config/nvim/ftplugin/python.lua b/.config/nvim/ftplugin/python.lua new file mode 100644 index 0000000..61d366f --- /dev/null +++ b/.config/nvim/ftplugin/python.lua @@ -0,0 +1,2 @@ +vim.g['semshi#error_sign'] = false + diff --git a/.config/nvim/ftplugin/rust.lua b/.config/nvim/ftplugin/rust.lua new file mode 100644 index 0000000..b230b53 --- /dev/null +++ b/.config/nvim/ftplugin/rust.lua @@ -0,0 +1 @@ +require('rust-tools').setup({}) diff --git a/.config/nvim/lua/config.lua b/.config/nvim/lua/config.lua index 14468b7..5adde4b 100644 --- a/.config/nvim/lua/config.lua +++ b/.config/nvim/lua/config.lua @@ -1,5 +1,23 @@ local Plug = vim.fn['plug#'] +local set = vim.opt +local cmd = vim.cmd +local g = vim.g +local function map(mode, lhs, rhs, opts) + local options = { noremap = true, silent = true } + if opts then + options = vim.tbl_extend("force", options, opts) + end + vim.api.nvim_set_keymap(mode, lhs, rhs, options) +end + +g.mapleader = " " + +-- colorschemes +cmd [[colorscheme seoul256]] +--set.termguicolors = true +--cmd [[colorscheme allomancer]] + vim.call('plug#begin', '~/.vim/bundle') -- --- Editing utility --- Plug('godlygeek/tabular') -- align tables @@ -23,6 +41,7 @@ Plug('ntpeters/vim-better-whitespace') Plug('simrat39/rust-tools.nvim') Plug('saecki/crates.nvim', { branch = 'main' }) -- --- Python --- +Plug('numirias/semshi', { ['do'] = ':UpdateRemotePlugins' }) -- --- Elixir --- Plug('elixir-editors/vim-elixir') -- elixir syntax highlight Plug('andyl/vim-textobj-elixir') -- make elixir blocks text-objects @@ -45,27 +64,13 @@ Plug('nvim-lua/plenary.nvim') Plug('scalameta/nvim-metals', { branch = 'main' }) vim.call('plug#end') -local set = vim.opt -local cmd = vim.cmd -local g = vim.g -local function map(mode, lhs, rhs, opts) - local options = { noremap = true, silent = true } - if opts then - options = vim.tbl_extend("force", options, opts) - end - vim.api.nvim_set_keymap(mode, lhs, rhs, options) -end - -g.mapleader = " " - ---------------------------------- -- Vim settings ------------------ ---------------------------------- -cmd [[colorscheme apprentice]] set.relativenumber = true set.number = true -cmd [[highlight ColorColumn ctermbg=235]] +cmd [[highlight ColorColumn ctermbg=237]] set.colorcolumn = '80' set.hlsearch = false diff --git a/.vim/colors/allomancer.vim b/.vim/colors/allomancer.vim new file mode 100644 index 0000000..f55a0a0 --- /dev/null +++ b/.vim/colors/allomancer.vim @@ -0,0 +1,230 @@ +" Vim allomancer colors file +" Code file inspired by: +" - https://github.com/patstockwell/vim-monokai-tasty +" - https://github.com/romainl/Apprentice +" +"Author: Nadim Edde +"TODO: Get consistency with colors and tokens + +hi clear "Reset all highlighting to the defaults. Removes all highlighting for groups added by the user + +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "allomancer" + +" User Options +if !exists("g:allomancer_italic") + let g:allomancer_italic = 0 +endif + +if g:allomancer_italic + let s:italic = { "cterm": "italic", "gui": "italic" } +else + let s:italic = { "cterm": "NONE", "gui": "NONE" } +endif + +"Defining UI colors +let s:black = {"cterm":"0", "gui": "#282c34"} "Background color +let s:light_black = {"cterm":"0", "gui": "#2c323c"} +let s:dark_grey = {"cterm":"8", "gui": "#3e4452"} +let s:grey = {"cterm":"8", "gui": "#55606d"} +let s:light_grey = {"cterm": "7", "gui": "#abb2bf"} "Foreground color +let s:white = {"cterm": "NONE", "gui": "#d6e9ff"} + + +"Defining highlighting colors + +let s:light_red = {"cterm": "1", "gui": "#e06c75"} +let s:dark_red = {"cterm": "9", "gui": "#af5f5f"} +let s:orange = {"cterm": "11", "gui": "#FF875F"} +let s:green = {"cterm": "2", "gui": "#87af87"} +let s:aqua = {"cterm": "6", "gui": "#5fafaf"} +let s:blue = {"cterm": "4", "gui": "#6E88A6"} +let s:purple = {"cterm": "5", "gui": "#D18EC2"} +let s:dark_purple = {"cterm": "13", "gui": "#875faf"} "Xterm color palette 97 +let s:beige = {"cterm": "3", "gui": "#D7AFAF"} + +"Special text properties +let s:none = { "cterm": "NONE", "gui": "NONE" } +let s:reverse = { "cterm": "reverse", "gui": "reverse" } +let s:bold = { "cterm": "bold", "gui": "bold" } +let s:underline = { "cterm": "underline", "gui": "underline" } +let s:bold_underline = { "cterm": "bold,underline", "gui": "bold,underline" } + +" Helper function to highlight a group +function! Highlight(group, fg, bg, style) + exec "hi " . a:group + \ . " ctermfg=" . a:fg["cterm"] + \ . " ctermbg=" . a:bg["cterm"] + \ . " cterm=" . a:style["cterm"] + \ . " guifg=" . a:fg["gui"] + \ . " guibg=" . a:bg["gui"] + \ . " gui=" . a:style["gui"] +endfunction + +" UI components +call Highlight("Normal", s:light_grey, s:black, s:none) +call Highlight("Visual", s:blue, s:black, s:reverse) + +call Highlight("Cursor", s:black, s:light_grey, s:none) +call Highlight("CursorLine", s:none, s:light_black, s:none) +call Highlight("CursorColumn", s:none, s:light_black, s:none) +call Highlight("CursorLineNr", s:aqua, s:light_black, s:none) +call Highlight("ColorColumn", s:none, s:none, s:none) +call Highlight("Conceal", s:none, s:none, s:none) + +call Highlight("LineNr", s:grey, s:black, s:none) +call Highlight("FoldColumn", s:light_grey, s:black, s:none) +call Highlight("Folded", s:light_grey, s:black, s:none) +call Highlight("MatchParen", s:grey, s:aqua, s:reverse) + +call Highlight("SignColumn", s:light_grey, s:black, s:none) +call Highlight("NonText", s:dark_grey, s:none, s:none) + +" Completion Menu +call Highlight("Pmenu", s:light_grey, s:dark_grey, s:none) +call Highlight("PmenuSel", s:black, s:aqua, s:none) +call Highlight("PmenuSbar", s:none, s:grey, s:none) +call Highlight("PmenuThumb", s:blue, s:beige, s:none) + +" Git diff output +call Highlight("DiffChange", s:dark_purple, s:black, s:reverse) +call Highlight("DiffText", s:orange, s:black, s:reverse) +call Highlight("DiffDelete", s:dark_red, s:black, s:reverse) +call Highlight("DiffAdd", s:green, s:black, s:reverse) + +" Git Gutter + +call Highlight("GitGutterAdd", s:green, s:black, s:none) +call Highlight("GitGutterChange", s:dark_purple, s:black, s:none) +call Highlight("GitGutterDelete", s:dark_red, s:black, s:none) + +" Errors and warnings +call Highlight("Error", s:light_red, s:none, s:reverse) +call Highlight("ErrorMsg", s:black, s:light_red, s:none) +call Highlight("WarningMsg", s:black, s:light_red, s:none) +call Highlight("SpellBad", s:light_red, s:black, s:underline) +call Highlight("SpellRare", s:orange, s:black, s:none) +call Highlight("SpellCap", s:aqua, s:black, s:italic) +call Highlight("SpellLocal", s:green, s:black, s:italic) + +call Highlight("MoreMsg", s:grey, s:black, s:none) +call Highlight("ModeMsg", s:black, s:green, s:none) +call Highlight("Question", s:green, s:black, s:none) + +call Highlight("TabLine", s:blue, s:dark_grey, s:underline) +call Highlight("TabLineSel", s:black, s:blue, s:bold) +call Highlight("TabLineFill", s:dark_grey, s:dark_grey, s:none) + +call Highlight("StatusLine", s:black, s:blue, s:none) +call Highlight("StatusLineNC", s:black, s:grey, s:none) +call Highlight("StatusLineTerm", s:black, s:blue, s:none) +call Highlight("StatusLineTermNC", s:black, s:grey, s:none) + +call Highlight("VertSplit", s:dark_grey, s:dark_grey, s:none) +call Highlight("WildMenu", s:black, s:orange, s:none) + +call Highlight("IncSearch", s:black, s:dark_red, s:bold_underline) +call Highlight("Search", s:black, s:aqua, s:bold_underline) + + +call Highlight("Comment", s:grey, s:none, s:none) +call Highlight("Constant", s:orange, s:black, s:none) +call Highlight("Identifier", s:blue, s:black, s:none) +call Highlight("Function", s:beige, s:black, s:none) +call Highlight("Ignore", s:none, s:none, s:none) +call Highlight("PreProc", s:aqua, s:black, s:none) +call Highlight("Special", s:green, s:black, s:none) +call Highlight("Statement", s:dark_red, s:black, s:none) +call Highlight("String", s:green, s:black, s:none) +call Highlight("Todo", s:purple, s:black, s:reverse) +call Highlight("Type", s:dark_purple, s:black, s:none) +call Highlight("StorageClass", s:light_red, s:black, s:none) +call Highlight("TypeDef", s:purple, s:black, s:none) +call Highlight("Underlined", s:aqua, s:black, s:underline) +call Highlight("SpecialKey", s:grey, s:black, s:none) +call Highlight("Title", s:white, s:black, s:none) + +"Haskell (https://raw.githubusercontent.com/sdiehl/haskell-vim-proto/master/vim/syntax/haskell.vim) +call Highlight("ConId", s:beige, s:black, s:none) +call Highlight("hsType", s:purple, s:black, s:none) + +"Markdown +call Highlight("markdownBold", s:white, s:black, s:bold) +call Highlight("markdownH1", s:green, s:black, s:bold) +call Highlight("markdownHeadingDelimiter", s:orange, s:black, s:bold) +call Highlight("markdownLinkText", s:blue, s:black, s:none) + +"Startify +call Highlight("StartifyPath", s:grey, s:black, s:none) +call Highlight("StartifyFile", s:light_grey, s:black, s:none) +call Highlight("StartifyHeader", s:green, s:black, s:none) + +"NERDTree +call Highlight("NERDTreeDir", s:blue, s:black, s:none) +call Highlight("NERDTreeUp", s:blue, s:black, s:none) + +"netrw +call Highlight("netrwDir", s:blue, s:black, s:none) + + +let links = [ + \ ['Boolean', 'Constant'], + \ ['Character', 'Constant'], + \ ['Conditional', 'Statement'], + \ ['Debug', 'Special'], + \ ['Define', 'PreProc'], + \ ['Delimiter', 'Special'], + \ ['Exception', 'Statement'], + \ ['Float', 'Number'], + \ ['HelpCommand', 'Statement'], + \ ['HelpExample', 'Statement'], + \ ['Include', 'PreProc'], + \ ['Keyword', 'Statement'], + \ ['Label', 'Statement'], + \ ['Macro', 'PreProc'], + \ ['Number', 'Constant'], + \ ['Operator', 'Statement'], + \ ['PreCondit', 'PreProc'], + \ ['Repeat', 'Statement'], + \ ['SpecialChar', 'Special'], + \ ['SpecialComment', 'Special'], + \ ['Structure', 'Type'], + \ ['Tag', 'Special'], + \ ['Terminal', 'Normal'], + \ ['htmlEndTag', 'htmlTagName'], + \ ['htmlLink', 'Function'], + \ ['htmlSpecialTagName', 'htmlTagName'], + \ ['htmlTag', 'htmlTagName'], + \ ['htmlBold', 'Normal'], + \ ['htmlItalic', 'Normal'], + \ ['xmlTag', 'Statement'], + \ ['xmlTagName', 'Statement'], + \ ['xmlEndTag', 'Statement'], + \ ['markdownItalic', 'Preproc'], + \ ['markdownH2', 'markDownH1'], + \ ['markdownH3', 'markDownH1'], + \ ['markdownH4', 'markDownH1'], + \ ['markdownH5', 'markDownH1'], + \ ['markdownH6', 'markDownH1'], + \ ['asciidocQuotedEmphasized', 'Preproc'], + \ ['diffBDiffer', 'WarningMsg'], + \ ['diffCommon', 'WarningMsg'], + \ ['diffDiffer', 'WarningMsg'], + \ ['diffIdentical', 'WarningMsg'], + \ ['diffIsA', 'WarningMsg'], + \ ['diffNoEOL', 'WarningMsg'], + \ ['diffOnly', 'WarningMsg'], + \ ['diffRemoved', 'WarningMsg'], + \ ['diffAdded', 'String'], + \ ['pdcHeader', 'markdownH1'], + \ ['pdcemphasis', 'markdownBold'], + \ ['pythonBuiltin', 'Function'], + \ ['Directory', 'Function'], + \ ] +augroup Allomancer + autocmd! + autocmd ColorScheme * if expand("") == "allomancer" | for link in links | execute 'hi link' link[0] link[1] | endfor | else | for link in links | execute 'hi link' link[0] 'NONE' | endfor | endif +augroup END \ No newline at end of file diff --git a/.vim/colors/seoul256.vim b/.vim/colors/seoul256.vim new file mode 100644 index 0000000..669805a --- /dev/null +++ b/.vim/colors/seoul256.vim @@ -0,0 +1,457 @@ +" " _____ _ ___ ___ ___ " +" " | __|___ ___ _ _| |_ | _| _| " +" " |__ | -_| . | | | | _|_ | . | " +" " |_____|___|___|___|_|___|___|___|.vim " +" +" " Low-contrast dark Vim color scheme using Seoul Colors " +" +" File: seoul256.vim +" URL: github.com/junegunn/seoul256.vim +" Author: Junegunn Choi (junegunn.c@gmail.com) +" License: MIT +" +" Copyright (c) 2017 Junegunn Choi +" +" MIT License +" +" Permission is hereby granted, free of charge, to any person obtaining +" a copy of this software and associated documentation files (the +" "Software"), to deal in the Software without restriction, including +" without limitation the rights to use, copy, modify, merge, publish, +" distribute, sublicense, and/or sell copies of the Software, and to +" permit persons to whom the Software is furnished to do so, subject to +" the following conditions: +" +" The above copyright notice and this permission notice shall be +" included in all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +" LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +" OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +" WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +if !exists('s:rgb_map') + if get(g:, 'seoul256_srgb', 0) + let s:rgb_map = + \{ 16: '#000000', 17: '#00005f', 18: '#000087', + \ 19: '#0000af', 20: '#0000d7', 21: '#0000ff', + \ 22: '#005f00', 23: '#005f5f', 24: '#005f87', + \ 25: '#005faf', 26: '#005fd7', 27: '#005fff', + \ 28: '#008700', 29: '#00875f', 30: '#008787', + \ 31: '#0087af', 32: '#0087d7', 33: '#0087ff', + \ 34: '#00af00', 35: '#00af5f', 36: '#00af87', + \ 37: '#00afaf', 38: '#00afd7', 39: '#00afff', + \ 40: '#00d700', 41: '#00d75f', 42: '#00d787', + \ 43: '#00d7af', 44: '#00d7d7', 45: '#00d7ff', + \ 46: '#00ff00', 47: '#00ff5f', 48: '#00ff87', + \ 49: '#00ffaf', 50: '#00ffd7', 51: '#00ffff', + \ 52: '#5f0000', 53: '#5f005f', 54: '#5f0087', + \ 55: '#5f00af', 56: '#5f00d7', 57: '#5f00ff', + \ 58: '#5f5f00', 59: '#5f5f5f', 60: '#5f5f87', + \ 61: '#5f5faf', 62: '#5f5fd7', 63: '#5f5fff', + \ 64: '#5f8700', 65: '#5f875f', 66: '#5f8787', + \ 67: '#5f87af', 68: '#5f87d7', 69: '#5f87ff', + \ 70: '#5faf00', 71: '#5faf5f', 72: '#5faf87', + \ 73: '#5fafaf', 74: '#5fafd7', 75: '#5fafff', + \ 76: '#5fd700', 77: '#5fd75f', 78: '#5fd787', + \ 79: '#5fd7af', 80: '#5fd7d7', 81: '#5fd7ff', + \ 82: '#5fff00', 83: '#5fff5f', 84: '#5fff87', + \ 85: '#5fffaf', 86: '#5fffd7', 87: '#5fffff', + \ 88: '#870000', 89: '#87005f', 90: '#870087', + \ 91: '#8700af', 92: '#8700d7', 93: '#8700ff', + \ 94: '#875f00', 95: '#875f5f', 96: '#875f87', + \ 97: '#875faf', 98: '#875fd7', 99: '#875fff', + \ 100: '#878700', 101: '#87875f', 102: '#878787', + \ 103: '#8787af', 104: '#8787d7', 105: '#8787ff', + \ 106: '#87af00', 107: '#87af5f', 108: '#87af87', + \ 109: '#87afaf', 110: '#87afd7', 111: '#87afff', + \ 112: '#87d700', 113: '#87d75f', 114: '#87d787', + \ 115: '#87d7af', 116: '#87d7d7', 117: '#87d7ff', + \ 118: '#87ff00', 119: '#87ff5f', 120: '#87ff87', + \ 121: '#87ffaf', 122: '#87ffd7', 123: '#87ffff', + \ 124: '#af0000', 125: '#af005f', 126: '#af0087', + \ 127: '#af00af', 128: '#af00d7', 129: '#af00ff', + \ 130: '#af5f00', 131: '#af5f5f', 132: '#af5f87', + \ 133: '#af5faf', 134: '#af5fd7', 135: '#af5fff', + \ 136: '#af8700', 137: '#af875f', 138: '#af8787', + \ 139: '#af87af', 140: '#af87d7', 141: '#af87ff', + \ 142: '#afaf00', 143: '#afaf5f', 144: '#afaf87', + \ 145: '#afafaf', 146: '#afafd7', 147: '#afafff', + \ 148: '#afd700', 149: '#afd75f', 150: '#afd787', + \ 151: '#afd7af', 152: '#afd7d7', 153: '#afd7ff', + \ 154: '#afff00', 155: '#afff5f', 156: '#afff87', + \ 157: '#afffaf', 158: '#afffd7', 159: '#afffff', + \ 160: '#d70000', 161: '#d7005f', 162: '#d70087', + \ 163: '#d700af', 164: '#d700d7', 165: '#d700ff', + \ 166: '#d75f00', 167: '#d75f5f', 168: '#d75f87', + \ 169: '#d75faf', 170: '#d75fd7', 171: '#d75fff', + \ 172: '#d78700', 173: '#d7875f', 174: '#d78787', + \ 175: '#d787af', 176: '#d787d7', 177: '#d787ff', + \ 178: '#d7af00', 179: '#d7af5f', 180: '#d7af87', + \ 181: '#d7afaf', 182: '#d7afd7', 183: '#d7afff', + \ 184: '#d7d700', 185: '#d7d75f', 186: '#d7d787', + \ 187: '#d7d7af', 188: '#d7d7d7', 189: '#d7d7ff', + \ 190: '#d7ff00', 191: '#d7ff5f', 192: '#d7ff87', + \ 193: '#d7ffaf', 194: '#d7ffd7', 195: '#d7ffff', + \ 196: '#ff0000', 197: '#ff005f', 198: '#ff0087', + \ 199: '#ff00af', 200: '#ff00d7', 201: '#ff00ff', + \ 202: '#ff5f00', 203: '#ff5f5f', 204: '#ff5f87', + \ 205: '#ff5faf', 206: '#ff5fd7', 207: '#ff5fff', + \ 208: '#ff8700', 209: '#ff875f', 210: '#ff8787', + \ 211: '#ff87af', 212: '#ff87d7', 213: '#ff87ff', + \ 214: '#ffaf00', 215: '#ffaf5f', 216: '#ffaf87', + \ 217: '#ffafaf', 218: '#ffafd7', 219: '#ffafff', + \ 220: '#ffd700', 221: '#ffd75f', 222: '#ffd787', + \ 223: '#ffd7af', 224: '#ffd7d7', 225: '#ffd7ff', + \ 226: '#ffff00', 227: '#ffff5f', 228: '#ffff87', + \ 229: '#ffffaf', 230: '#ffffd7', 231: '#ffffff', + \ 232: '#080808', 233: '#121212', 234: '#1c1c1c', + \ 235: '#262626', 236: '#303030', 237: '#3a3a3a', + \ 238: '#444444', 239: '#4e4e4e', 240: '#585858', + \ 241: '#626262', 242: '#6c6c6c', 243: '#767676', + \ 244: '#808080', 245: '#8a8a8a', 246: '#949494', + \ 247: '#9e9e9e', 248: '#a8a8a8', 249: '#b2b2b2', + \ 250: '#bcbcbc', 251: '#c6c6c6', 252: '#d0d0d0', + \ 253: '#dadada', 254: '#e4e4e4', 255: '#eeeeee' } + else + let s:rgb_map = + \{ 22: '#006F00', 23: '#007173', 24: '#007299', 25: '#0074BE', 30: '#009799', + \ 31: '#0099BD', 38: '#00BDDF', 52: '#730B00', 58: '#727100', 59: '#727272', + \ 65: '#719872', 66: '#719899', 67: '#7299BC', 68: '#719CDF', 73: '#6FBCBD', + \ 74: '#70BDDF', 88: '#9B1300', 89: '#9B1D72', 94: '#9A7200', 95: '#9A7372', + \ 96: '#9A7599', 101: '#999872', 103: '#999ABD', 108: '#98BC99', 109: '#98BCBD', + \ 110: '#98BEDE', 116: '#97DDDF', 125: '#BF2172', 131: '#BE7572', 137: '#BE9873', + \ 143: '#BDBB72', 144: '#BDBC98', 145: '#BDBDBD', 151: '#BCDDBD', 152: '#BCDEDE', + \ 153: '#BCE0FF', 161: '#E12672', 168: '#E17899', 173: '#E19972', 174: '#E09B99', + \ 179: '#DFBC72', 181: '#E0BEBC', 184: '#DEDC00', 186: '#DEDD99', 187: '#DFDEBD', + \ 189: '#DFDFFF', 216: '#FFBD98', 217: '#FFBFBD', 218: '#FFC0DE', 220: '#FFDD00', + \ 222: '#FFDE99', 224: '#FFDFDF', 230: '#FFFFDF', 231: '#FFFFFF', 232: '#060606', + \ 233: '#171717', 234: '#252525', 235: '#333233', 236: '#3F3F3F', 237: '#4B4B4B', + \ 238: '#565656', 239: '#616161', 240: '#6B6B6B', 241: '#757575', 249: '#BFBFBF', + \ 250: '#C8C8C8', 251: '#D1D0D1', 252: '#D9D9D9', 253: '#E1E1E1', 254: '#E9E9E9', + \ 255: '#F1F1F1' } + endif +endif + +let s:background = &background +let s:colors_name = get(g:, 'colors_name', '') + +silent! unlet s:style s:seoul256_background + +" 1. If g:seoul256_background is found +if exists('g:seoul256_background') + let s:seoul256_background = g:seoul256_background + if s:seoul256_background >= 233 && s:seoul256_background <= 239 + let s:style = 'dark' + elseif s:seoul256_background >= 252 && s:seoul256_background <= 256 + let s:style = 'light' + else + unlet s:seoul256_background + endif +endif + +if !exists('s:style') + " 2. If g:colors_name is NOT 'seoul256' -> dark version + if s:colors_name != 'seoul256' + let s:style = 'dark' + " 3. Follow &background setting + else + let s:style = &background + endif +endif +let s:style_idx = s:style == 'light' + +" Background colors +if s:style == 'dark' + let s:dark_bg = get(s:, 'seoul256_background', 236) + let s:light_bg = 253 +else + let s:dark_bg = 237 + let s:light_bg = get(s:, 'seoul256_background', 253) +endif +let s:dark_bg_2 = s:dark_bg > 233 ? s:dark_bg - 2 : 16 +let s:light_bg_1 = min([s:light_bg + 1, 256]) +let s:light_bg_2 = min([s:light_bg + 2, 256]) + +" Foreground colors +let s:dark_fg = 252 +let s:light_fg = 239 + +function! s:hi(item, fg, bg) + let fg = a:fg[s:style_idx] > 255 ? 231 : a:fg[s:style_idx] + let bg = a:bg[s:style_idx] > 255 ? 231 : a:bg[s:style_idx] + + if !empty(fg) + execute printf("highlight %s ctermfg=%s guifg=%s", a:item, fg, get(s:rgb_map, fg, 'NONE')) + endif + if !empty(bg) + execute printf("highlight %s ctermbg=%s guibg=%s", a:item, bg, get(s:rgb_map, bg, 'NONE')) + endif +endfunction + +let s:gui = has('gui_running') +if !s:gui + set t_Co=256 +end + +silent! unlet g:colors_name +hi clear +if exists("syntax_on") + syntax reset +endif + +call s:hi('Normal', [s:dark_fg, s:light_fg], [s:dark_bg, s:light_bg]) + +call s:hi('LineNr', [101, 101], [s:dark_bg + 1, s:light_bg - 2]) +call s:hi('Visual', ['', ''], [23, 152]) +call s:hi('VisualNOS', ['', ''], [23, 152]) + +call s:hi('Comment', [65, 65], ['', '']) +call s:hi('Number', [222, 95], ['', '']) +call s:hi('Float', [222, 95], ['', '']) +call s:hi('Boolean', [103, 168], ['', '']) +call s:hi('String', [109, 30], ['', '']) +call s:hi('Constant', [73, 23], ['', '']) +call s:hi('Character', [174, 168], ['', '']) +call s:hi('Delimiter', [137, 94], ['', '']) +call s:hi('StringDelimiter', [137, 94], ['', '']) +call s:hi('Statement', [108, 66], ['', '']) +" case, default, etc. +" hi Label ctermfg= + +" if else end +call s:hi('Conditional', [110, 31], ['', '']) + +" while end +call s:hi('Repeat', [68, 67], ['', '']) +call s:hi('Todo', [161, 125], [s:dark_bg_2, s:light_bg_2]) +call s:hi('Function', [187, 58], ['', '']) + +" Macros +call s:hi('Define', [173, 131], ['', '']) +call s:hi('Macro', [173, 131], ['', '']) +call s:hi('Include', [173, 131], ['', '']) +call s:hi('PreCondit', [173, 131], ['', '']) + + +" #! +call s:hi('PreProc', [143, 58], ['', '']) + +" @abc +call s:hi('Identifier', [217, 96], ['', '']) + +" AAA Abc +call s:hi('Type', [179, 94], ['', '']) + +" + - * / << +call s:hi('Operator', [186, 131], ['', '']) + +" super yield +call s:hi('Keyword', [168, 168], ['', '']) + +" raise +call s:hi('Exception', [161, 161], ['', '']) +" +" hi StorageClass ctermfg= +call s:hi('Structure', [116, 23], ['', '']) +" hi Typedef ctermfg= + +call s:hi('Error', [s:dark_fg, s:light_bg_1], [52, 174]) +call s:hi('ErrorMsg', [s:dark_fg, s:light_bg_1], [52, 168]) +call s:hi('Underlined', [181, 168], ['', '']) + +" set textwidth=80 +" set colorcolumn=+1 +call s:hi('ColorColumn', ['', ''], [s:dark_bg - 1, s:light_bg - 2]) + +" GVIM only +" hi Cursor ctermfg= +" hi CursorIM ctermfg= + +" set cursorline cursorcolumn +call s:hi('CursorLine', ['', ''], [s:dark_bg - 1, s:light_bg - 1]) +call s:hi('CursorLineNr', [131, 131], [s:dark_bg - 1, s:light_bg - 1]) +call s:hi('CursorColumn', ['', ''], [s:dark_bg - 1, s:light_bg - 1]) +call s:hi('NormalFloat', ['', ''], [s:dark_bg - 1, s:light_bg - 1]) + +call s:hi('Directory', [187, 95], ['', '']) + +call s:hi('DiffAdd', ['NONE', 'NONE'], [22, 151]) +call s:hi('DiffDelete', ['NONE', 'NONE'], [95, 181]) +call s:hi('DiffChange', ['NONE', 'NONE'], [s:dark_bg + 3, 189]) +call s:hi('DiffText', ['NONE', 'NONE'], [52, 224]) + +call s:hi('VertSplit', [s:dark_bg_2, s:light_bg - 3], [s:dark_bg_2, s:light_bg - 3]) +call s:hi('Folded', [101, 101], [s:dark_bg + 1, s:light_bg - 2]) + +" set foldcolumn=1 +call s:hi('FoldColumn', [144, 94], [s:dark_bg + 1, s:light_bg - 2]) + +call s:hi('MatchParen', ['', ''], [s:dark_bg + 3, s:light_bg - 3]) + +" -- INSERT -- +call s:hi('ModeMsg', [173, 173], ['', '']) + +" let &showbreak = '> ' +call s:hi('NonText', [59, 145], ['', '']) + +call s:hi('MoreMsg', [173, 173], ['', '']) + +" Popup menu +call s:hi('Pmenu', [s:dark_bg + 1, 238], [224, 224]) +call s:hi('PmenuSel', [s:dark_fg, s:dark_fg], [89, 89]) +call s:hi('PmenuSbar', ['', ''], [65, 65]) +call s:hi('PmenuThumb', ['', ''], [23, 23]) + +call s:hi('Search', [s:dark_fg, 255], [24, 74]) +call s:hi('IncSearch', [220, 220], [s:dark_bg + 1, 238]) + +" String delimiter, interpolation +call s:hi('Special', [216, 173], ['', '']) +" hi SpecialChar ctermfg= +" hi SpecialComment ctermfg= +" hi Tag ctermfg= +" hi Debug ctermfg= + +" :map, listchars +call s:hi('SpecialKey', [59, 145], ['', '']) + +if !s:gui + " Red / Blue / Cyan / Magenta + if s:style_idx == 0 + hi SpellBad ctermbg=NONE cterm=underline ctermfg=168 + hi SpellCap ctermbg=NONE cterm=underline ctermfg=110 + hi SpellLocal ctermbg=NONE cterm=underline ctermfg=153 + hi SpellRare ctermbg=NONE cterm=underline ctermfg=218 + else + hi SpellBad ctermbg=NONE cterm=underline ctermfg=125 + hi SpellCap ctermbg=NONE cterm=underline ctermfg=25 + hi SpellLocal ctermbg=NONE cterm=underline ctermfg=31 + hi SpellRare ctermbg=NONE cterm=underline ctermfg=96 + endif +else + if s:style_idx == 0 + execute 'hi SpellBad gui=undercurl guisp=' . s:rgb_map[168] + execute 'hi SpellCap gui=undercurl guisp=' . s:rgb_map[110] + execute 'hi SpellLocal gui=undercurl guisp=' . s:rgb_map[153] + execute 'hi SpellRare gui=undercurl guisp=' . s:rgb_map[218] + else + execute 'hi SpellBad gui=undercurl guisp=' . s:rgb_map[125] + execute 'hi SpellCap gui=undercurl guisp=' . s:rgb_map[25] + execute 'hi SpellLocal gui=undercurl guisp=' . s:rgb_map[31] + execute 'hi SpellRare gui=undercurl guisp=' . s:rgb_map[96] + endif +endif + +" +call s:hi('StatusLine', [95, 95], [187, 187]) +call s:hi('StatusLineNC', [s:dark_bg + 2, s:light_bg - 2], [187, 238]) +call s:hi('StatusLineTerm', [95, 95], [187, 187]) +call s:hi('StatusLineTermNC', [s:dark_bg + 2, s:light_bg - 2], [187, 238]) +hi StatusLineTerm cterm=bold,reverse gui=bold,reverse +hi StatusLineTermNC cterm=bold,reverse gui=bold,reverse +call s:hi('TabLineFill', [s:dark_bg + 2, s:light_bg - 2], ['', '']) +call s:hi('TabLineSel', [187, 187], [23, 66]) +call s:hi('TabLine', [s:dark_bg + 12, s:light_bg - 12], [s:dark_bg + 4, s:light_bg - 4]) +call s:hi('WildMenu', [95, 95], [184, 184]) + +" :set all +call s:hi('Title', [181, 88], ['', '']) + +" TODO +call s:hi('Question', [179, 88], ['', '']) + +" Search hit bottom +call s:hi('WarningMsg', [179, 88], ['', '']) + +" Sign column +call s:hi('SignColumn', [173, 173], [s:dark_bg, s:light_bg]) + +" Diff +call s:hi('diffAdded', [108, 65], ['', '']) +call s:hi('diffRemoved', [174, 131], ['', '']) +hi link diffLine Constant + +call s:hi('Conceal', [s:dark_fg + 2, s:light_fg - 2], [s:dark_bg - 1, s:light_bg + 2]) +call s:hi('Ignore', [s:dark_bg + 3, s:light_bg - 3], [s:dark_bg, s:light_bg]) + +""""""""""""""""""""""""""""""""""""""""""""""""" +" Plugins +""""""""""""""""""""""""""""""""""""""""""""""""" + +" vim-indent-guides +" ----------------- +let g:indent_guides_auto_colors = 0 +call s:hi('IndentGuidesOdd', ['', ''], [s:dark_bg - 1, s:light_bg + 1]) +call s:hi('IndentGuidesEven', ['', ''], [s:dark_bg + 1, s:light_bg - 1]) + +" vim-gitgutter +" ------------- +call s:hi('GitGutterAdd', [108, 65], [s:dark_bg + 1, s:light_bg - 2]) +call s:hi('GitGutterChange', [68, 68], [s:dark_bg + 1, s:light_bg - 2]) +call s:hi('GitGutterDelete', [161, 161], [s:dark_bg + 1, s:light_bg - 2]) +call s:hi('GitGutterChangeDelete', [168, 168], [s:dark_bg + 1, s:light_bg - 2]) + +" ale +" --- +call s:hi('ALEErrorSign', [161, 161], [s:dark_bg, s:light_bg]) +call s:hi('ALEWarningSign', [174, 131], [s:dark_bg, s:light_bg]) + +" vim-signify +" ----------- +call s:hi('SignifySignAdd', [108, 65], [s:dark_bg + 1, s:light_bg - 2]) +call s:hi('SignifySignChange', [68, 68], [s:dark_bg + 1, s:light_bg - 2]) +call s:hi('SignifySignDelete', [161, 161], [s:dark_bg + 1, s:light_bg - 2]) + +" coc.nvim +" -------- +call s:hi('CocFloating', [s:dark_fg, s:light_fg], [s:dark_bg_2, s:light_bg - 2]) + +" http://vim.wikia.com/wiki/Highlight_unwanted_spaces +" ---------------------------------------------------^^^^^ +call s:hi('ExtraWhitespace', ['', ''], [s:dark_bg - 1, s:light_bg - 2]) + +" vim-ruby +" -------- +" " rubySymbol +let ruby_operators = 1 +call s:hi('rubyClass', [31, 31], ['', '']) +" call s:hi('rubyInstanceVariable', [189, 189], ['', '']) +call s:hi('rubyRegexp', [186, 101], ['', '']) +call s:hi('rubyRegexpDelimiter', [168, 168], ['', '']) +call s:hi('rubyArrayDelimiter', [67, 38], ['', '']) +call s:hi('rubyBlockParameterList', [186, 94], ['', '']) +call s:hi('rubyCurlyBlockDelimiter', [144, 101], ['', '']) + +" ARGV $stdout +call s:hi('rubyPredefinedIdentifier', [230, 52], ['', '']) +" hi rubyRegexpSpecial + +" semshi (python) +" ------ +call s:hi('semshiLocal', [209, 209], ['', '']) +call s:hi('semshiGlobal', [179, 179], ['', '']) " guifg=#ffaf00 +call s:hi('semshiImported', [179, 179], ['', '']) " guifg=#ffaf00 cterm=bold gui=bold +call s:hi('semshiParameter', [116, 116], ['', '']) " guifg=#5fafff +call s:hi('semshiParameterUnused', [217, 217], ['', '']) " guifg=#87d7ff cterm=underline gui=underline +call s:hi('semshiFree', [218, 218], ['', '']) " guifg=#ffafd7 +call s:hi('semshiBuiltin', [217, 217], ['', '']) " guifg=#ff5fff +call s:hi('semshiAttribute', [189, 189], ['', '']) " guifg=#00ffaf +call s:hi('semshiSelf', [249, 249], ['', '']) " guifg=#b2b2b2 +call s:hi('semshiUnresolved', [226, 226], ['', '']) " guifg=#ffff00 cterm=underline gui=underline +call s:hi('semshiSelected', [231, 231], [95, 95]) " guifg=#ffffff ctermbg=161 guibg=#d7005f + +call s:hi('semshiErrorSign', [161, 161], [s:dark_bg, s:light_bg]) " guifg=#ffffff ctermbg=160 guibg=#d70000 +call s:hi('semshiErrorChar', [161, 161], [s:dark_bg, s:light_bg]) " guifg=#ffffff ctermbg=160 guibg=#d70000 + +let g:seoul256_current_fg = [s:dark_fg, s:light_fg][s:style_idx] +let g:seoul256_current_bg = [s:dark_bg, s:light_bg][s:style_idx] +let g:colors_name = 'seoul256' +if s:colors_name != g:colors_name || s:background == s:style + let &background = s:style +else + let &background = s:background +endif diff --git a/.zshrc b/.zshrc index 71d5ef2..cc75d2c 100644 --- a/.zshrc +++ b/.zshrc @@ -10,6 +10,16 @@ zplug check --verbose || zplug install zplug load +autoload -Uz compinit && compinit + +export HISTFILESIZE=1000000000 +export HISTSIZE=1000000000 +export SAVEHIST=1000000000 +export HISTFILE=~/.zsh_history +setopt HIST_FIND_NO_DUPS +setopt share_history +setopt inc_append_history + # homebrew : brew installed python # export PATH=/usr/local/bin:/usr/local/share/python:$PATH @@ -33,6 +43,7 @@ export PATH=$PATH:$HOME/bin # Add language servers to path export PATH=$PATH:$HOME/tools/lua-language-server/bin/macOS export PATH=$PATH:$HOME/.cargo/bin +export PATH=$PATH:$GOPATH/bin # Bind some convience keys for navigating shell commands