<commit_before>-- ensure packer.nvim is installed
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
	fn.system({ "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path })
	vim.cmd("packadd packer.nvim")
end

-- use plugins
require("packer").startup(function(use)
	-- packer itself
	use("wbthomason/packer.nvim")
	-- Load only when require
	use({ "nvim-lua/plenary.nvim", module = "plenary" })
	use({ "kyazdani42/nvim-web-devicons", module = "nvim-web-devicons" })
	-- UI
	use({
		{
			"nvim-treesitter/nvim-treesitter",
			event = "BufReadPre",
			run = ":TSUpdate",
			config = function()
				require("nvim-treesitter.configs").setup({
					ensure_installed = {
						"bash",
						"css",
						"go",
						"gomod",
						"hcl",
						"html",
						"json",
						"java",
						"javascript",
						"lua",
						"python",
						"typescript",
						"vim",
						"yaml",
					},
					highlight = {
						enable = true,
					},
					indent = {
						enable = false,
					},
					autotag = {
						enable = true,
					},
					rainbow = {
						enable = true,
						extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
						max_file_lines = nil, -- Do not enable for files with more than n lines, int
						-- colors = {}, -- table of hex strings
						-- termcolors = {} -- table of colour name strings
					},
				})
			end,
		},
		{ "windwp/nvim-ts-autotag", after = "nvim-treesitter" },
		{ "p00f/nvim-ts-rainbow", after = "nvim-treesitter" },
	})
	use({
		"EdenEast/nightfox.nvim",
		config = function()
			require("nightfox").setup({
				options = {
					styles = {
						comments = "italic",
						keywords = "italic",
					},
				},
			})
			vim.cmd("colorscheme nordfox")
		end,
	})
	use({
		"nvim-lualine/lualine.nvim",
		event = "VimEnter",
		requires = { "kyazdani42/nvim-web-devicons", opt = true },
		config = function()
			require("lualine").setup({
				tabline = {
					lualine_a = { "buffers" },
					lualine_b = {},
					lualine_c = {},
					lualine_x = {},
					lualine_y = {},
					lualine_z = {},
				},
			})
		end,
	})
	-- LSP, completion
	use({
		{
			"williamboman/mason.nvim",
			event = "VimEnter",
			config = function()
				require("mason").setup()
			end,
		},
		{
			"williamboman/mason-lspconfig.nvim",
			config = function()
				require("mason-lspconfig").setup({
					ensure_installed = {
						-- 'gopls',
						"pyright",
						"sumneko_lua",
						-- 'terraformls',
						"tsserver",
					},
				})
			end,
			-- mason-lspconfig requires nvim-lspconfig, so we have to load it first
			after = "nvim-lspconfig",
		},
		{
			"neovim/nvim-lspconfig",
			event = "BufReadPre",
			config = function()
				require("plugins.lsp")
			end,
		},
		{
			"glepnir/lspsaga.nvim",
			branch = "main",
			config = function()
				require("lspsaga").init_lsp_saga({
					code_action_icon = "",
				})
			end,
			after = "nvim-lspconfig",
		},
	})
	use({
		"jose-elias-alvarez/null-ls.nvim",
		event = "BufRead",
		config = function()
			require("plugins.null-ls")
		end,
	})
	use({
		{
			"hrsh7th/nvim-cmp",
			event = "InsertEnter",
			config = function()
				require("plugins.cmp")
			end,
			requires = {
				{
					"L3MON4D3/LuaSnip",
					event = "InsertEnter",
					config = function()
						require("plugins.luasnip")
					end,
					requires = {
						{
							"rafamadriz/friendly-snippets",
							event = "InsertEnter",
						},
					},
				},
			},
		},
		{
			"zbirenbaum/copilot-cmp",
			event = "VimEnter",
			requires = {
				{
					"zbirenbaum/copilot.lua",
					event = "VimEnter",
					config = function()
						vim.defer_fn(function()
							require("copilot").setup()
						end, 100)
					end,
				},
			},
		},
		{ "tzachar/cmp-tabnine", after = "nvim-cmp", run = "./install.sh" },
		{ "saadparwaiz1/cmp_luasnip", after = "nvim-cmp" },
		{ "hrsh7th/cmp-path", after = "nvim-cmp" },
		{ "hrsh7th/cmp-buffer", after = "nvim-cmp" },
		{ "hrsh7th/cmp-nvim-lsp", after = "nvim-cmp" },
	})

	use({
		"github/copilot.vim",
		-- copilot.lua needs it for the authentication, at least for now
		cond = false,
		config = function()
			vim.g.copilot_filetypes = {
				markdown = true,
				yaml = true,
			}
		end,
	})
	-- utils
	use({<commit_msg>fix plugin loading order<commit_after>-- ensure packer.nvim is installed
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
	fn.system({ "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path })
	vim.cmd("packadd packer.nvim")
end

-- use plugins
require("packer").startup(function(use)
	-- packer itself
	use("wbthomason/packer.nvim")
	-- Load only when require
	use({ "nvim-lua/plenary.nvim", module = "plenary" })
	use({ "kyazdani42/nvim-web-devicons", module = "nvim-web-devicons" })
	-- UI
	use({
		{
			"nvim-treesitter/nvim-treesitter",
			event = "BufReadPre",
			run = ":TSUpdate",
			config = function()
				require("nvim-treesitter.configs").setup({
					ensure_installed = {
						"bash",
						"css",
						"go",
						"gomod",
						"hcl",
						"html",
						"json",
						"java",
						"javascript",
						"lua",
						"python",
						"typescript",
						"vim",
						"yaml",
					},
					highlight = {
						enable = true,
					},
					indent = {
						enable = false,
					},
					autotag = {
						enable = true,
					},
					rainbow = {
						enable = true,
						extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
						max_file_lines = nil, -- Do not enable for files with more than n lines, int
						-- colors = {}, -- table of hex strings
						-- termcolors = {} -- table of colour name strings
					},
				})
			end,
		},
		{ "windwp/nvim-ts-autotag", after = "nvim-treesitter" },
		{ "p00f/nvim-ts-rainbow", after = "nvim-treesitter" },
	})
	use({
		"EdenEast/nightfox.nvim",
		config = function()
			require("nightfox").setup({
				options = {
					styles = {
						comments = "italic",
						keywords = "italic",
					},
				},
			})
			vim.cmd("colorscheme nordfox")
		end,
	})
	use({
		"nvim-lualine/lualine.nvim",
		event = "VimEnter",
		requires = { "kyazdani42/nvim-web-devicons", opt = true },
		config = function()
			require("lualine").setup({
				tabline = {
					lualine_a = { "buffers" },
					lualine_b = {},
					lualine_c = {},
					lualine_x = {},
					lualine_y = {},
					lualine_z = {},
				},
			})
		end,
	})
	-- LSP, completion
	use({
		{
			"williamboman/mason.nvim",
			event = "VimEnter",
			config = function()
				require("mason").setup()
			end,
		},
		{
			"williamboman/mason-lspconfig.nvim",
			config = function()
				require("mason-lspconfig").setup({
					ensure_installed = {
						-- 'gopls',
						"pyright",
						"sumneko_lua",
						-- 'terraformls',
						"tsserver",
					},
				})
			end,
			-- mason-lspconfig requires nvim-lspconfig, so we have to load it first
			after = { "nvim-lspconfig", "mason.nvim" },
		},
		{
			"neovim/nvim-lspconfig",
			event = "BufReadPre",
			config = function()
				require("plugins.lsp")
			end,
			requires = {
				-- cmp-nvim-lsp is needed to update lsp client capabilities
				{ "hrsh7th/cmp-nvim-lsp", module = "cmp_nvim_lsp" },
			},
		},
		{
			"glepnir/lspsaga.nvim",
			branch = "main",
			config = function()
				require("lspsaga").init_lsp_saga({
					code_action_icon = "",
				})
			end,
			after = "nvim-lspconfig",
		},
	})
	use({
		"jose-elias-alvarez/null-ls.nvim",
		event = "BufRead",
		config = function()
			require("plugins.null-ls")
		end,
	})
	use({
		{
			"hrsh7th/nvim-cmp",
			event = "InsertEnter",
			config = function()
				require("plugins.cmp")
			end,
			requires = {
				{
					"L3MON4D3/LuaSnip",
					event = "InsertEnter",
					config = function()
						require("plugins.luasnip")
					end,
					requires = {
						{
							"rafamadriz/friendly-snippets",
							event = "InsertEnter",
						},
					},
				},
			},
		},
		{
			"zbirenbaum/copilot-cmp",
			event = "VimEnter",
			requires = {
				{
					"zbirenbaum/copilot.lua",
					event = "VimEnter",
					config = function()
						vim.defer_fn(function()
							require("copilot").setup()
						end, 100)
					end,
				},
			},
		},
		{ "tzachar/cmp-tabnine", after = "nvim-cmp", run = "./install.sh" },
		{ "saadparwaiz1/cmp_luasnip", after = "nvim-cmp" },
		{ "hrsh7th/cmp-path", after = "nvim-cmp" },
		{ "hrsh7th/cmp-buffer", after = "nvim-cmp" },
	})

	use({
		"github/copilot.vim",
		-- copilot.lua needs it for the authentication, at least for now
		cond = false,
		config = function()
			vim.g.copilot_filetypes = {
				markdown = true,
				yaml = true,
			}
		end,
	})
	-- utils
	use({
{'fraction_non_alphanumeric': 0.1747342230264646, 'fraction_numerical': 0.004297670210359647, 'mean_word_length': 2.3294427710843375, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '194045', 'n_tokens_mistral': 4409, 'n_tokens_neox': 3330, 'n_words': 600}