From d97766b0a75c4b376ff517ca1e88abc442aed38d Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 19 Mar 2021 22:35:58 -0400 Subject: snippet stream --- README.md | 10 +++++++--- init.lua | 1 + lua/keymappings.lua | 15 +++++++-------- lua/lsp/python-ls.lua | 3 +++ lua/nv-emmet/init.lua | 3 +++ lua/nv-startify/init.lua | 19 ++++++++++--------- lua/nv-utils/init.lua | 3 ++- lua/plugins.lua | 16 ++++++++++------ 8 files changed, 43 insertions(+), 27 deletions(-) create mode 100644 lua/nv-emmet/init.lua diff --git a/README.md b/README.md index de2753b2..b76abfdf 100644 --- a/README.md +++ b/README.md @@ -76,20 +76,23 @@ To use vim-gists you will need to configure the following: git config --global github.user ``` +## Snippets + +If you are looking for snippets checkout this github topic: [Snippet Topic](https://github.com/topics/vscode-snippets) + ## TODO **HIGH PRIORITY** +- lsp kind for snippets - list all binaries needed for functionality - learn what opt is - learn nvim-dap in depth -- snippet support -- for vsnip :h vim-vsnip, also figure out what integr does - add utf8 line col and spaces (maybe blame) - potentially switch to dashboard - update Vista symbols +- vim ult test **LOW PRIORITY** -- configure nvim-peekup - better install script, support both nvim and nvcode paths - make java code actions prettier - figure out how to customize java formatting @@ -100,6 +103,7 @@ git config --global github.user - look into autoinstall lsp - json config file (luajson) - get logo +- configure nvim-peekup - configure neogit - toggle virtual text diagnostics - move language servers not installed with npm to neovim local share location diff --git a/init.lua b/init.lua index 2367f118..ee684e33 100644 --- a/init.lua +++ b/init.lua @@ -17,6 +17,7 @@ else require('nv-nvimtree') require('nv-treesitter') require('nv-barbar') + require('nv-emmet') require('nv-quickscope') require('nv-gitsigns') require('nv-nvim-autopairs') diff --git a/lua/keymappings.lua b/lua/keymappings.lua index 5a36a9da..c4ef85b6 100644 --- a/lua/keymappings.lua +++ b/lua/keymappings.lua @@ -59,12 +59,11 @@ vim.cmd('inoremap (\"\\\")') -- vim.cmd('inoremap (\"\\\")') -- vim.cmd('inoremap (\"\\\")') --- TAB Complete --- vim.api.nvim_set_keymap('i', '', 'pumvisible() ? \"\\\" : \"\\\"', { noremap = true, silent = true }) +-- vim.api.nvim_set_keymap('i', '', 'compe#complete()', {noremap = true, silent = true, expr = true}) -vim.cmd([[ -map p (miniyank-autoput) -map P (miniyank-autoPut) -map n (miniyank-cycle) -map N (miniyank-cycleback) -]]) +-- vim.cmd([[ +-- map p (miniyank-autoput) +-- map P (miniyank-autoPut) +-- map n (miniyank-cycle) +-- map N (miniyank-cycleback) +-- ]]) diff --git a/lua/lsp/python-ls.lua b/lua/lsp/python-ls.lua index 19de234a..e040e8ae 100644 --- a/lua/lsp/python-ls.lua +++ b/lua/lsp/python-ls.lua @@ -1,4 +1,7 @@ -- npm i -g pyright +-- local capabilities = vim.lsp.protocol.make_client_capabilities() +-- capabilities.textDocument.completion.completionItem.snippetSupport = true require'lspconfig'.pyright.setup{ on_attach = require'lsp'.common_on_attach, + -- capabilities = capabilities } diff --git a/lua/nv-emmet/init.lua b/lua/nv-emmet/init.lua new file mode 100644 index 00000000..329bc643 --- /dev/null +++ b/lua/nv-emmet/init.lua @@ -0,0 +1,3 @@ +-- After you have what you want press C-Y and , at the same time +-- autocmd FileType html,css EmmetInstall +-- vim.g.user_emmet_leader_key='' diff --git a/lua/nv-startify/init.lua b/lua/nv-startify/init.lua index 8e05cdbd..c066f75f 100644 --- a/lua/nv-startify/init.lua +++ b/lua/nv-startify/init.lua @@ -1,10 +1,8 @@ vim.g.startify_custom_header = { - ' _ ___ ________ __ ', - ' / | / / | / / ____/___ ____/ /__ ', - ' / |/ /| | / / / / __ \\/ __ / _ \\', - ' / /| / | |/ / /___/ /_/ / /_/ / __/', - ' /_/ |_/ |___/\\____/\\____/\\__,_/\\___/ ', - } + ' _ ___ ________ __ ', ' / | / / | / / ____/___ ____/ /__ ', + ' / |/ /| | / / / / __ \\/ __ / _ \\', ' / /| / | |/ / /___/ /_/ / /_/ / __/', + ' /_/ |_/ |___/\\____/\\____/\\__,_/\\___/ ' +} vim.g.webdevicons_enable_startify = 1 vim.g.startify_enable_special = 0 @@ -16,10 +14,13 @@ vim.g.startify_fortune_use_unicode = 1 vim.g.startify_session_persistence = 1 vim.g.startify_session_dir = '~/.config/nvim/session' +vim.api.nvim_exec( + 'let startify_lists = [ { \'type\': \'files\', \'header\': [\' Files\'] }, { \'type\': \'sessions\', \'header\': [\' Sessions\'] }, { \'type\': \'bookmarks\', \'header\': [\' Bookmarks\'] }, ]', + true) -vim.api.nvim_exec('let startify_lists = [ { \'type\': \'files\', \'header\': [\' Files\'] }, { \'type\': \'sessions\', \'header\': [\' Sessions\'] }, { \'type\': \'bookmarks\', \'header\': [\' Bookmarks\'] }, ]',true) - -vim.api.nvim_exec('let startify_bookmarks = [ { \'b\': \'~/Blog\' }, { \'i\': \'~/.config/nvim/init.vim\' }, { \'z\': \'~/.zshrc\' }]', true) +vim.api.nvim_exec( + 'let startify_bookmarks = [ { \'b\': \'~/Blog\' }, { \'i\': \'~/.config/nvim/init.lua\' }, { \'z\': \'~/.zshrc\' }, { \'r\': \'.config/nvim/README.md\' }]', + true) vim.cmd([[ function! StartifyEntryFormat() diff --git a/lua/nv-utils/init.lua b/lua/nv-utils/init.lua index 82e920de..901a1a71 100644 --- a/lua/nv-utils/init.lua +++ b/lua/nv-utils/init.lua @@ -31,7 +31,8 @@ nv_utils.define_augroups({ {'BufNewFile', '*', 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'}, {'FileType', 'java', 'luafile ~/.config/nvim/lua/lsp/java-ls.lua'}, {'FileType', 'java', 'nnoremap ca lua require(\'jdtls\').code_action()'}, - {'FileType', 'java', 'nnoremap ca lua require(\'jdtls\').code_action()'} + {'FileType', 'java', 'nnoremap ca lua require(\'jdtls\').code_action()'}, + {'FileType', 'markdown', 'set wrap'} -- {'User', 'GoyoLeave', 'lua require(\'galaxyline\').disable_galaxyline()'}, -- {'User', 'GoyoEnter', 'lua require(\'galaxyline\').galaxyline_augroup()'}, } diff --git a/lua/plugins.lua b/lua/plugins.lua index 684a4d0b..5aabf844 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -34,15 +34,19 @@ return require('packer').startup(function(use) -- Autocomplete use 'hrsh7th/nvim-compe' + use 'christianchiarulli/emmet-vim' use 'hrsh7th/vim-vsnip' - use 'hrsh7th/vim-vsnip-integ' - use 'honza/vim-snippets' + use 'xabikos/vscode-javascript' + use 'cstrap/python-snippets' + use 'dsznajder/vscode-es7-javascript-react-snippets' + use 'golang/vscode-go' + use 'rust-lang/vscode-rust' + use 'ChristianChiarulli/html-snippets' + -- use 'hrsh7th/vim-vsnip-integ' + -- use 'honza/vim-snippets' + -- use 'abusaidm/html-snippets' -- <- don't work -- use 'epilande/vim-react-snippets' - -- use 'xabikos/vscode-javascript' - -- use 'cstrap/python-snippets' -- use 'ylcnfrht/vscode-python-snippet-pack' - -- use 'golang/vscode-go' - -- use 'rust-lang/vscode-rust' -- use 'SirVer/ultisnips' -- use 'norcalli/snippets.nvim' -- cgit v1.2.3