From 3df44ee18a6c1b36278cbde8499f357e0a040411 Mon Sep 17 00:00:00 2001 From: triethyl Date: Sun, 6 Jul 2025 18:52:39 -0400 Subject: setting up lua config Former-commit-id: 6623b85be12ce3bf9411c35f50e4bc1f20dea186 --- pkgs/custom-neovim/config/lua/autocommands.lua | 0 pkgs/custom-neovim/config/lua/mappings.lua | 0 pkgs/custom-neovim/config/lua/options.lua | 0 pkgs/custom-neovim/config/lua/utilities.lua | 0 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 pkgs/custom-neovim/config/lua/autocommands.lua create mode 100644 pkgs/custom-neovim/config/lua/mappings.lua create mode 100644 pkgs/custom-neovim/config/lua/options.lua create mode 100644 pkgs/custom-neovim/config/lua/utilities.lua (limited to 'pkgs/custom-neovim/config/lua') diff --git a/pkgs/custom-neovim/config/lua/autocommands.lua b/pkgs/custom-neovim/config/lua/autocommands.lua new file mode 100644 index 0000000..e69de29 diff --git a/pkgs/custom-neovim/config/lua/mappings.lua b/pkgs/custom-neovim/config/lua/mappings.lua new file mode 100644 index 0000000..e69de29 diff --git a/pkgs/custom-neovim/config/lua/options.lua b/pkgs/custom-neovim/config/lua/options.lua new file mode 100644 index 0000000..e69de29 diff --git a/pkgs/custom-neovim/config/lua/utilities.lua b/pkgs/custom-neovim/config/lua/utilities.lua new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3 From 546752feb6576be92fe421be1998217aa7d657ff Mon Sep 17 00:00:00 2001 From: triethyl Date: Sun, 6 Jul 2025 22:21:45 -0400 Subject: working on nvim setup Former-commit-id: a43ab0499838d262445d8af9cb954a84e259bb35 --- pkgs/custom-neovim/config/lua/autocommands.lua | 36 +++++++++ pkgs/custom-neovim/config/lua/mappings.lua | 31 ++++++++ pkgs/custom-neovim/config/lua/options.lua | 67 ++++++++++++++++ .../custom-neovim/config/lua/plugins/lspconfig.lua | 91 ++++++++++++++++++++++ pkgs/custom-neovim/config/lua/plugins/lualine.lua | 1 + pkgs/custom-neovim/config/lua/plugins/presence.lua | 3 + pkgs/custom-neovim/config/lua/plugins/tabby.lua | 2 + .../custom-neovim/config/lua/plugins/telescope.lua | 1 + pkgs/custom-neovim/config/lua/utilities.lua | 5 ++ 9 files changed, 237 insertions(+) create mode 100644 pkgs/custom-neovim/config/lua/plugins/lspconfig.lua create mode 100644 pkgs/custom-neovim/config/lua/plugins/lualine.lua create mode 100644 pkgs/custom-neovim/config/lua/plugins/presence.lua create mode 100644 pkgs/custom-neovim/config/lua/plugins/tabby.lua create mode 100644 pkgs/custom-neovim/config/lua/plugins/telescope.lua (limited to 'pkgs/custom-neovim/config/lua') diff --git a/pkgs/custom-neovim/config/lua/autocommands.lua b/pkgs/custom-neovim/config/lua/autocommands.lua index e69de29..85a58c6 100644 --- a/pkgs/custom-neovim/config/lua/autocommands.lua +++ b/pkgs/custom-neovim/config/lua/autocommands.lua @@ -0,0 +1,36 @@ +-- Autocommands + +-- Use relative line number in normal mode and absolute in insert mode +vim.opt.number = true +local numbertoggle = vim.api.nvim_create_augroup("numbertoggle", {}) +vim.api.nvim_create_autocmd( + { "BufEnter", "FocusGained", "InsertLeave", "WinEnter", "CmdlineLeave" }, + { + group = numbertoggle, + callback = function() + if vim.opt.number and vim.api.nvim_get_mode() ~= "i" then + vim.opt.relativenumber = true + end + end, + } +) + +vim.api.nvim_create_autocmd( + { "BufLeave", "FocusLost", "InsertEnter", "WinLeave", "CmdlineEnter" }, + { + group = numbertoggle, + callback = function() + if vim.opt.number then + vim.opt.relativenumber = false + vim.cmd("redraw") + end + end, + } +) + + -- start terminal in insert mode +vim.api.nvim_create_autocmd("TermOpen", { + callback = function() + vim.cmd "startinsert!" + end, +}) diff --git a/pkgs/custom-neovim/config/lua/mappings.lua b/pkgs/custom-neovim/config/lua/mappings.lua index e69de29..efb1e85 100644 --- a/pkgs/custom-neovim/config/lua/mappings.lua +++ b/pkgs/custom-neovim/config/lua/mappings.lua @@ -0,0 +1,31 @@ +-- Keymap function. +local keymap = function(mode, key, desc, action) + vim.keymap.set(mode, key, action, {noremap = true, silent = true, desc = desc}) +end + +local mapkey = utils.mapkey + +-- Map the leader key. +vim.g.mapleader = ' ' + +vim.keymap.set("n", "", "gcc", {noremap = true, silent = true}) + +-- Pickers +keymap("n", "f", "Open file picker", ":Pick files") +keymap("n", "c", "Open recent file picker", ":Pick oldfiles") +keymap("n", "e", "Open file explorer", ":Pick explorer") +keymap("n", "b", "Open buffer picker", ":Pick buffers") +keymap("n", "/", "Open live grep picker", ":Pick grep_live") +keymap("n", "\\", "Open command palette", ":Pick commands") +keymap("n", "?", "Open help picker", ":Pick help") +keymap("n", "'", "Open last picker", ":Pick resume") + +-- Tabs +keymap("n", "t", "Manage tabs", "") +keymap("n", "tt", "Open new tab", ":tabnew") +keymap("n", "tq", "Close tab", ":tabclose") +keymap("n", "tn", "Go to next tab", ":tabnext") +keymap("n", "tp", "Go to previous tab", ":tabprev") + +-- QOL Keys +keymap("t", "", "Exit terminal insert mode", "") diff --git a/pkgs/custom-neovim/config/lua/options.lua b/pkgs/custom-neovim/config/lua/options.lua index e69de29..ae6fb0a 100644 --- a/pkgs/custom-neovim/config/lua/options.lua +++ b/pkgs/custom-neovim/config/lua/options.lua @@ -0,0 +1,67 @@ +-- General Settings +vim.o.winborder = 'rounded' +vim.o.showmode = false +vim.o.icm = 'split' +vim.o.cia = 'abbr,kind,menu' +vim.o.mouse = "" +vim.o.number = true -- set numbered lines +vim.o.scrolloff = 4 -- minimal number of screen lines to keep above and below the cursor +vim.o.signcolumn = "yes" -- always show the sign column, otherwise it would shift the text each time +vim.o.clipboard = "unnamedplus" -- use system clipboard +vim.o.sessionoptions = 'curdir,folds,globals,help,tabpages,terminal,winsize' -- Things to save with the session. +vim.keymap.set("c", "", function() + if vim.fn.pumvisible() == 1 then return '' end + return '' +end, { expr = true }) -- Make enter complete command. + +-- Indention +local indent = 2 +vim.o.autoindent = true -- auto indentation +vim.o.expandtab = true -- convert tabs to spaces +vim.o.shiftwidth = indent -- the number of spaces inserted for each indentation +vim.o.smartindent = true -- make indenting smarter +vim.o.softtabstop = indent -- when hitting , pretend like a tab is removed, even if spaces +vim.o.tabstop = indent -- insert 2 spaces for a tab +vim.o.shiftround = true -- use multiple of shiftwidth when indenting with "<" and ">" + +-- Backups +vim.o.backup = false -- create a backup file +vim.o.swapfile = false -- creates a swapfile +vim.o.writebackup = false -- if a file is being edited by another program, it is not allowed to be edited + +-- Search +vim.o.hlsearch = true -- highlight all matches on previous search pattern +vim.o.ignorecase = true -- ignore case in search patterns +vim.o.smartcase = true -- smart case + +-- Folding +vim.o.foldmethod = "expr" +vim.o.foldexpr = "v:lua.vim.treesitter.foldexpr()" -- Set folder to treesitter. +vim.o.foldlevel = 99 -- Don't fold initially. +vim.o.foldnestmax = 4 -- Don't fold if more than 4 folds deep. +vim.o.foldtext = "" -- Color text in folds. + +-- Set Colorscheme +vim.cmd.colorscheme("oxocarbon") +vim.o.termguicolors = true + +-- Neovide +if vim.g.neovide then + vim.o.guifont = "CodeNewRoman Nerd Font:h12" + vim.g.neovide_scale_factor = 0.8 + + -- Zoom keymaps. + local change_scale_factor = function(delta) + vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * delta + end + vim.keymap.set("n", "", function() + change_scale_factor(1.1) + end) + vim.keymap.set("n", "", function() + change_scale_factor(1/1.1) + end) + + -- Standard terminal emulator keymaps. + vim.api.nvim_set_keymap("c", "", "+", { noremap = true }) -- Paste in command mode. + vim.api.nvim_set_keymap('t', '', '"+Pi', {noremap = true}) -- Paste in terminal mode. +end diff --git a/pkgs/custom-neovim/config/lua/plugins/lspconfig.lua b/pkgs/custom-neovim/config/lua/plugins/lspconfig.lua new file mode 100644 index 0000000..98b34f2 --- /dev/null +++ b/pkgs/custom-neovim/config/lua/plugins/lspconfig.lua @@ -0,0 +1,91 @@ +-- vim.keymap.set('n', 'd', vim.diagnostic.setloclist, {desc = "Add buffer diagnostics to the location list."}) + +-- Disable semantic tokens to stop weird highlighting. +vim.api.nvim_create_autocmd('LspAttach', { + callback = function(ev) + local client = vim.lsp.get_client_by_id(ev.data.client_id) + if client then + client.server_capabilities.semanticTokensProvider = nil + end + end +}) + +-- Use LspAttach autocommand to only map the following keys +-- after the language server attaches to the current buffer +vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('UserLspConfig', {}), + callback = function(ev) + -- Enable completion triggered by + vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' + + -- Buffer local mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + + local keymap = function(mode, key, desc, action) + vim.keymap.set(mode, key, action, {noremap = true, silent = true, desc = desc}) + end + + keymap('n', 'gD', "Go to declaration", vim.lsp.buf.declaration) + keymap('n', 'gd', "Go to definition", vim.lsp.buf.definition) + keymap('n', 'gy', "Go to type definition", vim.lsp.buf.type_definition) + keymap('n', 'gi', "Go to implementation", vim.lsp.buf.implementation) + keymap('n', '', "Signature Help", vim.lsp.buf.signature_help) + keymap('i', '', "Signature Help", vim.lsp.buf.signature_help) + keymap('n', "o", "Manage LSP workspace", "") + keymap('n', 'oa', "Add Workspace Folder", vim.lsp.buf.add_workspace_folder) + keymap('n', 'or', "Remove Workspace Folder", vim.lsp.buf.remove_workspace_folder) + keymap('n', 'ol', "List Workspace Folders", function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end) + keymap('n', 'r', "Rename Symbol", vim.lsp.buf.rename) + keymap("n", "s", "Open symbol picker", [[:Pick lsp scope="document_symbol"]]) + keymap("n", "S", "Open workspace symbol picker", [[:Pick lsp scope="workspace_symbol"]]) + + -- LSP Pickers + keymap({'n', 'v'}, "a", "Perform code action", require("actions-preview").code_actions) + keymap("n", "D", "Open workspace diagnostic picker", ":Pick diagnostic") + keymap("n", "d", "Open diagnostic picker", [[:Pick diagnostic scope="current"]]) + + keymap('n', 'gr', "Buffer References", vim.lsp.buf.references) + keymap('n', 'f', "Format Buffer", function() + vim.lsp.buf.format { async = true } + end) + end, +}) + +local lspconfig = require('lspconfig') + +-- Configure individual lsps +lspconfig.nil_ls.setup {} +lspconfig.lua_ls.setup { + on_init = function(client) + local path = client.workspace_folders[1].name + if vim.loop.fs_stat(path..'/.luarc.json') or vim.loop.fs_stat(path..'/.luarc.jsonc') then + return + end + + client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { + runtime = { + -- Tell the language server which version of Lua you're using + -- (most likely LuaJIT in the case of Neovim) + version = 'LuaJIT' + }, + -- Make the server aware of Neovim runtime files + workspace = { + checkThirdParty = false, + library = { + vim.env.VIMRUNTIME, + -- Depending on the usage, you might want to add additional paths here. + "${3rd}/luv/library" + -- "${3rd}/busted/library", + } + -- or pull in all of 'runtimepath'. NOTE: this is a lot slower + -- library = vim.api.nvim_get_runtime_file("", true) + } + }) + end, + settings = { + Lua = {} + } +} +lspconfig.marksman.setup {} diff --git a/pkgs/custom-neovim/config/lua/plugins/lualine.lua b/pkgs/custom-neovim/config/lua/plugins/lualine.lua new file mode 100644 index 0000000..9814cae --- /dev/null +++ b/pkgs/custom-neovim/config/lua/plugins/lualine.lua @@ -0,0 +1 @@ +require("lualine").setup() diff --git a/pkgs/custom-neovim/config/lua/plugins/presence.lua b/pkgs/custom-neovim/config/lua/plugins/presence.lua new file mode 100644 index 0000000..7ffb57f --- /dev/null +++ b/pkgs/custom-neovim/config/lua/plugins/presence.lua @@ -0,0 +1,3 @@ +require('presence').setup({ + neovim_image_text = "Neovim Text Editor", +}) diff --git a/pkgs/custom-neovim/config/lua/plugins/tabby.lua b/pkgs/custom-neovim/config/lua/plugins/tabby.lua new file mode 100644 index 0000000..2ad03ed --- /dev/null +++ b/pkgs/custom-neovim/config/lua/plugins/tabby.lua @@ -0,0 +1,2 @@ +vim.o.showtabline = 1 +require('tabby').setup() diff --git a/pkgs/custom-neovim/config/lua/plugins/telescope.lua b/pkgs/custom-neovim/config/lua/plugins/telescope.lua new file mode 100644 index 0000000..be3366b --- /dev/null +++ b/pkgs/custom-neovim/config/lua/plugins/telescope.lua @@ -0,0 +1 @@ +require("telescope").setup() diff --git a/pkgs/custom-neovim/config/lua/utilities.lua b/pkgs/custom-neovim/config/lua/utilities.lua index e69de29..fe86dd6 100644 --- a/pkgs/custom-neovim/config/lua/utilities.lua +++ b/pkgs/custom-neovim/config/lua/utilities.lua @@ -0,0 +1,5 @@ +utils = {} + +utils.mapkey = function(mode, key, desc, action) + vim.keymap.set(mode, key, action, {noremap = true, silent = true, desc = desc}) +end -- cgit v1.2.3 From be6c16189410b280dd9f94cc2821ffcbd721dbc2 Mon Sep 17 00:00:00 2001 From: triethyl Date: Mon, 7 Jul 2025 11:43:06 -0400 Subject: working on neovim Former-commit-id: 025d1930a0ae07909efe826cc902424ff57d5ce9 --- pkgs/custom-neovim/config/lua/mappings.lua | 38 +++++---- pkgs/custom-neovim/config/lua/neovide.lua | 46 +++++++++++ pkgs/custom-neovim/config/lua/options.lua | 26 +----- pkgs/custom-neovim/config/lua/plugins/lualine.lua | 99 ++++++++++++++++++++++- 4 files changed, 163 insertions(+), 46 deletions(-) create mode 100644 pkgs/custom-neovim/config/lua/neovide.lua (limited to 'pkgs/custom-neovim/config/lua') diff --git a/pkgs/custom-neovim/config/lua/mappings.lua b/pkgs/custom-neovim/config/lua/mappings.lua index efb1e85..1ffbadb 100644 --- a/pkgs/custom-neovim/config/lua/mappings.lua +++ b/pkgs/custom-neovim/config/lua/mappings.lua @@ -1,31 +1,29 @@ -- Keymap function. -local keymap = function(mode, key, desc, action) - vim.keymap.set(mode, key, action, {noremap = true, silent = true, desc = desc}) -end - local mapkey = utils.mapkey -- Map the leader key. vim.g.mapleader = ' ' -vim.keymap.set("n", "", "gcc", {noremap = true, silent = true}) - -- Pickers -keymap("n", "f", "Open file picker", ":Pick files") -keymap("n", "c", "Open recent file picker", ":Pick oldfiles") -keymap("n", "e", "Open file explorer", ":Pick explorer") -keymap("n", "b", "Open buffer picker", ":Pick buffers") -keymap("n", "/", "Open live grep picker", ":Pick grep_live") -keymap("n", "\\", "Open command palette", ":Pick commands") -keymap("n", "?", "Open help picker", ":Pick help") -keymap("n", "'", "Open last picker", ":Pick resume") +mapkey("n", "f", "Open file picker", ":Telescope find_files") +mapkey("n", "c", "Open recent file picker", ":Telescope oldfiles") +-- mapkey("n", "e", "Open file explorer", ":Pick explorer") +mapkey("n", "b", "Open buffer picker", ":Telescope buffers") +mapkey("n", "/", "Open live grep picker", ":Telescope live_grep") +mapkey("n", "\\", "Open command palette", ":Telescope commands") +mapkey("n", "?", "Open help picker", ":Telescope help") +mapkey("n", "'", "Open last picker", ":Telescope resume") -- Tabs -keymap("n", "t", "Manage tabs", "") -keymap("n", "tt", "Open new tab", ":tabnew") -keymap("n", "tq", "Close tab", ":tabclose") -keymap("n", "tn", "Go to next tab", ":tabnext") -keymap("n", "tp", "Go to previous tab", ":tabprev") +mapkey("n", "t", "Manage tabs", "") +mapkey("n", "tt", "Open new tab", ":tabnew") +mapkey("n", "tq", "Close tab", ":tabclose") +mapkey("n", "tn", "Go to next tab", ":tabnext") +mapkey("n", "tp", "Go to previous tab", ":tabprev") -- QOL Keys -keymap("t", "", "Exit terminal insert mode", "") +mapkey("t", "", "Exit terminal insert mode", "") +vim.keymap.set("c", "", function() + if vim.fn.pumvisible() == 1 then return '' end + return '' +end, { expr = true }) -- Make enter complete command. diff --git a/pkgs/custom-neovim/config/lua/neovide.lua b/pkgs/custom-neovim/config/lua/neovide.lua new file mode 100644 index 0000000..0476765 --- /dev/null +++ b/pkgs/custom-neovim/config/lua/neovide.lua @@ -0,0 +1,46 @@ +if vim.g.neovide then + vim.o.guifont = "CodeNewRoman Nerd Font:h12" + vim.g.neovide_scale_factor = 0.8 + + -- Zoom keymaps. + local change_scale_factor = function(delta) + vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * delta + end + vim.keymap.set("n", "", function() + change_scale_factor(1.1) + end) + vim.keymap.set("n", "", function() + change_scale_factor(1/1.1) + end) + + -- Standard terminal emulator keymaps. + vim.api.nvim_set_keymap("c", "", "+", { noremap = true }) -- Paste in command mode. + vim.api.nvim_set_keymap('t', '', '"+Pi', {noremap = true}) -- Paste in terminal mode. + + + local positionAnimationLength = 0.2 + local scrollAnimationFarLines = 0.1 + local scrollAnimationLength = 0.1 + vim.g.neovide_position_animation_length = positionAnimationLength + vim.g.neovide_scroll_animation_far_lines = scrollAnimationFarLines + vim.g.neovide_scroll_animation_length = scrollAnimationLength + + -- Don't smooth scroll in terminals. + vim.api.nvim_create_autocmd("BufEnter", { + pattern = "*", + callback = function(args) + local filetype = vim.api.nvim_buf_get_option(args.buf, "filetype") + + -- When entering terminal for first time I noticed the filetype is empty + if filetype == '' or filetype == 'terminal' then + vim.g.neovide_position_animation_length = 0 + vim.g.neovide_scroll_animation_far_lines = 0 + vim.g.neovide_scroll_animation_length = 0 + else + vim.g.neovide_position_animation_length = positionAnimationLength + vim.g.neovide_scroll_animation_far_lines = scrollAnimationFarLines + vim.g.neovide_scroll_animation_length = scrollAnimationLength + end + end, + }) +end diff --git a/pkgs/custom-neovim/config/lua/options.lua b/pkgs/custom-neovim/config/lua/options.lua index ae6fb0a..a51e319 100644 --- a/pkgs/custom-neovim/config/lua/options.lua +++ b/pkgs/custom-neovim/config/lua/options.lua @@ -1,5 +1,6 @@ -- General Settings vim.o.winborder = 'rounded' +vim.o.showtabline = 1 vim.o.showmode = false vim.o.icm = 'split' vim.o.cia = 'abbr,kind,menu' @@ -9,10 +10,6 @@ vim.o.scrolloff = 4 -- minimal number of screen lines to keep above and below th vim.o.signcolumn = "yes" -- always show the sign column, otherwise it would shift the text each time vim.o.clipboard = "unnamedplus" -- use system clipboard vim.o.sessionoptions = 'curdir,folds,globals,help,tabpages,terminal,winsize' -- Things to save with the session. -vim.keymap.set("c", "", function() - if vim.fn.pumvisible() == 1 then return '' end - return '' -end, { expr = true }) -- Make enter complete command. -- Indention local indent = 2 @@ -44,24 +41,3 @@ vim.o.foldtext = "" -- Color text in folds. -- Set Colorscheme vim.cmd.colorscheme("oxocarbon") vim.o.termguicolors = true - --- Neovide -if vim.g.neovide then - vim.o.guifont = "CodeNewRoman Nerd Font:h12" - vim.g.neovide_scale_factor = 0.8 - - -- Zoom keymaps. - local change_scale_factor = function(delta) - vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * delta - end - vim.keymap.set("n", "", function() - change_scale_factor(1.1) - end) - vim.keymap.set("n", "", function() - change_scale_factor(1/1.1) - end) - - -- Standard terminal emulator keymaps. - vim.api.nvim_set_keymap("c", "", "+", { noremap = true }) -- Paste in command mode. - vim.api.nvim_set_keymap('t', '', '"+Pi', {noremap = true}) -- Paste in terminal mode. -end diff --git a/pkgs/custom-neovim/config/lua/plugins/lualine.lua b/pkgs/custom-neovim/config/lua/plugins/lualine.lua index 9814cae..409c452 100644 --- a/pkgs/custom-neovim/config/lua/plugins/lualine.lua +++ b/pkgs/custom-neovim/config/lua/plugins/lualine.lua @@ -1 +1,98 @@ -require("lualine").setup() +local auto_theme = require("lualine.themes.auto") + +local colors = { + modes = { + normal = auto_theme.normal.a.bg, + insert = auto_theme.insert.a.bg, + visual = auto_theme.visual.a.bg, + replace = auto_theme.replace.a.bg, + command = auto_theme.command.a.bg, + inactive = auto_theme.inactive.a.bg, + }, + text = { + dark = auto_theme.normal.a.fg, + light = auto_theme.normal.c.fg, + }, + backdrop = auto_theme.normal.c.bg, +} + +local custom_auto_theme = { + normal = { + a = {bg = colors.modes.normal, fg = colors.text.dark, gui = 'bold'}, + b = {bg = colors.backdrop, fg = colors.text.light}, + c = {bg = colors.backdrop, fg = colors.text.light}, + x = {bg = colors.backdrop, fg = colors.text.light}, + y = {bg = colors.backdrop, fg = colors.text.light}, + z = {bg = colors.modes.normal, fg = colors.text.dark, gui = 'bold'}, + }, + insert = { + a = {bg = colors.modes.insert, fg = colors.text.dark, gui = 'bold'}, + b = {bg = colors.backdrop, fg = colors.text.light}, + c = {bg = colors.backdrop, fg = colors.text.light}, + x = {bg = colors.backdrop, fg = colors.text.light}, + y = {bg = colors.backdrop, fg = colors.text.light}, + z = {bg = colors.modes.insert, fg = colors.text.dark, gui = 'bold'}, + }, + visual = { + a = {bg = colors.modes.visual, fg = colors.text.dark, gui = 'bold'}, + b = {bg = colors.backdrop, fg = colors.text.light}, + c = {bg = colors.backdrop, fg = colors.text.light}, + x = {bg = colors.backdrop, fg = colors.text.light}, + y = {bg = colors.backdrop, fg = colors.text.light}, + z = {bg = colors.modes.visual, fg = colors.text.dark, gui = 'bold'}, + }, + replace = { + a = {bg = colors.modes.replace, fg = colors.text.dark, gui = 'bold'}, + b = {bg = colors.backdrop, fg = colors.text.light}, + c = {bg = colors.backdrop, fg = colors.text.light}, + x = {bg = colors.backdrop, fg = colors.text.light}, + y = {bg = colors.backdrop, fg = colors.text.light}, + z = {bg = colors.modes.replace, fg = colors.text.dark, gui = 'bold'}, + }, + command = { + a = {bg = colors.modes.command, fg = colors.text.dark, gui = 'bold'}, + b = {bg = colors.backdrop, fg = colors.text.light}, + c = {bg = colors.backdrop, fg = colors.text.light}, + x = {bg = colors.backdrop, fg = colors.text.light}, + y = {bg = colors.backdrop, fg = colors.text.light}, + z = {bg = colors.modes.command, fg = colors.text.dark, gui = 'bold'}, + }, + inactive = { + a = {bg = colors.modes.inactive, fg = colors.text.dark, gui = 'bold'}, + b = {bg = colors.backdrop, fg = colors.text.light}, + c = {bg = colors.backdrop, fg = colors.text.light}, + x = {bg = colors.backdrop, fg = colors.text.light}, + y = {bg = colors.backdrop, fg = colors.text.light}, + z = {bg = colors.modes.inactive, fg = colors.text.dark, gui = 'bold'}, + }, +}; + +require('lualine').setup { + options = { + theme = custom_auto_theme, + component_separators = "", + section_separators = { left = '', right = '' }, + }, + sections = { + lualine_a = { { 'mode', separator = { left = '', rignt = '' }, right_padding = 2 } }, + lualine_b = { 'filename', 'branch' }, + lualine_c = { + '%=', --[[ add your center components here in place of this comment ]] + }, + lualine_x = {}, + lualine_y = { 'filetype', 'progress' }, + lualine_z = { + { 'location', separator = { left = '', right = '' }, left_padding = 2 }, + }, + }, + inactive_sections = { + lualine_a = { 'filename' }, + lualine_b = {}, + lualine_c = {}, + lualine_x = {}, + lualine_y = {}, + lualine_z = { 'location' }, + }, + tabline = {}, + extensions = {}, +} -- cgit v1.2.3 From a544c622d31187f245b34b9b8b17cbb63a941480 Mon Sep 17 00:00:00 2001 From: triethyl Date: Tue, 8 Jul 2025 15:44:17 -0400 Subject: configured lualine and tabby Former-commit-id: 947770af8ae586dfc89c0d498a766c7aaa802dd2 --- pkgs/custom-neovim/config/lua/options.lua | 6 +- pkgs/custom-neovim/config/lua/plugins/lualine.lua | 154 ++++++++++------------ pkgs/custom-neovim/config/lua/plugins/tabby.lua | 56 +++++++- pkgs/custom-neovim/config/lua/utilities.lua | 20 +++ 4 files changed, 150 insertions(+), 86 deletions(-) (limited to 'pkgs/custom-neovim/config/lua') diff --git a/pkgs/custom-neovim/config/lua/options.lua b/pkgs/custom-neovim/config/lua/options.lua index a51e319..14ee7d1 100644 --- a/pkgs/custom-neovim/config/lua/options.lua +++ b/pkgs/custom-neovim/config/lua/options.lua @@ -1,7 +1,9 @@ -- General Settings vim.o.winborder = 'rounded' -vim.o.showtabline = 1 -vim.o.showmode = false +vim.o.showtabline = 2 -- whether to only show tabline if there is more than one tab. +vim.o.laststatus = 3 -- only have one statusline at the bottom of the window. +vim.o.showmode = false -- don't show the mode in the commandline. +vim.o.ruler = false -- don't show #,# in the commandline. vim.o.icm = 'split' vim.o.cia = 'abbr,kind,menu' vim.o.mouse = "" diff --git a/pkgs/custom-neovim/config/lua/plugins/lualine.lua b/pkgs/custom-neovim/config/lua/plugins/lualine.lua index 409c452..b38d3ed 100644 --- a/pkgs/custom-neovim/config/lua/plugins/lualine.lua +++ b/pkgs/custom-neovim/config/lua/plugins/lualine.lua @@ -1,98 +1,88 @@ -local auto_theme = require("lualine.themes.auto") - -local colors = { - modes = { - normal = auto_theme.normal.a.bg, - insert = auto_theme.insert.a.bg, - visual = auto_theme.visual.a.bg, - replace = auto_theme.replace.a.bg, - command = auto_theme.command.a.bg, - inactive = auto_theme.inactive.a.bg, - }, - text = { - dark = auto_theme.normal.a.fg, - light = auto_theme.normal.c.fg, - }, - backdrop = auto_theme.normal.c.bg, -} - -local custom_auto_theme = { - normal = { - a = {bg = colors.modes.normal, fg = colors.text.dark, gui = 'bold'}, - b = {bg = colors.backdrop, fg = colors.text.light}, - c = {bg = colors.backdrop, fg = colors.text.light}, - x = {bg = colors.backdrop, fg = colors.text.light}, - y = {bg = colors.backdrop, fg = colors.text.light}, - z = {bg = colors.modes.normal, fg = colors.text.dark, gui = 'bold'}, - }, - insert = { - a = {bg = colors.modes.insert, fg = colors.text.dark, gui = 'bold'}, - b = {bg = colors.backdrop, fg = colors.text.light}, - c = {bg = colors.backdrop, fg = colors.text.light}, - x = {bg = colors.backdrop, fg = colors.text.light}, - y = {bg = colors.backdrop, fg = colors.text.light}, - z = {bg = colors.modes.insert, fg = colors.text.dark, gui = 'bold'}, - }, - visual = { - a = {bg = colors.modes.visual, fg = colors.text.dark, gui = 'bold'}, - b = {bg = colors.backdrop, fg = colors.text.light}, - c = {bg = colors.backdrop, fg = colors.text.light}, - x = {bg = colors.backdrop, fg = colors.text.light}, - y = {bg = colors.backdrop, fg = colors.text.light}, - z = {bg = colors.modes.visual, fg = colors.text.dark, gui = 'bold'}, - }, - replace = { - a = {bg = colors.modes.replace, fg = colors.text.dark, gui = 'bold'}, - b = {bg = colors.backdrop, fg = colors.text.light}, - c = {bg = colors.backdrop, fg = colors.text.light}, - x = {bg = colors.backdrop, fg = colors.text.light}, - y = {bg = colors.backdrop, fg = colors.text.light}, - z = {bg = colors.modes.replace, fg = colors.text.dark, gui = 'bold'}, - }, - command = { - a = {bg = colors.modes.command, fg = colors.text.dark, gui = 'bold'}, - b = {bg = colors.backdrop, fg = colors.text.light}, - c = {bg = colors.backdrop, fg = colors.text.light}, - x = {bg = colors.backdrop, fg = colors.text.light}, - y = {bg = colors.backdrop, fg = colors.text.light}, - z = {bg = colors.modes.command, fg = colors.text.dark, gui = 'bold'}, - }, - inactive = { - a = {bg = colors.modes.inactive, fg = colors.text.dark, gui = 'bold'}, - b = {bg = colors.backdrop, fg = colors.text.light}, - c = {bg = colors.backdrop, fg = colors.text.light}, - x = {bg = colors.backdrop, fg = colors.text.light}, - y = {bg = colors.backdrop, fg = colors.text.light}, - z = {bg = colors.modes.inactive, fg = colors.text.dark, gui = 'bold'}, - }, -}; +local generate_lualine_theme = function() + local colors = utils.generate_theme_from_lualine() + return { + normal = { + a = {bg = colors.modes.normal, fg = colors.text.dark, gui = 'bold'}, + b = {bg = colors.background, fg = colors.text.light}, + c = {bg = colors.background, fg = colors.text.light}, + x = {bg = colors.background, fg = colors.text.light}, + y = {bg = colors.background, fg = colors.text.light}, + z = {bg = colors.modes.normal, fg = colors.text.dark, gui = 'bold'}, + }, + insert = { + a = {bg = colors.modes.insert, fg = colors.text.dark, gui = 'bold'}, + b = {bg = colors.background, fg = colors.text.light}, + c = {bg = colors.background, fg = colors.text.light}, + x = {bg = colors.background, fg = colors.text.light}, + y = {bg = colors.background, fg = colors.text.light}, + z = {bg = colors.modes.insert, fg = colors.text.dark, gui = 'bold'}, + }, + visual = { + a = {bg = colors.modes.visual, fg = colors.text.dark, gui = 'bold'}, + b = {bg = colors.background, fg = colors.text.light}, + c = {bg = colors.background, fg = colors.text.light}, + x = {bg = colors.background, fg = colors.text.light}, + y = {bg = colors.background, fg = colors.text.light}, + z = {bg = colors.modes.visual, fg = colors.text.dark, gui = 'bold'}, + }, + replace = { + a = {bg = colors.modes.replace, fg = colors.text.dark, gui = 'bold'}, + b = {bg = colors.background, fg = colors.text.light}, + c = {bg = colors.background, fg = colors.text.light}, + x = {bg = colors.background, fg = colors.text.light}, + y = {bg = colors.background, fg = colors.text.light}, + z = {bg = colors.modes.replace, fg = colors.text.dark, gui = 'bold'}, + }, + command = { + a = {bg = colors.modes.command, fg = colors.text.dark, gui = 'bold'}, + b = {bg = colors.background, fg = colors.text.light}, + c = {bg = colors.background, fg = colors.text.light}, + x = {bg = colors.background, fg = colors.text.light}, + y = {bg = colors.background, fg = colors.text.light}, + z = {bg = colors.modes.command, fg = colors.text.dark, gui = 'bold'}, + }, + inactive = { + a = {bg = colors.modes.inactive, fg = colors.text.dark, gui = 'bold'}, + b = {bg = colors.background, fg = colors.text.light}, + c = {bg = colors.background, fg = colors.text.light}, + x = {bg = colors.background, fg = colors.text.light}, + y = {bg = colors.background, fg = colors.text.light}, + z = {bg = colors.modes.inactive, fg = colors.text.dark, gui = 'bold'}, + }, + }; +end require('lualine').setup { options = { - theme = custom_auto_theme, + theme = generate_lualine_theme(), component_separators = "", - section_separators = { left = '', right = '' }, + section_separators = { left = '', right = '' }, }, sections = { - lualine_a = { { 'mode', separator = { left = '', rignt = '' }, right_padding = 2 } }, - lualine_b = { 'filename', 'branch' }, - lualine_c = { - '%=', --[[ add your center components here in place of this comment ]] - }, - lualine_x = {}, - lualine_y = { 'filetype', 'progress' }, + lualine_a = { { 'mode', separator = { left = '', rignt = '' }, right_padding = 2 } }, -- { left = '', rignt = '' } + lualine_b = { 'filename', 'diff' }, + lualine_c = { 'branch' }, + lualine_x = { {'diagnostics', sources = { 'nvim_lsp' } } }, + lualine_y = { 'lsp_status', 'progress' }, lualine_z = { - { 'location', separator = { left = '', right = '' }, left_padding = 2 }, + { 'location', separator = { left = '', right = '' }, left_padding = 2 }, }, }, inactive_sections = { - lualine_a = { 'filename' }, - lualine_b = {}, + lualine_a = {}, + lualine_b = { 'filename' }, lualine_c = {}, lualine_x = {}, - lualine_y = {}, - lualine_z = { 'location' }, + lualine_y = { 'location' }, + lualine_z = {}, }, tabline = {}, extensions = {}, } + +-- vim.api.nvim_create_autocmd("ColorScheme", { +-- callback = function() +-- setup_lualine() +-- print "colorscheme changed" +-- end, +-- }) diff --git a/pkgs/custom-neovim/config/lua/plugins/tabby.lua b/pkgs/custom-neovim/config/lua/plugins/tabby.lua index 2ad03ed..ecba331 100644 --- a/pkgs/custom-neovim/config/lua/plugins/tabby.lua +++ b/pkgs/custom-neovim/config/lua/plugins/tabby.lua @@ -1,2 +1,54 @@ -vim.o.showtabline = 1 -require('tabby').setup() +local general_theme = utils.generate_theme_from_lualine() +local colors = { + current = { fg = general_theme.modes.insert, bg = general_theme.background, style = 'bold'}, + not_current = { fg = general_theme.text.light, bg = general_theme.background }; + fill = { bg = general_theme.background }; +}; +local theme = { + fill = colors.fill, + -- Also you can do this: fill = { fg='#f2e9de', bg='#907aa9', style='italic' } + head = colors.fill, + current_tab = colors.current, + tab = colors.not_current, + win = colors.fill, + tail = colors.fill, +} +require('tabby').setup({ + line = function(line) + return { + { + -- { '  ', hl = theme.head }, + -- line.sep('', theme.head, theme.fill), + }, + line.tabs().foreach(function(tab) + local hl = tab.is_current() and theme.current_tab or theme.tab + return { + line.sep('', hl, theme.fill), + -- tab.is_current() and '' or '󰆣', + tab.number(), + tab.name(), + line.sep('', hl, theme.fill), + hl = hl, + margin = ' ', + } + end), + line.spacer(), + line.wins_in_tab(line.api.get_current_tab()).foreach(function(win) + return { + line.sep('', theme.win, theme.fill), + -- win.is_current() and '' or '', + win.buf_name(), + line.sep('', theme.win, theme.fill), + hl = theme.win, + margin = ' ', + } + end), + { + line.sep('', theme.tail, theme.fill), + { '  ', hl = theme.tail }, + }, + hl = theme.fill, + } + end, + -- option = {}, -- setup modules' option, +}) diff --git a/pkgs/custom-neovim/config/lua/utilities.lua b/pkgs/custom-neovim/config/lua/utilities.lua index fe86dd6..3de4a54 100644 --- a/pkgs/custom-neovim/config/lua/utilities.lua +++ b/pkgs/custom-neovim/config/lua/utilities.lua @@ -3,3 +3,23 @@ utils = {} utils.mapkey = function(mode, key, desc, action) vim.keymap.set(mode, key, action, {noremap = true, silent = true, desc = desc}) end + +utils.generate_theme_from_lualine = function() + local auto_theme = require("lualine.themes.auto") + return { + modes = { + normal = auto_theme.normal.a.bg, + insert = auto_theme.insert.a.bg, + visual = auto_theme.visual.a.bg, + replace = auto_theme.replace.a.bg, + command = auto_theme.command.a.bg, + inactive = auto_theme.inactive.a.bg, + }, + text = { + dark = auto_theme.normal.a.fg, + light = auto_theme.normal.c.fg, + }, + background = auto_theme.normal.c.bg, + } +end + -- cgit v1.2.3 From 405c50fe980449290fa11c0c3b813954eacf4c4f Mon Sep 17 00:00:00 2001 From: triethyl Date: Tue, 8 Jul 2025 16:52:49 -0400 Subject: working on custom nvim Former-commit-id: 7d898c7680f9611b803438b88026d3d126672437 --- pkgs/custom-neovim/config/lua/art.lua | 271 ++++++++++++++++++++++++ pkgs/custom-neovim/config/lua/plugins/alpha.lua | 21 ++ pkgs/custom-neovim/config/lua/plugins/tabby.lua | 1 - 3 files changed, 292 insertions(+), 1 deletion(-) create mode 100644 pkgs/custom-neovim/config/lua/art.lua create mode 100644 pkgs/custom-neovim/config/lua/plugins/alpha.lua (limited to 'pkgs/custom-neovim/config/lua') diff --git a/pkgs/custom-neovim/config/lua/art.lua b/pkgs/custom-neovim/config/lua/art.lua new file mode 100644 index 0000000..76f2bfb --- /dev/null +++ b/pkgs/custom-neovim/config/lua/art.lua @@ -0,0 +1,271 @@ +-- Credits to the ascii.nvim plugin and jgs on the ascii art archive. + +art = { + space = { + saturn = { + [[ ~+ ]] + [[ * + ]] + [[ ' | ]] + [[ () .-.,="``"=. - o - ]] + [[ '=/_ \ | ]] + [[ * | '=._ | ]] + [[ \ `=./`, ' ]] + [[ . '=.__.=' `=' * ]] + [[ + + ]] + [[ O * ' . ]] + }, + }, + neovim = { + default1 = { + [[ __ ]], + [[ ___ ___ ___ __ __ /\_\ ___ ___ ]], + [[ / _ `\ / __`\ / __`\/\ \/\ \\/\ \ / __` __`\ ]], + [[/\ \/\ \/\ __//\ \_\ \ \ \_/ |\ \ \/\ \/\ \/\ \ ]], + [[\ \_\ \_\ \____\ \____/\ \___/ \ \_\ \_\ \_\ \_\]], + [[ \/_/\/_/\/____/\/___/ \/__/ \/_/\/_/\/_/\/_/]], + }, + + default2 = { + [[ _______ ____ ____.__ ]], + [[ \ \ ____ ___\ \ / /|__| _____ ]], + [[ / | \_/ __ \/ _ \ Y / | |/ \ ]], + [[/ | \ ___( <_> ) / | | Y Y \]], + [[\____|__ /\___ >____/ \___/ |__|__|_| /]], + [[ \/ \/ \/ ]], + }, + + dos_rebel = { + [[ ]], + [[ ██████ █████ █████ █████ ███ ]], + [[ ░░██████ ░░███ ░░███ ░░███ ░░░ ]], + [[ ░███░███ ░███ ██████ ██████ ░███ ░███ ████ █████████████ ]], + [[ ░███░░███░███ ███░░███ ███░░███ ░███ ░███ ░░███ ░░███░░███░░███ ]], + [[ ░███ ░░██████ ░███████ ░███ ░███ ░░███ ███ ░███ ░███ ░███ ░███ ]], + [[ ░███ ░░█████ ░███░░░ ░███ ░███ ░░░█████░ ░███ ░███ ░███ ░███ ]], + [[ █████ ░░█████░░██████ ░░██████ ░░███ █████ █████░███ █████ ]], + [[ ░░░░░ ░░░░░ ░░░░░░ ░░░░░░ ░░░ ░░░░░ ░░░░░ ░░░ ░░░░░ ]], + [[ ]], + }, + + rowan_cap = { + [[ ]], + [[ dMMMMb dMMMMMP .aMMMb dMP dMP dMP dMMMMMMMMb ]], + [[ dMP dMP dMP dMP"dMP dMP dMP amr dMP"dMP"dMP ]], + [[ dMP dMP dMMMP dMP dMP dMP dMP dMP dMP dMP dMP ]], + [[ dMP dMP dMP dMP.aMP YMvAP" dMP dMP dMP dMP ]], + [[ dMP dMP dMMMMMP VMMMP" VP" dMP dMP dMP dMP ]], + [[ ]], + }, + + isometric = { + [[ ]], + [[ /\__\ /\ \ /\ \ /\__\ ___ /\__\ ]], + [[ /::| | /::\ \ /::\ \ /:/ / /\ \ /::| | ]], + [[ /:|:| | /:/\:\ \ /:/\:\ \ /:/ / \:\ \ /:|:| | ]], + [[ /:/|:| |__ /::\~\:\ \ /:/ \:\ \ /:/__/ ___ /::\__\ /:/|:|__|__ ]], + [[ /:/ |:| /\__\ /:/\:\ \:\__\ /:/__/ \:\__\ |:| | /\__\ __/:/\/__/ /:/ |::::\__\ ]], + [[ \/__|:|/:/ / \:\~\:\ \/__/ \:\ \ /:/ / |:| |/:/ / /\/:/ / \/__/~~/:/ / ]], + [[ |:/:/ / \:\ \:\__\ \:\ /:/ / |:|__/:/ / \::/__/ /:/ / ]], + [[ |::/ / \:\ \/__/ \:\/:/ / \::::/__/ \:\__\ /:/ / ]], + [[ /:/ / \:\__\ \::/ / ~~~~ \/__/ /:/ / ]], + [[ \/__/ \/__/ \/__/ \/__/ ]], + [[ ]], + }, + + ogre = { + [[ ]], + [[ __ _ ]], + [[ /\ \ \___ ___/\ /(_)_ __ ___ ]], + [[ / \/ / _ \/ _ \ \ / | | '_ ` _ \ ]], + [[ / /\ | __| (_) \ V /| | | | | | | ]], + [[ \_\ \/ \___|\___/ \_/ |_|_| |_| |_| ]], + [[ ]], + }, + + slant_relief = { + [[ ]], + [[ /\\\\\_____/\\\_______________________________/\\\________/\\\___________________________ ]], + [[ \/\\\\\\___\/\\\______________________________\/\\\_______\/\\\__________________________ ]], + [[ _\/\\\/\\\__\/\\\______________________________\//\\\______/\\\___/\\\_____________________ ]], + [[ _\/\\\//\\\_\/\\\_____/\\\\\\\\______/\\\\\_____\//\\\____/\\\___\///_____/\\\\\__/\\\\\__ ]], + [[ _\/\\\\//\\\\/\\\___/\\\/////\\\___/\\\///\\\____\//\\\__/\\\_____/\\\__/\\\///\\\\\///\\\_ ]], + [[ _\/\\\_\//\\\/\\\__/\\\\\\\\\\\___/\\\__\//\\\____\//\\\/\\\_____\/\\\_\/\\\_\//\\\__\/\\\ ]], + [[ _\/\\\__\//\\\\\\_\//\\///////___\//\\\__/\\\______\//\\\\\______\/\\\_\/\\\__\/\\\__\/\\\_ ]], + [[ _\/\\\___\//\\\\\__\//\\\\\\\\\\__\///\\\\\/________\//\\\_______\/\\\_\/\\\__\/\\\__\/\\\ ]], + [[ _\///_____\/////____\//////////_____\/////___________\///________\///__\///___\///___\///__ ]], + [[ ]], + }, + + ansi_shadow = { + [[ ]], + [[ ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ]], + [[ ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ]], + [[ ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ]], + [[ ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ]], + [[ ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ]], + [[ ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ]], + [[ ]], + }, + + bloody = { + [[ ]], + [[ ███▄ █ ▓█████ ▒█████ ██▒ █▓ ██▓ ███▄ ▄███▓ ]], + [[ ██ ▀█ █ ▓█ ▀ ▒██▒ ██▒▓██░ █▒▓██▒▓██▒▀█▀ ██▒ ]], + [[ ▓██ ▀█ ██▒▒███ ▒██░ ██▒ ▓██ █▒░▒██▒▓██ ▓██░ ]], + [[ ▓██▒ ▐▌██▒▒▓█ ▄ ▒██ ██░ ▒██ █░░░██░▒██ ▒██ ]], + [[ ▒██░ ▓██░░▒████▒░ ████▓▒░ ▒▀█░ ░██░▒██▒ ░██▒ ]], + [[ ░ ▒░ ▒ ▒ ░░ ▒░ ░░ ▒░▒░▒░ ░ ▐░ ░▓ ░ ▒░ ░ ░ ]], + [[ ░ ░░ ░ ▒░ ░ ░ ░ ░ ▒ ▒░ ░ ░░ ▒ ░░ ░ ░ ]], + [[ ░ ░ ░ ░ ░ ░ ░ ▒ ░░ ▒ ░░ ░ ]], + [[ ░ ░ ░ ░ ░ ░ ░ ░ ]], + [[ ░ ]], + [[ ]], + }, + + delta_corps_priest1 = { + [[ ]], + [[ ███▄▄▄▄ ▄████████ ▄██████▄ ▄█ █▄ ▄█ ▄▄▄▄███▄▄▄▄ ]], + [[ ███▀▀▀██▄ ███ ███ ███ ███ ███ ███ ███ ▄██▀▀▀███▀▀▀██▄ ]], + [[ ███ ███ ███ █▀ ███ ███ ███ ███ ███▌ ███ ███ ███ ]], + [[ ███ ███ ▄███▄▄▄ ███ ███ ███ ███ ███▌ ███ ███ ███ ]], + [[ ███ ███ ▀▀███▀▀▀ ███ ███ ███ ███ ███▌ ███ ███ ███ ]], + [[ ███ ███ ███ █▄ ███ ███ ███ ███ ███ ███ ███ ███ ]], + [[ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ]], + [[ ▀█ █▀ ██████████ ▀██████▀ ▀██████▀ █▀ ▀█ ███ █▀ ]], + [[ ]], + }, + + elite = { + [[ ]], + [[ ▐ ▄ ▄▄▄ . ▌ ▐·▪ • ▌ ▄ ·. ]], + [[ •█▌▐█▀▄.▀·▪ ▪█·█▌██ ·██ ▐███▪ ]], + [[ ▐█▐▐▌▐▀▀▪▄ ▄█▀▄ ▐█▐█•▐█·▐█ ▌▐▌▐█· ]], + [[ ██▐█▌▐█▄▄▌▐█▌.▐▌ ███ ▐█▌██ ██▌▐█▌ ]], + [[ ▀▀ █▪ ▀▀▀ ▀█▄▀▪. ▀ ▀▀▀▀▀ █▪▀▀▀ ]], + [[ ]], + }, + + the_edge = { + [[ ]], + [[ ▄ ▄███▄ ████▄ ▄ ▄█ █▀▄▀█ ]], + [[ █ █▀ ▀ █ █ █ ██ █ █ █ ]], + [[ ██ █ ██▄▄ █ █ █ █ ██ █ ▄ █ ]], + [[ █ █ █ █▄ ▄▀ ▀████ █ █ ▐█ █ █ ]], + [[ █ █ █ ▀███▀ █ █ ▐ █ ]], + [[ █ ██ █▐ ▀ ]], + [[ ▐ ]], + [[ ]], + }, + + banner3 = { + [[ ]], + [[ ## ## ######## ####### ## ## #### ## ## ]], + [[ ### ## ## ## ## ## ## ## ### ### ]], + [[ #### ## ## ## ## ## ## ## #### #### ]], + [[ ## ## ## ###### ## ## ## ## ## ## ### ## ]], + [[ ## #### ## ## ## ## ## ## ## ## ]], + [[ ## ### ## ## ## ## ## ## ## ## ]], + [[ ## ## ######## ####### ### #### ## ## ]], + [[ ]], + }, + + colossal = { + [[ ]], + [[ 888b 888 888 888 d8b ]], + [[ 8888b 888 888 888 Y8P ]], + [[ 88888b 888 888 888 ]], + [[ 888Y88b 888 .d88b. .d88b. Y88b d88P 888 88888b.d88b. ]], + [[ 888 Y88b888 d8P Y8b d88""88b Y88b d88P 888 888 "888 "88b ]], + [[ 888 Y88888 88888888 888 888 Y88o88P 888 888 888 888 ]], + [[ 888 Y8888 Y8b. Y88..88P Y888P 888 888 888 888 ]], + [[ 888 Y888 "Y8888 "Y88P" Y8P 888 888 888 888 ]], + [[ ]], + }, + + decimal = { + [[ ]], + [[ 78 101 111 86 105 109 ]], + [[ ]], + }, + + def_leppard = { + [[ ]], + [[ : ]], + [[ L. ,; t#, ]], + [[ EW: ,ft f#i ;##W. t ]], + [[ E##; t#E .E#t :#L:WE Ej .. : ]], + [[ E###t t#E i#W, .KG ,#D t .DD.E#, ,W, .Et ]], + [[ E#fE#f t#E L#D. EE ;#f EK: ,WK. E#t t##, ,W#t ]], + [[ E#t D#G t#E :K#Wfff; f#. t#iE#t i#D E#t L###, j###t ]], + [[ E#t f#E. t#E i##WLLLLt :#G GK E#t j#f E#t .E#j##, G#fE#t ]], + [[ E#t t#K: t#E .E#L ;#L LW. E#tL#i E#t ;WW; ##,:K#i E#t ]], + [[ E#t ;#W,t#E f#E: t#f f#: E#WW, E#t j#E. ##f#W, E#t ]], + [[ E#t :K#D#E ,WW; f#D#; E#K: E#t .D#L ###K: E#t ]], + [[ E#t .E##E .D#; G#t ED. E#t :K#t ##D. E#t ]], + [[ .. G#E tt t t E#t ... #G .. ]], + [[ fE ,;. j ]], + [[ , ]], + [[ ]], + }, + + larry_3d = { + [[ ]], + [[ __ __ __ __ ]], + [[ /\ \/\ \ /\ \/\ \ __ ]], + [[ \ \ `\\ \ __ ___\ \ \ \ \/\_\ ___ ___ ]], + [[ \ \ , ` \ /'__`\ / __`\ \ \ \ \/\ \ /' __` __`\ ]], + [[ \ \ \`\ \/\ __//\ \L\ \ \ \_/ \ \ \/\ \/\ \/\ \ ]], + [[ \ \_\ \_\ \____\ \____/\ `\___/\ \_\ \_\ \_\ \_\ ]], + [[ \/_/\/_/\/____/\/___/ `\/__/ \/_/\/_/\/_/\/_/ ]], + [[ ]], + }, + + lean = { + [[ ]], + [[ _/ _/ _/ _/ _/ ]], + [[ _/_/ _/ _/_/ _/_/ _/ _/ _/_/_/ _/_/ ]], + [[ _/ _/ _/ _/_/_/_/ _/ _/ _/ _/ _/ _/ _/ _/ ]], + [[ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ ]], + [[ _/ _/ _/_/_/ _/_/ _/ _/ _/ _/ _/ ]], + [[ ]], + }, + + morse = { + [[ ]], + [[ -. . --- ...- .. -- ]], + [[ ]], + }, + + sharp = { + [[ ]], + [[  ]], + [[ ████ ██████ █████ ██ ]], + [[ ███████████ █████  ]], + [[ █████████ ███████████████████ ███ ███████████ ]], + [[ █████████ ███ █████████████ █████ ██████████████ ]], + [[ █████████ ██████████ █████████ █████ █████ ████ █████ ]], + [[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]], + [[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]], + [[ ]], + }, + }, + misc = { + hydra = { + [[ ]], + [[ ]], + [[ ]], + [[ ⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣿⣶⣿⣦⣼⣆ ]], + [[ ⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦ ]], + [[ ⠈⢿⣿⣟⠦ ⣾⣿⣿⣷ ⠻⠿⢿⣿⣧⣄ ]], + [[ ⣸⣿⣿⢧ ⢻⠻⣿⣿⣷⣄⣀⠄⠢⣀⡀⠈⠙⠿⠄ ]], + [[ ⢠⣿⣿⣿⠈ ⣻⣿⣿⣿⣿⣿⣿⣿⣛⣳⣤⣀⣀ ]], + [[ ⢠⣧⣶⣥⡤⢄ ⣸⣿⣿⠘ ⢀⣴⣿⣿⡿⠛⣿⣿⣧⠈⢿⠿⠟⠛⠻⠿⠄ ]], + [[ ⣰⣿⣿⠛⠻⣿⣿⡦⢹⣿⣷ ⢊⣿⣿⡏ ⢸⣿⣿⡇ ⢀⣠⣄⣾⠄ ]], + [[ ⣠⣿⠿⠛ ⢀⣿⣿⣷⠘⢿⣿⣦⡀ ⢸⢿⣿⣿⣄ ⣸⣿⣿⡇⣪⣿⡿⠿⣿⣷⡄ ]], + [[ ⠙⠃ ⣼⣿⡟ ⠈⠻⣿⣿⣦⣌⡇⠻⣿⣿⣷⣿⣿⣿ ⣿⣿⡇ ⠛⠻⢷⣄ ]], + [[ ⢻⣿⣿⣄ ⠈⠻⣿⣿⣿⣷⣿⣿⣿⣿⣿⡟ ⠫⢿⣿⡆ ]], + [[ ⠻⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⡟⢀⣀⣤⣾⡿⠃ ]], + [[ ]], + }, + }, +} diff --git a/pkgs/custom-neovim/config/lua/plugins/alpha.lua b/pkgs/custom-neovim/config/lua/plugins/alpha.lua new file mode 100644 index 0000000..ef39612 --- /dev/null +++ b/pkgs/custom-neovim/config/lua/plugins/alpha.lua @@ -0,0 +1,21 @@ +local alpha = require("alpha") +local dashboard = require("alpha.themes.dashboard") + +-- Set header +dashboard.section.header.val = art.misc.hydra + +-- Set menu +dashboard.section.buttons.val = { + dashboard.button( "f", " > Find file", ":cd $HOME | Telescope find_files"), + dashboard.button( "r", " > Find recent file", ":Telescope oldfiles"), + dashboard.button( "s", "Load session", ""), + dashboard.button( "q", " > Quit", ":qa"), +} + +-- Send config to alpha +alpha.setup(dashboard.opts) + +-- Disable folding on alpha buffer +vim.cmd([[ + autocmd FileType alpha setlocal nofoldenable +]]) diff --git a/pkgs/custom-neovim/config/lua/plugins/tabby.lua b/pkgs/custom-neovim/config/lua/plugins/tabby.lua index ecba331..211c0c0 100644 --- a/pkgs/custom-neovim/config/lua/plugins/tabby.lua +++ b/pkgs/custom-neovim/config/lua/plugins/tabby.lua @@ -6,7 +6,6 @@ local colors = { }; local theme = { fill = colors.fill, - -- Also you can do this: fill = { fg='#f2e9de', bg='#907aa9', style='italic' } head = colors.fill, current_tab = colors.current, tab = colors.not_current, -- cgit v1.2.3 From ed82f622069233e7b9f817e687865f19fb88b8bb Mon Sep 17 00:00:00 2001 From: triethyl Date: Wed, 9 Jul 2025 00:21:42 -0400 Subject: working on dashboard Former-commit-id: 5f31e111f7ffa0ef63d503c8641d0789cf18b868 --- pkgs/custom-neovim/config/lua/art.lua | 20 ++++++++--------- pkgs/custom-neovim/config/lua/plugins/alpha.lua | 26 ++++++++++++++++------ .../config/lua/plugins/mini/starter.lua | 1 + 3 files changed, 30 insertions(+), 17 deletions(-) create mode 100644 pkgs/custom-neovim/config/lua/plugins/mini/starter.lua (limited to 'pkgs/custom-neovim/config/lua') diff --git a/pkgs/custom-neovim/config/lua/art.lua b/pkgs/custom-neovim/config/lua/art.lua index 76f2bfb..1927173 100644 --- a/pkgs/custom-neovim/config/lua/art.lua +++ b/pkgs/custom-neovim/config/lua/art.lua @@ -3,16 +3,16 @@ art = { space = { saturn = { - [[ ~+ ]] - [[ * + ]] - [[ ' | ]] - [[ () .-.,="``"=. - o - ]] - [[ '=/_ \ | ]] - [[ * | '=._ | ]] - [[ \ `=./`, ' ]] - [[ . '=.__.=' `=' * ]] - [[ + + ]] - [[ O * ' . ]] + [[ ~+ ]], + [[ * + ]], + [[ ' | ]], + [[ () .-.,="``"=. - o - ]], + [[ '=/_ \ | ]], + [[ * | '=._ | ]], + [[ \ `=./`, ' ]], + [[ . '=.__.=' `=' * ]], + [[ + + ]], + [[ O * ' . ]], }, }, neovim = { diff --git a/pkgs/custom-neovim/config/lua/plugins/alpha.lua b/pkgs/custom-neovim/config/lua/plugins/alpha.lua index ef39612..5ccdc3f 100644 --- a/pkgs/custom-neovim/config/lua/plugins/alpha.lua +++ b/pkgs/custom-neovim/config/lua/plugins/alpha.lua @@ -6,16 +6,28 @@ dashboard.section.header.val = art.misc.hydra -- Set menu dashboard.section.buttons.val = { - dashboard.button( "f", " > Find file", ":cd $HOME | Telescope find_files"), + dashboard.button( "f", " > Find file", ":cd $HOME | Telescope find_files"), dashboard.button( "r", " > Find recent file", ":Telescope oldfiles"), - dashboard.button( "s", "Load session", ""), - dashboard.button( "q", " > Quit", ":qa"), + dashboard.button( "s", " > Load session", ""), + dashboard.button( "q", " > Quit", ":qa"), } -- Send config to alpha alpha.setup(dashboard.opts) --- Disable folding on alpha buffer -vim.cmd([[ - autocmd FileType alpha setlocal nofoldenable -]]) +-- Set options just for the dashboard. +vim.api.nvim_create_autocmd("BufEnter", { + pattern = "alpha", + callback = function() + vim.opt_local.foldenable = false -- disable folding + end, +}) + +-- Refresh dashboard when window resized. +vim.api.nvim_create_autocmd("VimResized", { + -- pattern = "alpha", + callback = function() + print("redrawn") + vim.cmd.AlphaRedraw() + end +}) diff --git a/pkgs/custom-neovim/config/lua/plugins/mini/starter.lua b/pkgs/custom-neovim/config/lua/plugins/mini/starter.lua new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/pkgs/custom-neovim/config/lua/plugins/mini/starter.lua @@ -0,0 +1 @@ + -- cgit v1.2.3 From d65a4b2e6fb66f51b21da8d5397f89ea1c2aaedc Mon Sep 17 00:00:00 2001 From: triethyl Date: Wed, 9 Jul 2025 01:02:02 -0400 Subject: working on dashboard Former-commit-id: 10503c9edf27043e403a17ac693af14e5f663537 --- pkgs/custom-neovim/config/lua/art.lua | 2 -- pkgs/custom-neovim/config/lua/plugins/dashboard.lua | 3 +++ pkgs/custom-neovim/config/lua/plugins/mini/starter.lua | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 pkgs/custom-neovim/config/lua/plugins/dashboard.lua (limited to 'pkgs/custom-neovim/config/lua') diff --git a/pkgs/custom-neovim/config/lua/art.lua b/pkgs/custom-neovim/config/lua/art.lua index 1927173..ae5b8c9 100644 --- a/pkgs/custom-neovim/config/lua/art.lua +++ b/pkgs/custom-neovim/config/lua/art.lua @@ -251,8 +251,6 @@ art = { }, misc = { hydra = { - [[ ]], - [[ ]], [[ ]], [[ ⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣿⣶⣿⣦⣼⣆ ]], [[ ⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦ ]], diff --git a/pkgs/custom-neovim/config/lua/plugins/dashboard.lua b/pkgs/custom-neovim/config/lua/plugins/dashboard.lua new file mode 100644 index 0000000..4824c04 --- /dev/null +++ b/pkgs/custom-neovim/config/lua/plugins/dashboard.lua @@ -0,0 +1,3 @@ +require('dashboard').setup { + +} diff --git a/pkgs/custom-neovim/config/lua/plugins/mini/starter.lua b/pkgs/custom-neovim/config/lua/plugins/mini/starter.lua index 8b13789..c05483a 100644 --- a/pkgs/custom-neovim/config/lua/plugins/mini/starter.lua +++ b/pkgs/custom-neovim/config/lua/plugins/mini/starter.lua @@ -1 +1,18 @@ +local starter = require('mini.starter') +local my_items = { + { name = 'Item #1 from function', action = "echo 'Item #1'", section = '' }, + { name = [[Another item in 'Section 1']], action = 'lua print(math.random() + 10)', section = '' }, +} +starter.setup({ + evaluate_single = true, + header = table.concat(art.misc.hydra, "\n"), + footer = "", + items = my_items, + content_hooks = { + -- starter.gen_hook.adding_bullet(), + -- starter.gen_hook.indexing('all', { 'Builtin actions' }), + starter.gen_hook.aligning('center', 'center'), + starter.gen_hook.padding(0, 0), + }, +}) -- cgit v1.2.3 From 4afdfee5c1ce99a09fc70075ca674b961fd3faed Mon Sep 17 00:00:00 2001 From: triethyl Date: Wed, 9 Jul 2025 13:11:23 -0400 Subject: working on custom neovim Former-commit-id: 4baf1a9c64b861ce1a934487b93b36bdb1438cf3 --- pkgs/custom-neovim/config/lua/autocommands.lua | 50 +++++++++++----------- pkgs/custom-neovim/config/lua/options.lua | 2 +- pkgs/custom-neovim/config/lua/plugins/alpha.lua | 13 ++---- .../custom-neovim/config/lua/plugins/dashboard.lua | 14 +++++- .../custom-neovim/config/lua/plugins/persisted.lua | 3 ++ 5 files changed, 45 insertions(+), 37 deletions(-) create mode 100644 pkgs/custom-neovim/config/lua/plugins/persisted.lua (limited to 'pkgs/custom-neovim/config/lua') diff --git a/pkgs/custom-neovim/config/lua/autocommands.lua b/pkgs/custom-neovim/config/lua/autocommands.lua index 85a58c6..48a976e 100644 --- a/pkgs/custom-neovim/config/lua/autocommands.lua +++ b/pkgs/custom-neovim/config/lua/autocommands.lua @@ -1,32 +1,32 @@ -- Autocommands -- Use relative line number in normal mode and absolute in insert mode -vim.opt.number = true -local numbertoggle = vim.api.nvim_create_augroup("numbertoggle", {}) -vim.api.nvim_create_autocmd( - { "BufEnter", "FocusGained", "InsertLeave", "WinEnter", "CmdlineLeave" }, - { - group = numbertoggle, - callback = function() - if vim.opt.number and vim.api.nvim_get_mode() ~= "i" then - vim.opt.relativenumber = true - end - end, - } -) +-- vim.opt.number = true +-- local numbertoggle = vim.api.nvim_create_augroup("numbertoggle", {}) +-- vim.api.nvim_create_autocmd( +-- { "BufEnter", "FocusGained", "InsertLeave", "WinEnter", "CmdlineLeave" }, +-- { +-- group = numbertoggle, +-- callback = function() +-- if vim.opt.number and vim.api.nvim_get_mode() ~= "i" then +-- vim.opt.relativenumber = true +-- end +-- end, +-- } +-- ) -vim.api.nvim_create_autocmd( - { "BufLeave", "FocusLost", "InsertEnter", "WinLeave", "CmdlineEnter" }, - { - group = numbertoggle, - callback = function() - if vim.opt.number then - vim.opt.relativenumber = false - vim.cmd("redraw") - end - end, - } -) +-- vim.api.nvim_create_autocmd( +-- { "BufLeave", "FocusLost", "InsertEnter", "WinLeave", "CmdlineEnter" }, +-- { +-- group = numbertoggle, +-- callback = function() +-- if vim.opt.number then +-- vim.opt.relativenumber = false +-- vim.cmd("redraw") +-- end +-- end, +-- } +-- ) -- start terminal in insert mode vim.api.nvim_create_autocmd("TermOpen", { diff --git a/pkgs/custom-neovim/config/lua/options.lua b/pkgs/custom-neovim/config/lua/options.lua index 14ee7d1..8981dad 100644 --- a/pkgs/custom-neovim/config/lua/options.lua +++ b/pkgs/custom-neovim/config/lua/options.lua @@ -7,7 +7,7 @@ vim.o.ruler = false -- don't show #,# in the commandline. vim.o.icm = 'split' vim.o.cia = 'abbr,kind,menu' vim.o.mouse = "" -vim.o.number = true -- set numbered lines +vim.o.relativenumber = true -- set numbered lines vim.o.scrolloff = 4 -- minimal number of screen lines to keep above and below the cursor vim.o.signcolumn = "yes" -- always show the sign column, otherwise it would shift the text each time vim.o.clipboard = "unnamedplus" -- use system clipboard diff --git a/pkgs/custom-neovim/config/lua/plugins/alpha.lua b/pkgs/custom-neovim/config/lua/plugins/alpha.lua index 5ccdc3f..6599bdb 100644 --- a/pkgs/custom-neovim/config/lua/plugins/alpha.lua +++ b/pkgs/custom-neovim/config/lua/plugins/alpha.lua @@ -8,7 +8,7 @@ dashboard.section.header.val = art.misc.hydra dashboard.section.buttons.val = { dashboard.button( "f", " > Find file", ":cd $HOME | Telescope find_files"), dashboard.button( "r", " > Find recent file", ":Telescope oldfiles"), - dashboard.button( "s", " > Load session", ""), + dashboard.button( "s", " > Load session", ":Telescope persisted"), dashboard.button( "q", " > Quit", ":qa"), } @@ -20,14 +20,7 @@ vim.api.nvim_create_autocmd("BufEnter", { pattern = "alpha", callback = function() vim.opt_local.foldenable = false -- disable folding + vim.opt_local.relativenumber = false + vim.opt_local.number = false end, }) - --- Refresh dashboard when window resized. -vim.api.nvim_create_autocmd("VimResized", { - -- pattern = "alpha", - callback = function() - print("redrawn") - vim.cmd.AlphaRedraw() - end -}) diff --git a/pkgs/custom-neovim/config/lua/plugins/dashboard.lua b/pkgs/custom-neovim/config/lua/plugins/dashboard.lua index 4824c04..f8458c9 100644 --- a/pkgs/custom-neovim/config/lua/plugins/dashboard.lua +++ b/pkgs/custom-neovim/config/lua/plugins/dashboard.lua @@ -1,3 +1,15 @@ require('dashboard').setup { - + theme = "doom", + config = { + header = art.misc.hydra, + center = { + { + icon = " ", + desc = "Find file", + key = "f", + action = ":cd $HOME | Telescope find_files", + }, + }, + vertical_center = true, + }, } diff --git a/pkgs/custom-neovim/config/lua/plugins/persisted.lua b/pkgs/custom-neovim/config/lua/plugins/persisted.lua new file mode 100644 index 0000000..d3a5814 --- /dev/null +++ b/pkgs/custom-neovim/config/lua/plugins/persisted.lua @@ -0,0 +1,3 @@ +require("persisted").setup() + +require("telescope").load_extension("persisted") -- cgit v1.2.3 From 96792596b8b48fdf73d99caab5781394c6fab00c Mon Sep 17 00:00:00 2001 From: triethyl Date: Thu, 10 Jul 2025 19:02:27 -0400 Subject: working on custom neovim Former-commit-id: 4ce0bec0e948790108ad93d37bd99097537302a6 --- pkgs/custom-neovim/config/lua/colorscheme.lua | 16 ++++++++++++++++ pkgs/custom-neovim/config/lua/mappings.lua | 1 + pkgs/custom-neovim/config/lua/plugins/alpha.lua | 9 +++++---- pkgs/custom-neovim/config/lua/plugins/lspconfig.lua | 4 ++-- 4 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 pkgs/custom-neovim/config/lua/colorscheme.lua (limited to 'pkgs/custom-neovim/config/lua') diff --git a/pkgs/custom-neovim/config/lua/colorscheme.lua b/pkgs/custom-neovim/config/lua/colorscheme.lua new file mode 100644 index 0000000..59cb970 --- /dev/null +++ b/pkgs/custom-neovim/config/lua/colorscheme.lua @@ -0,0 +1,16 @@ +-- Set colorscheme. +vim.cmd.colorscheme("oxocarbon") + +-- Set boolean to use patches. +local correct_borderless_windows = true + +-- Patches. +local link_highlight = function(first_highlight, second_highlight) + vim.cmd.highlight {bang = true, "link", first_highlight, second_highlight} +end + +if correct_borderless_windows then + link_highlight("TelescopeBorder", "Comment") + link_highlight("TelescopeResultsTitle", "Comment") + link_highlight("TelescopePreviewTitle", "Comment") +end diff --git a/pkgs/custom-neovim/config/lua/mappings.lua b/pkgs/custom-neovim/config/lua/mappings.lua index 1ffbadb..15a28e5 100644 --- a/pkgs/custom-neovim/config/lua/mappings.lua +++ b/pkgs/custom-neovim/config/lua/mappings.lua @@ -27,3 +27,4 @@ vim.keymap.set("c", "", function() if vim.fn.pumvisible() == 1 then return '' end return '' end, { expr = true }) -- Make enter complete command. +mapkey("n", "", "Clear highlights", ":noh") -- Make esc clear highlights diff --git a/pkgs/custom-neovim/config/lua/plugins/alpha.lua b/pkgs/custom-neovim/config/lua/plugins/alpha.lua index 6599bdb..e0fa7e9 100644 --- a/pkgs/custom-neovim/config/lua/plugins/alpha.lua +++ b/pkgs/custom-neovim/config/lua/plugins/alpha.lua @@ -6,10 +6,11 @@ dashboard.section.header.val = art.misc.hydra -- Set menu dashboard.section.buttons.val = { - dashboard.button( "f", " > Find file", ":cd $HOME | Telescope find_files"), - dashboard.button( "r", " > Find recent file", ":Telescope oldfiles"), - dashboard.button( "s", " > Load session", ":Telescope persisted"), - dashboard.button( "q", " > Quit", ":qa"), + dashboard.button( "f", " > Find file", ":cd $HOME | Telescope find_files" ), + dashboard.button( "r", " > Find recent file", ":Telescope oldfiles" ), + dashboard.button( "s", " > Load session", ":Telescope persisted" ), + dashboard.button( "l", " > Load last session", ":SessionLoadLast" ), + dashboard.button( "q", " > Quit", ":qa" ), } -- Send config to alpha diff --git a/pkgs/custom-neovim/config/lua/plugins/lspconfig.lua b/pkgs/custom-neovim/config/lua/plugins/lspconfig.lua index 98b34f2..445caee 100644 --- a/pkgs/custom-neovim/config/lua/plugins/lspconfig.lua +++ b/pkgs/custom-neovim/config/lua/plugins/lspconfig.lua @@ -38,8 +38,8 @@ vim.api.nvim_create_autocmd('LspAttach', { print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end) keymap('n', 'r', "Rename Symbol", vim.lsp.buf.rename) - keymap("n", "s", "Open symbol picker", [[:Pick lsp scope="document_symbol"]]) - keymap("n", "S", "Open workspace symbol picker", [[:Pick lsp scope="workspace_symbol"]]) + keymap("n", "s", "Open symbol picker", ":Telescope lsp_document_symbols") + keymap("n", "S", "Open workspace symbol picker", ":Telescope lsp_workspace_symbols") -- LSP Pickers keymap({'n', 'v'}, "a", "Perform code action", require("actions-preview").code_actions) -- cgit v1.2.3 From d3f7abc4c835e7d9db82b22116da359a8523630a Mon Sep 17 00:00:00 2001 From: triethyl Date: Fri, 11 Jul 2025 08:57:30 -0400 Subject: working on custom neovim Former-commit-id: a23d09a0f35e3bb18f6d979b0e696e0b613c7dff --- pkgs/custom-neovim/config/lua/art.lua | 2 +- pkgs/custom-neovim/config/lua/colorscheme.lua | 21 ++++++++++++++++----- pkgs/custom-neovim/config/lua/plugins/alpha.lua | 3 ++- pkgs/custom-neovim/config/lua/plugins/dashboard.lua | 15 --------------- .../config/lua/plugins/mini/starter.lua | 18 ------------------ 5 files changed, 19 insertions(+), 40 deletions(-) delete mode 100644 pkgs/custom-neovim/config/lua/plugins/dashboard.lua delete mode 100644 pkgs/custom-neovim/config/lua/plugins/mini/starter.lua (limited to 'pkgs/custom-neovim/config/lua') diff --git a/pkgs/custom-neovim/config/lua/art.lua b/pkgs/custom-neovim/config/lua/art.lua index ae5b8c9..f36a5d9 100644 --- a/pkgs/custom-neovim/config/lua/art.lua +++ b/pkgs/custom-neovim/config/lua/art.lua @@ -1,6 +1,6 @@ -- Credits to the ascii.nvim plugin and jgs on the ascii art archive. -art = { +Art = { space = { saturn = { [[ ~+ ]], diff --git a/pkgs/custom-neovim/config/lua/colorscheme.lua b/pkgs/custom-neovim/config/lua/colorscheme.lua index 59cb970..82e1420 100644 --- a/pkgs/custom-neovim/config/lua/colorscheme.lua +++ b/pkgs/custom-neovim/config/lua/colorscheme.lua @@ -9,8 +9,19 @@ local link_highlight = function(first_highlight, second_highlight) vim.cmd.highlight {bang = true, "link", first_highlight, second_highlight} end -if correct_borderless_windows then - link_highlight("TelescopeBorder", "Comment") - link_highlight("TelescopeResultsTitle", "Comment") - link_highlight("TelescopePreviewTitle", "Comment") -end +vim.api.nvim_create_autocmd({"ColorScheme", "VimEnter"}, { + callback = function() + -- Fixes some colorschemes having borderless floating windows. + if correct_borderless_windows then + link_highlight("FloatBorder", "Comment") + + link_highlight("TelescopeBorder", "Comment") + link_highlight("TelescopeResultsTitle", "Variable") + link_highlight("TelescopePreviewTitle", "Variable") + link_highlight("TelescopePromptTitle", "Variable") + link_highlight("TelescopePromptNormal", "Variable") + link_highlight("TelescopePromptBorder", "Variable") + link_highlight("TelescopePromptPrefix", "Variable") + end + end, +}) diff --git a/pkgs/custom-neovim/config/lua/plugins/alpha.lua b/pkgs/custom-neovim/config/lua/plugins/alpha.lua index e0fa7e9..42ad1e4 100644 --- a/pkgs/custom-neovim/config/lua/plugins/alpha.lua +++ b/pkgs/custom-neovim/config/lua/plugins/alpha.lua @@ -2,7 +2,7 @@ local alpha = require("alpha") local dashboard = require("alpha.themes.dashboard") -- Set header -dashboard.section.header.val = art.misc.hydra +dashboard.section.header.val = Art.misc.hydra -- Set menu dashboard.section.buttons.val = { @@ -25,3 +25,4 @@ vim.api.nvim_create_autocmd("BufEnter", { vim.opt_local.number = false end, }) + diff --git a/pkgs/custom-neovim/config/lua/plugins/dashboard.lua b/pkgs/custom-neovim/config/lua/plugins/dashboard.lua deleted file mode 100644 index f8458c9..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/dashboard.lua +++ /dev/null @@ -1,15 +0,0 @@ -require('dashboard').setup { - theme = "doom", - config = { - header = art.misc.hydra, - center = { - { - icon = " ", - desc = "Find file", - key = "f", - action = ":cd $HOME | Telescope find_files", - }, - }, - vertical_center = true, - }, -} diff --git a/pkgs/custom-neovim/config/lua/plugins/mini/starter.lua b/pkgs/custom-neovim/config/lua/plugins/mini/starter.lua deleted file mode 100644 index c05483a..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/mini/starter.lua +++ /dev/null @@ -1,18 +0,0 @@ -local starter = require('mini.starter') -local my_items = { - { name = 'Item #1 from function', action = "echo 'Item #1'", section = '' }, - { name = [[Another item in 'Section 1']], action = 'lua print(math.random() + 10)', section = '' }, -} -starter.setup({ - evaluate_single = true, - header = table.concat(art.misc.hydra, "\n"), - footer = "", - items = my_items, - content_hooks = { - -- starter.gen_hook.adding_bullet(), - -- starter.gen_hook.indexing('all', { 'Builtin actions' }), - starter.gen_hook.aligning('center', 'center'), - starter.gen_hook.padding(0, 0), - }, -}) - -- cgit v1.2.3 From 0c3ab10a8f5587ef64476fc4cf425531df73e3d4 Mon Sep 17 00:00:00 2001 From: triethyl Date: Fri, 11 Jul 2025 10:07:40 -0400 Subject: working on custom nvim Former-commit-id: b28cf748561ffb9e66ce669dde53530ff394e4af --- pkgs/custom-neovim/config/lua/plugins/which-key.lua | 1 + 1 file changed, 1 insertion(+) create mode 100644 pkgs/custom-neovim/config/lua/plugins/which-key.lua (limited to 'pkgs/custom-neovim/config/lua') diff --git a/pkgs/custom-neovim/config/lua/plugins/which-key.lua b/pkgs/custom-neovim/config/lua/plugins/which-key.lua new file mode 100644 index 0000000..d654699 --- /dev/null +++ b/pkgs/custom-neovim/config/lua/plugins/which-key.lua @@ -0,0 +1 @@ +require("which-key").setup() -- cgit v1.2.3 From 8e2f4297ba08f945e4f78d7c3a86aa4cc1e553ed Mon Sep 17 00:00:00 2001 From: triethyl Date: Fri, 11 Jul 2025 17:01:04 -0400 Subject: working on adding snacks.nvim Former-commit-id: 4e263cc0bcc079adaa4eb9487c7c31553e186388 --- pkgs/custom-neovim/config/lua/plugins/alpha.lua | 64 ++++++++++++++++++---- .../config/lua/plugins/snacks/dashboard.lua | 1 + .../custom-neovim/config/lua/plugins/which-key.lua | 4 +- 3 files changed, 56 insertions(+), 13 deletions(-) create mode 100644 pkgs/custom-neovim/config/lua/plugins/snacks/dashboard.lua (limited to 'pkgs/custom-neovim/config/lua') diff --git a/pkgs/custom-neovim/config/lua/plugins/alpha.lua b/pkgs/custom-neovim/config/lua/plugins/alpha.lua index 42ad1e4..f377b0d 100644 --- a/pkgs/custom-neovim/config/lua/plugins/alpha.lua +++ b/pkgs/custom-neovim/config/lua/plugins/alpha.lua @@ -1,20 +1,60 @@ local alpha = require("alpha") local dashboard = require("alpha.themes.dashboard") --- Set header -dashboard.section.header.val = Art.misc.hydra +-- -- Set header +-- dashboard.section.header.val = Art.misc.hydra --- Set menu -dashboard.section.buttons.val = { - dashboard.button( "f", " > Find file", ":cd $HOME | Telescope find_files" ), - dashboard.button( "r", " > Find recent file", ":Telescope oldfiles" ), - dashboard.button( "s", " > Load session", ":Telescope persisted" ), - dashboard.button( "l", " > Load last session", ":SessionLoadLast" ), - dashboard.button( "q", " > Quit", ":qa" ), -} +-- -- Set menu +-- dashboard.section.buttons.val = { +-- dashboard.button( "f", " > Find file", ":cd $HOME | Telescope find_files" ), +-- dashboard.button( "r", " > Find recent file", ":Telescope oldfiles" ), +-- dashboard.button( "s", " > Load session", ":Telescope persisted" ), +-- dashboard.button( "l", " > Load last session", ":SessionLoadLast" ), +-- dashboard.button( "q", " > Quit", ":qa" ), +-- } + +-- -- Center components. +-- dashboard.section.header.opts.position = "center" +-- dashboard.section.footer.opts.position = "center" --- Send config to alpha -alpha.setup(dashboard.opts) +-- -- Send config to alpha +-- alpha.setup(dashboard.opts) + +require("alpha").setup { + dashboard = { + config = {}, + opts = { + autostart = true + }, + section = { + buttons = { + entries = { { "f", "󰈞 Find File", "Telescope find_files" }, { "n", " New File", "ene!" }, { "p", " Projects ", "Telescope projects" }, { "r", " Recent files", +":Telescope oldfiles " }, { "t", "󰊄 Find Text", "Telescope live_grep" }, { "c", " Configuration", "edit /home/lucas/.config/lvim/config.lua " }, { "q", "󰅖 Quit", "quit" +} }, + opts = { + hl_shortcut = "Include", + spacing = 1 + } + }, + footer = { + opts = { + hl = "Number", + position = "center" + }, + type = "text", + val = { " ", " lunarvim.org", "release-1.4/neovim-0.9-d15c8d7" } + }, + header = { + opts = { + hl = "Label", + position = "center" + }, + type = "text", + } + } + }, + mode = "dashboard", +} -- Set options just for the dashboard. vim.api.nvim_create_autocmd("BufEnter", { diff --git a/pkgs/custom-neovim/config/lua/plugins/snacks/dashboard.lua b/pkgs/custom-neovim/config/lua/plugins/snacks/dashboard.lua new file mode 100644 index 0000000..1ef8c32 --- /dev/null +++ b/pkgs/custom-neovim/config/lua/plugins/snacks/dashboard.lua @@ -0,0 +1 @@ +require("snacks").setup() diff --git a/pkgs/custom-neovim/config/lua/plugins/which-key.lua b/pkgs/custom-neovim/config/lua/plugins/which-key.lua index d654699..612af14 100644 --- a/pkgs/custom-neovim/config/lua/plugins/which-key.lua +++ b/pkgs/custom-neovim/config/lua/plugins/which-key.lua @@ -1 +1,3 @@ -require("which-key").setup() +require("which-key").setup { + preset = "modern", +} -- cgit v1.2.3 From 93291a3f4f2db070e9470fd9780b2b15ad893e17 Mon Sep 17 00:00:00 2001 From: triethyl Date: Fri, 11 Jul 2025 17:30:21 -0400 Subject: adding snacks.nvim Former-commit-id: 5174c08353def54179d8b2dbc4c8411777c5de26 --- pkgs/custom-neovim/config/lua/plugins/snacks.lua | 4 ++++ pkgs/custom-neovim/config/lua/plugins/snacks/dashboard.lua | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 pkgs/custom-neovim/config/lua/plugins/snacks.lua delete mode 100644 pkgs/custom-neovim/config/lua/plugins/snacks/dashboard.lua (limited to 'pkgs/custom-neovim/config/lua') diff --git a/pkgs/custom-neovim/config/lua/plugins/snacks.lua b/pkgs/custom-neovim/config/lua/plugins/snacks.lua new file mode 100644 index 0000000..57c3bc9 --- /dev/null +++ b/pkgs/custom-neovim/config/lua/plugins/snacks.lua @@ -0,0 +1,4 @@ +require("snacks").setup { + bigfile = { enabled = true }, + picker = { enabled = true }, +} diff --git a/pkgs/custom-neovim/config/lua/plugins/snacks/dashboard.lua b/pkgs/custom-neovim/config/lua/plugins/snacks/dashboard.lua deleted file mode 100644 index 1ef8c32..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/snacks/dashboard.lua +++ /dev/null @@ -1 +0,0 @@ -require("snacks").setup() -- cgit v1.2.3 From fd886e18472da2884ea6c593aecfbfc7bc658cbf Mon Sep 17 00:00:00 2001 From: triethyl Date: Sat, 12 Jul 2025 22:23:30 -0400 Subject: working on custom nvim Former-commit-id: 7eeb50b4c2b95b3d917b37a3a6f0b98ed7b0d077 --- pkgs/custom-neovim/config/lua/colorscheme.lua | 4 ++ pkgs/custom-neovim/config/lua/neovide.lua | 9 ++-- pkgs/custom-neovim/config/lua/plugins/snacks.lua | 56 ++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 4 deletions(-) (limited to 'pkgs/custom-neovim/config/lua') diff --git a/pkgs/custom-neovim/config/lua/colorscheme.lua b/pkgs/custom-neovim/config/lua/colorscheme.lua index 82e1420..ed03aef 100644 --- a/pkgs/custom-neovim/config/lua/colorscheme.lua +++ b/pkgs/custom-neovim/config/lua/colorscheme.lua @@ -15,6 +15,7 @@ vim.api.nvim_create_autocmd({"ColorScheme", "VimEnter"}, { if correct_borderless_windows then link_highlight("FloatBorder", "Comment") + -- Telescope-specific highlights link_highlight("TelescopeBorder", "Comment") link_highlight("TelescopeResultsTitle", "Variable") link_highlight("TelescopePreviewTitle", "Variable") @@ -22,6 +23,9 @@ vim.api.nvim_create_autocmd({"ColorScheme", "VimEnter"}, { link_highlight("TelescopePromptNormal", "Variable") link_highlight("TelescopePromptBorder", "Variable") link_highlight("TelescopePromptPrefix", "Variable") + + -- Snacks-specific highlights + link_highlight("SnacksPickerDir", "SnacksPickerFile") end end, }) diff --git a/pkgs/custom-neovim/config/lua/neovide.lua b/pkgs/custom-neovim/config/lua/neovide.lua index 0476765..dc804fc 100644 --- a/pkgs/custom-neovim/config/lua/neovide.lua +++ b/pkgs/custom-neovim/config/lua/neovide.lua @@ -1,16 +1,17 @@ if vim.g.neovide then +-- if false then vim.o.guifont = "CodeNewRoman Nerd Font:h12" - vim.g.neovide_scale_factor = 0.8 + -- vim.g.neovide_scale_factor = 0.8 -- Zoom keymaps. local change_scale_factor = function(delta) - vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * delta + vim.g.neovide_scale_factor = vim.g.neovide_scale_factor + delta end vim.keymap.set("n", "", function() - change_scale_factor(1.1) + change_scale_factor(1) end) vim.keymap.set("n", "", function() - change_scale_factor(1/1.1) + change_scale_factor(-1) end) -- Standard terminal emulator keymaps. diff --git a/pkgs/custom-neovim/config/lua/plugins/snacks.lua b/pkgs/custom-neovim/config/lua/plugins/snacks.lua index 57c3bc9..324b013 100644 --- a/pkgs/custom-neovim/config/lua/plugins/snacks.lua +++ b/pkgs/custom-neovim/config/lua/plugins/snacks.lua @@ -1,4 +1,60 @@ require("snacks").setup { bigfile = { enabled = true }, picker = { enabled = true }, + dashboard = { + width = 60, + row = nil, -- dashboard position. nil for center + col = nil, -- dashboard position. nil for center + pane_gap = 4, -- empty columns between vertical panes + autokeys = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", -- autokey sequence + -- These settings are used by some built-in sections + preset = { + -- Defaults to a picker that supports `fzf-lua`, `telescope.nvim` and `mini.pick` + ---@type fun(cmd:string, opts:table)|nil + pick = nil, + -- Used by the `keys` section to show keymaps. + -- Set your custom keymaps here. + -- When using a function, the `items` argument are the default keymaps. + ---@type snacks.dashboard.Item[] + keys = { + { icon = " ", key = "f", desc = "Find File", action = ":lua Snacks.dashboard.pick('files')" }, + { icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" }, + { icon = " ", key = "g", desc = "Find Text", action = ":lua Snacks.dashboard.pick('live_grep')" }, + { icon = " ", key = "r", desc = "Recent Files", action = ":lua Snacks.dashboard.pick('oldfiles')" }, + { icon = " ", key = "c", desc = "Config", action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})" }, + { icon = " ", key = "q", desc = "Quit", action = ":qa" }, + }, + -- Used by the `header` section + header = table.concat(Art.misc.hydra, "\n"), + }, + -- item field formatters + formats = { + icon = function(item) + if item.file and item.icon == "file" or item.icon == "directory" then + return M.icon(item.file, item.icon) + end + return { item.icon, width = 2, hl = "icon" } + end, + footer = { "%s", align = "center" }, + header = { "%s", align = "center" }, + file = function(item, ctx) + local fname = vim.fn.fnamemodify(item.file, ":~") + fname = ctx.width and #fname > ctx.width and vim.fn.pathshorten(fname) or fname + if #fname > ctx.width then + local dir = vim.fn.fnamemodify(fname, ":h") + local file = vim.fn.fnamemodify(fname, ":t") + if dir and file then + file = file:sub(-(ctx.width - #dir - 2)) + fname = dir .. "/…" .. file + end + end + local dir, file = fname:match("^(.*)/(.+)$") + return dir and { { dir .. "/", hl = "dir" }, { file, hl = "file" } } or { { fname, hl = "file" } } + end, + }, + sections = { + { section = "header" }, + { section = "keys", gap = 1, padding = 1 }, + }, + } } -- cgit v1.2.3