diff --git a/UltiSnips/php.snippets b/UltiSnips/php.snippets index a32a09b..c54e5dd 100644 --- a/UltiSnips/php.snippets +++ b/UltiSnips/php.snippets @@ -1,3 +1,15 @@ +snippet pp "" + +endsnippet + +snippet pe "" + +endsnippet + +snippet ph "" + +endsnippet + snippet pf "public function ..." public function $1($2) { $0 diff --git a/init.plugins.vim b/init.plugins.vim index b5f1a69..a5516b8 100644 --- a/init.plugins.vim +++ b/init.plugins.vim @@ -58,7 +58,7 @@ Plug '~/nvim-paper-tonic' Plug 'hrsh7th/cmp-nvim-lsp', { 'branch': 'main' } Plug 'hrsh7th/cmp-buffer', { 'branch': 'main' } Plug 'hrsh7th/cmp-path', { 'branch': 'main' } - " Plug 'hrsh7th/cmp-nvim-ultisnips' + Plug 'quangnguyen30192/cmp-nvim-ultisnips', { 'branch': 'main' } "}}} diff --git a/lua/init-plugins.lua b/lua/init-plugins.lua index 2d81706..0953dad 100644 --- a/lua/init-plugins.lua +++ b/lua/init-plugins.lua @@ -11,32 +11,6 @@ require'nvim-treesitter.configs'.setup { additional_vim_regex_highlighting = false, }, } --- https://github.com/neovim/nvim-lspconfig --- https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md --- npm install -g typescript typescript-language-server -require'lspconfig'.tsserver.setup{} --- npm install -g vim-language-server -require'lspconfig'.vimls.setup{} --- npm install -g pyright -require'lspconfig'.pyright.setup{} --- phpactor installation - --- https://phpactor.readthedocs.io/en/master/usage/standalone.html -require'lspconfig'.phpactor.setup{} --- npm i -g vscode-langservers-extracted -require'lspconfig'.intelephense.setup{} --- npm install -g intelephense -require'lspconfig'.cssls.setup{} --- npm install -g vls -require'lspconfig'.vuels.setup{} --- npm i -g bash-language-server --- TODO - don't run for sh files but have something else instead - shellcheck? -require'lspconfig'.bashls.setup{} --- npm install -g yaml-language-server -require'lspconfig'.yamlls.setup{} --- npm i -g stylelint-lsp -require'lspconfig'.stylelint_lsp.setup{} --- https://github.com/neovim/nvim-lspconfig/wiki -require'lspconfig'.tailwindcss.setup{} --[efm-langserver] @@ -110,20 +84,48 @@ require "lspconfig".efm.setup { } } +-- [lspconfig] + local nvim_lsp = require('lspconfig') +-- Use a loop to conveniently call 'setup' on multiple servers and +-- map buffer local keybindings when the language server attaches +local servers = { + -- npm i -g bash-language-server + -- TODO - don't run for sh files but have something else instead - shellcheck? + 'bashls', + -- npm i -g vscode-langservers-extracted + 'cssls', + -- npm install -g intelephense + 'intelephense', + -- https://phpactor.readthedocs.io/en/master/usage/standalone.html + 'phpactor', + -- npm install -g pyright + 'pyright', + -- npm i -g stylelint-lsp + 'stylelint_lsp', + -- https://github.com/neovim/nvim-lspconfig/wiki + 'tailwindcss', + -- npm install -g typescript typescript-language-server + 'tsserver', + -- npm install -g vim-language-server + 'vimls', + -- npm install -g vls + 'vuels', + -- npm i -g stylelint-lsp + 'yamlls', +} + -- Use an on_attach function to only map the following keys -- after the language server attaches to the current buffer local on_attach = function(client, bufnr) - local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end - local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end + local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end + local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end -- Enable completion triggered by buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') - -- Mappings. local opts = { noremap=true, silent=true } - -- See `:help vim.lsp.*` for documentation on any of the below functions buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) @@ -142,26 +144,15 @@ local on_attach = function(client, bufnr) -- buf_set_keymap('n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) -- buf_set_keymap('n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) -- buf_set_keymap('n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) - end --- Use a loop to conveniently call 'setup' on multiple servers and --- map buffer local keybindings when the language server attaches -local servers = { - 'bashls', - 'cssls', - 'intelephense', - 'phpactor', - 'pyright', - 'stylelint_lsp', - 'tailwindcss', - 'tsserver', - 'vimls', - 'vuels' -} +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup { on_attach = on_attach, + capabilities = capabilities, flags = { debounce_text_changes = 150, } @@ -174,11 +165,11 @@ cmp.setup({ keyword_length = 4 -- autocomplete = false }, - -- snippet = { - -- expand = function(args) - -- vim.fn["vsnip#anonymous"](args.body) - -- end, - -- }, + snippet = { + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) + end, + }, mapping = { [''] = cmp.mapping.complete(), [''] = cmp.mapping.confirm({ select = true }), @@ -188,7 +179,7 @@ cmp.setup({ { name = 'buffer' }, { name = 'nvim_lsp' }, { name = 'path' }, - --{ name = 'ultisnips' }, + { name = 'ultisnips' }, ... } }) diff --git a/spell/en.utf-8.add b/spell/en.utf-8.add index 596a301..d309946 100644 --- a/spell/en.utf-8.add +++ b/spell/en.utf-8.add @@ -174,3 +174,5 @@ erimplement particularly movie multivariable +Unsetting +ajax diff --git a/spell/en.utf-8.add.spl b/spell/en.utf-8.add.spl index 5586cab..9eee6c1 100644 Binary files a/spell/en.utf-8.add.spl and b/spell/en.utf-8.add.spl differ