Browse Source

Initial commit

master
Adam Pippin 2 years ago
commit
29b912d898
  1. 1
      .gitignore
  2. 9
      README.md
  3. 2526
      autoload/plug.vim
  4. 414
      colors/base16-eighties.vim
  5. 517
      doc/nukevim.txt
  6. 42
      doc/tags
  7. 193
      lua/_config.lua
  8. 86
      lua/config/_keymap.lua
  9. 29
      lua/config/_plugins.lua
  10. 61
      lua/config/_settings.lua
  11. 269
      lua/config/plugins/development.lua
  12. 37
      lua/config/plugins/editing.lua
  13. 49
      lua/config/plugins/lang-php.lua
  14. 28
      lua/config/plugins/lib.lua
  15. 8
      lua/config/plugins/local.lua
  16. 13
      lua/config/plugins/tmp.lua
  17. 146
      lua/config/plugins/ui.lua
  18. 13
      lua/data/start.lua
  19. 420
      lua/impatient/impatient.lua
  20. 222
      lua/impatient/profile.lua
  21. 51
      lua/lib/autocmd.lua
  22. 15
      lua/lib/dump.lua
  23. 9
      lua/lib/file_exists.lua
  24. 14
      lua/lib/get_visual_selection.lua
  25. 4
      lua/lib/has_command.lua
  26. 7
      lua/lib/map.lua
  27. 9
      lua/lib/merge.lua
  28. 47
      lua/module.lua
  29. 249
      lua/module/keymap.lua
  30. 27
      lua/module/lsp.lua
  31. 66
      lua/module/phpunit.lua
  32. 88
      lua/module/plugins.lua
  33. 13
      lua/module/settings.lua
  34. 154
      lua/module/start.lua
  35. 14
      lua/module/syntax.lua
  36. 35
      lua/module/ui.lua
  37. 62
      lua/modules.lua
  38. 55
      lua/nukevim.lua
  39. 9
      lua/plugin/akinsho/toggleterm-nvim.lua
  40. 12
      lua/plugin/apzelos/blamer-nvim.lua
  41. 38
      lua/plugin/dein.lua
  42. 11
      lua/plugin/editorconfig/editorconfig-vim.lua
  43. 9
      lua/plugin/folke/todo-comments-nvim.lua
  44. 17
      lua/plugin/folke/trouble-nvim.lua
  45. 12
      lua/plugin/jghauser/shade-nvim.lua
  46. 9
      lua/plugin/joonty/vim-phpunitqf.lua
  47. 10
      lua/plugin/nacro90/numb-nvim.lua
  48. 18
      lua/plugin/preservim/tagbar.lua
  49. 8
      lua/plugin/stevearc/dressing-nvim.lua
  50. 40
      lua/plugin/tpope/vim-fugitive.lua
  51. 9
      lua/plugin/vim-airline/vim-airline.lua
  52. 70
      lua/plugin/vim-vdebug/vdebug.lua
  53. 37
      lua/plugin/vim_plug.lua

1
.gitignore

@ -0,0 +1 @@
/plugins/

9
README.md

@ -0,0 +1,9 @@
# NukeVim -- nucleardog's nvim config
This is my modular-ish and configurable-ish neovim config.
It's not intended to serve anyone's purposes but my own, but the core of it
should be fairly adaptable (if poorly implemented) to anything you want it to
do.
For further information, check out the [vim help file](doc/nukevim.txt).

2526
autoload/plug.vim

File diff suppressed because it is too large

414
colors/base16-eighties.vim

@ -0,0 +1,414 @@
" vi:syntax=vim
" base16-vim (https://github.com/chriskempson/base16-vim)
" by Chris Kempson (http://chriskempson.com)
" Eighties scheme by Chris Kempson (http://chriskempson.com)
" This enables the coresponding base16-shell script to run so that
" :colorscheme works in terminals supported by base16-shell scripts
" User must set this variable in .vimrc
" let g:base16_shell_path=base16-builder/output/shell/
if !has("gui_running")
if exists("g:base16_shell_path")
execute "silent !/bin/sh ".g:base16_shell_path."/base16-eighties.sh"
endif
endif
" GUI color definitions
let s:gui00 = "2d2d2d"
let g:base16_gui00 = "2d2d2d"
let s:gui01 = "393939"
let g:base16_gui01 = "393939"
let s:gui02 = "515151"
let g:base16_gui02 = "515151"
let s:gui03 = "747369"
let g:base16_gui03 = "747369"
let s:gui04 = "a09f93"
let g:base16_gui04 = "a09f93"
let s:gui05 = "d3d0c8"
let g:base16_gui05 = "d3d0c8"
let s:gui06 = "e8e6df"
let g:base16_gui06 = "e8e6df"
let s:gui07 = "f2f0ec"
let g:base16_gui07 = "f2f0ec"
let s:gui08 = "f2777a"
let g:base16_gui08 = "f2777a"
let s:gui09 = "f99157"
let g:base16_gui09 = "f99157"
let s:gui0A = "ffcc66"
let g:base16_gui0A = "ffcc66"
let s:gui0B = "99cc99"
let g:base16_gui0B = "99cc99"
let s:gui0C = "66cccc"
let g:base16_gui0C = "66cccc"
let s:gui0D = "6699cc"
let g:base16_gui0D = "6699cc"
let s:gui0E = "cc99cc"
let g:base16_gui0E = "cc99cc"
let s:gui0F = "d27b53"
let g:base16_gui0F = "d27b53"
" Terminal color definitions
let s:cterm00 = "00"
let g:base16_cterm00 = "00"
let s:cterm03 = "08"
let g:base16_cterm03 = "08"
let s:cterm05 = "07"
let g:base16_cterm05 = "07"
let s:cterm07 = "15"
let g:base16_cterm07 = "15"
let s:cterm08 = "01"
let g:base16_cterm08 = "01"
let s:cterm0A = "03"
let g:base16_cterm0A = "03"
let s:cterm0B = "02"
let g:base16_cterm0B = "02"
let s:cterm0C = "06"
let g:base16_cterm0C = "06"
let s:cterm0D = "04"
let g:base16_cterm0D = "04"
let s:cterm0E = "05"
let g:base16_cterm0E = "05"
if exists("base16colorspace") && base16colorspace == "256"
let s:cterm01 = "18"
let g:base16_cterm01 = "18"
let s:cterm02 = "19"
let g:base16_cterm02 = "19"
let s:cterm04 = "20"
let g:base16_cterm04 = "20"
let s:cterm06 = "21"
let g:base16_cterm06 = "21"
let s:cterm09 = "16"
let g:base16_cterm09 = "16"
let s:cterm0F = "17"
let g:base16_cterm0F = "17"
else
let s:cterm01 = "10"
let g:base16_cterm01 = "10"
let s:cterm02 = "11"
let g:base16_cterm02 = "11"
let s:cterm04 = "12"
let g:base16_cterm04 = "12"
let s:cterm06 = "13"
let g:base16_cterm06 = "13"
let s:cterm09 = "09"
let g:base16_cterm09 = "09"
let s:cterm0F = "14"
let g:base16_cterm0F = "14"
endif
" Neovim terminal colours
if has("nvim")
let g:terminal_color_0 = "#2d2d2d"
let g:terminal_color_1 = "#f2777a"
let g:terminal_color_2 = "#99cc99"
let g:terminal_color_3 = "#ffcc66"
let g:terminal_color_4 = "#6699cc"
let g:terminal_color_5 = "#cc99cc"
let g:terminal_color_6 = "#66cccc"
let g:terminal_color_7 = "#d3d0c8"
let g:terminal_color_8 = "#747369"
let g:terminal_color_9 = "#f2777a"
let g:terminal_color_10 = "#99cc99"
let g:terminal_color_11 = "#ffcc66"
let g:terminal_color_12 = "#6699cc"
let g:terminal_color_13 = "#cc99cc"
let g:terminal_color_14 = "#66cccc"
let g:terminal_color_15 = "#f2f0ec"
let g:terminal_color_background = g:terminal_color_0
let g:terminal_color_foreground = g:terminal_color_5
if &background == "light"
let g:terminal_color_background = g:terminal_color_7
let g:terminal_color_foreground = g:terminal_color_2
endif
elseif has("terminal")
let g:terminal_ansi_colors = [
\ "#2d2d2d",
\ "#f2777a",
\ "#99cc99",
\ "#ffcc66",
\ "#6699cc",
\ "#cc99cc",
\ "#66cccc",
\ "#d3d0c8",
\ "#747369",
\ "#f2777a",
\ "#99cc99",
\ "#ffcc66",
\ "#6699cc",
\ "#cc99cc",
\ "#66cccc",
\ "#f2f0ec",
\ ]
endif
" Theme setup
hi clear
syntax reset
let g:colors_name = "base16-eighties"
" Highlighting function
" Optional variables are attributes and guisp
function! g:Base16hi(group, guifg, guibg, ctermfg, ctermbg, ...)
let l:attr = get(a:, 1, "")
let l:guisp = get(a:, 2, "")
if a:guifg != ""
exec "hi " . a:group . " guifg=#" . a:guifg
endif
if a:guibg != ""
exec "hi " . a:group . " guibg=#" . a:guibg
endif
if a:ctermfg != ""
exec "hi " . a:group . " ctermfg=" . a:ctermfg
endif
if a:ctermbg != ""
exec "hi " . a:group . " ctermbg=" . a:ctermbg
endif
if l:attr != ""
exec "hi " . a:group . " gui=" . l:attr . " cterm=" . l:attr
endif
if l:guisp != ""
exec "hi " . a:group . " guisp=#" . l:guisp
endif
endfunction
fun <sid>hi(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)
call g:Base16hi(a:group, a:guifg, a:guibg, a:ctermfg, a:ctermbg, a:attr, a:guisp)
endfun
" Vim editor colors
call <sid>hi("Normal", s:gui05, s:gui00, s:cterm05, s:cterm00, "", "")
call <sid>hi("Bold", "", "", "", "", "bold", "")
call <sid>hi("Debug", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("Directory", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("Error", s:gui00, s:gui08, s:cterm00, s:cterm08, "", "")
call <sid>hi("ErrorMsg", s:gui08, s:gui00, s:cterm08, s:cterm00, "", "")
call <sid>hi("Exception", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("FoldColumn", s:gui0C, s:gui01, s:cterm0C, s:cterm01, "", "")
call <sid>hi("Folded", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "")
call <sid>hi("IncSearch", s:gui01, s:gui09, s:cterm01, s:cterm09, "none", "")
call <sid>hi("Italic", "", "", "", "", "none", "")
call <sid>hi("Macro", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("MatchParen", "", s:gui03, "", s:cterm03, "", "")
call <sid>hi("ModeMsg", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("MoreMsg", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("Question", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("Search", s:gui01, s:gui0A, s:cterm01, s:cterm0A, "", "")
call <sid>hi("Substitute", s:gui01, s:gui0A, s:cterm01, s:cterm0A, "none", "")
call <sid>hi("SpecialKey", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("TooLong", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("Underlined", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("Visual", "", s:gui02, "", s:cterm02, "", "")
call <sid>hi("VisualNOS", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("WarningMsg", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("WildMenu", s:gui08, s:gui0A, s:cterm08, "", "", "")
call <sid>hi("Title", s:gui0D, "", s:cterm0D, "", "none", "")
call <sid>hi("Conceal", s:gui0D, s:gui00, s:cterm0D, s:cterm00, "", "")
call <sid>hi("Cursor", s:gui00, s:gui05, s:cterm00, s:cterm05, "", "")
call <sid>hi("NonText", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("LineNr", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "")
call <sid>hi("SignColumn", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "")
call <sid>hi("StatusLine", s:gui04, s:gui02, s:cterm04, s:cterm02, "none", "")
call <sid>hi("StatusLineNC", s:gui03, s:gui01, s:cterm03, s:cterm01, "none", "")
call <sid>hi("VertSplit", s:gui02, s:gui02, s:cterm02, s:cterm02, "none", "")
call <sid>hi("ColorColumn", "", s:gui01, "", s:cterm01, "none", "")
call <sid>hi("CursorColumn", "", s:gui01, "", s:cterm01, "none", "")
call <sid>hi("CursorLine", "", s:gui01, "", s:cterm01, "none", "")
call <sid>hi("CursorLineNr", s:gui04, s:gui01, s:cterm04, s:cterm01, "", "")
call <sid>hi("QuickFixLine", "", s:gui01, "", s:cterm01, "none", "")
call <sid>hi("PMenu", s:gui05, s:gui01, s:cterm05, s:cterm01, "none", "")
call <sid>hi("PMenuSel", s:gui01, s:gui05, s:cterm01, s:cterm05, "", "")
call <sid>hi("TabLine", s:gui03, s:gui01, s:cterm03, s:cterm01, "none", "")
call <sid>hi("TabLineFill", s:gui03, s:gui01, s:cterm03, s:cterm01, "none", "")
call <sid>hi("TabLineSel", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "none", "")
" Standard syntax highlighting
call <sid>hi("Boolean", s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("Character", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("Comment", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("Conditional", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("Constant", s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("Define", s:gui0E, "", s:cterm0E, "", "none", "")
call <sid>hi("Delimiter", s:gui0F, "", s:cterm0F, "", "", "")
call <sid>hi("Float", s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("Function", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("Identifier", s:gui08, "", s:cterm08, "", "none", "")
call <sid>hi("Include", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("Keyword", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("Label", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("Number", s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("Operator", s:gui05, "", s:cterm05, "", "none", "")
call <sid>hi("PreProc", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("Repeat", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("Special", s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("SpecialChar", s:gui0F, "", s:cterm0F, "", "", "")
call <sid>hi("Statement", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("StorageClass", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("String", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("Structure", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("Tag", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("Todo", s:gui0A, s:gui01, s:cterm0A, s:cterm01, "", "")
call <sid>hi("Type", s:gui0A, "", s:cterm0A, "", "none", "")
call <sid>hi("Typedef", s:gui0A, "", s:cterm0A, "", "", "")
" C highlighting
call <sid>hi("cOperator", s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("cPreCondit", s:gui0E, "", s:cterm0E, "", "", "")
" C# highlighting
call <sid>hi("csClass", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("csAttribute", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("csModifier", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("csType", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("csUnspecifiedStatement", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("csContextualStatement", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("csNewDecleration", s:gui08, "", s:cterm08, "", "", "")
" CSS highlighting
call <sid>hi("cssBraces", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("cssClassName", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("cssColor", s:gui0C, "", s:cterm0C, "", "", "")
" Diff highlighting
call <sid>hi("DiffAdd", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "", "")
call <sid>hi("DiffChange", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "")
call <sid>hi("DiffDelete", s:gui08, s:gui01, s:cterm08, s:cterm01, "", "")
call <sid>hi("DiffText", s:gui0D, s:gui01, s:cterm0D, s:cterm01, "", "")
call <sid>hi("DiffAdded", s:gui0B, s:gui00, s:cterm0B, s:cterm00, "", "")
call <sid>hi("DiffFile", s:gui08, s:gui00, s:cterm08, s:cterm00, "", "")
call <sid>hi("DiffNewFile", s:gui0B, s:gui00, s:cterm0B, s:cterm00, "", "")
call <sid>hi("DiffLine", s:gui0D, s:gui00, s:cterm0D, s:cterm00, "", "")
call <sid>hi("DiffRemoved", s:gui08, s:gui00, s:cterm08, s:cterm00, "", "")
" Git highlighting
call <sid>hi("gitcommitOverflow", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("gitcommitSummary", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("gitcommitComment", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("gitcommitUntracked", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("gitcommitDiscarded", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("gitcommitSelected", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("gitcommitHeader", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("gitcommitSelectedType", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("gitcommitUnmergedType", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("gitcommitDiscardedType", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("gitcommitBranch", s:gui09, "", s:cterm09, "", "bold", "")
call <sid>hi("gitcommitUntrackedFile", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("gitcommitUnmergedFile", s:gui08, "", s:cterm08, "", "bold", "")
call <sid>hi("gitcommitDiscardedFile", s:gui08, "", s:cterm08, "", "bold", "")
call <sid>hi("gitcommitSelectedFile", s:gui0B, "", s:cterm0B, "", "bold", "")
" GitGutter highlighting
call <sid>hi("GitGutterAdd", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "", "")
call <sid>hi("GitGutterChange", s:gui0D, s:gui01, s:cterm0D, s:cterm01, "", "")
call <sid>hi("GitGutterDelete", s:gui08, s:gui01, s:cterm08, s:cterm01, "", "")
call <sid>hi("GitGutterChangeDelete", s:gui0E, s:gui01, s:cterm0E, s:cterm01, "", "")
" HTML highlighting
call <sid>hi("htmlBold", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("htmlItalic", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("htmlEndTag", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("htmlTag", s:gui05, "", s:cterm05, "", "", "")
" JavaScript highlighting
call <sid>hi("javaScript", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("javaScriptBraces", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("javaScriptNumber", s:gui09, "", s:cterm09, "", "", "")
" pangloss/vim-javascript highlighting
call <sid>hi("jsOperator", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("jsStatement", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("jsReturn", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("jsThis", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("jsClassDefinition", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("jsFunction", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("jsFuncName", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("jsFuncCall", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("jsClassFuncName", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("jsClassMethodType", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("jsRegexpString", s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("jsGlobalObjects", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("jsGlobalNodeObjects", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("jsExceptions", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("jsBuiltins", s:gui0A, "", s:cterm0A, "", "", "")
" Mail highlighting
call <sid>hi("mailQuoted1", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("mailQuoted2", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("mailQuoted3", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("mailQuoted4", s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("mailQuoted5", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("mailQuoted6", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("mailURL", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("mailEmail", s:gui0D, "", s:cterm0D, "", "", "")
" Markdown highlighting
call <sid>hi("markdownCode", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("markdownError", s:gui05, s:gui00, s:cterm05, s:cterm00, "", "")
call <sid>hi("markdownCodeBlock", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("markdownHeadingDelimiter", s:gui0D, "", s:cterm0D, "", "", "")
" NERDTree highlighting
call <sid>hi("NERDTreeDirSlash", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("NERDTreeExecFile", s:gui05, "", s:cterm05, "", "", "")
" PHP highlighting
call <sid>hi("phpMemberSelector", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("phpComparison", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("phpParent", s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("phpMethodsVar", s:gui0C, "", s:cterm0C, "", "", "")
" Python highlighting
call <sid>hi("pythonOperator", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("pythonRepeat", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("pythonInclude", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("pythonStatement", s:gui0E, "", s:cterm0E, "", "", "")
" Ruby highlighting
call <sid>hi("rubyAttribute", s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("rubyConstant", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("rubyInterpolationDelimiter", s:gui0F, "", s:cterm0F, "", "", "")
call <sid>hi("rubyRegexp", s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("rubySymbol", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("rubyStringDelimiter", s:gui0B, "", s:cterm0B, "", "", "")
" SASS highlighting
call <sid>hi("sassidChar", s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("sassClassChar", s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("sassInclude", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("sassMixing", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("sassMixinName", s:gui0D, "", s:cterm0D, "", "", "")
" Signify highlighting
call <sid>hi("SignifySignAdd", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "", "")
call <sid>hi("SignifySignChange", s:gui0D, s:gui01, s:cterm0D, s:cterm01, "", "")
call <sid>hi("SignifySignDelete", s:gui08, s:gui01, s:cterm08, s:cterm01, "", "")
" Spelling highlighting
call <sid>hi("SpellBad", "", "", "", "", "undercurl", s:gui08)
call <sid>hi("SpellLocal", "", "", "", "", "undercurl", s:gui0C)
call <sid>hi("SpellCap", "", "", "", "", "undercurl", s:gui0D)
call <sid>hi("SpellRare", "", "", "", "", "undercurl", s:gui0E)
" Startify highlighting
call <sid>hi("StartifyBracket", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("StartifyFile", s:gui07, "", s:cterm07, "", "", "")
call <sid>hi("StartifyFooter", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("StartifyHeader", s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("StartifyNumber", s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("StartifyPath", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("StartifySection", s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("StartifySelect", s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("StartifySlash", s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("StartifySpecial", s:gui03, "", s:cterm03, "", "", "")
" Java highlighting
call <sid>hi("javaOperator", s:gui0D, "", s:cterm0D, "", "", "")
" Remove functions
delf <sid>hi
" Remove color variables
unlet s:gui00 s:gui01 s:gui02 s:gui03 s:gui04 s:gui05 s:gui06 s:gui07 s:gui08 s:gui09 s:gui0A s:gui0B s:gui0C s:gui0D s:gui0E s:gui0F
unlet s:cterm00 s:cterm01 s:cterm02 s:cterm03 s:cterm04 s:cterm05 s:cterm06 s:cterm07 s:cterm08 s:cterm09 s:cterm0A s:cterm0B s:cterm0C s:cterm0D s:cterm0E s:cterm0F

517
doc/nukevim.txt

@ -0,0 +1,517 @@
*NukeVim* nucleardog's vim config
~
~
\ | | \ \ /_) ~
. | | | | / -_)\ \ / | ` \ ~
_|\_|\_,_|_\_\\___| \_/ _|_|_|_| ~
~
by nucleardog ~
~
~
+-------------------------------------------------------------------------+
| HELP QUICK GUIDE |
+-------------------------------------------------------------------------+
| Ctrl+] : follow link Ctrl+O : go back Ctrl+I : go forward |
| gO : table of contents |
+-------------------------------------------------------------------------+
================================================================================
CONTENTS *NukeVim-contents*
1. Introduction |NukeVimIntro|
1.1 Goals |NukeVimIntroGoals|
1.2 Really Quick Start |NukeVimReallyQuickStart|
1.3 Less Quick Start |NukeVimLessQuickStart|
2. Installation |NukeVimInstall|
2.1 Dependencies |NukeVimDependencies|
3. Features |NukeVimFeature|
3.1 Development |NukeVimFeatureDev|
3.1.1 Debugger |NukeVimFeatureDebugger|
3.1.2 Code Completion |NukeVimFeatureCodeCompletion|
3.1.3 Tag Bar |NukeVimFeatureTagBar|
3.1.4 Todos |NukeVimFeatureTodos|
3.1.5 Git |NukeVimFeatureGit|
3.1.6 Docker |NukeVimFeatureDocker|
3.2 PHP |NukeVimFeaturePhp|
3.2.1 Debugger |NukeVimFeaturePhpDebugger|
3.2.1 Composer |NukeVimFeaturePhpComposer|
3.3 UI |NukeVimFeatureUi|
3.3.1 Fuzzy Find |NukeVimFeatureUiFuzzyFind|
3.3.2 Terminal |NukevimFeatureUiTerminal|
4. Architecture |NukeVimArch|
4.1 Startup |NukeVimArchStartup|
4.2 Modules |NukeVimArchModule|
4.3 Plugins |NukeVimArchPlugin|
5. Modules |NukeVimModule|
5.1 Keymap |NukeVimModuleKeymap|
5.2 LSP |NukeVimModuleLSP|
5.3 PHPUnit |NukeVimModulePhpUnit|
5.4 Plugins |NukeVimModulePlugins|
5.5 Settings |NukeVimModuleSettings|
5.6 Start |NukeVimModuleStart|
5.7 Syntax |NukeVimModuleSyntax|
5.8 UI |NukeVimModuleUi|
================================================================================
1. Introduction *NukeVimIntro*
This is my modular-ish and configurable-ish neovim config.
It's not intended to serve anyone's purpose but my own, but the core of it
should be fairly adaptable (even if a bit poorly implemented).
--------------------------------------------------------------------------------
1.1 Goals *NukeVimIntroGoals*
The primary thing I try and do with this configuration is _enhance_ vim, not
make it into something else.
* This config should only _add_ or _enhance_ functionality, not make any major
changes to existing functionality or workflows.
* If I'm working on a server or any other computer that doesn't have my config,
I shouldn't be totally lost and useless. Which, conversely, means someone that
is used to vim should not feel lost when using this config.
* The core experience should not be complex. Additional functionality should be
surfaced as it's required or requested.
--------------------------------------------------------------------------------
1.2 Really Quick Start *NukeVimReallyQuickStart*
Basically... it's vim. Pretty much all of the things you're used to in vim
should be there exactly where you would expect them.
You can press `???` at any time to trigger a pop-up help bar that shows the
customized key bindings available. (Try it now!)
The leader key is, out of the box, the spacebar. Press it and wait briefly and
a similar legend should pop up to show the actions available.
Some actions are only available when specific file types are loaded (e.g.,
phpunit actions only display when you have a php file open). Several tools are
only available when the associated program is found in your path (e.g., git
tools are only available if git is found). If something seems missing, check
the install section and see if installing a dependency would help.
Good luck!
--------------------------------------------------------------------------------
1.3 Less Quick Start *NukeVimQuickStart*
This should be a quick run-down of the things that I think are probably most
important to get immediately productive.
*Important Key Mappings:*
+------+-------------------+---------------------------------------------------+
| Mode | Key | Description |
+------+-------------------+---------------------------------------------------+
| n | - (hyphen) | Open file browser in current buffer |
| nit | Alt+H/J/K/L | Select the buffer in the direction |
| n | Alt+Shift+H/J/K/L | Move the current buffer in the direction |
| nit | Ctrl+H/L | Switch tab left/right |
| n t | Ctrl+K | New tab |
+------+-------------------+---------------------------------------------------+
*Important Files:*
* `lua/config/_keymap.lua`: customize general key mappings
* `lua/config/_settings.lua`: customize vim settings and global variables
* `lua/config/plugins/local.lua`: add your own plugins
================================================================================
2. Installation *NukeVimInstall*
Check out, unzip, copy or otherwise place the repo contents in your
`~/.config/nvim` folder (or whatever your platform uses).
Run `nvim +PlugInstall +NukeVimInstall +qall` to install all the relevant
plugins, perform any initial NukeVim or other plugin setup tasks, and exit.
This may take several minutes if you have a few coc extensions. npm is sloooow.
--------------------------------------------------------------------------------
2.1 Dependencies *NukeVimDependencies*
Your nvim install should have the Python3 provider properly set up. Verify
this with the `:checkhealth` command. Generally this requires installing the
`pynvim` package, but the checkhealth command should point you in the right
direction.
// TODO: Add a NukeVim checkhealth provider to just validate all this shit automatically.
Several plugins require external programs in order to function (in many cases
to even make sense at all). Those are listed below.
Generally you should be able to get by without any of these programs installed,
the associated plugins should just automatically be disabled. If not, that's
a bug.
*composer* -- php package manager
Required By: phpctags, vim-composer
See: https://getcomposer.org/
*ctags* -- code tag parser
Required By: phpctags, tagbar
See: https://github.com/universal-ctags/ctags
*deno* -- javascript/typescript plugin runtime
Required By: denops-docker
See: https://deno.land/
*docker* -- build and run containers
Required By: vim-docker-tools, denops-docker,
See: https://www.docker.com/
*git* -- source code control
Required By: vim-fugitive, gv, vim-gitgutter, blamer
See: https://git-scm.com/
*npm* -- javascript package manager
Required By: coc
See: https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
*php* -- php language runtime
Required By: phpctags, vim-composer
See: https://php.org/
================================================================================
3. Features *NukeVimFeature*
--------------------------------------------------------------------------------
3.1 Development *NukeVimFeatureDev*
--------------------------------------------------------------------------------
3.1.1 Debugger *NukeVimFeatureDebugger*
--------------------------------------------------------------------------------
3.1.2 Code Completion *NukeVimFeatureCodeCompletion*
--------------------------------------------------------------------------------
3.1.3 Tag Bar *NukeVimFeatureTagBar*
--------------------------------------------------------------------------------
3.1.4 Todos *NukeVimFeatureTodos*
--------------------------------------------------------------------------------
3.1.5 Git *NukeVimFeatureGit*
--------------------------------------------------------------------------------
3.1.6 Docker *NukevimFeatureDocker*
--------------------------------------------------------------------------------
3.2 PHP *NukeVimFeaturePhp*
--------------------------------------------------------------------------------
3.2.1 Debugger *NukeVimFeaturePhpDebugger*
--------------------------------------------------------------------------------
3.2.2 Composer *NukeVimFeaturePhpComposer*
--------------------------------------------------------------------------------
3.3 UI *NukeVimFeatureUi*
--------------------------------------------------------------------------------
3.3.1 Fuzzy Find *NukeVimFeatureUiFuzzyFind*
--------------------------------------------------------------------------------
3.3.2 Terminal *NukeVimFeatureUiTerminal*
================================================================================
4. Architecture *NukeVimArch*
--------------------------------------------------------------------------------
4.1 Startup *NukeVimArchStartup*
--------------------------------------------------------------------------------
4.2 Modules *NukeVimArchModule*
--------------------------------------------------------------------------------
4.3 Plugins *NukeVimArchPlugin*
================================================================================
5. Modules *NukeVimModule*
Modules are the core of NukeVim, generally providing high-level/core
functionality. Though because of technical limitations there are a couple that
are quite specific.
In addition to the module-specific configuration listed below, every module's
configuration block supports two top-level properties, though both are optional:
* `enable`: if this is set and not `true`, then this module is skipped
* `order`: all modules are loaded, initialized, etc sorted by the ascending
value of the order property; any modules which do not specify an order value
(order = nil) are sorted to the end of the initialization list; any modules
with matching orders (including nil) are initialized in an undefined order
relative to each other.
--------------------------------------------------------------------------------
5.1 Keymap *NukeVimModuleKeymap*
The keymap module provides the ability to map keys directly as well as is
used by the Plugins module to register plugin-specific key mappings. If enabled,
the keymap module also handles generating the help/legend that you can trigger
with `???` or after pressing the leader key.
In `lua/_config.lua`, a couple of options are provided directly:
* `ui.enable`: whether to enable the legend when pressing the `???` combo or
after pressing the leader key.
* `ui.show_builtin`: if this is enabled then the legend will also show vim's
built-in key bindings, not just the customized ones.
A list of key bindings can be provided on the `keys` property.
By default, the general key mappings registered through the `keys` property are
included from `lua/config/_keymap.lua`. Mappings for plugins are generally
contained in the plugin config block in the plugin files. See
|NukeVimModulePlugins|.
Supported options for each keymap are:
* `mode`: the mode to register this key combo in (e.g., `n`, `i`, `v`, etc)
* `key`: either a string where each character is expected to represent a single
key (e.g., 'jj') or an array where each element is a key (e.g.,
`{ '<leader>', 'g', 'c' }`.
* `map`: what to bind to this keypress
* `label`: the label to show in the legend/help
* `group`: set true if this doesn't actually map a key but just provides a label
for a group of keys
* `virtual`: set true if this doesn't actually map a key but instead is just
intended to provide a label for an existing mapping
* `hidden`: set true if you want this map registered but to _not_ display in
the legend; no effect if the legend UI isn't enabled
* `options`: these are passed through to the map api, you can set `silent`,
`nowait`, and `noremap`. If the `options` table isn't specified, than the
default options is `noremap`.
Examples:
Basic Mapping:
{
mode = 'n',
key = 'jj',
map = '<Esc>',
label = 'escape'
},
Multiple Key Mapping:
{
mode = 'n',
key = { '<Space>', '<Space>' },
map = ':syn sync fromstart<CR>',
label = 'recalculate syntax highlighting'
},
Virtual Mapping (Label Only):
{
mode = 'n',
key = '-',
virtual = true,
label = 'browse files with netrw'
}
Hidden Mapping:
{
mode = 'n',
key = '<F49>',
map = ':lua nukevim:help()<CR>',
label = 'help',
hidden = true
},
Group Mapping (Label Only):
{
mode = 'n',
key = { '<leader>', 'd' },
group = true,
label = 'development tools'
},
{ mode = 'n', key = { '<leader>', 'd', 'a' }, map = '...', label = 'tool a' },
{ mode = 'n', key = { '<leader>', 'd', 'b' }, map = '...', label = 'tool b' },
{ mode = 'n', key = { '<leader>', 'd', 'c' }, map = '...', label = 'tool c' },
Vim Mapping Options:
{
mode = 'i',
key = { '<A-j>' },
map = '<C-O><C-W>j',
label = 'select buffer down',
options = { silent = true }
}
--------------------------------------------------------------------------------
5.2 LSP *NukeVimModuleLSP*
The LSP module is responsible for initializing and configuring NeoVim's built in
LSP client.
It provides only minimal functionality, but must be configured with any LSP
providers you expect to use in NeoVim.
All providers are configured under a top level `provders` property. The LSP
configuration is fairly specific to each provider, but the general format
is:
providers = {
intelephense = {
command = { 'intelephense', '--stdio' },
filetypes = { 'php' }
}
}
--------------------------------------------------------------------------------
5.3 PHPUnit *NukeVimModulePhpUnit*
The PHPUnit module is responsible for providing an interface to PHPUnit. It has
no configuration options, but registers several key bindings in the <leader>
interface for running PHPUnit tests when you have a PHP file open.
It is hardcoded to run PHPUnit using the path `./vendor/bin/phpunit` so should
always use the version of PHPUnit included in your project.
--------------------------------------------------------------------------------
5.4 Plugins *NukeVimModulePlugins*
The plugins module is responsible for initializing and configuring all external
vim plugins. By default, this relies on `vim-plug` to provide the actual plugin
management.
The plugins module provides one top-level option:
* `path`: the path on disk where plugins should be stored
The list of plugins should be provided as the `plugins` property. By default,
this is included from `lua/config/_plugins.lua` which in turn includes and
merges all the plugins in the files in `lua/config/plugins/`.
Each plugin supports a several properties, all except `name` are optional:
* `enable`: if set and not `true`, the plugin will be skipped
* `name`: the name of the plugin, generally a github reference (`user/plugin`)
* `config`: passed through as-is to both `vim-plug` and the plugin itself, some
useful options available from vim-plug:
* `branch`: override the branch to check out from git
* `on`: delay loading the plugin until one of the specified commands is called
* `do`: command to run after install/update
* `requires`: a list of programs that should be available in your path in order
for this plugin to be enabled (to, e.g., disable a docker plugin if docker
isn't installed)
* `keys`: a list of key mappings in the format expected by the keymap module
(see |NukeVimModuleKeymap|) that should be registered if this plugin is enabled
In addition to the plugin itself, if a file is present at
`lua/plugin/<plugin/path>.lua` it will be loaded and registered with the module
system to allow you to provide additional customization or initialization
logic. See |NukeVimArchPlugin| for more information.
--------------------------------------------------------------------------------
5.5 Settings *NukeVimModuleSettings*
This module is responsible for setting vim settings and global variables.
The settings module provides a single top-level option:
* `settings`: Set a `o` table to provide options, and a `g` table to set
global variables.
By default, the settings configuration is loaded from `lua/config/_settings.lua`.
The `o` property should be set to a table containing vim options and their value.
Generally, this is anything you would configure with `set option` or
`set option=value`.
In the case of "boolean" options (e.g., `wrap` and `nowrap`) you should not set
the `no` option, but instead set the option to value. That is, instead of
`nowrap = true`, set `wrap = false`.
The `g` property should be set to a table containing any global variables you
want to set on startup. Generally, this is anything you would configure with
`let g:option=value`.
--------------------------------------------------------------------------------
5.6 Start *NukeVimModuleStart*
This module has no configuration options available. It provides the NukeVim
splash screen on startup.
--------------------------------------------------------------------------------
5.7 Syntax *NukeVimModuleSyntax*
This module has no configuration options available. It simply exists to resolve
some conflicts between some syntax highlighting plugins.
--------------------------------------------------------------------------------
5.8 UI *NukeVimModuleUi*
The UI module is generally responsible for how vim looks.
It provides two top level properties:
* `tui`: configuration to apply on startup unconditionally
* `gui`: configuration to apply on top of the `tui` options if we detect
that vim is running in some sort of gui
Each property supports the following options:
* `theme`: the colorscheme to apply, this is basically `set colorscheme`
* `show_whitespace`: if enabled, then highlighting rules will be added to
make whitespace visible in the editor
* `font`: supports two properties: `family` and `size`

42
doc/tags

@ -0,0 +1,42 @@
NukeVim nukevim.txt /*NukeVim*
NukeVim-contents nukevim.txt /*NukeVim-contents*
NukeVimArch nukevim.txt /*NukeVimArch*
NukeVimArchModule nukevim.txt /*NukeVimArchModule*
NukeVimArchPlugin nukevim.txt /*NukeVimArchPlugin*
NukeVimArchStartup nukevim.txt /*NukeVimArchStartup*
NukeVimDependencies nukevim.txt /*NukeVimDependencies*
NukeVimFeature nukevim.txt /*NukeVimFeature*
NukeVimFeatureCodeCompletion nukevim.txt /*NukeVimFeatureCodeCompletion*
NukeVimFeatureDebugger nukevim.txt /*NukeVimFeatureDebugger*
NukeVimFeatureDev nukevim.txt /*NukeVimFeatureDev*
NukeVimFeatureGit nukevim.txt /*NukeVimFeatureGit*
NukeVimFeaturePhp nukevim.txt /*NukeVimFeaturePhp*
NukeVimFeaturePhpComposer nukevim.txt /*NukeVimFeaturePhpComposer*
NukeVimFeaturePhpDebugger nukevim.txt /*NukeVimFeaturePhpDebugger*
NukeVimFeatureTagBar nukevim.txt /*NukeVimFeatureTagBar*
NukeVimFeatureTodos nukevim.txt /*NukeVimFeatureTodos*
NukeVimFeatureUi nukevim.txt /*NukeVimFeatureUi*
NukeVimFeatureUiFuzzyFind nukevim.txt /*NukeVimFeatureUiFuzzyFind*
NukeVimFeatureUiTerminal nukevim.txt /*NukeVimFeatureUiTerminal*
NukeVimInstall nukevim.txt /*NukeVimInstall*
NukeVimIntro nukevim.txt /*NukeVimIntro*
NukeVimIntroGoals nukevim.txt /*NukeVimIntroGoals*
NukeVimModule nukevim.txt /*NukeVimModule*
NukeVimModuleKeymap nukevim.txt /*NukeVimModuleKeymap*
NukeVimModuleLSP nukevim.txt /*NukeVimModuleLSP*
NukeVimModulePhpUnit nukevim.txt /*NukeVimModulePhpUnit*
NukeVimModulePlugins nukevim.txt /*NukeVimModulePlugins*
NukeVimModuleSettings nukevim.txt /*NukeVimModuleSettings*
NukeVimModuleStart nukevim.txt /*NukeVimModuleStart*
NukeVimModuleSyntax nukevim.txt /*NukeVimModuleSyntax*
NukeVimModuleUi nukevim.txt /*NukeVimModuleUi*
NukeVimQuickStart nukevim.txt /*NukeVimQuickStart*
NukeVimReallyQuickStart nukevim.txt /*NukeVimReallyQuickStart*
NukevimFeatureDocker nukevim.txt /*NukevimFeatureDocker*
composer nukevim.txt /*composer*
ctags nukevim.txt /*ctags*
deno nukevim.txt /*deno*
docker nukevim.txt /*docker*
git nukevim.txt /*git*
npm nukevim.txt /*npm*
php nukevim.txt /*php*

193
lua/_config.lua

@ -0,0 +1,193 @@
--------------------------------------------------------------------------------
-- _config.lua --
--------------------------------------------------------------------------------
--
-- This is where you change settings for nukevim modules.
--
--
-- * Each key in this table is a nukevim module. (Valid modules are any
-- file under `lua/module/`).
-- * Each value in this table is the configuration for the module.
-- * The configuration _must_ be a table (`{ ... }`).
-- * The configuration _may_ include a `enable` property.
-- * If this is present and not `true`, then the module will be skipped.
-- * The configuration _may_ include a `order` property.
-- * Modules are processed from lowest to highest order number.
-- * Modules which do not have an order specified are processed last.
-- * Those with matching orders (including nil) will be processed in
-- an _undefined order_. And I mean undefined. I have no idea what lua
-- is doing but it's basically random.
--
return {
--------------------------------------------------------------------------------
-- CORE --
--------------------------------------------------------------------------------
------------------------------------------------------------
-- Plugins
--
-- Manage loading and initializing vim plugins.
--
-- * The general plugin list is kept in `_plugins.lua` (and
-- pulled in by the `require()` below. Add your plugins
-- there.
-- * Some modules have their own plugin dependencies. Those
-- modules automatically register their own plugins. They
-- do not need to also be listed here.
--
plugins = {
order = 10,
-- Path on disk to store the actual plugin code at.
path = "~/.config/nvim/plugins",
-- A list of plugins to install and load.
-- Load from `_plugins.lua`.
plugins = require('config/_plugins')
},
------------------------------------------------------------
-- Keymap
--
-- Handle mapping keys to things and, optionally, generating
-- a UI for showing a legend.
--
-- * The general keymap list is kept in `_keymap.lua` (and
-- pulled in by the `require()` below. Add your keymaps
-- there.
-- * Many keymaps associated with plugins are defined in
-- the plugin's configuration. Look at the plugins module
-- configuration for those.
-- * Many modules have their own mappings that need to be
-- included. They automatically register them. They do
-- not need to also be listed here.
--
keymap = {
order = 20,
-- Whether to provide a UI/legend for the key mappings.
ui = {
-- If enabled, the `which-key` plugin will be set up and
-- all key bindings will be run through it.
-- If disabled, the plugin will not be included and all
-- key bindings will be registered through the nvim native API.
enable = true,
-- If enabled, the legend will show keys built-in to vim as well
-- as custom plugin/module key bindings.
-- If disabled, only custom plugin/module key bindings will be
-- shown.
show_builtin = false
},
-- The list of keymaps to register.
-- Load from `_keymap.lua`.
keys = require('config/_keymap')
},
------------------------------------------------------------
-- Settings
--
-- Allows setting vim's native configuration options and
-- global variables.
--
-- * The settings are kept in `_settings.lua` (and pulled in
-- by the `require()` below. Add your settings there.
-- * Several modules and plugins may also set options or
-- global variables. They automatically manage this and
-- the settings do not need to be listed here.
-- * In the event of a conflict between a module/plugin
-- and your settings file, your settings file will
-- _generally_ prevail.
--
settings = {
order = 30,
settings = require('config/_settings'),
},
--------------------------------------------------------------------------------
-- UI --
--------------------------------------------------------------------------------
------------------------------------------------------------
-- UI
--
-- General user interface settings
--
-- * These settings are split into two sections: tui and gui
-- * tui: these settings are _always_ applied
-- * gui: these settings are applied _on top of_ tui settings
-- when running vim in a gui such as neovim-qt
-- * If for some reason you want to set a tui theme but _not_
-- any theme for gui, you can set gui's theme to `default`.
--
ui = {
order = 40,
-- Base settings -- applied in terminal, and applied before
-- gui settings in gui
tui = {
-- Colorscheme to use (i.e., set colorscheme <this>)
theme = "base16-eighties",
-- If configured, this will apply styling to whitespace so
-- it is visible in the editor
-- If set to true, default styling will be applied.
-- If set to a string, the specified colour will be used as the
-- highlight for whitespace (e.g., `gray30`)
show_whitespace = true
},
-- Override settings for gui mode
gui = {
-- Set the font family and size to use
font = { family = 'Source Code Variable', size = 10 },
theme = 'base16-eighties',
show_whitespace = true
},
},
--------------------------------------------------------------------------------
-- PROGRAMMING --
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- OTHER --
--------------------------------------------------------------------------------
------------------------------------------------------------
-- Syntax
--
-- More comprehensive and up-to-date syntax highlighting rules
--
-- This is basically just a plugin, but it requires a specific
-- global variable to be set earlier than the plugin system
-- allows (i.e., before the plugin itself is loaded) so it's
-- a module.
--
-- There are no options to configure.
--
syntax = {
order = 50,
},
-----------------------------------------------------------
phpunit = {
order = 60,
},
lsp = {
order = 70,
providers = {
intelephense = {
command = { 'intelephense', '--stdio' },
filetypes = { 'php' }
}
}
},
start = {
order = 80,
},
}

86
lua/config/_keymap.lua

@ -0,0 +1,86 @@
-- This file allows binding arbitrary keys in vim.
-- If a keymap is tied to a specific plugin, it should generally be specified
-- in the plugins file attached to that plugin.
--
-- When making a binding, group, etc, the key to bind to shoudl be specified
-- as an array. However, as long as _each character_ represents a single keypress
-- the key can be specified as a string. E.g., `key = 'jj'` and `key = { 'j', 'j' }`
-- are equivalent. However, `key = { '<A-h>' }` would be parsed as
-- `key = {'<', 'A', '-', 'h', '>'}
--
-- There are four main types of keymap bindings:
-- * Group: This only serves to provide a label for the keymap legend for
-- keys under a prefix. (e.g., label for `f` when we have bindings
-- for `fg` and `fh`).
-- `{ mode = 'n', key = { '<leader>', 'p' }, group = true, label = "Sample Group" }`
-- * Virtual: This registers a label in the keymap legend, but doesn't
-- actually change the binding of the key.
-- `{ mode = 'n', key = { 'g', 'q' }, virtual = true, description = 'reformat text, wrapping line length' }`
-- * Hidden: The key is bound through normal vim functionality, bypassing the
-- keymap legend so that the key will not show up in the legend.
-- `{ mode = 'n', key = { 'h' }, map = ':echo "Hello, world!'"', label = 'Hello world button', hidden = true
-- `{ mode = 'n', key = 'aaa', map = ':echo "Hello, world!'"', label = 'Hello world button', hidden = true}
-- * Normal: The key is bound, and the key is shown in the legend.
-- `{ mode = 'n', key = { 'j' }, map = ':echo "Hello, world!'"', label = 'Hello world button' }
-- `{ mode = 'n', key = 'aaa', map = ':echo "Hello, world!'"', label = 'Hello world button' }
return {
-- { mode = 'n', key = { '<F5>' }, map = ':call SynStack()<CR>', label = 'show syntax token' },
{ mode = 'n', key = { '<F49>' }, map = ':lua nukevim:help()<CR>', label = 'help' },
-- Provide labels for the main leader groups
{ mode = 'n', key = { '<leader>', 'c' }, group = true, label = 'code' },
{ mode = 'n', key = { '<leader>', 'd' }, group = true, label = 'dev tools' },
{ mode = 'v', key = { '<leader>', 'd' }, group = true, label = 'dev tools' },
{ mode = 'n', key = { '<leader>', 'g' }, group = true, label = 'git' },
{ mode = 'n', key = { '<leader>', 'l' }, group = true, label = 'language tools' },
{ mode = 'n', key = { '<leader>', 'w' }, group = true, label = 'workspace' },
-- A group label for the key legend
{ mode = 'n', key = 'z', group = true, label = 'text operations' },
-- A "virtual" key to add an existing vim bind to the legend
{ mode = 'n', key = 'z=', virtual = true, description = 'check spelling' },
-- Escape from insert with jj
{ mode = 'i', key = 'j', group = true, label = 'j' },
{ mode = 'i', key = 'jj', map = '<Esc>', label = 'escape' },
-- Dehighlight and recompute syntax highlighting
{ mode = 'n', key = { '<Space>', '<Space>' }, map = ':silent noh <Bar>echo<cr>:syn sync fromstart<CR>', label = 'refresh' },
-- Directory browsing
{ mode = 'n', key = { '-' }, virtual = true, label = "browse files" },
-- Move between buffers
{ mode = 'n', key = { '<A-h>' }, map = '<C-W>h', label = 'select buffer left' },
{ mode = 'n', key = { '<A-j>' }, map = '<C-W>j', label = 'select buffer down' },
{ mode = 'n', key = { '<A-k>' }, map = '<C-W>k', label = 'select buffer up' },
{ mode = 'n', key = { '<A-l>' }, map = '<C-W>l', label = 'select buffer right' },
{ mode = 'i', key = { '<A-h>' }, map = '<C-O><C-W>h', label = 'select buffer left', hidden = true },
-- { mode = 'i', key = { '<A-j>' }, map = '<C-O><C-W>j', label = 'select buffer down', hidden = true },
-- { mode = 'i', key = { '<A-k>' }, map = '<C-O><C-W>k', label = 'select buffer up', hidden = true },
{ mode = 'i', key = { '<A-j>' }, map = '<C-O><C-W>j', label = 'select buffer down', hidden = true, options = { silent = true }},
{ mode = 'i', key = { '<A-k>' }, map = '<C-O><C-W>k', label = 'select buffer up', hidden = true, options = { silent = true }},
{ mode = 'i', key = { '<A-l>' }, map = '<C-O><C-W>l', label = 'select buffer right', hidden = true },
-- Tab navigation
{ mode = 'n', key = { '<C-k>' }, map = ':tabnew<CR>', label = 'new tab' },
{ mode = 'n', key = { '<C-l>' }, map = ':tabnext<CR>', label = 'next tab' },
{ mode = 'i', key = { '<C-l>' }, map = '<ESC>:tabnext<CR>', label = 'next tab' },
{ mode = 'n', key = { '<C-h>' }, map = ':tabprev<CR>', label = 'previous tab' },
{ mode = 'i', key = { '<C-h>' }, map = '<ESC>:tabprev<CR>', label = 'previous tab' },
-- Scroll autocomplete
{ mode = 'i', key = { '<C-j>' }, map = '<C-n>', label = 'next autocomplete', hidden = true },
{ mode = 'i', key = { '<C-k>' }, map = '<C-p>', label = 'previous autocomplete', hidden = true },
-- Terminal bindings
{ mode = 't', key = { '<A-h>' }, map = '<C-\\><C-n><C-W>h', label = 'select buffer left', hidden = true },
{ mode = 't', key = { '<A-j>' }, map = '<C-\\><C-n><C-W>j', label = 'select buffer down', hidden = true },
{ mode = 't', key = { '<A-k>' }, map = '<C-\\><C-n><C-W>k', label = 'select buffer up', hidden = true },
{ mode = 't', key = { '<A-l>' }, map = '<C-\\><C-n><C-W>l', label = 'select buffer right', hidden = true },
{ mode = 't', key = { '<C-h>' }, map = '<C-\\><C-n>:tabprev<CR>', label = 'select buffer right', hidden = true },
{ mode = 't', key = { '<C-l>' }, map = '<C-\\><C-n>:tabnext<CR>', label = 'select buffer right', hidden = true },
{ mode = 't', key = { 'j', 'j' }, map = '<C-\\><C-n>', label = 'escape', hidden = true },
}

29
lua/config/_plugins.lua

@ -0,0 +1,29 @@
-- Plugins
--
-- Each entry in this table specifies one plugin that could be loaded. Each
-- plugin can contain the following properties:
--
-- * name: plugin path, generally a github username/repo-name
-- * config: a table to pass through to the plugin manager, see, e.g., https://github.com/junegunn/vim-plug
-- * enable: if present and not set to true, this plugin won't be loaded
-- * requires: a table listing system binaries that must be present for this
-- plugin to be enabled
-- * keys: a list of keymaps (in the same format as _keymap.lua) that will be
-- registered when this plugin is enabled
--
local merge = require('lib/merge')
return merge({
-- Libraries and frameworks that provide functionality that other plugins
-- consume.
require('config/plugins/lib'),
require('config/plugins/development'),
require('config/plugins/editing'),
require('config/plugins/ui'),
require('config/plugins/tmp'),
require('config/plugins/lang-php'),
})

61
lua/config/_settings.lua

@ -0,0 +1,61 @@
return {
-- vim options
-- these are things you would apply with `set thing` or `set thing=value`.
o = {
-- Disable modeline (security risk)
modeline = false,
-- Enable wrapping (visually) at the end of the window
wrap = true,
-- Display markers _after_ the 80th and 120th columns
cc = '81,121',
-- Smart search case sensitivity: If anything in search term is
-- uppercase, match case sensitive. Otherwise match case-insensitive.
ignorecase = true,
smartcase = true,
-- Allow backspace through indentation and stop at the beginning of
-- the line
backspace = 'start,indent',
-- Set defaults, should be overridden by the editorconfig plugin if you
-- have one.
softtabstop = 0,
shiftwidth = 4,
tabstop = 4,
expandtab = false,
-- Use smart-ish indentation
autoindent = true,
copyindent = true,
preserveindent = true,
-- Enable extended color support on terminal
termguicolors = true,
-- Automatically reload changed files
autoread = true,
-- How long for a multi-key binding to time out
-- This basically just controls how long before
-- the key helper pops up if you have the keymap
-- ui enabled.
timeoutlen = 300,
-- Show line numbers
number = true,
-- Highlight the line the cursor is on
cursorline = true,
-- Keep a persistent undo file, allow undoing after closing and reopening
-- a file.
undofile = true,
},
-- global variables
-- these are things you would apply with `let g:thing=value`
g = {
-- Control the 'leader' key for extended key bindings
mapleader = ' '
}
}

269
lua/config/plugins/development.lua

@ -0,0 +1,269 @@
--------------------------------------------------------------------------------
-- Development
--------------------------------------------------------------------------------
-- Tools for supporting development, excluding language-specific which should
-- go in `lang-<language>.lua`.
--
return {
--------------------------------------------------------------------------------
-- Debugging
--------------------------------------------------------------------------------
{
name = 'vim-vdebug/vdebug',
keys = {
{ mode = 'n', key = { '<leader>', 'd', 'd' }, group = true, label = 'debugger' },
{ mode = 'v', key = { '<leader>', 'd', 'd' }, group = true, label = 'debugger' },
{ mode = 'n', key = { '<F5>' }, virtual = true, label = 'start debugger' },
{ mode = 'n', key = { '<F10>' }, virtual = true, label = 'set breakpoint' },
{ mode = 'n', key = { '<leader>', 'd', 'd', 'b' }, map = ':lua nukevim.modules:get("vim-vdebug/vdebug"):setBreakpoint()<CR>', label = 'toggle breakpoint' },
{ mode = 'n', key = { '<leader>', 'd', 'd', 'c' }, map = ':lua nukevim.modules:get("vim-vdebug/vdebug"):setConditionalBreakpoint()<CR>', label = 'conditional breakpoint' },
{ mode = 'n', key = { '<leader>', 'd', 'd', 't' }, map = ':lua nukevim.modules:get("vim-vdebug/vdebug"):startTrace()<CR>', label = 'trace expression' },
{ mode = 'v', key = { '<leader>', 'd', 'd', 't' }, map = ':lua nukevim.modules:get("vim-vdebug/vdebug"):startTrace()<CR>', label = 'trace expression' },
{ mode = 'n', key = { '<leader>', 'd', 'd', 'e' }, map = ':lua nukevim.modules:get("vim-vdebug/vdebug"):eval()<CR>', label = 'eval code' },
{ mode = 'v', key = { '<leader>', 'd', 'd', 'e' }, map = ':lua nukevim.modules:get("vim-vdebug/vdebug"):eval()<CR>', label = 'eval code' },
{ mode = 'n', key = { '<leader>', 'd', 'd', 'w' }, map = ':lua nukevim.modules:get("vim-vdebug/vdebug"):showBreakpoints()<CR>', label = 'show breakpoints' },
}
},
--------------------------------------------------------------------------------
-- Editing
--------------------------------------------------------------------------------
-- Things that make the actual typing experience better.
----------------------------------------------------------------------------
-- .editorconfig
--
-- Load and respect the .editorconfig file in projects
--
{ name = 'editorconfig/editorconfig-vim' },
--------------------------------------------------------------------------------
-- Intellisense
--------------------------------------------------------------------------------
-- Things that provide code insights and completion.
----------------------------------------------------------------------------
-- Code completion provider
--
-- Provides completions for a whole bunch of stuff, managed separately through
-- the coc package.json
--
{
name = 'neoclide/coc.nvim',
-- Only enable this plugin if npm is installed
requires = { 'npm' },
config = {
branch = 'master',
['do'] = 'npm install'
},
keys = {
{ mode = 'n', key = { '<leader>', 'c', 'r' }, map = ":call CocAction('jumpReferences')<CR>", label = "references" },
}
},
----------------------------------------------------------------------------
-- Code tag sidebar
--
-- Provides a UI for browsing code "tags" (classes, functions, etc) in the
-- currently open file.
--
{
name = 'preservim/tagbar',
requires = { 'ctags' },
config = { ['on'] = { 'TagbarToggle', 'TagbarOpen', 'TagbarOpenAutoClose' } },
-- keys = {
-- { mode = 'n', key = { '<leader>', 't' }, map = ':TagbarOpenAutoClose<CR>', label = 'Show File Structure' }
-- }
keys = {
{ mode = 'n', key = { '<A-;>' }, map = ':TagbarOpenAutoClose<CR>', label = 'show tagbar' },
{ mode = 'i', key = { '<A-;>' }, map = '<ESC>:TagbarOpenAutoClose<CR>', label = 'show tagbar' },
}
},
--------------------------------------------------------------------------------
-- Projects
--------------------------------------------------------------------------------
-- Things that make working with projects better.
----------------------------------------------------------------------------
-- Making the working directory follow your projects
--
-- Whenever you load a new file, changes the working directory to the
-- nearest parent that has a `.git` folder in it, generally just working to
-- automatically always be in your current project's folder.
--
{ name = 'airblade/vim-rooter' },
----------------------------------------------------------------------------
-- Trouble - Show a todo list and list of errors from the lsp
--
{ name = 'kyazdani42/nvim-web-devicons' },
{ name = 'folke/trouble.nvim', config = { branch = 'main' } },
----------------------------------------------------------------------------
-- Todo Comments
--
-- Find todo/fixme/etc and highlight them, and allow viewing a list
-- project-wide
{
name = 'folke/todo-comments.nvim',
config = { branch = "main" },
keys = {
{ mode = 'n', key = { '<leader>', 'w', 't' }, map = ':TodoTrouble<CR>', label = "todos" },
}
},
--------------------------------------------------------------------------------
-- UI
--------------------------------------------------------------------------------
-- Things that make the UI nicer.
----------------------------------------------------------------------------
-- Collect scope at the top of the editor to maintain context
--
-- E.g., as you scroll down, if you're within a function() whose
-- declaration has scrolled off-screen, this will pin it to the top of the
-- editor so it's always visible.
--
{ enable = false, name = 'wellle/context.vim' },
--------------------------------------------------------------------------------
-- Tool: Git
--------------------------------------------------------------------------------
-- Things that make your git experience better.
----------------------------------------------------------------------------
-- Git Wrapper
--
-- Adds a :G command that allows you to specify most git commands and have
-- them do sensible things from within vim with a vim-y interface.
--
{
name = 'tpope/vim-fugitive',
-- Only enable if git is installed
requires = { 'git' },
config = { ['on'] = { 'G', 'Gdiffsplit', 'GDelete' } },
-- Put a bunch of stuff in the <leader> menu
keys = {
{ mode = 'n', key = { '<leader>', 'g', 'b' }, map = ':G blame<CR>', label = 'blame' },
{ mode = 'n', key = { '<leader>', 'g', 'd' }, map = ':Gdiffsplit<CR>', label = 'diff' },
{ mode = 'n', key = { '<leader>', 'g', 'l' }, map = ':G log<CR>', label = 'log' },
{ mode = 'n', key = { '<leader>', 'g', 'r' }, map = ':GDelete<CR>', label = 'rm' },
{ mode = 'n', key = { '<leader>', 'g', 's' }, map = ':G<CR>', label = 'status' },
{ mode = 'n', key = { '<leader>', 'g', 'a' }, map = ':G add %<CR>', label = 'add' },
{ mode = 'n', key = { '<leader>', 'g', 'c' }, map = ':G commit<CR>', label = 'commit' },
{ mode = 'n', key = { '<leader>', 'g', 'p' }, map = ':G push<CR>', label = 'push' },
{ mode = 'n', key = { '<leader>', 'g', 'x' }, map = ':lua nukevim.modules:get("tpope/vim-fugitive"):on_change_branch()<CR>', label = 'change branch' },
{ mode = 'n', key = { '<leader>', 'g', 'z' }, map = ':lua nukevim.modules:get("tpope/vim-fugitive"):on_checkout()<CR>', label = 'checkout', without = { 'nvim-telescope/telescope.nvim' } },
}
},
----------------------------------------------------------------------------
-- Better log browsing
--
-- Show the commit history of the repo in the usual branching tree type
-- list.
--
{
name = 'junegunn/gv.vim',
requires = { 'git' },
keys = {
{ mode = 'n', key = { '<leader>', 'g', 'g' }, map = ':GV<CR>', label = 'graph' }
}
},
----------------------------------------------------------------------------
-- Show line-by-line changes in the editor
--
-- Shows +/-/~ in the gutter to signify line-level changes versus the most
-- recent commit and provides tools for working with hunks.
--
{
name = 'airblade/vim-gitgutter',
requires = { 'git' },
keys = {
{ mode = 'n', key = { '<leader>', 'g', 'r' }, map = '<Plug>(GitGutterPrevHunk)', label = 'previous hunk' },
{ mode = 'n', key = { '<leader>', 'g', 'f' }, map = '<Plug>(GitGutterNextHunk)', label = 'next hunk' },
{ mode = 'n', key = { '<leader>', 'g', 't' }, map = '<Plug>(GitGutterStageHunk)', label = 'stage hunk' },
{ mode = 'n', key = { '<leader>', 'g', 'y' }, map = '<Plug>(GitGutterPreviewHunk)', label = 'preview hunk' },
}
},
----------------------------------------------------------------------------
-- Show blame on each line
--
-- vscode style codelens blame shown on each line after a delay
--
{
name = 'apzelos/blamer.nvim',
requires = { 'git' },
-- config = {
-- ['on'] = { 'BlamerToggle' }
-- },
keys = {
{ mode = 'n', key = { '<leader>', 'g', 'w' }, map = '<Cmd>BlamerToggle<CR>', label = 'toggle inline blame' },
}
},
--------------------------------------------------------------------------------
-- Tool: Docker
--------------------------------------------------------------------------------
-- Things that make your docker experience better.
----------------------------------------------------------------------------
-- Pure vimscript docker container management
--
-- This plugin is disabled by default as I prefer the "denops-docker" listed
-- below, but if you can't/won't install deno then this is an option.
--
{
enable = false,
name = 'kkvh/vim-docker-tools',
requires = { 'docker' },
config = { ['on'] = { 'DockerToolsOpen', 'DockerToolsToggle' } },
keys = {
{ mode = 'n', key = { '<leader>', 'd', 'c' }, map = ':below new<CR>:DockerToolsOpen<CR>', label = 'docker containers' }
}
},
----------------------------------------------------------------------------
-- Docker container and image management
--
-- This plugin seems a little more polished and full-featured, so as long
-- as deno is available enable this instead.
--
{
enable = true,
name = 'skanehira/denops-docker.vim',
config = { branch = 'main', ['on'] = { 'DockerContainers', 'DockerImages' } },
requires = { 'deno', 'docker' },
keys = {
{ mode = 'n', key = { '<leader>', 'd', 'c' }, map = ':below new<CR>:DockerContainers<CR>8<C-w>_', options = { silent = true }, label = 'docker containers' },
{ mode = 'n', key = { '<leader>', 'd', 'i' }, map = ':below new<CR>:DockerImages<CR>8<C-w>_', options = { silent = true }, label = 'docker images' },
{ filetype = 'docker-containers', mode = 'n', key = { 'u' }, label = 'start', virtual = true },
{ filetype = 'docker-containers', mode = 'n', key = { 'd' }, label = 'stop', virtual = true },
{ filetype = 'docker-containers', mode = 'n', key = { '<C-k>' }, label = 'kill', virtual = true },
{ filetype = 'docker-containers', mode = 'n', key = { 'a' }, label = 'terminal', virtual = true },
{ filetype = 'docker-containers', mode = 'n', key = { 't' }, label = 'log', virtual = true },
{ filetype = 'docker-containers', mode = 'n', key = { '<C-d>' }, label = 'delete', virtual = true },
{ filetype = 'docker-containers', mode = 'n', key = { 'q' }, label = 'close window', virtual = true },
{ filetype = 'docker-containers', mode = 'n', key = { 'r' }, label = 'restart', virtual = true },
{ filetype = 'docker-containers', mode = 'n', key = { '<CR>' }, label = 'inspect', virtual = true },
{ filetype = 'docker-images', mode = 'n', key = { '<CR>' }, label = 'inspect', virtual = true },
{ filetype = 'docker-images', mode = 'n', key = { '<C-d>' }, label = 'delete', virtual = true },
{ filetype = 'docker-images', mode = 'n', key = { 'r' }, label = 'run', virtual = true },
{ filetype = 'docker-images', mode = 'n', key = { 'q' }, label = 'close window', virtual = true },
}
},
}

37
lua/config/plugins/editing.lua

@ -0,0 +1,37 @@
return {
--------------------------------------------------------------------------------
-- Editing
--------------------------------------------------------------------------------
----------------------------------------------------------------------------
-- Toggle comments
--
-- Allow toggling comments on lines or blocks of lines in visual mode.
--
{
name = 'tpope/vim-commentary'
},
----------------------------------------------------------------------------
-- Lightspeed - quick motions... or something, it's some big brain shit
--
{
name = 'ggandor/lightspeed.nvim',
config = { branch = 'main' },
keys = {
{ mode = 'n', key = { 's' }, virtual = true, label = "smart jump forward" },
{ mode = 'n', key = { 'S' }, virtual = true, label = "smart jump backward" },
}
},
----------------------------------------------------------------------------
-- Preview line number jump
--
-- This will cause vim to temporarily scroll to the line number you're
-- entering when doing `:123`. When you press enter the cursor move will be
-- committed, but you can press <escape> to cancel and return to where you
-- were.
--
{ name = 'nacro90/numb.nvim' },
}

49
lua/config/plugins/lang-php.lua

@ -0,0 +1,49 @@
return {
--------------------------------------------------------------------------------
-- PHP
--------------------------------------------------------------------------------
----------------------------------------------------------------------------
-- Improved PHP syntax highlighting
--
-- TysonAndre maintains several very impressive PHP-adjacent projects and
-- I'd generally trust his stuff will be better than some of the other
-- abandoned projects or any stuff coming from an all-in-one type project.
--
{ name = 'TysonAndre/php-vim-syntax' },
----------------------------------------------------------------------------
-- PHP ctags provider
--
-- Allows parsing out PHP files to provide listings of classes/functions/etc
-- for use by other plugins, e.g., the tag sidebar
--
{
name = 'vim-php/phpctags',
requires = { 'ctags', 'php', 'composer' },
config = {
['do'] = 'composer install'
}
},
----------------------------------------------------------------------------
-- Composer interface
--
-- Very rudimentary, but allows for performing basic install/update/etc from
-- within vim.
--
{
name = 'vim-php/vim-composer',
requires = { 'php', 'composer' },
-- Only load this plugin if a composer function is called
config = { ['on'] = { 'ComposerInstall', 'ComposerUpdate', 'ComposerJSON' } },
keys = {
{ filetype = 'php', mode = 'n', key = { '<leader>', 'l', 'c' }, group = true, label = 'composer' },
{ filetype = 'php', mode = 'n', key = { '<leader>', 'l', 'c', 'i' }, map = ':ComposerInstall<CR>', label = 'composer install' },
{ filetype = 'php', mode = 'n', key = { '<leader>', 'l', 'c', 'u' }, map = ':ComposerUpdate<CR>', label = 'composer update' },
{ filetype = 'php', mode = 'n', key = { '<leader>', 'l', 'c', 'j' }, map = ':ComposerJSON<CR>', label = 'open composer.json' },
}
},
}

28
lua/config/plugins/lib.lua

@ -0,0 +1,28 @@
return {
--------------------------------------------------------------------------------
-- Dependencies
--------------------------------------------------------------------------------
----------------------------------------------------------------------------
-- Denops - Provides for deno/js-based plugins
--
{ name = 'vim-denops/denops.vim', requires = { 'deno' }, config = { branch = 'main' } },
----------------------------------------------------------------------------
-- Asyncrun - Run shell commands and stream their output into a window
--
-- Usually vim waits for the command to finish and then opens the window and
-- shows the output which doesn't provide a great experience for anything
-- that takes more than a second to run. This works around that.
--
{ name = 'skywind3000/asyncrun.vim' },
----------------------------------------------------------------------------
-- Plenary - A bunch of utility functions
--
-- This is depended on by a bunch of other plugins.
--
{ name = 'nvim-lua/plenary.nvim' },
}

8
lua/config/plugins/local.lua

@ -0,0 +1,8 @@
return {
--------------------------------------------------------------------------------
-- Local
--------------------------------------------------------------------------------
-- Add local modifications here.
}

13
lua/config/plugins/tmp.lua

@ -0,0 +1,13 @@
return {
--------------------------------------------------------------------------------
-- Maybe Later
--------------------------------------------------------------------------------
----------------------------------------------------------------------------
-- nvim-cmp
--
-- LSP-integrated completion engine that is an absolute beast to install and
-- configure
}

146
lua/config/plugins/ui.lua

@ -0,0 +1,146 @@
return {
--------------------------------------------------------------------------------
-- UI
--------------------------------------------------------------------------------
----------------------------------------------------------------------------
-- Better netrw file browsing
--
-- Rather than use something like NERDtree, allow browsing the filesystem
-- directly in a buffer. For a general overview of why I think this is
-- good, see http://vimcasts.org/blog/2013/01/oil-and-vinegar-split-windows-and-project-drawer/
--
-- * Press '-' anywhere to open the file browser, and go up a folder when
-- in the file browser.
-- * Press gh in the file browser to toggle hidden (dot) files.
-- * Press y to tank the absolute path of the file you've selected.
-- * Press ~ to go to your home directory.
--
{ name = 'tpope/vim-vinegar' },
----------------------------------------------------------------------------
-- Improved status bar
--
-- Show your current mode... but also git branch, file path, changes, file
-- type, line endings, line number, and a whole bunch of other stuff. With
-- icons and pretty colours.
--
-- The "themes" package provides color schemes that will adapt to several
-- popular pre-existing themes.
--
-- TODO: Actually configure this because the default options are quite noisy.
--
{ name = 'vim-airline/vim-airline' },
{ name = 'vim-airline/vim-airline-themes' },
----------------------------------------------------------------------------
-- Fuzzy find files
--
-- Search through all files in the current folder (or current project thanks
-- to vim-rooter) with a fuzzy search.
--
-- Telescope can provide similar functionality (more colors, previews files,
-- etc) but I don't like the interface and can't be arsed to figure out the
-- customization right now. Main issues are that it supports "command" mode
-- (why) so cancelling takes two escapes, and I want to use either j/k or
-- ctrl+j/k to scroll lists not arrow keys and ctrl+n/p.
--
{
name = 'ctrlpvim/ctrlp.vim',
config = {
-- Only load this plugin once one of these vim commands is triggered
['on'] = { 'CtrlP', 'CtrlPMixed', 'CtrlPMRU' }
},
keys = {
{ mode = 'n', key = { '<C-p>' }, map = ':CtrlP<CR>', options = { silent = true }, label = 'fuzzy find files' },
}
},
----------------------------------------------------------------------------
-- Toggleterm - Better vim terminals
--
-- This provides a persistent, hide-able terminal that you can pull up
-- anywhere. It seems to be a little less awkward than the built-in terminal
-- as well as far as vim modes and such.
--
{
name = 'akinsho/toggleterm.nvim',
config = { branch = 'main' },
keys = {
-- { mode = 'n', key = { '<C-t>' }, map = '<cmd>exe "v:count" + tabpagenr() . "ToggleTerm"<CR>', label = "open terminal", options = { silent = true } },
-- { mode = 't', key = { '<C-t>' }, map = '<cmd>exe "v:count" + tabpagenr() . "ToggleTerm"<CR>', label = "close terminal", options = { silent = true } },
{ mode = 'n', key = { '<C-t>' }, map = '<cmd>exe v:count1 . "ToggleTerm"<CR>', label = "toggle terminal", options = { silent = true } },
{ mode = 't', key = { '<C-t>' }, map = '<cmd>exe v:count1 . "ToggleTerm"<CR>', label = "toggle terminal", options = { silent = true } },
}
},
----------------------------------------------------------------------------
-- Input/select UI improvements
--
-- Dressing provides an improved vim.ui.input and vim.ui.select interface by
-- using any of a variety of drivers.
--
-- Telescope is one such driver. If telescope isn't enabled, this should
-- fall back on some less-good-but-still-better-than-default builtins.
--
{ name = 'stevearc/dressing.nvim' },
----------------------------------------------------------------------------
-- UI framework
--
-- Telescope provides an implementation of some nicer select boxes as well
-- as several built-in functions for triggering them to do various things.
--
-- If telescope is enabled, it will take over the git branch selection ui
-- from the custom one I've added to vim-fugitive.
--
{
name = 'nvim-telescope/telescope.nvim',
keys = {
{ mode = 'n', key = { '<leader>', 'g', 'z' }, map = ':lua require("telescope.builtin").git_branches()<cr>', label = 'checkout' },
}
},
----------------------------------------------------------------------------
-- Colour previews
--
-- Highlight hex codes (and in css, css named colors + rgb/hsl, etc) by
-- colouring their background to match the colour.
--
{ name = 'ap/vim-css-color' },
----------------------------------------------------------------------------
-- Dim inactive buffers
--
-- By default this is set to dim them only a little so it's _very_ slight.
-- Still able to reference things in other buffers easily but provides a
-- small focusing effect on the active buffer.
--
--
-- This is the original. Bunch of unmerged PRs that fix bugs.
-- { name = 'sunjon/Shade.nvim', config = { opacity = 75 } },
-- This is a fork that, at least at the time, basically just had all the PRs
-- merged.
{ name = 'jghauser/shade.nvim', config = { opacity = 60 , branch = "main" } },
----------------------------------------------------------------------------
-- Easier buffer moving
--
-- This allows you to move buffers around a little more easily.
--
{
name = 'sindrets/winshift.nvim',
config = {
branch = 'main',
['on'] = { 'WinShift' }
},
keys = {
{ mode = 'n', key = { '<M-H>' }, map = '<Cmd>WinShift left<CR>', label = 'move buffer left' },
{ mode = 'n', key = { '<M-J>' }, map = '<Cmd>WinShift down<CR>', label = 'move buffer down' },
{ mode = 'n', key = { '<M-K>' }, map = '<Cmd>WinShift up<CR>', label = 'move buffer up' },
{ mode = 'n', key = { '<M-L>' }, map = '<Cmd>WinShift right<CR>', label = 'move buffer right' },
}
},
}

13
lua/data/start.lua

@ -0,0 +1,13 @@
return {
[[ ]],
[[ ]],
[[ \ | | \ \ /_) ]],
[[ . | | | | / -_)\ \ / | ` \ ]],
[[ _|\_|\_,_|_\_\\___| \_/ _|_|_|_| ]],
[[ ]],
[[ by nucleardog ]],
[[ ]],
[[ ]],
[[ Press `Alt+F1` for help. ]],
[[ ]],
}

420
lua/impatient/impatient.lua

@ -0,0 +1,420 @@
-- from https://github.com/lewis6991/impatient.nvim
local vim = vim
local api = vim.api
local uv = vim.loop
local _loadfile = loadfile
local get_runtime = api.nvim__get_runtime
local fs_stat = uv.fs_stat
local mpack = vim.mpack
local std_cache = vim.fn.stdpath('cache')
local std_dirs = {
['<APPDIR>'] = os.getenv('APPDIR'),
['<VIMRUNTIME>'] = os.getenv('VIMRUNTIME'),
['<STD_DATA>'] = vim.fn.stdpath('data'),
['<STD_CONFIG>'] = vim.fn.stdpath('config'),
}
local function modpath_mangle(modpath)
for name, dir in pairs(std_dirs) do
modpath = modpath:gsub(dir, name)
end
return modpath
end
local function modpath_unmangle(modpath)
for name, dir in pairs(std_dirs) do
modpath = modpath:gsub(name, dir)
end
return modpath
end
-- Overridable by user
local default_config = {
chunks = {
enable = true,
path = std_cache..'/luacache_chunks',
},
modpaths = {
enable = true,
path = std_cache..'/luacache_modpaths',
},
}
-- State used internally
local default_state = {
chunks = {
cache = {},
profile = nil,
dirty = false,
get = function(self, path)
return self.cache[modpath_mangle(path)]
end,
set = function(self, path, chunk)
self.cache[modpath_mangle(path)] = chunk
end
},
modpaths = {
cache = {},
profile = nil,
dirty = false,
get = function(self, mod)
if self.cache[mod] then
return modpath_unmangle(self.cache[mod])
end
end,
set = function(self, mod, path)
self.cache[mod] = modpath_mangle(path)
end
},
log = {}
}
---@diagnostic disable-next-line: undefined-field
local M = vim.tbl_deep_extend('keep', _G.__luacache_config or {}, default_config, default_state)
_G.__luacache = M
local function log(...)
M.log[#M.log+1] = table.concat({string.format(...)}, ' ')
end
function M.print_log()
for _, l in ipairs(M.log) do
print(l)
end
end
function M.enable_profile()
local P = require('impatient.profile')
M.chunks.profile = {}
M.modpaths.profile = {}
P.setup(M.modpaths.profile)
M.print_profile = function()
P.print_profile(M)
end
vim.cmd[[command! LuaCacheProfile lua _G.__luacache.print_profile()]]
end
local function hash(modpath)
local stat = fs_stat(modpath)
if stat then
return stat.mtime.sec..stat.mtime.nsec..stat.size
end
error('Could not hash '..modpath)
end
local function profile(m, entry, name, loader)
if m.profile then
local mp = m.profile
mp[entry] = mp[entry] or {}
if not mp[entry].loader and loader then
mp[entry].loader = loader
end
if not mp[entry][name] then
mp[entry][name] = uv.hrtime()
end
end
end
local function mprofile(mod, name, loader)
profile(M.modpaths, mod, name, loader)
end
local function cprofile(path, name, loader)
if M.chunks.profile then
path = modpath_mangle(path)
end
profile(M.chunks, path, name, loader)
end
local function get_runtime_file_from_parent(basename, paths)
-- Look in the cache to see if we have already loaded a parent module.
-- If we have then try looking in the parents directory first.
local parents = vim.split(basename, '/')
for i = #parents, 1, -1 do
local parent = table.concat(vim.list_slice(parents, 1, i), '/')
local ppath = M.modpaths:get(parent)
if ppath then
if ppath:sub(-9) == '/init.lua' then
ppath = ppath:sub(1, -10) -- a/b/init.lua -> a/b
else
ppath = ppath:sub(1, -5) -- a/b.lua -> a/b
end
for _, path in ipairs(paths) do
-- path should be of form 'a/b/c.lua' or 'a/b/c/init.lua'
local modpath = ppath..'/'..path:sub(#('lua/'..parent)+2)
if fs_stat(modpath) then
return modpath, 'cache(p)'
end
end
end
end
end
local function get_runtime_file_cached(basename, paths)
local modpath, loader
local mp = M.modpaths
if mp.enable then
if mp.cache[basename] then
local modpath_cached = mp:get(basename)
if fs_stat(modpath_cached) then
modpath, loader = modpath_cached, 'cache'
else
-- Invalidate
mp.cache[basename] = nil
mp.dirty = true
end
end
if not modpath then
modpath, loader = get_runtime_file_from_parent(basename, paths)
end
end
if not modpath then
-- What Neovim does by default; slowest
modpath, loader = get_runtime(paths, false, {is_lua=true})[1], 'standard'
end
if modpath then
mprofile(basename, 'resolve_end', loader)
if mp.enable and loader ~= 'cache' then
log('Creating cache for module %s', basename)
mp:set(basename, modpath)
mp.dirty = true
end
end
return modpath
end
local function extract_basename(pats)
local basename
-- Deconstruct basename from pats
for _, pat in ipairs(pats) do
for i, npat in ipairs{
-- Ordered by most specific
'lua/(.*)/init%.lua',
'lua/(.*)%.lua'
} do
local m = pat:match(npat)
if i == 2 and m and m:sub(-4) == 'init' then
m = m:sub(0, -6)
end
if not basename then
if m then
basename = m
end
elseif m and m ~= basename then
-- matches are inconsistent
return
end
end
end
return basename
end
local function get_runtime_cached(pats, all, opts)
local fallback = false
if all or not opts or not opts.is_lua then
-- Fallback
fallback = true
end
local basename
if not fallback then
basename = extract_basename(pats)
end
if fallback or not basename then
return get_runtime(pats, all, opts)
end
return {get_runtime_file_cached(basename, pats)}
end
-- Copied from neovim/src/nvim/lua/vim.lua with two lines changed
local function load_package(name)
local basename = name:gsub('%.', '/')
local paths = {"lua/"..basename..".lua", "lua/"..basename.."/init.lua"}
-- Original line:
-- local found = vim.api.nvim__get_runtime(paths, false, {is_lua=true})
local found = {get_runtime_file_cached(basename, paths)}
if #found > 0 then
local f, err = loadfile(found[1])
return f or error(err)
end
local so_paths = {}
for _,trail in ipairs(vim._so_trails) do
local path = "lua"..trail:gsub('?', basename) -- so_trails contains a leading slash
table.insert(so_paths, path)
end
-- Original line:
-- found = vim.api.nvim__get_runtime(so_paths, false, {is_lua=true})
found = {get_runtime_file_cached(basename, so_paths)}
if #found > 0 then
-- Making function name in Lua 5.1 (see src/loadlib.c:mkfuncname) is
-- a) strip prefix up to and including the first dash, if any
-- b) replace all dots by underscores
-- c) prepend "luaopen_"
-- So "foo-bar.baz" should result in "luaopen_bar_baz"
local dash = name:find("-", 1, true)
local modname = dash and name:sub(dash + 1) or name
local f, err = package.loadlib(found[1], "luaopen_"..modname:gsub("%.", "_"))
return f or error(err)
end
return nil
end
local function load_from_cache(path)
local mc = M.chunks
local cache = mc:get(path)
if not cache then
return nil, string.format('No cache for path %s', path)
end
local mhash, codes = unpack(cache)
if mhash ~= hash(path) then
mc:set(path)
mc.dirty = true
return nil, string.format('Stale cache for path %s', path)
end
local chunk = loadstring(codes)
if not chunk then
mc:set(path)
mc.dirty = true
return nil, string.format('Cache error for path %s', path)
end
return chunk
end
local function loadfile_cached(path)
cprofile(path, 'load_start')
local chunk, err
if M.chunks.enable then
chunk, err = load_from_cache(path)
if chunk and not err then
log('Loaded cache for path %s', path)
cprofile(path, 'load_end', 'cache')
return chunk
end
log(err)
end
chunk, err = _loadfile(path)
if not err and M.chunks.enable then
log('Creating cache for path %s', path)
M.chunks:set(path, {hash(path), string.dump(chunk)})
M.chunks.dirty = true
end
cprofile(path, 'load_end', 'standard')
return chunk, err
end
function M.save_cache()
local function _save_cache(t)
if not t.enable then
return
end
if t.dirty then
log('Updating chunk cache file: %s', t.path)
local f = assert(io.open(t.path, 'w+b'))
f:write(mpack.encode(t.cache))
f:flush()
t.dirty = false
end
end
_save_cache(M.chunks)
_save_cache(M.modpaths)
end
function M.clear_cache()
local function _clear_cache(t)
t.cache = {}
os.remove(t.path)
end
_clear_cache(M.chunks)
_clear_cache(M.modpaths)
end
local function init_cache()
local function _init_cache(t)
if not t.enable then
return
end
if fs_stat(t.path) then
log('Loading cache file %s', t.path)
local f = assert(io.open(t.path, 'rb'))
local ok
ok, t.cache = pcall(function()
return mpack.decode(f:read'*a')
end)
if not ok then
log('Corrupted cache file, %s. Invalidating...', t.path)
os.remove(t.path)
t.cache = {}
end
t.dirty = not ok
end
end
if not uv.fs_stat(std_cache) then
vim.fn.mkdir(std_cache, 'p')
end
_init_cache(M.chunks)
_init_cache(M.modpaths)
end
local function setup()
init_cache()
-- Override default functions
for i, loader in ipairs(package.loaders) do
if loader == vim._load_package then
package.loaders[i] = load_package
break
end
end
vim._load_package = load_package
vim.api.nvim__get_runtime = get_runtime_cached
loadfile = loadfile_cached
vim.cmd[[
augroup impatient
autocmd VimEnter,VimLeave * lua _G.__luacache.save_cache()
augroup END
command! LuaCacheClear lua _G.__luacache.clear_cache()
command! LuaCacheLog lua _G.__luacache.print_log()
]]
end
setup()
return M

222
lua/impatient/profile.lua

@ -0,0 +1,222 @@
local M = {}
local api, uv = vim.api, vim.loop
local function load_buffer(title, lines)
local bufnr = api.nvim_create_buf(false, false)
api.nvim_buf_set_lines(bufnr, 0, 0, false, lines)
api.nvim_buf_set_option(bufnr, 'bufhidden', 'wipe')
api.nvim_buf_set_option(bufnr, 'buftype', 'nofile')
api.nvim_buf_set_option(bufnr, 'swapfile', false)
api.nvim_buf_set_option(bufnr, "modifiable", false)
api.nvim_buf_set_name(bufnr, title)
api.nvim_set_current_buf(bufnr)
end
local function time_tostr(x)
if x == 0 then
return '?'
end
return string.format('%8.3fms', x)
end
local function mem_tostr(x)
local unit = ''
for _, u in ipairs{'K', 'M', 'G'} do
if x < 1000 then
break
end
x = x / 1000
unit = u
end
return string.format('%1.1f%s', x, unit)
end
function M.print_profile(I)
local mod_profile = I.modpaths.profile
local chunk_profile = I.chunks.profile
if not mod_profile and not chunk_profile then
print('Error: profiling was not enabled')
return
end
local total_resolve = 0
local total_load = 0
local modules = {}
for path, m in pairs(chunk_profile) do
m.load = m.load_end - m.load_start
m.load = m.load / 1000000
m.path = path or '?'
end
local module_content_width = 0
for module, m in pairs(mod_profile) do
m.resolve = 0
if m.resolve_end then
m.resolve = m.resolve_end - m.resolve_start
m.resolve = m.resolve / 1000000
end
m.module = module:gsub('/', '.')
m.loader = m.loader or m.loader_guess
local path = I.modpaths.cache[module]
local path_prof = chunk_profile[path]
m.path = path or '?'
if path_prof then
chunk_profile[path] = nil
m.load = path_prof.load
m.ploader = path_prof.loader
else
m.load = 0
m.ploader = 'NA'
end
total_resolve = total_resolve + m.resolve
total_load = total_load + m.load
if #module > module_content_width then
module_content_width = #module
end
modules[#modules+1] = m
end
table.sort(modules, function(a, b)
return (a.resolve + a.load) > (b.resolve + b.load)
end)
local paths = {}
local total_paths_load = 0
for _, m in pairs(chunk_profile) do
paths[#paths+1] = m
total_paths_load = total_paths_load + m.load
end
table.sort(paths, function(a, b)
return a.load > b.load
end)
local lines = {}
local function add(fmt, ...)
local args = {...}
for i, a in ipairs(args) do
if type(a) == 'number' then
args[i] = time_tostr(a)
end
end
lines[#lines+1] = string.format(fmt, unpack(args))
end
local time_cell_width = 12
local loader_cell_width = 11
local time_content_width = time_cell_width - 2
local loader_content_width = loader_cell_width - 2
local module_cell_width = module_content_width + 2
local tcwl = string.rep('', time_cell_width)
local lcwl = string.rep('', loader_cell_width)
local mcwl = string.rep('', module_cell_width+2)
local n = string.rep('', 200)
local module_cell_format = '%-'..module_cell_width..'s'
local loader_format = '%-'..loader_content_width..'s'
local line_format = '%s │ %s │ %s │ %s │ %s │ %s'
local row_fmt = line_format:format(
' %'..time_content_width..'s',
loader_format,
'%'..time_content_width..'s',
loader_format,
module_cell_format,
'%s')
local title_fmt = line_format:format(
' %-'..time_content_width..'s',
loader_format,
'%-'..time_content_width..'s',
loader_format,
module_cell_format,
'%s')
local title1_width = time_cell_width+loader_cell_width-1
local title1_fmt = ('%s │ %s │'):format(
' %-'..title1_width..'s', '%-'..title1_width..'s')
add('Note: this report is not a measure of startup time. Only use this for comparing')
add('between cached and uncached loads of Lua modules')
add('')
add('Cache files:')
for _, f in ipairs{ I.chunks.path, I.modpaths.path } do
local size = vim.loop.fs_stat(f).size
add(' %s %s', f, mem_tostr(size))
end
add('')
add('%s─%s┬%s─%s┐', tcwl, lcwl, tcwl, lcwl)
add(title1_fmt, 'Resolve', 'Load')
add('%s┬%s┼%s┬%s┼%s┬%s', tcwl, lcwl, tcwl, lcwl, mcwl, n)
add(title_fmt, 'Time', 'Method', 'Time', 'Method', 'Module', 'Path')
add('%s┼%s┼%s┼%s┼%s┼%s', tcwl, lcwl, tcwl, lcwl, mcwl, n)
add(row_fmt, total_resolve, '', total_load, '', 'Total', '')
add('%s┼%s┼%s┼%s┼%s┼%s', tcwl, lcwl, tcwl, lcwl, mcwl, n)
for _, p in ipairs(modules) do
add(row_fmt, p.resolve, p.loader, p.load, p.ploader, p.module, p.path)
end
add('%s┴%s┴%s┴%s┴%s┴%s', tcwl, lcwl, tcwl, lcwl, mcwl, n)
if #paths > 0 then
add('')
add(n)
local f3 = ' %'..time_content_width..'s │ %'..loader_content_width..'s │ %s'
add('Files loaded with no associated module')
add('%s┬%s┬%s', tcwl, lcwl, n)
add(f3, 'Time', 'Loader', 'Path')
add('%s┼%s┼%s', tcwl, lcwl, n)
add(f3, total_paths_load, '', 'Total')
add('%s┼%s┼%s', tcwl, lcwl, n)
for _, p in ipairs(paths) do
add(f3, p.load, p.loader, p.path)
end
add('%s┴%s┴%s', tcwl, lcwl, n)
add('')
end
load_buffer('Impatient Profile Report', lines)
end
M.setup = function(profile)
local _require = require
require = function(mod)
local basename = mod:gsub('%.', '/')
if not profile[basename] then
profile[basename] = {}
profile[basename].resolve_start = uv.hrtime()
profile[basename].loader_guess = 'C'
end
return _require(mod)
end
-- Add profiling around all the loaders
local pl = package.loaders
for i = 1, #pl do
local l = pl[i]
pl[i] = function(mod)
local basename = mod:gsub('%.', '/')
profile[basename].loader_guess = i == 1 and 'preloader' or 'loader #'..i
return l(mod)
end
end
end
return M

51
lua/lib/autocmd.lua

@ -0,0 +1,51 @@
--
-- Move this file to your neovim lua runtime path ie. ~/.config/nvim/lua/au.lua
--
local cmd = vim.api.nvim_command
local function autocmd(this, event, spec)
local is_table = type(spec) == 'table'
local pattern = is_table and spec[1] or '*'
local action = is_table and spec[2] or spec
if type(action) == 'function' then
action = this.set(action)
end
-- local e = type(event) == 'table' and table.concat(event, ',') or event
local pattern = type(pattern) == 'table' and table.concat(pattern, ',') or pattern
cmd('autocmd ' .. e .. ' ' .. pattern .. ' ' .. action)
end
local S = {
__au = {},
}
local X = setmetatable({}, {
__index = S,
__newindex = autocmd,
__call = autocmd,
})
function S.exec(id)
S.__au[id]()
end
function S.set(fn)
local id = string.format('%p', fn)
S.__au[id] = fn
return string.format('lua require("au").exec("%s")', id)
end
function S.group(grp, cmds)
cmd('augroup ' .. grp)
cmd('autocmd!')
if type(cmds) == 'function' then
cmds(X)
else
for _, au in ipairs(cmds) do
autocmd(S, au[1], { au[2], au[3] })
end
end
cmd('augroup END')
end
return X

15
lua/lib/dump.lua

@ -0,0 +1,15 @@
local dump = nil
dump = function(o)
if type(o) == 'table' then
local s = '{ '
for k,v in pairs(o) do
if type(k) ~= 'number' then k = '"'..k..'"' end
s = s .. '['..k..'] = ' .. dump(v) .. ','
end
return s .. '} '
else
return tostring(o)
end
end
return dump

9
lua/lib/file_exists.lua

@ -0,0 +1,9 @@
return function(path)
f = io.open(path, 'r')
if (f ~= nil) then
io.close(f)
return true
else
return false
end
end

14
lua/lib/get_visual_selection.lua

@ -0,0 +1,14 @@
return function()
local s_start = vim.fn.getpos("'<")
local s_end = vim.fn.getpos("'>")
local n_lines = math.abs(s_end[2] - s_start[2]) + 1
local lines = vim.api.nvim_buf_get_lines(0, s_start[2] - 1, s_end[2], false)
if (lines[1] == nil) then return nil end
lines[1] = string.sub(lines[1], s_start[3], -1)
if n_lines == 1 then
lines[n_lines] = string.sub(lines[n_lines], 1, s_end[3] - s_start[3] + 1)
else
lines[n_lines] = string.sub(lines[n_lines], 1, s_end[3])
end
return table.concat(lines, '\n')
end

4
lua/lib/has_command.lua

@ -0,0 +1,4 @@
return function(command)
result = vim.fn.executable(command)
return result == 1
end

7
lua/lib/map.lua

@ -0,0 +1,7 @@
return function(mode, lhs, rhs, opts)
local options = { noremap = true }
if opts then
options = vim.tbl_extend("force", options, opts)
end
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
end

9
lua/lib/merge.lua

@ -0,0 +1,9 @@
return function(arrays)
o = {}
for idx,arr in ipairs(arrays) do
for i=1,#arr do
table.insert(o, arr[i])
end
end
return o
end

47
lua/module.lua

@ -0,0 +1,47 @@
local Module = {}
function Module:new(obj)
obj = obj or {}
setmetatable(obj, self)
self.__index = self
return obj
end
function Module:configure(config)
self.config = config or {}
end
-- Called first to give the module a change to initialize class vars, etc
-- If any configuration is present, configure() will have been called before
-- initialize
function Module:initialize()
end
-- Give the moduel a chance to register dependencies/etc (e.g., add plugins)
function Module:register()
end
-- After all modules have had a chance to register dependencies/etc with
-- each other, commit gives all plugins a chance to take action on those.
function Module:commit()
end
-- Do any further module startup required
function Module:boot()
end
-- Do core module things, this is _always called
function Module:run()
end
-- This is _only_ called if we think we're running in a ui (e.g., neovim-qt)
function Module:gui()
end
-- For doing first-time setup/install
-- This could be called multiple times and should not lose data
-- (E.g., plug#install)
function Module:install()
end
return Module

249
lua/module/keymap.lua

@ -0,0 +1,249 @@
local M = require('module'):new()
local map = require('lib/map')
function M:initialize(config)
self.plugins = nukevim.modules:get('plugins')
self.keymap = {}
end
function M:register()
if (self.config.ui.enable) then
self.plugins:add('folke/which-key.nvim', { branch = "main" }, {
{ mode = 'n', key = { '?', '?', '?' }, map = ":lua nukevim.modules:get('keymap'):show()<CR>", hidden = true },
{ mode = 'i', key = { '?', '?', '?' }, map = "<cmd> lua nukevim.modules:get('keymap'):show()<CR>", hidden = true },
{ mode = 'v', key = { '?', '?', '?' }, map = "<cmd> lua nukevim.modules:get('keymap'):show()<CR>", hidden = true },
})
end
if (self.config.keys ~= nil) then
for idx, key in ipairs(self.config.keys) do
self:add(key)
end
end
end
function M:show()
mode = vim.fn.mode()
buffer = vim.fn.expand('%')
-- n, i, v/V
show_buffer_keys = false
for i=1,#self.keymap do
if (self.keymap[i].buffer ~= nil and self.keymap[i].buffer == buffer) then
show_buffer_keys = true
break
end
end
if (show_buffer_keys and false) then
-- buf = vim.api.nvim_create_buf(false, true)
-- win = vim.api.nvim_open_win(buf, false, {
-- relative = "editor",
-- height = 6,
-- focusable = false,
-- anchor = "SW",
-- style = "minimal",
-- row = vim.o.lines,
-- col = 0,
-- width = vim.o.columns
-- })
-- vim.api.nvim_buf_set_option(buf, "filetype", "WhichKey")
-- vim.api.nvim_buf_set_option(buf, "buftype", "nofile")
-- vim.api.nvim_win_set_option(win, "winhighlight", "NormalFloat:WhichKeyFloat")
-- vim.api.nvim_win_set_option(win, "foldmethod", "manual")
-- -- vim.api.nvim_win_set_option(win, "winblend", true)
-- vim.cmd([[autocmd! WinClosed <buffer> lua nukevim.modules:get('keymap'):closed()]])
-- vim.api.nvim_buf_set_lines(buf, 0, -1, false, {
-- "hello, world!",
-- "this is a window"
-- })
else
require('which-key').show('', { mode = mode })
end
end
function M:registerBufferLocal()
filetype = vim.bo.filetype
local_binds = {}
for i=1,#self.keymap do
if (self.keymap[i].filetype ~= nil and self.keymap[i].filetype == filetype) then
table.insert(local_binds, self.keymap[i])
end
end
self:registerWithWhichKey(local_binds, { buffer = 0 })
end
function M:map(mode, key, map, options)
M:add({
mode = mode,
key = key,
map = map,
options = options or { noremap = true }
})
end
function M:add(keymap)
-- todo: validate
keymap.mode = keymap.mode or nil
keymap.key = keymap.key or nil
if (type(keymap.key) == "string") then
parts = {}
for part in string.gmatch(keymap.key, '.') do
table.insert(parts, part)
end
keymap.key = parts
end
keymap.map = keymap.map or nil
keymap.options = keymap.options or { noremap = true }
keymap.label = keymap.label or nil
keymap.virtual = keymap.virtual or false
keymap.hidden = keymap.hidden or false
keymap.group = keymap.group or false
keymap.with = keymap.with or {}
keymap.without = keymap.without or {}
table.insert(self.keymap, keymap)
end
function M:commit()
if (self.plugins:has('folke/which-key.nvim') and self.config.ui.enable) then
self:commitWithWhichKey()
else
self:commitWithNative()
end
end
function M:commitWithWhichKey()
-- Set up whichkey
whichkey = require('which-key')
whichkey.setup({
ignore_missing = true,
plugins = {
marks = true,
registers = true,
spelling = {
enabled = true,
suggestions = 20
},
presets = {
operators = self.config.ui.show_builtin,
motions = self.config.ui.show_builtin,
text_objects = self.config.ui.show_builtin,
windows = self.config.ui.show_builtin,
nav = self.config.ui.show_builtin,
z = self.config.ui.show_builtin,
g = self.config.ui.show_builtin,
}
}
})
-- Build tree of key binds
self:registerWithWhichKey(self.keymap)
end
function M:registerWithWhichKey(keys, opts)
opts = opts or {}
tree = {}
node = nil
for idx, keymap in ipairs(keys) do
if (keymap.hidden) then
if (keymap.label ~= nil) then
keymap.options.desc = keymap.label
end
map(keymap.mode, table.concat(keymap.key, ""), keymap.map, keymap.options)
-- TODO: Hack-y hack.
elseif (keymap.filetype ~= nil and opts.buffer == nil) then
-- this only applies to a specific filetype, register() will register
-- it buffer-local when it's opened
else
if (tree[keymap.mode] == nil) then
tree[keymap.mode] = {}
end
node = tree[keymap.mode]
for i = 1, #keymap.key - 1 do
if (node[keymap.key[i]] == nil) then
node[keymap.key[i]] = {}
end
node = node[keymap.key[i]]
end
last = keymap.key[#keymap.key]
have_all_with = true
for idx,plugin in ipairs(keymap.with) do
have_all_with = have_all_with and self.plugins:has(plugin)
end
have_any_without = false
for idx,plugin in ipairs(keymap.without) do
have_any_without = have_any_without or self.plugins:has(plugin)
end
if (have_all_with and not have_any_without) then
if (keymap.group) then
node[last] = node[last] or {}
node[last]['name'] = keymap.label
elseif (keymap.virtual) then
node[last] = { keymap.label }
else
node[last] = { keymap.map, keymap.label or nil }
if (keymap.options.noremap) then
node[last].noremap = true
end
if (keymap.options.silent) then
node[last].silent = true
end
if (keymap.options.nowait) then
node[last].nowait = true
end
end
end
end
end
for mode, node in pairs(tree) do
local_opts = {}
for k, v in pairs(opts) do
local_opts[k] = v
end
local_opts['mode'] = mode
whichkey.register(node, local_opts)
end
end
function M:commitWithNative()
for idx, keymap in ipairs(self.keymap) do
if (keymap.label ~= nil) then
keymap.options.desc = keymap.label
end
if (keymap.virtual ~= true) then
have_all_with = true
for plugin in ipairs(keymap.with) do
have_all_with = have_all_with and self.plugins:has(plugin)
end
have_any_without = false
for plugin in ipairs(keymap.without) do
have_any_without = have_any_without or self.plugins:has(plugin)
end
if (have_all_with and not have_any_without) then
map(keymap.mode, table.concat(keymap.key, ''), keymap.map, keymap.options)
end
end
end
end
return M

27
lua/module/lsp.lua

@ -0,0 +1,27 @@
local M = require('module'):new()
local has_command = require('lib/has_command')
function M:initialize()
self.plugins = nukevim.modules:get('plugins')
end
function M:register()
self.plugins:add('neovim/nvim-lspconfig')
end
function M:run()
local lsp = require('lspconfig')
for provider,config in pairs(self.config.providers) do
if (has_command(config.command[1])) then
lsp[provider].setup({
cmd = config.command,
filetypes = config.filetypes
})
else
print("can't find command")
end
end
end
return M

66
lua/module/phpunit.lua

@ -0,0 +1,66 @@
local M = require('module'):new()
function M:initialize()
self.keymap = nukevim.modules:get('keymap')
end
function M:register()
self.keymap:add({
filetype = 'php',
mode = 'n',
key = { '<leader>', 'l', 'p' },
group = true,
label = 'phpunit'
})
self.keymap:add({
filetype = 'php',
mode = 'n',
key = { '<leader>', 'l', 'p', 'a' },
map = ':lua nukevim.modules:get("phpunit"):all()<CR>',
label = 'run all'
})
self.keymap:add({
filetype = 'php',
mode = 'n',
key = { '<leader>', 'l', 'p', 'f' },
map = ':lua nukevim.modules:get("phpunit"):file()<CR>',
label = 'run file'
})
self.keymap:add({
filetype = 'php',
mode = 'n',
key = { '<leader>', 'l', 'p', 't' },
map = ':lua nukevim.modules:get("phpunit"):test()<CR>',
label = 'run single test'
})
end
function M:run()
vim.g.asyncrun_open = 8
end
function M:all()
vim.call('asyncrun#run', '', {}, './vendor/bin/phpunit --colors=never')
end
function M:file()
file = vim.fn.expand('%')
vim.call('asyncrun#run', '', {}, './vendor/bin/phpunit --colors=never '..file)
end
function M:test()
-- so... this tries to get the current tag in the which-key window which is
-- always blank. there's probably a smarter way to do this, but we just...
-- wait a half second then do it.
vim.defer_fn(function()
file = vim.fn.expand('%')
test = vim.fn['tagbar#currenttag']('%s', 'nil')
if (test == 'nil') then
print('cannot find test function')
return
end
vim.call('asyncrun#run', '', {}, './vendor/bin/phpunit --colors=never --filter '..test..' '..file)
end, 500)
end
return M

88
lua/module/plugins.lua

@ -0,0 +1,88 @@
local M = require('module'):new()
local package_manager = require('plugin/vim_plug')
local file_exists = require('lib/file_exists')
local has_command = require('lib/has_command')
function M:initialize()
self.path = self.config.path or "~/.config/nvim/plugins/"
self.auto_install = self.config.auto_install or true
self.auto_cleanup = self.config.auto_cleanup or true
self.plugins = {}
self.keymap = nukevim.modules:get('keymap')
end
function M:register()
for idx, plugin in pairs(self.config.plugins) do
if (plugin.enable == nil or plugin.enable == true) then
self:add(plugin.name, plugin.config or nil, plugin.keys or nil, plugin.requires or nil)
end
end
end
function M:commit()
package_manager:initialize(self.path)
package_manager:enter()
for idx, plugin in pairs(self.plugins) do
package_manager:add(plugin.name, plugin.config or nil)
end
package_manager:exit()
-- Check if any plugins have lua modules, if so register them
for idx, plugin in pairs(self.plugins) do
if (file_exists(vim.env.HOME .. '/.config/nvim/lua/plugin/' .. plugin.name:gsub('%.', '-') .. '.lua')) then
local plugin_module = require('plugin/' .. plugin.name:gsub('%.', '-')):new()
plugin_module:configure(plugin.config)
nukevim.modules:addInstance(plugin.name, plugin_module)
end
end
end
function M:boot()
if (self.auto_install and package_manager:hasPendingPackages()) then
package_manager:install()
end
if (self.auto_cleanup) then
package_manager:cleanup()
end
end
function M:add(name, config, keys, requires)
if (requires ~= nil) then
for i=1,#requires do
if (not has_command(requires[i])) then
return
end
end
end
table.insert(self.plugins, { name = name, config = config })
if (keys ~= nil) then
for idx, key in ipairs(keys) do
self.keymap:add(key)
end
end
end
function M:has(name)
for idx, plugin in pairs(self.plugins) do
if (plugin.name == name) then
return true
end
end
return false
end
function M:install()
package_manager:install()
end
function M:cleanup()
package_manager:cleanup()
end
return M

13
lua/module/settings.lua

@ -0,0 +1,13 @@
local M = require('module'):new()
-- We run this late to give this a chance to override most other modules since
-- they're explicitly set by the user.
function M:run()
for t,opts in pairs(self.config.settings) do
for k, v in pairs(opts) do
vim[t][k] = v
end
end
end
return M

154
lua/module/start.lua

@ -0,0 +1,154 @@
local M = require('module'):new()
function M:boot()
self.opts = {
win = {
number = false,
list = false,
colorcolumn = "",
cursorline = false
},
buf = {
}
}
self.is_gui = false
self.is_visible = false
end
function M:run()
if (vim.fn.argc() == 0 or vim.fn.line2byte("$") ~= -1) then -- and not vim.opt.insertmode) then
self:show()
end
end
function M:gui()
local win = vim.api.nvim_get_current_win()
local buf = vim.api.nvim_get_current_buf()
self.is_gui = true
self.opts.win.list = vim.api.nvim_win_get_option(win, 'list')
if (self.is_visible) then
vim.api.nvim_win_set_option(win, 'list', false)
self:draw(buf)
end
end
function M:show()
local height = vim.api.nvim_get_option('lines') - 2
local width = vim.api.nvim_get_option('columns')
local lines = require('data/start')
if (#lines > height) then
return
end
for i=1,#lines do
if (#lines[i] > width) then
return
end
end
self.is_visible = true
local win = vim.api.nvim_get_current_win()
local buf = vim.api.nvim_create_buf(true, true)
self:draw(buf)
vim.api.nvim_buf_set_option(buf, "modified", false)
vim.api.nvim_buf_set_option(buf, "buflisted", false)
vim.api.nvim_buf_set_option(buf, "bufhidden", "wipe")
vim.api.nvim_buf_set_option(buf, "buftype", "nofile")
vim.api.nvim_buf_set_option(buf, "swapfile", false)
for k, v in pairs(self.opts.win) do
old_val = vim.api.nvim_win_get_option(win, k)
vim.api.nvim_win_set_option(win, k, v)
self.opts.win[k] = old_val
end
for k, v in pairs(self.opts.buf) do
old_val = vim.api.nvim_buf_get_option(buf, k)
vim.api.nvim_buf_set_option(buf, k, v)
self.opts.buf[k] = old_val
end
-- vim.api.nvim_win_set_option(win, "number", false)
-- vim.api.nvim_win_set_option(win, "list", false)
-- vim.api.nvim_win_set_option(win, "cursorline", false)
-- vim.api.nvim_win_set_option(win, "colorcolumn", "")
vim.api.nvim_set_current_buf(buf)
vim.api.nvim_create_autocmd("InsertEnter,WinEnter", {
pattern = "<buffer>",
callback = function()
vim.cmd("enew")
self:hide()
end
})
vim.api.nvim_create_autocmd("FileType", {
pattern = "netrw",
callback = function()
self:hide()
end
})
end
function M:hide()
if (not self.is_visible) then
return
end
self.is_visible = false
local buf = vim.api.nvim_get_current_buf()
local win = vim.api.nvim_get_current_win()
vim.api.nvim_buf_set_option(buf, "modifiable", true)
vim.api.nvim_buf_set_option(buf, "buflisted", true)
vim.api.nvim_buf_set_option(buf, "buflisted", true)
-- vim.api.nvim_win_set_option(win, "number", nukevim.config.settings.settings.o.number or false)
-- vim.api.nvim_win_set_option(win, "colorcolumn", nukevim.config.settings.settings.o.cc or nukevim.config.settings.settings.o.colorcolumn or "")
-- vim.api.nvim_win_set_option(win, "cursorline", nukevim.config.settings.settings.o.cursorline or false)
-- if (self.is_gui) then
-- enable_list = nukevim.config.ui.gui.show_whitespace or nukevim.config.ui.tui.show_whitespace or false
-- else
-- enable_list = nukevim.config.ui.tui.show_whitespace or false
-- end
-- vim.api.nvim_win_set_option(win, "list", enable_list)
for k, v in pairs(self.opts.win) do
vim.api.nvim_win_set_option(win, k, v)
end
for k, v in pairs(self.opts.buf) do
vim.api.nvim_buf_set_option(buf, k, v)
end
end
function M:draw(buf)
local height = vim.api.nvim_get_option('lines') - 2
local width = vim.api.nvim_get_option('columns')
local lines = require('data/start')
for i=1,#lines do
lines[i] = self:center(lines[i])
end
vim.api.nvim_buf_set_lines(buf, 0, -1, false, lines)
end
function M:center(string)
width = vim.api.nvim_get_option('columns')
string_length = #string
padding_length = (width - string_length) / 2 - 1
padding = ''
for i=1,padding_length do
padding = padding .. ' '
end
return padding .. string .. padding
end
return M

14
lua/module/syntax.lua

@ -0,0 +1,14 @@
local M = require('module'):new()
function M:initialize(config)
self.plugins = nukevim.modules:get('plugins')
end
function M:register()
if (self.plugins:has('TysonAndre/php-vim-syntax')) then
vim.g.polyglot_disabled = { "php" }
end
self.plugins:add('sheerun/vim-polyglot')
end
return M

35
lua/module/ui.lua

@ -0,0 +1,35 @@
local M = require('module'):new()
function M:run()
self:configureUi(self.config.tui)
end
function M:gui()
self:configureUi(self.config.gui)
end
function M:configureUi(config)
-- Set the font if set
if (config.font ~= nil and config.font.family ~= nil and config.font.size ~= nil) then
vim.o.guifont = config.font.family..':h'..config.font.size
end
-- Set the color scheme if set
if (config.theme ~= nil) then
vim.cmd('colorscheme '..config.theme)
end
if (config.show_whitespace) then
vim.o.listchars = "tab:>-,trail:.,extends:.,precedes:.,space:."
vim.o.list = true
-- used to be 22, changed to not perfectly match the line highlight or cursor
if (config.show_whitespace == true) then
guifg = 'gray30'
else
guifg = config.show_whitespace
end
vim.highlight.create('Whitespace', { guifg = guifg })
end
end
return M

62
lua/modules.lua

@ -0,0 +1,62 @@
local Modules = {}
function Modules:new(obj)
obj = obj or {}
setmetatable(obj, self)
self.__index = self
obj:initialize()
return obj
end
function Modules:initialize()
self.modules = {}
end
function Modules:add(name, config)
local module = require('module/'..name)
self.modules[name] = { instance = module:new(), config = config }
end
function Modules:addInstance(name, instance, config)
self.modules[name] = { instance = instance, config = config }
end
function Modules:get(name)
if (self.modules[name] == nil) then
print("MODULE NOT LOADED: "..name)
end
return self.modules[name]['instance']
end
function Modules:configure()
for name, module in pairs(self.modules) do
module.instance:configure(module.config)
end
end
function Modules:call(method)
orders = {}
for name, module in pairs(self.modules) do
if (module.config ~= nil and module.config.order ~= nil) then
table.insert(orders, module.config.order)
end
end
table.sort(orders)
for idx,order in ipairs(orders) do
for name, module in pairs(self.modules) do
if (module.config ~= nil and module.config.order ~= nil and module.config.order == order) then
module['instance'][method](module['instance'])
end
end
end
for name, module in pairs(self.modules) do
if (module.config == nil or module.config.order == nil) then
module['instance'][method](module['instance'])
end
end
end
return Modules

55
lua/nukevim.lua

@ -0,0 +1,55 @@
local NukeVim = {}
function NukeVim:new(obj)
obj = obj or {}
setmetatable(obj, self)
self.__index = self
return obj
end
function NukeVim:enableCaching()
self.lua_cache = require('impatient/impatient')
end
function NukeVim:enableProfiling()
self.lua_cache.enable_profile()
end
function NukeVim:initialize()
-- init dependencies
self.config = require('_config')
self.modules = require('modules'):new()
-- load modules based on config
for module, config in pairs(self.config) do
if (config.enable == nil or config.enable == true) then
self.modules:add(module, config)
end
end
-- Start up modules
self.modules:configure()
self.modules:call('initialize')
self.modules:call('register')
self.modules:call('commit')
self.modules:call('boot')
end
function NukeVim:run()
self.modules:call('run')
end
function NukeVim:gui()
self.modules:call('gui')
end
function NukeVim:install()
self.modules:call('install')
vim.cmd(':helptags ~/.config/nvim/doc/')
end
function NukeVim:help()
vim.cmd(':h nukevim')
end
return NukeVim

9
lua/plugin/akinsho/toggleterm-nvim.lua

@ -0,0 +1,9 @@
local M = require('module'):new()
function M:boot()
require('toggleterm').setup({
})
end
return M

12
lua/plugin/apzelos/blamer-nvim.lua

@ -0,0 +1,12 @@
local M = require('module'):new()
function M:boot()
vim.g.blamer_enabled = 1
vim.g.blamer_delay = 1000
vim.g.blamer_show_in_visual_modes = 0
vim.g.blamer_show_in_insert_modes = 0
vim.g.blamer_relative_time = 1
end
return M

38
lua/plugin/dein.lua

@ -0,0 +1,38 @@
local M = {}
M.path = nil
function M:initialize(path)
self.path = path
vim.o.runtimepath = vim.o.runtimepath .. "," .. self.path .. "repos/github.com/Shougo/dein.vim/"
end
function M:enter()
vim.call('dein#begin', self.path)
end
function M:exit()
vim.call('dein#end')
end
function M:add(name, config)
if (type(config) == "nil") then
vim.call('dein#add', name)
else
vim.call('dein#add', name, config)
end
end
function M:install()
vim.call('dein#install')
end
function M:hasPendingPackages()
return vim.call('dein#check_install') ~= 0
end
function M:cleanup()
vim.call('map', vim.call('dein#check_clean'), "delete(v:val, 'rf')")
end
return M

11
lua/plugin/editorconfig/editorconfig-vim.lua

@ -0,0 +1,11 @@
local M = require('module'):new()
function M:boot()
-- If fugitive is loaded this requires an exclusion to
-- prevent conflicts.
if (nukevim.modules:get('plugins'):has('tpope/vim-fugitive')) then
vim.g.EditorConfig_exclude_patterns = { 'fugitive://.*' }
end
end
return M

9
lua/plugin/folke/todo-comments-nvim.lua

@ -0,0 +1,9 @@
local M = require('module'):new()
function M:boot()
require('todo-comments').setup({
})
end
return M

17
lua/plugin/folke/trouble-nvim.lua

@ -0,0 +1,17 @@
local M = require('module'):new()
function M:boot()
require('trouble').setup({
icons = false,
fold_open = 'v',
fold_closed = '>',
action_keys = {
jump = { '<tab>' },
jump_close = { '<cr>' },
},
auto_preview = false
})
end
return M

12
lua/plugin/jghauser/shade-nvim.lua

@ -0,0 +1,12 @@
local M = require('module'):new()
function M:boot()
opacity = self.config.opacity
if (opacity == nil) then opacity = 90 end
require('shade').setup({
overlay_opacity = opacity
})
end
return M

9
lua/plugin/joonty/vim-phpunitqf.lua

@ -0,0 +1,9 @@
local M = require('module'):new()
function M:boot()
vim.g.phpunit_cmd = "./vendor/bin/phpunit"
vim.g.phpunit_args = "--colors=always"
end
return M

10
lua/plugin/nacro90/numb-nvim.lua

@ -0,0 +1,10 @@
local M = require('module'):new()
function M:boot()
require('numb').setup({
centered_peeking = false
})
end
return M

18
lua/plugin/preservim/tagbar.lua

@ -0,0 +1,18 @@
local M = require('module'):new()
function M:boot()
vim.g.tagbar_silent = 1
vim.g.tagbar_type_php = {
kinds = {
'i:interfaces',
'c:classes',
'd:constant definitions:0:0',
'f:functions',
-- 'v:variables:0:0',
'j:javascript functions',
}
}
end
return M

8
lua/plugin/stevearc/dressing-nvim.lua

@ -0,0 +1,8 @@
local M = require('module'):new()
function M:boot()
require('dressing').setup({
})
end
return M

40
lua/plugin/tpope/vim-fugitive.lua

@ -0,0 +1,40 @@
local M = require('module'):new()
function M:boot()
self.plugins = nukevim.modules:get('plugins')
end
function M:on_change_branch()
vim.ui.input({
prompt = "branch? ",
-- completion =
}, function(branch)
if (branch ~= nil) then
vim.cmd(':G branch '..branch)
vim.cmd(':G checkout '..branch)
end
end)
end
function M:on_checkout()
branches_out = vim.fn.system('git branch')
branches = {}
for branch in branches_out:gmatch("[^\r\n]+") do
if (branch:sub(1, 1) ~= '*') then
table.insert(branches, branch)
end
end
vim.ui.select(branches, {
prompt = 'branch? '
},
function(branch)
if (branch ~= nil) then
vim.cmd(':G checkout '..branch)
end
end
)
end
return M

9
lua/plugin/vim-airline/vim-airline.lua

@ -0,0 +1,9 @@
local M = require('module'):new()
function M:boot()
-- Don't show mode in status bar since it's in our new fancy bar
vim.o.showmode = false
vim.g.airline_powerline_fonts = 1
end
return M

70
lua/plugin/vim-vdebug/vdebug.lua

@ -0,0 +1,70 @@
local M = require('module'):new()
local get_visual_selection = require('lib/get_visual_selection')
function M:boot()
vim.g.vdebug_options = {
break_on_open = 0,
path_maps = {
-- This is only evaluated on startup so will work if the editor is
-- started inside the project (I think vim-rooter will have run by
-- now) but not if you've navigated into a project like I do basically
-- every single time.
-- ["/var/www/html"] = getcwd()
},
marker_default = '*',
marker_closed_tree = '>',
marker_open_tree = 'v',
}
end
function M:setBreakpoint()
vim.cmd(":Breakpoint")
end
function M:setConditionalBreakpoint()
eval = vim.ui.input({
prompt = "Enter condition"
}, function(expression)
if (expression ~= nil) then
vim.cmd(":Breakpoint conditional " .. expression)
end
end)
end
function M:startTrace()
selected = get_visual_selection()
if (selected == nil) then
vim.ui.input({
prompt = "Enter trace expression"
}, function(expression)
if (expression ~= nil) then
vim.cmd(":VdebugTrace " .. expression)
end
end)
else
vim.cmd(":VdebugTrace " .. selected)
end
end
function M:eval()
selected = get_visual_selection()
if (selected == nil) then
vim.ui.input({
prompt = "Enter eval expression"
}, function(expression)
if (expression ~= nil) then
vim.cmd(":VdebugEval " .. expression)
end
end)
else
vim.cmd(":VdebugEval " .. selected)
end
end
function M:showBreakpoints()
vim.cmd(":BreakpointWindow")
end
return M

37
lua/plugin/vim_plug.lua

@ -0,0 +1,37 @@
local M = {}
M.path = nil
function M:initialize(path)
self.path = path
end
function M:enter()
vim.call('plug#begin', self.path)
end
function M:exit()
vim.call('plug#end')
end
function M:add(name, config)
if (type(config) == "nil") then
vim.fn['plug#'](name)
else
vim.fn['plug#'](name, config)
end
end
function M:install()
-- Bleh, but it works
vim.cmd(':PlugInstall')
end
function M:hasPendingPackages()
return false
end
function M:cleanup()
end
return M
Loading…
Cancel
Save