diff options
| author | Chris <[email protected]> | 2021-03-16 22:06:38 -0400 | 
|---|---|---|
| committer | Chris <[email protected]> | 2021-03-16 22:06:38 -0400 | 
| commit | be6c6ca92fa9e1f596bfaef0c1197b7144d70036 (patch) | |
| tree | f2b98636732f70d6a5e9a7e82a075766e8506149 | |
| parent | 1bcb1fd6edd02b804f7704c5ef70c1e7c34db0a5 (diff) | |
udpates
| -rw-r--r-- | README.md | 8 | ||||
| -rw-r--r-- | ftplugin/javascriptreact.vim | 2 | ||||
| -rw-r--r-- | init.lua | 9 | ||||
| -rw-r--r-- | lua/nv-comment/init.lua | 3 | ||||
| -rw-r--r-- | lua/nv-kommentary/init.lua | 60 | ||||
| -rw-r--r-- | lua/plugins.lua | 1 | ||||
| -rw-r--r-- | lua/utils.lua | 6 | ||||
| -rwxr-xr-x | utils/installer/install-nv-code.sh | 1 | ||||
| -rw-r--r-- | vimscript/nv-commentary/init.vim | 4 | ||||
| -rw-r--r-- | vimscript/nv-whichkey/init.vim | 4 | 
10 files changed, 19 insertions, 79 deletions
| @@ -43,16 +43,13 @@ $HOME/.config/nvim/lua/nv-vscode/init.vim  ## TODO  **HIGH PRIORITY** -- snippet support -- react commenting -- toggle virtual text diagnostics -- improve VSCode support  - formatting using efm server for python  - formatting using efm server for prettier/eslint +- wrap all whichkey lsp in functions +- snippet support  **LOW PRIORITY**  - redo barbar highlight groups -- wrap all whichkey lsp in functions  - make java code actions prettier  - figure out how to format java  - setup junit tests for java @@ -67,3 +64,4 @@ $HOME/.config/nvim/lua/nv-vscode/init.vim  - look into autoinstall lsp  - get logo  - configure neogit +- toggle virtual text diagnostics diff --git a/ftplugin/javascriptreact.vim b/ftplugin/javascriptreact.vim new file mode 100644 index 00000000..2171568a --- /dev/null +++ b/ftplugin/javascriptreact.vim @@ -0,0 +1,2 @@ +setlocal commentstring={/*%s*/} + @@ -1,11 +1,13 @@  if vim.g.vscode then    vim.cmd('source ~/.config/nvim/vimscript/nv-vscode/init.vim') +  require('settings')  else    -- General mappings    require('plugins')    require('keymappings')    require('settings')    require('colorscheme') +  require('utils')    -- Plugins    require('nv-compe') @@ -14,11 +16,11 @@ else    require('nv-treesitter')    require('nv-galaxyline')    require('nv-barbar') +  require('nv-quickscope')    require('nv-gitsigns')    require('nv-nvim-autopairs')    require('nv-neogit') -  require('nv-kommentary') -  require('nv-quickscope') +  require('nv-comment')    require('nv-rnvimr')    require('nv-startify')    require('nv-telescope') @@ -42,6 +44,5 @@ else    require('lsp.python-ls')    require('lsp.json-ls')    require('lsp.yaml-ls') -  require('utils') -  vim.cmd([[autocmd BufRead * lua print("hi")]])  end + diff --git a/lua/nv-comment/init.lua b/lua/nv-comment/init.lua new file mode 100644 index 00000000..df794386 --- /dev/null +++ b/lua/nv-comment/init.lua @@ -0,0 +1,3 @@ +require('nvim_comment').setup() +vim.api.nvim_set_keymap("n", "<leader>/", ":CommentToggle<CR>", {noremap=true, silent = true}) +vim.api.nvim_set_keymap("v", "<leader>/", ":CommentToggle<CR>", {noremap=true, silent = true}) diff --git a/lua/nv-kommentary/init.lua b/lua/nv-kommentary/init.lua deleted file mode 100644 index 779d530d..00000000 --- a/lua/nv-kommentary/init.lua +++ /dev/null @@ -1,60 +0,0 @@ --- 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("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 = {"{/*", "*/}"}, --- }) - ---[[ 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*/}") diff --git a/lua/plugins.lua b/lua/plugins.lua index 03c49a3b..e78e0788 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -117,4 +117,5 @@ return require('packer').startup(function()    --use 'suy/vim-context-commentstring'    -- use 'b3nj5m1n/kommentary'    use 'andymass/vim-matchup' +  use 'sheerun/vim-polyglot'  end) diff --git a/lua/utils.lua b/lua/utils.lua index cdb8991a..9a9080b1 100644 --- a/lua/utils.lua +++ b/lua/utils.lua @@ -26,14 +26,8 @@ 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*/}"'},          },      } diff --git a/utils/installer/install-nv-code.sh b/utils/installer/install-nv-code.sh index 846a504c..7697d993 100755 --- a/utils/installer/install-nv-code.sh +++ b/utils/installer/install-nv-code.sh @@ -58,6 +58,7 @@ installpynvim() { \  cloneconfig() { \    echo "Cloning NVCode configuration"    git clone https://github.com/ChristianChiarulli/nvcode.git ~/.config/nvcode +  nvim --headless +PackSync +qall > /dev/null 2>&1  }  asktoinstallnode() { \ diff --git a/vimscript/nv-commentary/init.vim b/vimscript/nv-commentary/init.vim index 284e6286..76e32b21 100644 --- a/vimscript/nv-commentary/init.vim +++ b/vimscript/nv-commentary/init.vim @@ -6,6 +6,6 @@ function! Comment()    endif   endfunction  vnoremap <silent> <space>/ :call Comment() -"autocmd! BufRead,BufNewFile *.{jsx,jx,js} setlocal filetype=javascript.jsx -autocmd FileType javascriptreact setlocal commentstring={/*\ %s\ */} +autocmd! BufRead,BufNewFile *.{jsx,jx,js} setlocal filetype=javascript +"autocmd FileType javascriptreact setlocal commentstring={/*\ %s\ */} diff --git a/vimscript/nv-whichkey/init.vim b/vimscript/nv-whichkey/init.vim index f0e80987..592fbd00 100644 --- a/vimscript/nv-whichkey/init.vim +++ b/vimscript/nv-whichkey/init.vim @@ -26,8 +26,8 @@ autocmd  FileType which_key set laststatus=0 noshowmode noruler  " let g:which_key_map['/'] = [ ':call Comment()'                                 , 'comment' ]  " let g:which_key_map['/'] = { 'name' : 'comment' } -let g:which_key_map['/'] = [ ':call Comment()'                                 , 'comment' ] -"let g:which_key_map['/'] = 'which_key_ignore' +"let g:which_key_map['/'] = [ ':call Comment()'                                 , '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' ] | 
