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 --- .../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 + 5 files changed, 98 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/plugins') 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() -- 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/plugins/lualine.lua | 99 ++++++++++++++++++++++- 1 file changed, 98 insertions(+), 1 deletion(-) (limited to 'pkgs/custom-neovim/config/lua/plugins') 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/plugins/lualine.lua | 154 ++++++++++------------ pkgs/custom-neovim/config/lua/plugins/tabby.lua | 56 +++++++- 2 files changed, 126 insertions(+), 84 deletions(-) (limited to 'pkgs/custom-neovim/config/lua/plugins') 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, +}) -- 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/plugins/alpha.lua | 21 +++++++++++++++++++++ pkgs/custom-neovim/config/lua/plugins/tabby.lua | 1 - 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 pkgs/custom-neovim/config/lua/plugins/alpha.lua (limited to 'pkgs/custom-neovim/config/lua/plugins') 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/plugins/alpha.lua | 26 ++++++++++++++++------ .../config/lua/plugins/mini/starter.lua | 1 + 2 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 pkgs/custom-neovim/config/lua/plugins/mini/starter.lua (limited to 'pkgs/custom-neovim/config/lua/plugins') 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/plugins/dashboard.lua | 3 +++ pkgs/custom-neovim/config/lua/plugins/mini/starter.lua | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 pkgs/custom-neovim/config/lua/plugins/dashboard.lua (limited to 'pkgs/custom-neovim/config/lua/plugins') 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/plugins/alpha.lua | 13 +++---------- pkgs/custom-neovim/config/lua/plugins/dashboard.lua | 14 +++++++++++++- pkgs/custom-neovim/config/lua/plugins/persisted.lua | 3 +++ 3 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 pkgs/custom-neovim/config/lua/plugins/persisted.lua (limited to 'pkgs/custom-neovim/config/lua/plugins') 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/plugins/alpha.lua | 9 +++++---- pkgs/custom-neovim/config/lua/plugins/lspconfig.lua | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'pkgs/custom-neovim/config/lua/plugins') 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/plugins/alpha.lua | 3 ++- pkgs/custom-neovim/config/lua/plugins/dashboard.lua | 15 --------------- pkgs/custom-neovim/config/lua/plugins/mini/starter.lua | 18 ------------------ 3 files changed, 2 insertions(+), 34 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/plugins') 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/plugins') 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/plugins') 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/plugins') 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/plugins/snacks.lua | 56 ++++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'pkgs/custom-neovim/config/lua/plugins') 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