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 /lua/config | |
Initial Commit
Diffstat (limited to 'lua/config')
| -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 |
15 files changed, 793 insertions, 0 deletions
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 = '๏ฌ'}, + -- [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 |
