From 74b8224b4535dcfea16355a228b15873a5b417d4 Mon Sep 17 00:00:00 2001 From: spinach <19keegandeppe@gmail.com> Date: Wed, 5 Apr 2023 12:58:08 -0400 Subject: [PATCH] base level copying, need to add git sub mods --- config/colors/hybrid.vim | 453 +++++++++++++++++++++++++++++ config/init.lua | 48 +++ config/lua/calcurse.lua | 7 + config/lua/due_nvim.lua | 325 +++++++++++++++++++++ config/lua/fuzzy.lua | 11 + config/lua/i3conf.lua | 6 + config/lua/keymap.lua | 38 +++ config/lua/plugins.lua | 13 + config/lua/transparent.lua | 9 + config/lua/tree.lua | 40 +++ config/spell/en.utf-8.add | 15 + config/spell/en.utf-8.add.spl | Bin 0 -> 261 bytes mac-config/colors/hybrid.vim | 453 +++++++++++++++++++++++++++++ mac-config/init.lua | 40 +++ mac-config/lua/calcurse.lua | 7 + mac-config/lua/keymap.lua | 24 ++ mac-config/lua/plugins.lua | 12 + mac-config/lua/transparent.lua | 9 + mac-config/lua/tree.lua | 40 +++ site/after/ftplugin/go.lua | 8 + site/after/ftplugin/markdown.lua | 27 ++ site/after/ftplugin/typescript.lua | 2 + 22 files changed, 1587 insertions(+) create mode 100644 config/colors/hybrid.vim create mode 100644 config/init.lua create mode 100644 config/lua/calcurse.lua create mode 100644 config/lua/due_nvim.lua create mode 100644 config/lua/fuzzy.lua create mode 100644 config/lua/i3conf.lua create mode 100644 config/lua/keymap.lua create mode 100644 config/lua/plugins.lua create mode 100644 config/lua/transparent.lua create mode 100644 config/lua/tree.lua create mode 100644 config/spell/en.utf-8.add create mode 100644 config/spell/en.utf-8.add.spl create mode 100644 mac-config/colors/hybrid.vim create mode 100644 mac-config/init.lua create mode 100644 mac-config/lua/calcurse.lua create mode 100644 mac-config/lua/keymap.lua create mode 100644 mac-config/lua/plugins.lua create mode 100644 mac-config/lua/transparent.lua create mode 100644 mac-config/lua/tree.lua create mode 100644 site/after/ftplugin/go.lua create mode 100644 site/after/ftplugin/markdown.lua create mode 100644 site/after/ftplugin/typescript.lua diff --git a/config/colors/hybrid.vim b/config/colors/hybrid.vim new file mode 100644 index 0000000..a89d0e8 --- /dev/null +++ b/config/colors/hybrid.vim @@ -0,0 +1,453 @@ +" File: hybrid.vim +" Maintainer: Andrew Wong (w0ng) +" URL: https://github.com/w0ng/vim-hybrid +" Modified: 27 Jan 2013 07:33 AM AEST +" License: MIT + +" Description:"{{{ +" ---------------------------------------------------------------------------- +" The default RGB colour palette is taken from Tomorrow-Night.vim: +" https://github.com/chriskempson/vim-tomorrow-theme +" +" The reduced RGB colour palette is taken from Codecademy's online editor: +" https://www.codecademy.com/learn +" +" The syntax highlighting scheme is taken from jellybeans.vim: +" https://github.com/nanotech/jellybeans.vim +" +" The is code taken from solarized.vim: +" https://github.com/altercation/vim-colors-solarized + +"}}} +" Requirements And Recommendations:"{{{ +" ---------------------------------------------------------------------------- +" Requirements +" - gVim 7.3+ on Linux, Mac and Windows. +" - Vim 7.3+ on Linux and Mac, using a terminal that supports 256 colours. +" +" Due to the limited 256 palette, colours in Vim and gVim will still be slightly +" different. +" +" In order to have Vim use the same colours as gVim (the way this colour scheme +" is intended), it is recommended that you define the basic 16 colours in your +" terminal. +" +" For Linux users (rxvt-unicode, xterm): +" +" 1. Add the default palette to ~/.Xresources: +" +" https://gist.github.com/3278077 +" +" or alternatively, add the reduced contrast palette to ~/.Xresources: +" +" https://gist.github.com/w0ng/16e33902508b4a0350ae +" +" 2. Add to ~/.vimrc: +" +" let g:hybrid_custom_term_colors = 1 +" let g:hybrid_reduced_contrast = 1 " Remove this line if using the default palette. +" colorscheme hybrid +" +" For OSX users (iTerm): +" +" 1. Import the default colour preset into iTerm: +" +" https://raw.githubusercontent.com/w0ng/dotfiles/master/iterm2/hybrid.itermcolors +" +" or alternatively, import the reduced contrast color preset into iTerm: +" +" https://raw.githubusercontent.com/w0ng/dotfiles/master/iterm2/hybrid-reduced-contrast.itermcolors +" +" 2. Add to ~/.vimrc: +" +" let g:hybrid_custom_term_colors = 1 +" let g:hybrid_reduced_contrast = 1 " Remove this line if using the default palette. +" colorscheme hybrid + +"}}} +" Initialisation:"{{{ +" ---------------------------------------------------------------------------- + +hi clear + +if exists("syntax_on") + syntax reset +endif + +let s:style = &background + +let g:colors_name = "hybrid" + +"}}} +" GUI And Cterm Palettes:"{{{ +" ---------------------------------------------------------------------------- + +let s:palette = {'gui' : {} , 'cterm' : {}} + +if exists("g:hybrid_reduced_contrast") && g:hybrid_reduced_contrast == 1 + let s:gui_background = "#232c31" + let s:gui_selection = "#425059" + let s:gui_line = "#2d3c46" + let s:gui_comment = "#6c7a80" +else + let s:gui_background = "#1d1f21" + let s:gui_selection = "#373b41" + let s:gui_line = "#282a2e" + let s:gui_comment = "#707880" +endif + +let s:palette.gui.background = { 'dark' : s:gui_background , 'light' : "#e4e4e4" } +let s:palette.gui.foreground = { 'dark' : "#c5c8c6" , 'light' : "#000000" } +let s:palette.gui.selection = { 'dark' : s:gui_selection , 'light' : "#bcbcbc" } +let s:palette.gui.line = { 'dark' : s:gui_line , 'light' : "#d0d0d0" } +let s:palette.gui.comment = { 'dark' : s:gui_comment , 'light' : "#5f5f5f" } +let s:palette.gui.red = { 'dark' : "#cc6666" , 'light' : "#5f0000" } +let s:palette.gui.orange = { 'dark' : "#de935f" , 'light' : "#875f00" } +let s:palette.gui.yellow = { 'dark' : "#f0c674" , 'light' : "#5f5f00" } +let s:palette.gui.green = { 'dark' : "#b5bd68" , 'light' : "#005f00" } +let s:palette.gui.aqua = { 'dark' : "#8abeb7" , 'light' : "#005f5f" } +let s:palette.gui.blue = { 'dark' : "#81a2be" , 'light' : "#00005f" } +let s:palette.gui.purple = { 'dark' : "#b294bb" , 'light' : "#5f005f" } +let s:palette.gui.window = { 'dark' : "#303030" , 'light' : "#9e9e9e" } +let s:palette.gui.darkcolumn = { 'dark' : "#1c1c1c" , 'light' : "#808080" } +let s:palette.gui.addbg = { 'dark' : "#5F875F" , 'light' : "#d7ffd7" } +let s:palette.gui.addfg = { 'dark' : "#d7ffaf" , 'light' : "#005f00" } +let s:palette.gui.changebg = { 'dark' : "#5F5F87" , 'light' : "#d7d7ff" } +let s:palette.gui.changefg = { 'dark' : "#d7d7ff" , 'light' : "#5f005f" } +let s:palette.gui.delbg = { 'dark' : "#cc6666" , 'light' : "#ffd7d7" } +let s:palette.gui.darkblue = { 'dark' : "#00005f" , 'light' : "#d7ffd7" } +let s:palette.gui.darkcyan = { 'dark' : "#005f5f" , 'light' : "#005f00" } +let s:palette.gui.darkred = { 'dark' : "#5f0000" , 'light' : "#d7d7ff" } +let s:palette.gui.darkpurple = { 'dark' : "#5f005f" , 'light' : "#5f005f" } + +if exists("g:hybrid_custom_term_colors") && g:hybrid_custom_term_colors == 1 + let s:cterm_foreground = "15" " White + let s:cterm_selection = "8" " DarkGrey + let s:cterm_line = "0" " Black + let s:cterm_comment = "7" " LightGrey + let s:cterm_red = "9" " LightRed + let s:cterm_orange = "3" " DarkYellow + let s:cterm_yellow = "11" " LightYellow + let s:cterm_green = "10" " LightGreen + let s:cterm_aqua = "14" " LightCyan + let s:cterm_blue = "12" " LightBlue + let s:cterm_purple = "13" " LightMagenta + let s:cterm_delbg = "9" " LightRed +else + let s:cterm_foreground = "250" + let s:cterm_selection = "237" + let s:cterm_line = "235" + let s:cterm_comment = "243" + let s:cterm_red = "167" + let s:cterm_orange = "173" + let s:cterm_yellow = "221" + let s:cterm_green = "143" + let s:cterm_aqua = "109" + let s:cterm_blue = "110" + let s:cterm_purple = "139" + let s:cterm_delbg = "167" +endif + +let s:palette.cterm.background = { 'dark' : "234" , 'light' : "254" } +let s:palette.cterm.foreground = { 'dark' : s:cterm_foreground , 'light' : "16" } +let s:palette.cterm.window = { 'dark' : "236" , 'light' : "247" } +let s:palette.cterm.selection = { 'dark' : s:cterm_selection , 'light' : "250" } +let s:palette.cterm.line = { 'dark' : s:cterm_line , 'light' : "252" } +let s:palette.cterm.comment = { 'dark' : s:cterm_comment , 'light' : "59" } +let s:palette.cterm.red = { 'dark' : s:cterm_red , 'light' : "52" } +let s:palette.cterm.orange = { 'dark' : s:cterm_orange , 'light' : "94" } +let s:palette.cterm.yellow = { 'dark' : s:cterm_yellow , 'light' : "58" } +let s:palette.cterm.green = { 'dark' : s:cterm_green , 'light' : "22" } +let s:palette.cterm.aqua = { 'dark' : s:cterm_aqua , 'light' : "23" } +let s:palette.cterm.blue = { 'dark' : s:cterm_blue , 'light' : "17" } +let s:palette.cterm.purple = { 'dark' : s:cterm_purple , 'light' : "53" } +let s:palette.cterm.darkcolumn = { 'dark' : "234" , 'light' : "244" } +let s:palette.cterm.addbg = { 'dark' : "65" , 'light' : "194" } +let s:palette.cterm.addfg = { 'dark' : "193" , 'light' : "22" } +let s:palette.cterm.changebg = { 'dark' : "60" , 'light' : "189" } +let s:palette.cterm.changefg = { 'dark' : "189" , 'light' : "53" } +let s:palette.cterm.delbg = { 'dark' : s:cterm_delbg , 'light' : "224" } +let s:palette.cterm.darkblue = { 'dark' : "17" , 'light' : "194" } +let s:palette.cterm.darkcyan = { 'dark' : "24" , 'light' : "22" } +let s:palette.cterm.darkred = { 'dark' : "52" , 'light' : "189" } +let s:palette.cterm.darkpurple = { 'dark' : "53" , 'light' : "53" } + +"}}} +" Formatting Options:"{{{ +" ---------------------------------------------------------------------------- +let s:none = "NONE" +let s:t_none = "NONE" +let s:n = "NONE" +let s:c = ",undercurl" +let s:r = ",reverse" +let s:s = ",standout" +let s:b = ",bold" +let s:u = ",underline" +let s:i = ",italic" + +"}}} +" Highlighting Primitives:"{{{ +" ---------------------------------------------------------------------------- +function! s:build_prim(hi_elem, field) + " Given a:hi_elem = bg, a:field = comment + let l:vname = "s:" . a:hi_elem . "_" . a:field " s:bg_comment + let l:gui_assign = "gui".a:hi_elem."=".s:palette.gui[a:field][s:style] " guibg=... + let l:cterm_assign = "cterm".a:hi_elem."=".s:palette.cterm[a:field][s:style] " ctermbg=... + exe "let " . l:vname . " = ' " . l:gui_assign . " " . l:cterm_assign . "'" +endfunction + +let s:bg_none = ' guibg=NONE ctermbg=NONE' +call s:build_prim('bg', 'foreground') +call s:build_prim('bg', 'background') +call s:build_prim('bg', 'selection') +call s:build_prim('bg', 'line') +call s:build_prim('bg', 'comment') +call s:build_prim('bg', 'red') +call s:build_prim('bg', 'orange') +call s:build_prim('bg', 'yellow') +call s:build_prim('bg', 'green') +call s:build_prim('bg', 'aqua') +call s:build_prim('bg', 'blue') +call s:build_prim('bg', 'purple') +call s:build_prim('bg', 'window') +call s:build_prim('bg', 'darkcolumn') +call s:build_prim('bg', 'addbg') +call s:build_prim('bg', 'addfg') +call s:build_prim('bg', 'changebg') +call s:build_prim('bg', 'changefg') +call s:build_prim('bg', 'delbg') +call s:build_prim('bg', 'darkblue') +call s:build_prim('bg', 'darkcyan') +call s:build_prim('bg', 'darkred') +call s:build_prim('bg', 'darkpurple') + +let s:fg_none = ' guifg=NONE ctermfg=NONE' +call s:build_prim('fg', 'foreground') +call s:build_prim('fg', 'background') +call s:build_prim('fg', 'selection') +call s:build_prim('fg', 'line') +call s:build_prim('fg', 'comment') +call s:build_prim('fg', 'red') +call s:build_prim('fg', 'orange') +call s:build_prim('fg', 'yellow') +call s:build_prim('fg', 'green') +call s:build_prim('fg', 'aqua') +call s:build_prim('fg', 'blue') +call s:build_prim('fg', 'purple') +call s:build_prim('fg', 'window') +call s:build_prim('fg', 'darkcolumn') +call s:build_prim('fg', 'addbg') +call s:build_prim('fg', 'addfg') +call s:build_prim('fg', 'changebg') +call s:build_prim('fg', 'changefg') +call s:build_prim('fg', 'darkblue') +call s:build_prim('fg', 'darkcyan') +call s:build_prim('fg', 'darkred') +call s:build_prim('fg', 'darkpurple') + +exe "let s:fmt_none = ' gui=NONE". " cterm=NONE". " term=NONE" ."'" +exe "let s:fmt_bold = ' gui=NONE".s:b. " cterm=NONE".s:b. " term=NONE".s:b ."'" +exe "let s:fmt_bldi = ' gui=NONE".s:b. " cterm=NONE".s:b. " term=NONE".s:b ."'" +exe "let s:fmt_undr = ' gui=NONE".s:u. " cterm=NONE".s:u. " term=NONE".s:u ."'" +exe "let s:fmt_undb = ' gui=NONE".s:u.s:b. " cterm=NONE".s:u.s:b. " term=NONE".s:u.s:b."'" +exe "let s:fmt_undi = ' gui=NONE".s:u. " cterm=NONE".s:u. " term=NONE".s:u ."'" +exe "let s:fmt_curl = ' gui=NONE".s:c. " cterm=NONE".s:c. " term=NONE".s:c ."'" +exe "let s:fmt_ital = ' gui=NONE".s:i. " cterm=NONE".s:i. " term=NONE".s:i ."'" +exe "let s:fmt_stnd = ' gui=NONE".s:s. " cterm=NONE".s:s. " term=NONE".s:s ."'" +exe "let s:fmt_revr = ' gui=NONE".s:r. " cterm=NONE".s:r. " term=NONE".s:r ."'" +exe "let s:fmt_revb = ' gui=NONE".s:r.s:b. " cterm=NONE".s:r.s:b. " term=NONE".s:r.s:b."'" + +exe "let s:sp_none = ' guisp=". s:none ."'" +exe "let s:sp_foreground = ' guisp=". s:palette.gui.foreground[s:style] ."'" +exe "let s:sp_background = ' guisp=". s:palette.gui.background[s:style] ."'" +exe "let s:sp_selection = ' guisp=". s:palette.gui.selection[s:style] ."'" +exe "let s:sp_line = ' guisp=". s:palette.gui.line[s:style] ."'" +exe "let s:sp_comment = ' guisp=". s:palette.gui.comment[s:style] ."'" +exe "let s:sp_red = ' guisp=". s:palette.gui.red[s:style] ."'" +exe "let s:sp_orange = ' guisp=". s:palette.gui.orange[s:style] ."'" +exe "let s:sp_yellow = ' guisp=". s:palette.gui.yellow[s:style] ."'" +exe "let s:sp_green = ' guisp=". s:palette.gui.green[s:style] ."'" +exe "let s:sp_aqua = ' guisp=". s:palette.gui.aqua[s:style] ."'" +exe "let s:sp_blue = ' guisp=". s:palette.gui.blue[s:style] ."'" +exe "let s:sp_purple = ' guisp=". s:palette.gui.purple[s:style] ."'" +exe "let s:sp_window = ' guisp=". s:palette.gui.window[s:style] ."'" +exe "let s:sp_addbg = ' guisp=". s:palette.gui.addbg[s:style] ."'" +exe "let s:sp_addfg = ' guisp=". s:palette.gui.addfg[s:style] ."'" +exe "let s:sp_changebg = ' guisp=". s:palette.gui.changebg[s:style] ."'" +exe "let s:sp_changefg = ' guisp=". s:palette.gui.changefg[s:style] ."'" +exe "let s:sp_darkblue = ' guisp=". s:palette.gui.darkblue[s:style] ."'" +exe "let s:sp_darkcyan = ' guisp=". s:palette.gui.darkcyan[s:style] ."'" +exe "let s:sp_darkred = ' guisp=". s:palette.gui.darkred[s:style] ."'" +exe "let s:sp_darkpurple = ' guisp=". s:palette.gui.darkpurple[s:style] ."'" + +"}}} +" Vim Highlighting: (see :help highlight-groups)"{{{ +" ---------------------------------------------------------------------------- +exe "hi! ColorColumn" .s:fg_none .s:bg_line .s:fmt_none +" Conceal" +" Cursor" +" CursorIM" +exe "hi! CursorColumn" .s:fg_none .s:bg_line .s:fmt_none +exe "hi! CursorLine" .s:fg_none .s:bg_none .s:fmt_none +exe "hi! Directory" .s:fg_blue .s:bg_none .s:fmt_none +exe "hi! DiffAdd" .s:fg_addfg .s:bg_addbg .s:fmt_none +exe "hi! DiffChange" .s:fg_changefg .s:bg_changebg .s:fmt_none +exe "hi! DiffDelete" .s:fg_background .s:bg_delbg .s:fmt_none +exe "hi! DiffText" .s:fg_background .s:bg_blue .s:fmt_none +exe "hi! ErrorMsg" .s:fg_background .s:bg_red .s:fmt_stnd +exe "hi! VertSplit" .s:fg_window .s:bg_none .s:fmt_none +exe "hi! Folded" .s:fg_comment .s:bg_darkcolumn .s:fmt_none +exe "hi! FoldColumn" .s:fg_none .s:bg_darkcolumn .s:fmt_none +exe "hi! SignColumn" .s:fg_none .s:bg_darkcolumn .s:fmt_none +" Incsearch" +exe "hi! LineNr" .s:fg_comment .s:bg_none .s:fmt_none +exe "hi! CursorLineNr" .s:fg_yellow .s:bg_none .s:fmt_none +exe "hi! MatchParen" .s:fg_background .s:bg_changebg .s:fmt_none +exe "hi! ModeMsg" .s:fg_green .s:bg_none .s:fmt_none +exe "hi! MoreMsg" .s:fg_green .s:bg_none .s:fmt_none +exe "hi! NonText" .s:fg_selection .s:bg_none .s:fmt_none +exe "hi! Pmenu" .s:fg_foreground .s:bg_selection .s:fmt_none +exe "hi! PmenuSel" .s:fg_foreground .s:bg_selection .s:fmt_revr +" PmenuSbar" +" PmenuThumb" +exe "hi! Question" .s:fg_green .s:bg_none .s:fmt_none +exe "hi! Search" .s:fg_background .s:bg_yellow .s:fmt_none +exe "hi! SpecialKey" .s:fg_selection .s:bg_none .s:fmt_none +exe "hi! SpellCap" .s:fg_blue .s:bg_darkblue .s:fmt_undr +exe "hi! SpellLocal" .s:fg_aqua .s:bg_darkcyan .s:fmt_undr +exe "hi! SpellBad" .s:fg_red .s:bg_darkred .s:fmt_undr +exe "hi! SpellRare" .s:fg_purple .s:bg_darkpurple .s:fmt_undr +exe "hi! StatusLine" .s:fg_comment .s:bg_background .s:fmt_revr +exe "hi! StatusLineNC" .s:fg_window .s:bg_comment .s:fmt_revr +exe "hi! TabLine" .s:fg_foreground .s:bg_darkcolumn .s:fmt_revr +" TabLineFill" +" TabLineSel" +exe "hi! Title" .s:fg_yellow .s:bg_none .s:fmt_none +exe "hi! Visual" .s:fg_none .s:bg_selection .s:fmt_none +" VisualNos" +exe "hi! WarningMsg" .s:fg_red .s:bg_none .s:fmt_none +" FIXME LongLineWarning to use variables instead of hardcoding +hi LongLineWarning guifg=NONE guibg=#371F1C gui=underline ctermfg=NONE ctermbg=NONE cterm=underline +" WildMenu" + +" Use defined custom background colour for terminal Vim. +if !has('gui_running') && exists("g:hybrid_custom_term_colors") && g:hybrid_custom_term_colors == 1 + let s:bg_normal = s:bg_none +else + let s:bg_normal = s:bg_background +endif +exe "hi! Normal" .s:fg_foreground .s:bg_normal .s:fmt_none + +"}}} +" Generic Syntax Highlighting: (see :help group-name)"{{{ +" ---------------------------------------------------------------------------- +exe "hi! Comment" .s:fg_comment .s:bg_none .s:fmt_none + +exe "hi! Constant" .s:fg_red .s:bg_none .s:fmt_none +exe "hi! String" .s:fg_green .s:bg_none .s:fmt_none +" Character" +" Number" +" Boolean" +" Float" + +exe "hi! Identifier" .s:fg_purple .s:bg_none .s:fmt_none +exe "hi! Function" .s:fg_yellow .s:bg_none .s:fmt_none + +exe "hi! Statement" .s:fg_blue .s:bg_none .s:fmt_none +" Conditional" +" Repeat" +" Label" +exe "hi! Operator" .s:fg_aqua .s:bg_none .s:fmt_none +" Keyword" +" Exception" + +exe "hi! PreProc" .s:fg_aqua .s:bg_none .s:fmt_none +" Include" +" Define" +" Macro" +" PreCondit" + +exe "hi! Type" .s:fg_orange .s:bg_none .s:fmt_none +" StorageClass" +exe "hi! Structure" .s:fg_aqua .s:bg_none .s:fmt_none +" Typedef" + +exe "hi! Special" .s:fg_green .s:bg_none .s:fmt_none +" SpecialChar" +" Tag" +" Delimiter" +" SpecialComment" +" Debug" +" +exe "hi! Underlined" .s:fg_blue .s:bg_none .s:fmt_none + +exe "hi! Ignore" .s:fg_none .s:bg_none .s:fmt_none + +exe "hi! Error" .s:fg_red .s:bg_darkred .s:fmt_undr + +exe "hi! Todo" .s:fg_addfg .s:bg_none .s:fmt_none + +" Quickfix window highlighting +exe "hi! qfLineNr" .s:fg_yellow .s:bg_none .s:fmt_none +" qfFileName" +" qfLineNr" +" qfError" + +"}}} +" Diff Syntax Highlighting:"{{{ +" ---------------------------------------------------------------------------- +" Diff +" diffOldFile +" diffNewFile +" diffFile +" diffOnly +" diffIdentical +" diffDiffer +" diffBDiffer +" diffIsA +" diffNoEOL +" diffCommon +hi! link diffRemoved Constant +" diffChanged +hi! link diffAdded Special +" diffLine +" diffSubname +" diffComment + +"}}} +" +" This is needed for some reason: {{{ + +let &background = s:style + +" }}} +" Legal:"{{{ +" ---------------------------------------------------------------------------- +" Copyright (c) 2011 Ethan Schoonover +" Copyright (c) 2009-2012 NanoTech +" Copyright (c) 2012 w0ng +" +" Permission is hereby granted, free of charge, to any per‐ +" son obtaining a copy of this software and associated doc‐ +" umentation files (the “Software”), to deal in the Soft‐ +" ware without restriction, including without limitation +" the rights to use, copy, modify, merge, publish, distrib‐ +" ute, 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 PARTICU‐ +" LAR 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 CON‐ +" TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON‐ +" NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +" THE SOFTWARE. + +" }}} diff --git a/config/init.lua b/config/init.lua new file mode 100644 index 0000000..a4ad24a --- /dev/null +++ b/config/init.lua @@ -0,0 +1,48 @@ +require('keymap') +require('plugins') +require('calcurse') +require('i3conf') + +-- prevent cursor override +vim.cmd('set guicursor=') +-- basic settings +vim.cmd('filetype plugin indent on') +vim.cmd('set ts=4 sts=4 sw=4 expandtab') + +-- hybrid numbering +vim.opt.relativenumber = true +vim.opt.number = true +vim.opt.cursorline = true + +vim.opt.compatible = false + +-- ignores search case unless capital is used +vim.opt.smartcase = true +vim.opt.hlsearch = true + +-- colorscheme and syntax settings +vim.cmd([[ + syntax enable + colorscheme hybrid + hi Normal ctermbg=NONE +]]) + +-- defaults to transparent +transparent = true + +-- timeouts +vim.opt.ttimeout = true +vim.opt.ttimeoutlen = 100 + +-- nvim tree basics + +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 + +-- vimwiki changes +vim.cmd([[ + let g:vimwiki_list = [{'path': '~/vimwiki/', + \ 'syntax': 'markdown', 'ext':'.md'}] +]]) + + diff --git a/config/lua/calcurse.lua b/config/lua/calcurse.lua new file mode 100644 index 0000000..c27546d --- /dev/null +++ b/config/lua/calcurse.lua @@ -0,0 +1,7 @@ +-- calcurse -> markdown +vim.api.nvim_create_autocmd({"BufRead","BufNewFile"}, { + pattern = {"/tmp/calcurse*","~/.local/share/calcurse/notes/*"}, + command = "set filetype=markdown", +}) + + diff --git a/config/lua/due_nvim.lua b/config/lua/due_nvim.lua new file mode 100644 index 0000000..ea40311 --- /dev/null +++ b/config/lua/due_nvim.lua @@ -0,0 +1,325 @@ +local M = {} +_VT_NS = vim.api.nvim_create_namespace("lsp_signature") + +local prescript +local prescript_hi +local due_hi +local ft +local today +local today_hi +local overdue +local overdue_hi +local date_hi +local pattern_start +local pattern_end + +local use_clock_time +local use_clock_today +local use_seconds +local default_due_time + +local user_hour +local user_min +local user_sec + +local date_pattern +local datetime_pattern +local datetime12_pattern +local fulldate_pattern +local fulldatetime_pattern +local fulldatetime12_pattern + +local regex_hi + +local update_rate + +local function patternify(str) + return str:gsub("[%(%)%.%%%+%-%*%?%[%^%$%]]", "%%%1") +end + +local function regexify(str) return str:gsub("\\%^%$%.%*~%[%]&", "\\%1") end + +local function make_pattern(pattern) + return patternify(pattern_start) .. pattern:gsub('%(', ''):gsub('%)', '') .. + patternify(pattern_end) +end + +local function make_pattern_match(pattern) + return patternify(pattern_start) .. pattern .. patternify(pattern_end) +end + +local function parseDue(due) + local year = 31556926 + local month = 2629743 + local week = 604800 + local day = 86400 + local hour = 3600 + local minute = 60 + local res = '' + local is_today = due < day + + if due >= year then + res = res .. math.floor(due / year) .. 'y ' + due = due % year + end + + if due >= month then + res = res .. math.floor(due / month) .. 'm ' + due = due % month + end + + if due >= week then + res = res .. math.floor(due / week) .. 'w ' + due = due % week + end + + if use_clock_time or (is_today and use_clock_today) then + if due >= day then + res = res .. math.floor(due / day) .. 'd ' + due = due % day + end + + if due >= hour then + res = res .. math.floor(due / hour) .. 'h ' + due = due % hour + end + + if due >= minute then + res = res .. math.floor(due / minute) .. 'min ' + due = due % minute + end + + if use_seconds then res = res .. math.floor(due / 1) + 1 .. 's ' end + + else + res = res .. math.floor(due / day) + 1 .. 'd ' + end + + return res +end + +function M.setup(c) + c = c or {} + use_clock_time = c.use_clock_time or false + use_clock_today = c.use_clock_time or false + if type(c.use_seconds) == 'boolean' then + use_seconds = c.use_seconds + else + use_seconds = c.use_clock_time or false + end + update_rate = c.update_rate or + (use_clock_time and (use_seconds and 1000 or 60000) or 0) + default_due_time = c.default_due_time or 'midnight' + prescript = c.prescript or 'due: ' + prescript_hi = c.prescript_hi or 'Comment' + due_hi = c.due_hi or 'String' + ft = c.ft or '*.md' + today = c.today or 'TODAY' + today_hi = c.today_hi or 'Character' + overdue = c.overdue or 'OVERDUE' + overdue_hi = c.overdue_hi or 'Error' + date_hi = c.date_hi or 'Conceal' + week_hi = c.week_hi or 'Question' + pattern_start = c.pattern_start or '<' + pattern_end = c.pattern_end or '>' + date_pattern = c.date_pattern or '(%d%d)%-(%d%d)' + datetime_pattern = c.datetime_pattern or (date_pattern .. ' (%d+):(%d%d)') + datetime12_pattern = c.datetime12_pattern or (datetime_pattern .. ' (%a%a)') + fulldate_pattern = c.fulldate_pattern or ('(%d%d%d%d)%-' .. date_pattern) + fulldatetime_pattern = c.fulldatetime_pattern or + ('(%d%d%d%d)%-' .. datetime_pattern) + fulldatetime12_pattern = c.fulldatetime12_pattern or + (fulldatetime_pattern .. ' (%a%a)') + regex_hi = c.regex_hi or + "\\d*-*\\d\\+-\\d\\+\\( \\d*:\\d*\\( \\a\\a\\)\\?\\)\\?" + + if default_due_time == "midnight" then + user_hour = 23 + user_min = 59 + user_sec = 59 + elseif default_due_time == "noon" then + user_hour = 12 + user_min = 00 + user_sec = 00 + end + + local regex_start = regexify(pattern_start) + local regex_end = regexify(pattern_end) + + local regex_hi_full = '/' .. regex_start .. regex_hi .. regex_end .. '/' + + vim.api.nvim_exec(string.format( + [[ + augroup Due + autocmd! + autocmd BufEnter %s lua require("due_nvim").draw(0) + autocmd BufEnter %s lua require("due_nvim").async_update(0) + autocmd InsertLeave %s lua require("due_nvim").redraw(0) + autocmd TextChanged %s lua require("due_nvim").redraw(0) + autocmd TextChangedI %s lua require("due_nvim").redraw(0) + autocmd BufEnter %s syn match DueDate %s display containedin=mkdNonListItemBlock,mkdListItemLine,mkdBlockquote conceal + autocmd BufEnter %s hi def link DueDate %s + augroup END + ]] , ft, ft, ft, ft, ft, ft, regex_hi_full, ft, date_hi), + false + ) + -- old autcmd + --autocmd BufEnter %s syn match DueDate %s display containedin=mkdNonListItemBlock,mkdListItemLine,mkdBlockquote contained conceal +end + +local function draw_due(due, buf, key) + local parsed + + if due > 0 then + if not (use_clock_time or use_clock_today) and due < 86400 then + parsed = { today, today_hi } + elseif due < 86400 then + parsed = { parseDue(due), today_hi } + elseif due < 604800 then + parsed = { parseDue(due), due_hi } + else + parsed = { parseDue(due), week_hi } + end + else + parsed = { overdue, overdue_hi } + end + + vim.api.nvim_buf_set_virtual_text(buf, _VT_NS, key - 1, + { { prescript, prescript_hi }, parsed }, {}) +end + +function M.draw(buf) + -- get current time + local now = os.time(os.date('*t')) + + -- find which date pattern is being passed in by user + for key, value in pairs(vim.api.nvim_buf_get_lines(buf, 0, -1, {})) do + local fulldatetime12 = value:match(make_pattern(fulldatetime12_pattern)) + if fulldatetime12 then + local year, month, day, hour, min, period = + fulldatetime12:match(make_pattern_match(fulldatetime12_pattern)) + hour = tonumber(hour) + local is_pm = period:lower() == 'pm' + if is_pm and hour < 12 or not is_pm and hour == 12 then + hour = hour + 12 + if hour == 24 then + hour = 0 + end + end + draw_due(os.time({ + year = year, + month = month, + day = day, + hour = hour, + min = min, + sec = user_sec + }) - now, buf, key) + goto continue + end + + local fulldatetime = value:match(make_pattern(fulldatetime_pattern)) + if fulldatetime then + local year, month, day, hour, min = + fulldatetime:match(make_pattern_match(fulldatetime_pattern)) + draw_due(os.time({ + year = year, + month = month, + day = day, + hour = hour, + min = min, + sec = user_sec + }) - now, buf, key) + goto continue + end + + local fulldate = value:match(make_pattern(fulldate_pattern)) + if fulldate then + local year, month, day = fulldate:match(make_pattern_match( + fulldate_pattern)) + draw_due(os.time({ + year = year, + month = month, + day = day, + hour = user_hour, + min = user_min, + sec = user_sec + }) - now, buf, key) + goto continue + end + + local datetime12 = value:match(make_pattern(datetime12_pattern)) + if datetime12 then + local month, day, hour, min, period = + datetime12:match(make_pattern_match(datetime12_pattern)) + local year = os.date("%Y") + hour = tonumber(hour) + local is_pm = period:lower() == 'pm' + if is_pm and hour < 12 or not is_pm and hour == 12 then + hour = hour + 12 + if hour == 24 then + hour = 0 + end + end + draw_due(os.time({ + year = year, + month = month, + day = day, + hour = hour, + min = min, + sec = user_sec + }) - now, buf, key) + goto continue + end + + local datetime = value:match(make_pattern(datetime_pattern)) + if datetime then + local month, day, hour, min = datetime:match(make_pattern_match( + datetime_pattern)) + local year = os.date("%Y") + draw_due(os.time({ + year = year, + month = month, + day = day, + hour = hour, + min = min, + sec = user_sec + }) - now, buf, key) + goto continue + end + + local date = value:match(make_pattern(date_pattern)) + if date then + local month, day = date:match(make_pattern_match(date_pattern)) + local year = os.date("%Y") + + draw_due(os.time({ + year = year, + month = month, + day = day, + hour = user_hour, + min = user_min, + sec = user_sec + }) - now, buf, key) + goto continue + end + ::continue:: + end +end + +function M.clear(buf) vim.api.nvim_buf_clear_namespace(buf, _VT_NS, 0, -1) end + +function M.redraw(buf) + M.clear(buf) + M.draw(buf) +end + +function M.async_update(buf) + if update_rate <= 0 then return end + local timer = vim.loop.new_timer() + timer:start(update_rate, 0, vim.schedule_wrap(function() + M.redraw(buf) + M.async_update(buf) + end)) +end + +return M diff --git a/config/lua/fuzzy.lua b/config/lua/fuzzy.lua new file mode 100644 index 0000000..c9e5477 --- /dev/null +++ b/config/lua/fuzzy.lua @@ -0,0 +1,11 @@ +require('telescope').setup({ + defaults = { + layout_config = { + horizontal = { width = 0.5 } + }, + }, +}) + +local builtin = require('telescope.builtin') +vim.keymap.set('n','f', builtin.find_files, {}) +vim.keymap.set('n','s', builtin.spell_suggest, {}) diff --git a/config/lua/i3conf.lua b/config/lua/i3conf.lua new file mode 100644 index 0000000..dd69d68 --- /dev/null +++ b/config/lua/i3conf.lua @@ -0,0 +1,6 @@ +-- recognize i3 config from dotfiles +-- +vim.api.nvim_create_autocmd({"BufRead","BufNewFile"}, { + pattern = {"*/i3/*.conf"}, + command = "set filetype=i3config", +}) diff --git a/config/lua/keymap.lua b/config/lua/keymap.lua new file mode 100644 index 0000000..947a4ff --- /dev/null +++ b/config/lua/keymap.lua @@ -0,0 +1,38 @@ +require("transparent") + +vim.g.mapleader = " " + +vim.keymap.set("n", "b", ":lua toggleTransparent()") + +-- nvim-tree bindings + +vim.keymap.set("n", "t", ":NvimTreeToggle") + +vim.keymap.set("n", "a", ":lua spellToggle()") + +-- toggle spell check +function spellToggle() + if vim.o.spell == nil or vim.o.spell then + vim.o.spell = false + else + vim.o.spell = true + end +end + +-- markdown preview + +vim.keymap.set("n", "p", ":MarkdownPreviewToggle") + +-- custom shell script to move windows +vim.cmd([[ + function OpenMarkdownPreview (url) + execute "silent ! markdown-preview.sh " . a:url + endfunction +]]) + +vim.g.mkdp_browserfunc = 'OpenMarkdownPreview' + +-- git actions +vim.keymap.set("n", "ga", ":Git add .") +vim.keymap.set("n", "gm", ":Git commit") + diff --git a/config/lua/plugins.lua b/config/lua/plugins.lua new file mode 100644 index 0000000..f093942 --- /dev/null +++ b/config/lua/plugins.lua @@ -0,0 +1,13 @@ +require('tree') +require('fuzzy') + +-- airline settings +if vim.g.airline_symbols == nil then + vim.g.airline_symbols = vim.empty_dict() +end + +vim.g.airline_powerline_fonts = 1 +vim.g.airline_symbols.linenr = '' +vim.g.airline_symbols.maxlinenr = '' +vim.g.airline_symbols.dirty = '' + diff --git a/config/lua/transparent.lua b/config/lua/transparent.lua new file mode 100644 index 0000000..d4ef570 --- /dev/null +++ b/config/lua/transparent.lua @@ -0,0 +1,9 @@ +function toggleTransparent() + transparent = not transparent + if transparent then + vim.cmd("hi Normal ctermbg=NONE") + else + vim.cmd("set background=dark") + vim.cmd("syntax enable") + end +end diff --git a/config/lua/tree.lua b/config/lua/tree.lua new file mode 100644 index 0000000..85e6479 --- /dev/null +++ b/config/lua/tree.lua @@ -0,0 +1,40 @@ +require('nvim-tree').setup({ + open_on_tab = false, + filters = { + dotfiles = true, + }, + actions = { + open_file = { + quit_on_open = true, + }, + }, +}) + +showHiddenFiles = false + +local function open_nvim_tree(data) + + -- buffer is a directory + local directory = vim.fn.isdirectory(data.file) == 1 + + local empty_file = data.file == "" + + if not directory and not empty_file then + return + end + + if directory then + vim.cmd.cd(data.file) + end + vim.cmd.enew() + vim.cmd.bw(data.buf) + -- change to directory and open + require("nvim-tree.api").tree.open() +end + +-- toggle dotfiles visibility +vim.keymap.set("n", "d", ":lua require('nvim-tree.api').tree.toggle_hidden_filter()") + +-- nvim-tree open at startup +vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree, }) + diff --git a/config/spell/en.utf-8.add b/config/spell/en.utf-8.add new file mode 100644 index 0000000..cebfc27 --- /dev/null +++ b/config/spell/en.utf-8.add @@ -0,0 +1,15 @@ +L2 +L3 +Pset +Kalynn +Appt +EPR +S983 +Airpods +swiffer +postlab +TypeScript +ADTs +tradeoffs +nonterminal +righthand diff --git a/config/spell/en.utf-8.add.spl b/config/spell/en.utf-8.add.spl new file mode 100644 index 0000000000000000000000000000000000000000..be02d65568012d8441151e1098fc29df08f64cb7 GIT binary patch literal 261 zcmYjMF%H5o5IYB!uIw=Igm!@ui3L?mRP2QYs3>WbL_*zo310&>7~vA>jE-_G1r3gVOVtA{ zu?ofXfhm!&R!4c#y0jEraU*{tpR&rvte;q=*n;B=k4+YD{76;9wokO?1g>M5eCBiQ aZ^c>UhvsHeVT+0*;hHKs{EIRbiF^UYbT0M) literal 0 HcmV?d00001 diff --git a/mac-config/colors/hybrid.vim b/mac-config/colors/hybrid.vim new file mode 100644 index 0000000..21f020a --- /dev/null +++ b/mac-config/colors/hybrid.vim @@ -0,0 +1,453 @@ +" File: hybrid.vim +" Maintainer: Andrew Wong (w0ng) +" URL: https://github.com/w0ng/vim-hybrid +" Modified: 27 Jan 2013 07:33 AM AEST +" License: MIT + +" Description:"{{{ +" ---------------------------------------------------------------------------- +" The default RGB colour palette is taken from Tomorrow-Night.vim: +" https://github.com/chriskempson/vim-tomorrow-theme +" +" The reduced RGB colour palette is taken from Codecademy's online editor: +" https://www.codecademy.com/learn +" +" The syntax highlighting scheme is taken from jellybeans.vim: +" https://github.com/nanotech/jellybeans.vim +" +" The is code taken from solarized.vim: +" https://github.com/altercation/vim-colors-solarized + +"}}} +" Requirements And Recommendations:"{{{ +" ---------------------------------------------------------------------------- +" Requirements +" - gVim 7.3+ on Linux, Mac and Windows. +" - Vim 7.3+ on Linux and Mac, using a terminal that supports 256 colours. +" +" Due to the limited 256 palette, colours in Vim and gVim will still be slightly +" different. +" +" In order to have Vim use the same colours as gVim (the way this colour scheme +" is intended), it is recommended that you define the basic 16 colours in your +" terminal. +" +" For Linux users (rxvt-unicode, xterm): +" +" 1. Add the default palette to ~/.Xresources: +" +" https://gist.github.com/3278077 +" +" or alternatively, add the reduced contrast palette to ~/.Xresources: +" +" https://gist.github.com/w0ng/16e33902508b4a0350ae +" +" 2. Add to ~/.vimrc: +" +" let g:hybrid_custom_term_colors = 1 +" let g:hybrid_reduced_contrast = 1 " Remove this line if using the default palette. +" colorscheme hybrid +" +" For OSX users (iTerm): +" +" 1. Import the default colour preset into iTerm: +" +" https://raw.githubusercontent.com/w0ng/dotfiles/master/iterm2/hybrid.itermcolors +" +" or alternatively, import the reduced contrast color preset into iTerm: +" +" https://raw.githubusercontent.com/w0ng/dotfiles/master/iterm2/hybrid-reduced-contrast.itermcolors +" +" 2. Add to ~/.vimrc: +" +" let g:hybrid_custom_term_colors = 1 +" let g:hybrid_reduced_contrast = 1 " Remove this line if using the default palette. +" colorscheme hybrid + +"}}} +" Initialisation:"{{{ +" ---------------------------------------------------------------------------- + +hi clear + +if exists("syntax_on") + syntax reset +endif + +let s:style = &background + +let g:colors_name = "hybrid" + +"}}} +" GUI And Cterm Palettes:"{{{ +" ---------------------------------------------------------------------------- + +let s:palette = {'gui' : {} , 'cterm' : {}} + +if exists("g:hybrid_reduced_contrast") && g:hybrid_reduced_contrast == 1 + let s:gui_background = "#232c31" + let s:gui_selection = "#425059" + let s:gui_line = "#2d3c46" + let s:gui_comment = "#6c7a80" +else + let s:gui_background = "#1d1f21" + let s:gui_selection = "#373b41" + let s:gui_line = "#282a2e" + let s:gui_comment = "#707880" +endif + +let s:palette.gui.background = { 'dark' : s:gui_background , 'light' : "#e4e4e4" } +let s:palette.gui.foreground = { 'dark' : "#c5c8c6" , 'light' : "#000000" } +let s:palette.gui.selection = { 'dark' : s:gui_selection , 'light' : "#bcbcbc" } +let s:palette.gui.line = { 'dark' : s:gui_line , 'light' : "#d0d0d0" } +let s:palette.gui.comment = { 'dark' : s:gui_comment , 'light' : "#5f5f5f" } +let s:palette.gui.red = { 'dark' : "#cc6666" , 'light' : "#5f0000" } +let s:palette.gui.orange = { 'dark' : "#de935f" , 'light' : "#875f00" } +let s:palette.gui.yellow = { 'dark' : "#f0c674" , 'light' : "#5f5f00" } +let s:palette.gui.green = { 'dark' : "#b5bd68" , 'light' : "#005f00" } +let s:palette.gui.aqua = { 'dark' : "#8abeb7" , 'light' : "#005f5f" } +let s:palette.gui.blue = { 'dark' : "#81a2be" , 'light' : "#00005f" } +let s:palette.gui.purple = { 'dark' : "#b294bb" , 'light' : "#5f005f" } +let s:palette.gui.window = { 'dark' : "#303030" , 'light' : "#9e9e9e" } +let s:palette.gui.darkcolumn = { 'dark' : "#1c1c1c" , 'light' : "#808080" } +let s:palette.gui.addbg = { 'dark' : "#5F875F" , 'light' : "#d7ffd7" } +let s:palette.gui.addfg = { 'dark' : "#d7ffaf" , 'light' : "#005f00" } +let s:palette.gui.changebg = { 'dark' : "#5F5F87" , 'light' : "#d7d7ff" } +let s:palette.gui.changefg = { 'dark' : "#d7d7ff" , 'light' : "#5f005f" } +let s:palette.gui.delbg = { 'dark' : "#cc6666" , 'light' : "#ffd7d7" } +let s:palette.gui.darkblue = { 'dark' : "#00005f" , 'light' : "#d7ffd7" } +let s:palette.gui.darkcyan = { 'dark' : "#005f5f" , 'light' : "#005f00" } +let s:palette.gui.darkred = { 'dark' : "#5f0000" , 'light' : "#d7d7ff" } +let s:palette.gui.darkpurple = { 'dark' : "#5f005f" , 'light' : "#5f005f" } + +if exists("g:hybrid_custom_term_colors") && g:hybrid_custom_term_colors == 1 + let s:cterm_foreground = "15" " White + let s:cterm_selection = "8" " DarkGrey + let s:cterm_line = "0" " Black + let s:cterm_comment = "7" " LightGrey + let s:cterm_red = "9" " LightRed + let s:cterm_orange = "3" " DarkYellow + let s:cterm_yellow = "11" " LightYellow + let s:cterm_green = "10" " LightGreen + let s:cterm_aqua = "14" " LightCyan + let s:cterm_blue = "12" " LightBlue + let s:cterm_purple = "13" " LightMagenta + let s:cterm_delbg = "9" " LightRed +else + let s:cterm_foreground = "250" + let s:cterm_selection = "237" + let s:cterm_line = "235" + let s:cterm_comment = "243" + let s:cterm_red = "167" + let s:cterm_orange = "173" + let s:cterm_yellow = "221" + let s:cterm_green = "143" + let s:cterm_aqua = "109" + let s:cterm_blue = "110" + let s:cterm_purple = "139" + let s:cterm_delbg = "167" +endif + +let s:palette.cterm.background = { 'dark' : "234" , 'light' : "254" } +let s:palette.cterm.foreground = { 'dark' : s:cterm_foreground , 'light' : "16" } +let s:palette.cterm.window = { 'dark' : "236" , 'light' : "247" } +let s:palette.cterm.selection = { 'dark' : s:cterm_selection , 'light' : "250" } +let s:palette.cterm.line = { 'dark' : s:cterm_line , 'light' : "252" } +let s:palette.cterm.comment = { 'dark' : s:cterm_comment , 'light' : "59" } +let s:palette.cterm.red = { 'dark' : s:cterm_red , 'light' : "52" } +let s:palette.cterm.orange = { 'dark' : s:cterm_orange , 'light' : "94" } +let s:palette.cterm.yellow = { 'dark' : s:cterm_yellow , 'light' : "58" } +let s:palette.cterm.green = { 'dark' : s:cterm_green , 'light' : "22" } +let s:palette.cterm.aqua = { 'dark' : s:cterm_aqua , 'light' : "23" } +let s:palette.cterm.blue = { 'dark' : s:cterm_blue , 'light' : "17" } +let s:palette.cterm.purple = { 'dark' : s:cterm_purple , 'light' : "53" } +let s:palette.cterm.darkcolumn = { 'dark' : "234" , 'light' : "244" } +let s:palette.cterm.addbg = { 'dark' : "65" , 'light' : "194" } +let s:palette.cterm.addfg = { 'dark' : "193" , 'light' : "22" } +let s:palette.cterm.changebg = { 'dark' : "60" , 'light' : "189" } +let s:palette.cterm.changefg = { 'dark' : "189" , 'light' : "53" } +let s:palette.cterm.delbg = { 'dark' : s:cterm_delbg , 'light' : "224" } +let s:palette.cterm.darkblue = { 'dark' : "17" , 'light' : "194" } +let s:palette.cterm.darkcyan = { 'dark' : "24" , 'light' : "22" } +let s:palette.cterm.darkred = { 'dark' : "52" , 'light' : "189" } +let s:palette.cterm.darkpurple = { 'dark' : "53" , 'light' : "53" } + +"}}} +" Formatting Options:"{{{ +" ---------------------------------------------------------------------------- +let s:none = "NONE" +let s:t_none = "NONE" +let s:n = "NONE" +let s:c = ",undercurl" +let s:r = ",reverse" +let s:s = ",standout" +let s:b = ",bold" +let s:u = ",underline" +let s:i = ",italic" + +"}}} +" Highlighting Primitives:"{{{ +" ---------------------------------------------------------------------------- +function! s:build_prim(hi_elem, field) + " Given a:hi_elem = bg, a:field = comment + let l:vname = "s:" . a:hi_elem . "_" . a:field " s:bg_comment + let l:gui_assign = "gui".a:hi_elem."=".s:palette.gui[a:field][s:style] " guibg=... + let l:cterm_assign = "cterm".a:hi_elem."=".s:palette.cterm[a:field][s:style] " ctermbg=... + exe "let " . l:vname . " = ' " . l:gui_assign . " " . l:cterm_assign . "'" +endfunction + +let s:bg_none = ' guibg=NONE ctermbg=NONE' +call s:build_prim('bg', 'foreground') +call s:build_prim('bg', 'background') +call s:build_prim('bg', 'selection') +call s:build_prim('bg', 'line') +call s:build_prim('bg', 'comment') +call s:build_prim('bg', 'red') +call s:build_prim('bg', 'orange') +call s:build_prim('bg', 'yellow') +call s:build_prim('bg', 'green') +call s:build_prim('bg', 'aqua') +call s:build_prim('bg', 'blue') +call s:build_prim('bg', 'purple') +call s:build_prim('bg', 'window') +call s:build_prim('bg', 'darkcolumn') +call s:build_prim('bg', 'addbg') +call s:build_prim('bg', 'addfg') +call s:build_prim('bg', 'changebg') +call s:build_prim('bg', 'changefg') +call s:build_prim('bg', 'delbg') +call s:build_prim('bg', 'darkblue') +call s:build_prim('bg', 'darkcyan') +call s:build_prim('bg', 'darkred') +call s:build_prim('bg', 'darkpurple') + +let s:fg_none = ' guifg=NONE ctermfg=NONE' +call s:build_prim('fg', 'foreground') +call s:build_prim('fg', 'background') +call s:build_prim('fg', 'selection') +call s:build_prim('fg', 'line') +call s:build_prim('fg', 'comment') +call s:build_prim('fg', 'red') +call s:build_prim('fg', 'orange') +call s:build_prim('fg', 'yellow') +call s:build_prim('fg', 'green') +call s:build_prim('fg', 'aqua') +call s:build_prim('fg', 'blue') +call s:build_prim('fg', 'purple') +call s:build_prim('fg', 'window') +call s:build_prim('fg', 'darkcolumn') +call s:build_prim('fg', 'addbg') +call s:build_prim('fg', 'addfg') +call s:build_prim('fg', 'changebg') +call s:build_prim('fg', 'changefg') +call s:build_prim('fg', 'darkblue') +call s:build_prim('fg', 'darkcyan') +call s:build_prim('fg', 'darkred') +call s:build_prim('fg', 'darkpurple') + +exe "let s:fmt_none = ' gui=NONE". " cterm=NONE". " term=NONE" ."'" +exe "let s:fmt_bold = ' gui=NONE".s:b. " cterm=NONE".s:b. " term=NONE".s:b ."'" +exe "let s:fmt_bldi = ' gui=NONE".s:b. " cterm=NONE".s:b. " term=NONE".s:b ."'" +exe "let s:fmt_undr = ' gui=NONE".s:u. " cterm=NONE".s:u. " term=NONE".s:u ."'" +exe "let s:fmt_undb = ' gui=NONE".s:u.s:b. " cterm=NONE".s:u.s:b. " term=NONE".s:u.s:b."'" +exe "let s:fmt_undi = ' gui=NONE".s:u. " cterm=NONE".s:u. " term=NONE".s:u ."'" +exe "let s:fmt_curl = ' gui=NONE".s:c. " cterm=NONE".s:c. " term=NONE".s:c ."'" +exe "let s:fmt_ital = ' gui=NONE".s:i. " cterm=NONE".s:i. " term=NONE".s:i ."'" +exe "let s:fmt_stnd = ' gui=NONE".s:s. " cterm=NONE".s:s. " term=NONE".s:s ."'" +exe "let s:fmt_revr = ' gui=NONE".s:r. " cterm=NONE".s:r. " term=NONE".s:r ."'" +exe "let s:fmt_revb = ' gui=NONE".s:r.s:b. " cterm=NONE".s:r.s:b. " term=NONE".s:r.s:b."'" + +exe "let s:sp_none = ' guisp=". s:none ."'" +exe "let s:sp_foreground = ' guisp=". s:palette.gui.foreground[s:style] ."'" +exe "let s:sp_background = ' guisp=". s:palette.gui.background[s:style] ."'" +exe "let s:sp_selection = ' guisp=". s:palette.gui.selection[s:style] ."'" +exe "let s:sp_line = ' guisp=". s:palette.gui.line[s:style] ."'" +exe "let s:sp_comment = ' guisp=". s:palette.gui.comment[s:style] ."'" +exe "let s:sp_red = ' guisp=". s:palette.gui.red[s:style] ."'" +exe "let s:sp_orange = ' guisp=". s:palette.gui.orange[s:style] ."'" +exe "let s:sp_yellow = ' guisp=". s:palette.gui.yellow[s:style] ."'" +exe "let s:sp_green = ' guisp=". s:palette.gui.green[s:style] ."'" +exe "let s:sp_aqua = ' guisp=". s:palette.gui.aqua[s:style] ."'" +exe "let s:sp_blue = ' guisp=". s:palette.gui.blue[s:style] ."'" +exe "let s:sp_purple = ' guisp=". s:palette.gui.purple[s:style] ."'" +exe "let s:sp_window = ' guisp=". s:palette.gui.window[s:style] ."'" +exe "let s:sp_addbg = ' guisp=". s:palette.gui.addbg[s:style] ."'" +exe "let s:sp_addfg = ' guisp=". s:palette.gui.addfg[s:style] ."'" +exe "let s:sp_changebg = ' guisp=". s:palette.gui.changebg[s:style] ."'" +exe "let s:sp_changefg = ' guisp=". s:palette.gui.changefg[s:style] ."'" +exe "let s:sp_darkblue = ' guisp=". s:palette.gui.darkblue[s:style] ."'" +exe "let s:sp_darkcyan = ' guisp=". s:palette.gui.darkcyan[s:style] ."'" +exe "let s:sp_darkred = ' guisp=". s:palette.gui.darkred[s:style] ."'" +exe "let s:sp_darkpurple = ' guisp=". s:palette.gui.darkpurple[s:style] ."'" + +"}}} +" Vim Highlighting: (see :help highlight-groups)"{{{ +" ---------------------------------------------------------------------------- +exe "hi! ColorColumn" .s:fg_none .s:bg_line .s:fmt_none +" Conceal" +" Cursor" +" CursorIM" +exe "hi! CursorColumn" .s:fg_none .s:bg_line .s:fmt_none +exe "hi! CursorLine" .s:fg_none .s:bg_line .s:fmt_none +exe "hi! Directory" .s:fg_blue .s:bg_none .s:fmt_none +exe "hi! DiffAdd" .s:fg_addfg .s:bg_addbg .s:fmt_none +exe "hi! DiffChange" .s:fg_changefg .s:bg_changebg .s:fmt_none +exe "hi! DiffDelete" .s:fg_background .s:bg_delbg .s:fmt_none +exe "hi! DiffText" .s:fg_background .s:bg_blue .s:fmt_none +exe "hi! ErrorMsg" .s:fg_background .s:bg_red .s:fmt_stnd +exe "hi! VertSplit" .s:fg_window .s:bg_none .s:fmt_none +exe "hi! Folded" .s:fg_comment .s:bg_darkcolumn .s:fmt_none +exe "hi! FoldColumn" .s:fg_none .s:bg_darkcolumn .s:fmt_none +exe "hi! SignColumn" .s:fg_none .s:bg_darkcolumn .s:fmt_none +" Incsearch" +exe "hi! LineNr" .s:fg_selection .s:bg_none .s:fmt_none +exe "hi! CursorLineNr" .s:fg_yellow .s:bg_none .s:fmt_none +exe "hi! MatchParen" .s:fg_background .s:bg_changebg .s:fmt_none +exe "hi! ModeMsg" .s:fg_green .s:bg_none .s:fmt_none +exe "hi! MoreMsg" .s:fg_green .s:bg_none .s:fmt_none +exe "hi! NonText" .s:fg_selection .s:bg_none .s:fmt_none +exe "hi! Pmenu" .s:fg_foreground .s:bg_selection .s:fmt_none +exe "hi! PmenuSel" .s:fg_foreground .s:bg_selection .s:fmt_revr +" PmenuSbar" +" PmenuThumb" +exe "hi! Question" .s:fg_green .s:bg_none .s:fmt_none +exe "hi! Search" .s:fg_background .s:bg_yellow .s:fmt_none +exe "hi! SpecialKey" .s:fg_selection .s:bg_none .s:fmt_none +exe "hi! SpellCap" .s:fg_blue .s:bg_darkblue .s:fmt_undr +exe "hi! SpellLocal" .s:fg_aqua .s:bg_darkcyan .s:fmt_undr +exe "hi! SpellBad" .s:fg_red .s:bg_darkred .s:fmt_undr +exe "hi! SpellRare" .s:fg_purple .s:bg_darkpurple .s:fmt_undr +exe "hi! StatusLine" .s:fg_comment .s:bg_background .s:fmt_revr +exe "hi! StatusLineNC" .s:fg_window .s:bg_comment .s:fmt_revr +exe "hi! TabLine" .s:fg_foreground .s:bg_darkcolumn .s:fmt_revr +" TabLineFill" +" TabLineSel" +exe "hi! Title" .s:fg_yellow .s:bg_none .s:fmt_none +exe "hi! Visual" .s:fg_none .s:bg_selection .s:fmt_none +" VisualNos" +exe "hi! WarningMsg" .s:fg_red .s:bg_none .s:fmt_none +" FIXME LongLineWarning to use variables instead of hardcoding +hi LongLineWarning guifg=NONE guibg=#371F1C gui=underline ctermfg=NONE ctermbg=NONE cterm=underline +" WildMenu" + +" Use defined custom background colour for terminal Vim. +if !has('gui_running') && exists("g:hybrid_custom_term_colors") && g:hybrid_custom_term_colors == 1 + let s:bg_normal = s:bg_none +else + let s:bg_normal = s:bg_background +endif +exe "hi! Normal" .s:fg_foreground .s:bg_normal .s:fmt_none + +"}}} +" Generic Syntax Highlighting: (see :help group-name)"{{{ +" ---------------------------------------------------------------------------- +exe "hi! Comment" .s:fg_comment .s:bg_none .s:fmt_none + +exe "hi! Constant" .s:fg_red .s:bg_none .s:fmt_none +exe "hi! String" .s:fg_green .s:bg_none .s:fmt_none +" Character" +" Number" +" Boolean" +" Float" + +exe "hi! Identifier" .s:fg_purple .s:bg_none .s:fmt_none +exe "hi! Function" .s:fg_yellow .s:bg_none .s:fmt_none + +exe "hi! Statement" .s:fg_blue .s:bg_none .s:fmt_none +" Conditional" +" Repeat" +" Label" +exe "hi! Operator" .s:fg_aqua .s:bg_none .s:fmt_none +" Keyword" +" Exception" + +exe "hi! PreProc" .s:fg_aqua .s:bg_none .s:fmt_none +" Include" +" Define" +" Macro" +" PreCondit" + +exe "hi! Type" .s:fg_orange .s:bg_none .s:fmt_none +" StorageClass" +exe "hi! Structure" .s:fg_aqua .s:bg_none .s:fmt_none +" Typedef" + +exe "hi! Special" .s:fg_green .s:bg_none .s:fmt_none +" SpecialChar" +" Tag" +" Delimiter" +" SpecialComment" +" Debug" +" +exe "hi! Underlined" .s:fg_blue .s:bg_none .s:fmt_none + +exe "hi! Ignore" .s:fg_none .s:bg_none .s:fmt_none + +exe "hi! Error" .s:fg_red .s:bg_darkred .s:fmt_undr + +exe "hi! Todo" .s:fg_addfg .s:bg_none .s:fmt_none + +" Quickfix window highlighting +exe "hi! qfLineNr" .s:fg_yellow .s:bg_none .s:fmt_none +" qfFileName" +" qfLineNr" +" qfError" + +"}}} +" Diff Syntax Highlighting:"{{{ +" ---------------------------------------------------------------------------- +" Diff +" diffOldFile +" diffNewFile +" diffFile +" diffOnly +" diffIdentical +" diffDiffer +" diffBDiffer +" diffIsA +" diffNoEOL +" diffCommon +hi! link diffRemoved Constant +" diffChanged +hi! link diffAdded Special +" diffLine +" diffSubname +" diffComment + +"}}} +" +" This is needed for some reason: {{{ + +let &background = s:style + +" }}} +" Legal:"{{{ +" ---------------------------------------------------------------------------- +" Copyright (c) 2011 Ethan Schoonover +" Copyright (c) 2009-2012 NanoTech +" Copyright (c) 2012 w0ng +" +" Permission is hereby granted, free of charge, to any per‐ +" son obtaining a copy of this software and associated doc‐ +" umentation files (the “Software”), to deal in the Soft‐ +" ware without restriction, including without limitation +" the rights to use, copy, modify, merge, publish, distrib‐ +" ute, 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 PARTICU‐ +" LAR 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 CON‐ +" TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON‐ +" NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +" THE SOFTWARE. + +" }}} diff --git a/mac-config/init.lua b/mac-config/init.lua new file mode 100644 index 0000000..2a6c417 --- /dev/null +++ b/mac-config/init.lua @@ -0,0 +1,40 @@ +require('keymap') +require('plugins') +require('calcurse') + +-- prevent cursor override +vim.cmd('set guicursor=') +-- basic settings +vim.cmd('filetype plugin indent on') +vim.cmd('set ts=4 sts=4 sw=4 expandtab') + +vim.opt.relativenumber = true + +vim.opt.compatible = false + +-- colorscheme and syntax settings +vim.cmd([[ + syntax enable + colorscheme hybrid + hi Normal ctermbg=NONE +]]) + +-- defaults to transparent +transparent = true + +-- timeouts +vim.opt.ttimeout = true +vim.opt.ttimeoutlen = 100 + +-- nvim tree basics + +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 + +-- vimwiki changes +vim.cmd([[ + let g:vimwiki_list = [{'path': '~/vimwiki/', + \ 'syntax': 'markdown', 'ext':'.md'}] +]]) + + diff --git a/mac-config/lua/calcurse.lua b/mac-config/lua/calcurse.lua new file mode 100644 index 0000000..c27546d --- /dev/null +++ b/mac-config/lua/calcurse.lua @@ -0,0 +1,7 @@ +-- calcurse -> markdown +vim.api.nvim_create_autocmd({"BufRead","BufNewFile"}, { + pattern = {"/tmp/calcurse*","~/.local/share/calcurse/notes/*"}, + command = "set filetype=markdown", +}) + + diff --git a/mac-config/lua/keymap.lua b/mac-config/lua/keymap.lua new file mode 100644 index 0000000..b5dc3c8 --- /dev/null +++ b/mac-config/lua/keymap.lua @@ -0,0 +1,24 @@ +require("transparent") + +vim.g.mapleader = " " + +vim.keymap.set("n", "b", ":lua toggleTransparent()") + +-- nvim-tree bindings + +vim.keymap.set("n", "t", ":NvimTreeToggle") + +vim.keymap.set("n", "s", ":lua spellToggle()") + +-- toggle spell check +function spellToggle() + if vim.o.spell == nil or vim.o.spell then + vim.o.spell = false + else + vim.o.spell = true + end +end + +-- markdown preview + +vim.keymap.set("n", "p", ":MarkdownPreviewToggle") diff --git a/mac-config/lua/plugins.lua b/mac-config/lua/plugins.lua new file mode 100644 index 0000000..1dfc555 --- /dev/null +++ b/mac-config/lua/plugins.lua @@ -0,0 +1,12 @@ +require('tree') + +-- airline settings +if vim.g.airline_symbols == nil then + vim.g.airline_symbols = vim.empty_dict() +end + +vim.g.airline_powerline_fonts = 1 +vim.g.airline_symbols.linenr = '' +vim.g.airline_symbols.maxlinenr = '' +vim.g.airline_symbols.dirty = '' + diff --git a/mac-config/lua/transparent.lua b/mac-config/lua/transparent.lua new file mode 100644 index 0000000..d4ef570 --- /dev/null +++ b/mac-config/lua/transparent.lua @@ -0,0 +1,9 @@ +function toggleTransparent() + transparent = not transparent + if transparent then + vim.cmd("hi Normal ctermbg=NONE") + else + vim.cmd("set background=dark") + vim.cmd("syntax enable") + end +end diff --git a/mac-config/lua/tree.lua b/mac-config/lua/tree.lua new file mode 100644 index 0000000..85e6479 --- /dev/null +++ b/mac-config/lua/tree.lua @@ -0,0 +1,40 @@ +require('nvim-tree').setup({ + open_on_tab = false, + filters = { + dotfiles = true, + }, + actions = { + open_file = { + quit_on_open = true, + }, + }, +}) + +showHiddenFiles = false + +local function open_nvim_tree(data) + + -- buffer is a directory + local directory = vim.fn.isdirectory(data.file) == 1 + + local empty_file = data.file == "" + + if not directory and not empty_file then + return + end + + if directory then + vim.cmd.cd(data.file) + end + vim.cmd.enew() + vim.cmd.bw(data.buf) + -- change to directory and open + require("nvim-tree.api").tree.open() +end + +-- toggle dotfiles visibility +vim.keymap.set("n", "d", ":lua require('nvim-tree.api').tree.toggle_hidden_filter()") + +-- nvim-tree open at startup +vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree, }) + diff --git a/site/after/ftplugin/go.lua b/site/after/ftplugin/go.lua new file mode 100644 index 0000000..59c3b62 --- /dev/null +++ b/site/after/ftplugin/go.lua @@ -0,0 +1,8 @@ +vim.cmd('packadd vim-go') + +vim.g.go_hightlight_types = 1 +vim.g.go_hightlight_fields = 1 +vim.g.go_hightlight_functions = 1 +vim.g.go_hightlight_function_calls = 1 +vim.g.go_hightlight_operators = 1 +vim.g.go_hightlight_extra_types = 1 diff --git a/site/after/ftplugin/markdown.lua b/site/after/ftplugin/markdown.lua new file mode 100644 index 0000000..e804bcf --- /dev/null +++ b/site/after/ftplugin/markdown.lua @@ -0,0 +1,27 @@ +-- adding packages +vim.cmd('packadd vim-markdown') +vim.cmd('packadd vimwiki') +-- due date highlighting +require('due_nvim').setup { + ft = '*.md', + date_hi = 'Comment', + week_hi = 'Structure', + + pattern_start = '<', + pattern_end = '>', + + use_clock_time = true, + use_clock_today = true, + use_seconds = false, +} +-- setting spell check +vim.cmd([[ + setlocal spell + setlocal wrap +]]) + +-- markdown plugin settings +vim.opt.conceallevel = 2 +vim.g.vim_markdown_folding_disabled = 1 +vim.g.vim_markdown_math = 1 +vim.g.vim_markdown_strikethrough = 1 diff --git a/site/after/ftplugin/typescript.lua b/site/after/ftplugin/typescript.lua new file mode 100644 index 0000000..5fff3c0 --- /dev/null +++ b/site/after/ftplugin/typescript.lua @@ -0,0 +1,2 @@ +-- adding packages +vim.cmd('packadd vim-typescript')