From 393c9eaa8aeadedd64af3478c637d77e976523d7 Mon Sep 17 00:00:00 2001 From: z3rOR0ne Date: Sun, 18 Dec 2022 18:17:43 -0800 Subject: [PATCH] :sparkles: New neovim config based off theprimeagen --- .config/nvim/after/plugin/autopairs.lua | 1 + .config/nvim/after/plugin/colorizer.lua | 1 + .config/nvim/after/plugin/colors.lua | 9 + .config/nvim/after/plugin/lsp.lua | 104 +++++++ .config/nvim/after/plugin/lualine.lua | 3 + .config/nvim/after/plugin/mardownpreview.lua | 2 + .config/nvim/after/plugin/multicursor.lua | 1 + .config/nvim/after/plugin/nerdcommenter.lua | 6 + .config/nvim/after/plugin/nvimtree.lua | 117 ++++++++ .config/nvim/after/plugin/rainbow.lua | 1 + .config/nvim/after/plugin/ripgrep.lua | 12 + .config/nvim/after/plugin/treesitter.lua | 22 ++ .config/nvim/after/plugin/vimsmoothie.lua | 2 + .config/nvim/init.lua | 1 + .config/nvim/lua/neovim/init.lua | 2 + .config/nvim/lua/neovim/packer.lua | 63 +++++ .config/nvim/lua/neovim/remap.lua | 94 +++++++ .config/nvim/lua/neovim/set.lua | 90 ++++++ .config/nvim/plugin/packer_compiled.lua | 279 +++++++++++++++++++ 19 files changed, 810 insertions(+) create mode 100644 .config/nvim/after/plugin/autopairs.lua create mode 100644 .config/nvim/after/plugin/colorizer.lua create mode 100644 .config/nvim/after/plugin/colors.lua create mode 100644 .config/nvim/after/plugin/lsp.lua create mode 100644 .config/nvim/after/plugin/lualine.lua create mode 100644 .config/nvim/after/plugin/mardownpreview.lua create mode 100644 .config/nvim/after/plugin/multicursor.lua create mode 100644 .config/nvim/after/plugin/nerdcommenter.lua create mode 100644 .config/nvim/after/plugin/nvimtree.lua create mode 100644 .config/nvim/after/plugin/rainbow.lua create mode 100644 .config/nvim/after/plugin/ripgrep.lua create mode 100644 .config/nvim/after/plugin/treesitter.lua create mode 100644 .config/nvim/after/plugin/vimsmoothie.lua create mode 100644 .config/nvim/init.lua create mode 100644 .config/nvim/lua/neovim/init.lua create mode 100644 .config/nvim/lua/neovim/packer.lua create mode 100755 .config/nvim/lua/neovim/remap.lua create mode 100644 .config/nvim/lua/neovim/set.lua create mode 100644 .config/nvim/plugin/packer_compiled.lua diff --git a/.config/nvim/after/plugin/autopairs.lua b/.config/nvim/after/plugin/autopairs.lua new file mode 100644 index 00000000..0f775736 --- /dev/null +++ b/.config/nvim/after/plugin/autopairs.lua @@ -0,0 +1 @@ +require('nvim-autopairs').setup() diff --git a/.config/nvim/after/plugin/colorizer.lua b/.config/nvim/after/plugin/colorizer.lua new file mode 100644 index 00000000..c7f7af87 --- /dev/null +++ b/.config/nvim/after/plugin/colorizer.lua @@ -0,0 +1 @@ +require'colorizer'.setup() diff --git a/.config/nvim/after/plugin/colors.lua b/.config/nvim/after/plugin/colors.lua new file mode 100644 index 00000000..1bb417f8 --- /dev/null +++ b/.config/nvim/after/plugin/colors.lua @@ -0,0 +1,9 @@ +function ColorMyPencils(color) + color = color or "nord" + vim.cmd.colorscheme(color) + + vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) + vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) +end + +ColorMyPencils() diff --git a/.config/nvim/after/plugin/lsp.lua b/.config/nvim/after/plugin/lsp.lua new file mode 100644 index 00000000..1227fb78 --- /dev/null +++ b/.config/nvim/after/plugin/lsp.lua @@ -0,0 +1,104 @@ +local lsp = require("lsp-zero") + +lsp.preset("recommended") + +lsp.ensure_installed({ +'tsserver', +'eslint', +'sumneko_lua', +'rust_analyzer', +}) + +-- Fix Undefined global 'vim' +lsp.configure('sumneko_lua', { +settings = { +Lua = { + diagnostics = { + globals = { 'vim' } + } +} +} +}) + + +local cmp = require('cmp') + +cmp.setup({ + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + } +}) + +local cmp_select = {behavior = cmp.SelectBehavior.Select} +local cmp_mappings = lsp.defaults.cmp_mappings({ +[''] = cmp.mapping.select_prev_item(cmp_select), +[''] = cmp.mapping.select_next_item(cmp_select), +[''] = cmp.mapping.confirm({ select = true }), +[""] = cmp.mapping.complete(), +}) + +-- disable completion with tab +-- this helps with copilot setup +cmp_mappings[''] = nil +cmp_mappings[''] = nil + +lsp.setup_nvim_cmp({ +mapping = cmp_mappings +}) + +lsp.set_preferences({ +suggest_lsp_servers = false, +sign_icons = { + error = 'E', + warn = 'W', + hint = 'H', + info = 'I' +} +}) + +lsp.on_attach(function(client, bufnr) +local opts = {buffer = bufnr, remap = false} + +if client.name == "eslint" then + vim.cmd.LspStop('eslint') + return +end + +vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) +vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) +vim.keymap.set("n", "vws", vim.lsp.buf.workspace_symbol, opts) +vim.keymap.set("n", "vd", vim.diagnostic.open_float, opts) +vim.keymap.set("n", "[d", vim.diagnostic.goto_next, opts) +vim.keymap.set("n", "]d", vim.diagnostic.goto_prev, opts) +vim.keymap.set("n", "vca", vim.lsp.buf.code_action, opts) +vim.keymap.set("n", "vrr", vim.lsp.buf.references, opts) +vim.keymap.set("n", "vrn", vim.lsp.buf.rename, opts) + vim.keymap.set("i", "", vim.lsp.buf.signature_help, opts) +end) + +-- function that is used with keybinding cm to toggle autocompletion +Mode = require('cmp.types').cmp.TriggerEvent.TextChanged +function SetAutoCmp(mode) + if mode then + cmp.setup({ + completion = { + autocomplete = { Mode } + } + }) + Mode = false + else + cmp.setup({ + completion = { + autocomplete = Mode + } + }) + Mode = require('cmp.types').cmp.TriggerEvent.TextChanged + end +end +SetAutoCmp(Mode) +lsp.setup() + +vim.diagnostic.config({ + virtual_text = true, +}) diff --git a/.config/nvim/after/plugin/lualine.lua b/.config/nvim/after/plugin/lualine.lua new file mode 100644 index 00000000..a7b34d9b --- /dev/null +++ b/.config/nvim/after/plugin/lualine.lua @@ -0,0 +1,3 @@ +require('lualine').setup({ + options = { them = 'nord' } +}) diff --git a/.config/nvim/after/plugin/mardownpreview.lua b/.config/nvim/after/plugin/mardownpreview.lua new file mode 100644 index 00000000..f1cbad1b --- /dev/null +++ b/.config/nvim/after/plugin/mardownpreview.lua @@ -0,0 +1,2 @@ +vim.g.mkdp_browser = 'librewolf' +vim.g.mkdp_theme = 'dark' diff --git a/.config/nvim/after/plugin/multicursor.lua b/.config/nvim/after/plugin/multicursor.lua new file mode 100644 index 00000000..162339af --- /dev/null +++ b/.config/nvim/after/plugin/multicursor.lua @@ -0,0 +1 @@ +vim.opt.cursorcolumn = true diff --git a/.config/nvim/after/plugin/nerdcommenter.lua b/.config/nvim/after/plugin/nerdcommenter.lua new file mode 100644 index 00000000..12bcba65 --- /dev/null +++ b/.config/nvim/after/plugin/nerdcommenter.lua @@ -0,0 +1,6 @@ +-- Create Default Mappings for NerdCommenter +vim.g.NERDCreateDefaultMappings = 1 +-- Add spaces after NerdCommenter delimiters by default +vim.g.NERDSpaceDelims = 1 +-- Enable Comments with Italics +-- vim.cmd[[highlight Comment cterm=italic gui=italic]] diff --git a/.config/nvim/after/plugin/nvimtree.lua b/.config/nvim/after/plugin/nvimtree.lua new file mode 100644 index 00000000..d25e3d74 --- /dev/null +++ b/.config/nvim/after/plugin/nvimtree.lua @@ -0,0 +1,117 @@ +-- Nvim_Tree configuration: -- setup with all defaults +-- each of these are documented in `:help nvim-tree.OPTION_NAME` +require'nvim-tree'.setup { -- BEGIN_DEFAULT_OPTS + auto_reload_on_write = true, + disable_netrw = false, + -- hide_root_folder = false, + hijack_cursor = false, + hijack_netrw = true, + hijack_unnamed_buffer_when_opening = false, + ignore_buffer_on_setup = false, + open_on_setup = false, + open_on_setup_file = false, + open_on_tab = false, + sort_by = "name", + update_cwd = false, + view = { + width = 25, + -- height = 30, + side = "right", + preserve_window_proportions = true, + number = false, + relativenumber = false, + signcolumn = "yes", + mappings = { + custom_only = false, + list = { + -- user mappings go here + }, + }, + }, + renderer = { + indent_markers = { + enable = false, + icons = { + corner = "└ ", + edge = "│ ", + none = " ", + }, + }, + icons = { + webdev_colors = true, + }, + }, + hijack_directories = { + enable = true, + auto_open = true, + }, + update_focused_file = { + enable = false, + update_cwd = false, + ignore_list = {}, + }, + ignore_ft_on_setup = {}, + system_open = { + cmd = nil, + args = {}, + }, + diagnostics = { + enable = false, + show_on_dirs = false, + icons = { + hint = "", + info = "", + warning = "", + error = "", + }, + }, + filters = { + dotfiles = false, + custom = {}, + exclude = {}, + }, + git = { + enable = true, + ignore = true, + timeout = 400, + }, + actions = { + use_system_clipboard = true, + change_dir = { + enable = true, + global = false, + restrict_above_cwd = false, + }, + open_file = { + quit_on_open = false, + resize_window = false, + window_picker = { + enable = true, + chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890", + exclude = { + filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" }, + buftype = { "nofile", "terminal", "help" }, + }, + }, + }, + }, + trash = { + cmd = "trash", + require_confirm = true, + }, + log = { + enable = false, + truncate = false, + types = { + all = false, + config = false, + copy_paste = false, + diagnostics = false, + git = false, + profile = false, + }, + }, +} -- END_DEFAULT_OPTS for Nvim_Tree + + -- Automatically closes Nvim tree if last window open +vim.cmd[[autocmd BufEnter * ++nested if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif]] diff --git a/.config/nvim/after/plugin/rainbow.lua b/.config/nvim/after/plugin/rainbow.lua new file mode 100644 index 00000000..3a0549cf --- /dev/null +++ b/.config/nvim/after/plugin/rainbow.lua @@ -0,0 +1 @@ +vim.g.rainbow_active = 1 diff --git a/.config/nvim/after/plugin/ripgrep.lua b/.config/nvim/after/plugin/ripgrep.lua new file mode 100644 index 00000000..33b9df57 --- /dev/null +++ b/.config/nvim/after/plugin/ripgrep.lua @@ -0,0 +1,12 @@ +-- Enable use of ripgrep +require('nvim-ripgrep').setup{ + runner = require('nvim-ripgrep.run').ripgrep, -- grep command + prompt = "❯ ", -- prompt + window = { + width = 0.8, + border = "rounded", + }; + open_qf_fn = function() + return vim.api.nvim_command('copen') + end, +} diff --git a/.config/nvim/after/plugin/treesitter.lua b/.config/nvim/after/plugin/treesitter.lua new file mode 100644 index 00000000..e0cc51f2 --- /dev/null +++ b/.config/nvim/after/plugin/treesitter.lua @@ -0,0 +1,22 @@ +require'nvim-treesitter.configs'.setup { + -- A list of parser names, or "all" + ensure_installed = {"bash", "c", "c_sharp", "cmake", "cpp", "css", "dockerfile", "go", "html", "http", "java", "javascript", "json", "json5", "jsonc", "lua", "make", "perl", "php", "pug", "python", "regex", "ruby", "toml", "tsx", "typescript", "rust", "vim", "vue", "wgsl", "yaml",}, + + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, + + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = true, + + highlight = { + -- `false` will disable the whole extension + enable = true, + + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = false, + }, +} diff --git a/.config/nvim/after/plugin/vimsmoothie.lua b/.config/nvim/after/plugin/vimsmoothie.lua new file mode 100644 index 00000000..23b06127 --- /dev/null +++ b/.config/nvim/after/plugin/vimsmoothie.lua @@ -0,0 +1,2 @@ +-- Use experimental features of vim-smoothie (gg and G) +vim.g.smoothie_experimental_mappings = 1 diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 00000000..f2d81ab2 --- /dev/null +++ b/.config/nvim/init.lua @@ -0,0 +1 @@ +require('neovim') diff --git a/.config/nvim/lua/neovim/init.lua b/.config/nvim/lua/neovim/init.lua new file mode 100644 index 00000000..af867b76 --- /dev/null +++ b/.config/nvim/lua/neovim/init.lua @@ -0,0 +1,2 @@ +require("neovim.remap") +require("neovim.set") diff --git a/.config/nvim/lua/neovim/packer.lua b/.config/nvim/lua/neovim/packer.lua new file mode 100644 index 00000000..d388058b --- /dev/null +++ b/.config/nvim/lua/neovim/packer.lua @@ -0,0 +1,63 @@ +-- 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 {'airblade/vim-gitgutter'} +use {'f-person/git-blame.nvim'} +use {'mattn/emmet-vim'} +use {'norcalli/nvim-colorizer.lua'} +use {'luochen1990/rainbow'} +use {'windwp/nvim-autopairs'} +use {'simeji/winresizer'} +use {'sbdchd/neoformat'} +use {'rhysd/vim-clang-format'} +use {'sangdol/mintabline.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 'rinx/nvim-ripgrep' + + 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'}, + } +} +end) diff --git a/.config/nvim/lua/neovim/remap.lua b/.config/nvim/lua/neovim/remap.lua new file mode 100755 index 00000000..a42848bd --- /dev/null +++ b/.config/nvim/lua/neovim/remap.lua @@ -0,0 +1,94 @@ +vim.g.mapleader = " " +vim.keymap.set("n", "pv", vim.cmd.Ex) + +vim.keymap.set("n", "J", "mzJ`z") + +-- remap for vim-smoothie +vim.cmd [[nnoremap call smoothie#do("\zz")]] +vim.cmd [[nnoremap call smoothie#do("\zz")]] +vim.cmd [[nnoremap gg call smoothie#do("\")]] +vim.cmd [[nnoremap call smoothie#do("\zz")]] + +-- recenter on next/previous search +vim.keymap.set("n", "n", "nzzzv") +vim.keymap.set("n", "N", "Nzzzv") + +--Toggle NERDCommenter with Ctrl + c +vim.keymap.set("n", "", "NERDCommenterToggle") + +vim.keymap.set("n", "Q", "") +-- reformats +vim.keymap.set("n", "f", vim.lsp.buf.format) + +-- global search and replace +vim.keymap.set("n", "", ":%s///gI") +vim.keymap.set("n", "", ":.,.s///g") + +-- toggle english spellcheck +vim.keymap.set("n", "", ":set spell!", { silent = true }) + +-- make current file executable +vim.keymap.set("n", "x", "!chmod +x %", { silent = true }) + +-- Vimium Like Keybindings +vim.keymap.set('n', 't', ':tabnew', {}) + +vim.keymap.set('n', '', ':tabprevious', {}) +vim.keymap.set('n', '', ':tabprevious', {}) +vim.keymap.set('n', '', ':tabprevious', {}) + +vim.keymap.set('n', '', ':tabnext', {}) +vim.keymap.set('n', '', ':tabnext', {}) +vim.keymap.set('n', '', ':tabnext', {}) + +-- Use ctrl- [hl] to select the active split! +vim.keymap.set('n', '', ':wincmd h', {}) +vim.keymap.set('n', '', ':wincmd l', {}) + +-- remap Nvim_Tree toggle to CTRL+B +vim.keymap.set('n', '', ':NvimTreeToggle', {}) + +-- Use ctrl - [hl] to select the active split +vim.keymap.set('n', '', ':wincmd h', {}) +vim.keymap.set('n', '', ':wincmd l', {}) + +-- nv creates new vertical split +vim.keymap.set('n', 'nv', ':vnew', { silent = true }) + +-- shift + p invokes PackerSync +vim.keymap.set('n', '', ':PackerSync', {}) + +-- control + p enable transparency +vim.keymap.set('n', '', ':lua ColorMyPencils()', {}) + +-- open :Mason using msn +vim.keymap.set('n', 'msn', ':Mason', { silent = true }) + +-- toggle relative line number with shift + x +vim.keymap.set('n', '', ':set relativenumber! number', {}) + +-- toggle multi-corsor with control + j/k +vim.cmd[[nmap ]] +vim.cmd[[nmap ]] + +-- enable gitblame with ctrl + g +vim.keymap.set('n', '', ':GitBlameToggle', { silent = true }) + +-- shift + m brings up markdown previewer +vim.keymap.set('n', '', ':MarkdownPreview', {}) + +-- invoke neoformat with nf +vim.keymap.set('n', 'nf', ':Neoformat', { silent = true }) + +-- format C and C++ Code with cp +vim.keymap.set('n', 'cp', ':ClangFormat', { silent = true }) + +-- open fzf with ctrl + p +vim.cmd[[nnoremap fzf :silent :FZFExplore]] +vim.keymap.set('n', '', ':FZFExplore', {}) + +-- open ripgrep +vim.cmd[[nnoremap rg :silent :Rg]] + +--toggle autocompletion +vim.cmd[[nnoremap cmp :silent lua SetAutoCmp(Mode)]] diff --git a/.config/nvim/lua/neovim/set.lua b/.config/nvim/lua/neovim/set.lua new file mode 100644 index 00000000..50cdd7c7 --- /dev/null +++ b/.config/nvim/lua/neovim/set.lua @@ -0,0 +1,90 @@ +-- vim.opt.guicursor = "" +-- +vim.opt.nu = true +vim.opt.relativenumber = true + +vim.opt.softtabstop = 0 +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true + +vim.opt.smartindent = true + +vim.opt.swapfile = false +vim.opt.backup = false +vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" +vim.opt.undofile = true + +vim.opt.hlsearch = false +vim.opt.incsearch = true + +vim.opt.termguicolors = true + +vim.opt.scrolloff = 8 +vim.opt.signcolumn = "yes" +vim.opt.isfname:append("@-@") + +vim.opt.updatetime = 50 + +vim.opt.mouse = 'a' +vim.opt.autoindent = true +vim.opt.smarttab = true +vim.opt.ignorecase = true +vim.opt.cindent = true +vim.opt.tabstop = 8 +vim.opt.cursorcolumn = true +-- Disable folds +vim.g.nofoldenable = true +-- Fix Splitting +vim.opt.splitbelow = true +vim.opt.splitright = true + +-- Removes trailing spaces +vim.cmd[[function TrimWhiteSpace() +%s/\s*$// +'' +endfunction]] +--Removes trailing spaces on save +vim.cmd[[autocmd FileWritePre * call TrimWhiteSpace()]] +vim.cmd[[autocmd FileAppendPre * call TrimWhiteSpace()]] +vim.cmd[[autocmd FilterWritePre * call TrimWhiteSpace()]] +vim.cmd[[autocmd BufWritePre * call TrimWhiteSpace()]] + +-- Marks end of line, space, and trailing space characters +vim.opt.listchars:append({ eol = '↵', trail = '·', space = '·' }) +vim.opt.list = true + +-- git-blame disabled by default +vim.g.gitblame_enabled = 0 + +-- vertically center document when entering Insert mode +vim.cmd[[autocmd InsertEnter * norm zz]] + +-- enable clipboard +vim.cmd[[set clipboard+=unnamedplus]] + +-- enable hard/soft wrap +vim.cmd[[set wrap linebreak textwidth=80]] + +-- max tab characters +vim.cmd[[let g:mintabline_tab_max_chars = 10 ]] + +-- Search pattern across repository files using fzf +vim.cmd[[ +function! FzfExplore(...) +let inpath = substitute(a:1, "'", '', 'g') +if inpath == "" || matchend(inpath, '/') == strlen(inpath) + execute "cd" getcwd() . '/' . inpath + let cwpath = getcwd() . '/' + call fzf#run(fzf#wrap(fzf#vim#with_preview({'source': 'ls -1ap', 'dir': cwpath, 'sink': 'FZFExplore', 'options': ['--prompt', cwpath]}))) +else + let file = getcwd() . '/' . inpath + execute "e" file +endif +endfunction]] + +vim.cmd[[command! -nargs=* FZFExplore call FzfExplore(shellescape())]] + +-- fzf is on bottom of screen +vim.cmd[[let g:fzf_layout = { 'down': '~30%' }]] + + diff --git a/.config/nvim/plugin/packer_compiled.lua b/.config/nvim/plugin/packer_compiled.lua new file mode 100644 index 00000000..f576c093 --- /dev/null +++ b/.config/nvim/plugin/packer_compiled.lua @@ -0,0 +1,279 @@ +-- 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" + }, + 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-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" + }, + rainbow = { + loaded = true, + path = "/home/brian/.local/share/nvim/site/pack/packer/start/rainbow", + url = "https://github.com/luochen1990/rainbow" + }, + ["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-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