🔧 Major overhaul of nvim config
This commit is contained in:
parent
351ce052a7
commit
5e7afd99ec
38 changed files with 1091 additions and 87 deletions
|
|
@ -22,6 +22,7 @@ require("conform").setup({
|
|||
format_on_save = {
|
||||
-- These options will be passed to conform.format()
|
||||
timeout_ms = 500,
|
||||
async = false,
|
||||
lsp_format = "fallback",
|
||||
},
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,31 +0,0 @@
|
|||
require("dap-vscode-js").setup({
|
||||
adapaters = { "pwa-node", "pwa-chrome", "pwa-msedge", "node-terminal", "pwa-extensionHost" },
|
||||
})
|
||||
|
||||
local languages = { "typescript", "javascript" }
|
||||
for _, language in ipairs(languages) do
|
||||
require("dap").configurations[language] = {
|
||||
{
|
||||
type = "pwa-node",
|
||||
request = "launch",
|
||||
name = "Launch file",
|
||||
program = "${file}",
|
||||
cwd = "${workspaceFolder}",
|
||||
},
|
||||
{
|
||||
type = "pwa-node",
|
||||
request = "attach",
|
||||
name = "Attach",
|
||||
processId = require("dap.utils").pick_process,
|
||||
cwd = "${workspaceFolder}",
|
||||
},
|
||||
{
|
||||
type = "pwa-chrome",
|
||||
request = "launch",
|
||||
name = 'Start Chrome with "localhost"',
|
||||
url = "http://localhost:3000",
|
||||
webRoot = "${workspaceFolder}",
|
||||
userDataDir = "${workspaceFolder}/.vscode/vscode-chrome-debug-userdatadir",
|
||||
},
|
||||
}
|
||||
end
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
require("dapui").setup()
|
||||
|
||||
local dap, dapui = require("dap"), require("dapui")
|
||||
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||
dapui.open({})
|
||||
end
|
||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||
dapui.close({})
|
||||
end
|
||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||
dapui.close({})
|
||||
end
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
local lsp = require("lsp-zero")
|
||||
local lspconfig = require("lspconfig")
|
||||
local cmp = require("cmp")
|
||||
lsp.preset("recommended")
|
||||
require("mason").setup()
|
||||
|
||||
lsp.ensure_installed({
|
||||
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md
|
||||
local servers = {
|
||||
"bashls",
|
||||
"biome",
|
||||
"clangd",
|
||||
|
|
@ -12,14 +12,24 @@ lsp.ensure_installed({
|
|||
"dockerls",
|
||||
"emmet_ls",
|
||||
"eslint",
|
||||
"html",
|
||||
"gopls",
|
||||
"jqls",
|
||||
"lua_ls",
|
||||
"pyright",
|
||||
"quick_lint_js",
|
||||
"rust_analyzer",
|
||||
"stylelint_lsp",
|
||||
"svelte",
|
||||
"ts_ls",
|
||||
"volar",
|
||||
"zls",
|
||||
}
|
||||
|
||||
for _, server in ipairs(servers) do
|
||||
lspconfig[server].setup({})
|
||||
end
|
||||
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = servers,
|
||||
})
|
||||
|
||||
cmp.setup({
|
||||
|
|
@ -27,16 +37,22 @@ cmp.setup({
|
|||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
})
|
||||
|
||||
lsp.set_preferences({
|
||||
suggest_lsp_servers = false,
|
||||
sign_icons = {
|
||||
error = "E",
|
||||
warn = "W",
|
||||
hint = "H",
|
||||
info = "I",
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
{ name = "vsnip" },
|
||||
}),
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<Up>"] = cmp.mapping.select_prev_item(),
|
||||
["<Down>"] = cmp.mapping.select_next_item(),
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
}),
|
||||
})
|
||||
|
||||
-- function that is used with keybinding cm to toggle autocompletion
|
||||
|
|
@ -76,42 +92,34 @@ vim.diagnostic.config({
|
|||
vim.keymap.set("n", "<space>e", "<cmd>lua vim.diagnostic.open_float()<CR>")
|
||||
|
||||
-- LSP Specific Settings
|
||||
-- Volar TypeScript Config (turn off for Vue with Vanilla JS)
|
||||
require("mason-lspconfig").setup_handlers({
|
||||
function(server_name)
|
||||
local server_config = {}
|
||||
if server_name == "volar" then
|
||||
server_config.filetypes = { "vue", "ts_ls", "javascript" }
|
||||
lspconfig.volar.setup({
|
||||
settings = {
|
||||
["volar.takeOverMode.enabled"] = true,
|
||||
},
|
||||
})
|
||||
end
|
||||
lspconfig.rust_analyzer.setup({
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
procMacro = {
|
||||
ignored = {
|
||||
leptos_macro = {
|
||||
"server",
|
||||
},
|
||||
},
|
||||
},
|
||||
rustfmt = {
|
||||
overrideCommand = {
|
||||
"leptosfmt",
|
||||
"--stdin",
|
||||
"--rustfmt",
|
||||
},
|
||||
edition = { "2021" },
|
||||
},
|
||||
cargo = {
|
||||
allFeatures = true,
|
||||
},
|
||||
},
|
||||
-- require("mason-lspconfig").setup_handlers({}
|
||||
|
||||
-- Vue TypeScript Setup
|
||||
-- https://lsp-zero.netlify.app/blog/configure-volar-v2.html
|
||||
-- NOTE: Don't install volar through Mason, this is done manually:
|
||||
-- npm install -g @vue/language-server
|
||||
-- npm install -g @vue/typescript-plugin
|
||||
local vue_typescript_plugin = "/usr/lib/node_modules"
|
||||
.. "/usr/lib/node_modules/@vue/language-server"
|
||||
.. "/usr/lib/node_modules/@vue/typescript-plugin"
|
||||
|
||||
lspconfig.ts_ls.setup({
|
||||
init_options = {
|
||||
plugins = {
|
||||
{
|
||||
name = "@vue/typescript-plugin",
|
||||
location = vue_typescript_plugin,
|
||||
languages = { "javascript", "typescript", "vue" },
|
||||
},
|
||||
})
|
||||
lspconfig[server_name].setup(server_config)
|
||||
end,
|
||||
},
|
||||
},
|
||||
filetypes = {
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"javascript.jsx",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"typescript.tsx",
|
||||
"vue",
|
||||
},
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,32 +0,0 @@
|
|||
local null_ls = require("null-ls")
|
||||
|
||||
local group = vim.api.nvim_create_augroup("lsp_format_on_save", { clear = false })
|
||||
local event = "BufWritePre" -- or "BufWritePost"
|
||||
local async = event == "BufWritePost"
|
||||
|
||||
null_ls.setup({
|
||||
on_attach = function(client, bufnr)
|
||||
if client.supports_method("textDocument/formatting") then
|
||||
vim.keymap.set("n", "<Leader>f", function()
|
||||
vim.lsp.buf.format({ bufnr = vim.api.nvim_get_current_buf() })
|
||||
end, { buffer = bufnr, desc = "[lsp] format" })
|
||||
|
||||
-- format on save
|
||||
vim.api.nvim_clear_autocmds({ buffer = bufnr, group = group })
|
||||
vim.api.nvim_create_autocmd(event, {
|
||||
buffer = bufnr,
|
||||
group = group,
|
||||
callback = function()
|
||||
vim.lsp.buf.format({ bufnr = bufnr, async = async })
|
||||
end,
|
||||
desc = "[lsp] format on save",
|
||||
})
|
||||
end
|
||||
|
||||
if client.supports_method("textDocument/rangeFormatting") then
|
||||
vim.keymap.set("x", "<Leader>f", function()
|
||||
vim.lsp.buf.format({ bufnr = vim.api.nvim_get_current_buf() })
|
||||
end, { buffer = bufnr, desc = "[lsp] format" })
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
|
@ -1,5 +1,2 @@
|
|||
require("neovim")
|
||||
require("impatient")
|
||||
-- require("config.dap.javascript")
|
||||
-- very recent error: https://github.com/rcarriga/nvim-dap-ui/issues/233
|
||||
-- require("dapui").setup()
|
||||
vim.loader.enable()
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
local function configure_debuggers()
|
||||
require("config.dap.javascript").setup()
|
||||
end
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
local dap = require('dap')
|
||||
dap.adapters.node2 = {
|
||||
type = 'executable',
|
||||
command = 'node',
|
||||
args = {os.getenv('HOME') .. '/dev/microsoft/vscode-node-debug2/out/src/nodeDebug.js'},
|
||||
}
|
||||
dap.configurations.javascript = {
|
||||
{
|
||||
name = 'Launch',
|
||||
type = 'node2',
|
||||
request = 'launch',
|
||||
program = '${file}',
|
||||
cwd = vim.fn.getcwd(),
|
||||
sourceMaps = true,
|
||||
protocol = 'inspector',
|
||||
console = 'integratedTerminal',
|
||||
},
|
||||
{
|
||||
-- For this to work you need to make sure the node process is started with the `--inspect` flag.
|
||||
name = 'Attach to process',
|
||||
type = 'node2',
|
||||
request = 'attach',
|
||||
processId = require'dap.utils'.pick_process,
|
||||
},
|
||||
}
|
||||
|
|
@ -1,128 +0,0 @@
|
|||
-- This file can be loaded by calling `lua require('plugins')` from your init.vim
|
||||
|
||||
-- Only required if you have packer configured as `opt`
|
||||
vim.cmd([[packadd packer.nvim]])
|
||||
|
||||
return require("packer").startup(function(use)
|
||||
-- Packer can manage itself
|
||||
use("wbthomason/packer.nvim")
|
||||
use({ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" })
|
||||
use({ "nvim-treesitter/playground" })
|
||||
use({
|
||||
"shaunsingh/nord.nvim",
|
||||
config = function()
|
||||
vim.cmd("colorscheme nord")
|
||||
end,
|
||||
})
|
||||
use({ "preservim/nerdcommenter" })
|
||||
use({ "nvim-lualine/lualine.nvim", requires = { "kyazdani42/nvim-web-devicons", opt = true } })
|
||||
use({ "kyazdani42/nvim-web-devicons" })
|
||||
use({ "kyazdani42/nvim-tree.lua" })
|
||||
use({ "psliwka/vim-smoothie" })
|
||||
use({ "mg979/vim-visual-multi" })
|
||||
-- use({ "Yggdroot/indentLine" })
|
||||
use({ "lukas-reineke/indent-blankline.nvim" })
|
||||
use({ "lewis6991/impatient.nvim" })
|
||||
use({ "airblade/vim-gitgutter" })
|
||||
use({ "f-person/git-blame.nvim" })
|
||||
use({ "kkoomen/vim-doge", run = ":call doge#install()" })
|
||||
-- use({ "norcalli/nvim-colorizer.lua" })
|
||||
use({ "windwp/nvim-autopairs" })
|
||||
use({ "simeji/winresizer" })
|
||||
-- use({ "sbdchd/neoformat" })
|
||||
use({ "stevearc/conform.nvim" })
|
||||
use({ "rhysd/vim-clang-format" })
|
||||
use({ "sangdol/mintabline.vim" })
|
||||
use({ "ThePrimeagen/harpoon" })
|
||||
use({
|
||||
"nvim-telescope/telescope.nvim",
|
||||
tag = "0.1.0",
|
||||
-- or , branch = '0.1.x',
|
||||
requires = { { "nvim-lua/plenary.nvim" } },
|
||||
})
|
||||
use({ "tpope/vim-fugitive" })
|
||||
use({ "tpope/vim-surround" })
|
||||
use({ "lambdalisue/suda.vim" })
|
||||
use({
|
||||
"iamcco/markdown-preview.nvim",
|
||||
run = function()
|
||||
vim.fn["mkdp#util#install"]()
|
||||
end,
|
||||
})
|
||||
-- use({ "iamcco/markdown-preview.nvim", run = "cd app && npm install", setup = function() vim.g.mkdp_filetypes = { "markdown" } end, ft = { "markdown" }, })
|
||||
use({ "junegunn/fzf.vim" })
|
||||
use({ "junegunn/gv.vim" })
|
||||
use({ "kien/ctrlp.vim" })
|
||||
use({ "rinx/nvim-ripgrep" })
|
||||
use({ "mbbill/undotree" })
|
||||
use({
|
||||
"VonHeikemen/lsp-zero.nvim",
|
||||
requires = {
|
||||
-- LSP Support
|
||||
{ "neovim/nvim-lspconfig" },
|
||||
{ "williamboman/mason.nvim" },
|
||||
{ "williamboman/mason-lspconfig.nvim" },
|
||||
|
||||
-- Autocompletion
|
||||
{ "hrsh7th/nvim-cmp" },
|
||||
{ "hrsh7th/cmp-buffer" },
|
||||
{ "hrsh7th/cmp-path" },
|
||||
{ "saadparwaiz1/cmp_luasnip" },
|
||||
{ "hrsh7th/cmp-nvim-lsp" },
|
||||
{ "hrsh7th/cmp-nvim-lua" },
|
||||
|
||||
-- Snippets
|
||||
{ "L3MON4D3/LuaSnip" },
|
||||
{ "rafamadriz/friendly-snippets" },
|
||||
},
|
||||
})
|
||||
use("jose-elias-alvarez/null-ls.nvim")
|
||||
use({ "rcarriga/nvim-dap-ui", requires = { "mfussenegger/nvim-dap" } })
|
||||
use({
|
||||
"mfussenegger/nvim-dap",
|
||||
opt = true,
|
||||
module = { "dap" },
|
||||
requires = {
|
||||
"theHamsta/nvim-dap-virtual-text",
|
||||
"mfussenegger/nvim-dap-python",
|
||||
"nvim-telescope/telescope-dap.nvim",
|
||||
{ "leoluz/nvim-dap-go", module = "dap-go" },
|
||||
{ "jbyuki/one-small-step-for-vimkind", module = "osv" },
|
||||
{ "mxsdev/nvim-dap-vscode-js" },
|
||||
{
|
||||
"microsoft/vscode-js-debug",
|
||||
opt = true,
|
||||
-- NOTE: didn't compile on install for some reason,
|
||||
-- navigate to ~/.local/share/nvim/site/pack/packer/opt/vscode-js-debug
|
||||
-- and npm run compile by hand...
|
||||
run = "npm install --legacy-peer-deps && npm run compile",
|
||||
},
|
||||
},
|
||||
})
|
||||
-- codeium AI
|
||||
use("Exafunction/codeium.vim")
|
||||
-- golang
|
||||
use("ray-x/go.nvim")
|
||||
use("ray-x/guihua.lua")
|
||||
-- rustlang
|
||||
use("rust-lang/rust.vim")
|
||||
-- use("mrcjkb/rustaceanvim")
|
||||
use("saecki/crates.nvim")
|
||||
-- code snippet screenshots
|
||||
-- capture code snippets using :Silicon,
|
||||
-- in Visual mode highlight then enter command
|
||||
use({
|
||||
"michaelrommel/nvim-silicon",
|
||||
config = function()
|
||||
require("silicon").setup({
|
||||
command = "silicon",
|
||||
font = "mononoki NF=34",
|
||||
theme = "Nord",
|
||||
no_round_corner = true,
|
||||
no_line_number = true,
|
||||
no_window_controls = true,
|
||||
background = "#20201e",
|
||||
})
|
||||
end,
|
||||
})
|
||||
end)
|
||||
89
.config/nvim/lua/neovim/pacq.lua
Normal file
89
.config/nvim/lua/neovim/pacq.lua
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
-- https://github.com/savq/paq-nvim
|
||||
require("paq")({
|
||||
{ "savq/paq-nvim" }, -- Let Paq manage itself
|
||||
|
||||
{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
|
||||
{ "nvim-treesitter/playground" },
|
||||
{
|
||||
"shaunsingh/nord.nvim",
|
||||
config = function()
|
||||
vim.cmd("colorscheme nord")
|
||||
end,
|
||||
},
|
||||
{ "preservim/nerdcommenter" },
|
||||
{ "nvim-lualine/lualine.nvim" },
|
||||
{ "kyazdani42/nvim-web-devicons", opt = true },
|
||||
{ "kyazdani42/nvim-web-devicons" },
|
||||
{ "kyazdani42/nvim-tree.lua" },
|
||||
{ "psliwka/vim-smoothie" },
|
||||
{ "mg979/vim-visual-multi" },
|
||||
{ "lukas-reineke/indent-blankline.nvim" },
|
||||
{ "airblade/vim-gitgutter" },
|
||||
{ "f-person/git-blame.nvim" },
|
||||
{ "kkoomen/vim-doge", build = ":call doge#install()" },
|
||||
{ "norcalli/nvim-colorizer.lua" },
|
||||
{ "windwp/nvim-autopairs" },
|
||||
{ "simeji/winresizer" },
|
||||
{ "stevearc/conform.nvim" },
|
||||
{ "rhysd/vim-clang-format" },
|
||||
{ "sangdol/mintabline.vim" },
|
||||
{ "nvim-lua/plenary.nvim" },
|
||||
{ "ThePrimeagen/harpoon" },
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
tag = "0.1.0",
|
||||
},
|
||||
{ "tpope/vim-fugitive" },
|
||||
{ "tpope/vim-surround" },
|
||||
{ "lambdalisue/suda.vim" },
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
build = function()
|
||||
vim.fn["mkdp#util#install"]()
|
||||
end,
|
||||
},
|
||||
{ "junegunn/fzf.vim" },
|
||||
{ "junegunn/gv.vim" },
|
||||
{ "kien/ctrlp.vim" },
|
||||
{ "rinx/nvim-ripgrep" },
|
||||
{ "mbbill/undotree" },
|
||||
{ "williamboman/mason.nvim" },
|
||||
{ "williamboman/mason-lspconfig.nvim" },
|
||||
{ "neovim/nvim-lspconfig" },
|
||||
|
||||
-- Autocompletion/Snippets
|
||||
{ "hrsh7th/nvim-cmp" },
|
||||
{ "hrsh7th/cmp-buffer" },
|
||||
{ "hrsh7th/cmp-path" },
|
||||
{ "hrsh7th/cmp-nvim-lsp" },
|
||||
{ "hrsh7th/cmp-nvim-lua" },
|
||||
{ "saadparwaiz1/cmp_luasnip" },
|
||||
{ "hrsh7th/cmp-vsnip" },
|
||||
|
||||
{ "VonHeikemen/lsp-zero.nvim" },
|
||||
-- codeium AI
|
||||
{ "Exafunction/codeium.vim" },
|
||||
-- golang
|
||||
{ "ray-x/go.nvim" },
|
||||
{ "ray-x/guihua.lua" },
|
||||
-- rustlang
|
||||
{ "rust-lang/rust.vim" },
|
||||
{ "saecki/crates.nvim" },
|
||||
-- code snippet screenshots
|
||||
-- capture code snippets using :Silicon,
|
||||
-- in Visual mode highlight then enter command
|
||||
{
|
||||
"michaelrommel/nvim-silicon",
|
||||
config = function()
|
||||
require("silicon").setup({
|
||||
command = "silicon",
|
||||
font = "mononoki NF=34",
|
||||
theme = "Nord",
|
||||
no_round_corner = true,
|
||||
no_line_number = true,
|
||||
no_window_controls = true,
|
||||
background = "#20201e",
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
|
@ -51,7 +51,7 @@ vim.keymap.set("n", "<C-l>", "<c-w>:wincmd l<CR>", {})
|
|||
vim.keymap.set("n", "nv", ":vnew", { silent = true })
|
||||
|
||||
-- shift + p invokes PackerSync
|
||||
vim.keymap.set("n", "<S-p>", "<c-w>:PackerSync<CR>", {})
|
||||
vim.keymap.set("n", "<S-p>", "<c-w>:PaqSync<CR>", {})
|
||||
|
||||
-- control + t enable transparency
|
||||
vim.keymap.set("n", "<leader>t", "<c-w>:lua ColorMyPencils()<CR>", {})
|
||||
|
|
@ -141,13 +141,13 @@ vim.keymap.set("n", "gD", function()
|
|||
end, bufopts)
|
||||
|
||||
-- dap Keybindings
|
||||
vim.keymap.set("n", "<leader>dbp", ":lua require'dap'.toggle_breakpoint()")
|
||||
vim.keymap.set("n", "<leader>dco", ":lua require'dap'.continue()")
|
||||
vim.keymap.set("n", "<leader>dov", ":lua require'dap'.step_over()")
|
||||
vim.keymap.set("n", "<leader>dso", ":lua require'dap'.step_out()")
|
||||
vim.keymap.set("n", "<leader>dsi", ":lua require'dap'.step_into()")
|
||||
vim.keymap.set("n", "<leader>dcl", ":lua require'dap'.close()")
|
||||
vim.keymap.set("n", "<leader>dui", ":lua require('dapui').toggle()")
|
||||
-- vim.keymap.set("n", "<leader>dbp", ":lua require'dap'.toggle_breakpoint()")
|
||||
-- vim.keymap.set("n", "<leader>dco", ":lua require'dap'.continue()")
|
||||
-- vim.keymap.set("n", "<leader>dov", ":lua require'dap'.step_over()")
|
||||
-- vim.keymap.set("n", "<leader>dso", ":lua require'dap'.step_out()")
|
||||
-- vim.keymap.set("n", "<leader>dsi", ":lua require'dap'.step_into()")
|
||||
-- vim.keymap.set("n", "<leader>dcl", ":lua require'dap'.close()")
|
||||
-- vim.keymap.set("n", "<leader>dui", ":lua require('dapui').toggle()")
|
||||
--
|
||||
-- codeium remappings
|
||||
vim.keymap.set("i", "<A-tab>", function()
|
||||
|
|
|
|||
|
|
@ -146,5 +146,5 @@ augroup END
|
|||
|
||||
-- codeium disable default keybindings
|
||||
vim.g.codeium_disable_bindings = 1
|
||||
-- codeium disable by default
|
||||
-- codeium enable(1)/disable(0) by default
|
||||
vim.g.codeium_enabled = 0
|
||||
|
|
|
|||
|
|
@ -1,309 +0,0 @@
|
|||
-- Automatically generated packer.nvim plugin loader code
|
||||
|
||||
if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then
|
||||
vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"')
|
||||
return
|
||||
end
|
||||
|
||||
vim.api.nvim_command('packadd packer.nvim')
|
||||
|
||||
local no_errors, error_msg = pcall(function()
|
||||
|
||||
_G._packer = _G._packer or {}
|
||||
_G._packer.inside_compile = true
|
||||
|
||||
local time
|
||||
local profile_info
|
||||
local should_profile = false
|
||||
if should_profile then
|
||||
local hrtime = vim.loop.hrtime
|
||||
profile_info = {}
|
||||
time = function(chunk, start)
|
||||
if start then
|
||||
profile_info[chunk] = hrtime()
|
||||
else
|
||||
profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6
|
||||
end
|
||||
end
|
||||
else
|
||||
time = function(chunk, start) end
|
||||
end
|
||||
|
||||
local function save_profiles(threshold)
|
||||
local sorted_times = {}
|
||||
for chunk_name, time_taken in pairs(profile_info) do
|
||||
sorted_times[#sorted_times + 1] = {chunk_name, time_taken}
|
||||
end
|
||||
table.sort(sorted_times, function(a, b) return a[2] > b[2] end)
|
||||
local results = {}
|
||||
for i, elem in ipairs(sorted_times) do
|
||||
if not threshold or threshold and elem[2] > threshold then
|
||||
results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms'
|
||||
end
|
||||
end
|
||||
if threshold then
|
||||
table.insert(results, '(Only showing plugins that took longer than ' .. threshold .. ' ms ' .. 'to load)')
|
||||
end
|
||||
|
||||
_G._packer.profile_output = results
|
||||
end
|
||||
|
||||
time([[Luarocks path setup]], true)
|
||||
local package_path_str = "/home/brian/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/brian/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/brian/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/brian/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua"
|
||||
local install_cpath_pattern = "/home/brian/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so"
|
||||
if not string.find(package.path, package_path_str, 1, true) then
|
||||
package.path = package.path .. ';' .. package_path_str
|
||||
end
|
||||
|
||||
if not string.find(package.cpath, install_cpath_pattern, 1, true) then
|
||||
package.cpath = package.cpath .. ';' .. install_cpath_pattern
|
||||
end
|
||||
|
||||
time([[Luarocks path setup]], false)
|
||||
time([[try_loadstring definition]], true)
|
||||
local function try_loadstring(s, component, name)
|
||||
local success, result = pcall(loadstring(s), name, _G.packer_plugins[name])
|
||||
if not success then
|
||||
vim.schedule(function()
|
||||
vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {})
|
||||
end)
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
time([[try_loadstring definition]], false)
|
||||
time([[Defining packer_plugins]], true)
|
||||
_G.packer_plugins = {
|
||||
LuaSnip = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/LuaSnip",
|
||||
url = "https://github.com/L3MON4D3/LuaSnip"
|
||||
},
|
||||
["cmp-buffer"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/cmp-buffer",
|
||||
url = "https://github.com/hrsh7th/cmp-buffer"
|
||||
},
|
||||
["cmp-nvim-lsp"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp",
|
||||
url = "https://github.com/hrsh7th/cmp-nvim-lsp"
|
||||
},
|
||||
["cmp-nvim-lua"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/cmp-nvim-lua",
|
||||
url = "https://github.com/hrsh7th/cmp-nvim-lua"
|
||||
},
|
||||
["cmp-path"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/cmp-path",
|
||||
url = "https://github.com/hrsh7th/cmp-path"
|
||||
},
|
||||
cmp_luasnip = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/cmp_luasnip",
|
||||
url = "https://github.com/saadparwaiz1/cmp_luasnip"
|
||||
},
|
||||
["emmet-vim"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/emmet-vim",
|
||||
url = "https://github.com/mattn/emmet-vim"
|
||||
},
|
||||
["friendly-snippets"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/friendly-snippets",
|
||||
url = "https://github.com/rafamadriz/friendly-snippets"
|
||||
},
|
||||
["fzf.vim"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/fzf.vim",
|
||||
url = "https://github.com/junegunn/fzf.vim"
|
||||
},
|
||||
["git-blame.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/git-blame.nvim",
|
||||
url = "https://github.com/f-person/git-blame.nvim"
|
||||
},
|
||||
harpoon = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/harpoon",
|
||||
url = "https://github.com/ThePrimeagen/harpoon"
|
||||
},
|
||||
indentLine = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/indentLine",
|
||||
url = "https://github.com/Yggdroot/indentLine"
|
||||
},
|
||||
["lsp-zero.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/lsp-zero.nvim",
|
||||
url = "https://github.com/VonHeikemen/lsp-zero.nvim"
|
||||
},
|
||||
["lualine.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/lualine.nvim",
|
||||
url = "https://github.com/nvim-lualine/lualine.nvim"
|
||||
},
|
||||
["markdown-preview.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/markdown-preview.nvim",
|
||||
url = "https://github.com/iamcco/markdown-preview.nvim"
|
||||
},
|
||||
["mason-lspconfig.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/mason-lspconfig.nvim",
|
||||
url = "https://github.com/williamboman/mason-lspconfig.nvim"
|
||||
},
|
||||
["mason.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/mason.nvim",
|
||||
url = "https://github.com/williamboman/mason.nvim"
|
||||
},
|
||||
["mintabline.vim"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/mintabline.vim",
|
||||
url = "https://github.com/sangdol/mintabline.vim"
|
||||
},
|
||||
neoformat = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/neoformat",
|
||||
url = "https://github.com/sbdchd/neoformat"
|
||||
},
|
||||
nerdcommenter = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/nerdcommenter",
|
||||
url = "https://github.com/preservim/nerdcommenter"
|
||||
},
|
||||
["nord.nvim"] = {
|
||||
config = { "\27LJ\2\n4\0\0\3\0\3\0\0056\0\0\0009\0\1\0'\2\2\0B\0\2\1K\0\1\0\21colorscheme nord\bcmd\bvim\0" },
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/nord.nvim",
|
||||
url = "https://github.com/shaunsingh/nord.nvim"
|
||||
},
|
||||
["nvim-autopairs"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/nvim-autopairs",
|
||||
url = "https://github.com/windwp/nvim-autopairs"
|
||||
},
|
||||
["nvim-cmp"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/nvim-cmp",
|
||||
url = "https://github.com/hrsh7th/nvim-cmp"
|
||||
},
|
||||
["nvim-colorizer.lua"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/nvim-colorizer.lua",
|
||||
url = "https://github.com/norcalli/nvim-colorizer.lua"
|
||||
},
|
||||
["nvim-lastplace"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/nvim-lastplace",
|
||||
url = "https://github.com/ethanholz/nvim-lastplace"
|
||||
},
|
||||
["nvim-lspconfig"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
|
||||
url = "https://github.com/neovim/nvim-lspconfig"
|
||||
},
|
||||
["nvim-ripgrep"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/nvim-ripgrep",
|
||||
url = "https://github.com/rinx/nvim-ripgrep"
|
||||
},
|
||||
["nvim-tree.lua"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/nvim-tree.lua",
|
||||
url = "https://github.com/kyazdani42/nvim-tree.lua"
|
||||
},
|
||||
["nvim-treesitter"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
|
||||
url = "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||
},
|
||||
["nvim-web-devicons"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/nvim-web-devicons",
|
||||
url = "https://github.com/kyazdani42/nvim-web-devicons"
|
||||
},
|
||||
["packer.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/packer.nvim",
|
||||
url = "https://github.com/wbthomason/packer.nvim"
|
||||
},
|
||||
playground = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/playground",
|
||||
url = "https://github.com/nvim-treesitter/playground"
|
||||
},
|
||||
["plenary.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/plenary.nvim",
|
||||
url = "https://github.com/nvim-lua/plenary.nvim"
|
||||
},
|
||||
rainbow = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/rainbow",
|
||||
url = "https://github.com/luochen1990/rainbow"
|
||||
},
|
||||
["telescope.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/telescope.nvim",
|
||||
url = "https://github.com/nvim-telescope/telescope.nvim"
|
||||
},
|
||||
undotree = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/undotree",
|
||||
url = "https://github.com/mbbill/undotree"
|
||||
},
|
||||
["vim-clang-format"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/vim-clang-format",
|
||||
url = "https://github.com/rhysd/vim-clang-format"
|
||||
},
|
||||
["vim-fugitive"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/vim-fugitive",
|
||||
url = "https://github.com/tpope/vim-fugitive"
|
||||
},
|
||||
["vim-gitgutter"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/vim-gitgutter",
|
||||
url = "https://github.com/airblade/vim-gitgutter"
|
||||
},
|
||||
["vim-smoothie"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/vim-smoothie",
|
||||
url = "https://github.com/psliwka/vim-smoothie"
|
||||
},
|
||||
["vim-visual-multi"] = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/vim-visual-multi",
|
||||
url = "https://github.com/mg979/vim-visual-multi"
|
||||
},
|
||||
winresizer = {
|
||||
loaded = true,
|
||||
path = "/home/brian/.local/share/nvim/site/pack/packer/start/winresizer",
|
||||
url = "https://github.com/simeji/winresizer"
|
||||
}
|
||||
}
|
||||
|
||||
time([[Defining packer_plugins]], false)
|
||||
-- Config for: nord.nvim
|
||||
time([[Config for nord.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n4\0\0\3\0\3\0\0056\0\0\0009\0\1\0'\2\2\0B\0\2\1K\0\1\0\21colorscheme nord\bcmd\bvim\0", "config", "nord.nvim")
|
||||
time([[Config for nord.nvim]], false)
|
||||
|
||||
_G._packer.inside_compile = false
|
||||
if _G._packer.needs_bufread == true then
|
||||
vim.cmd("doautocmd BufRead")
|
||||
end
|
||||
_G._packer.needs_bufread = false
|
||||
|
||||
if should_profile then save_profiles() end
|
||||
|
||||
end)
|
||||
|
||||
if not no_errors then
|
||||
error_msg = error_msg:gsub('"', '\\"')
|
||||
vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None')
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue