From 699efee232251032bf976547557e149daca9e833 Mon Sep 17 00:00:00 2001 From: Ethan Hunter Date: Mon, 19 Dec 2022 15:52:56 -0700 Subject: [PATCH] inital commit --- .gitignore | 1 + after/ftplugin/go.lua | 4 + after/ftplugin/lua.lua | 4 + after/plugin/defaults.lua | 31 +++++ init.lua | 1 + lua/config/autopairs.lua | 11 ++ lua/config/cmp.lua | 113 ++++++++++++++++ lua/config/indentblankline.lua | 11 ++ lua/config/lsp/handlers.lua | 41 ++++++ lua/config/lsp/init.lua | 38 ++++++ lua/config/lsp/installer.lua | 25 ++++ lua/config/lsp/keymaps.lua | 37 ++++++ lua/config/lualine.lua | 100 +++++++++++++++ lua/config/luasnip.lua | 14 ++ lua/config/telescope.lua | 14 ++ lua/config/treesitter.lua | 80 ++++++++++++ lua/config/whichkey.lua | 57 +++++++++ lua/plugins.lua | 227 +++++++++++++++++++++++++++++++++ lua/utils/finder.lua | 9 ++ plugin/.gitignore | 1 + 20 files changed, 819 insertions(+) create mode 100644 .gitignore create mode 100644 after/ftplugin/go.lua create mode 100644 after/ftplugin/lua.lua create mode 100644 after/plugin/defaults.lua create mode 100644 init.lua create mode 100644 lua/config/autopairs.lua create mode 100644 lua/config/cmp.lua create mode 100644 lua/config/indentblankline.lua create mode 100644 lua/config/lsp/handlers.lua create mode 100644 lua/config/lsp/init.lua create mode 100644 lua/config/lsp/installer.lua create mode 100644 lua/config/lsp/keymaps.lua create mode 100644 lua/config/lualine.lua create mode 100644 lua/config/luasnip.lua create mode 100644 lua/config/telescope.lua create mode 100644 lua/config/treesitter.lua create mode 100644 lua/config/whichkey.lua create mode 100644 lua/plugins.lua create mode 100644 lua/utils/finder.lua create mode 100644 plugin/.gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c84aa4a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +plugin/packer_compiled.lua diff --git a/after/ftplugin/go.lua b/after/ftplugin/go.lua new file mode 100644 index 0000000..83dbc90 --- /dev/null +++ b/after/ftplugin/go.lua @@ -0,0 +1,4 @@ +vim.bo.shiftwidth = 2 +vim.bo.tabstop = 2 +vim.bo.softtabstop = 2 +vim.bo.textwidth = 120 diff --git a/after/ftplugin/lua.lua b/after/ftplugin/lua.lua new file mode 100644 index 0000000..83dbc90 --- /dev/null +++ b/after/ftplugin/lua.lua @@ -0,0 +1,4 @@ +vim.bo.shiftwidth = 2 +vim.bo.tabstop = 2 +vim.bo.softtabstop = 2 +vim.bo.textwidth = 120 diff --git a/after/plugin/defaults.lua b/after/plugin/defaults.lua new file mode 100644 index 0000000..c5f8443 --- /dev/null +++ b/after/plugin/defaults.lua @@ -0,0 +1,31 @@ +local api = vim.api +local g = vim.g +local opt = vim.opt + + +-- leader +api.nvim_set_keymap("", "", "", {noremap = true, silent = true }) +g.mapleader = " " +g.maplocalleader = " " + + +opt.termguicolors = true +opt.hlsearch = true +opt.number = true +opt.relativenumber = true +opt.mouse = "a" +opt.breakindent = true +opt.undofile = true +opt.ignorecase = true +opt.smartcase = true +opt.updatetime = 250 +opt.signcolumn = "yes" +opt.clipboard = "unnamedplus" + +vim.cmd [[ + augroup YankHighlight + autocmd! + autocmd TextYankPost * silent! lua vim.highlight.on_yank() + augroup end +]] + diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..dd89e40 --- /dev/null +++ b/init.lua @@ -0,0 +1 @@ +require("plugins").setup() diff --git a/lua/config/autopairs.lua b/lua/config/autopairs.lua new file mode 100644 index 0000000..b2afc4f --- /dev/null +++ b/lua/config/autopairs.lua @@ -0,0 +1,11 @@ +local M = {} + +function M.setup() + local npairs = require "nvim-autopairs" + npairs.setup { + check_ts = true, + } + npairs.add_rules(require "nvim-autopairs.rules.endwise-lua") +end + +return M diff --git a/lua/config/cmp.lua b/lua/config/cmp.lua new file mode 100644 index 0000000..06d0048 --- /dev/null +++ b/lua/config/cmp.lua @@ -0,0 +1,113 @@ +local M = {} + +function M.setup() + local has_words_before = function() + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match "%s" == nil + end + + local cmp = require "cmp" + local lspkind = require "lspkind" + + local cmp_autopairs = require "nvim-autopairs.completion.cmp" + cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done { map_char = { tex = "" } }) + + cmp.setup { + completion = { completeopt = "menu,menuone,noinsert", keyword_length = 1,}, + experimental = { native_menu = false, ghost_text = false }, + + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + + formatting = { + -- format = function(entry, vim_item) + -- vim_item.menu = ({ + -- buffer = "[Buffer]", + -- nvim_lua = "[Lua]", + -- treesitter = "[Treesitter]", + -- })[entry.source.name] + -- return vim_item + -- end, + format = lspkind.cmp_format({ + mode = "symbol", + maxwidth = 50, + ellipsis_char = "...", + before = function(entry, vim_item) + vim_item.menu = ({ + buffer = "[Buffer]", + nvim_lua = "[Lua]", + treesitter = "[Treesitter]", + })[entry.source.name] + return vim_item + end + }) + }, + mapping = { + [""] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), + [""] = cmp.mapping { i = cmp.mapping.close(), c = cmp.mapping.close() }, + [""] = cmp.mapping { + i = cmp.mapping.confirm { behavior = cmp.ConfirmBehavior.Replace, select = false }, + c = function(fallback) + if cmp.visible() then + cmp.confirm { behavior = cmp.ConfirmBehavior.Replace, select = false } + else + fallback() + end + end, + }, + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { "i", "s", "c" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + else + fallback() + end + end, + {"i", "s", "c" }), + }, + + sources = { + { name = "nvim_lsp"}, + { name = "treesitter" }, + { name = "buffer" }, + { name = "nvim_lua" }, + { name = "path" }, + { name = "nvim_lsp_signature_help"}, + }, + --[[ documentation = { + border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" }, + winhighlight = "NormalFloat:NormalFloat,FloatBorder:TelescopeBorder", + }, ]] + } + + cmp.setup.cmdline("/", { + sources = { + { name = "buffer" }, + }, + }) + + cmp.setup.cmdline(":", { + sources = cmp.config.sources({ + { name = "path" }, + }, { + { name = "cmdline" }, + }), + }) +end + +return M diff --git a/lua/config/indentblankline.lua b/lua/config/indentblankline.lua new file mode 100644 index 0000000..3b96866 --- /dev/null +++ b/lua/config/indentblankline.lua @@ -0,0 +1,11 @@ +local M = {} + +function M.setup() + local g = vim.g + g.indent_blankline_char = "┊" + g.indent_blankline_filetype_exclude = {"help", "packer"} + g.indent_blankline_buftype_exclude = {"terminal", "nofile"} + g.indent_blankline_show_trailing_blankline_indent = false +end + +return M diff --git a/lua/config/lsp/handlers.lua b/lua/config/lsp/handlers.lua new file mode 100644 index 0000000..ec9d56c --- /dev/null +++ b/lua/config/lsp/handlers.lua @@ -0,0 +1,41 @@ +local M = {} + +function M.setup() + local lsp = { + float = { + focusable = true, + style = "minimal", + border = "rounded", + }, + diagnostic = { + virtual_text = { spacing = 4, prefix = "●" }, + underline = true, + update_in_insert = true, + severity_sort = true, + float = { + focusable = true, + style = "minimal", + border = "rounded", + }, + }, + } + local diagnostic_signs = { + { name = "DiagnosticSignError", text = "" }, + { name = "DiagnosticSignWarn", text = "" }, + { name = "DiagnosticSignHint", text = "" }, + { name = "DiagnosticSignInfo", text = "" }, + } + for _, sign in ipairs(diagnostic_signs) do + vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = sign.name }) + end + -- Diagnostic configuration + vim.diagnostic.config(lsp.diagnostic) + + -- Hover configuration + vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, lsp.float) + + -- Signature help configuration + vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, lsp.float) +end + +return M diff --git a/lua/config/lsp/init.lua b/lua/config/lsp/init.lua new file mode 100644 index 0000000..962aa9b --- /dev/null +++ b/lua/config/lsp/init.lua @@ -0,0 +1,38 @@ +local M = {} +local servers = { + rust_analyzer = {}, + sumneko_lua = {}, + gopls = {}, +} + +local function on_attach(client, bufnr) + vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc") + vim.api.nvim_buf_set_option(0, "formatexpr", "v:lua.vim.lsp.formatexpr") + require("config.lsp.keymaps").setup(client, bufnr) +end + +local lsp_signature = require "lsp_signature" +lsp_signature.setup { + bind = true, + handler_opts = { + border = "rounded", + }, +} + +local capabilities = require("cmp_nvim_lsp").default_capabilities() + +local opts = { + on_attach = on_attach, + capabilities = capabilities, + flags = { + debounce_text_changes = 150, + }, +} + +require("config.lsp.handlers").setup() + +function M.setup() + require("config.lsp.installer").setup(servers, opts) +end + +return M diff --git a/lua/config/lsp/installer.lua b/lua/config/lsp/installer.lua new file mode 100644 index 0000000..3ffbe23 --- /dev/null +++ b/lua/config/lsp/installer.lua @@ -0,0 +1,25 @@ +local lsp_installer_servers = require "nvim-lsp-installer.servers" + +local M = {} + +function M.setup(servers, options) + for server_name, _ in pairs(servers) do + local server_available, server = lsp_installer_servers.get_server(server_name) + + if server_available then + server:on_ready(function() + local opts = vim.tbl_deep_extend("force", options, servers[server.name] or {}) + server:setup(opts) + end) + + if not server:is_installed() then + vim.notify("Installing " .. server.name, vim.log.levels.INFO) + server:install() + end + else + vim.notify(server, vim.log.levels.ERROR) + end + end +end + +return M diff --git a/lua/config/lsp/keymaps.lua b/lua/config/lsp/keymaps.lua new file mode 100644 index 0000000..ee3abc9 --- /dev/null +++ b/lua/config/lsp/keymaps.lua @@ -0,0 +1,37 @@ +local M = {} + +local whichkey = require "which-key" + +local keymap = vim.api.nvim_set_keymap +local buf_keymap = vim.api.nvim_buf_set_keymap + +local function keymappings(client, bufnr) + local opts = { noremap = true, silent = true } + + buf_keymap(bufnr, "n", "K", "lua vim.lsp.buf.hover()", opts) + keymap("n", "[d", "lua vim.diagnostic.goto_prev()", opts) + keymap("n", "]d", "lua vim.diagnostic.goto_next()", opts) + keymap("n", "[e", "lua vim.diagnostic.goto_prev({severity = vim.diagnostic.severity.ERROR})", opts) + keymap("n", "]e", "lua vim.diagnostic.goto_next({severity = vim.diagnostic.severity.ERROR})", opts) + + local keymap_l = { + name = "LSP Actions", + r = { "lua vim.lsp.buf.rename()", "Rename" }, + a = { "lua vim.lsp.buf.code_action()", "Code Action" }, + i = { "lua vim.diagnostic.open_float()", "Line Diagnostics" }, + d = { "lua vim.lsp.buf.definition()", "Definition" }, + D = { "lua vim.lsp.buf.declaration()", "Declaration" }, + s = { "lua vim.lsp.buf.signature_help()", "Signature Help" }, + I = { "lua vim.lsp.buf.implementation()", "Goto Implementation" }, + t = { "lua vim.lsp.buf.type_definition()", "Goto Type Definition" }, + f = { "lua vim.lsp.buf.format()", "Format Buffer"}, + } + + whichkey.register(keymap_l, { buffer = bufnr, prefix = "c"}) +end + +function M.setup(client, bufnr) + keymappings(client, bufnr) +end + +return M diff --git a/lua/config/lualine.lua b/lua/config/lualine.lua new file mode 100644 index 0000000..e3ad026 --- /dev/null +++ b/lua/config/lualine.lua @@ -0,0 +1,100 @@ +local M = {} + +local colors = { + bg = "#202328", + fg = "#bbc2cf", + yellow = "#ECBE7B", + cyan = "#008080", + darkblue = "#081633", + green = "#98be65", + orange = "#FF8800", + violet = "#a9a1e1", + magenta = "#c678dd", + blue = "#51afef", + red = "#ec5f67", +} + +local function separator() + return "%=" +end + +local function lsp_client() + local buf_clients = vim.lsp.buf_get_clients() + if next(buf_clients) == nil then + return "" + end + local buf_client_names = {} + for _, client in pairs(buf_clients) do + if client.name ~= "null-ls" then + table.insert(buf_client_names, client.name) + end + end + return "[" .. table.concat(buf_client_names, ", ") .. "]" +end + +local function lsp_progress(_, is_active) + if not is_active then + return + end + local messages = vim.lsp.util.get_progress_messages() + if #messages == 0 then + return "" + end + local status = {} + for _, msg in pairs(messages) do + local title = "" + if msg.title then + title = msg.title + end + table.insert(status, (msg.percentage or 0) .. "%% " .. title) + end + local spinners = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" } + local ms = vim.loop.hrtime() / 1000000 + local frame = math.floor(ms / 120) % #spinners + return table.concat(status, "  ") .. " " .. spinners[frame + 1] +end + +function M.setup() + local gps = require "nvim-gps" + + require("lualine").setup { + options = { + icons_enabled = true, + theme = "auto", + component_separators = { left = "", right = "" }, + section_separators = { left = "", right = "" }, + disabled_filetypes = {}, + always_divide_middle = true, + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch", "diff", "diagnostics" }, + lualine_c = { + { "filename" }, + { + gps.get_location, + cond = gps.is_available, + color = { fg = "#f3ca28" }, + }, + { separator }, + { lsp_client, icon = " ", color = { fg = colors.violet, gui = "bold" } }, + { lsp_progress }, + }, + lualine_x = { "encoding", "fileformat", "filetype" }, + lualine_y = { "progress" }, + lualine_z = { "location" }, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { "filename" }, + lualine_x = { "location" }, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + extensions = {}, + } +end + +return M diff --git a/lua/config/luasnip.lua b/lua/config/luasnip.lua new file mode 100644 index 0000000..10ecf74 --- /dev/null +++ b/lua/config/luasnip.lua @@ -0,0 +1,14 @@ +local M = {} + +function M.setup() + local luasnip = require "luasnip" + + luasnip.config.set_config { + history = false, + updateevents = "TextChanged,TextChangedI", + } + + require("luasnip/loaders/from_vscode").load() +end + +return M diff --git a/lua/config/telescope.lua b/lua/config/telescope.lua new file mode 100644 index 0000000..905a11a --- /dev/null +++ b/lua/config/telescope.lua @@ -0,0 +1,14 @@ +local M = {} + +function M.setup() + local actions = require "telescope.actions" + local telescope = require "telescope" + + telescope.load_extension "fzf" + telescope.load_extension "project" + telescope.load_extension "repo" + telescope.load_extension "file_browser" + telescope.load_extension "projects" +end + +return M diff --git a/lua/config/treesitter.lua b/lua/config/treesitter.lua new file mode 100644 index 0000000..2556d54 --- /dev/null +++ b/lua/config/treesitter.lua @@ -0,0 +1,80 @@ +local M = {} + +function M.setup() + require("nvim-treesitter.configs").setup { + ensure_installed = "all", + sync_install = false, + highlight = { + -- enable = true, + }, + + incremental_selection = { + enable = true, + keymaps = { + init_selection = "gnn", + node_incremental = "grn", + scope_incremental = "grc", + node_decremental = "grm", + }, + }, + + indent = { enable = true }, + + textobjects = { + select = { + enable = true, + + lookahead = true, + + keymaps = { + ["af"] = "@function.outer", + ["if"] = "@function.inner", + ["ac"] = "@class.outer", + ["ic"] = "@class.inner", + }, + }, + + swap = { + enable = true, + swap_next = { + ["rx"] = "@parameter.inner", + }, + swap_previous = { + ["rX"] = "@parameter.inner", + }, + }, + + move = { + enable = true, + set_jumps = true, + goto_next_start = { + ["]m"] = "@function.outer", + ["]]"] = "@class.outer", + }, + goto_next_end = { + ["]M"] = "@function.outer", + ["]["] = "@class.outer", + }, + goto_previous_start = { + ["[m"] = "@function.outer", + ["[["] = "@class.outer", + }, + goto_previous_end = { + ["[M"] = "@function.outer", + ["[]"] = "@class.outer", + }, + }, + + lsp_interop = { + enable = true, + border = "none", + peek_definition_code = { + ["df"] = "@function.outer", + ["dF"] = "@class.outer", + }, + }, + }, + } +end + +return M diff --git a/lua/config/whichkey.lua b/lua/config/whichkey.lua new file mode 100644 index 0000000..6eaabfb --- /dev/null +++ b/lua/config/whichkey.lua @@ -0,0 +1,57 @@ +local M = {} + +function M.setup() + local whichkey = require "which-key" + + local conf = { + window = { + border = "single", + position = "bottom", + }, + } + + local opts = { + mode = "n", + prefix = "", + buffer = nil, + silent = true, + noremap = true, + nowait = false, + } + + + local keymaps_fzf = { + name = "Find", + f = { "lua require('utils.finder').find_files()", "Files" }, + b = { "Telescope buffers", "Buffers"}, + o = { "Telescope oldfiles", "Old Lives"}, + g = { "Telescope live_grep", "Live Grep"}, + c = { "Telescope commands", "Commands"}, + r = { "Telescope file_browser", "File Browser" }, + w = { "Telescope current_buffer", "Current Buffer"}, + d = { "Telescope diagnostics", "LSP Diagnostics"}, + s = { "Telescope lsp_workspace_symbols", "LSP Symbols"}, + R = { "Telescope lsp_references", "LSP References"}, + } + + local keymaps_project = { + name = "Project", + p = { "lua require'telescope'.extensions.project.project{}", "List" }, + s = { "Telescope repo list", "Search" }, + } + + local mappings = { + ["w"] = { "update!", "Save" }, + ["j"] = { "HopWord", "Hop" }, + b = { + name = "Buffer", + q = {"bd", "Close Buffer"}, + }, + f = keymaps_fzf, + p = keymaps_project, + } + whichkey.setup(conf) + whichkey.register(mappings, opts) +end + +return M diff --git a/lua/plugins.lua b/lua/plugins.lua new file mode 100644 index 0000000..869aaf1 --- /dev/null +++ b/lua/plugins.lua @@ -0,0 +1,227 @@ +local M = {} + +function M.setup() + local packer_bootstrap = false + + local conf = { + profile = { + enable = true, + threshold = 0, + }, + display = { + open_fn = function() + return require("packer.util").float { border = "rounded" } + end, + }, + } + + local function packer_init() + local fn = vim.fn + local install_path = fn.stdpath "data" .. "/site/pack/packer/start/packer.nvim" + if fn.empty(fn.glob(install_path)) > 0 then + packer_bootstrap = fn.system { + "git", + "clone", + "--depth", + "1", + "https://github.com/wbthomason/packer.nvim.git", + install_path, + } + vim.cmd [[packadd packer.nvim]] + end + vim.cmd "autocmd BufWritePost plugins.lua source | PackerCompile" + end + + local function plugins(use) + use { "wbthomason/packer.nvim" } + + use { + "sainnhe/edge", + config = function() + vim.cmd "colorscheme edge" + end, + } + + use { + "folke/which-key.nvim", + config = function() + require("config.whichkey").setup() + end, + } + + use { + "lukas-reineke/indent-blankline.nvim", + event = "BufReadPre", + config = function() + require("config.indentblankline").setup() + end, + } + + use { + "kyazdani42/nvim-web-devicons", + module = "nvim-web-devicons", + config = function() + require("nvim-web-devicons").setup { default = true } + end, + } + + use { + 'numToStr/Comment.nvim', + config = function() + require('Comment').setup() + end + } + + use { "chaoren/vim-wordmotion" } + + -- Easy hopping + use { + "phaazon/hop.nvim", + cmd = { "HopWord", "HopChar1" }, + config = function() + require("hop").setup {} + end, + } + + use { + "nvim-lualine/lualine.nvim", + after = "nvim-treesitter", + config = function() + require("config.lualine").setup() + end, + requires = { "nvim-web-devicons" }, + } + + use { + "nvim-treesitter/nvim-treesitter", + run = ":TSUpdate", + config = function() + require("config.treesitter").setup() + end, + requires = { + { "nvim-treesitter/nvim-treesitter-textobjects" }, + } + } + + use { + "SmiteshP/nvim-gps", + requires = "nvim-treesitter/nvim-treesitter", + module = "nvim-gps", + config = function() + require("nvim-gps").setup() + end, + } + + use { + "hrsh7th/nvim-cmp", + config = function() + require("config.cmp").setup() + end, + wants = { "LuaSnip", "lspkind.nvim" }, + requires = { + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-nvim-lua", + "ray-x/cmp-treesitter", + "hrsh7th/cmp-cmdline", + "saadparwaiz1/cmp_luasnip", + "hrsh7th/cmp-calc", + "f3fora/cmp-spell", + "hrsh7th/cmp-emoji", + "hrsh7th/cmp-nvim-lsp", + "saadparwaiz1/cmp_luasnip", + "hrsh7th/cmp-nvim-lsp-signature-help", + { + "onsails/lspkind.nvim", + }, + { + "L3MON4D3/LuaSnip", + wants = "friendly-snippets", + config = function() + require("config.luasnip").setup() + end, + }, + disable = false, + }, + } + + use { + "windwp/nvim-autopairs", + wants = "nvim-treesitter", + module = { "nvim-autopairs.completion.cmp", "nvim-autopairs" }, + config = function() + require("config.autopairs").setup() + end, + } + + use { + "windwp/nvim-ts-autotag", + wants = "nvim-treesitter", + event = "InsertEnter", + config = function() + require("nvim-ts-autotag").setup { enable = true } + end, + } + + use { + "neovim/nvim-lspconfig", + opt = true, + event = "BufReadPre", + wants = { "nvim-lsp-installer", "cmp-nvim-lsp", "lsp_signature.nvim" }, + config = function() + require("config.lsp").setup() + end, + requires = { + "williamboman/nvim-lsp-installer", + "ray-x/lsp_signature.nvim" + } + } + + use { + "nvim-telescope/telescope.nvim", + opt = true, + config = function() + require("config.telescope").setup() + end, + cmd = { "Telescope" }, + module = "telescope", + keys = { "f", "p" }, + wants = { + "plenary.nvim", + "popup.nvim", + "telescope-fzf-native.nvim", + "telescope-project.nvim", + "telescope-repo.nvim", + "telescope-file-browser.nvim", + "project.nvim", + }, + requires = { + "nvim-lua/popup.nvim", + "nvim-lua/plenary.nvim", + { "nvim-telescope/telescope-fzf-native.nvim", run = "make" }, + "nvim-telescope/telescope-project.nvim", + "cljoly/telescope-repo.nvim", + "nvim-telescope/telescope-file-browser.nvim", + { + "ahmedkhalf/project.nvim", + config = function() + require("project_nvim").setup {} + end, + }, + }, + } + + if packer_bootstrap then + print "Plugin Bootstrap - Restart Neovim required after installation!" + require("packer").sync() + end + end + + packer_init() + + local packer = require "packer" + packer.init(conf) + packer.startup(plugins) +end + +return M diff --git a/lua/utils/finder.lua b/lua/utils/finder.lua new file mode 100644 index 0000000..ced3992 --- /dev/null +++ b/lua/utils/finder.lua @@ -0,0 +1,9 @@ +local M = {} + +function M.find_files() + local opts = {} + local telescope = require "telescope.builtin" + telescope.find_files(opts) +end + +return M diff --git a/plugin/.gitignore b/plugin/.gitignore new file mode 100644 index 0000000..12e60dc --- /dev/null +++ b/plugin/.gitignore @@ -0,0 +1 @@ +packer_compiled.nvim