formmatting

This commit is contained in:
christianchiarulli 2021-07-06 23:22:46 -04:00
parent 152dd8032f
commit 7e60bb9d9f

View file

@ -1,11 +1,11 @@
local execute = vim.api.nvim_command local execute = vim.api.nvim_command
local fn = vim.fn local fn = vim.fn
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim" local install_path = fn.stdpath "data" .. "/site/pack/packer/start/packer.nvim"
if fn.empty(fn.glob(install_path)) > 0 then if fn.empty(fn.glob(install_path)) > 0 then
execute("!git clone https://github.com/wbthomason/packer.nvim " .. install_path) execute("!git clone https://github.com/wbthomason/packer.nvim " .. install_path)
execute("packadd packer.nvim") execute "packadd packer.nvim"
end end
local packer_ok, packer = pcall(require, "packer") local packer_ok, packer = pcall(require, "packer")
@ -13,84 +13,84 @@ if not packer_ok then
return return
end end
packer.init({ packer.init {
git = { clone_timeout = 300 }, git = { clone_timeout = 300 },
display = { display = {
open_fn = function() open_fn = function()
return require("packer.util").float({ border = "single" }) return require("packer.util").float { border = "single" }
end, end,
}, },
}) }
vim.cmd("autocmd BufWritePost plugins.lua PackerCompile") vim.cmd "autocmd BufWritePost plugins.lua PackerCompile"
return require("packer").startup(function(use) return require("packer").startup(function(use)
-- Packer can manage itself as an optional plugin -- Packer can manage itself as an optional plugin
use("wbthomason/packer.nvim") use "wbthomason/packer.nvim"
-- TODO refactor all of this (for now it works, but yes I know it could be wrapped in a simpler function) -- TODO refactor all of this (for now it works, but yes I know it could be wrapped in a simpler function)
use({ "neovim/nvim-lspconfig" }) use { "neovim/nvim-lspconfig" }
use({ "kabouzeid/nvim-lspinstall", event = "BufRead" }) use { "kabouzeid/nvim-lspinstall", event = "BufRead" }
-- Telescope -- Telescope
use({ "nvim-lua/popup.nvim" }) use { "nvim-lua/popup.nvim" }
use({ "nvim-lua/plenary.nvim" }) use { "nvim-lua/plenary.nvim" }
use({ "tjdevries/astronauta.nvim" }) use { "tjdevries/astronauta.nvim" }
use({ use {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
config = [[require('lv-telescope')]], config = [[require('lv-telescope')]],
event = "BufEnter", event = "BufEnter",
}) }
-- Autocomplete -- Autocomplete
use({ use {
"hrsh7th/nvim-compe", "hrsh7th/nvim-compe",
event = "InsertEnter", event = "InsertEnter",
config = function() config = function()
require("lv-compe").config() require("lv-compe").config()
end, end,
}) }
use({ "hrsh7th/vim-vsnip", event = "InsertEnter" }) use { "hrsh7th/vim-vsnip", event = "InsertEnter" }
use({ "rafamadriz/friendly-snippets", event = "InsertEnter" }) use { "rafamadriz/friendly-snippets", event = "InsertEnter" }
-- Treesitter -- Treesitter
use({ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" }) use { "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" }
-- Neoformat -- Neoformat
use({ "sbdchd/neoformat" }) use { "sbdchd/neoformat" }
use({ use {
"kyazdani42/nvim-tree.lua", "kyazdani42/nvim-tree.lua",
-- cmd = "NvimTreeToggle", -- cmd = "NvimTreeToggle",
config = function() config = function()
require("lv-nvimtree").config() require("lv-nvimtree").config()
end, end,
}) }
use({ use {
"lewis6991/gitsigns.nvim", "lewis6991/gitsigns.nvim",
config = function() config = function()
require("lv-gitsigns").config() require("lv-gitsigns").config()
end, end,
event = "BufRead", event = "BufRead",
}) }
-- whichkey -- whichkey
use({ "folke/which-key.nvim" }) use { "folke/which-key.nvim" }
-- Autopairs -- Autopairs
use({ use {
"windwp/nvim-autopairs", "windwp/nvim-autopairs",
event = "InsertEnter", event = "InsertEnter",
after = { "telescope.nvim" }, after = { "telescope.nvim" },
config = function() config = function()
require("lv-autopairs") require "lv-autopairs"
end, end,
}) }
-- Comments -- Comments
use({ use {
"terrortylor/nvim-comment", "terrortylor/nvim-comment",
cmd = "CommentToggle", cmd = "CommentToggle",
config = function() config = function()
@ -100,18 +100,18 @@ return require("packer").startup(function(use)
end end
nvim_comment.setup() nvim_comment.setup()
end, end,
}) }
-- Color -- Color
use({ "christianchiarulli/nvcode-color-schemes.vim", opt = true }) use { "christianchiarulli/nvcode-color-schemes.vim", opt = true }
-- Icons -- Icons
use({ "kyazdani42/nvim-web-devicons" }) use { "kyazdani42/nvim-web-devicons" }
-- Status Line and Bufferline -- Status Line and Bufferline
use({ "glepnir/galaxyline.nvim" }) use { "glepnir/galaxyline.nvim" }
use({ use {
"romgrk/barbar.nvim", "romgrk/barbar.nvim",
config = function() config = function()
vim.api.nvim_set_keymap("n", "<TAB>", ":BufferNext<CR>", { noremap = true, silent = true }) vim.api.nvim_set_keymap("n", "<TAB>", ":BufferNext<CR>", { noremap = true, silent = true })
@ -119,12 +119,12 @@ return require("packer").startup(function(use)
vim.api.nvim_set_keymap("n", "<S-x>", ":BufferClose<CR>", { noremap = true, silent = true }) vim.api.nvim_set_keymap("n", "<S-x>", ":BufferClose<CR>", { noremap = true, silent = true })
end, end,
-- event = "BufRead", -- event = "BufRead",
}) }
-- Builtins, these do not load by default -- Builtins, these do not load by default
-- Dashboard -- Dashboard
use({ use {
"ChristianChiarulli/dashboard-nvim", "ChristianChiarulli/dashboard-nvim",
-- event = "BufWinEnter", -- event = "BufWinEnter",
-- cmd = { "Dashboard", "DashboardNewFile", "DashboardJumpMarks" }, -- cmd = { "Dashboard", "DashboardNewFile", "DashboardJumpMarks" },
@ -133,9 +133,9 @@ return require("packer").startup(function(use)
end, end,
disable = not O.plugin.dashboard.active, disable = not O.plugin.dashboard.active,
-- opt = true, -- opt = true,
}) }
-- Zen Mode -- Zen Mode
use({ use {
"folke/zen-mode.nvim", "folke/zen-mode.nvim",
cmd = "ZenMode", cmd = "ZenMode",
-- event = "BufRead", -- event = "BufRead",
@ -143,26 +143,26 @@ return require("packer").startup(function(use)
require("lv-zen").config() require("lv-zen").config()
end, end,
disable = not O.plugin.zen.active, disable = not O.plugin.zen.active,
}) }
use({ use {
"norcalli/nvim-colorizer.lua", "norcalli/nvim-colorizer.lua",
event = "BufRead", event = "BufRead",
config = function() config = function()
require("lv-colorizer") require "lv-colorizer"
-- vim.cmd "ColorizerReloadAllBuffers" -- vim.cmd "ColorizerReloadAllBuffers"
end, end,
disable = not O.plugin.colorizer.active, disable = not O.plugin.colorizer.active,
}) }
-- Treesitter playground -- Treesitter playground
use({ use {
"nvim-treesitter/playground", "nvim-treesitter/playground",
event = "BufRead", event = "BufRead",
disable = not O.plugin.ts_playground.active, disable = not O.plugin.ts_playground.active,
}) }
use({ use {
"lukas-reineke/indent-blankline.nvim", "lukas-reineke/indent-blankline.nvim",
event = "BufRead", event = "BufRead",
setup = function() setup = function()
@ -180,30 +180,30 @@ return require("packer").startup(function(use)
vim.g.indent_blankline_show_first_indent_level = true vim.g.indent_blankline_show_first_indent_level = true
end, end,
disable = not O.plugin.indent_line.active, disable = not O.plugin.indent_line.active,
}) }
-- comments in context -- comments in context
use({ use {
"JoosepAlviste/nvim-ts-context-commentstring", "JoosepAlviste/nvim-ts-context-commentstring",
event = "BufRead", event = "BufRead",
disable = not O.plugin.ts_context_commentstring.active, disable = not O.plugin.ts_context_commentstring.active,
}) }
-- Symbol Outline -- Symbol Outline
use({ use {
"simrat39/symbols-outline.nvim", "simrat39/symbols-outline.nvim",
cmd = "SymbolsOutline", cmd = "SymbolsOutline",
disable = not O.plugin.symbol_outline.active, disable = not O.plugin.symbol_outline.active,
}) }
-- diagnostics -- diagnostics
use({ use {
"folke/trouble.nvim", "folke/trouble.nvim",
cmd = "TroubleToggle", cmd = "TroubleToggle",
disable = not O.plugin.trouble.active, disable = not O.plugin.trouble.active,
}) }
-- Debugging -- Debugging
use({ use {
"mfussenegger/nvim-dap", "mfussenegger/nvim-dap",
config = function() config = function()
local status_ok, dap = pcall(require, "dap") local status_ok, dap = pcall(require, "dap")
@ -220,84 +220,84 @@ return require("packer").startup(function(use)
dap.defaults.fallback.terminal_win_cmd = "50vsplit new" dap.defaults.fallback.terminal_win_cmd = "50vsplit new"
end, end,
disable = not O.plugin.debug.active, disable = not O.plugin.debug.active,
}) }
-- Floating terminal -- Floating terminal
use({ use {
"numToStr/FTerm.nvim", "numToStr/FTerm.nvim",
event = "BufWinEnter", event = "BufWinEnter",
config = function() config = function()
require("lv-floatterm").config() require("lv-floatterm").config()
end, end,
disable = not O.plugin.floatterm.active, disable = not O.plugin.floatterm.active,
}) }
-- Use fzy for telescope -- Use fzy for telescope
use({ use {
"nvim-telescope/telescope-fzy-native.nvim", "nvim-telescope/telescope-fzy-native.nvim",
event = "BufRead", event = "BufRead",
disable = not O.plugin.telescope_fzy.active, disable = not O.plugin.telescope_fzy.active,
}) }
-- Use project for telescope -- Use project for telescope
use({ use {
"nvim-telescope/telescope-project.nvim", "nvim-telescope/telescope-project.nvim",
event = "BufRead", event = "BufRead",
setup = function() setup = function()
vim.cmd([[packadd telescope.nvim]]) vim.cmd [[packadd telescope.nvim]]
end, end,
disable = not O.plugin.telescope_project.active, disable = not O.plugin.telescope_project.active,
}) }
-- Sane gx for netrw_gx bug -- Sane gx for netrw_gx bug
use({ use {
"felipec/vim-sanegx", "felipec/vim-sanegx",
event = "BufRead", event = "BufRead",
disable = not O.plugin.sanegx.active, disable = not O.plugin.sanegx.active,
}) }
-- Diffview -- Diffview
use({ use {
"sindrets/diffview.nvim", "sindrets/diffview.nvim",
event = "BufRead", event = "BufRead",
disable = not O.plugin.diffview.active, disable = not O.plugin.diffview.active,
}) }
-- Lush Create Color Schemes -- Lush Create Color Schemes
use({ use {
"rktjmp/lush.nvim", "rktjmp/lush.nvim",
-- cmd = {"LushRunQuickstart", "LushRunTutorial", "Lushify"}, -- cmd = {"LushRunQuickstart", "LushRunTutorial", "Lushify"},
disable = not O.plugin.lush.active, disable = not O.plugin.lush.active,
}) }
-- Debugger management -- Debugger management
use({ use {
"Pocco81/DAPInstall.nvim", "Pocco81/DAPInstall.nvim",
-- event = "BufRead", -- event = "BufRead",
disable = not O.plugin.dap_install.active, disable = not O.plugin.dap_install.active,
}) }
-- LANGUAGE SPECIFIC GOES HERE -- LANGUAGE SPECIFIC GOES HERE
use({ use {
"lervag/vimtex", "lervag/vimtex",
ft = "tex", ft = "tex",
config = function() config = function()
require("lv-vimtex") require "lv-vimtex"
end, end,
}) }
-- Rust tools -- Rust tools
-- TODO: use lazy loading maybe? -- TODO: use lazy loading maybe?
use({ use {
"simrat39/rust-tools.nvim", "simrat39/rust-tools.nvim",
disable = not O.lang.rust.rust_tools.active, disable = not O.lang.rust.rust_tools.active,
}) }
-- Elixir -- Elixir
use({ "elixir-editors/vim-elixir", ft = { "elixir", "eelixir", "euphoria3" } }) use { "elixir-editors/vim-elixir", ft = { "elixir", "eelixir", "euphoria3" } }
-- Javascript / Typescript -- Javascript / Typescript
use({ use {
"jose-elias-alvarez/nvim-lsp-ts-utils", "jose-elias-alvarez/nvim-lsp-ts-utils",
ft = { ft = {
"javascript", "javascript",
@ -307,7 +307,7 @@ return require("packer").startup(function(use)
"typescriptreact", "typescriptreact",
"typescript.tsx", "typescript.tsx",
}, },
}) }
-- use { -- use {
-- "jose-elias-alvarez/null-ls.nvim", -- "jose-elias-alvarez/null-ls.nvim",
-- ft = { -- ft = {
@ -324,36 +324,36 @@ return require("packer").startup(function(use)
-- } -- }
-- Pretty parentheses -- Pretty parentheses
use({ use {
"p00f/nvim-ts-rainbow", "p00f/nvim-ts-rainbow",
disable = not O.plugin.ts_rainbow.active, disable = not O.plugin.ts_rainbow.active,
}) }
-- Autotags <div>|</div> -- Autotags <div>|</div>
use({ use {
"windwp/nvim-ts-autotag", "windwp/nvim-ts-autotag",
event = "InsertEnter", event = "InsertEnter",
disable = not O.plugin.ts_autotag.active, disable = not O.plugin.ts_autotag.active,
}) }
-- Custom semantic text objects -- Custom semantic text objects
use({ use {
"nvim-treesitter/nvim-treesitter-textobjects", "nvim-treesitter/nvim-treesitter-textobjects",
disable = not O.plugin.ts_textobjects.active, disable = not O.plugin.ts_textobjects.active,
}) }
-- Smart text objects -- Smart text objects
use({ use {
"RRethy/nvim-treesitter-textsubjects", "RRethy/nvim-treesitter-textsubjects",
disable = not O.plugin.ts_textsubjects.active, disable = not O.plugin.ts_textsubjects.active,
}) }
-- Text objects using hint labels -- Text objects using hint labels
use({ use {
"mfussenegger/nvim-ts-hint-textobject", "mfussenegger/nvim-ts-hint-textobject",
event = "BufRead", event = "BufRead",
disable = not O.plugin.ts_hintobjects.active, disable = not O.plugin.ts_hintobjects.active,
}) }
for _, plugin in pairs(O.user_plugins) do for _, plugin in pairs(O.user_plugins) do
packer.use(plugin) packer.use(plugin)