From 79eefeb3cf125b5426aa5ad677a7105f93c5a31b Mon Sep 17 00:00:00 2001 From: Clay Gomera Date: Wed, 14 Sep 2022 10:28:06 -0400 Subject: [PATCH] updated --- user/.bash_logout | 3 + user/.config/awesome/core/apps.lua | 4 +- user/.config/awesome/theme/gruvbox/theme.lua | 2 - user/.config/nvim/.stylua.toml | 6 + user/.config/nvim/init.lua | 34 ++ user/.config/nvim/lua/core/default_config.lua | 27 ++ user/.config/nvim/lua/core/init.lua | 27 ++ user/.config/nvim/lua/core/lazy_load.lua | 94 ++++ user/.config/nvim/lua/core/mappings.lua | 407 ++++++++++++++++ user/.config/nvim/lua/core/options.lua | 103 ++++ user/.config/nvim/lua/core/utils.lua | 259 ++++++++++ user/.config/nvim/lua/custom/chadrc.lua | 27 ++ user/.config/nvim/lua/custom/mappings.lua | 407 ++++++++++++++++ .../nvim/lua/plugins/configs/alpha.lua | 110 +++++ user/.config/nvim/lua/plugins/configs/cmp.lua | 103 ++++ .../nvim/lua/plugins/configs/lspconfig.lua | 74 +++ .../nvim/lua/plugins/configs/mason.lua | 47 ++ .../nvim/lua/plugins/configs/nvimtree.lua | 90 ++++ .../nvim/lua/plugins/configs/nvterm.lua | 34 ++ .../nvim/lua/plugins/configs/others.lua | 183 +++++++ .../nvim/lua/plugins/configs/telescope.lua | 73 +++ .../nvim/lua/plugins/configs/treesitter.lua | 27 ++ .../nvim/lua/plugins/configs/whichkey.lua | 41 ++ user/.config/nvim/lua/plugins/init.lua | 225 +++++++++ user/.config/nvim/plugin/packer_compiled.lua | 458 ++++++++++++++++++ user/.config/rofi/config.rasi | 6 + user/.config/rofi/scripts/rofi_edit | 2 +- user/.config/rofi/scripts/rofi_power | 24 +- user/.config/rofi/scripts/rofi_scrot | 14 +- user/.config/rofi/scripts/rofi_wifi | 14 +- 30 files changed, 2894 insertions(+), 31 deletions(-) create mode 100644 user/.bash_logout create mode 100644 user/.config/nvim/.stylua.toml create mode 100644 user/.config/nvim/init.lua create mode 100644 user/.config/nvim/lua/core/default_config.lua create mode 100644 user/.config/nvim/lua/core/init.lua create mode 100644 user/.config/nvim/lua/core/lazy_load.lua create mode 100644 user/.config/nvim/lua/core/mappings.lua create mode 100644 user/.config/nvim/lua/core/options.lua create mode 100644 user/.config/nvim/lua/core/utils.lua create mode 100644 user/.config/nvim/lua/custom/chadrc.lua create mode 100644 user/.config/nvim/lua/custom/mappings.lua create mode 100644 user/.config/nvim/lua/plugins/configs/alpha.lua create mode 100644 user/.config/nvim/lua/plugins/configs/cmp.lua create mode 100644 user/.config/nvim/lua/plugins/configs/lspconfig.lua create mode 100644 user/.config/nvim/lua/plugins/configs/mason.lua create mode 100644 user/.config/nvim/lua/plugins/configs/nvimtree.lua create mode 100644 user/.config/nvim/lua/plugins/configs/nvterm.lua create mode 100644 user/.config/nvim/lua/plugins/configs/others.lua create mode 100644 user/.config/nvim/lua/plugins/configs/telescope.lua create mode 100644 user/.config/nvim/lua/plugins/configs/treesitter.lua create mode 100644 user/.config/nvim/lua/plugins/configs/whichkey.lua create mode 100644 user/.config/nvim/lua/plugins/init.lua create mode 100644 user/.config/nvim/plugin/packer_compiled.lua diff --git a/user/.bash_logout b/user/.bash_logout new file mode 100644 index 000000000..60c6b07a2 --- /dev/null +++ b/user/.bash_logout @@ -0,0 +1,3 @@ +# ~/.bash_logout +clear + diff --git a/user/.config/awesome/core/apps.lua b/user/.config/awesome/core/apps.lua index 81025f5ea..f8ce3c0a9 100644 --- a/user/.config/awesome/core/apps.lua +++ b/user/.config/awesome/core/apps.lua @@ -1,11 +1,11 @@ -- Apps local apps = { terminal = "alacritty", -editor = "emacsclient -c -a 'emacs'", +editor = "alacritty -e nvim", music = "alacritty -t cmus --class cmus,cmus -e cmus", chat = "alacritty -t gomuks --class gomuks,gomuks -e gomuks", game = "retroarch", file = "alacritty -t vifm --class vifm,vifm -e ./.config/vifm/scripts/vifmrun", -browser = "chromium", +browser = "qutebrowser", } return apps diff --git a/user/.config/awesome/theme/gruvbox/theme.lua b/user/.config/awesome/theme/gruvbox/theme.lua index 1e9c23c59..b7aca4fea 100644 --- a/user/.config/awesome/theme/gruvbox/theme.lua +++ b/user/.config/awesome/theme/gruvbox/theme.lua @@ -1,7 +1,5 @@ -- {{{ Imports local gears = require("gears") -local awful = require("awful") -local wibox = require("wibox") local dpi = require("beautiful.xresources").apply_dpi -- }}} diff --git a/user/.config/nvim/.stylua.toml b/user/.config/nvim/.stylua.toml new file mode 100644 index 000000000..ecb6dca5a --- /dev/null +++ b/user/.config/nvim/.stylua.toml @@ -0,0 +1,6 @@ +column_width = 120 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 2 +quote_style = "AutoPreferDouble" +call_parentheses = "None" diff --git a/user/.config/nvim/init.lua b/user/.config/nvim/init.lua new file mode 100644 index 000000000..7324b73d8 --- /dev/null +++ b/user/.config/nvim/init.lua @@ -0,0 +1,34 @@ +vim.defer_fn(function() + pcall(require, "impatient") +end, 0) + +require "core" +require "core.options" + +-- setup packer + plugins +local fn = vim.fn +local install_path = fn.stdpath "data" .. "/site/pack/packer/opt/packer.nvim" + +if fn.empty(fn.glob(install_path)) > 0 then + vim.api.nvim_set_hl(0, "NormalFloat", { bg = "#1e222a" }) + print "Cloning packer .." + fn.system { "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path } + + -- install plugins + compile their configs + vim.cmd "packadd packer.nvim" + require "plugins" + vim.cmd "PackerSync" + + -- install binaries from mason.nvim & tsparsers + vim.api.nvim_create_autocmd("User", { + pattern = "PackerComplete", + callback = function() + vim.cmd "bw | silent! MasonInstallAll" -- close packer window + require("packer").loader "nvim-treesitter" + end, + }) +end + +pcall(require, "custom") + +require("core.utils").load_mappings() diff --git a/user/.config/nvim/lua/core/default_config.lua b/user/.config/nvim/lua/core/default_config.lua new file mode 100644 index 000000000..1c7152b44 --- /dev/null +++ b/user/.config/nvim/lua/core/default_config.lua @@ -0,0 +1,27 @@ +-- Chadrc overrides this file + +local M = {} + +M.options = { + nvChad = { + update_url = "https://github.com/NvChad/NvChad", + update_branch = "main", + }, +} + +M.ui = { + -- hl = highlights + hl_add = {}, + hl_override = {}, + changed_themes = {}, + theme_toggle = { "onedark", "one_light" }, + theme = "onedark", -- default theme + transparency = false, +} + +M.plugins = {} + +-- check core.mappings for table structure +M.mappings = require "core.mappings" + +return M diff --git a/user/.config/nvim/lua/core/init.lua b/user/.config/nvim/lua/core/init.lua new file mode 100644 index 000000000..e96ca1a6d --- /dev/null +++ b/user/.config/nvim/lua/core/init.lua @@ -0,0 +1,27 @@ +-- add binaries installed by mason.nvim to path +local is_windows = vim.loop.os_uname().sysname == "Windows_NT" +vim.env.PATH = vim.env.PATH .. (is_windows and ";" or ":") .. vim.fn.stdpath "data" .. "/mason/bin" + +-- commands +vim.cmd "silent! command! NvChadUpdate lua require('nvchad').update_nvchad()" +vim.cmd "silent! command! NvChadSnapshotCreate lua require('nvchad').snap_create()" +vim.cmd "silent! command! NvChadSnapshotDelete lua require('nvchad').snap_delete()" +vim.cmd "silent! command! NvChadSnapshotCheckout lua require('nvchad').snap_checkout()" + +-- autocmds +local autocmd = vim.api.nvim_create_autocmd + +-- dont list quickfix buffers +autocmd("FileType", { + pattern = "qf", + callback = function() + vim.opt_local.buflisted = false + end, +}) + +-- wrap the PackerSync command to warn people before using it in NvChadSnapshots +autocmd("VimEnter", { + callback = function() + vim.cmd "command! -nargs=* -complete=customlist,v:lua.require'packer'.plugin_complete PackerSync lua require('plugins') require('core.utils').packer_sync()" + end, +}) diff --git a/user/.config/nvim/lua/core/lazy_load.lua b/user/.config/nvim/lua/core/lazy_load.lua new file mode 100644 index 000000000..ae7480f89 --- /dev/null +++ b/user/.config/nvim/lua/core/lazy_load.lua @@ -0,0 +1,94 @@ +local M = {} +local autocmd = vim.api.nvim_create_autocmd + +-- require("packer").loader(tb.plugins) +-- This must be used for plugins that need to be loaded just after a file +-- ex : treesitter, lspconfig etc +M.lazy_load = function(tb) + autocmd(tb.events, { + group = vim.api.nvim_create_augroup(tb.augroup_name, {}), + callback = function() + if tb.condition() then + vim.api.nvim_del_augroup_by_name(tb.augroup_name) + + -- dont defer for treesitter as it will show slow highlighting + -- This deferring only happens only when we do "nvim filename" + if tb.plugin ~= "nvim-treesitter" then + vim.defer_fn(function() + require("packer").loader(tb.plugin) + if tb.plugin == "nvim-lspconfig" then + vim.cmd "silent! do FileType" + end + end, 0) + else + require("packer").loader(tb.plugin) + end + end + end, + }) +end + +-- load certain plugins only when there's a file opened in the buffer +-- if "nvim filename" is executed -> load the plugin after nvim gui loads +-- This gives an instant preview of nvim with the file opened + +M.on_file_open = function(plugin_name) + M.lazy_load { + events = { "BufRead", "BufWinEnter", "BufNewFile" }, + augroup_name = "BeLazyOnFileOpen" .. plugin_name, + plugin = plugin_name, + condition = function() + local file = vim.fn.expand "%" + return file ~= "NvimTree_1" and file ~= "[packer]" and file ~= "" + end, + } +end + +M.packer_cmds = { + "PackerSnapshot", + "PackerSnapshotRollback", + "PackerSnapshotDelete", + "PackerInstall", + "PackerUpdate", + "PackerSync", + "PackerClean", + "PackerCompile", + "PackerStatus", + "PackerProfile", + "PackerLoad", +} + +M.treesitter_cmds = { + "TSInstall", + "TSBufEnable", + "TSBufDisable", + "TSEnable", + "TSDisable", + "TSModuleInfo", +} + +M.mason_cmds = { + "Mason", + "MasonInstall", + "MasonInstallAll", + "MasonUninstall", + "MasonUninstallAll", + "MasonLog", +} + +M.gitsigns = function() + autocmd({ "BufRead" }, { + group = vim.api.nvim_create_augroup("GitSignsLazyLoad", { clear = true }), + callback = function() + vim.fn.system("git rev-parse " .. vim.fn.expand "%:p:h") + if vim.v.shell_error == 0 then + vim.api.nvim_del_augroup_by_name "GitSignsLazyLoad" + vim.schedule(function() + require("packer").loader "gitsigns.nvim" + end) + end + end, + }) +end + +return M diff --git a/user/.config/nvim/lua/core/mappings.lua b/user/.config/nvim/lua/core/mappings.lua new file mode 100644 index 000000000..0abf7fdab --- /dev/null +++ b/user/.config/nvim/lua/core/mappings.lua @@ -0,0 +1,407 @@ +-- n, v, i, t = mode names + +local function termcodes(str) + return vim.api.nvim_replace_termcodes(str, true, true, true) +end + +local M = {} + +M.general = { + i = { + -- go to beginning and end + [""] = { "^i", "beginning of line" }, + [""] = { "", "end of line" }, + + -- navigate within insert mode + [""] = { "", "move left" }, + [""] = { "", "move right" }, + [""] = { "", "move down" }, + [""] = { "", "move up" }, + }, + + n = { + [""] = { " noh ", "no highlight" }, + + -- switch between windows + [""] = { "h", "window left" }, + [""] = { "l", "window right" }, + [""] = { "j", "window down" }, + [""] = { "k", "window up" }, + + -- save + [""] = { " w ", "save file" }, + + -- Copy all + [""] = { " %y+ ", "copy whole file" }, + + -- line numbers + ["n"] = { " set nu! ", "toggle line number" }, + ["rn"] = { " set rnu! ", "toggle relative number" }, + + -- update nvchad + ["uu"] = { " :NvChadUpdate ", "update nvchad" }, + + ["tt"] = { + function() + require("base46").toggle_theme() + end, + "toggle theme", + }, + + -- Allow moving the cursor through wrapped lines with j, k, and + -- http://www.reddit.com/r/vim/comments/2k4cbr/problem_with_gj_and_gk/ + -- empty mode is same as using :map + -- also don't use g[j|k] when in operator pending mode, so it doesn't alter d, y or c behaviour + ["j"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', opts = { expr = true } }, + ["k"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', opts = { expr = true } }, + [""] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', opts = { expr = true } }, + [""] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', opts = { expr = true } }, + + -- new buffer + ["b"] = { " enew ", "new buffer" }, + + -- close buffer + hide terminal buffer + ["x"] = { + function() + require("core.utils").close_buffer() + end, + "close buffer", + }, + }, + + t = { [""] = { termcodes "", "escape terminal mode" } }, + + v = { + [""] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', opts = { expr = true } }, + [""] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', opts = { expr = true } }, + }, + + x = { + ["j"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', opts = { expr = true } }, + ["k"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', opts = { expr = true } }, + -- Don't copy the replaced text after pasting in visual mode + -- https://vim.fandom.com/wiki/Replace_a_word_with_yanked_text#Alternative_mapping_for_paste + ["p"] = { 'p:let @+=@0:let @"=@0', opts = { silent = true } }, + }, +} + +M.tabufline = { + plugin = true, + + n = { + -- cycle through buffers + [""] = { + function() + require("core.utils").tabuflineNext() + end, + "goto next buffer", + }, + + [""] = { + function() + require("core.utils").tabuflinePrev() + end, + "goto prev buffer", + }, + + -- pick buffers via numbers + [""] = { " TbufPick ", "Pick buffer" }, + }, +} + +M.comment = { + plugin = true, + + -- toggle comment in both modes + n = { + ["/"] = { + function() + require("Comment.api").toggle.linewise.current() + end, + "toggle comment", + }, + }, + + v = { + ["/"] = { + "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", + "toggle comment", + }, + }, +} + +M.lspconfig = { + plugin = true, + + -- See ` :help vim.lsp.*` for documentation on any of the below functions + + n = { + ["gD"] = { + function() + vim.lsp.buf.declaration() + end, + "lsp declaration", + }, + + ["gd"] = { + function() + vim.lsp.buf.definition() + end, + "lsp definition", + }, + + ["K"] = { + function() + vim.lsp.buf.hover() + end, + "lsp hover", + }, + + ["gi"] = { + function() + vim.lsp.buf.implementation() + end, + "lsp implementation", + }, + + ["ls"] = { + function() + vim.lsp.buf.signature_help() + end, + "lsp signature_help", + }, + + ["D"] = { + function() + vim.lsp.buf.type_definition() + end, + "lsp definition type", + }, + + ["ra"] = { + function() + require("nvchad_ui.renamer").open() + end, + "lsp rename", + }, + + ["ca"] = { + function() + vim.lsp.buf.code_action() + end, + "lsp code_action", + }, + + ["gr"] = { + function() + vim.lsp.buf.references() + end, + "lsp references", + }, + + ["f"] = { + function() + vim.diagnostic.open_float() + end, + "floating diagnostic", + }, + + ["[d"] = { + function() + vim.diagnostic.goto_prev() + end, + "goto prev", + }, + + ["d]"] = { + function() + vim.diagnostic.goto_next() + end, + "goto_next", + }, + + ["q"] = { + function() + vim.diagnostic.setloclist() + end, + "diagnostic setloclist", + }, + + ["fm"] = { + function() + vim.lsp.buf.formatting {} + end, + "lsp formatting", + }, + + ["wa"] = { + function() + vim.lsp.buf.add_workspace_folder() + end, + "add workspace folder", + }, + + ["wr"] = { + function() + vim.lsp.buf.remove_workspace_folder() + end, + "remove workspace folder", + }, + + ["wl"] = { + function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, + "list workspace folders", + }, + }, +} + +M.nvimtree = { + plugin = true, + + n = { + -- toggle + [""] = { " NvimTreeToggle ", "toggle nvimtree" }, + + -- focus + ["e"] = { " NvimTreeFocus ", "focus nvimtree" }, + }, +} + +M.telescope = { + plugin = true, + + n = { + -- find + ["ff"] = { " Telescope find_files ", "find files" }, + ["fa"] = { " Telescope find_files follow=true no_ignore=true hidden=true ", "find all" }, + ["fw"] = { " Telescope live_grep ", "live grep" }, + ["fb"] = { " Telescope buffers ", "find buffers" }, + ["fh"] = { " Telescope help_tags ", "help page" }, + ["fo"] = { " Telescope oldfiles ", "find oldfiles" }, + ["tk"] = { " Telescope keymaps ", "show keys" }, + + -- git + ["cm"] = { " Telescope git_commits ", "git commits" }, + ["gt"] = { " Telescope git_status ", "git status" }, + + -- pick a hidden term + ["pt"] = { " Telescope terms ", "pick hidden term" }, + + -- theme switcher + ["th"] = { " Telescope themes ", "nvchad themes" }, + }, +} + +M.nvterm = { + plugin = true, + + t = { + -- toggle in terminal mode + [""] = { + function() + require("nvterm.terminal").toggle "float" + end, + "toggle floating term", + }, + + [""] = { + function() + require("nvterm.terminal").toggle "horizontal" + end, + "toggle horizontal term", + }, + + [""] = { + function() + require("nvterm.terminal").toggle "vertical" + end, + "toggle vertical term", + }, + }, + + n = { + -- toggle in normal mode + [""] = { + function() + require("nvterm.terminal").toggle "float" + end, + "toggle floating term", + }, + + [""] = { + function() + require("nvterm.terminal").toggle "horizontal" + end, + "toggle horizontal term", + }, + + [""] = { + function() + require("nvterm.terminal").toggle "vertical" + end, + "toggle vertical term", + }, + + -- new + + ["h"] = { + function() + require("nvterm.terminal").new "horizontal" + end, + "new horizontal term", + }, + + ["v"] = { + function() + require("nvterm.terminal").new "vertical" + end, + "new vertical term", + }, + }, +} + +M.whichkey = { + plugin = true, + + n = { + ["wK"] = { + function() + vim.cmd "WhichKey" + end, + "which-key all keymaps", + }, + ["wk"] = { + function() + local input = vim.fn.input "WhichKey: " + vim.cmd("WhichKey " .. input) + end, + "which-key query lookup", + }, + }, +} + +M.blankline = { + plugin = true, + + n = { + ["cc"] = { + function() + local ok, start = require("indent_blankline.utils").get_current_context( + vim.g.indent_blankline_context_patterns, + vim.g.indent_blankline_use_treesitter_scope + ) + + if ok then + vim.api.nvim_win_set_cursor(vim.api.nvim_get_current_win(), { start, 0 }) + vim.cmd [[normal! _]] + end + end, + + "Jump to current_context", + }, + }, +} + +return M diff --git a/user/.config/nvim/lua/core/options.lua b/user/.config/nvim/lua/core/options.lua new file mode 100644 index 000000000..c2a8832f6 --- /dev/null +++ b/user/.config/nvim/lua/core/options.lua @@ -0,0 +1,103 @@ +local opt = vim.opt +local g = vim.g +local config = require("core.utils").load_config() + +g.vim_version = vim.version().minor +g.nvchad_theme = config.ui.theme +g.toggle_theme_icon = "  " +g.transparency = config.ui.transparency +g.theme_switcher_loaded = false + +-- use filetype.lua instead of filetype.vim. it's enabled by default in neovim 0.8 (nightly) +if g.vim_version < 8 then + g.did_load_filetypes = 0 + g.do_filetype_lua = 1 +end + +opt.laststatus = 3 -- global statusline +opt.showmode = false + +opt.title = true +opt.clipboard = "unnamedplus" +opt.cursorline = true + +-- Indenting +opt.expandtab = true +opt.shiftwidth = 2 +opt.smartindent = true +opt.tabstop = 2 +opt.softtabstop = 2 + +opt.fillchars = { eob = " " } +opt.ignorecase = true +opt.smartcase = true +opt.mouse = "a" + +-- Numbers +opt.number = true +opt.numberwidth = 2 +opt.ruler = false + +-- disable nvim intro +opt.shortmess:append "sI" + +opt.signcolumn = "yes" +opt.splitbelow = true +opt.splitright = true +opt.termguicolors = true +opt.timeoutlen = 400 +opt.undofile = true + +-- interval for writing swap file to disk, also used by gitsigns +opt.updatetime = 250 + +-- go to previous/next line with h,l,left arrow and right arrow +-- when cursor reaches end/beginning of line +opt.whichwrap:append "<>[]hl" + +g.mapleader = " " + +-- disable some builtin vim plugins +local default_plugins = { + "2html_plugin", + "getscript", + "getscriptPlugin", + "gzip", + "logipat", + "netrw", + "netrwPlugin", + "netrwSettings", + "netrwFileHandlers", + "matchit", + "tar", + "tarPlugin", + "rrhelper", + "spellfile_plugin", + "vimball", + "vimballPlugin", + "zip", + "zipPlugin", + "tutor", + "rplugin", + "syntax", + "synmenu", + "optwin", + "compiler", + "bugreport", + "ftplugin", +} + +for _, plugin in pairs(default_plugins) do + g["loaded_" .. plugin] = 1 +end + +local default_providers = { + "node", + "perl", + "python3", + "ruby", +} + +for _, provider in ipairs(default_providers) do + vim.g["loaded_" .. provider .. "_provider"] = 0 +end diff --git a/user/.config/nvim/lua/core/utils.lua b/user/.config/nvim/lua/core/utils.lua new file mode 100644 index 000000000..6c23977dc --- /dev/null +++ b/user/.config/nvim/lua/core/utils.lua @@ -0,0 +1,259 @@ +local M = {} +local api = vim.api + +local merge_tb = vim.tbl_deep_extend + +M.close_buffer = function(bufnr) + if vim.bo.buftype == "terminal" then + vim.cmd(vim.bo.buflisted and "set nobl | enew" or "hide") + else + bufnr = bufnr or api.nvim_get_current_buf() + require("core.utils").tabuflinePrev() + vim.cmd("confirm bd" .. bufnr) + end +end + +M.load_config = function() + local config = require "core.default_config" + local chadrc_exists, chadrc = pcall(require, "custom.chadrc") + + if chadrc_exists then + -- merge user config if it exists and is a table; otherwise display an error + if type(chadrc) == "table" then + config.mappings = M.remove_disabled_keys(chadrc.mappings, config.mappings) + config = merge_tb("force", config, chadrc) or {} + else + error "chadrc must return a table!" + end + end + + config.mappings.disabled = nil + return config +end + +M.remove_disabled_keys = function(chadrc_mappings, default_mappings) + if not chadrc_mappings then + return default_mappings + end + + -- store keys in a array with true value to compare + local keys_to_disable = {} + for _, mappings in pairs(chadrc_mappings) do + for mode, section_keys in pairs(mappings) do + if not keys_to_disable[mode] then + keys_to_disable[mode] = {} + end + section_keys = (type(section_keys) == "table" and section_keys) or {} + for k, _ in pairs(section_keys) do + keys_to_disable[mode][k] = true + end + end + end + + -- make a copy as we need to modify default_mappings + for section_name, section_mappings in pairs(default_mappings) do + for mode, mode_mappings in pairs(section_mappings) do + mode_mappings = (type(mode_mappings) == "table" and mode_mappings) or {} + for k, _ in pairs(mode_mappings) do + -- if key if found then remove from default_mappings + if keys_to_disable[mode] and keys_to_disable[mode][k] then + default_mappings[section_name][mode][k] = nil + end + end + end + end + + return default_mappings +end + +M.load_mappings = function(section, mapping_opt) + local function set_section_map(section_values) + if section_values.plugin then + return + end + section_values.plugin = nil + + for mode, mode_values in pairs(section_values) do + local default_opts = merge_tb("force", { mode = mode }, mapping_opt or {}) + for keybind, mapping_info in pairs(mode_values) do + -- merge default + user opts + local opts = merge_tb("force", default_opts, mapping_info.opts or {}) + + mapping_info.opts, opts.mode = nil, nil + opts.desc = mapping_info[2] + + vim.keymap.set(mode, keybind, mapping_info[1], opts) + end + end + end + + local mappings = require("core.utils").load_config().mappings + + if type(section) == "string" then + mappings[section]["plugin"] = nil + mappings = { mappings[section] } + end + + for _, sect in pairs(mappings) do + set_section_map(sect) + end +end + +-- merge default/user plugin tables +M.merge_plugins = function(plugins) + local plugin_configs = M.load_config().plugins + local user_plugins = plugin_configs + + -- old plugin syntax for adding plugins + if plugin_configs.user and type(plugin_configs.user) == "table" then + user_plugins = plugin_configs.user + end + + -- support old plugin removal syntax + local remove_plugins = plugin_configs.remove + if type(remove_plugins) == "table" then + for _, v in ipairs(remove_plugins) do + plugins[v] = nil + end + end + + plugins = merge_tb("force", plugins, user_plugins) + + local final_table = {} + + for key, val in pairs(plugins) do + if val and type(val) == "table" then + plugins[key] = val.rm_default_opts and user_plugins[key] or plugins[key] + plugins[key][1] = key + final_table[#final_table + 1] = plugins[key] + end + end + + return final_table +end + +-- override plugin options table with custom ones +M.load_override = function(options_table, name) + local plugin_configs, plugin_options = M.load_config().plugins, nil + + -- support old plugin syntax for override + local user_override = plugin_configs.override and plugin_configs.override[name] + if user_override and type(user_override) == "table" then + plugin_options = user_override + end + + -- if no old style plugin override is found, then use the new syntax + if not plugin_options and plugin_configs[name] then + local override_options = plugin_configs[name].override_options or {} + if type(override_options) == "table" then + plugin_options = override_options + elseif type(override_options) == "function" then + plugin_options = override_options() + end + end + + -- make sure the plugin options are a table + plugin_options = type(plugin_options) == "table" and plugin_options or {} + + return merge_tb("force", options_table, plugin_options) +end + +M.packer_sync = function(...) + local git_exists, git = pcall(require, "nvchad.utils.git") + local defaults_exists, defaults = pcall(require, "nvchad.utils.config") + local packer_exists, packer = pcall(require, "packer") + + if git_exists and defaults_exists then + local current_branch_name = git.get_current_branch_name() + + -- warn the user if we are on a snapshot branch + if current_branch_name:match(defaults.snaps.base_snap_branch_name .. "(.+)" .. "$") then + vim.api.nvim_echo({ + { "WARNING: You are trying to use ", "WarningMsg" }, + { "PackerSync" }, + { + " on a NvChadSnapshot. This will cause issues if NvChad dependencies contain " + .. "any breaking changes! Plugin updates will not be included in this " + .. "snapshot, so they will be lost after switching between snapshots! Would " + .. "you still like to continue? [y/N]\n", + "WarningMsg", + }, + }, false, {}) + + local ans = vim.trim(string.lower(vim.fn.input "-> ")) + + if ans ~= "y" then + return + end + end + end + + if packer_exists then + packer.sync(...) + + local plugins = M.load_config().plugins + local old_style_options = plugins.user or plugins.override or plugins.remove + if old_style_options then + vim.notify_once("NvChad: This plugin syntax is deprecated, use new style config.", "Error") + end + else + error "Packer could not be loaded!" + end +end + +M.bufilter = function() + local bufs = vim.t.bufs or nil + + if not bufs then + return {} + end + + for i = #bufs, 1, -1 do + if not vim.api.nvim_buf_is_valid(bufs[i]) then + table.remove(bufs, i) + end + end + + return bufs +end + +M.tabuflineNext = function() + local bufs = M.bufilter() or {} + + for i, v in ipairs(bufs) do + if api.nvim_get_current_buf() == v then + vim.cmd(i == #bufs and "b" .. bufs[1] or "b" .. bufs[i + 1]) + break + end + end +end + +M.tabuflinePrev = function() + local bufs = M.bufilter() or {} + + for i, v in ipairs(bufs) do + if api.nvim_get_current_buf() == v then + vim.cmd(i == 1 and "b" .. bufs[#bufs] or "b" .. bufs[i - 1]) + break + end + end +end + +-- closes tab + all of its buffers +M.closeAllBufs = function(action) + local bufs = vim.t.bufs + + if action == "closeTab" then + vim.cmd "tabclose" + end + + for _, buf in ipairs(bufs) do + M.close_buffer(buf) + end + + if action ~= "closeTab" then + vim.cmd "enew" + end +end + +return M diff --git a/user/.config/nvim/lua/custom/chadrc.lua b/user/.config/nvim/lua/custom/chadrc.lua new file mode 100644 index 000000000..6e71c791b --- /dev/null +++ b/user/.config/nvim/lua/custom/chadrc.lua @@ -0,0 +1,27 @@ +-- Chadrc overrides this file + +local M = {} + +M.options = { + nvChad = { + update_url = "https://github.com/NvChad/NvChad", + update_branch = "main", + }, +} + +M.ui = { + -- hl = highlights + hl_add = {}, + hl_override = {}, + changed_themes = {}, + theme_toggle = { "gruvbox", "gruvbox-light" }, + theme = "gruvbox", -- default theme + transparency = false, +} + +M.plugins = {} + +-- check core.mappings for table structure +M.mappings = require "core.mappings" + +return M diff --git a/user/.config/nvim/lua/custom/mappings.lua b/user/.config/nvim/lua/custom/mappings.lua new file mode 100644 index 000000000..0abf7fdab --- /dev/null +++ b/user/.config/nvim/lua/custom/mappings.lua @@ -0,0 +1,407 @@ +-- n, v, i, t = mode names + +local function termcodes(str) + return vim.api.nvim_replace_termcodes(str, true, true, true) +end + +local M = {} + +M.general = { + i = { + -- go to beginning and end + [""] = { "^i", "beginning of line" }, + [""] = { "", "end of line" }, + + -- navigate within insert mode + [""] = { "", "move left" }, + [""] = { "", "move right" }, + [""] = { "", "move down" }, + [""] = { "", "move up" }, + }, + + n = { + [""] = { " noh ", "no highlight" }, + + -- switch between windows + [""] = { "h", "window left" }, + [""] = { "l", "window right" }, + [""] = { "j", "window down" }, + [""] = { "k", "window up" }, + + -- save + [""] = { " w ", "save file" }, + + -- Copy all + [""] = { " %y+ ", "copy whole file" }, + + -- line numbers + ["n"] = { " set nu! ", "toggle line number" }, + ["rn"] = { " set rnu! ", "toggle relative number" }, + + -- update nvchad + ["uu"] = { " :NvChadUpdate ", "update nvchad" }, + + ["tt"] = { + function() + require("base46").toggle_theme() + end, + "toggle theme", + }, + + -- Allow moving the cursor through wrapped lines with j, k, and + -- http://www.reddit.com/r/vim/comments/2k4cbr/problem_with_gj_and_gk/ + -- empty mode is same as using :map + -- also don't use g[j|k] when in operator pending mode, so it doesn't alter d, y or c behaviour + ["j"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', opts = { expr = true } }, + ["k"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', opts = { expr = true } }, + [""] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', opts = { expr = true } }, + [""] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', opts = { expr = true } }, + + -- new buffer + ["b"] = { " enew ", "new buffer" }, + + -- close buffer + hide terminal buffer + ["x"] = { + function() + require("core.utils").close_buffer() + end, + "close buffer", + }, + }, + + t = { [""] = { termcodes "", "escape terminal mode" } }, + + v = { + [""] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', opts = { expr = true } }, + [""] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', opts = { expr = true } }, + }, + + x = { + ["j"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', opts = { expr = true } }, + ["k"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', opts = { expr = true } }, + -- Don't copy the replaced text after pasting in visual mode + -- https://vim.fandom.com/wiki/Replace_a_word_with_yanked_text#Alternative_mapping_for_paste + ["p"] = { 'p:let @+=@0:let @"=@0', opts = { silent = true } }, + }, +} + +M.tabufline = { + plugin = true, + + n = { + -- cycle through buffers + [""] = { + function() + require("core.utils").tabuflineNext() + end, + "goto next buffer", + }, + + [""] = { + function() + require("core.utils").tabuflinePrev() + end, + "goto prev buffer", + }, + + -- pick buffers via numbers + [""] = { " TbufPick ", "Pick buffer" }, + }, +} + +M.comment = { + plugin = true, + + -- toggle comment in both modes + n = { + ["/"] = { + function() + require("Comment.api").toggle.linewise.current() + end, + "toggle comment", + }, + }, + + v = { + ["/"] = { + "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", + "toggle comment", + }, + }, +} + +M.lspconfig = { + plugin = true, + + -- See ` :help vim.lsp.*` for documentation on any of the below functions + + n = { + ["gD"] = { + function() + vim.lsp.buf.declaration() + end, + "lsp declaration", + }, + + ["gd"] = { + function() + vim.lsp.buf.definition() + end, + "lsp definition", + }, + + ["K"] = { + function() + vim.lsp.buf.hover() + end, + "lsp hover", + }, + + ["gi"] = { + function() + vim.lsp.buf.implementation() + end, + "lsp implementation", + }, + + ["ls"] = { + function() + vim.lsp.buf.signature_help() + end, + "lsp signature_help", + }, + + ["D"] = { + function() + vim.lsp.buf.type_definition() + end, + "lsp definition type", + }, + + ["ra"] = { + function() + require("nvchad_ui.renamer").open() + end, + "lsp rename", + }, + + ["ca"] = { + function() + vim.lsp.buf.code_action() + end, + "lsp code_action", + }, + + ["gr"] = { + function() + vim.lsp.buf.references() + end, + "lsp references", + }, + + ["f"] = { + function() + vim.diagnostic.open_float() + end, + "floating diagnostic", + }, + + ["[d"] = { + function() + vim.diagnostic.goto_prev() + end, + "goto prev", + }, + + ["d]"] = { + function() + vim.diagnostic.goto_next() + end, + "goto_next", + }, + + ["q"] = { + function() + vim.diagnostic.setloclist() + end, + "diagnostic setloclist", + }, + + ["fm"] = { + function() + vim.lsp.buf.formatting {} + end, + "lsp formatting", + }, + + ["wa"] = { + function() + vim.lsp.buf.add_workspace_folder() + end, + "add workspace folder", + }, + + ["wr"] = { + function() + vim.lsp.buf.remove_workspace_folder() + end, + "remove workspace folder", + }, + + ["wl"] = { + function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, + "list workspace folders", + }, + }, +} + +M.nvimtree = { + plugin = true, + + n = { + -- toggle + [""] = { " NvimTreeToggle ", "toggle nvimtree" }, + + -- focus + ["e"] = { " NvimTreeFocus ", "focus nvimtree" }, + }, +} + +M.telescope = { + plugin = true, + + n = { + -- find + ["ff"] = { " Telescope find_files ", "find files" }, + ["fa"] = { " Telescope find_files follow=true no_ignore=true hidden=true ", "find all" }, + ["fw"] = { " Telescope live_grep ", "live grep" }, + ["fb"] = { " Telescope buffers ", "find buffers" }, + ["fh"] = { " Telescope help_tags ", "help page" }, + ["fo"] = { " Telescope oldfiles ", "find oldfiles" }, + ["tk"] = { " Telescope keymaps ", "show keys" }, + + -- git + ["cm"] = { " Telescope git_commits ", "git commits" }, + ["gt"] = { " Telescope git_status ", "git status" }, + + -- pick a hidden term + ["pt"] = { " Telescope terms ", "pick hidden term" }, + + -- theme switcher + ["th"] = { " Telescope themes ", "nvchad themes" }, + }, +} + +M.nvterm = { + plugin = true, + + t = { + -- toggle in terminal mode + [""] = { + function() + require("nvterm.terminal").toggle "float" + end, + "toggle floating term", + }, + + [""] = { + function() + require("nvterm.terminal").toggle "horizontal" + end, + "toggle horizontal term", + }, + + [""] = { + function() + require("nvterm.terminal").toggle "vertical" + end, + "toggle vertical term", + }, + }, + + n = { + -- toggle in normal mode + [""] = { + function() + require("nvterm.terminal").toggle "float" + end, + "toggle floating term", + }, + + [""] = { + function() + require("nvterm.terminal").toggle "horizontal" + end, + "toggle horizontal term", + }, + + [""] = { + function() + require("nvterm.terminal").toggle "vertical" + end, + "toggle vertical term", + }, + + -- new + + ["h"] = { + function() + require("nvterm.terminal").new "horizontal" + end, + "new horizontal term", + }, + + ["v"] = { + function() + require("nvterm.terminal").new "vertical" + end, + "new vertical term", + }, + }, +} + +M.whichkey = { + plugin = true, + + n = { + ["wK"] = { + function() + vim.cmd "WhichKey" + end, + "which-key all keymaps", + }, + ["wk"] = { + function() + local input = vim.fn.input "WhichKey: " + vim.cmd("WhichKey " .. input) + end, + "which-key query lookup", + }, + }, +} + +M.blankline = { + plugin = true, + + n = { + ["cc"] = { + function() + local ok, start = require("indent_blankline.utils").get_current_context( + vim.g.indent_blankline_context_patterns, + vim.g.indent_blankline_use_treesitter_scope + ) + + if ok then + vim.api.nvim_win_set_cursor(vim.api.nvim_get_current_win(), { start, 0 }) + vim.cmd [[normal! _]] + end + end, + + "Jump to current_context", + }, + }, +} + +return M diff --git a/user/.config/nvim/lua/plugins/configs/alpha.lua b/user/.config/nvim/lua/plugins/configs/alpha.lua new file mode 100644 index 000000000..b91c23339 --- /dev/null +++ b/user/.config/nvim/lua/plugins/configs/alpha.lua @@ -0,0 +1,110 @@ +local present, alpha = pcall(require, "alpha") + +if not present then + return +end + +require("base46").load_highlight "alpha" + +local function button(sc, txt, keybind) + local sc_ = sc:gsub("%s", ""):gsub("SPC", "") + + local opts = { + position = "center", + text = txt, + shortcut = sc, + cursor = 5, + width = 36, + align_shortcut = "right", + hl = "AlphaButtons", + } + + if keybind then + opts.keymap = { "n", sc_, keybind, { noremap = true, silent = true } } + end + + return { + type = "button", + val = txt, + on_press = function() + local key = vim.api.nvim_replace_termcodes(sc_, true, false, true) or "" + vim.api.nvim_feedkeys(key, "normal", false) + end, + opts = opts, + } +end + +-- dynamic header padding +local fn = vim.fn +local marginTopPercent = 0.3 +local headerPadding = fn.max { 2, fn.floor(fn.winheight(0) * marginTopPercent) } + +local options = { + + header = { + type = "text", + val = { + " ⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣿⣶⣿⣦⣼⣆ ", + " ⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦ ", + " ⠈⢿⣿⣟⠦ ⣾⣿⣿⣷ ⠻⠿⢿⣿⣧⣄ ", + " ⣸⣿⣿⢧ ⢻⠻⣿⣿⣷⣄⣀⠄⠢⣀⡀⠈⠙⠿⠄ ", + " ⢠⣿⣿⣿⠈ ⣻⣿⣿⣿⣿⣿⣿⣿⣛⣳⣤⣀⣀ ", + " ⢠⣧⣶⣥⡤⢄ ⣸⣿⣿⠘ ⢀⣴⣿⣿⡿⠛⣿⣿⣧⠈⢿⠿⠟⠛⠻⠿⠄ ", + " ⣰⣿⣿⠛⠻⣿⣿⡦⢹⣿⣷ ⢊⣿⣿⡏ ⢸⣿⣿⡇ ⢀⣠⣄⣾⠄ ", + " ⣠⣿⠿⠛ ⢀⣿⣿⣷⠘⢿⣿⣦⡀ ⢸⢿⣿⣿⣄ ⣸⣿⣿⡇⣪⣿⡿⠿⣿⣷⡄ ", + " ⠙⠃ ⣼⣿⡟ ⠈⠻⣿⣿⣦⣌⡇⠻⣿⣿⣷⣿⣿⣿ ⣿⣿⡇ ⠛⠻⢷⣄ ", + " ⢻⣿⣿⣄ ⠈⠻⣿⣿⣿⣷⣿⣿⣿⣿⣿⡟ ⠫⢿⣿⡆ ", + " ⠻⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⡟⢀⣀⣤⣾⡿⠃ ", + }, + opts = { + position = "center", + hl = "AlphaHeader", + }, + }, + + buttons = { + type = "group", + val = { + button("SPC f f", " Find File ", ":Telescope find_files"), + button("SPC f o", " Recent File ", ":Telescope oldfiles"), + button("SPC f w", " Find Word ", ":Telescope live_grep"), + button("SPC b m", " Bookmarks ", ":Telescope marks"), + button("SPC t h", " Themes ", ":Telescope themes"), + button("SPC e s", " Settings", ":e $MYVIMRC | :cd %:p:h "), + }, + opts = { + spacing = 1, + }, + }, + + headerPaddingTop = { type = "padding", val = headerPadding }, + headerPaddingBottom = { type = "padding", val = 2 }, +} + +options = require("core.utils").load_override(options, "goolord/alpha-nvim") + +alpha.setup { + layout = { + options.headerPaddingTop, + options.header, + options.headerPaddingBottom, + options.buttons, + }, + opts = {}, +} + +-- Disable statusline in dashboard +vim.api.nvim_create_autocmd("FileType", { + pattern = "alpha", + callback = function() + -- store current statusline value and use that + local old_laststatus = vim.opt.laststatus + vim.api.nvim_create_autocmd("BufUnload", { + buffer = 0, + callback = function() + vim.opt.laststatus = old_laststatus + end, + }) + vim.opt.laststatus = 0 + end, +}) diff --git a/user/.config/nvim/lua/plugins/configs/cmp.lua b/user/.config/nvim/lua/plugins/configs/cmp.lua new file mode 100644 index 000000000..2b69b6b0d --- /dev/null +++ b/user/.config/nvim/lua/plugins/configs/cmp.lua @@ -0,0 +1,103 @@ +local present, cmp = pcall(require, "cmp") + +if not present then + return +end + +require("base46").load_highlight "cmp" + +vim.opt.completeopt = "menuone,noselect" + +local function border(hl_name) + return { + { "╭", hl_name }, + { "─", hl_name }, + { "╮", hl_name }, + { "│", hl_name }, + { "╯", hl_name }, + { "─", hl_name }, + { "╰", hl_name }, + { "│", hl_name }, + } +end + +local cmp_window = require "cmp.utils.window" + +cmp_window.info_ = cmp_window.info +cmp_window.info = function(self) + local info = self:info_() + info.scrollable = false + return info +end + +local options = { + window = { + completion = { + border = border "CmpBorder", + winhighlight = "Normal:CmpPmenu,CursorLine:PmenuSel,Search:None", + }, + documentation = { + border = border "CmpDocBorder", + }, + }, + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + formatting = { + format = function(_, vim_item) + local icons = require("nvchad_ui.icons").lspkind + vim_item.kind = string.format("%s %s", icons[vim_item.kind], vim_item.kind) + return vim_item + end, + }, + mapping = { + [""] = cmp.mapping.select_prev_item(), + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.close(), + [""] = cmp.mapping.confirm { + behavior = cmp.ConfirmBehavior.Replace, + select = false, + }, + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif require("luasnip").expand_or_jumpable() then + vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-expand-or-jump", true, true, true), "") + else + fallback() + end + end, { + "i", + "s", + }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif require("luasnip").jumpable(-1) then + vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-jump-prev", true, true, true), "") + else + fallback() + end + end, { + "i", + "s", + }), + }, + sources = { + { name = "luasnip" }, + { name = "nvim_lsp" }, + { name = "buffer" }, + { name = "nvim_lua" }, + { name = "path" }, + }, +} + +-- check for any override +options = require("core.utils").load_override(options, "hrsh7th/nvim-cmp") + +cmp.setup(options) diff --git a/user/.config/nvim/lua/plugins/configs/lspconfig.lua b/user/.config/nvim/lua/plugins/configs/lspconfig.lua new file mode 100644 index 000000000..0c168303e --- /dev/null +++ b/user/.config/nvim/lua/plugins/configs/lspconfig.lua @@ -0,0 +1,74 @@ +local present, lspconfig = pcall(require, "lspconfig") + +if not present then + return +end + +require("base46").load_highlight "lsp" +require "nvchad_ui.lsp" + +local M = {} +local utils = require "core.utils" + +-- export on_attach & capabilities for custom lspconfigs + +M.on_attach = function(client, bufnr) + if vim.g.vim_version > 7 then + -- nightly + client.server_capabilities.documentFormattingProvider = false + client.server_capabilities.documentRangeFormattingProvider = false + else + -- stable + client.resolved_capabilities.document_formatting = false + client.resolved_capabilities.document_range_formatting = false + end + + utils.load_mappings("lspconfig", { buffer = bufnr }) + + if client.server_capabilities.signatureHelpProvider then + require("nvchad_ui.signature").setup(client) + end +end + +M.capabilities = vim.lsp.protocol.make_client_capabilities() + +M.capabilities.textDocument.completion.completionItem = { + documentationFormat = { "markdown", "plaintext" }, + snippetSupport = true, + preselectSupport = true, + insertReplaceSupport = true, + labelDetailsSupport = true, + deprecatedSupport = true, + commitCharactersSupport = true, + tagSupport = { valueSet = { 1 } }, + resolveSupport = { + properties = { + "documentation", + "detail", + "additionalTextEdits", + }, + }, +} + +lspconfig.sumneko_lua.setup { + on_attach = M.on_attach, + capabilities = M.capabilities, + + settings = { + Lua = { + diagnostics = { + globals = { "vim" }, + }, + workspace = { + library = { + [vim.fn.expand "$VIMRUNTIME/lua"] = true, + [vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true, + }, + maxPreload = 100000, + preloadFileSize = 10000, + }, + }, + }, +} + +return M diff --git a/user/.config/nvim/lua/plugins/configs/mason.lua b/user/.config/nvim/lua/plugins/configs/mason.lua new file mode 100644 index 000000000..b330bda8c --- /dev/null +++ b/user/.config/nvim/lua/plugins/configs/mason.lua @@ -0,0 +1,47 @@ +local present, mason = pcall(require, "mason") + +if not present then + return +end + +vim.api.nvim_create_augroup("_mason", { clear = true }) +vim.api.nvim_create_autocmd("Filetype", { + pattern = "mason", + callback = function() + require("base46").load_highlight "mason" + end, + group = "_mason", +}) + +local options = { + ensure_installed = { "lua-language-server" }, -- not an option from mason.nvim + + ui = { + icons = { + package_pending = " ", + package_installed = " ", + package_uninstalled = " ﮊ", + }, + + keymaps = { + toggle_server_expand = "", + install_server = "i", + update_server = "u", + check_server_version = "c", + update_all_servers = "U", + check_outdated_servers = "C", + uninstall_server = "X", + cancel_installation = "", + }, + }, + + max_concurrent_installers = 10, +} + +options = require("core.utils").load_override(options, "williamboman/mason.nvim") + +vim.api.nvim_create_user_command("MasonInstallAll", function() + vim.cmd("MasonInstall " .. table.concat(options.ensure_installed, " ")) +end, {}) + +mason.setup(options) diff --git a/user/.config/nvim/lua/plugins/configs/nvimtree.lua b/user/.config/nvim/lua/plugins/configs/nvimtree.lua new file mode 100644 index 000000000..0f1733e8b --- /dev/null +++ b/user/.config/nvim/lua/plugins/configs/nvimtree.lua @@ -0,0 +1,90 @@ +local present, nvimtree = pcall(require, "nvim-tree") + +if not present then + return +end + +require("base46").load_highlight "nvimtree" + +local options = { + filters = { + dotfiles = false, + exclude = { vim.fn.stdpath "config" .. "/lua/custom" }, + }, + disable_netrw = true, + hijack_netrw = true, + open_on_setup = false, + ignore_ft_on_setup = { "alpha" }, + hijack_cursor = true, + hijack_unnamed_buffer_when_opening = false, + update_cwd = true, + update_focused_file = { + enable = true, + update_cwd = false, + }, + view = { + adaptive_size = true, + side = "left", + width = 25, + hide_root_folder = true, + }, + git = { + enable = false, + ignore = true, + }, + filesystem_watchers = { + enable = true, + }, + actions = { + open_file = { + resize_window = true, + }, + }, + renderer = { + highlight_git = false, + highlight_opened_files = "none", + + indent_markers = { + enable = false, + }, + + icons = { + show = { + file = true, + folder = true, + folder_arrow = true, + git = false, + }, + + glyphs = { + default = "", + symlink = "", + folder = { + default = "", + empty = "", + empty_open = "", + open = "", + symlink = "", + symlink_open = "", + arrow_open = "", + arrow_closed = "", + }, + git = { + unstaged = "✗", + staged = "✓", + unmerged = "", + renamed = "➜", + untracked = "★", + deleted = "", + ignored = "◌", + }, + }, + }, + }, +} + +-- check for any override +options = require("core.utils").load_override(options, "kyazdani42/nvim-tree.lua") +vim.g.nvimtree_side = options.view.side + +nvimtree.setup(options) diff --git a/user/.config/nvim/lua/plugins/configs/nvterm.lua b/user/.config/nvim/lua/plugins/configs/nvterm.lua new file mode 100644 index 000000000..2c82e14c1 --- /dev/null +++ b/user/.config/nvim/lua/plugins/configs/nvterm.lua @@ -0,0 +1,34 @@ +local present, nvterm = pcall(require, "nvterm") + +if not present then + return +end + +require "base46.term" + +local options = { + terminals = { + list = {}, + type_opts = { + float = { + relative = "editor", + row = 0.3, + col = 0.25, + width = 0.5, + height = 0.4, + border = "single", + }, + horizontal = { location = "rightbelow", split_ratio = 0.3 }, + vertical = { location = "rightbelow", split_ratio = 0.5 }, + }, + }, + behavior = { + close_on_exit = true, + auto_insert = true, + }, + enable_new_mappings = true, +} + +options = require("core.utils").load_override(options, "NvChad/nvterm") + +nvterm.setup(options) diff --git a/user/.config/nvim/lua/plugins/configs/others.lua b/user/.config/nvim/lua/plugins/configs/others.lua new file mode 100644 index 000000000..e0870d250 --- /dev/null +++ b/user/.config/nvim/lua/plugins/configs/others.lua @@ -0,0 +1,183 @@ +local M = {} + +local load_override = require("core.utils").load_override + +M.autopairs = function() + local present1, autopairs = pcall(require, "nvim-autopairs") + local present2, cmp = pcall(require, "cmp") + + if not (present1 and present2) then + return + end + + local options = { + fast_wrap = {}, + disable_filetype = { "TelescopePrompt", "vim" }, + } + + options = load_override(options, "windwp/nvim-autopairs") + autopairs.setup(options) + + local cmp_autopairs = require "nvim-autopairs.completion.cmp" + cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) +end + +M.blankline = function() + local present, blankline = pcall(require, "indent_blankline") + + if not present then + return + end + + require("base46").load_highlight "blankline" + + local options = { + indentLine_enabled = 1, + filetype_exclude = { + "help", + "terminal", + "alpha", + "packer", + "lspinfo", + "TelescopePrompt", + "TelescopeResults", + "mason", + "", + }, + buftype_exclude = { "terminal" }, + show_trailing_blankline_indent = false, + show_first_indent_level = false, + show_current_context = true, + show_current_context_start = true, + } + + options = load_override(options, "lukas-reineke/indent-blankline.nvim") + blankline.setup(options) +end + +M.colorizer = function() + local present, colorizer = pcall(require, "colorizer") + + if not present then + return + end + + local options = { + filetypes = { + "*", + }, + user_default_options = { + RGB = true, -- #RGB hex codes + RRGGBB = true, -- #RRGGBB hex codes + names = false, -- "Name" codes like Blue + RRGGBBAA = false, -- #RRGGBBAA hex codes + rgb_fn = false, -- CSS rgb() and rgba() functions + hsl_fn = false, -- CSS hsl() and hsla() functions + css = false, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB + css_fn = false, -- Enable all CSS *functions*: rgb_fn, hsl_fn + mode = "background", -- Set the display mode. + }, + } + + options = load_override(options, "NvChad/nvim-colorizer.lua") + colorizer.setup(options) + -- execute colorizer as soon as possible + return vim.tbl_isempty(options.filetypes or {}) or vim.cmd [[do FileType]] +end + +M.comment = function() + local present, nvim_comment = pcall(require, "Comment") + + if not present then + return + end + + local options = {} + options = load_override(options, "numToStr/Comment.nvim") + nvim_comment.setup(options) +end + +M.luasnip = function() + local present, luasnip = pcall(require, "luasnip") + + if not present then + return + end + + local options = { + history = true, + updateevents = "TextChanged,TextChangedI", + } + + options = load_override(options, "L3MON4D3/LuaSnip") + luasnip.config.set_config(options) + require("luasnip.loaders.from_vscode").lazy_load() + require("luasnip.loaders.from_vscode").lazy_load { paths = vim.g.luasnippets_path or "" } + + vim.api.nvim_create_autocmd("InsertLeave", { + callback = function() + if + require("luasnip").session.current_nodes[vim.api.nvim_get_current_buf()] + and not require("luasnip").session.jump_active + then + require("luasnip").unlink_current() + end + end, + }) +end + +M.gitsigns = function() + local present, gitsigns = pcall(require, "gitsigns") + + if not present then + return + end + + require("base46").load_highlight "git" + + local options = { + signs = { + add = { hl = "DiffAdd", text = "│", numhl = "GitSignsAddNr" }, + change = { hl = "DiffChange", text = "│", numhl = "GitSignsChangeNr" }, + delete = { hl = "DiffDelete", text = "", numhl = "GitSignsDeleteNr" }, + topdelete = { hl = "DiffDelete", text = "‾", numhl = "GitSignsDeleteNr" }, + changedelete = { hl = "DiffChangeDelete", text = "~", numhl = "GitSignsChangeNr" }, + }, + } + + options = load_override(options, "lewis6991/gitsigns.nvim") + gitsigns.setup(options) +end + +M.devicons = function() + local present, devicons = pcall(require, "nvim-web-devicons") + + if present then + require("base46").load_highlight "devicons" + + local options = { override = require("nvchad_ui.icons").devicons } + options = require("core.utils").load_override(options, "kyazdani42/nvim-web-devicons") + + devicons.setup(options) + end +end + +M.packer_init = function() + return { + auto_clean = true, + compile_on_sync = true, + git = { clone_timeout = 6000 }, + display = { + working_sym = "ﲊ", + error_sym = "✗ ", + done_sym = " ", + removed_sym = " ", + moved_sym = "", + open_fn = function() + return require("packer.util").float { border = "single" } + end, + }, + } +end + +return M diff --git a/user/.config/nvim/lua/plugins/configs/telescope.lua b/user/.config/nvim/lua/plugins/configs/telescope.lua new file mode 100644 index 000000000..03e1467ca --- /dev/null +++ b/user/.config/nvim/lua/plugins/configs/telescope.lua @@ -0,0 +1,73 @@ +local present, telescope = pcall(require, "telescope") + +if not present then + return +end + +vim.g.theme_switcher_loaded = true + +require("base46").load_highlight "telescope" + +local options = { + 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 = "horizontal", + layout_config = { + horizontal = { + prompt_position = "top", + preview_width = 0.55, + results_width = 0.8, + }, + vertical = { + mirror = false, + }, + width = 0.87, + height = 0.80, + preview_cutoff = 120, + }, + file_sorter = require("telescope.sorters").get_fuzzy_file, + file_ignore_patterns = { "node_modules" }, + generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter, + path_display = { "truncate" }, + winblend = 0, + border = {}, + borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, + color_devicons = true, + set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil, + 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, + -- Developer configurations: Not meant for general override + buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker, + mappings = { + n = { ["q"] = require("telescope.actions").close }, + }, + }, + + extensions_list = { "themes", "terms" }, +} + +-- check for any override +options = require("core.utils").load_override(options, "nvim-telescope/telescope.nvim") +telescope.setup(options) + +-- load extensions +pcall(function() + for _, ext in ipairs(options.extensions_list) do + telescope.load_extension(ext) + end +end) diff --git a/user/.config/nvim/lua/plugins/configs/treesitter.lua b/user/.config/nvim/lua/plugins/configs/treesitter.lua new file mode 100644 index 000000000..bb1b163a9 --- /dev/null +++ b/user/.config/nvim/lua/plugins/configs/treesitter.lua @@ -0,0 +1,27 @@ +local present, treesitter = pcall(require, "nvim-treesitter.configs") + +if not present then + return +end + +require("base46").load_highlight "treesitter" + +local options = { + ensure_installed = { + "lua", + }, + + highlight = { + enable = true, + use_languagetree = true, + }, + + indent = { + enable = true, + }, +} + +-- check for any override +options = require("core.utils").load_override(options, "nvim-treesitter/nvim-treesitter") + +treesitter.setup(options) diff --git a/user/.config/nvim/lua/plugins/configs/whichkey.lua b/user/.config/nvim/lua/plugins/configs/whichkey.lua new file mode 100644 index 000000000..89e7c3e23 --- /dev/null +++ b/user/.config/nvim/lua/plugins/configs/whichkey.lua @@ -0,0 +1,41 @@ +local present, wk = pcall(require, "which-key") + +if not present then + return +end + +require("base46").load_highlight "whichkey" + +local options = { + + icons = { + breadcrumb = "»", -- symbol used in the command line area that shows your active key combo + separator = "  ", -- symbol used between a key and it's label + group = "+", -- symbol prepended to a group + }, + + popup_mappings = { + scroll_down = "", -- binding to scroll down inside the popup + scroll_up = "", -- binding to scroll up inside the popup + }, + + window = { + border = "none", -- none/single/double/shadow + }, + + layout = { + spacing = 6, -- spacing between columns + }, + + hidden = { "", "", "", "", "call", "lua", "^:", "^ " }, + + triggers_blacklist = { + -- list of mode / prefixes that should never be hooked by WhichKey + i = { "j", "k" }, + v = { "j", "k" }, + }, +} + +options = require("core.utils").load_override(options, "folke/which-key.nvim") + +wk.setup(options) diff --git a/user/.config/nvim/lua/plugins/init.lua b/user/.config/nvim/lua/plugins/init.lua new file mode 100644 index 000000000..7a9bfcb39 --- /dev/null +++ b/user/.config/nvim/lua/plugins/init.lua @@ -0,0 +1,225 @@ +local plugins = { + + ["nvim-lua/plenary.nvim"] = { module = "plenary" }, + + ["lewis6991/impatient.nvim"] = {}, + + ["wbthomason/packer.nvim"] = { + cmd = require("core.lazy_load").packer_cmds, + config = function() + require "plugins" + end, + }, + + ["NvChad/extensions"] = { module = { "telescope", "nvchad" } }, + + ["NvChad/base46"] = { + config = function() + local ok, base46 = pcall(require, "base46") + + if ok then + base46.load_theme() + end + end, + }, + + ["NvChad/ui"] = { + after = "base46", + config = function() + local present, nvchad_ui = pcall(require, "nvchad_ui") + + if present then + nvchad_ui.setup() + end + end, + }, + + ["NvChad/nvterm"] = { + module = "nvterm", + config = function() + require "plugins.configs.nvterm" + end, + setup = function() + require("core.utils").load_mappings "nvterm" + end, + }, + + ["kyazdani42/nvim-web-devicons"] = { + after = "ui", + module = "nvim-web-devicons", + config = function() + require("plugins.configs.others").devicons() + end, + }, + + ["lukas-reineke/indent-blankline.nvim"] = { + opt = true, + setup = function() + require("core.lazy_load").on_file_open "indent-blankline.nvim" + require("core.utils").load_mappings "blankline" + end, + config = function() + require("plugins.configs.others").blankline() + end, + }, + + ["NvChad/nvim-colorizer.lua"] = { + opt = true, + setup = function() + require("core.lazy_load").on_file_open "nvim-colorizer.lua" + end, + config = function() + require("plugins.configs.others").colorizer() + end, + }, + + ["nvim-treesitter/nvim-treesitter"] = { + module = "nvim-treesitter", + setup = function() + require("core.lazy_load").on_file_open "nvim-treesitter" + end, + cmd = require("core.lazy_load").treesitter_cmds, + run = ":TSUpdate", + config = function() + require "plugins.configs.treesitter" + end, + }, + + -- git stuff + ["lewis6991/gitsigns.nvim"] = { + ft = "gitcommit", + setup = function() + require("core.lazy_load").gitsigns() + end, + config = function() + require("plugins.configs.others").gitsigns() + end, + }, + + -- lsp stuff + ["williamboman/mason.nvim"] = { + cmd = require("core.lazy_load").mason_cmds, + config = function() + require "plugins.configs.mason" + end, + }, + + ["neovim/nvim-lspconfig"] = { + opt = true, + setup = function() + require("core.lazy_load").on_file_open "nvim-lspconfig" + end, + config = function() + require "plugins.configs.lspconfig" + end, + }, + + -- load luasnips + cmp related in insert mode only + + ["rafamadriz/friendly-snippets"] = { + module = { "cmp", "cmp_nvim_lsp" }, + event = "InsertEnter", + }, + + ["hrsh7th/nvim-cmp"] = { + after = "friendly-snippets", + config = function() + require "plugins.configs.cmp" + end, + }, + + ["L3MON4D3/LuaSnip"] = { + wants = "friendly-snippets", + after = "nvim-cmp", + config = function() + require("plugins.configs.others").luasnip() + end, + }, + + ["saadparwaiz1/cmp_luasnip"] = { after = "LuaSnip" }, + ["hrsh7th/cmp-nvim-lua"] = { after = "cmp_luasnip" }, + ["hrsh7th/cmp-nvim-lsp"] = { after = "cmp-nvim-lua" }, + ["hrsh7th/cmp-buffer"] = { after = "cmp-nvim-lsp" }, + ["hrsh7th/cmp-path"] = { after = "cmp-buffer" }, + + -- misc plugins + ["windwp/nvim-autopairs"] = { + after = "nvim-cmp", + config = function() + require("plugins.configs.others").autopairs() + end, + }, + + ["goolord/alpha-nvim"] = { + after = "base46", + disable = true, + config = function() + require "plugins.configs.alpha" + end, + }, + + ["numToStr/Comment.nvim"] = { + module = "Comment", + keys = { "gc", "gb" }, + config = function() + require("plugins.configs.others").comment() + end, + setup = function() + require("core.utils").load_mappings "comment" + end, + }, + + -- file managing , picker etc + ["kyazdani42/nvim-tree.lua"] = { + ft = "alpha", + cmd = { "NvimTreeToggle", "NvimTreeFocus" }, + config = function() + require "plugins.configs.nvimtree" + end, + setup = function() + require("core.utils").load_mappings "nvimtree" + end, + }, + + ["nvim-telescope/telescope.nvim"] = { + cmd = "Telescope", + config = function() + require "plugins.configs.telescope" + end, + setup = function() + require("core.utils").load_mappings "telescope" + end, + }, + + -- Only load whichkey after all the gui + ["folke/which-key.nvim"] = { + disable = true, + module = "which-key", + keys = "", + config = function() + require "plugins.configs.whichkey" + end, + setup = function() + require("core.utils").load_mappings "whichkey" + end, + }, +} + +-- Load all plugins +local present, packer = pcall(require, "packer") + +if present then + vim.cmd "packadd packer.nvim" + + -- Override with default plugins with user ones + plugins = require("core.utils").merge_plugins(plugins) + + -- load packer init options + local init_options = require("plugins.configs.others").packer_init() + init_options = require("core.utils").load_override(init_options, "wbthomason/packer.nvim") + packer.init(init_options) + + for _, v in pairs(plugins) do + packer.use(v) + end +end diff --git a/user/.config/nvim/plugin/packer_compiled.lua b/user/.config/nvim/plugin/packer_compiled.lua new file mode 100644 index 000000000..743b0bd3e --- /dev/null +++ b/user/.config/nvim/plugin/packer_compiled.lua @@ -0,0 +1,458 @@ +-- Automatically generated packer.nvim plugin loader code + +if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then + vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"') + return +end + +vim.api.nvim_command('packadd packer.nvim') + +local no_errors, error_msg = pcall(function() + +_G._packer = _G._packer or {} +_G._packer.inside_compile = true + +local time +local profile_info +local should_profile = false +if should_profile then + local hrtime = vim.loop.hrtime + profile_info = {} + time = function(chunk, start) + if start then + profile_info[chunk] = hrtime() + else + profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6 + end + end +else + time = function(chunk, start) end +end + +local function save_profiles(threshold) + local sorted_times = {} + for chunk_name, time_taken in pairs(profile_info) do + sorted_times[#sorted_times + 1] = {chunk_name, time_taken} + end + table.sort(sorted_times, function(a, b) return a[2] > b[2] end) + local results = {} + for i, elem in ipairs(sorted_times) do + if not threshold or threshold and elem[2] > threshold then + results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms' + end + end + if threshold then + table.insert(results, '(Only showing plugins that took longer than ' .. threshold .. ' ms ' .. 'to load)') + end + + _G._packer.profile_output = results +end + +time([[Luarocks path setup]], true) +local package_path_str = "/home/drk/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/drk/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/drk/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/drk/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua" +local install_cpath_pattern = "/home/drk/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so" +if not string.find(package.path, package_path_str, 1, true) then + package.path = package.path .. ';' .. package_path_str +end + +if not string.find(package.cpath, install_cpath_pattern, 1, true) then + package.cpath = package.cpath .. ';' .. install_cpath_pattern +end + +time([[Luarocks path setup]], false) +time([[try_loadstring definition]], true) +local function try_loadstring(s, component, name) + local success, result = pcall(loadstring(s), name, _G.packer_plugins[name]) + if not success then + vim.schedule(function() + vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {}) + end) + end + return result +end + +time([[try_loadstring definition]], false) +time([[Defining packer_plugins]], true) +_G.packer_plugins = { + ["Comment.nvim"] = { + config = { "\27LJ\2\2F\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\fcomment\27plugins.configs.others\frequire\0" }, + keys = { { "", "gc" }, { "", "gb" } }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/home/drk/.local/share/nvim/site/pack/packer/opt/Comment.nvim", + url = "https://github.com/numToStr/Comment.nvim" + }, + LuaSnip = { + after = { "cmp_luasnip" }, + config = { "\27LJ\2\2F\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\fluasnip\27plugins.configs.others\frequire\0" }, + load_after = { + ["nvim-cmp"] = true + }, + loaded = false, + needs_bufread = true, + path = "/home/drk/.local/share/nvim/site/pack/packer/opt/LuaSnip", + url = "https://github.com/L3MON4D3/LuaSnip", + wants = { "friendly-snippets" } + }, + base46 = { + after = { "ui" }, + config = { "\27LJ\2\2K\0\0\3\0\4\0\t6\0\0\0006\1\1\0'\2\2\0B\0\3\3\15\0\0\0X\2\29\2\3\1B\2\1\1K\0\1\0\15load_theme\vbase46\frequire\npcall\0" }, + loaded = true, + only_config = true, + path = "/home/drk/.local/share/nvim/site/pack/packer/start/base46", + url = "https://github.com/NvChad/base46" + }, + ["cmp-buffer"] = { + after = { "cmp-path" }, + after_files = { "/home/drk/.local/share/nvim/site/pack/packer/opt/cmp-buffer/after/plugin/cmp_buffer.lua" }, + load_after = { + ["cmp-nvim-lsp"] = true + }, + loaded = false, + needs_bufread = false, + path = "/home/drk/.local/share/nvim/site/pack/packer/opt/cmp-buffer", + url = "https://github.com/hrsh7th/cmp-buffer" + }, + ["cmp-nvim-lsp"] = { + after = { "cmp-buffer" }, + after_files = { "/home/drk/.local/share/nvim/site/pack/packer/opt/cmp-nvim-lsp/after/plugin/cmp_nvim_lsp.lua" }, + load_after = { + ["cmp-nvim-lua"] = true + }, + loaded = false, + needs_bufread = false, + path = "/home/drk/.local/share/nvim/site/pack/packer/opt/cmp-nvim-lsp", + url = "https://github.com/hrsh7th/cmp-nvim-lsp" + }, + ["cmp-nvim-lua"] = { + after = { "cmp-nvim-lsp" }, + after_files = { "/home/drk/.local/share/nvim/site/pack/packer/opt/cmp-nvim-lua/after/plugin/cmp_nvim_lua.lua" }, + load_after = { + cmp_luasnip = true + }, + loaded = false, + needs_bufread = false, + path = "/home/drk/.local/share/nvim/site/pack/packer/opt/cmp-nvim-lua", + url = "https://github.com/hrsh7th/cmp-nvim-lua" + }, + ["cmp-path"] = { + after_files = { "/home/drk/.local/share/nvim/site/pack/packer/opt/cmp-path/after/plugin/cmp_path.lua" }, + load_after = { + ["cmp-buffer"] = true + }, + loaded = false, + needs_bufread = false, + path = "/home/drk/.local/share/nvim/site/pack/packer/opt/cmp-path", + url = "https://github.com/hrsh7th/cmp-path" + }, + cmp_luasnip = { + after = { "cmp-nvim-lua" }, + after_files = { "/home/drk/.local/share/nvim/site/pack/packer/opt/cmp_luasnip/after/plugin/cmp_luasnip.lua" }, + load_after = { + LuaSnip = true + }, + loaded = false, + needs_bufread = false, + path = "/home/drk/.local/share/nvim/site/pack/packer/opt/cmp_luasnip", + url = "https://github.com/saadparwaiz1/cmp_luasnip" + }, + extensions = { + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/home/drk/.local/share/nvim/site/pack/packer/opt/extensions", + url = "https://github.com/NvChad/extensions" + }, + ["friendly-snippets"] = { + after = { "nvim-cmp" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/home/drk/.local/share/nvim/site/pack/packer/opt/friendly-snippets", + url = "https://github.com/rafamadriz/friendly-snippets" + }, + ["gitsigns.nvim"] = { + config = { "\27LJ\2\2G\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\rgitsigns\27plugins.configs.others\frequire\0" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/home/drk/.local/share/nvim/site/pack/packer/opt/gitsigns.nvim", + url = "https://github.com/lewis6991/gitsigns.nvim" + }, + ["impatient.nvim"] = { + loaded = true, + path = "/home/drk/.local/share/nvim/site/pack/packer/start/impatient.nvim", + url = "https://github.com/lewis6991/impatient.nvim" + }, + ["indent-blankline.nvim"] = { + config = { "\27LJ\2\2H\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\14blankline\27plugins.configs.others\frequire\0" }, + loaded = false, + needs_bufread = false, + path = "/home/drk/.local/share/nvim/site/pack/packer/opt/indent-blankline.nvim", + url = "https://github.com/lukas-reineke/indent-blankline.nvim" + }, + ["mason.nvim"] = { + commands = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUninstall", "MasonUninstallAll", "MasonLog" }, + config = { "\27LJ\2\0025\0\0\2\0\2\0\0046\0\0\0'\1\1\0B\0\2\1K\0\1\0\26plugins.configs.mason\frequire\0" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/home/drk/.local/share/nvim/site/pack/packer/opt/mason.nvim", + url = "https://github.com/williamboman/mason.nvim" + }, + ["nvim-autopairs"] = { + config = { "\27LJ\2\2H\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\14autopairs\27plugins.configs.others\frequire\0" }, + load_after = { + ["nvim-cmp"] = true + }, + loaded = false, + needs_bufread = false, + path = "/home/drk/.local/share/nvim/site/pack/packer/opt/nvim-autopairs", + url = "https://github.com/windwp/nvim-autopairs" + }, + ["nvim-cmp"] = { + after = { "nvim-autopairs", "LuaSnip" }, + config = { "\27LJ\2\0023\0\0\2\0\2\0\0046\0\0\0'\1\1\0B\0\2\1K\0\1\0\24plugins.configs.cmp\frequire\0" }, + load_after = { + ["friendly-snippets"] = true + }, + loaded = false, + needs_bufread = false, + path = "/home/drk/.local/share/nvim/site/pack/packer/opt/nvim-cmp", + url = "https://github.com/hrsh7th/nvim-cmp" + }, + ["nvim-colorizer.lua"] = { + config = { "\27LJ\2\2H\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\14colorizer\27plugins.configs.others\frequire\0" }, + loaded = false, + needs_bufread = false, + path = "/home/drk/.local/share/nvim/site/pack/packer/opt/nvim-colorizer.lua", + url = "https://github.com/NvChad/nvim-colorizer.lua" + }, + ["nvim-lspconfig"] = { + config = { "\27LJ\2\0029\0\0\2\0\2\0\0046\0\0\0'\1\1\0B\0\2\1K\0\1\0\30plugins.configs.lspconfig\frequire\0" }, + loaded = false, + needs_bufread = false, + path = "/home/drk/.local/share/nvim/site/pack/packer/opt/nvim-lspconfig", + url = "https://github.com/neovim/nvim-lspconfig" + }, + ["nvim-tree.lua"] = { + commands = { "NvimTreeToggle", "NvimTreeFocus" }, + config = { "\27LJ\2\0028\0\0\2\0\2\0\0046\0\0\0'\1\1\0B\0\2\1K\0\1\0\29plugins.configs.nvimtree\frequire\0" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/home/drk/.local/share/nvim/site/pack/packer/opt/nvim-tree.lua", + url = "https://github.com/kyazdani42/nvim-tree.lua" + }, + ["nvim-treesitter"] = { + commands = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSEnable", "TSDisable", "TSModuleInfo" }, + config = { "\27LJ\2\2:\0\0\2\0\2\0\0046\0\0\0'\1\1\0B\0\2\1K\0\1\0\31plugins.configs.treesitter\frequire\0" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/home/drk/.local/share/nvim/site/pack/packer/opt/nvim-treesitter", + url = "https://github.com/nvim-treesitter/nvim-treesitter" + }, + ["nvim-web-devicons"] = { + config = { "\27LJ\2\2G\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\rdevicons\27plugins.configs.others\frequire\0" }, + load_after = {}, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/home/drk/.local/share/nvim/site/pack/packer/opt/nvim-web-devicons", + url = "https://github.com/kyazdani42/nvim-web-devicons" + }, + nvterm = { + config = { "\27LJ\2\0026\0\0\2\0\2\0\0046\0\0\0'\1\1\0B\0\2\1K\0\1\0\27plugins.configs.nvterm\frequire\0" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/home/drk/.local/share/nvim/site/pack/packer/opt/nvterm", + url = "https://github.com/NvChad/nvterm" + }, + ["packer.nvim"] = { + commands = { "PackerSnapshot", "PackerSnapshotRollback", "PackerSnapshotDelete", "PackerInstall", "PackerUpdate", "PackerSync", "PackerClean", "PackerCompile", "PackerStatus", "PackerProfile", "PackerLoad" }, + config = { "\27LJ\2\2'\0\0\2\0\2\0\0046\0\0\0'\1\1\0B\0\2\1K\0\1\0\fplugins\frequire\0" }, + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/home/drk/.local/share/nvim/site/pack/packer/opt/packer.nvim", + url = "https://github.com/wbthomason/packer.nvim" + }, + ["plenary.nvim"] = { + loaded = false, + needs_bufread = false, + only_cond = false, + path = "/home/drk/.local/share/nvim/site/pack/packer/opt/plenary.nvim", + url = "https://github.com/nvim-lua/plenary.nvim" + }, + ["telescope.nvim"] = { + commands = { "Telescope" }, + config = { "\27LJ\2\0029\0\0\2\0\2\0\0046\0\0\0'\1\1\0B\0\2\1K\0\1\0\30plugins.configs.telescope\frequire\0" }, + loaded = false, + needs_bufread = true, + only_cond = false, + path = "/home/drk/.local/share/nvim/site/pack/packer/opt/telescope.nvim", + url = "https://github.com/nvim-telescope/telescope.nvim" + }, + ui = { + after = { "nvim-web-devicons" }, + config = { "\27LJ\2\2I\0\0\3\0\4\0\t6\0\0\0006\1\1\0'\2\2\0B\0\3\3\15\0\0\0X\2\29\2\3\1B\2\1\1K\0\1\0\nsetup\14nvchad_ui\frequire\npcall\0" }, + load_after = {}, + loaded = true, + needs_bufread = false, + path = "/home/drk/.local/share/nvim/site/pack/packer/opt/ui", + url = "https://github.com/NvChad/ui" + } +} + +time([[Defining packer_plugins]], false) +local module_lazy_loads = { + ["^Comment"] = "Comment.nvim", + ["^cmp"] = "friendly-snippets", + ["^cmp_nvim_lsp"] = "friendly-snippets", + ["^nvchad"] = "extensions", + ["^nvim%-treesitter"] = "nvim-treesitter", + ["^nvim%-web%-devicons"] = "nvim-web-devicons", + ["^nvterm"] = "nvterm", + ["^plenary"] = "plenary.nvim", + ["^telescope"] = "extensions" +} +local lazy_load_called = {['packer.load'] = true} +local function lazy_load_module(module_name) + local to_load = {} + if lazy_load_called[module_name] then return nil end + lazy_load_called[module_name] = true + for module_pat, plugin_name in pairs(module_lazy_loads) do + if not _G.packer_plugins[plugin_name].loaded and string.match(module_name, module_pat) then + to_load[#to_load + 1] = plugin_name + end + end + + if #to_load > 0 then + require('packer.load')(to_load, {module = module_name}, _G.packer_plugins) + local loaded_mod = package.loaded[module_name] + if loaded_mod then + return function(modname) return loaded_mod end + end + end +end + +if not vim.g.packer_custom_loader_enabled then + table.insert(package.loaders, 1, lazy_load_module) + vim.g.packer_custom_loader_enabled = true +end + +-- Setup for: nvim-lspconfig +time([[Setup for nvim-lspconfig]], true) +try_loadstring("\27LJ\2\2V\0\0\2\0\4\0\a6\0\0\0'\1\1\0B\0\2\0029\0\2\0'\1\3\0B\0\2\1K\0\1\0\19nvim-lspconfig\17on_file_open\19core.lazy_load\frequire\0", "setup", "nvim-lspconfig") +time([[Setup for nvim-lspconfig]], false) +-- Setup for: nvterm +time([[Setup for nvterm]], true) +try_loadstring("\27LJ\2\2K\0\0\2\0\4\0\a6\0\0\0'\1\1\0B\0\2\0029\0\2\0'\1\3\0B\0\2\1K\0\1\0\vnvterm\18load_mappings\15core.utils\frequire\0", "setup", "nvterm") +time([[Setup for nvterm]], false) +-- Setup for: nvim-colorizer.lua +time([[Setup for nvim-colorizer.lua]], true) +try_loadstring("\27LJ\2\2Z\0\0\2\0\4\0\a6\0\0\0'\1\1\0B\0\2\0029\0\2\0'\1\3\0B\0\2\1K\0\1\0\23nvim-colorizer.lua\17on_file_open\19core.lazy_load\frequire\0", "setup", "nvim-colorizer.lua") +time([[Setup for nvim-colorizer.lua]], false) +-- Setup for: indent-blankline.nvim +time([[Setup for indent-blankline.nvim]], true) +try_loadstring("\27LJ\2\2\1\0\0\2\0\a\0\r6\0\0\0'\1\1\0B\0\2\0029\0\2\0'\1\3\0B\0\2\0016\0\0\0'\1\4\0B\0\2\0029\0\5\0'\1\6\0B\0\2\1K\0\1\0\14blankline\18load_mappings\15core.utils\26indent-blankline.nvim\17on_file_open\19core.lazy_load\frequire\0", "setup", "indent-blankline.nvim") +time([[Setup for indent-blankline.nvim]], false) +-- Setup for: gitsigns.nvim +time([[Setup for gitsigns.nvim]], true) +try_loadstring("\27LJ\2\2?\0\0\2\0\3\0\0066\0\0\0'\1\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\rgitsigns\19core.lazy_load\frequire\0", "setup", "gitsigns.nvim") +time([[Setup for gitsigns.nvim]], false) +-- Setup for: nvim-tree.lua +time([[Setup for nvim-tree.lua]], true) +try_loadstring("\27LJ\2\2M\0\0\2\0\4\0\a6\0\0\0'\1\1\0B\0\2\0029\0\2\0'\1\3\0B\0\2\1K\0\1\0\rnvimtree\18load_mappings\15core.utils\frequire\0", "setup", "nvim-tree.lua") +time([[Setup for nvim-tree.lua]], false) +-- Setup for: Comment.nvim +time([[Setup for Comment.nvim]], true) +try_loadstring("\27LJ\2\2L\0\0\2\0\4\0\a6\0\0\0'\1\1\0B\0\2\0029\0\2\0'\1\3\0B\0\2\1K\0\1\0\fcomment\18load_mappings\15core.utils\frequire\0", "setup", "Comment.nvim") +time([[Setup for Comment.nvim]], false) +-- Setup for: telescope.nvim +time([[Setup for telescope.nvim]], true) +try_loadstring("\27LJ\2\2N\0\0\2\0\4\0\a6\0\0\0'\1\1\0B\0\2\0029\0\2\0'\1\3\0B\0\2\1K\0\1\0\14telescope\18load_mappings\15core.utils\frequire\0", "setup", "telescope.nvim") +time([[Setup for telescope.nvim]], false) +-- Setup for: nvim-treesitter +time([[Setup for nvim-treesitter]], true) +try_loadstring("\27LJ\2\2W\0\0\2\0\4\0\a6\0\0\0'\1\1\0B\0\2\0029\0\2\0'\1\3\0B\0\2\1K\0\1\0\20nvim-treesitter\17on_file_open\19core.lazy_load\frequire\0", "setup", "nvim-treesitter") +time([[Setup for nvim-treesitter]], false) +-- Config for: base46 +time([[Config for base46]], true) +try_loadstring("\27LJ\2\2K\0\0\3\0\4\0\t6\0\0\0006\1\1\0'\2\2\0B\0\3\3\15\0\0\0X\2\29\2\3\1B\2\1\1K\0\1\0\15load_theme\vbase46\frequire\npcall\0", "config", "base46") +time([[Config for base46]], false) +-- Load plugins in order defined by `after` +time([[Sequenced loading]], true) +vim.cmd [[ packadd ui ]] + +-- Config for: ui +try_loadstring("\27LJ\2\2I\0\0\3\0\4\0\t6\0\0\0006\1\1\0'\2\2\0B\0\3\3\15\0\0\0X\2\29\2\3\1B\2\1\1K\0\1\0\nsetup\14nvchad_ui\frequire\npcall\0", "config", "ui") + +time([[Sequenced loading]], false) + +-- Command lazy-loads +time([[Defining lazy-load commands]], true) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file PackerSnapshotRollback lua require("packer.load")({'packer.nvim'}, { cmd = "PackerSnapshotRollback", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file PackerCompile lua require("packer.load")({'packer.nvim'}, { cmd = "PackerCompile", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Telescope lua require("packer.load")({'telescope.nvim'}, { cmd = "Telescope", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSBufEnable lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSBufEnable", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file PackerStatus lua require("packer.load")({'packer.nvim'}, { cmd = "PackerStatus", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file PackerUpdate lua require("packer.load")({'packer.nvim'}, { cmd = "PackerUpdate", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file PackerInstall lua require("packer.load")({'packer.nvim'}, { cmd = "PackerInstall", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSBufDisable lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSBufDisable", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file MasonInstall lua require("packer.load")({'mason.nvim'}, { cmd = "MasonInstall", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file NvimTreeFocus lua require("packer.load")({'nvim-tree.lua'}, { cmd = "NvimTreeFocus", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSDisable lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSDisable", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file PackerProfile lua require("packer.load")({'packer.nvim'}, { cmd = "PackerProfile", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSModuleInfo lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSModuleInfo", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file NvimTreeToggle lua require("packer.load")({'nvim-tree.lua'}, { cmd = "NvimTreeToggle", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSInstall lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSInstall", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSEnable lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSEnable", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file PackerLoad lua require("packer.load")({'packer.nvim'}, { cmd = "PackerLoad", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file MasonUninstall lua require("packer.load")({'mason.nvim'}, { cmd = "MasonUninstall", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file MasonUninstallAll lua require("packer.load")({'mason.nvim'}, { cmd = "MasonUninstallAll", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file PackerSync lua require("packer.load")({'packer.nvim'}, { cmd = "PackerSync", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file PackerSnapshotDelete lua require("packer.load")({'packer.nvim'}, { cmd = "PackerSnapshotDelete", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file PackerSnapshot lua require("packer.load")({'packer.nvim'}, { cmd = "PackerSnapshot", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file MasonInstallAll lua require("packer.load")({'mason.nvim'}, { cmd = "MasonInstallAll", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Mason lua require("packer.load")({'mason.nvim'}, { cmd = "Mason", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file MasonLog lua require("packer.load")({'mason.nvim'}, { cmd = "MasonLog", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file PackerClean lua require("packer.load")({'packer.nvim'}, { cmd = "PackerClean", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +time([[Defining lazy-load commands]], false) + +-- Keymap lazy-loads +time([[Defining lazy-load keymaps]], true) +vim.cmd [[noremap gb lua require("packer.load")({'Comment.nvim'}, { keys = "gb", prefix = "" }, _G.packer_plugins)]] +vim.cmd [[noremap gc lua require("packer.load")({'Comment.nvim'}, { keys = "gc", prefix = "" }, _G.packer_plugins)]] +time([[Defining lazy-load keymaps]], false) + +vim.cmd [[augroup packer_load_aucmds]] +vim.cmd [[au!]] + -- Filetype lazy-loads +time([[Defining lazy-load filetype autocommands]], true) +vim.cmd [[au FileType gitcommit ++once lua require("packer.load")({'gitsigns.nvim'}, { ft = "gitcommit" }, _G.packer_plugins)]] +vim.cmd [[au FileType alpha ++once lua require("packer.load")({'nvim-tree.lua'}, { ft = "alpha" }, _G.packer_plugins)]] +time([[Defining lazy-load filetype autocommands]], false) + -- Event lazy-loads +time([[Defining lazy-load event autocommands]], true) +vim.cmd [[au InsertEnter * ++once lua require("packer.load")({'friendly-snippets'}, { event = "InsertEnter *" }, _G.packer_plugins)]] +time([[Defining lazy-load event autocommands]], false) +vim.cmd("augroup END") + +_G._packer.inside_compile = false +if _G._packer.needs_bufread == true then + vim.cmd("doautocmd BufRead") +end +_G._packer.needs_bufread = false + +if should_profile then save_profiles() end + +end) + +if not no_errors then + error_msg = error_msg:gsub('"', '\\"') + vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None') +end diff --git a/user/.config/rofi/config.rasi b/user/.config/rofi/config.rasi index 15f8ff088..b91a409b9 100644 --- a/user/.config/rofi/config.rasi +++ b/user/.config/rofi/config.rasi @@ -1 +1,7 @@ @theme "/usr/share/rofi/themes/gruvbox-dark-hard.rasi" +configuration { + font: "mononoki Nerd Font 14"; + show-icons: true; + display-window: "Window"; + display-drun: "Search"; +} diff --git a/user/.config/rofi/scripts/rofi_edit b/user/.config/rofi/scripts/rofi_edit index 92b585409..6df895b5c 100755 --- a/user/.config/rofi/scripts/rofi_edit +++ b/user/.config/rofi/scripts/rofi_edit @@ -5,7 +5,7 @@ # - Dependencies: rofi (Everything else can be changed) # Show list of options -EDITOR="emacsclient -c -a emacs" +EDITOR="alacritty -e nvim" cd "$HOME" || exit 0 file=1 while [ "$file" ]; do diff --git a/user/.config/rofi/scripts/rofi_power b/user/.config/rofi/scripts/rofi_power index 4be284bc7..1e0b3d96a 100755 --- a/user/.config/rofi/scripts/rofi_power +++ b/user/.config/rofi/scripts/rofi_power @@ -5,22 +5,22 @@ # - Dependencies: rofi, power-profiles-daemon ## OPTIONS ## -option1="(L) Logout" -option2="(R) Reboot" -option3="(P) Power off" -option4="(S) Suspend" -option5="(K) Lock" -option6="(C) Change power profile" -option7="(X) Cancel" +option1=" Logout" +option2=" Reboot" +option3=" Power off" +option4="鈴 Suspend" +option5=" Lock" +option6="漣 Change power profile" +option7=" Cancel" ## OPTIONS ARRAY ## options="$option1\n$option2\n$option3\n$option4\n$option5\n$option6\n$option7" ## POWER PROFILE OPTIONS ## -pwr1="(P) Performance" -pwr2="(B) Balanced" -pwr3="(S) Power Saver" -pwr4="(X) Cancel" +pwr1=" Performance" +pwr2=" Balanced" +pwr3=" Power Saver" +pwr4=" Cancel" ## POWER PROFILES ARRAY ## pwrs="$pwr1\n$pwr2\n$pwr3\n$pwr4" @@ -40,7 +40,7 @@ case "$action" in betterlockscreen -l;; $option6*) currentpwr=$(powerprofilesctl get) - pwraction=$(echo -e "$pwrs" | rofi -dmenu -b -l 3 -i -p "Current profile is: ${currentpwr} | Select profile:") + pwraction=$(echo -e "$pwrs" | rofi -dmenu -b -l 4 -i -p "Current profile is: ${currentpwr} | Select profile:") case "$pwraction" in $pwr1*) powerprofilesctl set performance && notify-send "Power profile switched to performance";; diff --git a/user/.config/rofi/scripts/rofi_scrot b/user/.config/rofi/scripts/rofi_scrot index 90d2921f8..22d4679a6 100755 --- a/user/.config/rofi/scripts/rofi_scrot +++ b/user/.config/rofi/scripts/rofi_scrot @@ -9,16 +9,16 @@ mkdir -p "$HOME/Pictures/Screenshots" cd "$HOME/Pictures/Screenshots" || exit 0 ## CHOICES ## -cho1="(S) Entire screen" -cho2="(D) Entire screen with delay" -cho3="(W) Focused window" -cho4="(A) Select area" +cho1=" Entire screen" +cho2=" Entire screen with delay" +cho3=" Focused window" +cho4=" Select area" chos="$cho1\n$cho2\n$cho3\n$cho4" ## DELAY OPTIONS ## -del1="(1) 3 sec delay" -del2="(2) 5 sec delay" -del3="(3) 10 sec delay" +del1=" 3 sec delay" +del2=" 5 sec delay" +del3=" 10 sec delay" dels="$del1\n$del2\n$del3" ## DELAY FUNCTION ## diff --git a/user/.config/rofi/scripts/rofi_wifi b/user/.config/rofi/scripts/rofi_wifi index a2f248b49..47ac7b04a 100755 --- a/user/.config/rofi/scripts/rofi_wifi +++ b/user/.config/rofi/scripts/rofi_wifi @@ -7,15 +7,15 @@ ## ROFI VARIABLES ## ROFI1="rofi -dmenu -l 10 -b -i -p" ROFI2="rofi -dmenu -l 1 -b -p" -ROFI3="rofi -dmenu -l 5 -b -i -p" +ROFI3="rofi -dmenu -l 6 -b -i -p" ## MAIN OPTIONS ## -option1="(O) Turn on WiFi" -option2="(F) Turn off WiFi" -option3="(D) Disconnect WiFi" -option4="(C) Connect WiFi" -option5="(S) Setup captive portal" -option6="(X) Exit" +option1=" Turn on WiFi" +option2=" Turn off WiFi" +option3="睊 Disconnect WiFi" +option4="直 Connect WiFi" +option5="漣 Setup captive portal" +option6=" Cancel" options="$option1\n$option2\n$option3\n$option4\n$option5\n$option6" wlan=$(nmcli dev | grep wifi | sed 's/ \{2,\}/|/g' | cut -d '|' -f1 | head -1)