diff --git a/lua/core/default_config.lua b/lua/core/default_config.lua index ab8c554..458f3f6 100644 --- a/lua/core/default_config.lua +++ b/lua/core/default_config.lua @@ -48,18 +48,26 @@ M.ui = { -- nvdash (dashboard) nvdash = { - load_on_startup = false, + load_on_startup = true, header = { - " ▄ ▄ ", - " ▄ ▄▄▄ ▄ ▄▄▄ ▄ ▄ ", - " █ ▄ █▄█ ▄▄▄ █ █▄█ █ █ ", - " ▄▄ █▄█▄▄▄█ █▄█▄█▄▄█▄▄█ █ ", - " ▄ █▄▄█ ▄ ▄▄ ▄█ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ", - " █▄▄▄▄ ▄▄▄ █ ▄ ▄▄▄ ▄ ▄▄▄ ▄ ▄ █ ▄", - "▄ █ █▄█ █▄█ █ █ █▄█ █ █▄█ ▄▄▄ █ █", - "█▄█ ▄ █▄▄█▄▄█ █ ▄▄█ █ ▄ █ █▄█▄█ █", - " █▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█ █▄█▄▄▄█ ", + " ____________________", + "/ \\", + "| In case of |", + "| Frustration |", + "\\____________________/", + " ! !", + " ! !", + " L_ !", + " / _)!", + " / /__L", + " _____/ (____)", + " (____)", + " _____ (____)", + " \\_(____)", + " ! !", + " ! !", + " \\__/", }, buttons = { diff --git a/lua/core/mappings.lua b/lua/core/mappings.lua index 0fd3e6d..e307c11 100644 --- a/lua/core/mappings.lua +++ b/lua/core/mappings.lua @@ -4,10 +4,6 @@ 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" }, diff --git a/lua/custom/chadrc.lua b/lua/custom/chadrc.lua index b9922f5..5f76f8d 100644 --- a/lua/custom/chadrc.lua +++ b/lua/custom/chadrc.lua @@ -1,7 +1,90 @@ ---@type ChadrcConfig local M = {} -M.ui = { theme = 'one_light' } -M.plugins = 'custom.plugins' +M.ui = { + ------------------------------- base46 ------------------------------------- + -- hl = highlights + hl_add = {}, + hl_override = {}, + changed_themes = {}, + theme_toggle = { "dark_horizon", "one_light" }, + theme = "dark_horizon", -- default theme + transparency = false, + lsp_semantic_tokens = false, -- needs nvim v0.9, just adds highlight groups for lsp semantic tokens + + -- https://github.com/NvChad/base46/tree/v2.0/lua/base46/extended_integrations + extended_integrations = {}, -- these aren't compiled by default, ex: "alpha", "notify" + + -- cmp themeing + cmp = { + icons = true, + lspkind_text = true, + style = "default", -- default/flat_light/flat_dark/atom/atom_colored + border_color = "grey_fg", -- only applicable for "default" style, use color names from base30 variables + selected_item_bg = "colored", -- colored / simple + }, + + telescope = { style = "borderless" }, -- borderless / bordered + + ------------------------------- nvchad_ui modules ----------------------------- + statusline = { + theme = "default", -- default/vscode/vscode_colored/minimal + -- default/round/block/arrow separators work only for default statusline theme + -- round and block will work for minimal theme only + separator_style = "default", + overriden_modules = nil, + }, + + -- lazyload it when there are 1+ buffers + tabufline = { + show_numbers = false, + enabled = true, + lazyload = true, + overriden_modules = nil, + }, + + -- nvdash (dashboard) + nvdash = { + load_on_startup = true, + + header = { + " ____________________ ", + "/ \\ ", + "| In case of | ", + "| Frustration | ", + "\\____________________/ ", + " ! ! ", + " ! ! ", + " L_ ! ", + " / _)! ", + " / /__L ", + " _____/ (____) ", + " (____) ", + " _____ (____) ", + " \\_(____) ", + " ! ! ", + " ! ! ", + " \\__/ ", + }, + + buttons = { + { " Find File", "Spc f f", "Telescope find_files" }, + { "󰈚 Recent Files", "Spc f o", "Telescope oldfiles" }, + { " Find Sessions", "Spc f s", "Telescope Sessions" }, + }, + }, + + cheatsheet = { theme = "grid" }, -- simple/grid + + lsp = { + -- show function signatures i.e args as you type + signature = { + disabled = false, + silent = true, -- silences 'no signature help available' message from appearing + }, + }, +} + +M.plugins = "custom.plugins" M.mappings = require "custom.mappings" return M diff --git a/lua/custom/configs/lspconfig.lua b/lua/custom/configs/lspconfig.lua index 589a4f7..fc74472 100644 --- a/lua/custom/configs/lspconfig.lua +++ b/lua/custom/configs/lspconfig.lua @@ -65,6 +65,7 @@ lspconfig.matlab_ls.setup { on_attach = on_attach, capabilities = capabilities, filetypes = { "matlab" }, + require "custom.language_specific_commands.matlab", } lspconfig.clangd.setup { @@ -73,17 +74,9 @@ lspconfig.clangd.setup { filetypes = { "c", "cpp" }, } -local function marksman_on_attach(client, bufnr) - -- Call the global version first - on_attach(client, bufnr) - - -- Then do the Markdown-specific logic - -- vim.api.nvim_set_option_value("spell", true, { buf = bufnr }) - -- vim.api.nvim_set_option_value("spelllang", "en_us", { buf = bufnr }) -end - lspconfig.marksman.setup { - on_attach = marksman_on_attach, + on_attach = on_attach, capabilities = capabilities, filetypes = { "markdown" }, + require "custom.language_specific_commands.markdown", } diff --git a/lua/custom/language_specific_commands/markdown.lua b/lua/custom/language_specific_commands/markdown.lua index 01bff18..4e4f29f 100644 --- a/lua/custom/language_specific_commands/markdown.lua +++ b/lua/custom/language_specific_commands/markdown.lua @@ -1,6 +1,7 @@ vim.keymap.set( "n", - "li", + "mi", "The quick brown fox jumps over the lazy dog. The dog stays blissfully asleep. :)", { desc = "Print a standard 80 character string for Markdown formatting." } ) +print "Markdown Keybinds Loaded" diff --git a/lua/custom/language_specific_commands/matlab.lua b/lua/custom/language_specific_commands/matlab.lua index f8cf44a..4aeaf70 100644 --- a/lua/custom/language_specific_commands/matlab.lua +++ b/lua/custom/language_specific_commands/matlab.lua @@ -5,19 +5,19 @@ local matlab_term_job = nil -- Create the "RunMatlab" user command vim.api.nvim_create_user_command("RunMatlab", function() -- Get the absolute path of the current file - local file = vim.fn.expand("%:p") + local file = vim.fn.expand "%:p" -- Escape single quotes by doubling them for MATLAB's string literal. local matlab_file = file:gsub("'", "''") -- Construct the command to run MATLAB in batch mode, executing the current file. - local cmd = 'matlab -batch "run(\'' .. matlab_file .. '\')"' - + local cmd = "matlab -batch \"run('" .. matlab_file .. "')\"" + -- If we already have a MATLAB terminal and it's valid, reuse it. if matlab_term_buf and vim.api.nvim_buf_is_valid(matlab_term_buf) and matlab_term_job then -- Check if the terminal buffer is visible in any window. local wins = vim.fn.win_findbuf(matlab_term_buf) if #wins == 0 then -- If not visible, open it in a vertical split. - vim.cmd("split") + vim.cmd "split" vim.cmd("buffer " .. matlab_term_buf) else -- Otherwise, switch focus to that window. @@ -27,8 +27,8 @@ vim.api.nvim_create_user_command("RunMatlab", function() vim.api.nvim_chan_send(matlab_term_job, cmd .. "\n") else -- If the MATLAB terminal doesn't exist, open a new vertical split terminal. - vim.cmd("split") - vim.cmd("terminal") + vim.cmd "split" + vim.cmd "terminal" -- Store the terminal buffer and job ID for future reuse. matlab_term_buf = vim.api.nvim_get_current_buf() matlab_term_job = vim.b.terminal_job_id @@ -40,4 +40,6 @@ vim.api.nvim_create_user_command("RunMatlab", function() end, {}) -- Map +r+m (i.e. rm) to run the MATLAB code -vim.keymap.set("n", "rm", ":RunMatlab", { noremap = true, silent = true }) +vim.keymap.set("n", "mr", ":RunMatlab", { noremap = true, silent = true }) + +print "MATLAB Keybinds Loaded" diff --git a/lua/custom/mappings.lua b/lua/custom/mappings.lua index 3dfd0d6..6485a05 100644 --- a/lua/custom/mappings.lua +++ b/lua/custom/mappings.lua @@ -42,11 +42,4 @@ vim.api.nvim_create_autocmd("CursorHold", { end, }) --- Optional: keybinding to manually show diagnostics on hover -vim.api.nvim_set_keymap("n", "e", "lua vim.diagnostic.open_float()", { noremap = true, silent = true }) - -require "custom.language_specific_commands.matlab" -require "custom.language_specific_commands.rust" -require "custom.language_specific_commands.markdown" - return M diff --git a/lua/custom/plugins.lua b/lua/custom/plugins.lua index 38a834a..b02e91e 100644 --- a/lua/custom/plugins.lua +++ b/lua/custom/plugins.lua @@ -58,6 +58,9 @@ local plugins = { init = function() vim.g.rustfmt_autosave = 1 end, + config = function() + require "custom.language_specific_commands.rust" + end, }, { "theHamsta/nvim-dap-virtual-text", @@ -173,76 +176,6 @@ local plugins = { vim.o.formatexpr = "v:lua.require'conform'.formatexpr()" end, }, - { - "goolord/alpha-nvim", - lazy = false, - requires = { "kyazdani42/nvim-web-devicons" }, - config = function() - local alpha = require "alpha" - local dashboard = require "alpha.themes.dashboard" - - math.randomseed(os.time()) - - local function pick_color() - local colors = { "String", "Identifier", "Keyword", "Number" } - return colors[math.random(#colors)] - end - - local function footer() - local datetime = os.date " %d-%m-%Y  %H:%M:%S" - local version = vim.version() - local nvim_version_info = "  v" .. version.major .. "." .. version.minor .. "." .. version.patch - - return datetime .. nvim_version_info - end - - local logo = { - [[ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ]], - [[ %%%%%=-------------------------------------------=#%%% ]], - [[ %%%%%=-----------------------------------------------=#%% ]], - [[ %%%%%%%%#----------*%%%%%%%%%%%%%%%%%%%%%%%%%---------+%% ]], - [[ %%%%#----------*%%%%%%%%%%%%%%%%%%%%%%%%%---------+%% ]], - [[ %%%%#----------*%% %%%%%---------+%% ]], - [[ %%%%#----------+*************************---------+%% ]], - [[ %%%%#--------------------------------------------+%%% ]], - [[ %%%%#-----------------------------------------#%%%% ]], - [[ %%%%#----------*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ]], - [[ %%%%#----------*%%%%%%%%%%%%%%%%%%%%%%%%%%% ]], - [[ %%%%#----------*%% ]], - [[ %%%%#----------*%% %%%##**++++++*#%%%%%%% %%#***#%% ]], - [[%==% %%%%#----------*%%%%=+#=-----------+------------=+-------+==--=*=#=-==%% ]], - [[#-=% %%%%#---------=#*===**------------*=-----------++-------=%=----*=--=+=*%*# ]], - [[ %*==#%%%%#*##*==-=**#%%%+=--------+*=+**----------*++=----+*#=---=*#%*+==-* % ]], - [[ %#+==--==+*#*+===*#*=--------=*+*%%%%%#+=-==----%#=---+#=---=#%%%%%% %*+% ]], - [[ %%%%#-----+*==*#%% %#++==#% %%%%%%#=--=% %%#*=+#=-=+%% ]], - [[ %%%%#----+*-=%#%%% %+=-*% %% %#=-=# %%#==--=*#%%%% ]], - [[ %%%%%=----------------#%% %%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%]], - [[ %%%%%=----------------#%% %%-----------+%% %%=-------------------=%% %%--------------------=%%]], - [[ %%%%%=----------------#%% %%=---*% %%%%%%%%%%*----%%%%%%%%%% %%%%%%%%%%+---=%%%%%%%%%%]], - [[ %%%%%=----------------#%% %%=---*% %*----%% %+---=%% ]], - [[ %%%%%%%%%%%%%%%%%%%%%%%%% %%-----------+%% %%=----------*%% %%=----------*%% ]], - [[ %%%%%%%%%%%%%%%%%%%%%%%%% %%############%% %%###########%%% %%############%% ]], - } - - dashboard.section.header.val = logo - dashboard.section.header.opts.hl = pick_color() - - dashboard.section.buttons.val = { - dashboard.button("ff", " File Explorer"), - dashboard.button("fo", " Find File"), - dashboard.button("fw", " Find Word"), - dashboard.button("fs", "󱝆 Find Session"), - dashboard.button("ps", " Update plugins"), - dashboard.button("q", "󰩈 Quit", ":qa"), - } - - dashboard.section.footer.val = footer() - dashboard.section.footer.opts.hl = "Constant" - - alpha.setup(dashboard.opts) - - vim.cmd [[ autocmd FileType alpha setlocal nofoldenable ]] - end, - }, } + return plugins