From e6051a38a672182c7f7dfa083ca1e72b97803c94 Mon Sep 17 00:00:00 2001 From: Toby Vincent Date: Fri, 25 Mar 2022 23:38:13 -0500 Subject: feat: migrated to gnu stow --- nvim/.config/nvim/init.lua | 7 + nvim/.config/nvim/lua/autocommands.lua | 55 +++ nvim/.config/nvim/lua/icons.lua | 106 ++++ nvim/.config/nvim/lua/mappings.lua | 193 ++++++++ nvim/.config/nvim/lua/options.lua | 75 +++ nvim/.config/nvim/lua/plugins.lua | 279 +++++++++++ nvim/.config/nvim/lua/plugins/alpha.lua | 56 +++ nvim/.config/nvim/lua/plugins/blankline.lua | 11 + nvim/.config/nvim/lua/plugins/bufferline.lua | 82 ++++ nvim/.config/nvim/lua/plugins/cmp.lua | 119 +++++ nvim/.config/nvim/lua/plugins/dap.lua | 89 ++++ nvim/.config/nvim/lua/plugins/git-blame.lua | 3 + nvim/.config/nvim/lua/plugins/git-worktree.lua | 14 + nvim/.config/nvim/lua/plugins/gitsigns.lua | 48 ++ nvim/.config/nvim/lua/plugins/lsp-installer.lua | 124 +++++ nvim/.config/nvim/lua/plugins/lsp-signature.lua | 59 +++ nvim/.config/nvim/lua/plugins/lspconfig.lua | 97 ++++ nvim/.config/nvim/lua/plugins/lspkind.lua | 34 ++ nvim/.config/nvim/lua/plugins/lspstatus.lua | 13 + nvim/.config/nvim/lua/plugins/lualine.lua | 113 +++++ nvim/.config/nvim/lua/plugins/luasnip.lua | 18 + nvim/.config/nvim/lua/plugins/neogit.lua | 6 + nvim/.config/nvim/lua/plugins/null-ls.lua | 47 ++ nvim/.config/nvim/lua/plugins/nvim-tree.lua | 111 +++++ nvim/.config/nvim/lua/plugins/project.lua | 13 + nvim/.config/nvim/lua/plugins/renamer.lua | 46 ++ nvim/.config/nvim/lua/plugins/session_manager.lua | 25 + nvim/.config/nvim/lua/plugins/telescope.lua | 55 +++ nvim/.config/nvim/lua/plugins/treesitter.lua | 14 + nvim/.config/nvim/lua/plugins/which-key.lua | 34 ++ nvim/.config/nvim/lua/utils.lua | 9 + nvim/.config/nvim/plugin/packer_compiled.lua | 572 ++++++++++++++++++++++ 32 files changed, 2527 insertions(+) create mode 100644 nvim/.config/nvim/init.lua create mode 100644 nvim/.config/nvim/lua/autocommands.lua create mode 100644 nvim/.config/nvim/lua/icons.lua create mode 100644 nvim/.config/nvim/lua/mappings.lua create mode 100644 nvim/.config/nvim/lua/options.lua create mode 100644 nvim/.config/nvim/lua/plugins.lua create mode 100644 nvim/.config/nvim/lua/plugins/alpha.lua create mode 100644 nvim/.config/nvim/lua/plugins/blankline.lua create mode 100644 nvim/.config/nvim/lua/plugins/bufferline.lua create mode 100644 nvim/.config/nvim/lua/plugins/cmp.lua create mode 100644 nvim/.config/nvim/lua/plugins/dap.lua create mode 100644 nvim/.config/nvim/lua/plugins/git-blame.lua create mode 100644 nvim/.config/nvim/lua/plugins/git-worktree.lua create mode 100644 nvim/.config/nvim/lua/plugins/gitsigns.lua create mode 100644 nvim/.config/nvim/lua/plugins/lsp-installer.lua create mode 100644 nvim/.config/nvim/lua/plugins/lsp-signature.lua create mode 100644 nvim/.config/nvim/lua/plugins/lspconfig.lua create mode 100644 nvim/.config/nvim/lua/plugins/lspkind.lua create mode 100644 nvim/.config/nvim/lua/plugins/lspstatus.lua create mode 100644 nvim/.config/nvim/lua/plugins/lualine.lua create mode 100644 nvim/.config/nvim/lua/plugins/luasnip.lua create mode 100644 nvim/.config/nvim/lua/plugins/neogit.lua create mode 100644 nvim/.config/nvim/lua/plugins/null-ls.lua create mode 100644 nvim/.config/nvim/lua/plugins/nvim-tree.lua create mode 100644 nvim/.config/nvim/lua/plugins/project.lua create mode 100644 nvim/.config/nvim/lua/plugins/renamer.lua create mode 100644 nvim/.config/nvim/lua/plugins/session_manager.lua create mode 100644 nvim/.config/nvim/lua/plugins/telescope.lua create mode 100644 nvim/.config/nvim/lua/plugins/treesitter.lua create mode 100644 nvim/.config/nvim/lua/plugins/which-key.lua create mode 100644 nvim/.config/nvim/lua/utils.lua create mode 100644 nvim/.config/nvim/plugin/packer_compiled.lua (limited to 'nvim/.config') diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua new file mode 100644 index 0000000..4671808 --- /dev/null +++ b/nvim/.config/nvim/init.lua @@ -0,0 +1,7 @@ +-- https://github.com/mikebarkmin/.dotfiles/tree/main/nvim/.config/nvim +-- https://github.com/ThePrimeagen/.dotfiles/tree/master/nvim +-- https://github.com/ChristianChiarulli/nvim +require('plugins') +require('options') +require('autocommands') +require('mappings') diff --git a/nvim/.config/nvim/lua/autocommands.lua b/nvim/.config/nvim/lua/autocommands.lua new file mode 100644 index 0000000..c87fb70 --- /dev/null +++ b/nvim/.config/nvim/lua/autocommands.lua @@ -0,0 +1,55 @@ +-- to Show whitespace, MUST be inserted BEFORE the colorscheme command +vim.cmd [[ + augroup _general_settings + autocmd! + autocmd FileType qf,help,man,lspinfo,spectre_panel nnoremap q :close + autocmd TextYankPost * silent!lua require('vim.highlight').on_yank({higroup = 'Visual', timeout = 200}) + autocmd BufWritePre * :%s/\s\+$//e + autocmd BufWinEnter * :set formatoptions-=cro + autocmd BufEnter * set fo-=c fo-=r fo-=o + autocmd FileType qf set nobuflisted + autocmd CmdWinEnter * quit + autocmd FileType xml,html,xhtml,css,scss,javascript,lua,dart setlocal shiftwidth=2 tabstop=2 + autocmd BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif + augroup end + + augroup format_on_save + autocmd! + autocmd BufWritePre * lua vim.lsp.buf.formatting() + augroup end + + augroup _git + autocmd! + autocmd FileType gitcommit setlocal wrap + autocmd FileType gitcommit setlocal spell + augroup end + + augroup _markdown + autocmd! + autocmd FileType markdown setlocal wrap + autocmd FileType markdown setlocal spell + autocmd BufNewFile,BufRead *.mdx set filetype=markdown + augroup end + + augroup _latex + autocmd! + autocmd FileType latex,tex,plaintex setlocal wrap + autocmd FileType latex,tex,plaintex setlocal spell + autocmd FileType latex,tex,plaintex setlocal linebreak + augroup end + + augroup _json + autocmd! + autocmd BufEnter *.json set ai expandtab shiftwidth=2 tabstop=2 sta fo=croql + augroup end + + augroup _auto_resize + autocmd! + autocmd VimResized * tabdo wincmd = + augroup end + + augroup _alpha + autocmd! + autocmd User AlphaReady set showtabline=0 | autocmd BufUnload set showtabline=2 + augroup end +]] diff --git a/nvim/.config/nvim/lua/icons.lua b/nvim/.config/nvim/lua/icons.lua new file mode 100644 index 0000000..be868a0 --- /dev/null +++ b/nvim/.config/nvim/lua/icons.lua @@ -0,0 +1,106 @@ +-- https://github.com/microsoft/vscode/blob/main/src/vs/base/common/codicons.ts +-- go to the above and then enter u and the symbold should appear +-- or go here and upload the font file: https://mathew-kurian.github.io/CharacterMap/ +-- find more here: https://www.nerdfonts.com/cheat-sheet +--   פּ ﯟ   蘒練 some other good icons +return { + kind = { + Text = "", + -- Method = "m", + -- Function = "", + -- Constructor = "", + Method = "", + Function = "", + Constructor = "", + Field = "", + -- Variable = "", + Variable = "", + Class = "", + Interface = "", + -- Module = "", + Module = "", + Property = "", + Unit = "", + Value = "", + Enum = "", + -- Keyword = "", + Keyword = "", + -- Snippet = "", + Snippet = "", + Color = "", + File = "", + Reference = "", + Folder = "", + EnumMember = "", + Constant = "", + Struct = "", + Event = "", + Operator = "", + TypeParameter = "", + }, + type = { + Array = "", + Number = "", + String = "", + Boolean = "蘒", + Object = "", + }, + documents = { + File = "", + Files = "", + Folder = "", + OpenFolder = "", + }, + git = { + Add = "", + Mod = "", + Remove = "", + Ignore = "", + Rename = "", + Diff = "", + Repo = "", + }, + ui = { + Lock = "", + Circle = "", + BigCircle = "", + BigUnfilledCircle = "", + Close = "", + NewFile = "", + Search = "", + Lightbulb = "", + Project = "", + Dashboard = "", + History = "", + Comment = "", + Bug = "", + Code = "", + Telescope = "", + Gear = "", + Package = "", + List = "", + SignIn = "", + Check = "", + Fire = "", + Note = "", + BookMark = "", + Pencil = "", + -- ChevronRight = "", + ChevronRight = ">", + Table = "", + Calendar = "", + }, + diagnostics = { + Error = "", + Warning = "", + Information = "", + Question = "", + Hint = "", + }, + misc = { + Robot = "ﮧ", + Squirrel = "", + Tag = "", + Watch = "", + }, +} \ No newline at end of file diff --git a/nvim/.config/nvim/lua/mappings.lua b/nvim/.config/nvim/lua/mappings.lua new file mode 100644 index 0000000..3b6c7d5 --- /dev/null +++ b/nvim/.config/nvim/lua/mappings.lua @@ -0,0 +1,193 @@ +local status_ok, which_key = pcall(require, "which-key") +if not status_ok then + return +end + +local opts = { + buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings + silent = true, -- use `silent` when creating keymaps + noremap = true, -- use `noremap` when creating keymaps + nowait = true, -- use `nowait` when creating keymaps +} + +local mappings = { + -- Ctrl maps + [""] = { "w!", "Save" }, + [""] = { "NvimTreeToggle", "Explorer" }, +} + +local nopts = { + mode = "n", -- NORMAL mode + buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings + silent = true, -- use `silent` when creating keymaps + noremap = true, -- use `noremap` when creating keymaps + nowait = true, -- use `nowait` when creating keymaps +} + +local nmappings = { + -- Ctrl maps + [""] = { "lua require('Comment.api').toggle_current_linewise()", "Comment" }, + + -- Prefix "" + [""] = { + a = { "Alpha", "Alpha" }, + c = { "Bdelete!", "Close Buffer" }, + q = { "q!", "Quit" }, + R = { "lua require('renamer').rename()", "Rename" }, + w = { "w!", "Save" }, + W = { ":set wrap! linebreak!", "Toggle Line Wrap" }, + z = { "ZenMode", "Zen" }, + ["/"] = { "lua require('Comment.api').toggle_current_linewise()", "Comment" }, + + f = { + name = "Find", + b = { "Telescope git_branches", "Checkout branch" }, + c = { "Telescope colorscheme", "Colorscheme" }, + C = { "Telescope commands", "Commands" }, + e = { "Telescope frecency theme=get_dropdown", "Frecency" }, + f = { "Telescope find_files theme=get_dropdown", "Find files" }, + g = { "Telescope live_grep theme=ivy", "Find Text" }, + h = { "Telescope help_tags", "Help" }, + i = { "lua require('telescope').extensions.media_files.media_files()", "Media" }, + k = { "Telescope keymaps", "Keymaps" }, + l = { "Telescope resume", "Last Search" }, + m = { "Telescope man_pages", "Man Pages" }, + p = { "lua require('telescope').extensions.projects.projects()", "Projects" }, + r = { "Telescope oldfiles", "Recent File" }, + R = { "Telescope registers", "Registers" }, + t = { "Telescope buffers show_all_buffers=true theme=get_dropdown", "Buffers" }, + }, + + g = { + name = "Git", + b = { "Telescope git_branches", "Checkout branch" }, + c = { "Telescope git_commits", "Checkout commit" }, + d = { "Gitsigns diffthis HEAD", "Diff" }, + g = { "LazyGit", "Lazygit" }, + j = { "lua require 'gitsigns'.next_hunk()", "Next Hunk" }, + k = { "lua require 'gitsigns'.prev_hunk()", "Prev Hunk" }, + l = { "GitBlameToggle", "Blame" }, + o = { "Telescope git_status", "Open changed file" }, + p = { "lua require 'gitsigns'.preview_hunk()", "Preview Hunk" }, + r = { "lua require 'gitsigns'.reset_hunk()", "Reset Hunk" }, + R = { "lua require 'gitsigns'.reset_buffer()", "Reset Buffer" }, + s = { "lua require 'gitsigns'.stage_hunk()", "Stage Hunk" }, + u = { "lua require 'gitsigns'.undo_stage_hunk()", "Undo Stage Hunk" }, + w = { + name = "Worktree", + s = { [[lua require('telescope').extensions.git_worktree.git_worktrees()]], "Switch" }, + c = { [[lua require('telescope').extensions.git_worktree.create_git_worktree()]], "Create" }, + }, + }, + + l = { + name = "LSP", + a = { "lua vim.lsp.buf.code_action()", "Code Action" }, + d = { "TroubleToggle", "Diagnostics" }, + f = { "lua vim.lsp.buf.formatting()", "Format" }, + -- F = { "LspToggleAutoFormat", "Toggle Autoformat" }, + g = { + name = "Goto", + d = { "lua vim.lsp.buf.definition()", "Definition" }, + D = { "lua vim.lsp.buf.declaration()", "Declaration" }, + i = { "lua vim.lsp.buf.implementation()", "Implementation" }, + r = { "lua vim.lsp.buf.references()", "References" }, + }, + h = { "lua vim.lsp.buf.hover()", "Hover" }, + H = { "lua vim.lsp.buf.signature_help()", "Signature Help" }, + i = { "LspInfo", "Info" }, + I = { "LspInstallInfo", "Installer Info" }, + j = { "lua vim.diagnostic.goto_next({buffer=0})", "Next Diagnostic" }, + k = { "lua vim.diagnostic.goto_prev({buffer=0})", "Prev Diagnostic" }, + l = { "lua vim.lsp.codelens.run()", "CodeLens Action" }, + o = { "SymbolsOutline", "Outline" }, + q = { "lua vim.lsp.diagnostic.set_loclist()", "Quickfix" }, + r = { "lua vim.lsp.buf.rename()", "Rename" }, + R = { "TroubleToggle lsp_references", "References" }, + s = { "Telescope lsp_document_symbols", "Document Symbols" }, + S = { "Telescope lsp_dynamic_workspace_symbols", "Workspace Symbols" }, + w = { "Telescope lsp_workspace_diagnostics", "Workspace Diagnostics" }, + }, + + p = { + name = "Packer", + c = { "PackerCompile", "Compile" }, + i = { "PackerInstall", "Install" }, + s = { "PackerSync", "Sync" }, + S = { "PackerStatus", "Status" }, + u = { "PackerUpdate", "Update" }, + }, + + r = { + name = "Replace", + f = { "lua require('spectre').open_file_search()", "Replace Buffer" }, + r = { "lua require('spectre').open()", "Replace" }, + w = { "lua require('spectre').open_visual({select_word=true})", "Replace Word" }, + }, + + s = { + name = "Surround", + ["."] = { "lua require('surround').repeat_last()", "Repeat" }, + a = { "lua require('surround').surround_add(true)", "Add" }, + b = { "lua require('surround').toggle_brackets()", "Brackets" }, + d = { "lua require('surround').surround_delete()", "Delete" }, + q = { "lua require('surround').toggle_quotes()", "Quotes" }, + r = { "lua require('surround').surround_replace()", "Replace" }, + }, + + t = { + name = "Terminal", + ["1"] = { ":1ToggleTerm", "1" }, + ["2"] = { ":2ToggleTerm", "2" }, + ["3"] = { ":3ToggleTerm", "3" }, + ["4"] = { ":4ToggleTerm", "4" }, + f = { "ToggleTerm direction=float", "Float" }, + h = { "ToggleTerm size=10 direction=horizontal", "Horizontal" }, + v = { "ToggleTerm size=80 direction=vertical", "Vertical" }, + }, + + T = { + name = "Treesitter", + h = { "TSHighlightCapturesUnderCursor", "Highlight" }, + p = { "TSPlaygroundToggle", "Playground" }, + }, + }, + -- Prefix "m" + m = { + a = { "BookmarkAnnotate", "Annotate" }, + c = { "BookmarkClear", "Clear" }, + h = { 'lua require("harpoon.mark").add_file()', "Harpoon" }, + j = { "BookmarkNext", "Next" }, + k = { "BookmarkPrev", "Prev" }, + m = { "BookmarkToggle", "Toggle" }, + s = { + "lua require('telescope').extensions.vim_bookmarks.all({ hide_filename=false, prompt_title=\"bookmarks\", shorten_path=false })", + "Show", + }, + u = { 'lua require("harpoon.ui").toggle_quick_menu()', "Harpoon UI" }, + x = { "BookmarkClearAll", "Clear All" }, + }, +} + +local vopts = { + mode = "v", -- VISUAL mode + buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings + silent = true, -- use `silent` when creating keymaps + noremap = true, -- use `noremap` when creating keymaps + nowait = true, -- use `nowait` when creating keymaps +} + +local vmappings = { + -- Ctrl maps + [""] = { "lua require('Comment.api').toggle_linewise_op(vim.fn.visualmode())", "Comment" }, + + -- Prefix "" + [""] = { + + ["/"] = { "lua require('Comment.api').toggle_linewise_op(vim.fn.visualmode())", "Comment" }, + } +} + +which_key.register(mappings, opts) +which_key.register(nmappings, nopts) +which_key.register(vmappings, vopts) diff --git a/nvim/.config/nvim/lua/options.lua b/nvim/.config/nvim/lua/options.lua new file mode 100644 index 0000000..6fb959d --- /dev/null +++ b/nvim/.config/nvim/lua/options.lua @@ -0,0 +1,75 @@ +local g = vim.g -- global variables +local opt = vim.opt -- vim options +local exec = vim.api.nvim_exec -- execute Vimscript + +g.mapleader = ' ' + +-- set colorscheme +g.vscode_style = "dark" +g.vscode_transparent = 1 +g.vscode_italic_comment = 1 +g.vscode_disable_nvimtree_bg = true + +vim.cmd('colorscheme vscode') + +g.tex_flavor = "latex"; + +-- global options +local options = { + termguicolors = true, -- Enable GUI colors for the terminal to get truecolor + list = false, -- show whitespace + listchars = { + nbsp = '⦸', -- CIRCLED REVERSE SOLIDUS (U+29B8, UTF-8: E2 A6 B8) + extends = '»', -- RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK (U+00BB, UTF-8: C2 BB) + precedes = '«', -- LEFT-POINTING DOUBLE ANGLE QUOTATION MARK (U+00AB, UTF-8: C2 AB) + tab = '▷─', -- WHITE RIGHT-POINTING TRIANGLE (U+25B7, UTF-8: E2 96 B7) + BOX DRAWINGS HEAVY TRIPLE DASH HORIZONTAL (U+2505, UTF-8: E2 94 85) + trail = '•', -- BULLET (U+2022, UTF-8: E2 80 A2) + space = ' ' + }, + fillchars = { + diff = '∙', -- BULLET OPERATOR (U+2219, UTF-8: E2 88 99) + eob = ' ', -- NO-BREAK SPACE (U+00A0, UTF-8: C2 A0) to suppress ~ at EndOfBuffer + fold = '·', -- MIDDLE DOT (U+00B7, UTF-8: C2 B7) + vert = ' ' -- remove ugly vertical lines on window division + }, + undofile = true, + undodir = vim.fn.stdpath("config") .. "/undo", + clipboard = opt.clipboard + "unnamedplus", -- copy & paste + shortmess = opt.shortmess + "c", + wrap = false, -- don't automatically wrap on load + showmatch = true, -- show the matching part of the pair for [] {} and () + cursorline = true, -- highlight current line + number = true, -- show line numbers + relativenumber = true, -- show relative line number + incsearch = true, -- incremental search + hlsearch = true, -- highlighted search results + ignorecase = true, -- ignore case sensetive while searching + smartcase = true, + scrolloff = 1, -- when scrolling, keep cursor 1 lines away from screen border + sidescrolloff = 2, -- keep 30 columns visible left and right of the cursor at all times + backspace = 'indent,start,eol', -- make backspace behave like normal again + mouse = "a", -- turn on mouse interaction + updatetime = 500, -- CursorHold interval + expandtab = true, + softtabstop = 4, + textwidth = 100, + shiftwidth = 4, -- spaces per tab (when shifting), when using the >> or << commands, shift lines by 4 spaces + tabstop = 4, -- spaces per tab + smarttab = true, -- / indent/dedent in leading whitespace + autoindent = true, -- maintain indent of current line + shiftround = true, + splitbelow = true, -- open horizontal splits below current window + splitright = true, -- open vertical splits to the right of the current window + laststatus = 2, -- always show status line + colorcolumn = "100", -- vertical word limit line + hidden = true, -- allows you to hide buffers with unsaved changes without being prompted + inccommand = 'split', -- live preview of :s results + shell = 'zsh', -- shell to use for `!`, `:!`, `system()` etc. + wildignore = opt.wildignore + '*.o,*.rej,*.so', + lazyredraw = true, + completeopt = 'menuone,noselect,noinsert', +} + +for k, v in pairs(options) do + vim.opt[k] = v +end diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua new file mode 100644 index 0000000..de4c47f --- /dev/null +++ b/nvim/.config/nvim/lua/plugins.lua @@ -0,0 +1,279 @@ +local fn = vim.fn + +-- Automatically install packer +local install_path = fn.stdpath "data" .. "/site/pack/packer/start/packer.nvim" +if fn.empty(fn.glob(install_path)) > 0 then + PACKER_BOOTSTRAP = fn.system { + "git", + "clone", + "--depth", + "1", + "https://github.com/wbthomason/packer.nvim", + install_path, + } + print "Installing packer close and reopen Neovim..." + vim.cmd [[packadd packer.nvim]] +end + +-- Autocommand that reloads neovim whenever you save the plugins.lua file +vim.cmd [[ + augroup packer_user_config + autocmd! + autocmd BufWritePost plugins.lua source | PackerSync + augroup end +]] + +-- Use a protected call so we don't error out on first use +local status_ok, packer = pcall(require, "packer") +if not status_ok then + return +end + +-- Have packer use a popup window +packer.init { + display = { + open_fn = function() + return require("packer.util").float { border = "rounded" } + end, + }, +} + +-- Install your plugins here +return packer.startup(function(use) + -- My plugins here + + -- Have packer manage itself + + use "wbthomason/packer.nvim" + + use { + 'dstein64/vim-startuptime', + cmd = 'StartupTime', + config = [[vim.g.startuptime_tries = 3]] + } + + use 'lewis6991/impatient.nvim' + use 'andweeb/presence.nvim' + use 'Mofiqul/vscode.nvim' -- vscode theme + + use { + 'tpope/vim-dispatch', + cmd = { + 'Dispatch', + 'Make', + 'Focus', + 'Start' + } + } + + use { + 'neovim/nvim-lspconfig', + config = [[require('plugins/lspconfig')]] + } + + use { + "williamboman/nvim-lsp-installer", + config = [[require('plugins/lsp-installer')]] + } + + use 'nvim-lua/lsp_extensions.nvim' + use 'simrat39/rust-tools.nvim' + use 'simrat39/symbols-outline.nvim' + + use { + "folke/trouble.nvim", + cmd = "TroubleToggle" + } + + use { + 'hrsh7th/nvim-cmp', + requires = { + { "onsails/lspkind-nvim", config = [[require('plugins/lspkind')]] }, -- vscode-like pictograms for cmp + 'ray-x/lsp_signature.nvim', + 'hrsh7th/cmp-nvim-lsp', -- nvim-cmp source for neovim builtin LSP client + 'hrsh7th/cmp-nvim-lua', -- nvim-cmp source for nvim lua + 'hrsh7th/cmp-buffer', -- nvim-cmp source for buffer words. + 'hrsh7th/cmp-path', -- nvim-cmp source for filesystem paths. + 'hrsh7th/cmp-calc', -- nvim-cmp source for math calculation. + 'saadparwaiz1/cmp_luasnip', -- luasnip completion source for nvim-cmp + 'hrsh7th/cmp-nvim-lsp-signature-help', -- luasnip completion source for lsp_signature + }, + config = [[require('plugins/cmp')]], + } + + use { + 'nvim-telescope/telescope.nvim', + requires = { + 'nvim-lua/plenary.nvim', + 'BurntSushi/ripgrep', + 'nvim-telescope/telescope-dap.nvim', + { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }, + { "nvim-telescope/telescope-frecency.nvim", requires = "tami5/sqlite.lua" }, + }, + config = [[require('plugins/telescope')]], + } + + use { + "jose-elias-alvarez/null-ls.nvim", + requires = "nvim-lua/plenary.nvim", + config = [[require('plugins/null-ls')]] + } + + use { + "L3MON4D3/LuaSnip", + requires = "rafamadriz/friendly-snippets", + config = [[require('plugins/luasnip')]] + } + + use { + "nvim-treesitter/nvim-treesitter", + run = ":TSUpdate", + requires = { + 'nvim-treesitter/nvim-treesitter-refactor', + 'RRethy/nvim-treesitter-textsubjects', + }, + config = [[require('plugins/treesitter')]] + } + + use { + "lukas-reineke/indent-blankline.nvim", + config = [[require('plugins/blankline')]] + } + + use "tpope/vim-eunuch" + + use { + "nvim-lualine/lualine.nvim", + requires = { + { "kyazdani42/nvim-web-devicons" }, + }, + config = [[require('plugins/lualine')]] + } + + use { + 'tpope/vim-fugitive', + cmd = { + 'Git', + 'Gstatus', + 'Gblame', + 'Gpush', + 'Gpull' + }, + disable = true + } + + use { + 'lewis6991/gitsigns.nvim', + requires = 'nvim-lua/plenary.nvim', + config = [[require('plugins/gitsigns')]], + } + + use { + 'TimUntersberger/neogit', + cmd = 'Neogit', + config = [[require('neogit').setup {disable_commit_confirmation = true, disable_signs = true}]] + } + + use 'kdheepak/lazygit.nvim' + + use { + "f-person/git-blame.nvim", + config = [[require('plugins/git-blame')]] + } + + use { + 'mbbill/undotree', + cmd = 'UndotreeToggle', + config = [[vim.g.undotree_SetFocusWhenToggle = 1]], + } + + use { + "ThePrimeagen/git-worktree.nvim", + config = [[require('plugins/git-worktree')]] + } + + use { + 'ThePrimeagen/refactoring.nvim', + opt = true + } + + use { + "ahmedkhalf/project.nvim", + config = [[require('plugins/project')]] + } + + use { + "folke/which-key.nvim", + config = [[require('plugins/which-key')]] + } + + use { + 'mfussenegger/nvim-dap', + requires = { + "theHamsta/nvim-dap-virtual-text", + "rcarriga/nvim-dap-ui", + "Pocco81/DAPInstall.nvim", + }, + config = [[require('plugins/dap')]], + } + + use 'rcarriga/nvim-notify' + use "antoinemadec/FixCursorHold.nvim" + use "nacro90/numb.nvim" + use "Shatur/neovim-session-manager" + use 'ThePrimeagen/harpoon' + use "b0o/SchemaStore.nvim" + use 'windwp/nvim-spectre' + + use { + 'goolord/alpha-nvim', + config = [[require('plugins/alpha')]] + } + + use { + "filipdutescu/renamer.nvim", + config = [[require('plugins/renamer')]] + } + + use { + 'numToStr/Comment.nvim', + config = [[require('Comment').setup()]] + } + + use { + 'norcalli/nvim-colorizer.lua', + ft = { + 'css', + 'javascript', + 'vim', + 'html' + }, + config = [[require('colorizer').setup {'css', 'javascript', 'vim', 'html'}]], + } + + use { + 'akinsho/nvim-bufferline.lua', + requires = 'kyazdani42/nvim-web-devicons', + config = [[require('plugins/bufferline')]], + } + + use "moll/vim-bbye" + use 'SmiteshP/nvim-gps' + + use { + "kyazdani42/nvim-tree.lua", + requires = { + { + 'yamatsum/nvim-nonicons', + requires = 'kyazdani42/nvim-web-devicons' + }, + }, + config = [[require('plugins/nvim-tree')]] + } + + -- Automatically set up your configuration after cloning packer.nvim + -- Put this at the end after all plugins + if PACKER_BOOTSTRAP then + require("packer").sync() + end +end) diff --git a/nvim/.config/nvim/lua/plugins/alpha.lua b/nvim/.config/nvim/lua/plugins/alpha.lua new file mode 100644 index 0000000..87ae48a --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/alpha.lua @@ -0,0 +1,56 @@ +local status_ok, alpha = pcall(require, "alpha") +if not status_ok then + return +end + +local status_ok, dashboard = pcall(require, "alpha.themes.dashboard") +if not status_ok then + return +end + + +-- alpha.setup(dashboard.config) + +local icons = require "icons" + +local dashboard = require "alpha.themes.dashboard" +dashboard.section.header.val = { + [[ __ ]], + [[ ___ ___ ___ __ __ /\_\ ___ ___ ]], + [[ / _ `\ / __`\ / __`\/\ \/\ \\/\ \ / __` __`\ ]], + [[/\ \/\ \/\ __//\ \_\ \ \ \_/ |\ \ \/\ \/\ \/\ \ ]], + [[\ \_\ \_\ \____\ \____/\ \___/ \ \_\ \_\ \_\ \_\]], + [[ \/_/\/_/\/____/\/___/ \/__/ \/_/\/_/\/_/\/_/]], +} +dashboard.section.buttons.val = { + dashboard.button("f", icons.documents.Files .. " Find file", ":Telescope find_files "), + dashboard.button("e", icons.ui.NewFile .. " New file", ":ene startinsert "), + dashboard.button( + "p", + icons.git.Repo .. " Find project", + ":lua require('telescope').extensions.projects.projects()" + ), + dashboard.button("r", icons.ui.History .. " Recent files", ":Telescope oldfiles "), + dashboard.button("t", icons.ui.List .. " Find text", ":Telescope live_grep "), + dashboard.button("s", icons.ui.SignIn .. " Find Session", ":Telescope sessions save_current=false "), + dashboard.button("c", icons.ui.Gear .. " Config", ":e ~/.config/nvim/init.lua "), + dashboard.button("q", icons.diagnostics.Error .. " Quit", ":qa"), +} +local function footer() + -- NOTE: requires the fortune-mod package to work + -- local handle = io.popen("fortune") + -- local fortune = handle:read("*a") + -- handle:close() + -- return fortune + return "tobyvin.com" +end + +dashboard.section.footer.val = footer() + +dashboard.section.footer.opts.hl = "Type" +dashboard.section.header.opts.hl = "Include" +dashboard.section.buttons.opts.hl = "Keyword" + +dashboard.opts.opts.noautocmd = true +-- vim.cmd([[autocmd User AlphaReady echo 'ready']]) +alpha.setup(dashboard.opts) \ No newline at end of file diff --git a/nvim/.config/nvim/lua/plugins/blankline.lua b/nvim/.config/nvim/lua/plugins/blankline.lua new file mode 100644 index 0000000..44f90c8 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/blankline.lua @@ -0,0 +1,11 @@ +local status_ok, indent_blankline = pcall(require, "indent_blankline") +if not status_ok then + return +end + +indent_blankline.setup { + -- for example, context is off by default, use this to turn it on + show_current_context = true, + show_current_context_start = true, + show_end_of_line = true +} diff --git a/nvim/.config/nvim/lua/plugins/bufferline.lua b/nvim/.config/nvim/lua/plugins/bufferline.lua new file mode 100644 index 0000000..105df66 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/bufferline.lua @@ -0,0 +1,82 @@ +local status_ok, bufferline = pcall(require, "bufferline") +if not status_ok then + return +end + +-- https://github.com/Mofiqul/vscode.nvim#-usage + +local diagnostics_signs = { + ['error'] = '', + warning = '', + default = '', +} + +require('bufferline').setup{ + options = { + indicator_icon = ' ', + buffer_close_icon = '', + modified_icon = '●', + close_icon = '', + close_command = "Bdelete! %d", + right_mouse_command = "Bdelete! %d", + always_show_bufferline = false, + diagnostics = 'nvim_lsp', + diagnostics_indicator = function(count, level, diagnostics_dict, context) + local s = ' ' + for e, n in pairs(diagnostics_dict) do + local sym = diagnostics_signs[e] or diagnostics_signs.default + s = s .. (#s > 1 and ' ' or '') .. sym .. ' ' .. n + end + return s + end, + -- separator_style = 'slant', + offsets = {{filetype = "NvimTree", text = "EXPLORER", text_align = "center"}}, + show_tab_indicators = true, + show_close_icon = false + }, + highlights = { + fill = { + guifg = {attribute = "fg", highlight = "Normal"}, + guibg = {attribute = "bg", highlight = "StatusLineNC"}, + }, + background = { + guifg = {attribute = "fg", highlight = "Normal"}, + guibg = {attribute = "bg", highlight = "StatusLine"} + }, + buffer_visible = { + gui = "", + guifg = {attribute = "fg", highlight="Normal"}, + guibg = {attribute = "bg", highlight = "Normal"} + }, + buffer_selected = { + gui = "", + guifg = {attribute = "fg", highlight="Normal"}, + guibg = {attribute = "bg", highlight = "Normal"} + }, + separator = { + guifg = {attribute = "bg", highlight = "Normal"}, + guibg = {attribute = "bg", highlight = "StatusLine"}, + }, + separator_selected = { + guifg = {attribute = "fg", highlight="Special"}, + guibg = {attribute = "bg", highlight = "Normal"} + }, + separator_visible = { + guifg = {attribute = "fg", highlight = "Normal"}, + guibg = {attribute = "bg", highlight = "StatusLineNC"}, + }, + close_button = { + guifg = {attribute = "fg", highlight = "Normal"}, + guibg = {attribute = "bg", highlight = "StatusLine"} + }, + close_button_selected = { + guifg = {attribute = "fg", highlight="normal"}, + guibg = {attribute = "bg", highlight = "normal"} + }, + close_button_visible = { + guifg = {attribute = "fg", highlight="normal"}, + guibg = {attribute = "bg", highlight = "normal"} + }, + + } +} diff --git a/nvim/.config/nvim/lua/plugins/cmp.lua b/nvim/.config/nvim/lua/plugins/cmp.lua new file mode 100644 index 0000000..1a13863 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/cmp.lua @@ -0,0 +1,119 @@ +local status_ok, cmp = pcall(require, "cmp") +if not status_ok then + return +end + +-- Require function for tab to work with LUA-SNIP +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 + +cmp.setup({ + completion = { + completeopt = 'menu,menuone,noinsert', + }, + snippet = { + expand = function(args) require('luasnip').lsp_expand(args.body) end + }, + mapping = { + [''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.select_next_item(), + -- Add tab support + [''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.close(), + [''] = cmp.mapping.confirm({ + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }) + }, + formatting = { + format = function(entry, vim_item) + -- fancy icons and a name of kind + vim_item.kind = require("lspkind").presets.default[vim_item.kind] + -- set a name for each source + vim_item.menu = ({ + buffer = "[Buff]", + nvim_lsp = "[LSP]", + luasnip = "[LuaSnip]", + nvim_lua = "[Lua]", + latex_symbols = "[Latex]" + })[entry.source.name] + return vim_item + end + }, + sources = { + {name = 'nvim_lsp'}, + {name = 'nvim_lua'}, + {name = 'path'}, + {name = 'luasnip'}, + {name = 'buffer', keyword_length = 1}, + {name = 'calc' } + }, + experimental = { + -- ghost_text = true, + } + +}) + + + +-- local luasnip = require("luasnip") + +-- local source_mapping = { +-- nvim_lsp = "[LSP]", +-- nvim_lua = "[Lua]", +-- path = "[Path]", +-- buffer = "[Buffer]", +-- luasnip = "[LuaSnip]", +-- nvim_lsp_signature_help = "[LspSignatureHelp]", +-- calc = "[Calc]", +-- } + +-- cmp.setup({ +-- snippet = { +-- expand = function(args) require('luasnip').lsp_expand(args.body) end +-- }, + +-- mapping = { +-- [''] = cmp.mapping.select_prev_item(), +-- [''] = cmp.mapping.select_next_item(), +-- -- Add tab support +-- [''] = cmp.mapping.select_prev_item(), +-- [''] = cmp.mapping.select_next_item(), +-- [''] = cmp.mapping.scroll_docs(-4), +-- [''] = cmp.mapping.scroll_docs(4), +-- [''] = cmp.mapping.complete(), +-- [''] = cmp.mapping.close(), +-- [''] = cmp.mapping.confirm({ +-- behavior = cmp.ConfirmBehavior.Replace, +-- select = true, +-- }) +-- }, + +-- formatting = { +-- format = function(entry, vim_item) +-- vim_item.kind = require("lspkind").presets.default[vim_item.kind] +-- local menu = source_mapping[entry.source.name] +-- vim_item.menu = menu +-- return vim_item +-- end, +-- }, +-- -- Installed sources +-- sources = { +-- -- { name = 'path' }, +-- { name = "nvim_lsp" }, +-- { name = "nvim_lua" }, +-- { name = 'path' }, +-- { name = "luasnip" }, +-- { name = "buffer", keyword_length = 1 }, +-- { name = 'nvim_lsp_signature_help' }, +-- { name = 'calc' }, +-- }, +-- }) diff --git a/nvim/.config/nvim/lua/plugins/dap.lua b/nvim/.config/nvim/lua/plugins/dap.lua new file mode 100644 index 0000000..f49590e --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/dap.lua @@ -0,0 +1,89 @@ +local status_ok, dap = pcall(require, "dap") +if not status_ok then + return +end + +-- Debugpy +dap.adapters.python = { + type = 'executable', + command = 'python', + args = { '-m', 'debugpy.adapter' }, +} + +dap.configurations.python = { + { + type = 'python', + request = 'launch', + name = 'Launch file', + program = '${file}', + pythonPath = function() + local venv_path = vim.fn.getenv 'VIRTUAL_ENVIRONMENT' + if venv_path ~= vim.NIL and venv_path ~= '' then + return venv_path .. '/bin/python' + else + return '/usr/bin/python' + end + end, + }, +} + +-- Neovim Lua +dap.adapters.nlua = function(callback, config) + callback { type = 'server', host = config.host, port = config.port } +end + +dap.configurations.lua = { + { + type = 'nlua', + request = 'attach', + name = 'Attach to running Neovim instance', + host = function() + local value = vim.fn.input 'Host [127.0.0.1]: ' + if value ~= '' then + return value + end + return '127.0.0.1' + end, + port = function() + local val = tonumber(vim.fn.input 'Port: ') + assert(val, 'Please provide a port number') + return val + end, + }, +} + +-- lldb +dap.adapters.lldb = { + type = 'executable', + command = '/usr/bin/lldb-vscode', + name = 'lldb', +} + +dap.configurations.cpp = { + { + name = 'Launch', + type = 'lldb', + request = 'launch', + program = function() + return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') + end, + cwd = '${workspaceFolder}', + stopOnEntry = false, + args = {}, + runInTerminal = false, + }, +} + +dap.configurations.c = dap.configurations.cpp +dap.configurations.rust = dap.configurations.cpp + +vim.cmd [[command! BreakpointToggle lua require('dap').toggle_breakpoint()]] +vim.cmd [[command! Debug lua require('dap').continue()]] +vim.cmd [[command! DapREPL lua require('dap').repl.open()]] + +local tele_status_ok, telescope = pcall(require, "telescope") +if not tele_status_ok then + return +end + +telescope.load_extension('dap') \ No newline at end of file diff --git a/nvim/.config/nvim/lua/plugins/git-blame.lua b/nvim/.config/nvim/lua/plugins/git-blame.lua new file mode 100644 index 0000000..f0bb678 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/git-blame.lua @@ -0,0 +1,3 @@ +vim.g.gitblame_enabled = 0 +vim.g.gitblame_message_template = "" +vim.g.gitblame_highlight_group = "LineNr" \ No newline at end of file diff --git a/nvim/.config/nvim/lua/plugins/git-worktree.lua b/nvim/.config/nvim/lua/plugins/git-worktree.lua new file mode 100644 index 0000000..2bc8892 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/git-worktree.lua @@ -0,0 +1,14 @@ +local status_ok, git_worktree = pcall(require, "git-worktree") +if not status_ok then + return +end + +git_worktree.setup({ +}) + +local status_ok, telescope = pcall(require, "telescope") +if not status_ok then + return +end + +require("telescope").load_extension("git_worktree") \ No newline at end of file diff --git a/nvim/.config/nvim/lua/plugins/gitsigns.lua b/nvim/.config/nvim/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..b3c944a --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/gitsigns.lua @@ -0,0 +1,48 @@ +local status_ok, gitsigns = pcall(require, "gitsigns") +if not status_ok then + return +end + +gitsigns.setup { + signs = { + add = { hl = "GitSignsAdd", text = "▎", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" }, + change = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, + delete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, + topdelete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, + changedelete = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, + }, + signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` + numhl = false, -- Toggle with `:Gitsigns toggle_numhl` + linehl = false, -- Toggle with `:Gitsigns toggle_linehl` + word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` + watch_gitdir = { + interval = 1000, + follow_files = true, + }, + attach_to_untracked = true, + current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` + current_line_blame_opts = { + virt_text = true, + virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' + delay = 1000, + ignore_whitespace = false, + }, + current_line_blame_formatter_opts = { + relative_time = false, + }, + sign_priority = 6, + update_debounce = 100, + status_formatter = nil, -- Use default + max_file_length = 40000, + preview_config = { + -- Options passed to nvim_open_win + border = "rounded", + style = "minimal", + relative = "cursor", + row = 0, + col = 1, + }, + yadm = { + enable = false, + }, +} \ No newline at end of file diff --git a/nvim/.config/nvim/lua/plugins/lsp-installer.lua b/nvim/.config/nvim/lua/plugins/lsp-installer.lua new file mode 100644 index 0000000..199fd37 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/lsp-installer.lua @@ -0,0 +1,124 @@ +local status_ok, lsp_installer = pcall(require, "nvim-lsp-installer") +if not status_ok then + print("Failed to require nvim-lsp-installer") +end + +-- Provide settings first! +lsp_installer.settings { + ui = { + icons = { + server_installed = "✓", + server_pending = "➜", + server_uninstalled = "✗" + } + }, + + -- Limit for the maximum amount of servers to be installed at the same time. Once this limit is reached, any further + -- servers that are requested to be installed will be put in a queue. + max_concurrent_installers = 4 +} + +--------------------------------------------------- +local enhance_server_opts = { + ["eslintls"] = function(opts) + opts.settings = { + format = { + enable = true, + }, + } + end, + ["gopls"] = function(opts) + opts.cmd = { + "gopls", + "serve", + } + opts.settings = { + gopls = { + staticcheck = true, + analyses = { + unusedparams = true, + }, + }, + } + end +} + + +local function make_server_ready(attach) + lsp_installer.on_server_ready(function(server) + -- Specify the default options which we'll use to setup all servers + local opts = { + on_attach = on_attach, + } + if server.name == "rust_analyzer" then + local rustopts = { + tools = { + autoSetHints = true, + hover_with_actions = false, + inlay_hints = { + show_parameter_hints = true, + parameter_hints_prefix = "", + other_hints_prefix = "", + }, + }, + server = vim.tbl_deep_extend("force", server:get_default_options(), opts, { + settings = { + ["rust-analyzer"] = { + completion = { + postfix = { + enable = false + } + }, + checkOnSave = { + command = "clippy" + }, + } + } + }), + } + require("rust-tools").setup(rustopts) + server:attach_buffers() + else + if enhance_server_opts[server.name] then + -- Enhance the default opts with the server-specific ones + enhance_server_opts[server.name](opts) + end + -- This setup() function is exactly the same as lspconfig's setup function (:help lspconfig-quickstart) + server:setup(opts) + end + + vim.cmd [[ do User LspAttachBuffers ]] + end) +end +--------------------------------------------------- + +--------------------------------------------------- +local servers = { + "rust_analyzer", + "tsserver", -- for javascript + "jsonls", -- for json + "texlab", -- for latex + "ltex", + "sqlls", -- for sql + "pylsp", -- for python + "sumneko_lua", -- for lua + "gopls", -- for go + "yamlls", + "bashls", + "dockerls" +} + +-- setup the LS +require "plugins.lspconfig" +make_server_ready(On_attach) -- LSP mappings + +-- install the LS +for _, name in pairs(servers) do + local server_is_found, server = lsp_installer.get_server(name) + if server_is_found then + if not server:is_installed() then + print("Installing " .. name) + server:install() + end + end +end \ No newline at end of file diff --git a/nvim/.config/nvim/lua/plugins/lsp-signature.lua b/nvim/.config/nvim/lua/plugins/lsp-signature.lua new file mode 100644 index 0000000..084913c --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/lsp-signature.lua @@ -0,0 +1,59 @@ +local status_ok, signature = pcall(require, "lsp_signature") +if not status_ok then + return +end + +local icons = require "icons" + +local cfg = { + debug = false, -- set to true to enable debug logging + log_path = "debug_log_file_path", -- debug log path + verbose = false, -- show debug line number + + bind = true, -- This is mandatory, otherwise border config won't get registered. + -- If you want to hook lspsaga or other signature handler, pls set to false + doc_lines = 0, -- will show two lines of comment/doc(if there are more than two lines in doc, will be truncated); + -- set to 0 if you DO NOT want any API comments be shown + -- This setting only take effect in insert mode, it does not affect signature help in normal + -- mode, 10 by default + + floating_window = false, -- show hint in a floating window, set to false for virtual text only mode + + floating_window_above_cur_line = true, -- try to place the floating above the current line when possible Note: + -- will set to true when fully tested, set to false will use whichever side has more space + -- this setting will be helpful if you do not want the PUM and floating win overlap + fix_pos = false, -- set to true, the floating window will not auto-close until finish all parameters + hint_enable = true, -- virtual hint enable + hint_prefix = icons.misc.Squirrel .. " ", -- Panda for parameter + hint_scheme = "Comment", + use_lspsaga = false, -- set to true if you want to use lspsaga popup + hi_parameter = "LspSignatureActiveParameter", -- how your parameter will be highlight + max_height = 12, -- max height of signature floating_window, if content is more than max_height, you can scroll down + -- to view the hiding contents + max_width = 120, -- max_width of signature floating_window, line will be wrapped if exceed max_width + handler_opts = { + border = "rounded", -- double, rounded, single, shadow, none + }, + + always_trigger = false, -- sometime show signature on new line or in middle of parameter can be confusing, set it to false for #58 + + auto_close_after = nil, -- autoclose signature float win after x sec, disabled if nil. + extra_trigger_chars = {}, -- Array of extra characters that will trigger signature completion, e.g., {"(", ","} + zindex = 200, -- by default it will be on top of all floating windows, set to <= 50 send it to bottom + + padding = "", -- character to pad on left and right of signature can be ' ', or '|' etc + + transparency = nil, -- disabled by default, allow floating win transparent value 1~100 + shadow_blend = 36, -- if you using shadow as border use this set the opacity + shadow_guibg = "Black", -- if you using shadow as border use this set the color e.g. 'Green' or '#121315' + timer_interval = 200, -- default timer check interval set to lower value if you want to reduce latency + toggle_key = nil, -- toggle signature on and off in insert mode, e.g. toggle_key = '' +} + +-- recommanded: +signature.setup(cfg) -- no need to specify bufnr if you don't use toggle_key + +-- You can also do this inside lsp on_attach +-- note: on_attach deprecated +-- require("lsp_signature").on_attach(cfg, bufnr) -- no need to specify bufnr if you don't use toggle_key +signature.on_attach(cfg) -- no need to specify bufnr if you don't use toggle_key \ No newline at end of file diff --git a/nvim/.config/nvim/lua/plugins/lspconfig.lua b/nvim/.config/nvim/lua/plugins/lspconfig.lua new file mode 100644 index 0000000..0635ee8 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/lspconfig.lua @@ -0,0 +1,97 @@ +local status_ok, lspconfig = pcall(require, "lspconfig") +if not status_ok then + return +end + +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( + vim.lsp.diagnostic.on_publish_diagnostics, { + underline = true, + signs = true, + update_in_insert = true, + virtual_text = { + true, + spacing = 6, + severity_limit='Error' -- Only show virtual text on error + }, + } +) + +local function config(_config) + return vim.tbl_deep_extend("force", { + capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()), + on_attach = function() + Nnoremap("gd", ":lua vim.lsp.buf.definition()") + Nnoremap("K", ":lua vim.lsp.buf.hover()") + Nnoremap("vws", ":lua vim.lsp.buf.workspace_symbol()") + Nnoremap("vd", ":lua vim.diagnostic.open_float()") + Nnoremap("[d", ":lua vim.lsp.diagnostic.goto_next()") + Nnoremap("]d", ":lua vim.lsp.diagnostic.goto_prev()") + Nnoremap("vca", ":lua vim.lsp.buf.code_action()") + Nnoremap("vrr", ":lua vim.lsp.buf.references()") + Nnoremap("vrn", ":lua vim.lsp.buf.rename()") + Inoremap("", "lua vim.lsp.buf.signature_help()") + end, + }, _config or {}) +end + +lspconfig.tsserver.setup(config()) + +lspconfig.ccls.setup(config()) + +lspconfig.gopls.setup(config({ + cmd = { "gopls", "serve" }, + settings = { + gopls = { + analyses = { + unusedparams = true, + }, + staticcheck = true, + }, + }, +})) + +local rustopts = { + tools = { + autoSetHints = true, + hover_with_actions = true, + runnables = { + use_telescope = true + }, + inlay_hints = { + show_parameter_hints = false, + parameter_hints_prefix = "", + other_hints_prefix = "", + }, + }, + server = { + settings = { + ["rust-analyzer"] = { + cargo = { + allFeatures = "true", + }, + checkOnSave = { + command = "clippy", + }, + } + } + }, +} + +require("rust-tools").setup(rustopts) + +local opts = { + -- whether to highlight the currently hovered symbol + -- disable if your cpu usage is higher than you want it + -- or you just hate the highlight + -- default: true + highlight_hovered_item = true, + + -- whether to show outline guides + -- default: true + show_guides = true, +} + +require("symbols-outline").setup(opts) diff --git a/nvim/.config/nvim/lua/plugins/lspkind.lua b/nvim/.config/nvim/lua/plugins/lspkind.lua new file mode 100644 index 0000000..b33a24a --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/lspkind.lua @@ -0,0 +1,34 @@ +local status_ok, lspkind = pcall(require, "lspkind") +if not status_ok then + return +end + +lspkind.init({ + -- enables text annotations (default: 'default') + -- default symbol map can be either 'default' or 'codicons' for codicon preset (requires vscode-codicons font installed) + preset = 'codicons', + + -- override preset symbols (default: {}) + symbol_map = { + Text = '', + Method = 'ƒ', + Function = '', + Constructor = '', + Variable = '', + Class = '', + Interface = 'ﰮ', + Module = '', + Property = '', + Unit = '', + Value = '', + Enum = '了', + Keyword = '', + Snippet = '﬌', + Color = '', + File = '', + Folder = '', + EnumMember = '', + Constant = '', + Struct = '' + }, +}) \ No newline at end of file diff --git a/nvim/.config/nvim/lua/plugins/lspstatus.lua b/nvim/.config/nvim/lua/plugins/lspstatus.lua new file mode 100644 index 0000000..923209b --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/lspstatus.lua @@ -0,0 +1,13 @@ +local lsp_status = require 'lsp-status' +lsp_status.status() +lsp_status.register_progress() +lsp_status.config({ + indicator_errors = "", + indicator_warnings = "", + indicator_info = "", + indicator_hint = "", + indicator_ok = "", + current_function = true, + update_interval = 100, + status_symbol = ' 🇻', +}) \ No newline at end of file diff --git a/nvim/.config/nvim/lua/plugins/lualine.lua b/nvim/.config/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..74db5b8 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/lualine.lua @@ -0,0 +1,113 @@ +local status_ok, lualine = pcall(require, "lualine") +if not status_ok then + return +end + +local status_gps_ok, gps = pcall(require, "nvim-gps") +if not status_gps_ok then + return +end + +local hide_in_width = function() + return vim.fn.winwidth(0) > 80 +end + +local icons = require 'icons' + +local diagnostics = { + "diagnostics", + sources = { "nvim_diagnostic" }, + sections = { "error", "warn" }, + symbols = { error = icons.diagnostics.Error .. " ", warn = icons.diagnostics.Warning .. " " }, + colored = false, + update_in_insert = false, + always_visible = true, +} + +local diff = { + "diff", + colored = false, + symbols = { added = icons.git.Add .. " ", modified = icons.git.Mod .. " ", removed = icons.git.Remove .. " " }, -- changes diff symbols + cond = hide_in_width, +} + +local mode = { + "mode", + fmt = function(str) + return "-- " .. str .. " --" + end, +} + +local filetype = { + "filetype", + icons_enabled = false, + icon = nil, +} + +local branch = { + "branch", + icons_enabled = true, + icon = "", +} + +local location = { + "location", + padding = 0, +} + +-- cool function for progress +local progress = function() + local current_line = vim.fn.line "." + local total_lines = vim.fn.line "$" + local chars = { "__", "▁▁", "▂▂", "▃▃", "▄▄", "▅▅", "▆▆", "▇▇", "██" } + local line_ratio = current_line / total_lines + local index = math.ceil(line_ratio * #chars) + return chars[index] +end + +local spaces = function() + return "spaces: " .. vim.api.nvim_buf_get_option(0, "shiftwidth") +end + +local nvim_gps = function() + local gps_location = gps.get_location() + if gps_location == "error" then + return "" + else + return gps.get_location() + end +end + +lualine.setup { + options = { + icons_enabled = true, + theme = "vscode", + component_separators = { left = "", right = "" }, + section_separators = { left = "", right = "" }, + disabled_filetypes = { "alpha", "dashboard", "NvimTree", "Outline", "toggleterm" }, + always_divide_middle = true, + }, + sections = { + -- lualine_a = { branch, diagnostics }, + lualine_a = { branch }, + lualine_b = { diagnostics }, + -- lualine_c = { _gps }, + lualine_c = { + { nvim_gps, cond = hide_in_width }, + }, + -- lualine_x = { "encoding", "fileformat", "filetype" }, + lualine_x = { diff, spaces, "encoding", filetype }, + lualine_y = { location }, + lualine_z = { progress }, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {}, + lualine_x = { "location" }, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + extensions = {}, +} \ No newline at end of file diff --git a/nvim/.config/nvim/lua/plugins/luasnip.lua b/nvim/.config/nvim/lua/plugins/luasnip.lua new file mode 100644 index 0000000..962dc24 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/luasnip.lua @@ -0,0 +1,18 @@ +local status_ok, luasnip = pcall(require, "luasnip") +if not status_ok then + return +end + +luasnip.config.set_config({ + history = true, + updateevents = "TextChanged,TextChangedI" +}) + +luasnip.snippets = {all = {}, html = {}} + +luasnip.snippets.javascript = luasnip.snippets.html +luasnip.snippets.javascriptreact = luasnip.snippets.html +luasnip.snippets.typescriptreact = luasnip.snippets.html +require("luasnip.loaders.from_vscode").load({include = {"html"}}) + +require('luasnip.loaders.from_vscode').lazy_load() \ No newline at end of file diff --git a/nvim/.config/nvim/lua/plugins/neogit.lua b/nvim/.config/nvim/lua/plugins/neogit.lua new file mode 100644 index 0000000..ad1f275 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/neogit.lua @@ -0,0 +1,6 @@ +local status_ok, neogit = pcall(require, "neogit") +if not status_ok then + return +end + +neogit.setup {} \ No newline at end of file diff --git a/nvim/.config/nvim/lua/plugins/null-ls.lua b/nvim/.config/nvim/lua/plugins/null-ls.lua new file mode 100644 index 0000000..e3aa45f --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/null-ls.lua @@ -0,0 +1,47 @@ +local status_ok, null_ls = pcall(require, "null-ls") +if not status_ok then + return +end + +local code_actions = null_ls.builtins.code_actions +local diagnostics = null_ls.builtins.diagnostics +local formatting = null_ls.builtins.formatting + +null_ls.setup({ + sources = { + -- Code Actions + code_actions.gitsigns, + -- code_actions.shellcheck, + + -- Diagnostics + -- diagnostics.codespell, + -- diagnostics.luacheck, + -- diagnostics.markdownlint, + -- diagnostics.shellcheck, + + -- Formatting + formatting.prettier, + formatting.black, + formatting.latexindent, + formatting.markdownlint, + formatting.stylua, + formatting.rustfmt.with({ + extra_args = function(params) + local Path = require("plenary.path") + local cargo_toml = Path:new(params.root .. "/" .. "Cargo.toml") + + if cargo_toml:exists() and cargo_toml:is_file() then + for _, line in ipairs(cargo_toml:readlines()) do + local edition = line:match([[^edition%s*=%s*%"(%d+)%"]]) + if edition then + return { "--edition=" .. edition } + end + end + end + -- default edition when we don't find `Cargo.toml` or the `edition` in it. + return { "--edition=2021" } + end, + }), + formatting.shfmt, + }, +}) diff --git a/nvim/.config/nvim/lua/plugins/nvim-tree.lua b/nvim/.config/nvim/lua/plugins/nvim-tree.lua new file mode 100644 index 0000000..2bab234 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/nvim-tree.lua @@ -0,0 +1,111 @@ +local status_ok, nvim_tree = pcall(require, "nvim-tree") +if not status_ok then + return +end + +local config_status_ok, nvim_tree_config = pcall(require, "nvim-tree.config") +if not config_status_ok then + return +end + +local tree_cb = nvim_tree_config.nvim_tree_callback + +vim.g.nvim_tree_respect_buf_cwd = 1 +vim.g.nvim_tree_icons = { + default = "", + symlink = "", + git = { + unstaged = "", + staged = "S", + unmerged = "", + renamed = "➜", + deleted = "", + untracked = "U", + ignored = "◌", + }, + folder = { + default = "", + open = "", + empty = "", + empty_open = "", + symlink = "", + }, +} + +nvim_tree.setup { + disable_netrw = true, + hijack_netrw = true, + open_on_setup = false, + ignore_ft_on_setup = { + "startify", + "dashboard", + "alpha", + }, + auto_close = true, + open_on_tab = false, + hijack_cursor = false, + update_cwd = true, + update_to_buf_dir = { + enable = true, + auto_open = true, + }, + diagnostics = { + enable = true, + icons = { + hint = "", + info = "", + warning = "", + error = "", + }, + }, + update_focused_file = { + enable = true, + update_cwd = true, + ignore_list = {}, + }, + system_open = { + cmd = nil, + args = {}, + }, + filters = { + dotfiles = false, + custom = {}, + }, + git = { + enable = true, + ignore = true, + timeout = 500, + }, + view = { + width = 30, + height = 30, + hide_root_folder = false, + side = "left", + auto_resize = true, + mappings = { + custom_only = false, + list = { + { key = { "l", "", "o" }, cb = tree_cb "edit" }, + { key = "h", cb = tree_cb "close_node" }, + { key = "v", cb = tree_cb "vsplit" }, + }, + }, + number = false, + relativenumber = false, + }, + trash = { + cmd = "trash", + require_confirm = true, + }, + quit_on_open = 0, + git_hl = 1, + disable_window_picker = 0, + root_folder_modifier = ":t", + show_icons = { + git = 1, + folders = 1, + files = 1, + folder_arrows = 1, + tree_width = 30, + }, +} \ No newline at end of file diff --git a/nvim/.config/nvim/lua/plugins/project.lua b/nvim/.config/nvim/lua/plugins/project.lua new file mode 100644 index 0000000..810d2bd --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/project.lua @@ -0,0 +1,13 @@ +local status_ok, project = pcall(require, "project_nvim") +if not status_ok then + return +end + +project.setup {} + +local tele_status_ok, telescope = pcall(require, "telescope") +if not tele_status_ok then + return +end + +telescope.load_extension('projects') \ No newline at end of file diff --git a/nvim/.config/nvim/lua/plugins/renamer.lua b/nvim/.config/nvim/lua/plugins/renamer.lua new file mode 100644 index 0000000..2db1899 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/renamer.lua @@ -0,0 +1,46 @@ +local status_ok, renamer = pcall(require, "renamer") +if not status_ok then + return +end + +vim.api.nvim_set_keymap( + "i", + "", + 'lua require("renamer").rename({empty = true})', + { noremap = true, silent = true } +) +vim.api.nvim_set_keymap( + "n", + "", + 'lua require("renamer").rename({empty = true})', + { noremap = true, silent = true } +) +local mappings_utils = require("renamer.mappings.utils") +renamer.setup({ + -- The popup title, shown if `border` is true + title = "Rename", + -- The padding around the popup content + padding = { + top = 0, + left = 0, + bottom = 0, + right = 0, + }, + -- Whether or not to shown a border around the popup + border = true, + -- The characters which make up the border + border_chars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, + -- Whether or not to highlight the current word references through LSP + show_refs = true, + -- The keymaps available while in the `renamer` buffer. The example below + -- overrides the default values, but you can add others as well. + mappings = { + [""] = mappings_utils.set_cursor_to_start, + [""] = mappings_utils.set_cursor_to_end, + [""] = mappings_utils.set_cursor_to_word_end, + [""] = mappings_utils.set_cursor_to_word_start, + [""] = mappings_utils.clear_line, + [""] = mappings_utils.undo, + [""] = mappings_utils.redo, + }, +}) \ No newline at end of file diff --git a/nvim/.config/nvim/lua/plugins/session_manager.lua b/nvim/.config/nvim/lua/plugins/session_manager.lua new file mode 100644 index 0000000..736e69a --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/session_manager.lua @@ -0,0 +1,25 @@ +local status_ok, session_manager = pcall(require, "session_manager") +if not status_ok then + return +end + +local status_ok, config = pcall(require, "session_manager.config") +if not status_ok then + return +end + +-- local Path = require('plenary.path') +session_manager.setup({ + autoload_mode = config.AutoloadMode.CurrentDir, -- Define what to do when Neovim is started without arguments. Possible values: Disabled, CurrentDir, LastSession + autosave_last_session = false, -- Automatically save last session on exit. +}) + +local tele_status_ok, telescope = pcall(require, "telescope") +if not tele_status_ok then + return +end + +local tele_session_status_ok, telescope = pcall(telescope.load_extension, "sessions") +if not tele_session_status_ok then + return +end \ No newline at end of file diff --git a/nvim/.config/nvim/lua/plugins/telescope.lua b/nvim/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..4376f76 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,55 @@ +local status_ok, telescope = pcall(require, "telescope") +if not status_ok then + return +end + +telescope.setup { + defaults = { + file_ignore_patterns = {"node_modules", ".git", "dist"}, + vimgrep_arguments = { + "rg", + "--color=never", + "--no-heading", + "--with-filename", + "--line-number", + "--column", + "--hidden", + "--iglob", + "!yarn.lock", + "--smart-case", + "-u" + }, + layout_strategy = 'flex', + scroll_strategy = 'cycle', + }, + extensions = { + project = { + base_dirs = { + {path = "~/src", max_depth = 1} + }, + hidden_files = true + }, + fzf = { + fuzzy = true, + override_generic_sorter = true, + override_file_sorter = true, + case_mode = 'smart_case', + }, + }, + pickers = { + find_files = { + find_command = {"rg", "--files", "--hidden"} + }, + lsp_references = { theme = 'dropdown' }, + lsp_code_actions = { theme = 'dropdown' }, + lsp_definitions = { theme = 'dropdown' }, + lsp_implementations = { theme = 'dropdown' }, + buffers = { + sort_lastused = true, + }, + }, +} + +-- Extensions +telescope.load_extension('frecency') +telescope.load_extension('fzf') diff --git a/nvim/.config/nvim/lua/plugins/treesitter.lua b/nvim/.config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..95c1aea --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,14 @@ +local status_ok, treesitter = pcall(require, "nvim-treesitter.configs") +if not status_ok then + return +end + +treesitter.setup { + indent = { + enable = true + }, + highlight = { + enable = true, + additional_vim_regex_highlighting = false + } +} \ No newline at end of file diff --git a/nvim/.config/nvim/lua/plugins/which-key.lua b/nvim/.config/nvim/lua/plugins/which-key.lua new file mode 100644 index 0000000..b30fd4d --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/which-key.lua @@ -0,0 +1,34 @@ +local status_ok, which_key = pcall(require, "which-key") +if not status_ok then + return +end + +local setup = { + plugins = { + spelling = { + enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions + suggestions = 20, -- how many suggestions should be shown in the list? + }, + }, + window = { + border = "rounded", -- none, single, double, shadow + position = "bottom", -- bottom, top + margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left] + padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left] + winblend = 0, + }, + layout = { + height = { min = 4, max = 25 }, -- min and max height of the columns + width = { min = 20, max = 50 }, -- min and max width of the columns + spacing = 3, -- spacing between columns + align = "center", -- align columns left, center or right + }, +} +local opts = { + buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings + silent = true, -- use `silent` when creating keymaps + noremap = true, -- use `noremap` when creating keymaps + nowait = true, -- use `nowait` when creating keymaps +} + +which_key.setup(setup) \ No newline at end of file diff --git a/nvim/.config/nvim/lua/utils.lua b/nvim/.config/nvim/lua/utils.lua new file mode 100644 index 0000000..14c6e62 --- /dev/null +++ b/nvim/.config/nvim/lua/utils.lua @@ -0,0 +1,9 @@ +local M = {} + +function M.map(mode, lhs, rhs, opts) + local options = {noremap = true} + if opts then options = vim.tbl_extend("force", options, opts) end + vim.api.nvim_set_keymap(mode, lhs, rhs, options) +end + +return M \ No newline at end of file diff --git a/nvim/.config/nvim/plugin/packer_compiled.lua b/nvim/.config/nvim/plugin/packer_compiled.lua new file mode 100644 index 0000000..c302f00 --- /dev/null +++ b/nvim/.config/nvim/plugin/packer_compiled.lua @@ -0,0 +1,572 @@ +-- 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 = "/home/tobyv/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/tobyv/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/tobyv/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/tobyv/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua" +local install_cpath_pattern = "/home/tobyv/.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 = { + ["Comment.nvim"] = { + config = { "require('Comment').setup()" }, + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/Comment.nvim", + url = "https://github.com/numToStr/Comment.nvim" + }, + ["DAPInstall.nvim"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/DAPInstall.nvim", + url = "https://github.com/Pocco81/DAPInstall.nvim" + }, + ["FixCursorHold.nvim"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/FixCursorHold.nvim", + url = "https://github.com/antoinemadec/FixCursorHold.nvim" + }, + LuaSnip = { + config = { "require('plugins/luasnip')" }, + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/LuaSnip", + url = "https://github.com/L3MON4D3/LuaSnip" + }, + ["SchemaStore.nvim"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/SchemaStore.nvim", + url = "https://github.com/b0o/SchemaStore.nvim" + }, + ["alpha-nvim"] = { + config = { "require('plugins/alpha')" }, + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/alpha-nvim", + url = "https://github.com/goolord/alpha-nvim" + }, + ["cmp-buffer"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/cmp-buffer", + url = "https://github.com/hrsh7th/cmp-buffer" + }, + ["cmp-calc"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/cmp-calc", + url = "https://github.com/hrsh7th/cmp-calc" + }, + ["cmp-nvim-lsp"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp", + url = "https://github.com/hrsh7th/cmp-nvim-lsp" + }, + ["cmp-nvim-lsp-signature-help"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp-signature-help", + url = "https://github.com/hrsh7th/cmp-nvim-lsp-signature-help" + }, + ["cmp-nvim-lua"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/cmp-nvim-lua", + url = "https://github.com/hrsh7th/cmp-nvim-lua" + }, + ["cmp-path"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/cmp-path", + url = "https://github.com/hrsh7th/cmp-path" + }, + cmp_luasnip = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/cmp_luasnip", + url = "https://github.com/saadparwaiz1/cmp_luasnip" + }, + ["friendly-snippets"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/friendly-snippets", + url = "https://github.com/rafamadriz/friendly-snippets" + }, + ["git-blame.nvim"] = { + config = { "require('plugins/git-blame')" }, + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/git-blame.nvim", + url = "https://github.com/f-person/git-blame.nvim" + }, + ["git-worktree.nvim"] = { + config = { "require('plugins/git-worktree')" }, + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/git-worktree.nvim", + url = "https://github.com/ThePrimeagen/git-worktree.nvim" + }, + ["gitsigns.nvim"] = { + config = { "require('plugins/gitsigns')" }, + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/gitsigns.nvim", + url = "https://github.com/lewis6991/gitsigns.nvim" + }, + harpoon = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/harpoon", + url = "https://github.com/ThePrimeagen/harpoon" + }, + ["impatient.nvim"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/impatient.nvim", + url = "https://github.com/lewis6991/impatient.nvim" + }, + ["indent-blankline.nvim"] = { + config = { "require('plugins/blankline')" }, + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/indent-blankline.nvim", + url = "https://github.com/lukas-reineke/indent-blankline.nvim" + }, + ["lazygit.nvim"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/lazygit.nvim", + url = "https://github.com/kdheepak/lazygit.nvim" + }, + ["lsp_extensions.nvim"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/lsp_extensions.nvim", + url = "https://github.com/nvim-lua/lsp_extensions.nvim" + }, + ["lsp_signature.nvim"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/lsp_signature.nvim", + url = "https://github.com/ray-x/lsp_signature.nvim" + }, + ["lspkind-nvim"] = { + config = { "require('plugins/lspkind')" }, + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/lspkind-nvim", + url = "https://github.com/onsails/lspkind-nvim" + }, + ["lualine.nvim"] = { + config = { "require('plugins/lualine')" }, + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/lualine.nvim", + url = "https://github.com/nvim-lualine/lualine.nvim" + }, + neogit = { + commands = { "Neogit" }, + config = { "require('neogit').setup {disable_commit_confirmation = true, disable_signs = true}" }, + loaded = false, + needs_bufread = true, + only_cond = false, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/opt/neogit", + url = "https://github.com/TimUntersberger/neogit" + }, + ["neovim-session-manager"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/neovim-session-manager", + url = "https://github.com/Shatur/neovim-session-manager" + }, + ["null-ls.nvim"] = { + config = { "require('plugins/null-ls')" }, + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/null-ls.nvim", + url = "https://github.com/jose-elias-alvarez/null-ls.nvim" + }, + ["numb.nvim"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/numb.nvim", + url = "https://github.com/nacro90/numb.nvim" + }, + ["nvim-bufferline.lua"] = { + config = { "require('plugins/bufferline')" }, + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/nvim-bufferline.lua", + url = "https://github.com/akinsho/nvim-bufferline.lua" + }, + ["nvim-cmp"] = { + config = { "require('plugins/cmp')" }, + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/nvim-cmp", + url = "https://github.com/hrsh7th/nvim-cmp" + }, + ["nvim-colorizer.lua"] = { + config = { "require('colorizer').setup {'css', 'javascript', 'vim', 'html'}" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/opt/nvim-colorizer.lua", + url = "https://github.com/norcalli/nvim-colorizer.lua" + }, + ["nvim-dap"] = { + config = { "require('plugins/dap')" }, + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/nvim-dap", + url = "https://github.com/mfussenegger/nvim-dap" + }, + ["nvim-dap-ui"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/nvim-dap-ui", + url = "https://github.com/rcarriga/nvim-dap-ui" + }, + ["nvim-dap-virtual-text"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/nvim-dap-virtual-text", + url = "https://github.com/theHamsta/nvim-dap-virtual-text" + }, + ["nvim-gps"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/nvim-gps", + url = "https://github.com/SmiteshP/nvim-gps" + }, + ["nvim-lsp-installer"] = { + config = { "require('plugins/lsp-installer')" }, + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/nvim-lsp-installer", + url = "https://github.com/williamboman/nvim-lsp-installer" + }, + ["nvim-lspconfig"] = { + config = { "require('plugins/lspconfig')" }, + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/nvim-lspconfig", + url = "https://github.com/neovim/nvim-lspconfig" + }, + ["nvim-nonicons"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/nvim-nonicons", + url = "https://github.com/yamatsum/nvim-nonicons" + }, + ["nvim-notify"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/nvim-notify", + url = "https://github.com/rcarriga/nvim-notify" + }, + ["nvim-spectre"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/nvim-spectre", + url = "https://github.com/windwp/nvim-spectre" + }, + ["nvim-tree.lua"] = { + config = { "require('plugins/nvim-tree')" }, + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/nvim-tree.lua", + url = "https://github.com/kyazdani42/nvim-tree.lua" + }, + ["nvim-treesitter"] = { + config = { "require('plugins/treesitter')" }, + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/nvim-treesitter", + url = "https://github.com/nvim-treesitter/nvim-treesitter" + }, + ["nvim-treesitter-refactor"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/nvim-treesitter-refactor", + url = "https://github.com/nvim-treesitter/nvim-treesitter-refactor" + }, + ["nvim-treesitter-textsubjects"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/nvim-treesitter-textsubjects", + url = "https://github.com/RRethy/nvim-treesitter-textsubjects" + }, + ["nvim-web-devicons"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/nvim-web-devicons", + url = "https://github.com/kyazdani42/nvim-web-devicons" + }, + ["packer.nvim"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/packer.nvim", + url = "https://github.com/wbthomason/packer.nvim" + }, + ["plenary.nvim"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/plenary.nvim", + url = "https://github.com/nvim-lua/plenary.nvim" + }, + ["presence.nvim"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/presence.nvim", + url = "https://github.com/andweeb/presence.nvim" + }, + ["project.nvim"] = { + config = { "require('plugins/project')" }, + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/project.nvim", + url = "https://github.com/ahmedkhalf/project.nvim" + }, + ["refactoring.nvim"] = { + loaded = false, + needs_bufread = false, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/opt/refactoring.nvim", + url = "https://github.com/ThePrimeagen/refactoring.nvim" + }, + ["renamer.nvim"] = { + config = { "require('plugins/renamer')" }, + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/renamer.nvim", + url = "https://github.com/filipdutescu/renamer.nvim" + }, + ripgrep = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/ripgrep", + url = "https://github.com/BurntSushi/ripgrep" + }, + ["rust-tools.nvim"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/rust-tools.nvim", + url = "https://github.com/simrat39/rust-tools.nvim" + }, + ["sqlite.lua"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/sqlite.lua", + url = "https://github.com/tami5/sqlite.lua" + }, + ["symbols-outline.nvim"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/symbols-outline.nvim", + url = "https://github.com/simrat39/symbols-outline.nvim" + }, + ["telescope-dap.nvim"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/telescope-dap.nvim", + url = "https://github.com/nvim-telescope/telescope-dap.nvim" + }, + ["telescope-frecency.nvim"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/telescope-frecency.nvim", + url = "https://github.com/nvim-telescope/telescope-frecency.nvim" + }, + ["telescope-fzf-native.nvim"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/telescope-fzf-native.nvim", + url = "https://github.com/nvim-telescope/telescope-fzf-native.nvim" + }, + ["telescope.nvim"] = { + config = { "require('plugins/telescope')" }, + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/telescope.nvim", + url = "https://github.com/nvim-telescope/telescope.nvim" + }, + ["trouble.nvim"] = { + commands = { "TroubleToggle" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/opt/trouble.nvim", + url = "https://github.com/folke/trouble.nvim" + }, + undotree = { + commands = { "UndotreeToggle" }, + config = { "vim.g.undotree_SetFocusWhenToggle = 1" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/opt/undotree", + url = "https://github.com/mbbill/undotree" + }, + ["vim-bbye"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/vim-bbye", + url = "https://github.com/moll/vim-bbye" + }, + ["vim-dispatch"] = { + commands = { "Dispatch", "Make", "Focus", "Start" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/opt/vim-dispatch", + url = "https://github.com/tpope/vim-dispatch" + }, + ["vim-eunuch"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/vim-eunuch", + url = "https://github.com/tpope/vim-eunuch" + }, + ["vim-startuptime"] = { + commands = { "StartupTime" }, + config = { "vim.g.startuptime_tries = 3" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/opt/vim-startuptime", + url = "https://github.com/dstein64/vim-startuptime" + }, + ["vscode.nvim"] = { + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/vscode.nvim", + url = "https://github.com/Mofiqul/vscode.nvim" + }, + ["which-key.nvim"] = { + config = { "require('plugins/which-key')" }, + loaded = true, + path = "/home/tobyv/.local/share/nvim/site/pack/packer/start/which-key.nvim", + url = "https://github.com/folke/which-key.nvim" + } +} + +time([[Defining packer_plugins]], false) +-- Config for: indent-blankline.nvim +time([[Config for indent-blankline.nvim]], true) +require('plugins/blankline') +time([[Config for indent-blankline.nvim]], false) +-- Config for: nvim-bufferline.lua +time([[Config for nvim-bufferline.lua]], true) +require('plugins/bufferline') +time([[Config for nvim-bufferline.lua]], false) +-- Config for: nvim-cmp +time([[Config for nvim-cmp]], true) +require('plugins/cmp') +time([[Config for nvim-cmp]], false) +-- Config for: nvim-tree.lua +time([[Config for nvim-tree.lua]], true) +require('plugins/nvim-tree') +time([[Config for nvim-tree.lua]], false) +-- Config for: Comment.nvim +time([[Config for Comment.nvim]], true) +require('Comment').setup() +time([[Config for Comment.nvim]], false) +-- Config for: nvim-treesitter +time([[Config for nvim-treesitter]], true) +require('plugins/treesitter') +time([[Config for nvim-treesitter]], false) +-- Config for: nvim-dap +time([[Config for nvim-dap]], true) +require('plugins/dap') +time([[Config for nvim-dap]], false) +-- Config for: renamer.nvim +time([[Config for renamer.nvim]], true) +require('plugins/renamer') +time([[Config for renamer.nvim]], false) +-- Config for: lspkind-nvim +time([[Config for lspkind-nvim]], true) +require('plugins/lspkind') +time([[Config for lspkind-nvim]], false) +-- Config for: which-key.nvim +time([[Config for which-key.nvim]], true) +require('plugins/which-key') +time([[Config for which-key.nvim]], false) +-- Config for: lualine.nvim +time([[Config for lualine.nvim]], true) +require('plugins/lualine') +time([[Config for lualine.nvim]], false) +-- Config for: LuaSnip +time([[Config for LuaSnip]], true) +require('plugins/luasnip') +time([[Config for LuaSnip]], false) +-- Config for: git-blame.nvim +time([[Config for git-blame.nvim]], true) +require('plugins/git-blame') +time([[Config for git-blame.nvim]], false) +-- Config for: git-worktree.nvim +time([[Config for git-worktree.nvim]], true) +require('plugins/git-worktree') +time([[Config for git-worktree.nvim]], false) +-- Config for: telescope.nvim +time([[Config for telescope.nvim]], true) +require('plugins/telescope') +time([[Config for telescope.nvim]], false) +-- Config for: nvim-lsp-installer +time([[Config for nvim-lsp-installer]], true) +require('plugins/lsp-installer') +time([[Config for nvim-lsp-installer]], false) +-- Config for: gitsigns.nvim +time([[Config for gitsigns.nvim]], true) +require('plugins/gitsigns') +time([[Config for gitsigns.nvim]], false) +-- Config for: nvim-lspconfig +time([[Config for nvim-lspconfig]], true) +require('plugins/lspconfig') +time([[Config for nvim-lspconfig]], false) +-- Config for: null-ls.nvim +time([[Config for null-ls.nvim]], true) +require('plugins/null-ls') +time([[Config for null-ls.nvim]], false) +-- Config for: alpha-nvim +time([[Config for alpha-nvim]], true) +require('plugins/alpha') +time([[Config for alpha-nvim]], false) +-- Config for: project.nvim +time([[Config for project.nvim]], true) +require('plugins/project') +time([[Config for project.nvim]], false) + +-- Command lazy-loads +time([[Defining lazy-load commands]], true) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Dispatch lua require("packer.load")({'vim-dispatch'}, { cmd = "Dispatch", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Make lua require("packer.load")({'vim-dispatch'}, { cmd = "Make", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file UndotreeToggle lua require("packer.load")({'undotree'}, { cmd = "UndotreeToggle", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Start lua require("packer.load")({'vim-dispatch'}, { cmd = "Start", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Neogit lua require("packer.load")({'neogit'}, { cmd = "Neogit", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file StartupTime lua require("packer.load")({'vim-startuptime'}, { cmd = "StartupTime", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Focus lua require("packer.load")({'vim-dispatch'}, { cmd = "Focus", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TroubleToggle lua require("packer.load")({'trouble.nvim'}, { cmd = "TroubleToggle", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +time([[Defining lazy-load commands]], false) + +vim.cmd [[augroup packer_load_aucmds]] +vim.cmd [[au!]] + -- Filetype lazy-loads +time([[Defining lazy-load filetype autocommands]], true) +vim.cmd [[au FileType html ++once lua require("packer.load")({'nvim-colorizer.lua'}, { ft = "html" }, _G.packer_plugins)]] +vim.cmd [[au FileType vim ++once lua require("packer.load")({'nvim-colorizer.lua'}, { ft = "vim" }, _G.packer_plugins)]] +vim.cmd [[au FileType css ++once lua require("packer.load")({'nvim-colorizer.lua'}, { ft = "css" }, _G.packer_plugins)]] +vim.cmd [[au FileType javascript ++once lua require("packer.load")({'nvim-colorizer.lua'}, { ft = "javascript" }, _G.packer_plugins)]] +time([[Defining lazy-load filetype autocommands]], false) +vim.cmd("augroup END") +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 -- cgit v1.2.3-70-g09d2