From e6cd535dd1ef94444cbdae41707c3a0da5c9836a Mon Sep 17 00:00:00 2001 From: Ian Keane Date: Sat, 25 Jun 2022 09:37:33 -0400 Subject: [PATCH] Add nvim configs --- dotfiles/mkscaffold.sh | 2 + dotfiles/nvim/.config/nvim/init.vim | 344 ++++++++++++++++++ dotfiles/nvim/.config/nvim/lua/config.lua | 11 + dotfiles/nvim/.config/nvim/lua/init.lua | 175 +++++++++ .../nvim/.config/nvim/lua/keybindings.lua | 24 ++ dotfiles/nvim/.config/nvim/lua/packages.lua | 16 + .../.config/nvim/plugin/packer_compiled.lua | 152 ++++++++ 7 files changed, 724 insertions(+) create mode 100644 dotfiles/nvim/.config/nvim/init.vim create mode 100644 dotfiles/nvim/.config/nvim/lua/config.lua create mode 100644 dotfiles/nvim/.config/nvim/lua/init.lua create mode 100644 dotfiles/nvim/.config/nvim/lua/keybindings.lua create mode 100644 dotfiles/nvim/.config/nvim/lua/packages.lua create mode 100644 dotfiles/nvim/.config/nvim/plugin/packer_compiled.lua diff --git a/dotfiles/mkscaffold.sh b/dotfiles/mkscaffold.sh index 670524b..9ede67d 100755 --- a/dotfiles/mkscaffold.sh +++ b/dotfiles/mkscaffold.sh @@ -8,4 +8,6 @@ mkdir -p ~/.vim mkdir -p ~/.local/bin +mkdir -p ~/.config/nvim + # mkdir -p ~/.local/share/flavours/base16/templates diff --git a/dotfiles/nvim/.config/nvim/init.vim b/dotfiles/nvim/.config/nvim/init.vim new file mode 100644 index 0000000..a1ea636 --- /dev/null +++ b/dotfiles/nvim/.config/nvim/init.vim @@ -0,0 +1,344 @@ +" vim-plug {{{ +" Automatic installation + if empty(glob('~/.vim/autoload/plug.vim')) + silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs + \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + autocmd VimEnter * PlugInstall --sync | source $MYVIMRC + endif + + call plug#begin('~/.nvim/plugins') + packloadall + + Plug 'chriskempson/base16-vim' + Plug 'junegunn/vim-easy-align' + Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin --all' } + " Plug 'https://gitlab.com/lstwn/broot.vim' + Plug 'tpope/vim-surround' + Plug 'tpope/vim-commentary' + " Plug 'dense-analysis/ale' + Plug 'airblade/vim-gitgutter' + " Plug 'itchyny/lightline.vim' + Plug 'tpope/vim-repeat' + " Plug 'haya14busa/incsearch.vim' + Plug 'sheerun/vim-polyglot' + " Plug 'nvie/vim-flake8' + " Plug 'wolf-dog/lightline-sceaduhelm.vim' + Plug 'tpope/vim-fugitive' + Plug 'justinmk/vim-sneak' + Plug 'jgdavey/tslime.vim' + Plug 'vimwiki/vimwiki' + Plug 'simnalamburt/vim-mundo' + Plug 'tpope/vim-dadbod' + Plug 'junegunn/gv.vim' + Plug 'rbong/vim-flog' + Plug 'tpope/vim-unimpaired' + Plug 'guns/vim-clojure-static' " syntax + Plug 'tpope/vim-fireplace' + Plug 'guns/vim-sexp' + Plug 'tpope/vim-sexp-mappings-for-regular-people' + Plug 'alvan/vim-closetag' + Plug 'mattn/emmet-vim' + Plug 'chrisbra/colorizer' + Plug 'christoomey/vim-tmux-navigator' + Plug 'tpope/vim-rhubarb' + Plug 'zhaozg/vim-diagram' + Plug 'fatih/vim-go' + Plug 'diepm/vim-rest-console' + Plug 'pangloss/vim-javascript' + Plug 'leafgarland/typescript-vim' + Plug 'MaxMEllon/vim-jsx-pretty' + Plug 'peitalin/vim-jsx-typescript' + Plug 'jremmen/vim-ripgrep' + Plug 'francoiscabrol/ranger.vim' + " Plug 'https://github.com/moll/vim-bbye' + Plug 'jlanzarotta/bufexplorer' + Plug 'dbeniamine/cheat.sh-vim' + Plug 'skyuplam/broot.nvim' + Plug 'rbgrouleff/bclose.vim' + + call plug#end() + +"}}} + +" unmaps {{{ +let g:bclose_no_plugin_maps=1 +" }}} + +" appearance {{{ + let base16colorspace=256 + colorscheme base16-default-dark + syntax on " Enable syntax + set encoding=utf-8 " Keep utf-8 encoding + set scrolloff=2 " Keep at least 3 lines above and below cursor + set showmode " Something something buffers + set showcmd " Show command in bottom bar + set wildmenu " Visual autocomplete for command menu + set wildmode=list:longest " Show all completions on tab + set laststatus=2 " Last window will always have statusline + set showmatch " Highlight matching [{()}] + set cursorline " Highlight current line + highlight GitGutterAdd ctermbg=black guibg=black + highlight SignColumn guibg=black ctermbg=black + let g:ctrlsf_default_root="project" + " remove underline on current line number + hi CursorLineNr cterm=bold + + hi StatusLine ctermbg=Black + hi WinSeparator guibg=None + + " " Lightline + " let g:lightline = { 'colorscheme': 'sceaduhelm' } + " set fillchars+=vert:│ + + " command! LightlineReload call LightlineReload() + + " function! LightlineReload() + " call lightline#init() + " call lightline#colorscheme() + " call lightline#update() + " endfunction + + " Invisible characters + set list + set listchars=tab:▸\ ,eol:¬ + + set laststatus=3 + +" }}} + +" Folding {{{ + set foldenable " Enable folding + set foldmethod=marker " Fold sections by marker + set foldlevel=0 " Fold by default + set modelines=1 " Check final line of file for modeline + +" }}} + +" behavior {{{ + set nocompatible " Turn off vi compatability nonsense + set hidden " Hide buffer when opening new file + set visualbell " Use visual bell instead of beeping + set ttyfast " Improves smoothness and drawing + set backspace=indent,eol,start " Always allow backspacing + set undofile " Make .un file for persistent undo + set number + set lazyredraw " Redraw only when necessary + set updatetime=100 " Make updates happen faster (gitgutter) + set splitright " Make split to right by default + set splitbelow + set winheight=30 " Soft minimum window height (active) + set winminheight=6 " Hard minimum window height (inactive) + set winwidth=90 " Window width for current window + set winminwidth=30 " Hard minimum for window width + set t_vb= " No visual bell ever + let g:sneak#use_ic_scs=1 + set virtualedit=block + set noswapfile + set undodir=~/.nvim/undo + let g:markdown_folding=1 + au FileType markdown setlocal foldlevel=99 + let g:bufExplorerSplitHorzSize=8 " New split window is n rows high. + let g:bufExplorerDefaultHelp=0 " Do not show default help. + +"}}} + +" searching {{{ + set gdefault " Remove default g flag on search + set ignorecase " Ignore case for searches + set smartcase " Case-specific only when uppercase + set hlsearch " Don't continue to highlight searched phrases. + set incsearch " But do search as characters are entered + +"}}} + +" tab settings {{{ + set tabstop=4 " Number of visual spaces per tab + set softtabstop=4 " Should always = tabstop + set shiftwidth=4 " Indent/outdent by 4 columns + set expandtab " Tabs are spaces + set shiftround " Always indent/outdent to the nearest tabstop + " Make search terms more visible + highlight Visual ctermbg=DarkGreen ctermfg=Black + set autoindent " Auto indentation + +"}}} + +" hjkl {{{ + " Disable arrow keys in normal and visual mode + nnoremap + nnoremap + nnoremap + nnoremap + inoremap + inoremap + inoremap + inoremap + " Make j and k move by screen line, not file line + nnoremap j gj + nnoremap k gk + +"}}} + +" {{{ web dev + autocmd FileType html,css,javascript,typescript,typescriptreact + \ set expandtab smarttab softtabstop=2 shiftwidth=2 tabstop=2 + + " Emmet tab size + let g:user_emmet_settings = { + \ 'indentation' : ' ' + \} + +" }}} + +" split pane navigation {{{ + " nnoremap h + " nnoremap j + " nnoremap k + " nnoremap l + nnoremap :close + nnoremap :bn + nnoremap :bp + let g:tmux_navigator_disable_when_zoomed = 1 + +"}}} + +" git commands {{{ + nmap ghv (GitGutterPreviewHunk) + nmap ghn (GitGutterNextHunk) + nmap ghp (GitGutterPrevHunk) + nmap ghf (GitGutterFold) + nmap ghs (GitGutterStageHunk) + " Controls fugitive diff split direction + set diffopt=vertical +"}}} + +" plugin modification {{{ + " FZF + map :FZF + " map :tabNext + " This is the default extra key bindings + let g:fzf_action = { + \ 'ctrl-t': 'tab split', + \ 'ctrl-x': 'split', + \ 'ctrl-v': 'vsplit' } + + " Default fzf layout + " - down / up / left / right + let g:fzf_layout = { 'down': '~30%' } + + " Customize fzf colors to match your color scheme + let g:fzf_colors = + \ { 'fg': [ 'fg', 'Normal'], + \ 'bg': [ 'bg', 'Normal'], + \ 'hl': [ 'fg', 'Comment'], + \ 'fg+': [ 'fg', 'CursorLine', 'CursorColumn', 'Normal'], + \ 'bg+': [ 'bg', 'CursorLine', 'CursorColumn'], + \ 'hl+': [ 'fg', 'Statement'], + \ 'info': [ 'fg', 'PreProc'], + \ 'border': [ 'fg', 'Ignore'], + \ 'prompt': [ 'fg', 'Conditional'], + \ 'pointer': [ 'fg', 'Exception'], + \ 'marker': [ 'fg', 'Keyword'], + \ 'spinner': [ 'fg', 'Label'], + \ 'header': [ 'fg', 'Comment'] } + + " EasyAlign + "" Start interactive EasyAlign in visual mode (e.g. vipga) + xmap ga (EasyAlign) + " Start interactive EasyAlign for a motion/text object (e.g. gaip) + nmap ga (EasyAlign) + +"}}} + +" vimwiki {{{ + let g:vimwiki_list = [ + \ {'name': 'work', 'path': '~/.vim/work'}, + \ {'name': 'home', 'path': '~/.vim/home'}, + \ {'name': 'blog', 'path': '~/.vim/blog'}, + \ {'name': 'vim', 'path': '~/.vim/vim'}, + \ ] + + + let g:vimwiki_syntax = 'markdown' + let g:vimwiki_ext = '.md' + + let g:vimwiki_automatic_nested_syntaxes = 1 + let g:vimwiki_links_space_char = '_' + +"}}} + +" diffs {{{ + hi DiffAdd cterm=none ctermfg=DarkGray ctermbg=Green + hi DiffChange cterm=none ctermfg=DarkGray ctermbg=Yellow + hi DiffDelete cterm=bold ctermfg=DarkGray ctermbg=Red + hi DiffText cterm=none ctermfg=DarkGray ctermbg=LightBlue + + " better diffs + set diffopt+=internal,algorithm:patience + +" }}} + +" buffers {{{ + let g:bufExplorerDisableDefaultKeyMapping=1 " Disable mapping. +"}}} + +" broot {{{ + " let g:broot_default_conf_path=expand('~/.config/broot/conf.hjson') + " let g:broot_replace_netrw=1 + " let g:loaded_netrwPlugin=1 " use broot for :E/T/V/Hexplore +"}}} + +"" ALE {{{ +" let g:ale_linters = {'javascript': ['tsserver'], +" \ 'typescript': ['tsserver'], +" \ 'typescriptreact': ['tsserver'], +" \ 'python': ['flake8'], +" \ 'css': ['csslint'], +" \ 'dockerfile': ['hadolint'], +" \ 'yaml': ['yamllint'] } + +" let g:ale_fixers = { +" \ '*': ['remove_trailing_lines', 'trim_whitespace'] } + +" " let g:ale_set_loclist = 0 +" " let g:ale_set_quickfix = 1 +" let g:ale_set_quickfix = 0 +" let g:ale_set_loclist = 0 +" let g:ale_fix_on_save = 1 + +""}}} + +" leaders {{{ + :let mapleader = "," + + " Underline with line of the same length + nnoremap - yypv$r- + + " Insert date on current line + nnoremap d k :r !date + + nnoremap se :Explore + nnoremap st :Texplore + nnoremap sv :Vexplore + nnoremap sh :Hexplore + + nmap h :map + + " nnoremap ad :ALEDetail + " nnoremap ag :ALEGoToDefinition + " nnoremap al :ALEPopulateQuickfix + " nnoremap an :ALENext + " nnoremap ap :ALEPrevious + " nnoremap ar :ALERename + + nnoremap b :BufExplorerHorizontalSplit + +"}}} +" +lua require('init') + +" folding options {{{ + " folding options, this must be last in file + " vim:foldmethod=marker:foldlevel=0 + +" }}} diff --git a/dotfiles/nvim/.config/nvim/lua/config.lua b/dotfiles/nvim/.config/nvim/lua/config.lua new file mode 100644 index 0000000..bec22d7 --- /dev/null +++ b/dotfiles/nvim/.config/nvim/lua/config.lua @@ -0,0 +1,11 @@ +-- require('keybindings') +-- require('package') +-- require('config') + +-- Global options: vim.o +-- Local to window: vim.wo +-- Local to buffer: vim.bo + +vim.opt.expandtab = true +vim.opt.shiftwidth = 2 +vim.opt.softtabstop = 2 diff --git a/dotfiles/nvim/.config/nvim/lua/init.lua b/dotfiles/nvim/.config/nvim/lua/init.lua new file mode 100644 index 0000000..162cb8f --- /dev/null +++ b/dotfiles/nvim/.config/nvim/lua/init.lua @@ -0,0 +1,175 @@ +require('keybindings') +require('packages') +require('config') + +-- Treesitter Confirg +require('nvim-treesitter.configs').setup { + ensure_installed = { + "c", "lua", "rust", "python", "typescript", "bash", "clojure", + "comment", "commonlisp", "fennel", "fish", "json", "html", "markdown", + "make", "toml", "tsx", "vim", "yaml" + }, + highlight = { + enable = true, + }, + indent = { + enable = true, + } +} + +-- LSP Language Installer +local lsp_installer = require("nvim-lsp-installer") + +-- Setup lspconfig. +local on_attach = function(client, bufnr) + -- Enable completion triggered by + vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + + -- Mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + local bufopts = { noremap=true, silent=true, buffer=bufnr } + vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) + vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) + vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) + vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) + -- vim.keymap.set('n', '', vim.lsp.buf.signature_help, bufopts) + vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, bufopts) + vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, bufopts) + vim.keymap.set('n', 'wl', function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, bufopts) + vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, bufopts) + vim.keymap.set('n', 'rn', vim.lsp.buf.rename, bufopts) + vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, bufopts) + vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) + vim.keymap.set('n', 'f', vim.lsp.buf.formatting, bufopts) +end + +local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) + +lsp_installer.on_server_ready(function(server) + local opts = { + on_attach = on_attach, + capabilities = capabilities, + } + if server.name == "sumneko_lua" then + opts.settings = { + Lua = { + diagnostics = { + globals = {'vim', 'use'} + }, + } + } + end + server:setup(opts) +end) + +-- Needed for LuaSnip +require("luasnip/loaders/from_vscode").lazy_load() + +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 luasnip = require("luasnip") + +-- LSP Completion +local cmp = require('cmp') +cmp.setup({ + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + end, + }, + completion = { autocomplete = false }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + -- [''] = cmp.mapping.complete(), -- use supertab + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({ select = true }), + [''] = cmp.mapping(cmp.mapping.select_next_item(), {'i','c'}), + [''] = cmp.mapping(cmp.mapping.select_prev_item(), {'i','c'}), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'luasnip' }, -- For luasnip users. + }, + { + { name = 'buffer' }, + }) +}) + + +-- Set configuration for specific filetype. +cmp.setup.filetype('gitcommit', { + sources = cmp.config.sources({ + { name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it. + }, { + { name = 'buffer' }, + }) +}) + +-- Replace with each lsp server you've enabled. +-- require('lspconfig').sumneko_lua.setup { +-- on_attach = on_attach, +-- capabilities = capabilities, +-- } + +-- require('lspconfig')['tsserver'].setup { +-- capabilities = capabilities +-- } +-- require('lspconfig')['tsserver'].setup { +-- capabilities = capabilities +-- } + + + +-- TODO figure out fold stuff later +-- vim.opt.foldmethod = "expr" +-- vim.opt.foldexpr = "nvim_treesitter#foldexpr()" +-- vim.opt.foldnestmax = 1 +vim.opt.completeopt = "menu" -- keep omnicomplete from spawning new buffer + +-- Autoformatting +require("formatter").setup { + logging = false, + log_level = vim.log.levels.WARN, + filetype = { + -- lua = { + -- require("formatter.filetypes.lua").stylua, + -- }, + python = { + require("formatter.filetypes.python").black, + }, + ["*"] = { + require("formatter.filetypes.any").remove_trailing_whitespace + } + } +} + +-- You will likely want to reduce updatetime which affects CursorHold +-- note: this setting is global and should be set only once +vim.o.updatetime = 250 +vim.cmd [[autocmd! CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]] diff --git a/dotfiles/nvim/.config/nvim/lua/keybindings.lua b/dotfiles/nvim/.config/nvim/lua/keybindings.lua new file mode 100644 index 0000000..8499ba1 --- /dev/null +++ b/dotfiles/nvim/.config/nvim/lua/keybindings.lua @@ -0,0 +1,24 @@ +-- vim.api.nvim_set_keymap({mode}, {keymap}, {mapped to}, {options}) + +local keymap = vim.api.nvim_set_keymap +local opts = { noremap = true } -- don't recursively remap things + +keymap('n', '?', ':tabNext', opts) +-- keymap('n', 'gp', ':tabprevious', opts) + +-- local function nkeymap(key, map) +-- keymap('n', key, map, opts) +-- end + +-- nkeymap('gd', ':lua vim.lsp.buf.definition()') +-- nkeymap('gD', ':lua vim.lsp.buf.declaration()') +-- nkeymap('gi', ':lua vim.lsp.buf.implementation()') +-- nkeymap('gw', ':lua vim.lsp.buf.document_symbol()') +-- nkeymap('gw', ':lua vim.lsp.buf.workspace_symbol()') +-- nkeymap('gr', ':lua vim.lsp.buf.references()') +-- nkeymap('gt', ':lua vim.lsp.buf.type_definition()') +-- nkeymap('K', ':lua vim.lsp.buf.hover()') +-- nkeymap('', ':lua vim.lsp.buf.signature_help()') +-- nkeymap('af', ':lua vim.lsp.buf.code_action()') +-- nkeymap('rn', ':lua vim.lsp.buf.rename()') + diff --git a/dotfiles/nvim/.config/nvim/lua/packages.lua b/dotfiles/nvim/.config/nvim/lua/packages.lua new file mode 100644 index 0000000..6954fd2 --- /dev/null +++ b/dotfiles/nvim/.config/nvim/lua/packages.lua @@ -0,0 +1,16 @@ +require('packer').startup(function() + use 'wbthomason/packer.nvim' + use 'nvim-treesitter/nvim-treesitter' + use 'williamboman/nvim-lsp-installer' + use 'neovim/nvim-lspconfig' + use 'hrsh7th/cmp-nvim-lsp' + use 'hrsh7th/cmp-buffer' + use 'hrsh7th/cmp-path' + use 'hrsh7th/cmp-cmdline' + use 'hrsh7th/nvim-cmp' + use 'L3MON4D3/LuaSnip' + use 'rafamadriz/friendly-snippets' + use 'saadparwaiz1/cmp_luasnip' + use 'onsails/lspkind-nvim' + use 'mhartington/formatter.nvim' +end) diff --git a/dotfiles/nvim/.config/nvim/plugin/packer_compiled.lua b/dotfiles/nvim/.config/nvim/plugin/packer_compiled.lua new file mode 100644 index 0000000..bbfb490 --- /dev/null +++ b/dotfiles/nvim/.config/nvim/plugin/packer_compiled.lua @@ -0,0 +1,152 @@ +-- 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() + + 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 + + _G._packer = _G._packer or {} + _G._packer.profile_output = results +end + +time([[Luarocks path setup]], true) +local package_path_str = "/Users/iankeane/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/Users/iankeane/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/Users/iankeane/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/Users/iankeane/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua" +local install_cpath_pattern = "/Users/iankeane/.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 = "/Users/iankeane/.local/share/nvim/site/pack/packer/start/LuaSnip", + url = "https://github.com/L3MON4D3/LuaSnip" + }, + ["cmp-buffer"] = { + loaded = true, + path = "/Users/iankeane/.local/share/nvim/site/pack/packer/start/cmp-buffer", + url = "https://github.com/hrsh7th/cmp-buffer" + }, + ["cmp-cmdline"] = { + loaded = true, + path = "/Users/iankeane/.local/share/nvim/site/pack/packer/start/cmp-cmdline", + url = "https://github.com/hrsh7th/cmp-cmdline" + }, + ["cmp-nvim-lsp"] = { + loaded = true, + path = "/Users/iankeane/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp", + url = "https://github.com/hrsh7th/cmp-nvim-lsp" + }, + ["cmp-path"] = { + loaded = true, + path = "/Users/iankeane/.local/share/nvim/site/pack/packer/start/cmp-path", + url = "https://github.com/hrsh7th/cmp-path" + }, + cmp_luasnip = { + loaded = true, + path = "/Users/iankeane/.local/share/nvim/site/pack/packer/start/cmp_luasnip", + url = "https://github.com/saadparwaiz1/cmp_luasnip" + }, + ["formatter.nvim"] = { + loaded = true, + path = "/Users/iankeane/.local/share/nvim/site/pack/packer/start/formatter.nvim", + url = "https://github.com/mhartington/formatter.nvim" + }, + ["friendly-snippets"] = { + loaded = true, + path = "/Users/iankeane/.local/share/nvim/site/pack/packer/start/friendly-snippets", + url = "https://github.com/rafamadriz/friendly-snippets" + }, + ["lspkind-nvim"] = { + loaded = true, + path = "/Users/iankeane/.local/share/nvim/site/pack/packer/start/lspkind-nvim", + url = "https://github.com/onsails/lspkind-nvim" + }, + ["nvim-cmp"] = { + loaded = true, + path = "/Users/iankeane/.local/share/nvim/site/pack/packer/start/nvim-cmp", + url = "https://github.com/hrsh7th/nvim-cmp" + }, + ["nvim-lsp-installer"] = { + loaded = true, + path = "/Users/iankeane/.local/share/nvim/site/pack/packer/start/nvim-lsp-installer", + url = "https://github.com/williamboman/nvim-lsp-installer" + }, + ["nvim-lspconfig"] = { + loaded = true, + path = "/Users/iankeane/.local/share/nvim/site/pack/packer/start/nvim-lspconfig", + url = "https://github.com/neovim/nvim-lspconfig" + }, + ["nvim-treesitter"] = { + loaded = true, + path = "/Users/iankeane/.local/share/nvim/site/pack/packer/start/nvim-treesitter", + url = "https://github.com/nvim-treesitter/nvim-treesitter" + }, + ["packer.nvim"] = { + loaded = true, + path = "/Users/iankeane/.local/share/nvim/site/pack/packer/start/packer.nvim", + url = "https://github.com/wbthomason/packer.nvim" + } +} + +time([[Defining packer_plugins]], 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