Browse Source

trying to get react commenting to work

Chris 4 năm trước cách đây
mục cha
commit
570d317285
7 tập tin đã thay đổi với 72 bổ sung349 xóa
  1. 5 3
      init.lua
  2. 1 1
      lua/lsp/js-ts-ls.lua
  3. 53 12
      lua/nv-kommentary/init.lua
  4. 0 109
      lua/nv-vscode/init.vim
  5. 0 220
      lua/nv-whichkey/init.vim
  6. 6 4
      lua/plugins.lua
  7. 7 0
      lua/utils.lua

+ 5 - 3
init.lua

@@ -1,12 +1,11 @@
 if vim.g.vscode then
-  vim.cmd('source ~/.config/nvim/lua/nv-vscode/init.vim')
+  vim.cmd('source ~/.config/nvim/vimscript/nv-vscode/init.vim')
 else
   -- General mappings
   require('plugins')
   require('keymappings')
   require('settings')
   require('colorscheme')
-  require('utils')
 
   -- Plugins
   require('nv-compe')
@@ -31,7 +30,8 @@ else
   require('nv-gitblame')
 
   -- Which Key (Hope to replace with Lua plugin someday)
-  vim.cmd('source ~/.config/nvim/lua/nv-whichkey/init.vim')
+  vim.cmd('source ~/.config/nvim/vimscript/nv-whichkey/init.vim')
+--  vim.cmd('source ~/.config/nvim/vimscript/nv-commentary/init.vim')
 
   -- LSP
   require('lsp')
@@ -42,4 +42,6 @@ else
   require('lsp.python-ls')
   require('lsp.json-ls')
   require('lsp.yaml-ls')
+  require('utils')
+  vim.cmd([[autocmd BufRead * lua print("hi")]])
 end

+ 1 - 1
lua/lsp/js-ts-ls.lua

@@ -4,7 +4,7 @@
 -- local capabilities = vim.lsp.protocol.make_client_capabilities()
 -- capabilities.textDocument.completion.completionItem.snippetSupport = true;
 local on_attach_common = function(client)
-    print("LSP Initialized")
+    --print("LSP Initialized")
     -- require'completion'.on_attach(client)
     require'illuminate'.on_attach(client)
 end

+ 53 - 12
lua/nv-kommentary/init.lua

@@ -1,19 +1,60 @@
--- TODO bring back when kommentary works for React
-vim.g.kommentary_create_default_mappings = false
-vim.api.nvim_set_keymap("n", "<leader>/", "<Plug>kommentary_line_default", {})
-vim.api.nvim_set_keymap("v", "<leader>/", "<Plug>kommentary_visual_default", {})
+-- vim.api.nvim_set_keymap("v", "<leader>/", "<Plug>kommentary_visual_default", {})
 
-require('kommentary.config').configure_language("default", {
-    prefer_single_line_comments = true,
-})
+-- require('kommentary.config').configure_language("default", {
+--     prefer_single_line_comments = true,
+-- })
 
 -- require('kommentary.config').configure_language("python", {
 --     prefer_single_line_comments = true,
 -- })
 
-require('kommentary.config').configure_language("javascriptreact", {
-    prefer_multi_line_comments = true,
-    -- single_line_comment_string = "{/*\\ %s\\ */}",
-    multi_line_comment_strings = {"{/*", "*/}"},
-})
+-- require('kommentary.config').configure_language("javascriptreact", {
+--     prefer_multi_line_comments = true,
+--     -- single_line_comment_string = "{/*\\ %s\\ */}",
+--     multi_line_comment_strings = {"{/*", "*/}"},
+-- })
+
+--[[ This is our custom function for toggling comments with a custom commentstring,
+it's based on the default toggle_comment, but before calling the function for
+toggling ranges, it sets the commenstring to something else. After it is done,
+it sets it back to what it was before. ]]
+-- function toggle_comment_custom_commentstring(...)
+--     local args = {...}
+--     -- Save the current value of commentstring so we can restore it later
+--     local commentstring = vim.bo.commentstring
+--     -- Set the commentstring for the current buffer to something new
+--     vim.bo.commentstring =  "{/*%s*/}"
+--     -- print(args[1])
+--     -- print(args[2])
+--     -- print(vim.inspect(args[1]))
+--     print(vim.inspect(args))
+
+--     --[[ Call the function for toggling comments, which will resolve the config
+--     to the new commentstring and proceed with that. ]]
+--     require('kommentary.kommentary').toggle_comment_range(args[1], args[2],
+--         require('kommentary.config').get_modes().normal)
+--     -- Restore the original value of commentstring
+--     vim.api.nvim_buf_set_option(0, "commentstring", commentstring)
+-- end
+
+--     -- vim.bo.commentstring =  "{/*%s*/}"
+-- -- Set the extra mapping for toggling a single line in normal mode
+-- vim.api.nvim_set_keymap('n', '<leader>/',
+-- '<cmd>lua require("kommentary");kommentary.go(' .. require('kommentary.config').context.line .. ', '
+-- .. "'toggle_comment_custom_commentstring'" .. ')<cr>',
+-- { noremap = true, silent = true })
+-- -- -- Set the extra mapping for toggling a range with a motion
+-- -- vim.api.nvim_set_keymap('n', '<leader>/',
+-- -- 'v:lua.kommentary.go(' .. require('kommentary.config').context.init .. ', ' ..
+-- -- "'toggle_comment_custom_commentstring'" .. ')',
+-- -- { noremap = true, expr = true })
+-- -- -- Set the extra mapping for toggling a range with a visual selection
+-- -- vim.api.nvim_set_keymap('v', 'gC',
+-- -- '<cmd>lua require("kommentary");kommentary.go(' .. require('kommentary.config').context.visual .. ', '
+-- -- .. "'toggle_comment_custom_commentstring'" .. ')<cr>',
+-- -- { noremap = true, silent = true })
+
+require('nvim_comment').setup()
+
 
+--vim.api.nvim_buf_set_option(0, "commentstring", "{/*%s*/}")

+ 0 - 109
lua/nv-vscode/init.vim

@@ -1,109 +0,0 @@
-" TODO there is a more contemporary version of this file
-" TODO Also some of it is redundant
-"VSCode
-function! s:split(...) abort
-    let direction = a:1
-    let file = a:2
-    call VSCodeCall(direction == 'h' ? 'workbench.action.splitEditorDown' : 'workbench.action.splitEditorRight')
-    if file != ''
-        call VSCodeExtensionNotify('open-file', expand(file), 'all')
-    endif
-endfunction
-
-function! s:splitNew(...)
-    let file = a:2
-    call s:split(a:1, file == '' ? '__vscode_new__' : file)
-endfunction
-
-function! s:closeOtherEditors()
-    call VSCodeNotify('workbench.action.closeEditorsInOtherGroups')
-    call VSCodeNotify('workbench.action.closeOtherEditors')
-endfunction
-
-function! s:manageEditorSize(...)
-    let count = a:1
-    let to = a:2
-    for i in range(1, count ? count : 1)
-        call VSCodeNotify(to == 'increase' ? 'workbench.action.increaseViewSize' : 'workbench.action.decreaseViewSize')
-    endfor
-endfunction
-
-function! s:vscodeCommentary(...) abort
-    if !a:0
-        let &operatorfunc = matchstr(expand('<sfile>'), '[^. ]*$')
-        return 'g@'
-    elseif a:0 > 1
-        let [line1, line2] = [a:1, a:2]
-    else
-        let [line1, line2] = [line("'["), line("']")]
-    endif
-
-    call VSCodeCallRange("editor.action.commentLine", line1, line2, 0)
-endfunction
-
-function! s:openVSCodeCommandsInVisualMode()
-    normal! gv
-    let visualmode = visualmode()
-    if visualmode == "V"
-        let startLine = line("v")
-        let endLine = line(".")
-        call VSCodeNotifyRange("workbench.action.showCommands", startLine, endLine, 1)
-    else
-        let startPos = getpos("v")
-        let endPos = getpos(".")
-        call VSCodeNotifyRangePos("workbench.action.showCommands", startPos[1], endPos[1], startPos[2], endPos[2], 1)
-    endif
-endfunction
-
-function! s:openWhichKeyInVisualMode()
-    normal! gv
-    let visualmode = visualmode()
-    if visualmode == "V"
-        let startLine = line("v")
-        let endLine = line(".")
-        call VSCodeNotifyRange("whichkey.show", startLine, endLine, 1)
-    else
-        let startPos = getpos("v")
-        let endPos = getpos(".")
-        call VSCodeNotifyRangePos("whichkey.show", startPos[1], endPos[1], startPos[2], endPos[2], 1)
-    endif
-endfunction
-
-
-command! -complete=file -nargs=? Split call <SID>split('h', <q-args>)
-command! -complete=file -nargs=? Vsplit call <SID>split('v', <q-args>)
-command! -complete=file -nargs=? New call <SID>split('h', '__vscode_new__')
-command! -complete=file -nargs=? Vnew call <SID>split('v', '__vscode_new__')
-command! -bang Only if <q-bang> == '!' | call <SID>closeOtherEditors() | else | call VSCodeNotify('workbench.action.joinAllGroups') | endif
-
-" Better Navigation
-nnoremap <silent> <C-j> :call VSCodeNotify('workbench.action.navigateDown')<CR>
-xnoremap <silent> <C-j> :call VSCodeNotify('workbench.action.navigateDown')<CR>
-nnoremap <silent> <C-k> :call VSCodeNotify('workbench.action.navigateUp')<CR>
-xnoremap <silent> <C-k> :call VSCodeNotify('workbench.action.navigateUp')<CR>
-nnoremap <silent> <C-h> :call VSCodeNotify('workbench.action.navigateLeft')<CR>
-xnoremap <silent> <C-h> :call VSCodeNotify('workbench.action.navigateLeft')<CR>
-nnoremap <silent> <C-l> :call VSCodeNotify('workbench.action.navigateRight')<CR>
-xnoremap <silent> <C-l> :call VSCodeNotify('workbench.action.navigateRight')<CR>
-
-nnoremap gr <Cmd>call VSCodeNotify('editor.action.goToReferences')<CR>
-
-" Bind C-/ to vscode commentary since calling from vscode produces double comments due to multiple cursors
-xnoremap <expr> <C-/> <SID>vscodeCommentary()
-nnoremap <expr> <C-/> <SID>vscodeCommentary() . '_'
-
-nnoremap <silent> <C-w>_ :<C-u>call VSCodeNotify('workbench.action.toggleEditorWidths')<CR>
-
-nnoremap <silent> <Space> :call VSCodeNotify('whichkey.show')<CR>
-xnoremap <silent> <Space> :<C-u>call <SID>openWhichKeyInVisualMode()<CR>
-
-xnoremap <silent> <C-P> :<C-u>call <SID>openVSCodeCommandsInVisualMode()<CR>
-
-xmap gc  <Plug>VSCodeCommentary
-nmap gc  <Plug>VSCodeCommentary
-omap gc  <Plug>VSCodeCommentary
-nmap gcc <Plug>VSCodeCommentaryLine
-
-" Simulate same TAB behavior in VSCode
-  nmap <Tab> :Tabnext<CR>
-  nmap <S-Tab> :Tabprev<CR>

+ 0 - 220
lua/nv-whichkey/init.vim

@@ -1,220 +0,0 @@
-" Leader Key Maps
-
-" Timeout
-let g:which_key_timeout = 100
-
-let g:which_key_display_names = {'<CR>': '↵', '<TAB>': '⇆'}
-
-" Map leader to which_key
-nnoremap <silent> <leader> :silent <c-u> :silent WhichKey '<Space>'<CR>
-vnoremap <silent> <leader> :silent <c-u> :silent WhichKeyVisual '<Space>'<CR>
-
-let g:which_key_map =  {}
-let g:which_key_sep = '→'
-
-" Not a fan of floating windows for this
-let g:which_key_use_floating_win = 0
-let g:which_key_max_size = 0
-
-" Hide status line
-autocmd! FileType which_key
-autocmd  FileType which_key set laststatus=0 noshowmode noruler
-  \| autocmd BufLeave <buffer> set laststatus=2 noshowmode ruler
-
-
-" Single mappings
-" let g:which_key_map['/'] = [ ':call Comment()'                                 , 'comment' ]
-" let g:which_key_map['/'] = { 'name' : 'comment' }
-let g:which_key_map['/'] = 'which_key_ignore'
-let g:which_key_map['?'] = [ ':NvimTreeFindFile'                               , 'find current file' ]
-let g:which_key_map['e'] = [ ':NvimTreeToggle'                                 , 'explorer' ]
-let g:which_key_map['f'] = [ ':Telescope find_files'                           , 'find files' ]
-let g:which_key_map['h'] = [ '<C-W>s'                                          , 'split below']
-let g:which_key_map['m'] = [ ':MarkdownPreviewToggle'                          , 'markdown preview']
-let g:which_key_map['n'] = [ ':let @/ = ""'                                    , 'no highlight' ]
-let g:which_key_map['r'] = [ ':RnvimrToggle'                                   , 'ranger' ]
-" TODO create entire treesitter section
-let g:which_key_map['T'] = [ ':TSHighlightCapturesUnderCursor'                 , 'treesitter highlight' ]
-let g:which_key_map['v'] = [ '<C-W>v'                                          , 'split right']
-" Add Zen mode, play nice with status line
-" let g:which_key_map['z'] = [ 'Goyo'                                            , 'zen' ]
-
-" Group mappings
-
-" a is for actions
-let g:which_key_map.a = {
-      \ 'name' : '+actions' ,
-      \ 'c' : [':ColorizerToggle'        , 'colorizer'],
-      \ 'e' : [':CocCommand explorer'    , 'explorer'],
-      \ 'h' : [':let @/ = ""'            , 'remove search highlight'],
-      \ 'l' : [':Bracey'                 , 'start live server'],
-      \ 'L' : [':BraceyStop'             , 'stop live server'],
-      \ 'n' : [':set nonumber!'          , 'line-numbers'],
-      \ 's' : [':s/\%V\(.*\)\%V/"\1"/'   , 'surround'],
-      \ 'r' : [':set norelativenumber!'  , 'relative line nums'],
-      \ 't' : [':FloatermToggle'         , 'terminal'],
-      \ 'v' : [':Codi'                   , 'virtual repl on'],
-      \ 'V' : [':Codi!'                  , 'virtual repl off'],
-      \ 'w' : [':StripWhitespace'        , 'strip whitespace'],
-      \ }
-
-" b is for buffer
-let g:which_key_map.b = {
-      \ 'name' : '+buffer' ,
-      \ '>' : [':BufferMoveNext'        , 'move next'],
-      \ '<' : [':BufferMovePrevious'    , 'move prev'],
-      \ 'b' : [':BufferPick'            , 'pick buffer'],
-      \ 'd' : [':Bdelete'               , 'delete-buffer'],
-      \ 'n' : ['bnext'                  , 'next-buffer'],
-      \ 'p' : ['bprevious'              , 'previous-buffer'],
-      \ '?' : ['Buffers'                , 'fzf-buffer'],
-      \ }
-
-
-" F is for fold
-let g:which_key_map.F = {
-    \ 'name': '+fold',
-    \ 'O' : [':set foldlevel=20', 'open all'],
-    \ 'C' : [':set foldlevel=0', 'close all'],
-    \ 'c' : [':foldclose', 'close'],
-    \ 'o' : [':foldopen', 'open'],
-    \ '1' : [':set foldlevel=1', 'level1'],
-    \ '2' : [':set foldlevel=2', 'level2'],
-    \ '3' : [':set foldlevel=3', 'level3'],
-    \ '4' : [':set foldlevel=4', 'level4'],
-    \ '5' : [':set foldlevel=5', 'level5'],
-    \ '6' : [':set foldlevel=6', 'level6']
-    \ }
-
-" s is for search powered by telescope
-let g:which_key_map.s = {
-      \ 'name' : '+search' ,
-      \ '.' : [':Telescope filetypes'                   , 'filetypes'],
-      \ 'B' : [':Telescope git_branches'                , 'git branches'],
-      \ 'd' : [':Telescope lsp_document_diagnostics'    , 'document_diagnostics'],
-      \ 'D' : [':Telescope lsp_workspace_diagnostics'   , 'workspace_diagnostics'],
-      \ 'f' : [':Telescope find_files'                  , 'files'],
-      \ 'h' : [':Telescope command_history'             , 'history'],
-      \ 'i' : [':Telescope media_files'                 , 'media files'],
-      \ 'm' : [':Telescope marks'                       , 'marks'],
-      \ 'M' : [':Telescope man_pages'                   , 'man_pages'],
-      \ 'o' : [':Telescope vim_options'                 , 'vim_options'],
-      \ 't' : [':Telescope live_grep'                   , 'text'],
-      \ 'r' : [':Telescope registers'                   , 'registers'],
-      \ 'w' : [':Telescope file_browser'                , 'buf_fuz_find'],
-      \ 'u' : [':Telescope colorscheme'                 , 'colorschemes'],
-      \ }
-      " \ 'A' : [':Telescope builtin'                     , 'all'],
-      " \ 's' : [':Telescope git_status'                  , 'git_status'],
-      " \ 'b' : [':Telescope buffers'                     , 'buffers'],
-      " \ ';' : [':Telescope commands'                    , 'commands'],
-      " \ 'a' : [':Telescope lsp_code_actions'            , 'code_actions'],
-      " \ 'c' : [':Telescope git_commits'                 , 'git_commits'],
-      " \ 'C' : [':Telescope git_bcommits'                , 'git_bcommits'],
-      " \ 'g' : [':Telescope tags'                        , 'tags'],
-      " \ 'F' : [':Telescope git_files'                   , 'git_files'],
-      " \ 'G' : [':Telescope current_buffer_tags'         , 'buffer_tags'],
-      " \ 'k' : [':Telescope keymaps'                     , 'keymaps'],
-      " \ 'H' : [':Telescope help_tags'                   , 'help_tags'],
-      " \ 'l' : [':Telescope loclist'                     , 'loclist'],
-      " \ 'O' : [':Telescope oldfiles'                    , 'oldfiles'],
-      " \ 'p' : [':Telescope fd'                          , 'fd'],
-      " \ 'S' : [':Telescope grep_string'                 , 'grep_string'],
-      " \ 'y' : [':Telescope symbols'                     , 'symbols'],
-      " \ 'Y' : [':Telescope lsp_workspace_symbols'       , 'lsp_workspace_symbols'],
-      " \ 'R' : [':Telescope reloader'                    , 'reloader'],
-      " \ 'z' : [':Telescope current_buffer_fuzzy_find'   , 'buf_fuz_find'],
-      " \ 'P' : [':Telescope spell_suggest'               , 'spell_suggest'],
-
-let g:which_key_map.S = {
-      \ 'name' : '+Session' ,
-      \ 'c' : [':SClose'          , 'Close Session']  ,
-      \ 'd' : [':SDelete'         , 'Delete Session'] ,
-      \ 'l' : [':SLoad'           , 'Load Session']     ,
-      \ 's' : [':Startify'        , 'Start Page']     ,
-      \ 'S' : [':SSave'           , 'Save Session']   ,
-      \ }
-
-" g is for git
-let g:which_key_map.g = {
-      \ 'name' : '+git' ,
-      \ 'b' : [':GitBlameToggle'                   , 'blame'],
-      \ 'B' : [':GBrowse'                          , 'browse'],
-      \ 'd' : [':Git diff'                         , 'diff'],
-      \ 'i' : [':Gist -b'                          , 'post gist'],
-      \ 'l' : [':Git log'                          , 'log'],
-      \ 'S' : [':Gstatus'                          , 'status'],
-      \ }
-      " set these up for git signs
-      "     ['n ]c'] = { expr = true, "&diff ? ']c' : '<cmd>lua require\"gitsigns\".next_hunk()<CR>'"},
-      "     ['n [c'] = { expr = true, "&diff ? '[c' : '<cmd>lua require\"gitsigns\".prev_hunk()<CR>'"},
-
-      "     ['n <leader>hs'] = '<cmd>lua require"gitsigns".stage_hunk()<CR>',
-      "     ['n <leader>hu'] = '<cmd>lua require"gitsigns".undo_stage_hunk()<CR>',
-      "     ['n <leader>hr'] = '<cmd>lua require"gitsigns".reset_hunk()<CR>',
-      "     ['n <leader>hR'] = '<cmd>lua require"gitsigns".reset_buffer()<CR>',
-      "     ['n <leader>hp'] = '<cmd>lua require"gitsigns".preview_hunk()<CR>',
-      "     ['n <leader>hb'] = '<cmd>lua require"gitsigns".blame_line()<CR>',
-      " \ 'p' : [':Git push'                         , 'push'],
-      " \ 'P' : [':Git pull'                         , 'pull'],
-      " \ 'g' : [':GGrep'                            , 'git grep'],
-      " \ 'D' : [':Gdiffsplit'                       , 'diff split'],
-      " \ 'c' : [':Git commit'                       , 'commit'],
-      " \ 'A' : [':CocCommand fzf-preview.GitStatus' , 'actions'],
-      " \ 'a' : [':Git add .'                        , 'add all'],
-      " \ 'A' : [':Git add %'                        , 'add current'],
-      " \ 'S' : [':!git status'                      , 'status'],
-
-let g:which_key_map.G = {
-      \ 'name' : '+gist' ,
-      \ 'b' : [':Gist -b'                          , 'post gist browser'],
-      \ 'd' : [':Gist -d'                          , 'delete gist'],
-      \ 'e' : [':Gist -e'                          , 'edit gist'],
-      \ 'l' : [':Gist -l'                          , 'list public gists'],
-      \ 's' : [':Gist -ls'                         , 'list starred gists'],
-      \ 'm' : [':Gist -m'                          , 'post gist all buffers'],
-      \ 'p' : [':Gist -P'                          , 'post public gist '],
-      \ 'P' : [':Gist -p'                          , 'post private gist '],
-      \ }
-      " \ 'a' : [':Gist -a'                          , 'post gist anon'],
-
-" l is for language server protocol
-let g:which_key_map.l = {
-      \ 'name' : '+lsp' ,
-      \ 'a' : [':Lspsaga code_action'                , 'code action'],
-      \ 'A' : [':Lspsaga range_code_action'          , 'selected action'],
-      \ 'd' : [':Telescope lsp_document_diagnostics' , 'document diagnostics'],
-      \ 'D' : [':Telescope lsp_workspace_diagnostics', 'workspace diagnostics'],
-      \ 'f' : [':LspFormatting'                      , 'format'],
-      \ 'H' : [':Lspsaga signature_help'             , 'signature_help'],
-      \ 'I' : [':LspInfo'                            , 'lsp info'],
-      \ 'l' : [':Lspsaga lsp_finder'                 , 'lsp finder'],
-      \ 'L' : [':Lspsaga show_line_diagnostics'      , 'line_diagnostics'],
-      \ 'o' : [':Vista!!'                            , 'outline'],
-      \ 'p' : [':Lspsaga preview_definition'         , 'preview definition'],
-      \ 'q' : [':Telescope quickfix'                 , 'quickfix'],
-      \ 'r' : [':LspRename'                          , 'rename'],
-      \ 'T' : [':LspTypeDefinition'                  , 'type defintion'],
-      \ 'x' : [':cclose'                             , 'close quickfix'],
-      \ 's' : [':Telescope lsp_document_symbols'     , 'document symbols'],
-      \ 'S' : [':Telescope lsp_workspace_symbols'    , 'workspace symbols'],
-      \ }
-
-" t is for terminal
-let g:which_key_map.t = {
-      \ 'name' : '+terminal' ,
-      \ ';' : [':FloatermNew --wintype=normal --height=6'       , 'terminal'],
-      \ 'f' : [':FloatermNew fzf'                               , 'fzf'],
-      \ 'g' : [':FloatermNew lazygit'                           , 'git'],
-      \ 'd' : [':FloatermNew lazydocker'                        , 'docker'],
-      \ 'n' : [':FloatermNew node'                              , 'node'],
-      \ 'N' : [':FloatermNew nnn'                               , 'nnn'],
-      \ 'p' : [':FloatermNew python'                            , 'python'],
-      \ 'm' : [':FloatermNew lazynpm'                           , 'npm'],
-      \ 't' : [':FloatermToggle'                                , 'toggle'],
-      \ 'y' : [':FloatermNew ytop'                              , 'ytop'],
-      \ 'u' : [':FloatermNew ncdu'                              , 'ncdu'],
-      \ }
-      " \ 'r' : [':FloatermNew ranger'                            , 'ranger'],
-
-call which_key#register('<Space>', "g:which_key_map")

+ 6 - 4
lua/plugins.lua

@@ -109,10 +109,12 @@ return require('packer').startup(function()
   use 'voldikss/vim-floaterm'
   use 'phaazon/hop.nvim'
   use 'liuchengxu/vista.vim'
-  use { 'npxbr/glow.nvim', run = ':GlowInstall' }
+  -- use { 'npxbr/glow.nvim', run = ':GlowInstall' }
   -- figure out how to disable or configure for things with tags like <div></div> because it will highlight all divs
   use 'RRethy/vim-illuminate'
-  -- use 'tpope/vim-commentary'
-  -- use 'suy/vim-context-commentstring'
-  use 'b3nj5m1n/kommentary'
+  use 'terrortylor/nvim-comment'
+  --use 'tpope/vim-commentary'
+  --use 'suy/vim-context-commentstring'
+  -- use 'b3nj5m1n/kommentary'
+  use 'andymass/vim-matchup'
 end)

+ 7 - 0
lua/utils.lua

@@ -26,8 +26,15 @@ define_augroups(
             {'BufWinEnter', '*', 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'},
             {'BufRead', '*', 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'},
             {'BufNewFile', '*', 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'},
+
             {'FileType', 'java', 'luafile ~/.config/nvim/lua/lsp/java-ls.lua'},
             {'FileType', 'java', 'nnoremap ca <Cmd>lua require(\'jdtls\').code_action()<CR>'},
+            {'FileType', 'lua', 'lua print("hi")'},
+            --{'BufRead', '*', 'lua vim.api.nvim_buf_set_option(0, "commentstring", "{/*%s*/}")'},
+            --{'BufNewFile', '*', 'lua vim.api.nvim_buf_set_option(0, "commentstring", "{/*%s*/}")'},
+            {'BufNewFile', '*', 'verbose setlocal commentstring="{/*%s*/}"'},
+            {'BufRead', '*', 'verbose setlocal commentstring="{/*%s*/}"'},
+
         },
     }
 )