diff --git a/UltiSnips/php.snippets b/UltiSnips/php.snippets index b3ea48f..c524c6f 100644 --- a/UltiSnips/php.snippets +++ b/UltiSnips/php.snippets @@ -1,3 +1,15 @@ +snippet if "if () {}" +if ($1) { + $0 +} +endsnippet + +snippet fe "foreach () {}" +foreach (\$${1:array} as \$${2:item}) { + $0 +} +endsnippet + snippet pp "" endsnippet @@ -31,3 +43,11 @@ endsnippet snippet ''= "'...' => " '$1' => $0, endsnippet + +snippet apm "add_post_meta(..." +add_post_meta( 341, 'DEBUG_$1', $0); +endsnippet + +snippet upm "update_post_meta(..." +update_post_meta( 341, 'DEBUG_$1', $0); +endsnippet diff --git a/lua/init-lspconfig.lua b/lua/init-lspconfig.lua index e4ecaf9..5d826c5 100644 --- a/lua/init-lspconfig.lua +++ b/lua/init-lspconfig.lua @@ -36,19 +36,19 @@ local on_attach = function(client, bufnr) -- 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) - buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) - buf_set_keymap('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) - buf_set_keymap('n', '', 'lua vim.lsp.buf.signature_help()', opts) buf_set_keymap('n', '[d', 'lua vim.lsp.diagnostic.goto_prev()', opts) buf_set_keymap('n', ']d', 'lua vim.lsp.diagnostic.goto_next()', opts) + buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) + buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) + buf_set_keymap('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) + buf_set_keymap('n', 'gt', 'lua vim.lsp.buf.type_definition()', opts) + buf_set_keymap('n', 'gl', 'lua vim.lsp.diagnostic.show_line_diagnostics()', opts) + buf_set_keymap('n', 'gh', 'lua vim.lsp.buf.hover()', opts) + buf_set_keymap('n', '', 'lua vim.lsp.buf.signature_help()', opts) buf_set_keymap('n', 'l', 'lua vim.lsp.diagnostic.set_loclist()', opts) buf_set_keymap('n', 'ca', 'lua vim.lsp.buf.code_action()', opts) buf_set_keymap('n', 'rn', 'lua vim.lsp.buf.rename()', opts) - buf_set_keymap('n', 'e', 'lua vim.lsp.diagnostic.show_line_diagnostics()', opts) - buf_set_keymap('n', 'D', 'lua vim.lsp.buf.type_definition()', opts) buf_set_keymap('n', 'f', 'lua vim.lsp.buf.formatting()', opts) -- 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)