diff options
| author | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2022-02-19 21:04:27 +0100 |
|---|---|---|
| committer | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2022-02-19 21:04:27 +0100 |
| commit | 1a13d2375bad70b372b89cd06beb3c726ed93f5c (patch) | |
| tree | 4ffae4e5d89b23c73f64f3c29d1f49a1ba9eaca4 | |
| parent | 9a297aef71c0e1bac094ccbf0b33f8c34b6030a3 (diff) | |
| download | nvim-conf-1a13d2375bad70b372b89cd06beb3c726ed93f5c.tar.gz nvim-conf-1a13d2375bad70b372b89cd06beb3c726ed93f5c.zip | |
update snippets, treesitter config
| -rw-r--r-- | after/plugin/treesitter.lua | 6 | ||||
| -rw-r--r-- | init.lua | 1 | ||||
| -rw-r--r-- | lua/alpha/refactor.lua | 3 | ||||
| -rw-r--r-- | lua/alpha/snips/ft/php.lua | 32 | ||||
| -rw-r--r-- | plugin/packer_compiled.lua | 2 |
5 files changed, 34 insertions, 10 deletions
diff --git a/after/plugin/treesitter.lua b/after/plugin/treesitter.lua index f2f5360..cff85bc 100644 --- a/after/plugin/treesitter.lua +++ b/after/plugin/treesitter.lua @@ -3,7 +3,7 @@ if not pcall(require, "nvim-treesitter") then end require "nvim-treesitter.configs".setup { - ensure_installed = {"php", "go", "comment", "css", "html", "javascript", "lua", "typescript"}, + ensure_installed = {"php", "phpdoc", "vim", "go", "comment", "css", "html", "javascript", "lua", "typescript"}, highlight = { enable = true, additional_vim_regex_highlighting = false, @@ -12,7 +12,7 @@ require "nvim-treesitter.configs".setup { enable = true, }, incremental_selection = { - enable = true, + enable = false, keymaps = { init_selection = "gnn", node_incremental = "grn", @@ -25,7 +25,7 @@ require "nvim-treesitter.configs".setup { smart_rename = { enable = true, keymaps = { - smart_rename = "grr", + smart_rename = "trr", }, }, }, @@ -17,3 +17,4 @@ require "alpha.plugins" require "alpha.telescope.setup" require "alpha.telescope.mappings" require "alpha.dap" +require "alpha.refactor" diff --git a/lua/alpha/refactor.lua b/lua/alpha/refactor.lua index e887271..418a078 100644 --- a/lua/alpha/refactor.lua +++ b/lua/alpha/refactor.lua @@ -243,4 +243,7 @@ M.new_property = function () vim.api.nvim_win_set_cursor(0, {row, column}) end +vim.keymap.set("n", "<leader>rs", M.setter_getter, {}) +vim.keymap.set("n", "<leader>rn", M.new_property, {}) + return M diff --git a/lua/alpha/snips/ft/php.lua b/lua/alpha/snips/ft/php.lua index 4e2506f..6de8114 100644 --- a/lua/alpha/snips/ft/php.lua +++ b/lua/alpha/snips/ft/php.lua @@ -98,18 +98,18 @@ local M = { declare(strict_types=1); -namespace []; +namespace {}; -class [] -{ - [] -} +class {} +{{ + {} +}} ]], { f(namespace), f(class_name), i(0), - }, { delimiters = "[]"}), + }), _c = { d(1, visibility, {}, "public"), @@ -127,6 +127,26 @@ class [] t {"", ") {", "}"}, }, + fn = { + d(1, visibility, {}, "public"), + t(" function "), + i(2, "name"), + t("("), + i(3, "$arg"), + t(")"), + c(4, { + t(""), + snippet_from_nodes(nil, { + t(': '), + i(1, "void"), + }), + }), + newline "{", + newline "\t", + i(0, ""), + newline "}", + }, + pro = { d(1, visibility, {}, "private"), t " ", diff --git a/plugin/packer_compiled.lua b/plugin/packer_compiled.lua index f9e0b67..0401c42 100644 --- a/plugin/packer_compiled.lua +++ b/plugin/packer_compiled.lua @@ -401,8 +401,8 @@ time([[Config for git-worktree.nvim]], false) -- Command lazy-loads time([[Defining lazy-load commands]], true) -pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Http lua require("packer.load")({'vim-http'}, { cmd = "Http", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]]) pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file VimwikiIndex lua require("packer.load")({'vimwiki'}, { cmd = "VimwikiIndex", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Http lua require("packer.load")({'vim-http'}, { cmd = "Http", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]]) time([[Defining lazy-load commands]], false) if should_profile then save_profiles() end |