diff --git a/.config/nvim/.stylua.toml b/.config/nvim/.stylua.toml index cadd8cb3..95380b46 100644 --- a/.config/nvim/.stylua.toml +++ b/.config/nvim/.stylua.toml @@ -1,3 +1,3 @@ column_width = 120 -indent_type = "Spaces" -quote_style = "AutoPreferSingle" +indent_type = 'Spaces' +quote_style = 'AutoPreferSingle' diff --git a/.config/nvim/after/ftplugin/norg.lua b/.config/nvim/after/ftplugin/norg.lua index bb3b3ad1..57e0be06 100644 --- a/.config/nvim/after/ftplugin/norg.lua +++ b/.config/nvim/after/ftplugin/norg.lua @@ -1,4 +1,4 @@ -local map = require("utils.funcs").map +local map = require('utils.funcs').map -map("n", "fge", ":Neorg gtd edit") -map("n", "fgv", ":Neorg gtd views") +map('n', 'fge', ':Neorg gtd edit') +map('n', 'fgv', ':Neorg gtd views') diff --git a/.config/nvim/after/ftplugin/rust.lua b/.config/nvim/after/ftplugin/rust.lua index 08cdefd9..cbfa0b70 100644 --- a/.config/nvim/after/ftplugin/rust.lua +++ b/.config/nvim/after/ftplugin/rust.lua @@ -1,13 +1,13 @@ -local map = require("utils.funcs").map +local map = require('utils.funcs').map -map("n", "fr", ":RustRunnables") -map("n", "fd", ":RustDebuggables") -map("n", "fp", ":RustParentModule") -map("n", "fJ", ":RustJoinLines") -map("n", "fh", ":RustHoverActions") -map("n", "fH",":RustHoverRange") -map("n", "fi", ":RustToggleInlayHints") -map("n", "fm", ":RustExpandMacro") -map("n", "fc", ":RustOpenCargo") -map("n", "fk", ":RustMoveItemUp") -map("n", "fj", ":RustMoveItemDown") +map('n', 'fr', ':RustRunnables') +map('n', 'fd', ':RustDebuggables') +map('n', 'fp', ':RustParentModule') +map('n', 'fJ', ':RustJoinLines') +map('n', 'fh', ':RustHoverActions') +map('n', 'fH', ':RustHoverRange') +map('n', 'fi', ':RustToggleInlayHints') +map('n', 'fm', ':RustExpandMacro') +map('n', 'fc', ':RustOpenCargo') +map('n', 'fk', ':RustMoveItemUp') +map('n', 'fj', ':RustMoveItemDown') diff --git a/.config/nvim/ftplugin/yaml.lua b/.config/nvim/ftplugin/yaml.lua index 09aa45b0..2d15a8f8 100644 --- a/.config/nvim/ftplugin/yaml.lua +++ b/.config/nvim/ftplugin/yaml.lua @@ -1,3 +1,3 @@ local opt = vim.opt -opt.foldmethod = "indent" +opt.foldmethod = 'indent' diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index c8c0962c..0ef91993 100755 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,2 +1,2 @@ -pcall(require, "impatient") -require("main") +pcall(require, 'impatient') +require('main') diff --git a/.config/nvim/lua/core/disabled.lua b/.config/nvim/lua/core/disabled.lua index df6305b4..22513488 100755 --- a/.config/nvim/lua/core/disabled.lua +++ b/.config/nvim/lua/core/disabled.lua @@ -1,25 +1,25 @@ local M = {} M.setup = function() - local disabled_built_ins = { - "gzip", - "zip", - "zipPlugin", - "tar", - "tarPlugin", - "getscript", - "getscriptPlugin", - "vimball", - "vimballPlugin", - "2html_plugin", - "logipat", - "rrhelper", - "spellfile_plugin", - "matchit", - } + local disabled_built_ins = { + 'gzip', + 'zip', + 'zipPlugin', + 'tar', + 'tarPlugin', + 'getscript', + 'getscriptPlugin', + 'vimball', + 'vimballPlugin', + '2html_plugin', + 'logipat', + 'rrhelper', + 'spellfile_plugin', + 'matchit', + } - for _, plugin in pairs(disabled_built_ins) do - vim.g["loaded_" .. plugin] = 1 - end + for _, plugin in pairs(disabled_built_ins) do + vim.g['loaded_' .. plugin] = 1 + end end return M diff --git a/.config/nvim/lua/core/init.lua b/.config/nvim/lua/core/init.lua index 41127c92..2156783e 100755 --- a/.config/nvim/lua/core/init.lua +++ b/.config/nvim/lua/core/init.lua @@ -1,5 +1,5 @@ -require("core.disabled").setup() -require("core.options").setup() -require("core.mappings").setup() -require("core.globals").setup() -require("core.lsp").setup() +require('core.disabled').setup() +require('core.options').setup() +require('core.mappings').setup() +require('core.globals').setup() +require('core.lsp').setup() diff --git a/.config/nvim/lua/core/lsp.lua b/.config/nvim/lua/core/lsp.lua index 3fc4a474..d92cbdee 100644 --- a/.config/nvim/lua/core/lsp.lua +++ b/.config/nvim/lua/core/lsp.lua @@ -1,15 +1,15 @@ local M = {} M.setup = function() - local function lspSymbol(name, icon) - local hl = "DiagnosticSign" .. name - vim.fn.sign_define(hl, { text = icon, numhl = hl, texthl = hl }) - end + local function lspSymbol(name, icon) + local hl = 'DiagnosticSign' .. name + vim.fn.sign_define(hl, { text = icon, numhl = hl, texthl = hl }) + end - lspSymbol("Error", "") - lspSymbol("Warn", "") - lspSymbol("Info", "") - lspSymbol("Hint", "") + lspSymbol('Error', '') + lspSymbol('Warn', '') + lspSymbol('Info', '') + lspSymbol('Hint', '') end return M diff --git a/.config/nvim/lua/core/mappings.lua b/.config/nvim/lua/core/mappings.lua index 78d0611f..d74bd3b0 100755 --- a/.config/nvim/lua/core/mappings.lua +++ b/.config/nvim/lua/core/mappings.lua @@ -1,29 +1,28 @@ -local utils_func = require("utils.funcs") +local utils_func = require('utils.funcs') local map = utils_func.map local M = {} M.setup = function() - -- set mapleader to space - vim.g.mapleader = " " + -- set mapleader to space + vim.g.mapleader = ' ' - -- Get rid of highlight after search - map("n", "", ":noh") + -- Get rid of highlight after search + map('n', '', ':noh') -- Spell Checking - map("n", "st",":set spell!") + map('n', 'st', ':set spell!') -- Better split movement - map("n", "", "l") - map("n", "", "h") - map("n", "", "k") - map("n", "", "j") + map('n', '', 'l') + map('n', '', 'h') + map('n', '', 'k') + map('n', '', 'j') -- Better split closing - map("n", "", "c") + map('n', '', 'c') -- Set current focused file as cwd - map("n", "cd", ":cd %:p:h") - + map('n', 'cd', ':cd %:p:h') end return M diff --git a/.config/nvim/lua/core/options.lua b/.config/nvim/lua/core/options.lua index ad4ba4ff..30015101 100755 --- a/.config/nvim/lua/core/options.lua +++ b/.config/nvim/lua/core/options.lua @@ -3,99 +3,99 @@ local opt = vim.opt local M = {} M.setup = function() - -- Number settings - opt.number = true - opt.numberwidth = 2 - opt.relativenumber = false + -- Number settings + opt.number = true + opt.numberwidth = 2 + opt.relativenumber = false - -- Scroll Offset - opt.scrolloff = 3 + -- Scroll Offset + opt.scrolloff = 3 - -- Disable showmode - opt.showmode = false + -- Disable showmode + opt.showmode = false - -- Set truecolor support - opt.termguicolors = true - vim.cmd("highlight Normal guibg=none") + -- Set truecolor support + opt.termguicolors = true + vim.cmd('highlight Normal guibg=none') - -- Enable system clipboard - opt.clipboard = "unnamedplus" + -- Enable system clipboard + opt.clipboard = 'unnamedplus' - -- Set mouse support for any mode - opt.mouse = "a" + -- Set mouse support for any mode + opt.mouse = 'a' - -- Allow hidden - opt.hidden = true + -- Allow hidden + opt.hidden = true - -- Useful defaults for tab, indentation, etc. - opt.tabstop = 4 - opt.shiftwidth = 4 - opt.smartindent = true - opt.breakindent = true - opt.expandtab = true - opt.smarttab = true + -- Useful defaults for tab, indentation, etc. + opt.tabstop = 4 + opt.shiftwidth = 4 + opt.smartindent = true + opt.breakindent = true + opt.expandtab = true + opt.smarttab = true - -- Search settings - opt.hlsearch = true - opt.incsearch = true - opt.ignorecase = true - opt.smartcase = true + -- Search settings + opt.hlsearch = true + opt.incsearch = true + opt.ignorecase = true + opt.smartcase = true - -- Better backspaces - opt.backspace = "indent,eol,start" + -- Better backspaces + opt.backspace = 'indent,eol,start' - -- Make new splits vertical - opt.splitright = true + -- Make new splits vertical + opt.splitright = true - -- Show line & column num of cursor - opt.ruler = true + -- Show line & column num of cursor + opt.ruler = true - -- Set timeouts - opt.ttimeoutlen = 20 - opt.timeoutlen = 1000 - opt.updatetime = 250 - opt.signcolumn = "yes" + -- Set timeouts + opt.ttimeoutlen = 20 + opt.timeoutlen = 1000 + opt.updatetime = 250 + opt.signcolumn = 'yes' - -- Enable persistent undo - opt.undodir = vim.fn.stdpath("cache") .. "/undo" - opt.undofile = true + -- Enable persistent undo + opt.undodir = vim.fn.stdpath('cache') .. '/undo' + opt.undofile = true - -- Better folding - opt.foldmethod = "expr" - opt.foldexpr = "nvim_treesitter#foldexpr()" - opt.fillchars = { fold = " " } - opt.foldlevel = 20 + -- Better folding + opt.foldmethod = 'expr' + opt.foldexpr = 'nvim_treesitter#foldexpr()' + opt.fillchars = { fold = ' ' } + opt.foldlevel = 20 - -- Concealment for nicer rendering - opt.conceallevel = 2 - opt.concealcursor = "ic" + -- Concealment for nicer rendering + opt.conceallevel = 2 + opt.concealcursor = 'ic' - -- Lazy Redraw to Speed Up Macros - opt.lazyredraw = true + -- Lazy Redraw to Speed Up Macros + opt.lazyredraw = true - -- Spell Settings - opt.spelllang = { "en_us" } + -- Spell Settings + opt.spelllang = { 'en_us' } - -- Better completion experience - opt.completeopt = "menuone,noselect" + -- Better completion experience + opt.completeopt = 'menuone,noselect' - -- Set max text width - opt.textwidth = 120 + -- Set max text width + opt.textwidth = 120 - -- Highlight cursor line - opt.cursorline = true + -- Highlight cursor line + opt.cursorline = true - -- Make statusline global - opt.laststatus = 3 + -- Make statusline global + opt.laststatus = 3 -- Set listcharacters opt.list = true - opt.listchars:append("tab:⭾⭾") - opt.listchars:append("lead:·") - opt.listchars:append("trail:·") - opt.listchars:append("extends:◣") - opt.listchars:append("precedes:◢") - opt.listchars:append("nbsp:○") + opt.listchars:append('tab:⭾⭾') + opt.listchars:append('lead:·') + opt.listchars:append('trail:·') + opt.listchars:append('extends:◣') + opt.listchars:append('precedes:◢') + opt.listchars:append('nbsp:○') -- Remove end of boundry '~' opt.fillchars:append('eob: ') diff --git a/.config/nvim/lua/core/postload.lua b/.config/nvim/lua/core/postload.lua index b9e80513..890e5d29 100755 --- a/.config/nvim/lua/core/postload.lua +++ b/.config/nvim/lua/core/postload.lua @@ -1 +1 @@ -require("core.theme").setup() +require('core.theme').setup() diff --git a/.config/nvim/lua/core/theme.lua b/.config/nvim/lua/core/theme.lua index f8adbbf9..b56ecfe2 100755 --- a/.config/nvim/lua/core/theme.lua +++ b/.config/nvim/lua/core/theme.lua @@ -1,19 +1,19 @@ local M = {} M.setup = function() - vim.g.tokyonight_style = "night" - vim.g.tokyonight_transparent = true - vim.g.tokyonight_transparent_sidebar = true + vim.g.tokyonight_style = 'night' + vim.g.tokyonight_transparent = true + vim.g.tokyonight_transparent_sidebar = true - local colorscheme_name = "tokyonight" - local loaded, _ = pcall(vim.cmd, "colorscheme " .. colorscheme_name) + local colorscheme_name = 'tokyonight' + local loaded, _ = pcall(vim.cmd, 'colorscheme ' .. colorscheme_name) - if not loaded then - vim.notify('Colorscheme "' .. colorscheme_name .. '" could not be loaded!', vim.lsp.log_levels.WARN, { - title = "Colorscheme", - }) - end + if not loaded then + vim.notify('Colorscheme "' .. colorscheme_name .. '" could not be loaded!', vim.lsp.log_levels.WARN, { + title = 'Colorscheme', + }) + end - vim.api.nvim_set_hl(0, "SpecialKey", { fg = "#61AFEF" }) + vim.api.nvim_set_hl(0, 'SpecialKey', { fg = '#61AFEF' }) end return M diff --git a/.config/nvim/lua/main.lua b/.config/nvim/lua/main.lua index ee1ef08e..5f97233c 100755 --- a/.config/nvim/lua/main.lua +++ b/.config/nvim/lua/main.lua @@ -4,14 +4,14 @@ -- INFO: SHOULD have a init.lua file associated with them. -- INFO: init.lua is responsible for loading all configuration -- INFO: related to that directory. -require("core.init") -require("plugins.init") -require("utils.init") +require('core.init') +require('plugins.init') +require('utils.init') -- INFO: Post load, for things that need to setup keybindings etc after the fact -- -- NOTE: All postload modules should be independent of each other, they shouldn't -- NOTE: rely on each other's load order. That type of logic should be shifted -- NOTE: into non-postload regions then handled in postload modules. -require("plugins.postload") -require("core.postload") +require('plugins.postload') +require('core.postload') diff --git a/.config/nvim/lua/plugins/configs/_cmp.lua b/.config/nvim/lua/plugins/configs/_cmp.lua index 462bf723..3bfdcc60 100755 --- a/.config/nvim/lua/plugins/configs/_cmp.lua +++ b/.config/nvim/lua/plugins/configs/_cmp.lua @@ -1,195 +1,195 @@ -local cmp = require("cmp") +local cmp = require('cmp') 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").load() +require('luasnip.loaders.from_vscode').load() cmp.setup({ - formatting = { - format = function(entry, vim_item) - -- 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 - -- 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],", - })[entry.source.name] - return vim_item - end, - }, - window = { - documentation = { - border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" }, - }, - }, - experimental = { - ghost_text = true, - native_menu = false, - }, - snippet = { - -- REQUIRED - you must specify a snippet engine - expand = function(args) - 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({ - 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) - if luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - else - fallback() - end - 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) - if cmp.visible() then - cmp.select_next_item() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - }, - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "path" }, - { name = "emoji" }, - { name = "neorg" }, - { name = "luasnip" }, -- For luasnip users. - { name = "calc" }, - { name = "zsh" }, - { name = "fuzzy_buffer" }, - { name = "rg" }, - { name = "npm", keyword_length = 2 }, - { - name = "dictionary", - keyword_length = 2, - }, - }), - sorting = { - priority_weight = 2, - comparators = { + formatting = { + format = function(entry, vim_item) + -- 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 + -- 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],', + })[entry.source.name] + return vim_item + end, + }, + window = { + documentation = { + border = { '╭', '─', '╮', '│', '╯', '─', '╰', '│' }, + }, + }, + experimental = { + ghost_text = true, + native_menu = false, + }, + snippet = { + -- REQUIRED - you must specify a snippet engine + expand = function(args) + 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({ + 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) + if luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + 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) + if cmp.visible() then + cmp.select_next_item() + else + fallback() + end + end, { 'i', 's' }), + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { 'i', 's' }), + }, + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'path' }, + { name = 'emoji' }, + { name = 'neorg' }, + { name = 'luasnip' }, -- For luasnip users. + { name = 'calc' }, + { name = 'zsh' }, + { name = 'fuzzy_buffer' }, + { name = 'rg' }, + { name = 'npm', keyword_length = 2 }, + { + name = 'dictionary', + keyword_length = 2, + }, + }), + sorting = { + priority_weight = 2, + comparators = { compare.score, compare.recently_used, compare.exact, - require("cmp_fuzzy_buffer.compare"), - compare.offset, + require('cmp_fuzzy_buffer.compare'), + compare.offset, compare.kind, - compare.sort_text, - compare.length, - compare.order, - }, - }, + compare.sort_text, + compare.length, + compare.order, + }, + }, }) -- Git Commit Completions -cmp.setup.filetype("gitcommit", { - sources = cmp.config.sources({ - { name = "conventionalcommits" }, - { name = "buffer" }, - }), +cmp.setup.filetype('gitcommit', { + sources = cmp.config.sources({ + { name = 'conventionalcommits' }, + { name = 'buffer' }, + }), }) -cmp.setup.filetype("toml", { - sources = cmp.config.sources({ - { name = "crates" }, - }), +cmp.setup.filetype('toml', { + sources = cmp.config.sources({ + { name = 'crates' }, + }), }) -- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). -cmp.setup.cmdline("/", { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - -- { name = "buffer" }, - { name = "fuzzy_buffer" }, - { name = "cmdline_history" }, - }), +cmp.setup.cmdline('/', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + -- { name = "buffer" }, + { name = 'fuzzy_buffer' }, + { name = 'cmdline_history' }, + }), }) -cmp.setup.cmdline("?", { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = "fuzzy_buffer" }, - { name = "cmdline_history" }, - }), +cmp.setup.cmdline('?', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = 'fuzzy_buffer' }, + { name = 'cmdline_history' }, + }), }) -cmp.setup.cmdline("@", { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = "fuzzy_buffer" }, - { name = "cmdline_history" }, - }), +cmp.setup.cmdline('@', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = 'fuzzy_buffer' }, + { name = 'cmdline_history' }, + }), }) -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). -cmp.setup.cmdline(":", { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = "path" }, - { name = "cmdline" }, - { name = "cmdline_history" }, - }), +cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = 'path' }, + { name = 'cmdline' }, + { name = 'cmdline_history' }, + }), }) diff --git a/.config/nvim/lua/plugins/configs/_dap.lua b/.config/nvim/lua/plugins/configs/_dap.lua index ef190b9e..17bb1e8c 100755 --- a/.config/nvim/lua/plugins/configs/_dap.lua +++ b/.config/nvim/lua/plugins/configs/_dap.lua @@ -1,59 +1,59 @@ -local dap = require("dap") -local async = require("plenary.async") +local dap = require('dap') +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 fd = io.popen("which " .. program) - local program_path = fd:read("*all") - fd:close() - program_path = program_path.gsub(program_path, "\n", "") + local fd = io.popen('which ' .. program) + local program_path = fd:read('*all') + fd:close() + program_path = program_path.gsub(program_path, '\n', '') - if program_path == nil or program_path == "" then - async.run(function() - vim.notify.async(("Failed to find (%s) in your path"):format(program), "error", { - title = "DAP", - }).events.close() - end) - program_path = nil - end - return program_path + if program_path == nil or program_path == '' then + async.run(function() + vim.notify.async(('Failed to find (%s) in your path'):format(program), 'error', { + title = 'DAP', + }).events.close() + end) + program_path = nil + end + 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", - command = lldb_path, - name = "lldb", + type = 'executable', + command = lldb_path, + name = 'lldb', } -- configurations 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, - targetArchitecture = "arm64", - args = {}, + { + name = 'Launch', + type = 'lldb', + request = 'launch', + program = function() + return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') + end, + cwd = '${workspaceFolder}', + stopOnEntry = false, + targetArchitecture = 'arm64', + args = {}, - -- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting: - -- - -- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope - -- - -- Otherwise you might get the following error: - -- - -- Error on launch: Failed to attach to the target process - -- - -- But you should be aware of the implications: - -- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html - runInTerminal = false, - }, + -- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting: + -- + -- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope + -- + -- Otherwise you might get the following error: + -- + -- Error on launch: Failed to attach to the target process + -- + -- But you should be aware of the implications: + -- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html + runInTerminal = false, + }, } dap.configurations.c = dap.configurations.cpp diff --git a/.config/nvim/lua/plugins/configs/_neoclip.lua b/.config/nvim/lua/plugins/configs/_neoclip.lua index 48bfe02e..1aaf7f23 100755 --- a/.config/nvim/lua/plugins/configs/_neoclip.lua +++ b/.config/nvim/lua/plugins/configs/_neoclip.lua @@ -1,3 +1,3 @@ -require("neoclip").setup({ - enable_persistent_history = true +require('neoclip').setup({ + enable_persistent_history = true, }) diff --git a/.config/nvim/lua/plugins/configs/_neorg.lua b/.config/nvim/lua/plugins/configs/_neorg.lua index f188239e..13782bcf 100755 --- a/.config/nvim/lua/plugins/configs/_neorg.lua +++ b/.config/nvim/lua/plugins/configs/_neorg.lua @@ -1,50 +1,50 @@ -local neorg = require("neorg") +local neorg = require('neorg') neorg.setup({ load = { - ["core.defaults"] = {}, - ["core.norg.concealer"] = {}, - ["core.norg.esupports.metagen"] = { - config = { - type = "auto", - } - }, - ["core.integrations.nvim-cmp"] = { - config = {} - }, - ["core.norg.completion"] = { + ['core.defaults'] = {}, + ['core.norg.concealer'] = {}, + ['core.norg.esupports.metagen'] = { config = { - engine = "nvim-cmp" + type = 'auto', }, }, - ["core.keybinds"] = { + ['core.integrations.nvim-cmp'] = { + config = {}, + }, + ['core.norg.completion'] = { + config = { + engine = 'nvim-cmp', + }, + }, + ['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"] = { - config = {} + ['core.gtd.ui'] = { + config = {}, }, - ["core.gtd.helpers"] = { - config = {} - } - } + ['core.gtd.helpers'] = { + config = {}, + }, + }, }) diff --git a/.config/nvim/lua/plugins/configs/_stabilize.lua b/.config/nvim/lua/plugins/configs/_stabilize.lua index 13876f90..c3c6b362 100755 --- a/.config/nvim/lua/plugins/configs/_stabilize.lua +++ b/.config/nvim/lua/plugins/configs/_stabilize.lua @@ -1,20 +1,20 @@ -require("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" }, - buftype = { - "packer", - "Dashboard", - "terminal", - "quickfix", - "loclist", - "LspInstall" - }, - }, - -- comma-separated list of autocmds that wil trigger the plugins window restore function - nested = nil, +require('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' }, + buftype = { + 'packer', + 'Dashboard', + 'terminal', + 'quickfix', + 'loclist', + 'LspInstall', + }, + }, + -- comma-separated list of autocmds that wil trigger the plugins window restore function + nested = nil, }) diff --git a/.config/nvim/lua/plugins/configs/_windline.lua b/.config/nvim/lua/plugins/configs/_windline.lua index edb99a0e..25db6767 100755 --- a/.config/nvim/lua/plugins/configs/_windline.lua +++ b/.config/nvim/lua/plugins/configs/_windline.lua @@ -1,7 +1,7 @@ -- Load Animations -require("wlanimation") +require('wlanimation') -- Load a line (these include setup) -require("wlsample.bubble2") +require('wlsample.bubble2') -- In the future I may want to implement -- my own, for now much too lazy for that diff --git a/.config/nvim/lua/plugins/configs/bufferline.lua b/.config/nvim/lua/plugins/configs/bufferline.lua index 93684c95..abd50440 100755 --- a/.config/nvim/lua/plugins/configs/bufferline.lua +++ b/.config/nvim/lua/plugins/configs/bufferline.lua @@ -1,18 +1,18 @@ -local bufferline = require("bufferline") +local bufferline = require('bufferline') bufferline.setup({ - options = { - numbers = function(opts) - return string.format("%s", opts.id) - end, - diagnostics = "nvim_lsp", - offsets = { - { - filetype = "NvimTree", - text = "File Explorer", - highlight = "Directory", - text_align = "left", - }, - }, - }, + options = { + numbers = function(opts) + return string.format('%s', opts.id) + end, + diagnostics = 'nvim_lsp', + offsets = { + { + filetype = 'NvimTree', + text = 'File Explorer', + highlight = 'Directory', + text_align = 'left', + }, + }, + }, }) diff --git a/.config/nvim/lua/plugins/configs/code-outline.lua b/.config/nvim/lua/plugins/configs/code-outline.lua index e95a638a..583d5d7d 100755 --- a/.config/nvim/lua/plugins/configs/code-outline.lua +++ b/.config/nvim/lua/plugins/configs/code-outline.lua @@ -1 +1 @@ -map("n", "ls", ":SymbolsOutline") +map('n', 'ls', ':SymbolsOutline') diff --git a/.config/nvim/lua/plugins/configs/coq.lua b/.config/nvim/lua/plugins/configs/coq.lua index b4efa617..3b0e0290 100755 --- a/.config/nvim/lua/plugins/configs/coq.lua +++ b/.config/nvim/lua/plugins/configs/coq.lua @@ -3,8 +3,8 @@ local g = vim.g -- Run COQ on open g.coq_settings = { - auto_start = "shut-up", + auto_start = 'shut-up', limits = { completion_manual_timeout = 2000, - } + }, } diff --git a/.config/nvim/lua/plugins/configs/dap-ui.lua b/.config/nvim/lua/plugins/configs/dap-ui.lua index c80cac14..5c0df7e9 100755 --- a/.config/nvim/lua/plugins/configs/dap-ui.lua +++ b/.config/nvim/lua/plugins/configs/dap-ui.lua @@ -1,9 +1,9 @@ local fn = vim.fn -require("dapui").setup({}) +require('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/.config/nvim/lua/plugins/configs/dashboard-nvim.lua b/.config/nvim/lua/plugins/configs/dashboard-nvim.lua index 960e1456..9dd95966 100755 --- a/.config/nvim/lua/plugins/configs/dashboard-nvim.lua +++ b/.config/nvim/lua/plugins/configs/dashboard-nvim.lua @@ -1,40 +1,40 @@ local g = vim.g local fn = vim.fn -local plugins_count = fn.len(fn.globpath("~/.local/share/nvim/site/pack/packer/start", "*", 0, 1)) +local plugins_count = fn.len(fn.globpath('~/.local/share/nvim/site/pack/packer/start', '*', 0, 1)) g.dashboard_disable_statusline = 1 -g.dashboard_default_executive = "telescope" +g.dashboard_default_executive = 'telescope' g.dashboard_custom_header = { - " ███╗ ██╗ ███████╗ ██████╗ ██╗ ██╗ ██╗ ███╗ ███╗", - " ████╗ ██║ ██╔════╝██╔═══██╗ ██║ ██║ ██║ ████╗ ████║", - " ██╔██╗ ██║ █████╗ ██║ ██║ ██║ ██║ ██║ ██╔████╔██║", - " ██║╚██╗██║ ██╔══╝ ██║ ██║ ╚██╗ ██╔╝ ██║ ██║╚██╔╝██║", - " ██║ ╚████║ ███████╗╚██████╔╝ ╚████╔╝ ██║ ██║ ╚═╝ ██║", - " ╚═╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝", + ' ███╗ ██╗ ███████╗ ██████╗ ██╗ ██╗ ██╗ ███╗ ███╗', + ' ████╗ ██║ ██╔════╝██╔═══██╗ ██║ ██║ ██║ ████╗ ████║', + ' ██╔██╗ ██║ █████╗ ██║ ██║ ██║ ██║ ██║ ██╔████╔██║', + ' ██║╚██╗██║ ██╔══╝ ██║ ██║ ╚██╗ ██╔╝ ██║ ██║╚██╔╝██║', + ' ██║ ╚████║ ███████╗╚██████╔╝ ╚████╔╝ ██║ ██║ ╚═╝ ██║', + ' ╚═╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝', } g.dashboard_custom_section = { - a = { description = { " Find File SPC t f" }, command = "Telescope find_files" }, - b = { description = { " Find directory SPC t d" }, command = "Telescope find_directories" }, - c = { description = { " Recents SPC t o" }, command = "Telescope oldfiles" }, - d = { description = { " Find Word SPC t w" }, command = "Telescope live_grep" }, + a = { description = { ' Find File SPC t f' }, command = 'Telescope find_files' }, + b = { description = { ' Find directory SPC t d' }, command = 'Telescope find_directories' }, + c = { description = { ' Recents SPC t o' }, command = 'Telescope oldfiles' }, + d = { description = { ' Find Word SPC t w' }, command = 'Telescope live_grep' }, } g.dashboard_custom_footer = { - "Loaded " .. plugins_count .. " plugins!  ", + 'Loaded ' .. plugins_count .. ' plugins!  ', } -- Disable statusline and cursorline in dashboard. -vim.api.nvim_create_autocmd("BufEnter", { - callback = function () - if vim.bo.filetype == "dashboard" then +vim.api.nvim_create_autocmd('BufEnter', { + callback = function() + if vim.bo.filetype == 'dashboard' then vim.opt.laststatus = 0 vim.opt.cursorline = false else vim.opt.laststatus = 3 vim.opt.cursorline = true end - end + end, }) diff --git a/.config/nvim/lua/plugins/configs/diag-scrollbar.lua b/.config/nvim/lua/plugins/configs/diag-scrollbar.lua index 82523d88..aa479f3c 100755 --- a/.config/nvim/lua/plugins/configs/diag-scrollbar.lua +++ b/.config/nvim/lua/plugins/configs/diag-scrollbar.lua @@ -1,18 +1,18 @@ -local colors = require("tokyonight.colors").setup() -require("scrollbar").setup({ - handle = { - color = colors.bg_highlight, - }, - marks = { - Search = { color = colors.orange }, - Error = { color = colors.error }, - Warn = { color = colors.warning }, - Info = { color = colors.info }, - Hint = { color = colors.hint }, - Misc = { color = colors.purple }, - }, - handlers = { - diagnostic = true, - search = true, - }, +local colors = require('tokyonight.colors').setup() +require('scrollbar').setup({ + handle = { + color = colors.bg_highlight, + }, + marks = { + Search = { color = colors.orange }, + Error = { color = colors.error }, + Warn = { color = colors.warning }, + Info = { color = colors.info }, + Hint = { color = colors.hint }, + Misc = { color = colors.purple }, + }, + handlers = { + diagnostic = true, + search = true, + }, }) diff --git a/.config/nvim/lua/plugins/configs/fidget-spinner.lua b/.config/nvim/lua/plugins/configs/fidget-spinner.lua index 8f7aad93..0c1fb887 100755 --- a/.config/nvim/lua/plugins/configs/fidget-spinner.lua +++ b/.config/nvim/lua/plugins/configs/fidget-spinner.lua @@ -1,10 +1,10 @@ -local fidget = require("fidget") +local fidget = require('fidget') fidget.setup({ text = { - spinner = "dots" + spinner = 'dots', }, window = { blend = 0, - } + }, }) diff --git a/.config/nvim/lua/plugins/configs/file-explorer.lua b/.config/nvim/lua/plugins/configs/file-explorer.lua index 938200a5..985b477e 100755 --- a/.config/nvim/lua/plugins/configs/file-explorer.lua +++ b/.config/nvim/lua/plugins/configs/file-explorer.lua @@ -1,18 +1,18 @@ -local treesitter = require("nvim-tree.configs") +local treesitter = require('nvim-tree.configs') treesitter.setup({ - highlight = { - enable = true, - additional_vim_regex_highlighting = true, - disable = { + highlight = { + enable = true, + additional_vim_regex_highlighting = true, + disable = { -- Ansible support reasons - "ansible.yaml", + 'ansible.yaml', }, - }, - matchup = { - enable = true, - }, - autotag = { - enable = true, - }, + }, + matchup = { + enable = true, + }, + autotag = { + enable = true, + }, }) diff --git a/.config/nvim/lua/plugins/configs/indent-blankline.lua b/.config/nvim/lua/plugins/configs/indent-blankline.lua index e06e6db3..a1e58b95 100755 --- a/.config/nvim/lua/plugins/configs/indent-blankline.lua +++ b/.config/nvim/lua/plugins/configs/indent-blankline.lua @@ -1,24 +1,24 @@ 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", - "dashboard", - "packer", - "lsp-installer", - "lspinfo", + 'help', + 'terminal', + 'dashboard', + 'packer', + 'lsp-installer', + 'lspinfo', } -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({ - -- space_char_blankline = " ", - show_current_context = true, - show_current_context_start = true, +require('indent_blankline').setup({ + -- space_char_blankline = " ", + show_current_context = true, + show_current_context_start = true, }) diff --git a/.config/nvim/lua/plugins/configs/lsp.lua b/.config/nvim/lua/plugins/configs/lsp.lua index 75e61fc5..1034eb85 100755 --- a/.config/nvim/lua/plugins/configs/lsp.lua +++ b/.config/nvim/lua/plugins/configs/lsp.lua @@ -19,7 +19,7 @@ local required_servers = { 'html', 'vimls', 'clangd', - 'omnisharp' + 'omnisharp', } for _, name in pairs(required_servers) do @@ -74,7 +74,7 @@ local rustopts = { inlay_hints = { parameter_hints_prefix = ' ', other_hints_prefix = ' ', - } + }, }, } require('rust-tools').setup(rustopts) @@ -132,7 +132,7 @@ for _, server in ipairs({ 'vimls', 'clangd', 'cmake', - 'omnisharp' + 'omnisharp', }) do lspconfig[server].setup(opts) end diff --git a/.config/nvim/lua/plugins/configs/lspconfig.lua b/.config/nvim/lua/plugins/configs/lspconfig.lua index cb74f81f..add24a33 100755 --- a/.config/nvim/lua/plugins/configs/lspconfig.lua +++ b/.config/nvim/lua/plugins/configs/lspconfig.lua @@ -1,30 +1,29 @@ local function lspSymbol(name, icon) - local hl = "DiagnosticSign" .. name - vim.fn.sign_define(hl, { text = icon, numhl = hl, texthl = hl }) + local hl = 'DiagnosticSign' .. name + vim.fn.sign_define(hl, { text = icon, numhl = hl, texthl = hl }) end -lspSymbol("Error", "") -lspSymbol("Warn", "") -lspSymbol("Info", "") -lspSymbol("Hint", "") - +lspSymbol('Error', '') +lspSymbol('Warn', '') +lspSymbol('Info', '') +lspSymbol('Hint', '') local border = { - {"🭽", "FloatBorder"}, - {"▔", "FloatBorder"}, - {"🭾", "FloatBorder"}, - {"▕", "FloatBorder"}, - {"🭿", "FloatBorder"}, - {"▁", "FloatBorder"}, - {"🭼", "FloatBorder"}, - {"▏", "FloatBorder"}, + { '🭽', 'FloatBorder' }, + { '▔', 'FloatBorder' }, + { '🭾', 'FloatBorder' }, + { '▕', 'FloatBorder' }, + { '🭿', 'FloatBorder' }, + { '▁', 'FloatBorder' }, + { '🭼', 'FloatBorder' }, + { '▏', 'FloatBorder' }, } local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...) - opts = opts or {} - opts.border = opts.border or border - return orig_util_open_floating_preview(contents, syntax, opts, ...) + opts = opts or {} + opts.border = opts.border or border + return orig_util_open_floating_preview(contents, syntax, opts, ...) end -- vim.o.updatetime = 100 @@ -35,6 +34,6 @@ vim.diagnostic.config({ severity_sort = true, update_in_insert = false, float = { - source = "always" - } + source = 'always', + }, }) diff --git a/.config/nvim/lua/plugins/configs/neoformat.lua b/.config/nvim/lua/plugins/configs/neoformat.lua index 3056b34a..72a2c975 100755 --- a/.config/nvim/lua/plugins/configs/neoformat.lua +++ b/.config/nvim/lua/plugins/configs/neoformat.lua @@ -1,8 +1,8 @@ -vim.cmd[[ +vim.cmd([[ let g:neoformat_python_black = { \ 'exe': 'black', \ 'stdin': 1, \ 'args': ['-q', '-'], \ } let g:neoformat_enabled_python = ['black'] -]] +]]) diff --git a/.config/nvim/lua/plugins/configs/neotree.lua b/.config/nvim/lua/plugins/configs/neotree.lua index 82ad1952..051cef5e 100644 --- a/.config/nvim/lua/plugins/configs/neotree.lua +++ b/.config/nvim/lua/plugins/configs/neotree.lua @@ -1,8 +1,8 @@ -local neotree = require("neo-tree") +local neotree = require('neo-tree') vim.g.neo_tree_remove_legacy_commands = 1 neotree.setup({ - filesystem = { - use_libuv_file_watcher = true, - }, + filesystem = { + use_libuv_file_watcher = true, + }, }) diff --git a/.config/nvim/lua/plugins/configs/null_ls.lua b/.config/nvim/lua/plugins/configs/null_ls.lua index 1f62a1e2..824aa414 100755 --- a/.config/nvim/lua/plugins/configs/null_ls.lua +++ b/.config/nvim/lua/plugins/configs/null_ls.lua @@ -1,10 +1,10 @@ -local null_ls = require("null-ls") +local null_ls = require('null-ls') null_ls.setup({ sources = { null_ls.builtins.formatting.shfmt, null_ls.builtins.diagnostics.hadolint, null_ls.builtins.diagnostics.shellcheck, - null_ls.builtins.diagnostics.ansiblelint + null_ls.builtins.diagnostics.ansiblelint, }, }) diff --git a/.config/nvim/lua/plugins/configs/nvim-colorizer.lua b/.config/nvim/lua/plugins/configs/nvim-colorizer.lua index 37f335e7..a6f2cf4e 100755 --- a/.config/nvim/lua/plugins/configs/nvim-colorizer.lua +++ b/.config/nvim/lua/plugins/configs/nvim-colorizer.lua @@ -1,3 +1,3 @@ -local colorizer = require("colorizer") +local colorizer = require('colorizer') colorizer.setup({}) -vim.cmd("ColorizerAttachToBuffer") +vim.cmd('ColorizerAttachToBuffer') diff --git a/.config/nvim/lua/plugins/configs/nvim-notify.lua b/.config/nvim/lua/plugins/configs/nvim-notify.lua index 03f2b183..5f2f5510 100755 --- a/.config/nvim/lua/plugins/configs/nvim-notify.lua +++ b/.config/nvim/lua/plugins/configs/nvim-notify.lua @@ -1,34 +1,34 @@ -require("notify").setup({ - -- Animation style (see below for details) - stages = "fade_in_slide_out", +require('notify').setup({ + -- Animation style (see below for details) + stages = 'fade_in_slide_out', - -- Function called when a new window is opened, use for changing win settings/config - on_open = nil, + -- Function called when a new window is opened, use for changing win settings/config + on_open = nil, - -- Function called when a window is closed - on_close = nil, + -- Function called when a window is closed + on_close = nil, - -- Render function for notifications. See notify-render() - render = "default", + -- Render function for notifications. See notify-render() + render = 'default', - -- Default timeout for notifications - timeout = 5000, + -- 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", + -- 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', - -- Minimum width for notification windows - minimum_width = 50, + -- Minimum width for notification windows + minimum_width = 50, - -- Icons for the different levels - icons = { - ERROR = "", - WARN = "", - INFO = "", - DEBUG = "", - TRACE = "✎", - }, + -- Icons for the different levels + icons = { + ERROR = '', + WARN = '', + INFO = '', + DEBUG = '', + TRACE = '✎', + }, }) -vim.notify = require("notify") +vim.notify = require('notify') diff --git a/.config/nvim/lua/plugins/configs/python-dap.lua b/.config/nvim/lua/plugins/configs/python-dap.lua index f79d650a..93849bfe 100755 --- a/.config/nvim/lua/plugins/configs/python-dap.lua +++ b/.config/nvim/lua/plugins/configs/python-dap.lua @@ -1,3 +1,3 @@ -local dap_python = require("dap-python") -dap_python.setup("~/.venvs/debugpy/bin/python") -dap_python.test_runner = "pytest" +local dap_python = require('dap-python') +dap_python.setup('~/.venvs/debugpy/bin/python') +dap_python.test_runner = 'pytest' diff --git a/.config/nvim/lua/plugins/configs/statusline.lua b/.config/nvim/lua/plugins/configs/statusline.lua index 9058f329..7dc39ca9 100755 --- a/.config/nvim/lua/plugins/configs/statusline.lua +++ b/.config/nvim/lua/plugins/configs/statusline.lua @@ -1,43 +1,43 @@ -local present, lualine = pcall(require, "lualine") +local present, lualine = pcall(require, 'lualine') if not present then - return + return end -local left_pad = "" -local right_pad = "" +local left_pad = '' +local right_pad = '' lualine.setup({ - options = { - icons_enabled = true, - theme = "auto", - component_separators = "|", - section_separators = { left = left_pad, right = right_pad }, - disabled_filetypes = {}, - always_divide_middle = true, - globalstatus = true, - }, - sections = { - lualine_a = { "mode" }, - lualine_b = { "branch", "diff", "diagnostics" }, - lualine_c = { - { - "filename", - file_status = true, - path = 1, - }, - }, - lualine_x = { "encoding", "fileformat", "filetype" }, - lualine_y = { "progress" }, - lualine_z = { "location" }, - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = { "filename" }, - lualine_x = { "location" }, - lualine_y = {}, - lualine_z = {}, - }, - tabline = {}, - extensions = { "fugitive", "fzf" }, + options = { + icons_enabled = true, + theme = 'auto', + component_separators = '|', + section_separators = { left = left_pad, right = right_pad }, + disabled_filetypes = {}, + always_divide_middle = true, + globalstatus = true, + }, + sections = { + lualine_a = { 'mode' }, + lualine_b = { 'branch', 'diff', 'diagnostics' }, + lualine_c = { + { + 'filename', + file_status = true, + path = 1, + }, + }, + lualine_x = { 'encoding', 'fileformat', 'filetype' }, + lualine_y = { 'progress' }, + lualine_z = { 'location' }, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { 'filename' }, + lualine_x = { 'location' }, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + extensions = { 'fugitive', 'fzf' }, }) diff --git a/.config/nvim/lua/plugins/configs/telescope-nvim.lua b/.config/nvim/lua/plugins/configs/telescope-nvim.lua index 9df301ef..94c4a59e 100755 --- a/.config/nvim/lua/plugins/configs/telescope-nvim.lua +++ b/.config/nvim/lua/plugins/configs/telescope-nvim.lua @@ -1,64 +1,64 @@ -local telescope = require("telescope") +local telescope = require('telescope') telescope.setup({ - defaults = { - vimgrep_arguments = { - "rg", - "--color=never", - "--no-heading", - "--with-filename", - "--line-number", - "--column", - "--smart-case", - }, - prompt_prefix = "  ", - selection_caret = " ", - entry_prefix = " ", - initial_mode = "insert", - selection_strategy = "reset", - sorting_strategy = "ascending", - layout_strategy = "flex", - layout_config = { - vertical = { - prompt_position = "top", - width = 0.90, - height = 0.98, - preview_height = 0.65, - }, - horizontal = { - prompt_position = "top", - width = 0.90, - height = 0.98, - preview_width = 0.70, - }, - flex = { - flip_cloumns = 120, - }, - }, - file_sorter = require("telescope.sorters").get_fuzzy_file, - generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter, - path_display = { "truncate" }, - winblend = 0, - border = {}, - borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, - color_devicons = true, - use_less = true, - set_env = { ["COLORTERM"] = "truecolor" }, - file_previewer = require("telescope.previewers").vim_buffer_cat.new, - grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new, - qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new, - buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker, - }, - extensions = { - media_files = { - filetypes = { "png", "webp", "jpg", "jpeg" }, - find_cmd = "rg", - }, - }, + defaults = { + vimgrep_arguments = { + 'rg', + '--color=never', + '--no-heading', + '--with-filename', + '--line-number', + '--column', + '--smart-case', + }, + prompt_prefix = '  ', + selection_caret = ' ', + entry_prefix = ' ', + initial_mode = 'insert', + selection_strategy = 'reset', + sorting_strategy = 'ascending', + layout_strategy = 'flex', + layout_config = { + vertical = { + prompt_position = 'top', + width = 0.90, + height = 0.98, + preview_height = 0.65, + }, + horizontal = { + prompt_position = 'top', + width = 0.90, + height = 0.98, + preview_width = 0.70, + }, + flex = { + flip_cloumns = 120, + }, + }, + file_sorter = require('telescope.sorters').get_fuzzy_file, + generic_sorter = require('telescope.sorters').get_generic_fuzzy_sorter, + path_display = { 'truncate' }, + winblend = 0, + border = {}, + borderchars = { '─', '│', '─', '│', '╭', '╮', '╯', '╰' }, + color_devicons = true, + use_less = true, + set_env = { ['COLORTERM'] = 'truecolor' }, + file_previewer = require('telescope.previewers').vim_buffer_cat.new, + grep_previewer = require('telescope.previewers').vim_buffer_vimgrep.new, + qflist_previewer = require('telescope.previewers').vim_buffer_qflist.new, + buffer_previewer_maker = require('telescope.previewers').buffer_previewer_maker, + }, + extensions = { + media_files = { + filetypes = { 'png', 'webp', 'jpg', 'jpeg' }, + find_cmd = 'rg', + }, + }, }) -telescope.load_extension("media_files") -telescope.load_extension("find_directories") -telescope.load_extension("file_browser") -telescope.load_extension("notify") -telescope.load_extension("fzf") +telescope.load_extension('media_files') +telescope.load_extension('find_directories') +telescope.load_extension('file_browser') +telescope.load_extension('notify') +telescope.load_extension('fzf') diff --git a/.config/nvim/lua/plugins/configs/todo-comments.lua b/.config/nvim/lua/plugins/configs/todo-comments.lua index ae7ceee1..5fbe08e7 100755 --- a/.config/nvim/lua/plugins/configs/todo-comments.lua +++ b/.config/nvim/lua/plugins/configs/todo-comments.lua @@ -1 +1 @@ -require("todo-comments").setup({}) +require('todo-comments').setup({}) diff --git a/.config/nvim/lua/plugins/configs/tokyonight.lua b/.config/nvim/lua/plugins/configs/tokyonight.lua index aea2cdd6..398c754c 100755 --- a/.config/nvim/lua/plugins/configs/tokyonight.lua +++ b/.config/nvim/lua/plugins/configs/tokyonight.lua @@ -1,7 +1,7 @@ local g = vim.g -g.tokyonight_style = "night" +g.tokyonight_style = 'night' g.tokyonight_transparent = true g.tokyonight_transparent_sidebar = true -vim.cmd("colorscheme tokyonight") +vim.cmd('colorscheme tokyonight') diff --git a/.config/nvim/lua/plugins/configs/treesitter.lua b/.config/nvim/lua/plugins/configs/treesitter.lua index 078ebd1a..e215607a 100755 --- a/.config/nvim/lua/plugins/configs/treesitter.lua +++ b/.config/nvim/lua/plugins/configs/treesitter.lua @@ -1,23 +1,23 @@ -local nvim_treesitter = require("nvim-treesitter.configs") +local nvim_treesitter = require('nvim-treesitter.configs') nvim_treesitter.setup({ - ensure_installed = { - "norg", - "norg_meta", - "norg_table", - }, - highlight = { - enable = true, - additional_vim_regex_highlighting = true, - disable = { "yaml" }, - }, - matchup = { - enable = true, - }, - autotag = { - enable = true, - }, - yati = { - enable = true, - }, + ensure_installed = { + 'norg', + 'norg_meta', + 'norg_table', + }, + highlight = { + enable = true, + additional_vim_regex_highlighting = true, + disable = { 'yaml' }, + }, + matchup = { + enable = true, + }, + autotag = { + enable = true, + }, + yati = { + enable = true, + }, }) diff --git a/.config/nvim/lua/plugins/init.lua b/.config/nvim/lua/plugins/init.lua index 9a03ba07..8451b6d0 100755 --- a/.config/nvim/lua/plugins/init.lua +++ b/.config/nvim/lua/plugins/init.lua @@ -1,5 +1,5 @@ -require("plugins.plugins") -local found, _ = pcall(require, "packer_compiled") +require('plugins.plugins') +local found, _ = pcall(require, 'packer_compiled') if not found then - vim.notify("Unable to locate packer_compiled!") + vim.notify('Unable to locate packer_compiled!') end diff --git a/.config/nvim/lua/plugins/mappings.lua b/.config/nvim/lua/plugins/mappings.lua index 97a90d30..22cd0236 100755 --- a/.config/nvim/lua/plugins/mappings.lua +++ b/.config/nvim/lua/plugins/mappings.lua @@ -1,5 +1,5 @@ local utils = require('utils.funcs') -local async = require("plenary.async") +local async = require('plenary.async') local map = utils.map -- Telescope mappings @@ -92,48 +92,47 @@ map('n', 'zm', ':ZenMode') -- SnipRun Mappings local run_snip = function() - async.run(function () + async.run(function() vim.notify.async('Running snippet, saving current buffer.', 'info', { - title = 'SnipRun' + title = 'SnipRun', }) end) vim.cmd('w') vim.cmd('SnipRun') end map('n', 'sr', '', { - callback = run_snip + callback = run_snip, }) map('v', 'sr', '', { - callback = run_snip + callback = run_snip, }) -- Packer Mappings -local packer = require("packer") -local packer_sync = function () - async.run(function () +local packer = require('packer') +local packer_sync = function() + async.run(function() vim.notify.async('Syncing packer.', 'info', { - title = 'Packer' + title = 'Packer', }) end) - local snap_shot_time = os.date("!%Y-%m-%dT%TZ") + local snap_shot_time = os.date('!%Y-%m-%dT%TZ') packer.snapshot(snap_shot_time) packer.sync() end -local packer_compile = function () - async.run(function () +local packer_compile = function() + async.run(function() vim.notify.async('Compiling packer.', 'info', { - title = 'Packer' + title = 'Packer', }) end) packer.compile() end map('n', 'ps', '', { - callback = packer_sync + callback = packer_sync, }) map('n', 'pc', '', { - callback = packer_compile + callback = packer_compile, }) - diff --git a/.config/nvim/lua/plugins/plugins.lua b/.config/nvim/lua/plugins/plugins.lua index 1c2329bb..e2123e72 100755 --- a/.config/nvim/lua/plugins/plugins.lua +++ b/.config/nvim/lua/plugins/plugins.lua @@ -119,7 +119,7 @@ return packer.startup({ ['ac'] = '@class.outer', ['ic'] = '@class.inner', ['ib'] = '@block.inner', - ['ab'] = '@block.outer' + ['ab'] = '@block.outer', }, }, move = { diff --git a/.config/nvim/lua/plugins/postload.lua b/.config/nvim/lua/plugins/postload.lua index ffbd3fb2..2110066f 100755 --- a/.config/nvim/lua/plugins/postload.lua +++ b/.config/nvim/lua/plugins/postload.lua @@ -1,3 +1,3 @@ -- Anything that needs to be loaded LAST -- needs to required here -require("plugins.mappings") +require('plugins.mappings') diff --git a/.config/nvim/lua/utils/cmd.lua b/.config/nvim/lua/utils/cmd.lua index 70c07848..d9e9329c 100755 --- a/.config/nvim/lua/utils/cmd.lua +++ b/.config/nvim/lua/utils/cmd.lua @@ -1,6 +1,6 @@ -- Highlight yanked text -vim.api.nvim_create_autocmd("TextYankPost", { - callback = function() - vim.highlight.on_yank() - end, +vim.api.nvim_create_autocmd('TextYankPost', { + callback = function() + vim.highlight.on_yank() + end, }) diff --git a/.config/nvim/lua/utils/funcs.lua b/.config/nvim/lua/utils/funcs.lua index 8867ea17..c656e1fc 100755 --- a/.config/nvim/lua/utils/funcs.lua +++ b/.config/nvim/lua/utils/funcs.lua @@ -1,126 +1,126 @@ local U = {} U.map = function(mode, lhs, rhs, opts) - local options = { noremap = true, silent = true } - if opts then - options = vim.tbl_extend("force", options, opts) - end - vim.api.nvim_set_keymap(mode, lhs, rhs, options) + local options = { noremap = true, silent = true } + if opts then + options = vim.tbl_extend('force', options, opts) + end + vim.api.nvim_set_keymap(mode, lhs, rhs, options) end U.close_buffer = function(force) - -- Yanked from NvChad, thanks to them. This saves - -- a lot of pain + -- Yanked from NvChad, thanks to them. This saves + -- a lot of pain - -- This is a modification of a NeoVim plugin from - -- Author: ojroques - Olivier Roques - -- Src: https://github.com/ojroques/nvim-bufdel + -- This is a modification of a NeoVim plugin from + -- Author: ojroques - Olivier Roques + -- Src: https://github.com/ojroques/nvim-bufdel - -- Options - local opts = { - next = "cycle", -- how to retrieve the next buffer - quit = false, -- exit when last buffer is deleted - --TODO make this a chadrc flag/option - } + -- Options + local opts = { + next = 'cycle', -- how to retrieve the next buffer + quit = false, -- exit when last buffer is deleted + --TODO make this a chadrc flag/option + } - -- ---------------- - -- Helper functions - -- ---------------- + -- ---------------- + -- Helper functions + -- ---------------- - -- Switch to buffer 'buf' on each window from list 'windows' - local function switch_buffer(windows, buf) - local cur_win = vim.fn.winnr() - for _, winid in ipairs(windows) do - vim.cmd(string.format("%d wincmd w", vim.fn.win_id2win(winid))) - vim.cmd(string.format("buffer %d", buf)) - end - vim.cmd(string.format("%d wincmd w", cur_win)) -- return to original window - end + -- Switch to buffer 'buf' on each window from list 'windows' + local function switch_buffer(windows, buf) + local cur_win = vim.fn.winnr() + for _, winid in ipairs(windows) do + vim.cmd(string.format('%d wincmd w', vim.fn.win_id2win(winid))) + vim.cmd(string.format('buffer %d', buf)) + end + vim.cmd(string.format('%d wincmd w', cur_win)) -- return to original window + end - -- Select the first buffer with a number greater than given buffer - local function get_next_buf(buf) - local next = vim.fn.bufnr("#") - if opts.next == "alternate" and vim.fn.buflisted(next) == 1 then - return next - end - for i = 0, vim.fn.bufnr("$") - 1 do - next = (buf + i) % vim.fn.bufnr("$") + 1 -- will loop back to 1 - if vim.fn.buflisted(next) == 1 then - return next - end - end - end + -- Select the first buffer with a number greater than given buffer + local function get_next_buf(buf) + local next = vim.fn.bufnr('#') + if opts.next == 'alternate' and vim.fn.buflisted(next) == 1 then + return next + end + for i = 0, vim.fn.bufnr('$') - 1 do + next = (buf + i) % vim.fn.bufnr('$') + 1 -- will loop back to 1 + if vim.fn.buflisted(next) == 1 then + return next + end + end + end - -- ---------------- - -- End helper functions - -- ---------------- + -- ---------------- + -- End helper functions + -- ---------------- - local buf = vim.fn.bufnr() - if vim.fn.buflisted(buf) == 0 then -- exit if buffer number is invalid - vim.cmd("close") - return - end + local buf = vim.fn.bufnr() + if vim.fn.buflisted(buf) == 0 then -- exit if buffer number is invalid + vim.cmd('close') + return + end - if #vim.fn.getbufinfo({ buflisted = 1 }) < 2 then - if opts.quit then - -- exit when there is only one buffer left - if force then - vim.cmd("qall!") - else - vim.cmd("confirm qall") - end - return - end + if #vim.fn.getbufinfo({ buflisted = 1 }) < 2 then + if opts.quit then + -- exit when there is only one buffer left + if force then + vim.cmd('qall!') + else + vim.cmd('confirm qall') + end + return + end - local chad_term, _ = pcall(function() - return vim.api.nvim_buf_get_var(buf, "term_type") - end) + local chad_term, _ = pcall(function() + return vim.api.nvim_buf_get_var(buf, 'term_type') + end) - if chad_term then - -- Must be a window type - vim.cmd(string.format("setlocal nobl", buf)) - vim.cmd("enew") - return - end - -- don't exit and create a new empty buffer - vim.cmd("enew") - vim.cmd("bp") - end + if chad_term then + -- Must be a window type + vim.cmd(string.format('setlocal nobl', buf)) + vim.cmd('enew') + return + end + -- don't exit and create a new empty buffer + vim.cmd('enew') + vim.cmd('bp') + end - local next_buf = get_next_buf(buf) - local windows = vim.fn.getbufinfo(buf)[1].windows + local next_buf = get_next_buf(buf) + local windows = vim.fn.getbufinfo(buf)[1].windows - -- force deletion of terminal buffers to avoid the prompt - if force or vim.fn.getbufvar(buf, "&buftype") == "terminal" then - local chad_term, type = pcall(function() - return vim.api.nvim_buf_get_var(buf, "term_type") - end) + -- force deletion of terminal buffers to avoid the prompt + if force or vim.fn.getbufvar(buf, '&buftype') == 'terminal' then + local chad_term, type = pcall(function() + return vim.api.nvim_buf_get_var(buf, 'term_type') + end) - -- TODO this scope is error prone, make resilient - if chad_term then - if type == "wind" then - -- hide from bufferline - vim.cmd(string.format("%d bufdo setlocal nobl", buf)) - -- swtich to another buff - -- TODO switch to next bufffer, this works too - vim.cmd("BufferLineCycleNext") - else - local cur_win = vim.fn.winnr() - -- we can close this window - vim.cmd(string.format("%d wincmd c", cur_win)) - return - end - else - switch_buffer(windows, next_buf) - vim.cmd(string.format("bd! %d", buf)) - end - else - switch_buffer(windows, next_buf) - vim.cmd(string.format("silent! confirm bd %d", buf)) - end - -- revert buffer switches if user has canceled deletion - if vim.fn.buflisted(buf) == 1 then - switch_buffer(windows, buf) - end + -- TODO this scope is error prone, make resilient + if chad_term then + if type == 'wind' then + -- hide from bufferline + vim.cmd(string.format('%d bufdo setlocal nobl', buf)) + -- swtich to another buff + -- TODO switch to next bufffer, this works too + vim.cmd('BufferLineCycleNext') + else + local cur_win = vim.fn.winnr() + -- we can close this window + vim.cmd(string.format('%d wincmd c', cur_win)) + return + end + else + switch_buffer(windows, next_buf) + vim.cmd(string.format('bd! %d', buf)) + end + else + switch_buffer(windows, next_buf) + vim.cmd(string.format('silent! confirm bd %d', buf)) + end + -- revert buffer switches if user has canceled deletion + if vim.fn.buflisted(buf) == 1 then + switch_buffer(windows, buf) + end end return U diff --git a/.config/nvim/lua/utils/init.lua b/.config/nvim/lua/utils/init.lua index d3a89064..8b3028bd 100755 --- a/.config/nvim/lua/utils/init.lua +++ b/.config/nvim/lua/utils/init.lua @@ -1 +1 @@ -require("utils.cmd") +require('utils.cmd')