diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/_cmp.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/_cmp.lua index f7dbf0cf..9c666cd8 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/_cmp.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/configs/_cmp.lua @@ -1,49 +1,53 @@ -local cmp = require('cmp') -local types = require('cmp.types') -local str = require('cmp.utils.str') +local loaded, cmp = pcall(require, "cmp") +if not loaded then + return +end + +local types = require("cmp.types") +local str = require("cmp.utils.str") local compare = cmp.config.compare -local luasnip = require('luasnip') +local luasnip = require("luasnip") local kind_icons = { - Text = '', - Method = '', - Function = '', - Constructor = '', - Field = '', - Variable = '', - Class = 'ﴯ', - Interface = '', - Module = '', - Property = 'ﰠ', - Unit = '', - Value = '', - Enum = '', - Keyword = '', - Snippet = '', - Color = '', - File = '', - Reference = '', - Folder = '', - EnumMember = '', - Constant = '', - Struct = '', - Event = '', - Operator = '', - TypeParameter = '', + Text = "", + Method = "", + Function = "", + Constructor = "", + Field = "", + Variable = "", + Class = "ﴯ", + Interface = "", + Module = "", + Property = "ﰠ", + Unit = "", + Value = "", + Enum = "", + Keyword = "", + Snippet = "", + Color = "", + File = "", + Reference = "", + Folder = "", + EnumMember = "", + Constant = "", + Struct = "", + Event = "", + Operator = "", + TypeParameter = "", } -- Load Snippets -require('luasnip.loaders.from_vscode').lazy_load() +require("luasnip.loaders.from_vscode").lazy_load() local border = { - { '╭', 'CmpBorder' }, - { '─', 'CmpBorder' }, - { '╮', 'CmpBorder' }, - { '│', 'CmpBorder' }, - { '╯', 'CmpBorder' }, - { '─', 'CmpBorder' }, - { '╰', 'CmpBorder' }, - { '│', 'CmpBorder' }, + { "╭", "CmpBorder" }, + { "─", "CmpBorder" }, + { "╮", "CmpBorder" }, + { "│", "CmpBorder" }, + { "╯", "CmpBorder" }, + { "─", "CmpBorder" }, + { "╰", "CmpBorder" }, + { "│", "CmpBorder" }, } cmp.setup({ @@ -65,32 +69,33 @@ cmp.setup({ local max = 50 if string.len(word) >= max then local before = string.sub(word, 1, math.floor((max - 3) / 2)) - word = before .. '...' + word = before .. "..." end - if entry.completion_item.insertTextFormat == types.lsp.InsertTextFormat.Snippet - and string.sub(vim_item.abbr, -1, -1) == '~' + if + entry.completion_item.insertTextFormat == types.lsp.InsertTextFormat.Snippet + and string.sub(vim_item.abbr, -1, -1) == "~" then - word = word .. '~' + word = word .. "~" end vim_item.abbr = word -- Kind icons - vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind + vim_item.kind = string.format("%s %s", kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind -- Source vim_item.menu = ({ - fuzzy_buffer = '[Buffer]', - nvim_lsp = '[Lsp]', - luasnip = '[LuaSnip]', - path = '[Path]', - calc = '[Calculator]', - neorg = '[Neorg]', - emoji = '[Emoji]', - zsh = '[Zsh]', - crates = '[Crates]', - cmdline_history = '[Cmd History]', - rg = '[Ripgrep]', - npm = '[Npm],', - conventionalcommits = '[Commit]', + fuzzy_buffer = "[Buffer]", + nvim_lsp = "[Lsp]", + luasnip = "[LuaSnip]", + path = "[Path]", + calc = "[Calculator]", + neorg = "[Neorg]", + emoji = "[Emoji]", + zsh = "[Zsh]", + crates = "[Crates]", + cmdline_history = "[Cmd History]", + rg = "[Ripgrep]", + npm = "[Npm],", + conventionalcommits = "[Commit]", })[entry.source.name] return vim_item end, @@ -110,41 +115,41 @@ cmp.setup({ snippet = { -- REQUIRED - you must specify a snippet engine expand = function(args) - require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + require("luasnip").lsp_expand(args.body) -- For `luasnip` users. end, }, mapping = { - [''] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }), - [''] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }), - [''] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }), - [''] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `` mapping. - [''] = cmp.mapping({ + [""] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), + [""] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `` mapping. + [""] = cmp.mapping({ i = cmp.mapping.abort(), c = cmp.mapping.close(), }), - [''] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - [''] = cmp.mapping(function(fallback) + [""] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + [""] = cmp.mapping(function(fallback) if luasnip.expand_or_jumpable() then luasnip.expand_or_jump() else fallback() end - end, { 'i', 's' }), - [''] = cmp.mapping(function(fallback) + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) if luasnip.jumpable(-1) then luasnip.jump(-1) else fallback() end - end, { 'i', 's' }), - [''] = cmp.mapping(function(fallback) + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() else fallback() end - end, { 'i', 's' }), - [''] = cmp.mapping(function(fallback) + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_prev_item() elseif luasnip.jumpable(-1) then @@ -152,21 +157,21 @@ cmp.setup({ else fallback() end - end, { 'i', 's' }), + end, { "i", "s" }), }, sources = cmp.config.sources({ - { name = 'nvim_lsp', priority = 10 }, - { name = 'luasnip', priority = 9 }, -- For luasnip users. - { name = 'fuzzy_buffer', priority = 8 }, - { name = 'rg', priority = 7 }, - { name = 'path', priority = 6 }, - { name = 'zsh', priority = 5 }, - { name = 'emoji', keyword_length = 2 }, - { name = 'neorg' }, - { name = 'calc' }, - { name = 'npm', keyword_length = 2 }, + { name = "nvim_lsp", priority = 10 }, + { name = "luasnip", priority = 9 }, -- For luasnip users. + { name = "fuzzy_buffer", priority = 8 }, + { name = "rg", priority = 7 }, + { name = "path", priority = 6 }, + { name = "zsh", priority = 5 }, + { name = "emoji", keyword_length = 2 }, + { name = "neorg" }, + { name = "calc" }, + { name = "npm", keyword_length = 2 }, { - name = 'dictionary', + name = "dictionary", keyword_length = 2, }, }), @@ -176,7 +181,7 @@ cmp.setup({ compare.offset, compare.recently_used, compare.exact, - require('cmp_fuzzy_buffer.compare'), + require("cmp_fuzzy_buffer.compare"), compare.kind, compare.sort_text, compare.length, @@ -186,55 +191,55 @@ cmp.setup({ }) -- Git Commit Completions -cmp.setup.filetype('gitcommit', { +cmp.setup.filetype("gitcommit", { sources = cmp.config.sources({ - { name = 'conventionalcommits', priority = 20 }, + { name = "conventionalcommits", priority = 20 }, }), }) -cmp.setup.filetype('NeogitCommitMesssage', { +cmp.setup.filetype("NeogitCommitMesssage", { sources = cmp.config.sources({ - { name = 'conventionalcommits', priority = 20 }, + { name = "conventionalcommits", priority = 20 }, }), }) -cmp.setup.filetype('toml', { +cmp.setup.filetype("toml", { sources = cmp.config.sources({ - { name = 'crates' }, + { name = "crates" }, }), }) -- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). -cmp.setup.cmdline('/', { +cmp.setup.cmdline("/", { mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({ - { name = 'fuzzy_buffer' }, - { name = 'cmdline_history' }, + { name = "fuzzy_buffer" }, + { name = "cmdline_history" }, }), }) -cmp.setup.cmdline('?', { +cmp.setup.cmdline("?", { mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({ - { name = 'fuzzy_buffer' }, - { name = 'cmdline_history' }, + { name = "fuzzy_buffer" }, + { name = "cmdline_history" }, }), }) -cmp.setup.cmdline('@', { +cmp.setup.cmdline("@", { mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({ - { name = 'fuzzy_buffer' }, - { name = 'cmdline_history' }, + { name = "fuzzy_buffer" }, + { name = "cmdline_history" }, }), }) -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). -cmp.setup.cmdline(':', { +cmp.setup.cmdline(":", { mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({ - { name = 'path' }, - { name = 'cmdline' }, - { name = 'cmdline_history' }, + { name = "path" }, + { name = "cmdline" }, + { name = "cmdline_history" }, }), }) diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/_dap.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/_dap.lua index 3e91509d..38cf708d 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/_dap.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/configs/_dap.lua @@ -1,41 +1,44 @@ -local dap = require('dap') -local async = require('plenary.async') +local loaded, dap = pcall(require, "dap") +if not loaded then + return +end +local async = require("plenary.async") --- Gets a path for a given program in the environment ---@param program @The string of a program in the PATH ---@return @The full path to the program if found, or nil if not local function get_program_path(program) - local home = os.getenv('HOME') - local program_path = home .. '/.local/share/nvim/mason/packages/' .. program .. '/' .. program + local home = os.getenv("HOME") + local program_path = home .. "/.local/share/nvim/mason/packages/" .. program .. "/" .. program return program_path end -local lldb_path = get_program_path('lldb-vscode') +local lldb_path = get_program_path("lldb-vscode") -- Adapaters dap.adapters.lldb = { - type = 'executable', + type = "executable", command = lldb_path, - name = 'lldb', + name = "lldb", } dap.adapters.coreclr = { - type = 'executable', - command = get_program_path('netcoredbg'), - args = { '--interpreter=vscode' }, + type = "executable", + command = get_program_path("netcoredbg"), + args = { "--interpreter=vscode" }, } -- configurations dap.configurations.cpp = { { - name = 'Launch', - type = 'lldb', - request = 'launch', + name = "Launch", + type = "lldb", + request = "launch", program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') + return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file") end, - cwd = '${workspaceFolder}', + cwd = "${workspaceFolder}", stopOnEntry = false, - targetArchitecture = 'arm64', + targetArchitecture = "arm64", args = {}, -- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting: @@ -57,11 +60,11 @@ dap.configurations.rust = dap.configurations.cpp dap.configurations.cs = { { - type = 'coreclr', - name = 'launch - netcoredbg', - request = 'launch', + type = "coreclr", + name = "launch - netcoredbg", + request = "launch", program = function() - return vim.fn.input('Path to dll: ', vim.fn.getcwd() .. '/bin/Debug/', 'file') + return vim.fn.input("Path to dll: ", vim.fn.getcwd() .. "/bin/Debug/", "file") end, }, } diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/_neoclip.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/_neoclip.lua index 1aaf7f23..3bebdd32 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/_neoclip.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/configs/_neoclip.lua @@ -1,3 +1,7 @@ -require('neoclip').setup({ +local neoclip = pcall(require, "neoclip") +if not neoclip then + return +end +neoclip.setup({ enable_persistent_history = true, }) diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/_neorg.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/_neorg.lua index 13782bcf..3787e435 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/_neorg.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/configs/_neorg.lua @@ -1,49 +1,52 @@ -local neorg = require('neorg') +local loaded, neorg = pcall(require, "neorg") +if not loaded then + return +end neorg.setup({ load = { - ['core.defaults'] = {}, - ['core.norg.concealer'] = {}, - ['core.norg.esupports.metagen'] = { + ["core.defaults"] = {}, + ["core.norg.concealer"] = {}, + ["core.norg.esupports.metagen"] = { config = { - type = 'auto', + type = "auto", }, }, - ['core.integrations.nvim-cmp'] = { + ["core.integrations.nvim-cmp"] = { config = {}, }, - ['core.norg.completion'] = { + ["core.norg.completion"] = { config = { - engine = 'nvim-cmp', + engine = "nvim-cmp", }, }, - ['core.keybinds'] = { + ["core.keybinds"] = { config = { default_keybinds = true, -- norg_leader = "-" }, }, - ['core.norg.dirman'] = { + ["core.norg.dirman"] = { config = { workspaces = { - default = '~/.notes', -- Format: = + default = "~/.notes", -- Format: = }, autochdir = true, -- Automatically change the directory to the current workspace's root every time - index = 'index.norg', -- The name of the main (root) .norg file - last_workspace = vim.fn.stdpath('cache') .. '/neorg_last_workspace.txt', -- The location to write and read the workspace cache file + index = "index.norg", -- The name of the main (root) .norg file + last_workspace = vim.fn.stdpath("cache") .. "/neorg_last_workspace.txt", -- The location to write and read the workspace cache file }, }, - ['core.integrations.telescope'] = {}, - ['core.norg.qol.toc'] = {}, - ['core.gtd.base'] = { + ["core.integrations.telescope"] = {}, + ["core.norg.qol.toc"] = {}, + ["core.gtd.base"] = { config = { - workspace = 'default', + workspace = "default", }, }, - ['core.gtd.ui'] = { + ["core.gtd.ui"] = { config = {}, }, - ['core.gtd.helpers'] = { + ["core.gtd.helpers"] = { config = {}, }, }, diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/_stabilize.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/_stabilize.lua index c3c6b362..a34a3bdf 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/_stabilize.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/configs/_stabilize.lua @@ -1,18 +1,22 @@ -require('stabilize').setup({ +local loaded, stabilize = pcall(require, "stabilize") +if not loaded then + return +end +stabilize.setup({ -- stabilize window even when current cursor position will be hidden behind new window force = true, -- set context mark to register on force event which can be jumped to with ' forcemark = nil, -- do not manage windows matching these file/buftypes ignore = { - filetype = { 'packer', 'Dashboard', 'Trouble', 'TelescopePrompt' }, + filetype = { "packer", "Dashboard", "Trouble", "TelescopePrompt" }, buftype = { - 'packer', - 'Dashboard', - 'terminal', - 'quickfix', - 'loclist', - 'LspInstall', + "packer", + "Dashboard", + "terminal", + "quickfix", + "loclist", + "LspInstall", }, }, -- comma-separated list of autocmds that wil trigger the plugins window restore function diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/_windline.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/_windline.lua deleted file mode 100755 index 25db6767..00000000 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/_windline.lua +++ /dev/null @@ -1,7 +0,0 @@ --- Load Animations -require('wlanimation') --- Load a line (these include setup) -require('wlsample.bubble2') - --- In the future I may want to implement --- my own, for now much too lazy for that diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/alpha.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/alpha.lua index d88f95fc..9c2c0f64 100644 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/alpha.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/configs/alpha.lua @@ -1,79 +1,82 @@ -local alpha = require('alpha') -local startify = require('alpha.themes.startify') -local dashboard = require('alpha.themes.dashboard') +local loaded, alpha = pcall(require, "alpha") +if not loaded then + return +end +local startify = require("alpha.themes.startify") +local dashboard = require("alpha.themes.dashboard") -- Set header local header = { - type = 'text', + type = "text", val = { - ' ', - ' ', - ' ', - ' ⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣿⣶⣿⣦⣼⣆ ', - ' ⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦ ', - ' ⠈⢿⣿⣟⠦ ⣾⣿⣿⣷ ⠻⠿⢿⣿⣧⣄ ', - ' ⣸⣿⣿⢧ ⢻⠻⣿⣿⣷⣄⣀⠄⠢⣀⡀⠈⠙⠿⠄ ', - ' ⢠⣿⣿⣿⠈ ⣻⣿⣿⣿⣿⣿⣿⣿⣛⣳⣤⣀⣀ ', - ' ⢠⣧⣶⣥⡤⢄ ⣸⣿⣿⠘ ⢀⣴⣿⣿⡿⠛⣿⣿⣧⠈⢿⠿⠟⠛⠻⠿⠄ ', - ' ⣰⣿⣿⠛⠻⣿⣿⡦⢹⣿⣷ ⢊⣿⣿⡏ ⢸⣿⣿⡇ ⢀⣠⣄⣾⠄ ', - ' ⣠⣿⠿⠛ ⢀⣿⣿⣷⠘⢿⣿⣦⡀ ⢸⢿⣿⣿⣄ ⣸⣿⣿⡇⣪⣿⡿⠿⣿⣷⡄ ', - ' ⠙⠃ ⣼⣿⡟ ⠈⠻⣿⣿⣦⣌⡇⠻⣿⣿⣷⣿⣿⣿ ⣿⣿⡇ ⠛⠻⢷⣄ ', - ' ⢻⣿⣿⣄ ⠈⠻⣿⣿⣿⣷⣿⣿⣿⣿⣿⡟ ⠫⢿⣿⡆ ', - ' ⠻⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⡟⢀⣀⣤⣾⡿⠃ ', - ' ', + " ", + " ", + " ", + " ⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣿⣶⣿⣦⣼⣆ ", + " ⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦ ", + " ⠈⢿⣿⣟⠦ ⣾⣿⣿⣷ ⠻⠿⢿⣿⣧⣄ ", + " ⣸⣿⣿⢧ ⢻⠻⣿⣿⣷⣄⣀⠄⠢⣀⡀⠈⠙⠿⠄ ", + " ⢠⣿⣿⣿⠈ ⣻⣿⣿⣿⣿⣿⣿⣿⣛⣳⣤⣀⣀ ", + " ⢠⣧⣶⣥⡤⢄ ⣸⣿⣿⠘ ⢀⣴⣿⣿⡿⠛⣿⣿⣧⠈⢿⠿⠟⠛⠻⠿⠄ ", + " ⣰⣿⣿⠛⠻⣿⣿⡦⢹⣿⣷ ⢊⣿⣿⡏ ⢸⣿⣿⡇ ⢀⣠⣄⣾⠄ ", + " ⣠⣿⠿⠛ ⢀⣿⣿⣷⠘⢿⣿⣦⡀ ⢸⢿⣿⣿⣄ ⣸⣿⣿⡇⣪⣿⡿⠿⣿⣷⡄ ", + " ⠙⠃ ⣼⣿⡟ ⠈⠻⣿⣿⣦⣌⡇⠻⣿⣿⣷⣿⣿⣿ ⣿⣿⡇ ⠛⠻⢷⣄ ", + " ⢻⣿⣿⣄ ⠈⠻⣿⣿⣿⣷⣿⣿⣿⣿⣿⡟ ⠫⢿⣿⡆ ", + " ⠻⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⡟⢀⣀⣤⣾⡿⠃ ", + " ", }, opts = { - position = 'center', - hl = 'Function', + position = "center", + hl = "Function", }, } -- Subheader, plugin count local get_plugins = function() - local num_plugins_loaded = #vim.fn.globpath(vim.fn.stdpath('data') .. '/site/pack/packer/start', '*', 0, 1) + local num_plugins_loaded = #vim.fn.globpath(vim.fn.stdpath("data") .. "/site/pack/packer/start", "*", 0, 1) local num_plugins_total = #vim.tbl_keys(packer_plugins) if num_plugins_total <= 1 then - return num_plugins_loaded .. ' / ' .. num_plugins_total .. ' plugin  loaded' + return num_plugins_loaded .. " / " .. num_plugins_total .. " plugin  loaded" else - return num_plugins_loaded .. ' / ' .. num_plugins_total .. ' plugins  loaded' + return num_plugins_loaded .. " / " .. num_plugins_total .. " plugins  loaded" end end local plugin_count = { - type = 'text', + type = "text", val = { get_plugins(), }, opts = { - hl = 'Comment', - position = 'center', + hl = "Comment", + position = "center", }, } -- Menu local button = function(sc, txt, keybind) - local sc_ = sc:gsub('%s', ''):gsub('SPC', '') + local sc_ = sc:gsub("%s", ""):gsub("SPC", "") local opts = { - position = 'center', + position = "center", text = txt, shortcut = sc, cursor = 4, width = 30, - align_shortcut = 'right', - hl_shortcut = 'Number', - hl = 'Function', + align_shortcut = "right", + hl_shortcut = "Number", + hl = "Function", } if keybind then - opts.keymap = { 'n', sc_, keybind, { noremap = true, silent = true } } + opts.keymap = { "n", sc_, keybind, { noremap = true, silent = true } } end return { - type = 'button', + type = "button", val = txt, on_press = function() local key = vim.api.nvim_replace_termcodes(sc_, true, false, true) - vim.api.nvim_feedkeys(key, 'normal', false) + vim.api.nvim_feedkeys(key, "normal", false) end, opts = opts, } @@ -81,14 +84,14 @@ end -- Set menu local buttons = { - type = 'group', + type = "group", val = { - button('e', ' New File', ':ene startinsert '), - button('f', ' Find File', ':Telescope find_files'), - button('r', ' Recent', ':Telescope oldfiles'), - button('s', ' Settings', ':e ~/.config/nvim/'), - button('u', ' Update Plugins', ':PackerSync'), - button('q', ' Quit', ':qa'), + button("e", " New File", ":ene startinsert "), + button("f", " Find File", ":Telescope find_files"), + button("r", " Recent", ":Telescope oldfiles"), + button("s", " Settings", ":e ~/.config/nvim/"), + button("u", " Update Plugins", ":PackerSync"), + button("q", " Quit", ":qa"), }, opts = { spacing = 0, @@ -97,16 +100,16 @@ local buttons = { -- Footer 2, fortune local fortune = { - type = 'text', - val = require('alpha.fortune')(), + type = "text", + val = require("alpha.fortune")(), opts = { - position = 'center', - hl = 'Comment', + position = "center", + hl = "Comment", }, } local padding = function() - return { type = 'padding', val = 4 } + return { type = "padding", val = 4 } end local opts = { layout = { @@ -126,8 +129,8 @@ local opts = { -- Send config to alpha alpha.setup(opts) -vim.api.nvim_create_autocmd('FileType', { - pattern = 'alpha', +vim.api.nvim_create_autocmd("FileType", { + pattern = "alpha", callback = function() vim.opt_local.cursorline = false end, diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/bufferline.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/bufferline.lua index abd50440..1a89c22c 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/bufferline.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/configs/bufferline.lua @@ -1,17 +1,20 @@ -local bufferline = require('bufferline') +local loaded, bufferline = pcall(require, "bufferline") +if not loaded then + return +end bufferline.setup({ options = { numbers = function(opts) - return string.format('%s', opts.id) + return string.format("%s", opts.id) end, - diagnostics = 'nvim_lsp', + diagnostics = "nvim_lsp", offsets = { { - filetype = 'NvimTree', - text = 'File Explorer', - highlight = 'Directory', - text_align = 'left', + filetype = "NvimTree", + text = "File Explorer", + highlight = "Directory", + text_align = "left", }, }, }, diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/coq.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/coq.lua deleted file mode 100755 index 3b0e0290..00000000 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/coq.lua +++ /dev/null @@ -1,10 +0,0 @@ --- Alias for vim.g -local g = vim.g - --- Run COQ on open -g.coq_settings = { - auto_start = 'shut-up', - limits = { - completion_manual_timeout = 2000, - }, -} diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/dap-ui.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/dap-ui.lua index 5c0df7e9..af4bc066 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/dap-ui.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/configs/dap-ui.lua @@ -1,9 +1,13 @@ local fn = vim.fn -require('dapui').setup({}) +local loaded, dapui = pcall(require, "dapui") +if not loaded then + return +end +dapui.setup({}) -fn.sign_define('DapBreakpoint', { text = '● ', texthl = 'DiagnosticSignError', linehl = '', numhl = '' }) -fn.sign_define('DapBreakpointCondition', { text = '● ', texthl = 'DiagnosticSignWarn', linehl = '', numhl = '' }) -fn.sign_define('DapLogPoint', { text = '● ', texthl = 'DiagnosticSignInfo', linehl = '', numhl = '' }) -fn.sign_define('DapStopped', { text = '→ ', texthl = 'DiagnosticSignWarn', linehl = '', numhl = '' }) -fn.sign_define('DapBreakpointReject', { text = '●', texthl = 'DiagnosticSignHint', linehl = '', numhl = '' }) +fn.sign_define("DapBreakpoint", { text = "● ", texthl = "DiagnosticSignError", linehl = "", numhl = "" }) +fn.sign_define("DapBreakpointCondition", { text = "● ", texthl = "DiagnosticSignWarn", linehl = "", numhl = "" }) +fn.sign_define("DapLogPoint", { text = "● ", texthl = "DiagnosticSignInfo", linehl = "", numhl = "" }) +fn.sign_define("DapStopped", { text = "→ ", texthl = "DiagnosticSignWarn", linehl = "", numhl = "" }) +fn.sign_define("DapBreakpointReject", { text = "●", texthl = "DiagnosticSignHint", linehl = "", numhl = "" }) diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/diag-scrollbar.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/diag-scrollbar.lua index aa479f3c..519e645d 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/diag-scrollbar.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/configs/diag-scrollbar.lua @@ -1,5 +1,13 @@ -local colors = require('tokyonight.colors').setup() -require('scrollbar').setup({ +local loaded, colors = pcall(require, "kanagawa.colors") +if not loaded then + return +end +local loaded, scrollbar = pcall(require, "scrollbar") +if not loaded then + return +end + +scrollbar.setup({ handle = { color = colors.bg_highlight, }, diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/fidget-spinner.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/fidget-spinner.lua index 0c1fb887..be07041f 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/fidget-spinner.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/configs/fidget-spinner.lua @@ -1,8 +1,11 @@ -local fidget = require('fidget') +local loaded, fidget = pcall(require, "fidget") +if not loaded then + return +end fidget.setup({ text = { - spinner = 'dots', + spinner = "dots", }, window = { blend = 0, diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/file-explorer.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/file-explorer.lua index 4ccf865b..8a683d72 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/file-explorer.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/configs/file-explorer.lua @@ -1,4 +1,7 @@ -local nvim_tree = require('nvim-tree.configs') +local loaded, nvim_tree = pcall(require, "nvim-tree.configs") +if not loaded then + return +end nvim_tree.setup({ highlight = { @@ -6,7 +9,7 @@ nvim_tree.setup({ additional_vim_regex_highlighting = true, disable = { -- Ansible support reasons - 'ansible.yaml', + "ansible.yaml", }, }, matchup = { diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/hydra.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/hydra.lua index a5f4966b..4ced56eb 100644 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/hydra.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/configs/hydra.lua @@ -1,26 +1,29 @@ -local hydra = require('hydra') +local loaded, hydra = pcall(require, "hydra") +if not loaded then + return +end -- Side Scroll hydra({ - name = 'Side scroll', + name = "Side scroll", config = { { - position = 'bottom-right', - border = 'rounded', + position = "bottom-right", + border = "rounded", }, }, - mode = 'n', - body = 'z', + mode = "n", + body = "z", heads = { - { 'h', '5zh' }, - { 'l', '5zl', { desc = '←/→' } }, - { 'H', 'zH' }, - { 'L', 'zL', { desc = 'half screen ←/→' } }, + { "h", "5zh" }, + { "l", "5zl", { desc = "←/→" } }, + { "H", "zH" }, + { "L", "zL", { desc = "half screen ←/→" } }, }, }) -- Git Integration -local gitsigns = require('gitsigns') +local gitsigns = require("gitsigns") local hint = [[ _J_: next hunk _s_: stage hunk _d_: show deleted _b_: blame line @@ -33,11 +36,11 @@ local hint = [[ hydra({ hint = hint, config = { - color = 'pink', + color = "pink", invoke_on_body = true, hint = { - position = 'bottom-right', - border = 'rounded', + position = "bottom-right", + border = "rounded", }, on_enter = function() vim.bo.modifiable = false @@ -50,68 +53,68 @@ hydra({ gitsigns.toggle_deleted(false) end, }, - mode = { 'n', 'x' }, - body = 'G', + mode = { "n", "x" }, + body = "G", heads = { { - 'J', + "J", function() if vim.wo.diff then - return ']c' + return "]c" end vim.schedule(function() gitsigns.next_hunk() end) - return '' + return "" end, { expr = true }, }, { - 'K', + "K", function() if vim.wo.diff then - return '[c' + return "[c" end vim.schedule(function() gitsigns.prev_hunk() end) - return '' + return "" end, { expr = true }, }, - { 's', ':Gitsigns stage_hunk', { silent = true } }, - { 'u', gitsigns.undo_stage_hunk }, - { 'S', gitsigns.stage_buffer }, - { 'p', gitsigns.preview_hunk }, - { 'd', gitsigns.toggle_deleted, { nowait = true } }, - { 'b', gitsigns.blame_line }, + { "s", ":Gitsigns stage_hunk", { silent = true } }, + { "u", gitsigns.undo_stage_hunk }, + { "S", gitsigns.stage_buffer }, + { "p", gitsigns.preview_hunk }, + { "d", gitsigns.toggle_deleted, { nowait = true } }, + { "b", gitsigns.blame_line }, { - 'B', + "B", function() gitsigns.blame_line({ full = true }) end, }, - { '/', gitsigns.show, { exit = true } }, -- show the base of the file - { '', 'Neogit', { exit = true } }, - { 'q', nil, { exit = true, nowait = true } }, + { "/", gitsigns.show, { exit = true } }, -- show the base of the file + { "", "Neogit", { exit = true } }, + { "q", nil, { exit = true, nowait = true } }, }, }) -- Hydra to repeat expanding windows hydra({ - name = 'Window Sizing', - mode = 'n', - body = '', + name = "Window Sizing", + mode = "n", + body = "", config = { { - position = 'bottom-right', - border = 'rounded', + position = "bottom-right", + border = "rounded", }, }, heads = { - { '<', '2<' }, - { '>', '2>', { desc = '←/→' } }, - { '+', '2+' }, - { '-', '2-', { desc = '↑/↓' } }, + { "<", "2<" }, + { ">", "2>", { desc = "←/→" } }, + { "+", "2+" }, + { "-", "2-", { desc = "↑/↓" } }, }, }) diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/indent-blankline.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/indent-blankline.lua index c154b693..db6a07ed 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/indent-blankline.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/configs/indent-blankline.lua @@ -1,24 +1,28 @@ local g = vim.g -g.indent_blankline_char = '▏' -g.indent_blankline_context_char = '▏' +g.indent_blankline_char = "▏" +g.indent_blankline_context_char = "▏" -- Disable indent-blankline on these pages. g.indent_blankline_filetype_exclude = { - 'help', - 'terminal', - 'alpha', - 'packer', - 'lsp-installer', - 'lspinfo', - 'mason.nvim', + "help", + "terminal", + "alpha", + "packer", + "lsp-installer", + "lspinfo", + "mason.nvim", } -g.indent_blankline_buftype_exclude = { 'terminal' } +g.indent_blankline_buftype_exclude = { "terminal" } g.indent_blankline_show_trailing_blankline_indent = false g.indent_blankline_show_first_indent_level = true -require('indent_blankline').setup({ +local loaded, indent_blankline = pcall(require, "indent_blankline") +if not loaded then + return +end +indent_blankline.setup({ -- space_char_blankline = " ", show_current_context = true, show_current_context_start = true, diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/lsp.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/lsp.lua index ba3ad067..0bf749d3 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/lsp.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/configs/lsp.lua @@ -1,6 +1,42 @@ -local mason_lspconfig = require("mason-lspconfig") -local lspconfig = require("lspconfig") -local async = require("plenary.async") +local loaded, mason_lspconfig = pcall(require, "mason-lspconfig") +if not loaded then + return +end + +local lspconfig_loaded, lspconfig = pcall(require, "lspconfig") +if not lspconfig_loaded then + return +end + +local plenary_loaded, async = pcall(require, "plenary.async") +if not plenary_loaded then + return +end + +local cmp_nvim_lsp_loaded, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp") +if not cmp_nvim_lsp_loaded then + return +end + +local rust_tools_loaded, rust_tools = pcall(require, "rust_tools") +if not rust_tools_loaded then + return +end + +local lua_dev_loaded, lua_dev = pcall(require, "lua-dev") +if not lua_dev_loaded then + return +end + +local sqls_loaded, sqls = pcall(require, "sqls") +if not sqls_loaded then + return +end + +local chsarpls_extended_loaded, csharpls_extended = pcall(require, "csharpls_extended") +if not csharpls_extended_loaded then + return +end -- NOTE: Keep this near top mason_lspconfig.setup({ @@ -18,7 +54,7 @@ local function on_attach(client, bufnr) end) end -local lsp_capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()) +local lsp_capabilities = cmp_nvim_lsp.update_capabilities(vim.lsp.protocol.make_client_capabilities()) local opts = { capabilities = lsp_capabilities, on_attach = on_attach, @@ -51,7 +87,7 @@ local rustopts = { }, }, } -require("rust-tools").setup(rustopts) +rust_tools.setup(rustopts) -- NOTE: ANSIBLE LSP -- I use ansible a lot, define exceptions for servers that can use @@ -79,7 +115,7 @@ lspconfig.ansiblels.setup({ }) -- NOTE: LUA LSP -local luadev = require("lua-dev").setup({ +local luadev = lua_dev.setup({ lspconfig = opts, }) @@ -88,7 +124,7 @@ lspconfig.sumneko_lua.setup(luadev) -- NOTE: SQL LSP lspconfig.sqls.setup({ on_attach = function(client, bufnr) - require("sqls").on_attach(client, bufnr) + sqls.on_attach(client, bufnr) on_attach(client, bufnr) end, }) @@ -157,7 +193,7 @@ lspconfig.yamlls.setup({ lspconfig.csharp_ls.setup({ handlers = { - ["textDocument/definition"] = require("csharpls_extended").handler, + ["textDocument/definition"] = csharpls_extended.handler, }, capabilities = lsp_capabilities, on_attach = on_attach, diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/neotree.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/neotree.lua index 1492e22f..82baf7a4 100644 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/neotree.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/configs/neotree.lua @@ -1,4 +1,7 @@ -local neotree = require('neo-tree') +local loaded, neotree = pcall(require, "neo-tree") +if not loaded then + return +end vim.g.neo_tree_remove_legacy_commands = 1 neotree.setup({ @@ -7,8 +10,8 @@ neotree.setup({ }, window = { mappings = { - ['/'] = 'noop', - ['/'] = {}, + ["/"] = "noop", + ["/"] = {}, }, }, }) diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/null_ls.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/null_ls.lua index 04c9c406..fac110a1 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/null_ls.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/configs/null_ls.lua @@ -1,9 +1,12 @@ -local null_ls = require('null-ls') +local loaded, null_ls = pcall(require, "null-ls") +if not loaded then + return +end null_ls.setup({ sources = { null_ls.builtins.formatting.shfmt.with({ - extra_args = { '-i 4' }, + extra_args = { "-i 4" }, }), null_ls.builtins.diagnostics.shellcheck, null_ls.builtins.code_actions.shellcheck, diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/nvim-colorizer.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/nvim-colorizer.lua index a6f2cf4e..afe725f9 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/nvim-colorizer.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/configs/nvim-colorizer.lua @@ -1,3 +1,6 @@ -local colorizer = require('colorizer') +local loaded, colorizer = pcall(require, "colorizer") +if not loaded then + return +end colorizer.setup({}) -vim.cmd('ColorizerAttachToBuffer') +vim.cmd("ColorizerAttachToBuffer") diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/nvim-notify.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/nvim-notify.lua index 5f2f5510..b4bf4103 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/nvim-notify.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/configs/nvim-notify.lua @@ -1,6 +1,10 @@ -require('notify').setup({ +local loaded, notify = pcall(require, "notify") +if not loaded then + return +end +notify.setup({ -- Animation style (see below for details) - stages = 'fade_in_slide_out', + stages = "fade_in_slide_out", -- Function called when a new window is opened, use for changing win settings/config on_open = nil, @@ -9,26 +13,26 @@ require('notify').setup({ on_close = nil, -- Render function for notifications. See notify-render() - render = 'default', + render = "default", -- Default timeout for notifications timeout = 5000, -- For stages that change opacity this is treated as the highlight behind the window -- Set this to either a highlight group, an RGB hex value e.g. "#000000" or a function returning an RGB code for dynamic values - background_colour = '#000000', + background_colour = "#000000", -- Minimum width for notification windows minimum_width = 50, -- Icons for the different levels icons = { - ERROR = '', - WARN = '', - INFO = '', - DEBUG = '', - TRACE = '✎', + ERROR = "", + WARN = "", + INFO = "", + DEBUG = "", + TRACE = "✎", }, }) -vim.notify = require('notify') +vim.notify = require("notify") diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/python-dap.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/python-dap.lua index 93849bfe..05f58975 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/python-dap.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/configs/python-dap.lua @@ -1,3 +1,6 @@ -local dap_python = require('dap-python') -dap_python.setup('~/.venvs/debugpy/bin/python') -dap_python.test_runner = 'pytest' +local loaded, dap_python = pcall(require, "dap-python") +if not loaded then + return +end +dap_python.setup("~/.venvs/debugpy/bin/python") +dap_python.test_runner = "pytest" diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/telescope-nvim.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/telescope-nvim.lua index 40053227..50f77440 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/telescope-nvim.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/configs/telescope-nvim.lua @@ -1,4 +1,7 @@ -local telescope = require("telescope") +local loaded, telescope = pcall(require, "telescope") +if not loaded then + return +end local actions = require("telescope.actions") telescope.setup({ diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/todo-comments.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/todo-comments.lua index 5fbe08e7..dd31f226 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/todo-comments.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/configs/todo-comments.lua @@ -1 +1,5 @@ -require('todo-comments').setup({}) +local loaded, todo_comments = pcall(require, "todo-comments") +if not loaded then + return +end +todo_comments.setup({}) diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/tokyonight.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/tokyonight.lua deleted file mode 100755 index 398c754c..00000000 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/tokyonight.lua +++ /dev/null @@ -1,7 +0,0 @@ -local g = vim.g - -g.tokyonight_style = 'night' -g.tokyonight_transparent = true -g.tokyonight_transparent_sidebar = true - -vim.cmd('colorscheme tokyonight') diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/treesitter.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/treesitter.lua index d20425ed..d0ff5c38 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/treesitter.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/configs/treesitter.lua @@ -1,13 +1,16 @@ -local nvim_treesitter = require('nvim-treesitter.configs') +local loaded, nvim_treesitter = pcall(require, "nvim-treesitter.configs") +if not loaded then + return +end nvim_treesitter.setup({ ensure_installed = { - 'norg', + "norg", }, highlight = { enable = true, additional_vim_regex_highlighting = true, - disable = { 'yaml' }, + disable = { "yaml" }, }, matchup = { enable = true,