diff options
| author | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2021-11-20 20:25:07 +0100 |
|---|---|---|
| committer | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2021-11-20 20:25:07 +0100 |
| commit | 31efe743072b868d4bb86ed709b85253db0b1f60 (patch) | |
| tree | 9fb46944cb2130b4e38e9af706c20d9fef4d25fb /lua | |
| parent | 742388c8ee0e68993d67beac362eaa98439f9394 (diff) | |
| download | nvim-conf-31efe743072b868d4bb86ed709b85253db0b1f60.tar.gz nvim-conf-31efe743072b868d4bb86ed709b85253db0b1f60.zip | |
Update config
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/alpha/completition.lua | 1 | ||||
| -rw-r--r-- | lua/alpha/refactoring.lua | 13 | ||||
| -rw-r--r-- | lua/alpha/snippets.lua | 8 | ||||
| -rw-r--r-- | lua/alpha/telescope.lua | 27 | ||||
| -rw-r--r-- | lua/plugins.lua | 34 |
5 files changed, 31 insertions, 52 deletions
diff --git a/lua/alpha/completition.lua b/lua/alpha/completition.lua index 4ed9dc7..d91dccc 100644 --- a/lua/alpha/completition.lua +++ b/lua/alpha/completition.lua @@ -8,7 +8,6 @@ cmp.setup { mapping = { ["<C-d>"] = cmp.mapping.scroll_docs(-4), ["<C-f>"] = cmp.mapping.scroll_docs(4), - -- ["<C-e>"] = cmp.mapping.close(), ["<C-e>"] = cmp.mapping(function(fallback) if cmp.visible() then cmp.close() diff --git a/lua/alpha/refactoring.lua b/lua/alpha/refactoring.lua index 262400f..22ea11e 100644 --- a/lua/alpha/refactoring.lua +++ b/lua/alpha/refactoring.lua @@ -1,5 +1,5 @@ local refactor = require("refactoring") -refactor.setup() +refactor.setup({}) -- telescope refactoring helper local function refactor(prompt_bufnr) @@ -16,12 +16,13 @@ end -- in the mappings below M = {} M.refactors = function() - require("telescope.pickers").new({}, { + local opts = require("telescope.themes").get_cursor() -- set personal telescope options + require("telescope.pickers").new(opts, { prompt_title = "refactors", finder = require("telescope.finders").new_table({ results = require("refactoring").get_refactors(), }), - sorter = require("telescope.config").values.generic_sorter({}), + sorter = require("telescope.config").values.generic_sorter(opts), attach_mappings = function(_, map) map("i", "<CR>", refactor) map("n", "<CR>", refactor) @@ -30,6 +31,6 @@ M.refactors = function() }):find() end -vim.api.nvim_set_keymap("v", "<Leader>re", [[ <Cmd>lua require('refactoring').refactor('Extract Function')<CR>]], {noremap = true, silent = true, expr = false}) -vim.api.nvim_set_keymap("v", "<Leader>rf", [[ <Cmd>lua require('refactoring').refactor('Extract Function To File')<CR>]], {noremap = true, silent = true, expr = false}) -vim.api.nvim_set_keymap("v", "<Leader>rt", [[ <Cmd>lua M.refactors()<CR>]], {noremap = true, silent = true, expr = false}) +vim.api.nvim_set_keymap("v", "<Leader>re", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function')<CR>]], {noremap = true, silent = true, expr = false}) +vim.api.nvim_set_keymap("v", "<Leader>rf", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function To File')<CR>]], {noremap = true, silent = true, expr = false}) +vim.api.nvim_set_keymap("v", "<Leader>rt", [[ <Esc><Cmd>lua M.refactors()<CR>]], {noremap = true, silent = true, expr = false}) diff --git a/lua/alpha/snippets.lua b/lua/alpha/snippets.lua index c326f72..bdf217b 100644 --- a/lua/alpha/snippets.lua +++ b/lua/alpha/snippets.lua @@ -18,6 +18,12 @@ ls.snippets = { t({""," */", "private $"}), i(2, "name"), t(";", ""), - }) + }), + s("pf", { + t("public function"), i(1, "name"), t("("), i(2, "$arg"), t(")"), + t({"", "{"}), + i(0, " "), + t({"", "}"}) + }), } } diff --git a/lua/alpha/telescope.lua b/lua/alpha/telescope.lua index 21fd839..daa4cd8 100644 --- a/lua/alpha/telescope.lua +++ b/lua/alpha/telescope.lua @@ -1,15 +1,17 @@ +local telescope = require('telescope') local actions = require('telescope.actions') +local previewers = require('telescope.previewers') -require('telescope').setup { +telescope.setup { defaults = { file_sorter = require('telescope.sorters').get_fzy_sorter, prompt_prefix = ' >', use_less = false, set_env = { ['COLORTERM'] = 'truecolor' }, - file_previewer = require('telescope.previewers').vim_buffer_cat.new, - grep_previewer = require('telescope.previewers').vim_buffer_vimgrep.new, - qflist_previewer = require('telescope.previewers').vim_buffer_qflist.new, + file_previewer = previewers.vim_buffer_cat.new, + grep_previewer = previewers.vim_buffer_vimgrep.new, + qflist_previewer = previewers.vim_buffer_qflist.new, mappings = { i = { @@ -26,7 +28,7 @@ require('telescope').setup { } } -require('telescope').load_extension('fzy_native') +telescope.load_extension('fzy_native') local M = {} @@ -37,8 +39,10 @@ M.search_config = function() }) end -M.buffers = function() - require("telescope.builtin").buffers() +M.project_files = function() + local opts = {} -- define here if you want to define something + local ok = pcall(require'telescope.builtin'.git_files, opts) + if not ok then require'telescope.builtin'.find_files(opts) end end M.branches = function() @@ -49,16 +53,7 @@ M.branches = function() end}) end --- just a test base on a relative path -M.laravel_controllers = function() - require("telescope.builtin").find_files({ - prompt_title = "< Controllers >", - cwd = "app/Http/Controllers", - }) -end - M.laravel_artisan = require('alpha.telescope_laravel').artisan - M.project_find = require('alpha.telescope_projectionist').find return M diff --git a/lua/plugins.lua b/lua/plugins.lua index c4e8811..c0ab19a 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -22,35 +22,10 @@ return require('packer').startup(function(use) requires = { 'nvim-lua/plenary.nvim', 'nvim-lua/popup.nvim', - 'ThePrimeagen/harpoon', }, } - use { - "folke/twilight.nvim", - config = function() - require("twilight").setup { - context = 3, - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - expand = { -- for treesitter, we we always try to expand to the top-most ancestor with these types - "function_declaration", - "function_call_expression", - "expression_statement", - "function", - "function_definition", - "method_declaration", - "method", - "table", - "if_statement", - "type_declaration", - }, - } - end - } - - use { 'tpope/vim-dispatch', opt = true, cmd = {'Dispatch', 'Make', 'Focus', 'Start'}} + use 'tpope/vim-dispatch' use "hrsh7th/nvim-cmp" use "hrsh7th/cmp-buffer" @@ -60,6 +35,8 @@ return require('packer').startup(function(use) use "saadparwaiz1/cmp_luasnip" use "onsails/lspkind-nvim" + use "ray-x/lsp_signature.nvim" + use "tjdevries/colorbuddy.nvim" use { @@ -119,10 +96,11 @@ return require('packer').startup(function(use) use 'tpope/vim-vinegar' use 'tpope/vim-eunuch' use 'tpope/vim-commentary' - use 'tpope/vim-tbone' - use 'tpope/vim-dadbod' use 'airblade/vim-gitgutter' + use 'tpope/vim-tbone' + + use 'tpope/vim-dadbod' use 'kristijanhusak/vim-dadbod-ui' use { 'nicwest/vim-http', opt = true, cmd = {'Http'}} |