diff options
| author | bh <qn+git@excalibur.computer> | 2025-11-12 23:57:20 +0800 |
|---|---|---|
| committer | bh <qn+git@excalibur.computer> | 2025-11-12 23:57:20 +0800 |
| commit | cc5ca2e8c8fa3cf2e60321fdb0cb4ddb66551ff2 (patch) | |
| tree | f6173f63d1bd48710728817bd338838654ec60de | |
Initial Commit
| -rw-r--r-- | .bak/.init.lua.bak | 429 | ||||
| -rw-r--r-- | init.lua | 133 | ||||
| -rw-r--r-- | lazy-lock.json | 18 | ||||
| -rw-r--r-- | lua/config/.bak/.neovide.lua.bak | 81 | ||||
| -rw-r--r-- | lua/config/.bak/dashboard.lua.bak | 109 | ||||
| -rw-r--r-- | lua/config/.bak/dashboard2.lua.bak | 122 | ||||
| -rw-r--r-- | lua/config/.bak/greeter.lua.bak | 5 | ||||
| -rw-r--r-- | lua/config/colorpicker.lua | 16 | ||||
| -rw-r--r-- | lua/config/dashboard.lua | 84 | ||||
| -rw-r--r-- | lua/config/keybindings.lua | 19 | ||||
| -rw-r--r-- | lua/config/lazy.lua | 35 | ||||
| -rw-r--r-- | lua/config/lsp.lua | 104 | ||||
| -rw-r--r-- | lua/config/statusline.lua | 76 | ||||
| -rw-r--r-- | lua/config/tabs.lua | 81 | ||||
| -rw-r--r-- | lua/config/telescope.lua | 0 | ||||
| -rw-r--r-- | lua/config/theme.lua | 2 | ||||
| -rw-r--r-- | lua/config/tree.lua | 29 | ||||
| -rw-r--r-- | lua/config/vimtex.lua | 30 | ||||
| -rw-r--r-- | lua/plugins/.bak/.init.lua.bak | 119 | ||||
| -rw-r--r-- | lua/plugins/.bak/old.lua.bak | 104 | ||||
| -rw-r--r-- | lua/plugins/init.lua | 65 | ||||
| -rw-r--r-- | lua/plugins/test.c | 12 |
22 files changed, 1673 insertions, 0 deletions
diff --git a/.bak/.init.lua.bak b/.bak/.init.lua.bak new file mode 100644 index 0000000..daf47e2 --- /dev/null +++ b/.bak/.init.lua.bak @@ -0,0 +1,429 @@ +-- ░██████╗░██╗░░░██╗██╗██╗░░██╗░█████╗░████████╗██╗░█████╗░░░░░░░███╗░░██╗██╗░░░██╗██╗███╗░░░███╗ +-- ██╔═══██╗██║░░░██║██║╚██╗██╔╝██╔══██╗╚══██╔══╝██║██╔══██╗░░░░░░████╗░██║██║░░░██║██║████╗░████║ +-- ██║██╗██║██║░░░██║██║░╚███╔╝░██║░░██║░░░██║░░░██║██║░░╚═╝█████╗██╔██╗██║╚██╗░██╔╝██║██╔████╔██║ +-- ╚██████╔╝██║░░░██║██║░██╔██╗░██║░░██║░░░██║░░░██║██║░░██╗╚════╝██║╚████║░╚████╔╝░██║██║╚██╔╝██║ +-- ░╚═██╔═╝░╚██████╔╝██║██╔╝╚██╗╚█████╔╝░░░██║░░░██║╚█████╔╝░░░░░░██║░╚███║░░╚██╔╝░░██║██║░╚═╝░██║ +-- ░░░╚═╝░░░░╚═════╝░╚═╝╚═╝░░╚═╝░╚════╝░░░░╚═╝░░░╚═╝░╚════╝░░░░░░░╚═╝░░╚══╝░░░╚═╝░░░╚═╝╚═╝░░░░░╚═╝ +-- +-- By QuixoticNapoleon + +-------------------------------------------------------- +-- 🪶 Plugins +-------------------------------------------------------- + +-- Plugins +require("config.lazy") +-- require("lazy").setup("plugins") + + +-- Config Files +require("config/keybindings") +require("config/tree") +require('config/statusline') +require("config/neovide") +require("config/ccc") +require("config/dashboard") +require("config/tabs") + + +-- require('config/greeter') +-------------------------------------------------------- +-- 🪶 Basic Settings +-------------------------------------------------------- + +-- Line Numbers +vim.wo.number = true +vim.wo.relativenumber = true + + +-- Change the color of the line numbers +vim.api.nvim_set_hl(0, 'LineNr', { fg = '#74c4c4', bg = 'NONE' }) +vim.api.nvim_set_hl(0, 'CursorLineNr', { fg = '#74c4c4', bg = 'NONE' }) + + +-- Tab Spaces +vim.cmd("set tabstop=4") +vim.cmd("set shiftwidth=4") +vim.cmd("set expandtab") + + +-------------------------------------------------------- +-- 🪶 GUI and Colour Configuration +-------------------------------------------------------- + +-- Colors +vim.opt.termguicolors = true +vim.opt.background = "dark" -- or "light" depending on theme + +-- Remove Vim Background +vim.api.nvim_set_hl(0, "Normal", { ctermbg = "none", bg = "none" }) + +-- Colors (Foreground and Background) +-- Neovide uses Neovim's colorscheme, so we’ll override via highlight groups +vim.api.nvim_set_hl(0, "Normal", { fg = "#8affff", bg = "#003636" }) +vim.api.nvim_set_hl(0, "NormalFloat", { fg = "#8affff", bg = "#003636" }) + +-- Set font and size +-- vim.o.guifont = "JetBrainsMono Nerd Font:h14" +vim.o.guifont = "Source Code Pro:h10.5" + +vim.cmd [[ + highlight BufferCurrent guifg=#FFFFFF guibg=#003636 + highlight BufferVisible guifg=#CCCCCC guibg=#003636 + highlight BufferInactive guifg=#888888 guibg=#003636 + + highlight BufferDefaultCurrent guifg=#FFFFFF guibg=#003636 + highlight BufferDefaultVisible guifg=#CCCCCC guibg=#003636 + highlight BufferDefaultInactive guifg=#888888 guibg=#003636 + + highlight BufferInactiveSign guifg=#8affff guibg=#003636 + highlight BufferVisibleSign guifg=#8affff guibg=#003636 + highlight BufferCurrentSign guifg=#8affff guibg=#003636 + + highlight BufferDefaultInactiveSign guifg=#8affff guibg=#003636 + highlight BufferDefaultVisibleSign guifg=#8affff guibg=#003636 + highlight BufferDefaultCurrentSign guifg=#8affff guibg=#003636 + + highlight BufferDefaultInactiveIcon guifg=#8affff guibg=#003636 + highlight BufferDefaultVisibleIcon guifg=#8affff guibg=#003636 + highlight BufferDefaultCurrentIcon guifg=#8affff guibg=#003636 + + highlight BufferInactiveIcon guifg=#8affff guibg=#003636 + highlight BufferVisibleIcon guifg=#8affff guibg=#003636 + highlight BufferCurrentIcon guifg=#8affff guibg=#003636 + + highlight BufferTabpageFill guibg=#003636 +]] + +-- desired icon background colour +local ICON_BG = "#003636" + +local function fix_devicon_bg() + for _, name in ipairs(vim.fn.getcompletion('DevIcon', 'highlight')) do + local hl = vim.api.nvim_get_hl(0, { name = name }) + -- Only change background (keep fg) + vim.api.nvim_set_hl(0, name, { fg = hl.fg, bg = ICON_BG }) + end +end + +-- Hook on colorscheme change / startup +vim.api.nvim_create_autocmd({ "ColorScheme", "VimEnter" }, { + callback = function() vim.schedule(fix_devicon_bg) end, +}) + +-- Hook when buffers enter (so new filetypes show up) +vim.api.nvim_create_autocmd("BufEnter", { + callback = function() vim.schedule(fix_devicon_bg) end, +}) + +-- Wrap devicons.refresh +local ok, devicons = pcall(require, "nvim-web-devicons") +if ok then + local orig_refresh = devicons.refresh + devicons.refresh = function(...) + local result = orig_refresh(...) + vim.schedule(fix_devicon_bg) + return result + end +end + +-- local bg = "#003636" +-- +-- local function fix_devicon_bg() +-- for _, name in ipairs(vim.fn.getcompletion('DevIcon', 'highlight')) do +-- local hl = vim.api.nvim_get_hl(0, { name = name }) +-- vim.api.nvim_set_hl(0, name, { fg = hl.fg, bg = bg }) +-- end +-- end +-- +-- -- Run whenever colorschemes change or devicons refresh +-- vim.api.nvim_create_autocmd({ "ColorScheme", "VimEnter" }, { +-- callback = function() vim.schedule(fix_devicon_bg) end, +-- }) +-- +-- -- Wrap nvim-web-devicons.refresh() to always recolor after it defines new icons +-- local devicons_ok, devicons = pcall(require, "nvim-web-devicons") +-- if devicons_ok then +-- local orig_refresh = devicons.refresh +-- devicons.refresh = function(...) +-- local result = orig_refresh(...) +-- vim.schedule(fix_devicon_bg) +-- return result +-- end +-- end + + +-- local function fix_all_devicon_bg() +-- local bg = "#003636" +-- for _, name in ipairs(vim.fn.getcompletion('DevIcon', 'highlight')) do +-- -- only override background, keep whatever fg is there +-- local hl = vim.api.nvim_get_hl(0, { name = name }) +-- vim.api.nvim_set_hl(0, name, { fg = hl.fg, bg = bg }) +-- end +-- end +-- +-- vim.api.nvim_create_autocmd({ "ColorScheme", "VimEnter" }, { +-- callback = function() +-- vim.schedule(fix_all_devicon_bg) +-- end, +-- }) + +-- -- Function to set all DevIcon backgrounds +-- local function fix_devicon_bg() +-- local bg = "#003636" +-- for _, name in ipairs(vim.fn.getcompletion('DevIcon', 'highlight')) do +-- local current = vim.api.nvim_get_hl(0, { name = name }) +-- -- keep existing fg, just change bg +-- vim.api.nvim_set_hl(0, name, { fg = current.fg, bg = bg }) +-- end +-- end +-- +-- -- Run after startup and colorscheme changes +-- vim.api.nvim_create_autocmd({ "ColorScheme", "VimEnter" }, { +-- callback = function() vim.schedule(fix_devicon_bg) end, +-- }) + +-- vim.cmd [[ +-- highlight BufferDefaultAlternate guibg=#003636 +-- highlight BufferAlternate +-- highlight BufferDefaultAlternateADDED guibg=#003636 +-- highlight BufferAlternateADDED guibg=#003636 +-- highlight BufferDefaultAlternateBtn guibg=#003636 +-- highlight BufferAlternateBtn guibg=#003636 +-- highlight BufferDefaultAlternateCHANGED guibg=#003636 +-- highlight BufferAlternateCHANGED guibg=#003636 +-- highlight BufferDefaultAlternateDELETED guibg=#003636 +-- highlight BufferAlternateDELETED guibg=#003636 +-- highlight BufferDefaultAlternateERROR guibg=#003636 +-- highlight BufferAlternateERROR guibg=#003636 +-- highlight BufferDefaultAlternateHINT guibg=#003636 +-- highlight BufferAlternateHINT guibg=#003636 +-- highlight BufferDefaultAlternateIcon guibg=#003636 +-- highlight BufferAlternateIcon guibg=#003636 +-- highlight BufferDefaultAlternateIndex guibg=#003636 +-- highlight BufferAlternateIndex guibg=#003636 +-- highlight BufferDefaultAlternateINFO guibg=#003636 +-- highlight BufferAlternateINFO guibg=#003636 +-- highlight BufferDefaultAlternateMod guibg=#003636 +-- highlight BufferAlternateMod guibg=#003636 +-- highlight BufferDefaultAlternateModBtn guibg=#003636 +-- highlight BufferAlternateModBtn guibg=#003636 +-- highlight BufferDefaultAlternateNumber guibg=#003636 +-- highlight BufferAlternateNumber guibg=#003636 +-- highlight BufferDefaultAlternatePin guibg=#003636 +-- highlight BufferAlternatePin guibg=#003636 +-- highlight BufferDefaultAlternatePinBtn guibg=#003636 +-- highlight BufferAlternatePinBtn guibg=#003636 +-- highlight BufferDefaultAlternateSign guibg=#003636 +-- highlight BufferAlternateSign guibg=#003636 +-- highlight BufferDefaultAlternateSignRight guibg=#003636 +-- highlight BufferAlternateSignRight guibg=#003636 +-- highlight BufferDefaultAlternateTarget guibg=#003636 +-- highlight BufferAlternateTarget guibg=#003636 +-- highlight BufferDefaultAlternateWARN guibg=#003636 +-- highlight BufferAlternateWARN guibg=#003636 +-- highlight BufferDefaultCurrent guibg=#003636 +-- highlight BufferCurrent +-- highlight BufferDefaultCurrentADDED guibg=#003636 +-- highlight BufferCurrentADDED guibg=#003636 +-- highlight BufferDefaultCurrentBtn guibg=#003636 +-- highlight BufferCurrentBtn +-- highlight BufferDefaultCurrentCHANGED guibg=#003636 +-- highlight BufferCurrentCHANGED guibg=#003636 +-- highlight BufferDefaultCurrentDELETED guibg=#003636 +-- highlight BufferCurrentDELETED guibg=#003636 +-- highlight BufferDefaultCurrentERROR guibg=#003636 +-- highlight BufferCurrentERROR guibg=#003636 +-- highlight BufferDefaultCurrentHINT guibg=#003636 +-- highlight BufferCurrentHINT guibg=#003636 +-- highlight BufferDefaultCurrentIcon guibg=#003636 +-- highlight BufferCurrentIcon guibg=#003636 +-- highlight BufferDefaultCurrentIndex guibg=#003636 +-- highlight BufferCurrentIndex guibg=#003636 +-- highlight BufferDefaultCurrentINFO guibg=#003636 +-- highlight BufferCurrentINFO guibg=#003636 +-- highlight BufferDefaultCurrentMod guibg=#003636 +-- highlight BufferCurrentMod +-- highlight BufferDefaultCurrentModBtn guibg=#003636 +-- highlight BufferCurrentModBtn guibg=#003636 +-- highlight BufferDefaultCurrentNumber guibg=#003636 +-- highlight BufferCurrentNumber guibg=#003636 +-- highlight BufferDefaultCurrentPin guibg=#003636 +-- highlight BufferCurrentPin +-- highlight BufferDefaultCurrentPinBtn guibg=#003636 +-- highlight BufferCurrentPinBtn guibg=#003636 +-- highlight BufferDefaultCurrentSign guibg=#003636 +-- highlight BufferCurrentSign guibg=#003636 +-- highlight BufferDefaultCurrentSignRight guibg=#003636 +-- highlight BufferCurrentSignRight guibg=#003636 +-- highlight BufferDefaultCurrentTarget guibg=#003636 +-- highlight BufferCurrentTarget guibg=#003636 +-- highlight BufferDefaultCurrentWARN guibg=#003636 +-- highlight BufferCurrentWARN guibg=#003636 +-- highlight BufferDefaultInactive guibg=#003636 +-- highlight BufferInactive +-- highlight BufferDefaultInactiveADDED guibg=#003636 +-- highlight BufferInactiveADDED guibg=#003636 +-- highlight BufferDefaultInactiveBtn guibg=#003636 +-- highlight BufferInactiveBtn guibg=#003636 +-- highlight BufferDefaultInactiveCHANGED guibg=#003636 +-- highlight BufferInactiveCHANGED guibg=#003636 +-- highlight BufferDefaultInactiveDELETED guibg=#003636 +-- highlight BufferInactiveDELETED guibg=#003636 +-- highlight BufferDefaultInactiveERROR guibg=#003636 +-- highlight BufferInactiveERROR guibg=#003636 +-- highlight BufferDefaultInactiveHINT guibg=#003636 +-- highlight BufferInactiveHINT guibg=#003636 +-- highlight BufferDefaultInactiveIcon guibg=#003636 +-- highlight BufferInactiveIcon guibg=#003636 +-- highlight BufferDefaultInactiveIndex guibg=#003636 +-- highlight BufferInactiveIndex guibg=#003636 +-- highlight BufferDefaultInactiveINFO guibg=#003636 +-- highlight BufferInactiveINFO guibg=#003636 +-- highlight BufferDefaultInactiveMod guibg=#003636 +-- highlight BufferInactiveMod guibg=#003636 +-- highlight BufferDefaultInactiveModBtn guibg=#003636 +-- highlight BufferInactiveModBtn guibg=#003636 +-- highlight BufferDefaultInactiveNumber guibg=#003636 +-- highlight BufferInactiveNumber guibg=#003636 +-- highlight BufferDefaultInactivePin guibg=#003636 +-- highlight BufferInactivePin guibg=#003636 +-- highlight BufferDefaultInactivePinBtn guibg=#003636 +-- highlight BufferInactivePinBtn guibg=#003636 +-- highlight BufferDefaultInactiveSign guibg=#003636 +-- highlight BufferInactiveSign guibg=#003636 +-- highlight BufferDefaultInactiveSignRight guibg=#003636 +-- highlight BufferInactiveSignRight guibg=#003636 +-- highlight BufferDefaultInactiveTarget guibg=#003636 +-- highlight BufferInactiveTarget guibg=#003636 +-- highlight BufferDefaultInactiveWARN guibg=#003636 +-- highlight BufferInactiveWARN guibg=#003636 +-- highlight BufferDefaultOffset guibg=#003636 +-- highlight BufferOffset +-- highlight BufferDefaultTabpagesSep guibg=#003636 +-- highlight BufferScrollArrow guibg=#003636 +-- highlight BufferDefaultTabpageFill guibg=#003636 +-- highlight BufferTabpageFill guibg=#003636 +-- highlight BufferDefaultTabpages guibg=#003636 +-- highlight BufferTabpages +-- highlight BufferTabpagesSep guibg=#003636 +-- highlight BufferDefaultVisible guibg=#003636 +-- highlight BufferVisible +-- highlight BufferDefaultVisibleADDED guibg=#003636 +-- highlight BufferVisibleADDED guibg=#003636 +-- highlight BufferDefaultVisibleBtn guibg=#003636 +-- highlight BufferVisibleBtn +-- highlight BufferDefaultVisibleCHANGED guibg=#003636 +-- highlight BufferVisibleCHANGED guibg=#003636 +-- highlight BufferDefaultVisibleDELETED guibg=#003636 +-- highlight BufferVisibleDELETED guibg=#003636 +-- highlight BufferDefaultVisibleERROR guibg=#003636 +-- highlight BufferVisibleERROR guibg=#003636 +-- highlight BufferDefaultVisibleHINT guibg=#003636 +-- highlight BufferVisibleHINT guibg=#003636 +-- highlight BufferDefaultVisibleIcon guibg=#003636 +-- highlight BufferVisibleIcon guibg=#003636 +-- highlight BufferDefaultVisibleIndex guibg=#003636 +-- highlight BufferVisibleIndex guibg=#003636 +-- highlight BufferDefaultVisibleINFO guibg=#003636 +-- highlight BufferVisibleINFO guibg=#003636 +-- highlight BufferDefaultVisibleMod guibg=#003636 +-- highlight BufferVisibleMod +-- highlight BufferDefaultVisibleModBtn guibg=#003636 +-- highlight BufferVisibleModBtn guibg=#003636 +-- highlight BufferDefaultVisibleNumber guibg=#003636 +-- highlight BufferVisibleNumber guibg=#003636 +-- highlight BufferDefaultVisiblePin guibg=#003636 +-- highlight BufferVisiblePin +-- highlight BufferDefaultVisiblePinBtn guibg=#003636 +-- highlight BufferVisiblePinBtn guibg=#003636 +-- highlight BufferDefaultVisibleSign guibg=#003636 +-- highlight BufferVisibleSign guibg=#003636 +-- highlight BufferDefaultVisibleSignRight guibg=#003636 +-- highlight BufferVisibleSignRight guibg=#003636 +-- highlight BufferDefaultVisibleTarget guibg=#003636 +-- highlight BufferVisibleTarget guibg=#003636 +-- highlight BufferDefaultVisibleWARN guibg=#003636 +-- highlight BufferVisibleWARN guibg=#003636 +-- ]] + + +-- vim.schedule(function() +-- local old_color, new_color = "#4f5258", "#003636" +-- +-- for _, group in ipairs(vim.fn.getcompletion('', 'highlight')) do +-- local hl = vim.api.nvim_get_hl(0, { name = group }) +-- local changed = false +-- +-- if hl.fg == old_color then hl.fg = new_color; changed = true end +-- if hl.bg == old_color then hl.bg = new_color; changed = true end +-- +-- if changed then vim.api.nvim_set_hl(0, group, hl) end +-- end +-- end) + + + + + +-- -- Override after colourscheme +-- -- After your colourscheme and require("barbar").setup(...) +-- vim.cmd [[ +-- " Standard buffer highlights +-- highlight BufferCurrent guibg=#003636 +-- highlight BufferCurrentMod guibg=#003636 +-- highlight BufferVisible guibg=#003636 +-- highlight BufferVisibleMod guibg=#003636 +-- highlight BufferInactive guibg=#003636 +-- highlight BufferInactiveMod guibg=#003636 +-- highlight BufferAlternate guibg=#003636 +-- highlight BufferAlternateMod guibg=#003636 +-- +-- " Separator / empty space highlights +-- highlight BufferCurrentSign guibg=#003636 +-- highlight BufferCurrentSignRight guibg=#003636 +-- highlight BufferVisibleSign guibg=#003636 +-- highlight BufferVisibleSignRight guibg=#003636 +-- highlight BufferInactiveSign guibg=#003636 +-- highlight BufferInactiveSignRight guibg=#003636 +-- highlight BufferAlternateSign guibg=#003636 +-- highlight BufferAlternateSignRight guibg=#003636 +-- ]] +-- +-- -- Transparent backgrounds (if you also want that) +-- -- vim.cmd [[ +-- -- highlight BufferCurrent guibg=NONE +-- -- highlight BufferCurrentMod guibg=NONE +-- -- highlight BufferVisible guibg=NONE +-- -- highlight BufferVisibleMod guibg=NONE +-- -- highlight BufferInactive guibg=NONE +-- -- highlight BufferInactiveMod guibg=NONE +-- -- highlight BufferAlternate guibg=NONE +-- -- highlight BufferAlternateMod guibg=NONE +-- -- ]] +-- +-- -- -- Function to toggle visibility +-- -- local function toggle_barbar() +-- -- -- count *listed* buffers with a window open +-- -- local count = 0 +-- -- for _, buf in ipairs(vim.fn.getbufinfo({buflisted = 1})) do +-- -- if vim.fn.bufwinnr(buf.bufnr) ~= -1 then +-- -- count = count + 1 +-- -- end +-- -- end +-- -- +-- -- if count <= 1 then +-- -- -- Only one visible buffer: hide barbar tabline +-- -- vim.cmd("BarbarDisable") +-- -- -- Optionally also hide native tabline +-- -- vim.o.showtabline = 0 +-- -- else +-- -- vim.cmd("BarbarEnable") +-- -- vim.o.showtabline = 2 +-- -- end +-- -- end +-- -- +-- -- -- Autocommands to trigger +-- -- vim.api.nvim_create_autocmd({ "BufAdd", "BufDelete", "BufEnter", "VimEnter" }, { +-- -- callback = toggle_barbar, +-- -- }) diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..d2ddbf3 --- /dev/null +++ b/init.lua @@ -0,0 +1,133 @@ +-- ░██████╗░██╗░░░██╗██╗██╗░░██╗░█████╗░████████╗██╗░█████╗░░░░░░░███╗░░██╗██╗░░░██╗██╗███╗░░░███╗ +-- ██╔═══██╗██║░░░██║██║╚██╗██╔╝██╔══██╗╚══██╔══╝██║██╔══██╗░░░░░░████╗░██║██║░░░██║██║████╗░████║ +-- ██║██╗██║██║░░░██║██║░╚███╔╝░██║░░██║░░░██║░░░██║██║░░╚═╝█████╗██╔██╗██║╚██╗░██╔╝██║██╔████╔██║ +-- ╚██████╔╝██║░░░██║██║░██╔██╗░██║░░██║░░░██║░░░██║██║░░██╗╚════╝██║╚████║░╚████╔╝░██║██║╚██╔╝██║ +-- ░╚═██╔═╝░╚██████╔╝██║██╔╝╚██╗╚█████╔╝░░░██║░░░██║╚█████╔╝░░░░░░██║░╚███║░░╚██╔╝░░██║██║░╚═╝░██║ +-- ░░░╚═╝░░░░╚═════╝░╚═╝╚═╝░░╚═╝░╚════╝░░░░╚═╝░░░╚═╝░╚════╝░░░░░░░╚═╝░░╚══╝░░░╚═╝░░░╚═╝╚═╝░░░░░╚═╝ +-- +-- By QuixoticNapoleon + +-------------------------------------------------------- +-- 🪶 Plugins +-------------------------------------------------------- + +-- Plugins +require("config.lazy") +-- require("lazy").setup("plugins") + + +-- Config Files +require("config/theme") +require("config/keybindings") +-- require("config/tree") +-- require('config/statusline') +-- require("config/neovide") +-- require("config/ccc") +-- require("config/dashboard") +-- require("config/tabs") + + +-- require('config/greeter') +-------------------------------------------------------- +-- 🪶 Basic Settings +-------------------------------------------------------- + +-- Line Numbers +vim.wo.number = true +vim.wo.relativenumber = true + + +-- Change the color of the line numbers +vim.api.nvim_set_hl(0, 'LineNr', { fg = '#74c4c4', bg = 'NONE' }) +vim.api.nvim_set_hl(0, 'CursorLineNr', { fg = '#74c4c4', bg = 'NONE' }) + + +-- Tab Spaces +vim.cmd("set tabstop=4") +vim.cmd("set shiftwidth=4") +vim.cmd("set expandtab") + + +-------------------------------------------------------- +-- 🪶 GUI and Colour Configuration +-------------------------------------------------------- + +-- Colors +vim.opt.termguicolors = true +vim.opt.background = "dark" -- or "light" depending on theme + +-- Remove Vim Background +vim.api.nvim_set_hl(0, "Normal", { ctermbg = "none", bg = "none" }) + +-- Colors (Foreground and Background) +-- Neovide uses Neovim's colorscheme, so we’ll override via highlight groups +vim.api.nvim_set_hl(0, "Normal", { fg = "#8affff", bg = "#003636" }) +vim.api.nvim_set_hl(0, "NormalFloat", { fg = "#8affff", bg = "#003636" }) + +-- Set font and size +-- vim.o.guifont = "JetBrainsMono Nerd Font:h14" +vim.o.guifont = "Source Code Pro:h10.5" + +vim.cmd [[ + highlight BufferCurrent guifg=#FFFFFF guibg=#003636 + highlight BufferVisible guifg=#CCCCCC guibg=#003636 + highlight BufferInactive guifg=#888888 guibg=#003636 + + highlight BufferCurrentMod guifg=#fce094 guibg=#003636 + highlight BufferVisibleMod guibg=#003636 + highlight BufferInactiveMod guibg=#003636 + + highlight BufferDefaultCurrent guifg=#FFFFFF guibg=#003636 + highlight BufferDefaultVisible guifg=#CCCCCC guibg=#003636 + highlight BufferDefaultInactive guifg=#888888 guibg=#003636 + + highlight BufferInactiveSign guifg=#8affff guibg=#003636 + highlight BufferVisibleSign guifg=#8affff guibg=#003636 + highlight BufferCurrentSign guifg=#8affff guibg=#003636 + + highlight BufferDefaultInactiveSign guifg=#8affff guibg=#003636 + highlight BufferDefaultVisibleSign guifg=#8affff guibg=#003636 + highlight BufferDefaultCurrentSign guifg=#8affff guibg=#003636 + + highlight BufferDefaultInactiveIcon guifg=#8affff guibg=#003636 + highlight BufferDefaultVisibleIcon guifg=#8affff guibg=#003636 + highlight BufferDefaultCurrentIcon guifg=#8affff guibg=#003636 + + highlight BufferInactiveIcon guifg=#8affff guibg=#003636 + highlight BufferVisibleIcon guifg=#8affff guibg=#003636 + highlight BufferCurrentIcon guifg=#8affff guibg=#003636 + + highlight BufferTabpageFill guibg=#003636 +]] + +-- desired icon background colour +local ICON_BG = "#003636" + +local function fix_devicon_bg() + for _, name in ipairs(vim.fn.getcompletion('DevIcon', 'highlight')) do + local hl = vim.api.nvim_get_hl(0, { name = name }) + -- Only change background (keep fg) + vim.api.nvim_set_hl(0, name, { fg = hl.fg, bg = ICON_BG }) + end +end + +-- Hook on colorscheme change / startup +vim.api.nvim_create_autocmd({ "ColorScheme", "VimEnter" }, { + callback = function() vim.schedule(fix_devicon_bg) end, +}) + +-- Hook when buffers enter (so new filetypes show up) +vim.api.nvim_create_autocmd("BufEnter", { + callback = function() vim.schedule(fix_devicon_bg) end, +}) + +-- Wrap devicons.refresh +local ok, devicons = pcall(require, "nvim-web-devicons") +if ok then + local orig_refresh = devicons.refresh + devicons.refresh = function(...) + local result = orig_refresh(...) + vim.schedule(fix_devicon_bg) + return result + end +end diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..dcbe927 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,18 @@ +{ + "LuaSnip": { "branch": "master", "commit": "3732756842a2f7e0e76a7b0487e9692072857277" }, + "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" }, + "darkplus.nvim": { "branch": "main", "commit": "6101ffce60682208e9e076710299d189ce11c40d" }, + "dashboard-nvim": { "branch": "master", "commit": "0775e567b6c0be96d01a61795f7b64c1758262f6" }, + "gitsigns.nvim": { "branch": "main", "commit": "20ad4419564d6e22b189f6738116b38871082332" }, + "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, + "nvim-cmp": { "branch": "main", "commit": "106c4bcc053a5da783bf4a9d907b6f22485c2ea0" }, + "nvim-lspconfig": { "branch": "master", "commit": "c8503e63c6afab3ed34b49865a4a4edbb1ebf4a8" }, + "nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" }, + "onedark.nvim": { "branch": "master", "commit": "6c10964f91321c6a0f09bcc41dd64e7a6602bc4f" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" }, + "vim-grammarous": { "branch": "master", "commit": "db46357465ce587d5325e816235b5e92415f8c05" }, + "vimtex": { "branch": "master", "commit": "32bcb3922c20588e00de68f73c86312eda2141ad" } +} diff --git a/lua/config/.bak/.neovide.lua.bak b/lua/config/.bak/.neovide.lua.bak new file mode 100644 index 0000000..aa62665 --- /dev/null +++ b/lua/config/.bak/.neovide.lua.bak @@ -0,0 +1,81 @@ +-- -------------------------------------------------------- +-- -- 🪶 Neovide GUI Configuration +-- -------------------------------------------------------- +-- -- NEOVIDE -- +-- +-- -- Enable transparency +-- vim.g.neovide_opacity = 0.75 +-- +-- -- Set font and size +-- -- vim.o.guifont = "JetBrainsMono Nerd Font:h14" +-- vim.o.guifont = "Source Code Pro:h10.5" +-- +-- -- Colors (Foreground and Background) +-- -- Neovide uses Neovim's colorscheme, so we’ll override via highlight groups +-- vim.api.nvim_set_hl(0, "Normal", { fg = "#8affff", bg = "#003636" }) +-- vim.api.nvim_set_hl(0, "NormalFloat", { fg = "#8affff", bg = "#003636" }) +-- +-- -- Neovide also supports an extra blending layer +-- vim.g.neovide_background_color = "#003636" .. string.format("%x", math.floor(255 * vim.g.neovide_opacity)) +-- +-- +-- -- Padding (Kitty → Neovide scaling) +-- vim.g.neovide_padding_top = 5 +-- vim.g.neovide_padding_bottom = 5 +-- vim.g.neovide_padding_right = 5 +-- vim.g.neovide_padding_left = 5 +-- +-- -- Set cursor effects +-- -- vim.g.neovide_cursor_vfx_mode = "railgun" +-- +-- -- Enable fullscreen +-- -- vim.g.neovide_fullscreen = true +-- +-- -- Scale factor (zoom) +-- vim.g.neovide_scale_factor = 0.75 +-- +-- -- Helper function to zoom in/out +-- -- local change_scale_factor = function(delta) +-- -- vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * delta +-- -- end +-- -- vim.keymap.set("n", "<C-=>", function() change_scale_factor(1.25) end) +-- -- vim.keymap.set("n", "<C-->", function() change_scale_factor(1/1.25) end) +-- +-- + +-------------------------------------------------------- +-- 🪶 Neovide GUI Configuration +-------------------------------------------------------- +-- NEOVIDE -- + +-- Enable transparency +vim.g.neovide_opacity = 0.75 + + + +-- Neovide also supports an extra blending layer +vim.g.neovide_background_color = "#003636" .. string.format("%x", math.floor(255 * vim.g.neovide_opacity)) + + +-- Padding (Kitty → Neovide scaling) +vim.g.neovide_padding_top = 5 +vim.g.neovide_padding_bottom = 5 +vim.g.neovide_padding_right = 5 +vim.g.neovide_padding_left = 5 + +-- Set cursor effects +-- vim.g.neovide_cursor_vfx_mode = "railgun" + +-- Enable fullscreen +-- vim.g.neovide_fullscreen = true + +-- Scale factor (zoom) +vim.g.neovide_scale_factor = 0.75 + +-- Helper function to zoom in/out +-- local change_scale_factor = function(delta) +-- vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * delta +-- end +-- vim.keymap.set("n", "<C-=>", function() change_scale_factor(1.25) end) +-- vim.keymap.set("n", "<C-->", function() change_scale_factor(1/1.25) end) + diff --git a/lua/config/.bak/dashboard.lua.bak b/lua/config/.bak/dashboard.lua.bak new file mode 100644 index 0000000..d5c81c0 --- /dev/null +++ b/lua/config/.bak/dashboard.lua.bak @@ -0,0 +1,109 @@ +-- local home = os.getenv('HOME') +-- local db = require('dashboard') +-- db.default_banner = +-- { +-- '', +-- '', +-- '', +-- '██████╗ ██╗ ██╗ ███╗ ██╗██╗ ██╗██╗███╗ ███╗', +-- '██╔══██╗██║ ██║ ████╗ ██║██║ ██║██║████╗ ████║', +-- '██████╔╝███████║█████╗██╔██╗ ██║██║ ██║██║██╔████╔██║', +-- '██╔══██╗██╔══██║╚════╝██║╚██╗██║╚██╗ ██╔╝██║██║╚██╔╝██║', +-- '██████╔╝██║ ██║ ██║ ╚████║ ╚████╔╝ ██║██║ ╚═╝ ██║', +-- '╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═══╝ ╚═══╝ ╚═╝╚═╝ ╚═ ', +-- '', +-- ' [TIP: To exit Vim, use a sledgehammer.] ', +-- '', +-- +-- +-- } +-- db.preview_file_height = 11 +-- db.preview_file_width = 70 +-- db.custom_center = +-- { +-- { icon = ' ', +-- desc = 'Recently Opened Files ', +-- action = 'Telescope oldfiles', +-- shortcut = 'SPC f h' }, +-- { icon = ' ', +-- desc = 'New File ', +-- action = ':tabnew', +-- shortcut = 'SPC f n' }, +-- { icon = ' ', +-- desc = 'Find File ', +-- action = 'Telescope find_files find_command=rg,--hidden,--files', +-- shortcut = 'SPC f f' }, +-- { icon = ' ', +-- desc = 'File Browser ', +-- action = 'Telescope file_browser', +-- shortcut = 'SPC f b' }, +-- { icon = ' ', +-- desc = 'Find Word ', +-- action = 'Telescope live_grep', +-- shortcut = 'SPC f w' }, +-- { icon = ' ', +-- desc = 'View Harpoon Marks ', +-- action = 'Telescope harpoon marks', +-- shortcut = 'SPC f r' }, +-- { icon = '⚒ ', +-- desc = 'Use A Sledgehammer ', +-- action = 'qa', +-- shortcut = 'SPC w q' }, +-- } + +local db = require("dashboard") +db.setup { + theme = "hyper", + config = { + header = { + " ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ", + " ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ", + " ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ", + " ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ", + " ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ", + " ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ " + + }, +-- center = { +-- { icon = " ", desc = "Find File", action = "Telescope find_files", shortcut = "f" }, +-- { icon = " ", desc = "Recent Files", action = "Telescope oldfiles", shortcut = "r" }, +-- { icon = " ", desc = "New File", action = "enew", shortcut = "n" }, +-- { icon = " ", desc = "Open Config", action = "edit ~/.config/nvim/init.lua", shortcut = "c" }, +-- { icon = " ", desc = "Quit", action = "qa", shortcut = "q" }, +-- }, + center = + { + { icon = ' ', + desc = 'Recently Opened Files ', + action = 'Telescope oldfiles', + shortcut = 'SPC f h' }, + { icon = ' ', + desc = 'New File ', + action = ':tabnew', + shortcut = 'SPC f n' }, + { icon = ' ', + desc = 'Find File ', + action = 'Telescope find_files find_command=rg,--hidden,--files', + shortcut = 'SPC f f' }, + { icon = ' ', + desc = 'File Browser ', + action = 'Telescope file_browser', + shortcut = 'SPC f b' }, + { icon = ' ', + desc = 'Find Word ', + action = 'Telescope live_grep', + shortcut = 'SPC f w' }, + { icon = ' ', + desc = 'View Harpoon Marks ', + action = 'Telescope harpoon marks', + shortcut = 'SPC f r' }, + { icon = '⚒ ', + desc = 'Use A Sledgehammer ', + action = 'qa', + shortcut = 'SPC w q' }, + }, + + footer = { "Have a productive day!" }, + }, +} + diff --git a/lua/config/.bak/dashboard2.lua.bak b/lua/config/.bak/dashboard2.lua.bak new file mode 100644 index 0000000..8eeb687 --- /dev/null +++ b/lua/config/.bak/dashboard2.lua.bak @@ -0,0 +1,122 @@ +-- local home = os.getenv('HOME') +-- local db = require('dashboard') +-- db.default_banner = +-- { +-- '', +-- '', +-- '', +-- '██████╗ ██╗ ██╗ ███╗ ██╗██╗ ██╗██╗███╗ ███╗', +-- '██╔══██╗██║ ██║ ████╗ ██║██║ ██║██║████╗ ████║', +-- '██████╔╝███████║█████╗██╔██╗ ██║██║ ██║██║██╔████╔██║', +-- '██╔══██╗██╔══██║╚════╝██║╚██╗██║╚██╗ ██╔╝██║██║╚██╔╝██║', +-- '██████╔╝██║ ██║ ██║ ╚████║ ╚████╔╝ ██║██║ ╚═╝ ██║', +-- '╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═══╝ ╚═══╝ ╚═╝╚═╝ ╚═ ', +-- '', +-- ' [TIP: To exit Vim, use a sledgehammer.] ', +-- '', +-- +-- +-- } +-- db.preview_file_height = 11 +-- db.preview_file_width = 70 +-- db.custom_center = +-- { +-- { icon = ' ', +-- desc = 'Recently Opened Files ', +-- action = 'Telescope oldfiles', +-- shortcut = 'SPC f h' }, +-- { icon = ' ', +-- desc = 'New File ', +-- action = ':tabnew', +-- shortcut = 'SPC f n' }, +-- { icon = ' ', +-- desc = 'Find File ', +-- action = 'Telescope find_files find_command=rg,--hidden,--files', +-- shortcut = 'SPC f f' }, +-- { icon = ' ', +-- desc = 'File Browser ', +-- action = 'Telescope file_browser', +-- shortcut = 'SPC f b' }, +-- { icon = ' ', +-- desc = 'Find Word ', +-- action = 'Telescope live_grep', +-- shortcut = 'SPC f w' }, +-- { icon = ' ', +-- desc = 'View Harpoon Marks ', +-- action = 'Telescope harpoon marks', +-- shortcut = 'SPC f r' }, +-- { icon = '⚒ ', +-- desc = 'Use A Sledgehammer ', +-- action = 'qa', +-- shortcut = 'SPC w q' }, +-- } + +local db = require("dashboard") +db.setup { + theme = "hyper", + config = { + header = { + " ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗", + " ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║", + " ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║", + " ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██╔╝██╔╝██║", + " ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║", + " ╚═╝ ╚═══╝╚══════╝╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝", + " " + }, + week_header = { + enable = false -- or true if you want date/time header + }, + shortcut = { + { + icon = " ", + desc = "Find File", + key = "f", + action = "Telescope find_files" + }, + { + icon = " ", + desc = "Recent Files", + key = "r", + action = "Telescope oldfiles" + }, + { + icon = " ", + desc = "New File", + key = "n", + action = "enew" + }, + { + icon = " ", + desc = "Open Config", + key = "c", + action = "edit ~/.config/nvim/init.lua" + }, + { + icon = " ", + desc = "Quit", + key = "q", + action = "qa" + }, + }, + packages = { + enable = true -- set to true if you want plugin count display + }, + project = { + enable = false, -- set true if you want project list + limit = 8, + icon = " ", + label = "Projects", + action = "Telescope find_files cwd=" + }, + mru = { + enable = true, -- set true if you want MRU files + limit = 10, + icon = " ", + label = "Recent", + cwd_only = false + }, + footer = { "Have a productive day!" }, + }, +} + diff --git a/lua/config/.bak/greeter.lua.bak b/lua/config/.bak/greeter.lua.bak new file mode 100644 index 0000000..a41cfd9 --- /dev/null +++ b/lua/config/.bak/greeter.lua.bak @@ -0,0 +1,5 @@ +-- vim.g.dashboard_custom_header = +-- { +-- [[ Hello ]] +-- } + diff --git a/lua/config/colorpicker.lua b/lua/config/colorpicker.lua new file mode 100644 index 0000000..39772be --- /dev/null +++ b/lua/config/colorpicker.lua @@ -0,0 +1,16 @@ +return function() + -- Enable true color + vim.opt.termguicolors = true + + local ccc = require("ccc") + local mapping = ccc.mapping + + ccc.setup({ + highlighter = { + auto_enable = true, + lsp = true, + }, + -- add other options here + }) +end + diff --git a/lua/config/dashboard.lua b/lua/config/dashboard.lua new file mode 100644 index 0000000..c317a71 --- /dev/null +++ b/lua/config/dashboard.lua @@ -0,0 +1,84 @@ +return function() +local db = require("dashboard") + +-- Safe fortune function +local function quote() + local handle = io.popen("fortune -s") -- run fortune + local result = handle:read("*a") -- read all output + handle:close() + -- Remove all newlines and carriage returns + result = result:gsub("\r",""):gsub("\n"," ") + return result +end + +db.setup { + theme = "hyper", + config = { + week_header = { + enable = false -- or true if you want date/time header + }, + header = { + " ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗", + " ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║", + " ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║", + " ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██╔╝██╔╝██║", + " ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║", + " ╚═╝ ╚═══╝╚══════╝╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝", + " ", + " " .. os.date("%A, %B %d, %Y"), -- your custom date/day line + "", + "[TIP: To exit Vim, use a Sledgehammer!]", + "" -- optional empty line to separate from center shortcuts + }, + shortcut = { + { + icon = " ", + desc = "New File", + key = "n", + action = "enew" + }, + { + icon = " ", + desc = "Find File", + key = "f", + action = "Telescope find_files" + }, + { + icon = " ", + desc = "Recent Files", + key = "r", + action = "Telescope oldfiles" + }, + { + icon = " ", + desc = "Open Config", + key = "c", + action = "edit ~/.config/nvim/" + }, + { + icon = " ", + desc = "SLEDGEHAMMER!", + action = "qa" + }, + }, + packages = { + enable = true -- set to true if you want plugin count display + }, + mru = { + enable = true, -- set true if you want MRU files + limit = 10, + icon = " ", + label = "Recent", + cwd_only = false + }, + project = { + enable = false, -- set true if you want project list + limit = 8, + icon = " ", + label = "Projects", + action = "Telescope find_files cwd=" + }, + footer = { "", quote() }, + }, +} +end diff --git a/lua/config/keybindings.lua b/lua/config/keybindings.lua new file mode 100644 index 0000000..65d2b2b --- /dev/null +++ b/lua/config/keybindings.lua @@ -0,0 +1,19 @@ +-- Keybindings + +-- Swap Ctrl + C to Esc +-- vim.api.nvim_set_keymap('i', '<C-c>', '<Esc>', { noremap = true, silent = true }) +-- vim.api.nvim_set_keymap('i', '<C-g>', '<Esc>', { noremap = true, silent = true }) +-- vim.api.nvim_set_keymap('i', '<Esc>', '<C-c>', { noremap = true, silent = true }) + + +-- Leader Key +vim.g.mapleader = ' ' + +-- Tree +vim.api.nvim_set_keymap('n', '<leader>t', ':NvimTreeToggle<CR>', { noremap = true, silent = true }) + +-- Telescope +local builtin = require('telescope.builtin') +vim.keymap.set('n', '<leader>ff', builtin.find_files, {}) +vim.keymap.set('n', '<leader>fg', builtin.live_grep, {}) +vim.keymap.set('n', '<leader>fb', builtin.buffers, {}) diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua new file mode 100644 index 0000000..f5ee74c --- /dev/null +++ b/lua/config/lazy.lua @@ -0,0 +1,35 @@ +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end +vim.opt.rtp:prepend(lazypath) + +-- Make sure to setup `mapleader` and `maplocalleader` before +-- loading lazy.nvim so that mappings are correct. +-- This is also a good place to setup other settings (vim.opt) +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" + +-- Setup lazy.nvim +require("lazy").setup({ + spec = { + -- import your plugins + { import = "plugins" }, + }, + -- Configure any other settings here. See the documentation for more details. + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "habamax" } }, + -- automatically check for plugin updates + checker = { enabled = true }, +}) diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua new file mode 100644 index 0000000..5e1197a --- /dev/null +++ b/lua/config/lsp.lua @@ -0,0 +1,104 @@ +-- ~/.config/nvim/lua/config/lsp.lua +return function() + -- Shared settings✖ + local cmp_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp") + local capabilities = vim.lsp.protocol.make_client_capabilities() + if cmp_ok then + capabilities = cmp_nvim_lsp.default_capabilities(capabilities) + end + + local on_attach = function(client, bufnr) + local opts = { noremap = true, silent = true, buffer = bufnr } + vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) + vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) + vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts) + vim.keymap.set("n", "gr", vim.lsp.buf.references, opts) + vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts) + -- Normal mode: show diagnostics in a floating window + vim.keymap.set('n', '<leader>d', vim.diagnostic.open_float, { noremap=true, silent=true }) + + end + + -- Server‑specific configurations + local servers = { + lua_ls = { + settings = { + Lua = { + diagnostics = { globals = { "vim" } }, + workspace = { library = vim.api.nvim_get_runtime_file("", true) }, + telemetry = { enable = false }, + }, + }, + }, + ts_ls = {}, + texlab = { + settings = { + texlab = { + auxDirectory = "build", + build = { + executable = "latexmk", + args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" }, + onSave = true, + }, + forwardSearch = { + executable = "zathura", + args = { "--synctex-forward", "%l:1:%f", "%p" }, + }, + }, + }, + }, + clangd = {}, -- C & C++ + pyright = {}, -- Python + rust_analyzer = {}, -- Rust + zls = {}, -- Zig + hls = {}, -- Haskell + jdtls = {}, -- Java + asm_lsp = {}, -- Assembly (if you install it) + } + + for name, cfg in pairs(servers) do + -- Use the new api + vim.lsp.config(name, { + on_attach = on_attach, + capabilities = capabilities, + settings = cfg.settings, + root_dir = cfg.root_dir, -- optional if you have special root logic + }) + vim.lsp.enable(name) + + -- Diagnostic Icons + local signs = { Error = "✖", Warn = "", Hint = "", Info = "" } + for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) + end + + -- Use Nerd Font symbols for diagnostics + vim.fn.sign_define("DiagnosticSignError", {text = "✖", texthl = "DiagnosticError"}) -- x-mark + vim.fn.sign_define("DiagnosticSignWarn", {text = "", texthl = "DiagnosticWarn"}) -- warning triangle + vim.fn.sign_define("DiagnosticSignInfo", {text = "", texthl = "DiagnosticInfo"}) -- info circle + vim.fn.sign_define("DiagnosticSignHint", {text = "", texthl = "DiagnosticHint"}) -- lightbulb + + + vim.diagnostic.config({ + virtual_text = true, -- inline messages + signs = true, -- show signs in the gutter + underline = true, -- underline errors/warnings + update_in_insert = false, + severity_sort = true, + }) + + lualine_x = { + { + "diagnostics", + sources = {"nvim_lsp"}, + sections = {"error", "warn", "info", "hint"}, + symbols = { error = " ", warn = " ", info = " ", hint = " " }, + } + } + + + + end +end + diff --git a/lua/config/statusline.lua b/lua/config/statusline.lua new file mode 100644 index 0000000..9e5fbb8 --- /dev/null +++ b/lua/config/statusline.lua @@ -0,0 +1,76 @@ +-- ~/.config/nvim/lua/config/statusline.lua +return function() + local colors = { + fg = '#8affff', + bg = '#003636', + blue1 = '#00a8e6', + blue2 = '#2dc5fc', + green = '#00e6a9', + purple = '#d38cff', + red1 = '#f07178', + red2 = '#ff5370', + yellow = '#ffcb6b', + } + + local theal = { + normal = { + a = { fg = colors.bg, bg = colors.blue2, gui = 'bold' }, + b = { fg = colors.fg, bg = colors.bg }, + c = { fg = colors.fg, bg = colors.bg }, + }, + insert = { + a = { fg = colors.bg, bg = colors.green, gui = 'bold' }, + b = { fg = colors.fg, bg = colors.bg }, + }, + visual = { + a = { fg = colors.bg, bg = colors.purple, gui = 'bold' }, + b = { fg = colors.fg, bg = colors.bg }, + }, + replace = { + a = { fg = colors.bg, bg = colors.red1, gui = 'bold' }, + b = { fg = colors.fg, bg = colors.bg }, + }, + command = { + a = { fg = colors.bg, bg = colors.yellow, gui = 'bold' }, + b = { fg = colors.fg, bg = colors.bg }, + }, + inactive = { + a = { fg = colors.fg, bg = colors.bg, gui = 'bold' }, + b = { fg = colors.fg, bg = colors.bg }, + c = { fg = colors.fg, bg = colors.bg }, + }, + } + + require('lualine').setup { + options = { + icons_enabled = true, + theme = theal, + component_separators = { left = '', right = '' }, + section_separators = { left = '', right = '' }, + always_divide_middle = true, + globalstatus = false, + refresh = { statusline = 1000, tabline = 1000, winbar = 1000 }, + }, + sections = { + lualine_a = {'mode'}, + lualine_b = {'branch', 'diff', 'diagnostics'}, + lualine_c = {'filename'}, + lualine_x = {'encoding', 'fileformat', 'filetype'}, + lualine_y = {'progress'}, + lualine_z = {'location'} + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {'filename'}, + lualine_x = {'location'}, + lualine_y = {}, + lualine_z = {} + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {} + } +end + diff --git a/lua/config/tabs.lua b/lua/config/tabs.lua new file mode 100644 index 0000000..82e9e8f --- /dev/null +++ b/lua/config/tabs.lua @@ -0,0 +1,81 @@ +-- ~/.config/nvim/lua/config/tabs.lua +return function() + -- Disable auto-setup + vim.g.barbar_auto_setup = false -- disable auto-setup + + require'barbar'.setup { + -- WARN: do not copy everything below into your config! + -- It is just an example of what configuration options there are. + -- The defaults are suitable for most people. + + -- Enable/disable animations + animation = true, + + -- Automatically hide the tabline when there are this many buffers left. + -- Set to any value >=0 to enable. + auto_hide = 1, + + -- Set the filetypes which barbar will offset itself for + sidebar_filetypes = { + -- Use the default values: {event = 'BufWinLeave', text = '', align = 'left'} + NvimTree = true, + -- Or, specify the text used for the offset: + undotree = { + text = 'undotree', + align = 'center', -- *optionally* specify an alignment (either 'left', 'center', or 'right') + }, + -- Or, specify the event which the sidebar executes when leaving: + ['neo-tree'] = {event = 'BufWipeout'}, + -- Or, specify all three + Outline = {event = 'BufWinLeave', text = 'symbols-outline', align = 'right'}, + }, + + -- icons = { + -- -- Configure the base icons on the bufferline. + -- -- Valid options to display the buffer index and -number are `true`, 'superscript' and 'subscript' + -- buffer_index = false, + -- buffer_number = false, + -- button = '', + -- -- Enables / disables diagnostic symbols + -- diagnostics = { + -- [vim.diagnostic.severity.ERROR] = {enabled = true, icon = 'ff'}, + -- [vim.diagnostic.severity.WARN] = {enabled = false}, + -- [vim.diagnostic.severity.INFO] = {enabled = false}, + -- [vim.diagnostic.severity.HINT] = {enabled = true}, + -- }, + -- gitsigns = { + -- added = {enabled = true, icon = '+'}, + -- changed = {enabled = true, icon = '~'}, + -- deleted = {enabled = true, icon = '-'}, + -- }, + -- filetype = { + -- -- Sets the icon's highlight group. + -- -- If false, will use nvim-web-devicons colors + -- custom_colors = false, + + -- -- Requires `nvim-web-devicons` if `true` + -- enabled = true, + -- }, + -- separator = {left = '▎', right = ''}, + + -- -- If true, add an additional separator at the end of the buffer list + -- separator_at_end = true, + + -- -- Configure the icons on the bufferline when modified or pinned. + -- -- Supports all the base icon options. + -- modified = {button = '●'}, + -- pinned = {button = '', filename = true}, + + -- -- Use a preconfigured buffer appearance— can be 'default', 'powerline', or 'slanted' + -- preset = 'default', + + -- -- Configure the icons on the bufferline based on the visibility of a buffer. + -- -- Supports all the base icon options, plus `modified` and `pinned`. + -- alternate = {filetype = {enabled = false}}, + -- current = {buffer_index = true}, + -- inactive = {button = '×'}, + -- visible = {modified = {buffer_number = false}}, + -- }, + } +end + diff --git a/lua/config/telescope.lua b/lua/config/telescope.lua new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/lua/config/telescope.lua diff --git a/lua/config/theme.lua b/lua/config/theme.lua new file mode 100644 index 0000000..4c2a94a --- /dev/null +++ b/lua/config/theme.lua @@ -0,0 +1,2 @@ +vim.cmd("colorscheme default") + diff --git a/lua/config/tree.lua b/lua/config/tree.lua new file mode 100644 index 0000000..bb1c6c9 --- /dev/null +++ b/lua/config/tree.lua @@ -0,0 +1,29 @@ +-- ~/.config/nvim/lua/config/tree.lua +return function() + -- disable netrw + vim.g.loaded_netrw = 1 + vim.g.loaded_netrwPlugin = 1 + + -- enable 24-bit colors + vim.opt.termguicolors = true + + -- nvim-tree setup + require("nvim-tree").setup({ + sort = { + sorter = "case_sensitive", + }, + view = { + width = 30, + }, + renderer = { + group_empty = true, + }, + filters = { + dotfiles = true, + }, + }) + + -- keybindings + vim.api.nvim_set_keymap('n', '<leader>t', ':NvimTreeToggle<CR>', { noremap = true, silent = true }) +end + diff --git a/lua/config/vimtex.lua b/lua/config/vimtex.lua new file mode 100644 index 0000000..24679bf --- /dev/null +++ b/lua/config/vimtex.lua @@ -0,0 +1,30 @@ +return function() + -- Use Zathura as the PDF viewer + vim.g.vimtex_view_method = "zathura" + + -- Compile using latexmk automatically + vim.g.vimtex_compiler_method = "latexmk" + vim.g.vimtex_compiler_latexmk = { + build_dir = "build", -- Keep files in a separate folder + callback = 1, + continuous = 1, -- Automatically recompile on save + executable = "latexmk", + options = { + "-pdf", + "-interaction=nonstopmode", + "-synctex=1", + }, + } + + -- Optional: disable conceal for clearer LaTeX text + vim.g.vimtex_syntax_conceal = { + accents = 0, + ligatures = 0, + cites = 0, + fancy = 0, + spacing = 0, + greek = 0, + math_delimiters = 0, + math_super_sub = 0, + } +end diff --git a/lua/plugins/.bak/.init.lua.bak b/lua/plugins/.bak/.init.lua.bak new file mode 100644 index 0000000..394b181 --- /dev/null +++ b/lua/plugins/.bak/.init.lua.bak @@ -0,0 +1,119 @@ +-- Plugins +return { + + -- Nvim Tree + "nvim-tree/nvim-tree.lua", + + -- Icons + "nvim-tree/nvim-web-devicons", + + -- Color Picker + "uga-rosa/ccc.nvim", + + -- Status Bar + 'nvim-lualine/lualine.nvim', + + -- Neoscroll + "karb94/neoscroll.nvim", + opts = {}, + + + -- Telescope + { + 'nvim-telescope/telescope.nvim', tag = '0.1.8', + -- or , branch = '0.1.x', + dependencies = { 'nvim-lua/plenary.nvim' } + }, + + -- LSP + + + -- LaTeX + { + "lervag/vimtex", + ft = "tex", + init = function() + -- Use Zathura as the PDF viewer + vim.g.vimtex_view_method = "zathura" + + -- Compile using latexmk automatically + vim.g.vimtex_compiler_method = "latexmk" + vim.g.vimtex_compiler_latexmk = { + build_dir = "build", -- optional: keep files in a separate folder + callback = 1, + continuous = 1, -- automatically recompile on save + executable = "latexmk", + options = { + "-pdf", + "-interaction=nonstopmode", + "-synctex=1", + }, + } + + -- Optional: disable conceal for clearer LaTeX text + vim.g.vimtex_syntax_conceal = { + accents = 0, + ligatures = 0, + cites = 0, + fancy = 0, + spacing = 0, + greek = 0, + math_delimiters = 0, + math_super_sub = 0, + } + end, + }, + + -- LSP support + { + "neovim/nvim-lspconfig", + config = function() + require("lspconfig").texlab.setup({}) + end, + }, + + -- Autocompletion (optional) + { "hrsh7th/nvim-cmp" }, + { "hrsh7th/cmp-nvim-lsp" }, + + -- Snippets (optional) + { "L3MON4D3/LuaSnip" }, + + -- Grammar & spell checking + { "rhysd/vim-grammarous", ft = "tex" }, + + + -- Tab Bar + {'romgrk/barbar.nvim', + dependencies = { + 'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status + 'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons + }, + init = function() vim.g.barbar_auto_setup = false end, + opts = { + -- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default: + -- animation = true, + -- insert_at_start = true, + -- …etc. + }, + version = '^1.0.0', -- optional: only update when a new 1.x version is released + }, + + -- Dashboard + { + 'nvimdev/dashboard-nvim', + event = 'VimEnter', + config = function() + require('dashboard').setup { + -- config + } + end, + dependencies = { {'nvim-tree/nvim-web-devicons'}} + }, + + -- THEMES + "martinsione/darkplus.nvim", + "folke/tokyonight.nvim", + "navarasu/onedark.nvim" + +} diff --git a/lua/plugins/.bak/old.lua.bak b/lua/plugins/.bak/old.lua.bak new file mode 100644 index 0000000..e1f3946 --- /dev/null +++ b/lua/plugins/.bak/old.lua.bak @@ -0,0 +1,104 @@ +-- Plugins +return { + + + + -- Telescope + { + 'nvim-telescope/telescope.nvim', tag = '0.1.8', + -- or , branch = '0.1.x', + dependencies = { 'nvim-lua/plenary.nvim' } + }, + + -- LSP + + + -- LaTeX + { + "lervag/vimtex", + ft = "tex", + init = function() + -- Use Zathura as the PDF viewer + vim.g.vimtex_view_method = "zathura" + + -- Compile using latexmk automatically + vim.g.vimtex_compiler_method = "latexmk" + vim.g.vimtex_compiler_latexmk = { + build_dir = "build", -- optional: keep files in a separate folder + callback = 1, + continuous = 1, -- automatically recompile on save + executable = "latexmk", + options = { + "-pdf", + "-interaction=nonstopmode", + "-synctex=1", + }, + } + + -- Optional: disable conceal for clearer LaTeX text + vim.g.vimtex_syntax_conceal = { + accents = 0, + ligatures = 0, + cites = 0, + fancy = 0, + spacing = 0, + greek = 0, + math_delimiters = 0, + math_super_sub = 0, + } + end, + }, + + -- LSP support + { + "neovim/nvim-lspconfig", + config = function() + require("lspconfig").texlab.setup({}) + end, + }, + + -- Autocompletion (optional) + { "hrsh7th/nvim-cmp" }, + { "hrsh7th/cmp-nvim-lsp" }, + + -- Snippets (optional) + { "L3MON4D3/LuaSnip" }, + + -- Grammar & spell checking + { "rhysd/vim-grammarous", ft = "tex" }, + + + -- Tab Bar + {'romgrk/barbar.nvim', + dependencies = { + 'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status + 'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons + }, + init = function() vim.g.barbar_auto_setup = false end, + opts = { + -- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default: + -- animation = true, + -- insert_at_start = true, + -- …etc. + }, + version = '^1.0.0', -- optional: only update when a new 1.x version is released + }, + + -- Dashboard + { + 'nvimdev/dashboard-nvim', + event = 'VimEnter', + config = function() + require('dashboard').setup { + -- config + } + end, + dependencies = { {'nvim-tree/nvim-web-devicons'}} + }, + + -- THEMES + "martinsione/darkplus.nvim", + "folke/tokyonight.nvim", + "navarasu/onedark.nvim" + +} diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua new file mode 100644 index 0000000..0f8fad0 --- /dev/null +++ b/lua/plugins/init.lua @@ -0,0 +1,65 @@ +-- ~/.config/nvim/lua/plugins/init.lua +return { + -- LSP + { + "neovim/nvim-lspconfig", + config = function() + require("config.lsp")() -- note the () if your lsp.lua returns a function + end, + }, + + + -- File Explorer + { "nvim-tree/nvim-tree.lua", config = require("config.tree") }, + + -- Icons + { "nvim-tree/nvim-web-devicons" }, + + -- Color Picker + { "uga-rosa/ccc.nvim", config = require("config.colorpicker") }, + + -- Status Line + { "nvim-lualine/lualine.nvim", config = require("config.statusline"), opts = {} }, + + -- Smooth Scrolling + { "karb94/neoscroll.nvim", opts = {} }, + + -- Telescope + { "nvim-telescope/telescope.nvim", tag = "0.1.8", dependencies = { "nvim-lua/plenary.nvim" }, config = require("config.telescope") }, + + -- Plenary + { "nvim-lua/plenary.nvim" }, + + -- LaTeX + { "lervag/vimtex", ft = "tex", config = require("config.vimtex") }, + + -- Autocompletion + { "hrsh7th/nvim-cmp" }, + { "hrsh7th/cmp-nvim-lsp" }, + + -- Snippets + { "L3MON4D3/LuaSnip" }, + + -- Grammar & Spell Checking + { "rhysd/vim-grammarous", ft = "tex" }, + + -- Tab Bar + { + "romgrk/barbar.nvim", + dependencies = { + "lewis6991/gitsigns.nvim", -- optional: for git status + "nvim-tree/nvim-web-devicons", -- optional: for file icons + }, + version = "^1.0.0", + config = require("config.tabs"), + }, + + -- Dashboard + { "nvimdev/dashboard-nvim", event = "VimEnter", dependencies = { "nvim-tree/nvim-web-devicons" }, config = require("config.dashboard") }, + + -- Themes + "martinsione/darkplus.nvim", + "folke/tokyonight.nvim", + "navarasu/onedark.nvim" +} + diff --git a/lua/plugins/test.c b/lua/plugins/test.c new file mode 100644 index 0000000..57028aa --- /dev/null +++ b/lua/plugins/test.c @@ -0,0 +1,12 @@ +#include <stdio.h> + +int main() +{ + int x = 5; + printf("Hello World!\n"); + + while(1){ + printf("Hello World!\n"); + } + +} |
