From 214c5ae44b613f5c34e71e735fc90dbd280bdaa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Sun, 8 Oct 2023 17:13:22 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20style(nvim):=20stylua=20formatti?= =?UTF-8?q?ng=20with=202=20spaces?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/nvim/lua/config/lazy.lua | 86 +-- .config/nvim/lua/plugins/telescope.lua | 926 ++++++++++++------------- 2 files changed, 506 insertions(+), 506 deletions(-) diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua index 98b67705..3b445fad 100644 --- a/.config/nvim/lua/config/lazy.lua +++ b/.config/nvim/lua/config/lazy.lua @@ -8,48 +8,48 @@ end vim.opt.rtp:prepend(vim.env.LAZY or lazypath) require("lazy").setup({ - spec = { - -- add LazyVim and import its plugins - { "LazyVim/LazyVim", import = "lazyvim.plugins" }, - -- import any extras modules here - { import = "lazyvim.plugins.extras.lang.typescript" }, - { import = "lazyvim.plugins.extras.lang.json" }, - { import = "lazyvim.plugins.extras.dap.core" }, - { import = "lazyvim.plugins.extras.test.core" }, - { import = "lazyvim.plugins.extras.lang.python" }, - { import = "lazyvim.plugins.extras.lang.docker" }, - { import = "lazyvim.plugins.extras.lang.go" }, - { import = "lazyvim.plugins.extras.lang.rust" }, - { import = "lazyvim.plugins.extras.lang.tailwind" }, - { import = "lazyvim.plugins.extras.linting.eslint" }, - { import = "lazyvim.plugins.extras.formatting.prettier" }, - -- { import = "lazyvim.plugins.extras.coding.copilot" }, - { import = "lazyvim.plugins.extras.lang.yaml" }, - { import = "lazyvim.plugins.extras.coding.yanky" }, - { import = "lazyvim.plugins.extras.util.project" }, - { import = "lazyvim.plugins.extras.lang.omnisharp" }, - { import = "plugins" }, - }, - defaults = { - -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. - -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. - lazy = false, - -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, - -- have outdated releases, which may break your Neovim install. - version = false, -- always use the latest git commit - -- version = "*", -- try installing the latest stable version for plugins that support semver - }, - checker = { enabled = true }, -- automatically check for plugin updates - performance = { - rtp = { - -- disable some rtp plugins - disabled_plugins = { - "gzip", - "tarPlugin", - "tohtml", - "tutor", - "zipPlugin", - }, - }, + spec = { + -- add LazyVim and import its plugins + { "LazyVim/LazyVim", import = "lazyvim.plugins" }, + -- import any extras modules here + { import = "lazyvim.plugins.extras.lang.typescript" }, + { import = "lazyvim.plugins.extras.lang.json" }, + { import = "lazyvim.plugins.extras.dap.core" }, + { import = "lazyvim.plugins.extras.test.core" }, + { import = "lazyvim.plugins.extras.lang.python" }, + { import = "lazyvim.plugins.extras.lang.docker" }, + { import = "lazyvim.plugins.extras.lang.go" }, + { import = "lazyvim.plugins.extras.lang.rust" }, + { import = "lazyvim.plugins.extras.lang.tailwind" }, + { import = "lazyvim.plugins.extras.linting.eslint" }, + { import = "lazyvim.plugins.extras.formatting.prettier" }, + -- { import = "lazyvim.plugins.extras.coding.copilot" }, + { import = "lazyvim.plugins.extras.lang.yaml" }, + { import = "lazyvim.plugins.extras.coding.yanky" }, + { import = "lazyvim.plugins.extras.util.project" }, + { import = "lazyvim.plugins.extras.lang.omnisharp" }, + { import = "plugins" }, + }, + defaults = { + -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. + -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. + lazy = false, + -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, + -- have outdated releases, which may break your Neovim install. + version = false, -- always use the latest git commit + -- version = "*", -- try installing the latest stable version for plugins that support semver + }, + checker = { enabled = true }, -- automatically check for plugin updates + performance = { + rtp = { + -- disable some rtp plugins + disabled_plugins = { + "gzip", + "tarPlugin", + "tohtml", + "tutor", + "zipPlugin", + }, }, + }, }) diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 7e201f0a..5e596df5 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -1,468 +1,468 @@ local Util = require("lazyvim.util") return { - { - "nvim-telescope/telescope.nvim", - commit = vim.fn.has("nvim-0.9.0") == 0 and "057ee0f8783" or nil, - cmd = "Telescope", - version = false, -- telescope did only one release, so use HEAD for now - dependencies = { - "nvim-telescope/telescope-fzf-native.nvim", - build = "make", - config = function() - require("telescope").load_extension("fzf") - end, - }, - keys = { - { - ",", - "Telescope buffers show_all_buffers=true", - desc = "Switch Buffer", - }, - { - "/", - Util.telescope("live_grep"), - desc = "Grep (root dir)", - }, - { - ":", - "Telescope command_history", - desc = "Command History", - }, - { - "", - Util.telescope("files"), - desc = "Find Files (root dir)", - }, - -- find - { "fb", "Telescope buffers", desc = "Buffers" }, - { - "ff", - Util.telescope("files"), - desc = "Find Files (root dir)", - }, - { - "fF", - Util.telescope("files", { cwd = false }), - desc = "Find Files (cwd)", - }, - { "fr", "Telescope oldfiles", desc = "Recent" }, - { "fR", Util.telescope("oldfiles", { cwd = vim.loop.cwd() }), desc = "Recent (cwd)" }, - -- git - { "gc", "Telescope git_commits", desc = "commits" }, - { "gs", "Telescope git_status", desc = "status" }, - -- search - { 's"', "Telescope registers", desc = "Registers" }, - { - "sa", - "Telescope autocommands", - desc = "Auto Commands", - }, - { "sb", "Telescope current_buffer_fuzzy_find", desc = "Buffer" }, - { - "sc", - "Telescope command_history", - desc = "Command History", - }, - { "sC", "Telescope commands", desc = "Commands" }, - { - "sd", - "Telescope diagnostics bufnr=0", - desc = "Document diagnostics", - }, - { - "sD", - "Telescope diagnostics", - desc = "Workspace diagnostics", - }, - { - "sg", - Util.telescope("live_grep"), - desc = "Grep (root dir)", - }, - { "sG", Util.telescope("live_grep", { cwd = false }), desc = "Grep (cwd)" }, - { "sh", "Telescope help_tags", desc = "Help Pages" }, - { - "sH", - "Telescope highlights", - desc = "Search Highlight Groups", - }, - { "sk", "Telescope keymaps", desc = "Key Maps" }, - { "sM", "Telescope man_pages", desc = "Man Pages" }, - { "sm", "Telescope marks", desc = "Jump to Mark" }, - { "so", "Telescope vim_options", desc = "Options" }, - { "sR", "Telescope resume", desc = "Resume" }, - { "gu", "Telescope undo", desc = "Telescope Undotree" }, - { - "sw", - Util.telescope("grep_string", { word_match = "-w" }), - desc = "Word (root dir)", - }, - { "sW", Util.telescope("grep_string", { cwd = false, word_match = "-w" }), desc = "Word (cwd)" }, - { - "sw", - Util.telescope("grep_string"), - mode = "v", - desc = "Selection (root dir)", - }, - { - "sW", - Util.telescope("grep_string", { cwd = false }), - mode = "v", - desc = "Selection (cwd)", - }, - { - "uC", - Util.telescope("colorscheme", { enable_preview = true }), - desc = "Colorscheme with preview", - }, - { - "ssa", - Util.telescope("lsp_document_symbols", { - symbols = { - "Class", - "Function", - "Method", - "Constructor", - "Interface", - "Module", - "Struct", - "Trait", - "Field", - "Property", - "Enum", - "Constant", - }, - }), - desc = "All", - }, - { - "ssc", - Util.telescope("lsp_document_symbols", { - symbols = { - "Class", - }, - }), - desc = "Class", - }, - { - "ssf", - Util.telescope("lsp_document_symbols", { - symbols = { - "Function", - }, - }), - desc = "Function", - }, - { - "ssm", - Util.telescope("lsp_document_symbols", { - symbols = { - "Method", - }, - }), - desc = "Method", - }, - { - "ssC", - Util.telescope("lsp_document_symbols", { - symbols = { - "Constructor", - }, - }), - desc = "Constructor", - }, - { - "sse", - Util.telescope("lsp_document_symbols", { - symbols = { - "Enum", - }, - }), - desc = "Enum", - }, - { - "ssi", - Util.telescope("lsp_document_symbols", { - symbols = { - "Interface", - }, - }), - desc = "Interface", - }, - { - "ssM", - Util.telescope("lsp_document_symbols", { - symbols = { - "Module", - }, - }), - desc = "Module", - }, - { - "sss", - Util.telescope("lsp_document_symbols", { - symbols = { - "Struct", - }, - }), - desc = "Struct", - }, - { - "sst", - Util.telescope("lsp_document_symbols", { - symbols = { - "Trait", - }, - }), - desc = "Trait", - }, - { - "ssF", - Util.telescope("lsp_document_symbols", { - symbols = { - "Field", - }, - }), - desc = "Field", - }, - { - "ssp", - Util.telescope("lsp_document_symbols", { - symbols = { - "Property", - }, - }), - desc = "Property", - }, - { - "ssv", - Util.telescope("lsp_document_symbols", { - symbols = { - "Variable", - "Parameter", - }, - }), - desc = "Variable", - }, - { - "sSa", - Util.telescope("lsp_dynamic_workspace_symbols", { - symbols = { - "Class", - "Function", - "Method", - "Constructor", - "Interface", - "Module", - "Struct", - "Trait", - "Field", - "Property", - "Enum", - "Constant", - }, - }), - desc = "All", - }, - { - "sSc", - Util.telescope("lsp_dynamic_workspace_symbols", { - symbols = { - "Class", - }, - }), - desc = "Class", - }, - { - "sSf", - Util.telescope("lsp_dynamic_workspace_symbols", { - symbols = { - "Function", - }, - }), - desc = "Function", - }, - { - "sSm", - Util.telescope("lsp_dynamic_workspace_symbols", { - symbols = { - "Method", - }, - }), - desc = "Method", - }, - { - "sSC", - Util.telescope("lsp_dynamic_workspace_symbols", { - symbols = { - "Constructor", - }, - }), - desc = "Constructor", - }, - { - "sSe", - Util.telescope("lsp_dynamic_workspace_symbols", { - symbols = { - "Enum", - }, - }), - desc = "Enum", - }, - { - "sSi", - Util.telescope("lsp_dynamic_workspace_symbols", { - symbols = { - "Interface", - }, - }), - desc = "Interface", - }, - { - "sSM", - Util.telescope("lsp_dynamic_workspace_symbols", { - symbols = { - "Module", - }, - }), - desc = "Module", - }, - { - "sSs", - Util.telescope("lsp_dynamic_workspace_symbols", { - symbols = { - "Struct", - }, - }), - desc = "Struct", - }, - { - "sSt", - Util.telescope("lsp_dynamic_workspace_symbols", { - symbols = { - "Trait", - }, - }), - desc = "Trait", - }, - { - "sSF", - Util.telescope("lsp_dynamic_workspace_symbols", { - symbols = { - "Field", - }, - }), - desc = "Field", - }, - { - "sSp", - Util.telescope("lsp_dynamic_workspace_symbols", { - - symbols = { - "Property", - }, - }), - desc = "Property", - }, - { - "sSv", - Util.telescope("lsp_dynamic_workspace_symbols", { - symbols = { - "Variable", - "Parameter", - }, - }), - desc = "Variable", - }, - { - "sA", - Util.telescope("treesitter"), - desc = "Treesitter Symbols", - }, - }, - opts = function() - local actions = require("telescope.actions") - local open_with_trouble = function(...) - return require("trouble.providers.telescope").open_with_trouble(...) - end - - local open_selected_with_trouble = function(...) - return require("trouble.providers.telescope").open_selected_with_trouble(...) - end - - local find_files_no_ignore = function() - local action_state = require("telescope.actions.state") - local line = action_state.get_current_line() - Util.telescope("find_files", { no_ignore = true, default_text = line })() - end - - local find_files_with_hidden = function() - local action_state = require("telescope.actions.state") - local line = action_state.get_current_line() - Util.telescope("find_files", { hidden = true, default_text = line })() - end - - return { - defaults = { - prompt_prefix = " ", - selection_caret = " ", - mappings = { - i = { - [""] = open_with_trouble, - [""] = open_selected_with_trouble, - [""] = find_files_no_ignore, - [""] = find_files_with_hidden, - [""] = actions.cycle_history_next, - [""] = actions.cycle_history_prev, - [""] = actions.preview_scrolling_down, - [""] = actions.preview_scrolling_up, - [""] = actions.move_selection_previous, - [""] = actions.move_selection_next, - [""] = actions.send_selected_to_qflist + actions.open_qflist, - [""] = actions.close, - [""] = false, - [""] = actions.delete_buffer + actions.move_to_top, - }, - n = { - ["q"] = actions.close, - }, - }, - file_ignore_patterns = { - ".gitignore", - "node_modules", - "build", - "dist", - "yarn.lock", - "*.git/*", - "*/tmp/*", - }, - pickers = { - find_files = { - hidden = true, - }, - }, - extensions = { - undo = { - side_by_side = true, - layout_strategy = "vertical", - layout_config = { - preview_height = 0.65, - }, - }, - import = { - insert_at_top = true, - }, - fzf = { - fuzzy = true, - override_generic_sorter = true, - override_file_sorter = true, - case_mode = "smart_case", - }, - }, - }, - require("telescope").load_extension("refactoring"), - } - end, + { + "nvim-telescope/telescope.nvim", + commit = vim.fn.has("nvim-0.9.0") == 0 and "057ee0f8783" or nil, + cmd = "Telescope", + version = false, -- telescope did only one release, so use HEAD for now + dependencies = { + "nvim-telescope/telescope-fzf-native.nvim", + build = "make", + config = function() + require("telescope").load_extension("fzf") + end, }, + keys = { + { + ",", + "Telescope buffers show_all_buffers=true", + desc = "Switch Buffer", + }, + { + "/", + Util.telescope("live_grep"), + desc = "Grep (root dir)", + }, + { + ":", + "Telescope command_history", + desc = "Command History", + }, + { + "", + Util.telescope("files"), + desc = "Find Files (root dir)", + }, + -- find + { "fb", "Telescope buffers", desc = "Buffers" }, + { + "ff", + Util.telescope("files"), + desc = "Find Files (root dir)", + }, + { + "fF", + Util.telescope("files", { cwd = false }), + desc = "Find Files (cwd)", + }, + { "fr", "Telescope oldfiles", desc = "Recent" }, + { "fR", Util.telescope("oldfiles", { cwd = vim.loop.cwd() }), desc = "Recent (cwd)" }, + -- git + { "gc", "Telescope git_commits", desc = "commits" }, + { "gs", "Telescope git_status", desc = "status" }, + -- search + { 's"', "Telescope registers", desc = "Registers" }, + { + "sa", + "Telescope autocommands", + desc = "Auto Commands", + }, + { "sb", "Telescope current_buffer_fuzzy_find", desc = "Buffer" }, + { + "sc", + "Telescope command_history", + desc = "Command History", + }, + { "sC", "Telescope commands", desc = "Commands" }, + { + "sd", + "Telescope diagnostics bufnr=0", + desc = "Document diagnostics", + }, + { + "sD", + "Telescope diagnostics", + desc = "Workspace diagnostics", + }, + { + "sg", + Util.telescope("live_grep"), + desc = "Grep (root dir)", + }, + { "sG", Util.telescope("live_grep", { cwd = false }), desc = "Grep (cwd)" }, + { "sh", "Telescope help_tags", desc = "Help Pages" }, + { + "sH", + "Telescope highlights", + desc = "Search Highlight Groups", + }, + { "sk", "Telescope keymaps", desc = "Key Maps" }, + { "sM", "Telescope man_pages", desc = "Man Pages" }, + { "sm", "Telescope marks", desc = "Jump to Mark" }, + { "so", "Telescope vim_options", desc = "Options" }, + { "sR", "Telescope resume", desc = "Resume" }, + { "gu", "Telescope undo", desc = "Telescope Undotree" }, + { + "sw", + Util.telescope("grep_string", { word_match = "-w" }), + desc = "Word (root dir)", + }, + { "sW", Util.telescope("grep_string", { cwd = false, word_match = "-w" }), desc = "Word (cwd)" }, + { + "sw", + Util.telescope("grep_string"), + mode = "v", + desc = "Selection (root dir)", + }, + { + "sW", + Util.telescope("grep_string", { cwd = false }), + mode = "v", + desc = "Selection (cwd)", + }, + { + "uC", + Util.telescope("colorscheme", { enable_preview = true }), + desc = "Colorscheme with preview", + }, + { + "ssa", + Util.telescope("lsp_document_symbols", { + symbols = { + "Class", + "Function", + "Method", + "Constructor", + "Interface", + "Module", + "Struct", + "Trait", + "Field", + "Property", + "Enum", + "Constant", + }, + }), + desc = "All", + }, + { + "ssc", + Util.telescope("lsp_document_symbols", { + symbols = { + "Class", + }, + }), + desc = "Class", + }, + { + "ssf", + Util.telescope("lsp_document_symbols", { + symbols = { + "Function", + }, + }), + desc = "Function", + }, + { + "ssm", + Util.telescope("lsp_document_symbols", { + symbols = { + "Method", + }, + }), + desc = "Method", + }, + { + "ssC", + Util.telescope("lsp_document_symbols", { + symbols = { + "Constructor", + }, + }), + desc = "Constructor", + }, + { + "sse", + Util.telescope("lsp_document_symbols", { + symbols = { + "Enum", + }, + }), + desc = "Enum", + }, + { + "ssi", + Util.telescope("lsp_document_symbols", { + symbols = { + "Interface", + }, + }), + desc = "Interface", + }, + { + "ssM", + Util.telescope("lsp_document_symbols", { + symbols = { + "Module", + }, + }), + desc = "Module", + }, + { + "sss", + Util.telescope("lsp_document_symbols", { + symbols = { + "Struct", + }, + }), + desc = "Struct", + }, + { + "sst", + Util.telescope("lsp_document_symbols", { + symbols = { + "Trait", + }, + }), + desc = "Trait", + }, + { + "ssF", + Util.telescope("lsp_document_symbols", { + symbols = { + "Field", + }, + }), + desc = "Field", + }, + { + "ssp", + Util.telescope("lsp_document_symbols", { + symbols = { + "Property", + }, + }), + desc = "Property", + }, + { + "ssv", + Util.telescope("lsp_document_symbols", { + symbols = { + "Variable", + "Parameter", + }, + }), + desc = "Variable", + }, + { + "sSa", + Util.telescope("lsp_dynamic_workspace_symbols", { + symbols = { + "Class", + "Function", + "Method", + "Constructor", + "Interface", + "Module", + "Struct", + "Trait", + "Field", + "Property", + "Enum", + "Constant", + }, + }), + desc = "All", + }, + { + "sSc", + Util.telescope("lsp_dynamic_workspace_symbols", { + symbols = { + "Class", + }, + }), + desc = "Class", + }, + { + "sSf", + Util.telescope("lsp_dynamic_workspace_symbols", { + symbols = { + "Function", + }, + }), + desc = "Function", + }, + { + "sSm", + Util.telescope("lsp_dynamic_workspace_symbols", { + symbols = { + "Method", + }, + }), + desc = "Method", + }, + { + "sSC", + Util.telescope("lsp_dynamic_workspace_symbols", { + symbols = { + "Constructor", + }, + }), + desc = "Constructor", + }, + { + "sSe", + Util.telescope("lsp_dynamic_workspace_symbols", { + symbols = { + "Enum", + }, + }), + desc = "Enum", + }, + { + "sSi", + Util.telescope("lsp_dynamic_workspace_symbols", { + symbols = { + "Interface", + }, + }), + desc = "Interface", + }, + { + "sSM", + Util.telescope("lsp_dynamic_workspace_symbols", { + symbols = { + "Module", + }, + }), + desc = "Module", + }, + { + "sSs", + Util.telescope("lsp_dynamic_workspace_symbols", { + symbols = { + "Struct", + }, + }), + desc = "Struct", + }, + { + "sSt", + Util.telescope("lsp_dynamic_workspace_symbols", { + symbols = { + "Trait", + }, + }), + desc = "Trait", + }, + { + "sSF", + Util.telescope("lsp_dynamic_workspace_symbols", { + symbols = { + "Field", + }, + }), + desc = "Field", + }, + { + "sSp", + Util.telescope("lsp_dynamic_workspace_symbols", { + + symbols = { + "Property", + }, + }), + desc = "Property", + }, + { + "sSv", + Util.telescope("lsp_dynamic_workspace_symbols", { + symbols = { + "Variable", + "Parameter", + }, + }), + desc = "Variable", + }, + { + "sA", + Util.telescope("treesitter"), + desc = "Treesitter Symbols", + }, + }, + opts = function() + local actions = require("telescope.actions") + local open_with_trouble = function(...) + return require("trouble.providers.telescope").open_with_trouble(...) + end + + local open_selected_with_trouble = function(...) + return require("trouble.providers.telescope").open_selected_with_trouble(...) + end + + local find_files_no_ignore = function() + local action_state = require("telescope.actions.state") + local line = action_state.get_current_line() + Util.telescope("find_files", { no_ignore = true, default_text = line })() + end + + local find_files_with_hidden = function() + local action_state = require("telescope.actions.state") + local line = action_state.get_current_line() + Util.telescope("find_files", { hidden = true, default_text = line })() + end + + return { + defaults = { + prompt_prefix = " ", + selection_caret = " ", + mappings = { + i = { + [""] = open_with_trouble, + [""] = open_selected_with_trouble, + [""] = find_files_no_ignore, + [""] = find_files_with_hidden, + [""] = actions.cycle_history_next, + [""] = actions.cycle_history_prev, + [""] = actions.preview_scrolling_down, + [""] = actions.preview_scrolling_up, + [""] = actions.move_selection_previous, + [""] = actions.move_selection_next, + [""] = actions.send_selected_to_qflist + actions.open_qflist, + [""] = actions.close, + [""] = false, + [""] = actions.delete_buffer + actions.move_to_top, + }, + n = { + ["q"] = actions.close, + }, + }, + file_ignore_patterns = { + ".gitignore", + "node_modules", + "build", + "dist", + "yarn.lock", + "*.git/*", + "*/tmp/*", + }, + pickers = { + find_files = { + hidden = true, + }, + }, + extensions = { + undo = { + side_by_side = true, + layout_strategy = "vertical", + layout_config = { + preview_height = 0.65, + }, + }, + import = { + insert_at_top = true, + }, + fzf = { + fuzzy = true, + override_generic_sorter = true, + override_file_sorter = true, + case_mode = "smart_case", + }, + }, + }, + require("telescope").load_extension("refactoring"), + } + end, + }, }