feat(nvim): add profile and gx

This commit is contained in:
Oliver
2025-10-24 16:21:22 +02:00
parent 54bf8fdd78
commit e55dd790eb
3 changed files with 142 additions and 0 deletions

13
nvim/lsp/luals.lua Normal file
View File

@@ -0,0 +1,13 @@
return {
cmd = { "lua-language-server" },
filetypes = { "lua" },
root_markers = { ".luarc.json", ".luarc.jsonc" },
settings = {
Lua = {
runtime = {
version = "LuaJIT",
},
signatureHelp = { enabled = true },
},
},
}

View File

@@ -0,0 +1,66 @@
return {
"chrishrb/gx.nvim",
keys = { { "gx", "<cmd>Browse<cr>", mode = { "n", "x" } } },
cmd = { "Browse" },
init = function()
vim.g.netrw_nogx = 1 -- disable netrw gx
end,
dependencies = { "nvim-lua/plenary.nvim" }, -- Required for Neovim < 0.10.0
config = true, -- default settings
submodules = false, -- not needed, submodules are required only for tests
-- -- you can specify also another config if you want
-- config = function()
-- require("gx").setup {
-- open_browser_app = "os_specific", -- specify your browser app; default for macOS is "open", Linux "xdg-open" and Windows "powershell.exe"
-- open_browser_args = { "--background" }, -- specify any arguments, such as --background for macOS' "open".
-- handlers = {
-- plugin = true, -- open plugin links in lua (e.g. packer, lazy, ..)
-- github = true, -- open github issues
-- brewfile = true, -- open Homebrew formulaes and casks
-- package_json = true, -- open dependencies from package.json
-- search = true, -- search the web/selection on the web if nothing else is found
-- go = true, -- open pkg.go.dev from an import statement (uses treesitter)
-- jira = { -- custom handler to open Jira tickets (these have higher precedence than builtin handlers)
-- name = "jira", -- set name of handler
-- handle = function(mode, line, _)
-- local ticket = require("gx.helper").find(line, mode, "(%u+-%d+)")
-- if ticket and #ticket < 20 then
-- return "http://jira.company.com/browse/" .. ticket
-- end
-- end,
-- },
-- rust = { -- custom handler to open rust's cargo packages
-- name = "rust", -- set name of handler
-- filetype = { "toml" }, -- you can also set the required filetype for this handler
-- filename = "Cargo.toml", -- or the necessary filename
-- handle = function(mode, line, _)
-- local crate = require("gx.helper").find(line, mode, "(%w+)%s-=%s")
-- if crate then
-- return "https://crates.io/crates/" .. crate
-- end
-- end,
-- },
-- },
-- handler_options = {
-- search_engine = "google", -- you can select between google, bing, duckduckgo, ecosia and yandex
-- search_engine = "https://search.brave.com/search?q=", -- or you can pass in a custom search engine
-- select_for_search = false, -- if your cursor is e.g. on a link, the pattern for the link AND for the word will always match. This disables this behaviour for default so that the link is opened without the select option for the word AND link
-- git_remotes = { "upstream", "origin" }, -- list of git remotes to search for git issue linking, in priority
-- git_remotes = function(fname) -- you can also pass in a function
-- if fname:match("myproject") then
-- return { "mygit" }
-- end
-- return { "upstream", "origin" }
-- end,
-- git_remote_push = false, -- use the push url for git issue linking,
-- git_remote_push = function(fname) -- you can also pass in a function
-- return fname:match("myproject")
-- end,
-- },
-- }
-- end,
}

View File

@@ -0,0 +1,63 @@
return {
{
"Kurama622/profile.nvim",
config = function()
local comp = require("profile.components")
require("profile").setup({
avatar_opts = {
force_blank = false,
},
disable_keys = {},
cursor_pos = { 17, 48 },
format = function()
local header = {
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⣴⣶⣶⣶⣶⣦⣤⡀⠀⠀⠀⠀]],
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⠟⠉⠉⠉⠉⠉⠛⠻⢿⣷⣄⠀⠀]],
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⣿⠟⠁⠀⠀⢠⣤⣄⠀⠀⠀⠀⠙⣿⣷⠀]],
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⠏⠀⠀⠀⠀⠘⠻⠋⠀⠀⠀⠀⠀⢸⣿⡇]],
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⣿⡏⠀⠀⣀⣀⣀⣠⣤⣤⣤⣤⣿⣄⠀⢠⣿⣧]],
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⣿⠀⠀⠀⠈⠻⣿⣶⠶⣶⣤⣤⣜⣿⣦⡈⢿⣿]],
[[⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⠀⠀⠀⠀⠀⠈⠙⠻⢶⣤⣭⣛⣿⣿⣷⣼⣿]],
[[⠀⠀⠀⠀⠀⣰⣶⣾⠿⠿⢿⣷⣶⣄⠀⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠙⠛⠛⢛⣿⣿]],
[[⠀⠀⠀⠀⠀⢹⣿⣆⠀⠀⠀⠈⠻⢿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⡏]],
[[⠀⠀⠀⠀⠀⣸⣿⣿⠀⠀⠀⠀⠀⠀⢀⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⠀]],
[[⠀⠀⠀⢀⣾⣿⣿⡇⠀⠀⠀⠀⠀⠀⢸⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⡇⠀]],
[[⠀⠀⠀⣼⣿⠃⠹⣿⣷⣄⠀⠀⠀⠀⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⠇⠀]],
[[⠀⠀⠀⣿⡿⠀⠀⠈⠻⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⠀⠀]],
[[⠀⠀⢸⣿⣧⠀⠀⠀⠀⠸⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡷⠀⠀]],
[[⠀⠀⠈⣿⣿⡄⠀⠀⠀⠀⢻⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣿⡀⠀]],
[[⠀⠀⠀⣿⣿⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣧⠀]],
[[⠀⠀⠀⢻⣿⡟⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⣿⡇]],
[[⠀⠀⠀⠘⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⡿]],
[[⠀⠀⠀⣤⣸⣿⣿⡷⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⠃]],
[[⠀⠀⠘⣿⡿⠿⣿⣿⣿⣷⡶⢶⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⠏⠀]],
[[⠀⠀⢀⣿⡟⠀⠀⠀⠀⠀⠀⠈⣿⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⡿⠟⠉⠀⠀]],
[[⠀⠀⣼⣿⠇⠀⣴⣄⠀⠀⠀⠀⢹⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣶⣿⠟⠁⠀⠀⠀⠀]],
[[⢀⣼⣿⠋⠀⠀⠘⣿⣧⠀⠀⠀⢸⣿⣧⣄⣀⠀⠀⠀⢀⣀⣤⣶⣿⣿⠋⠁⠀⠀⠀⠀⠀⠀]],
[[⢾⣯⣁⠀⠀⠀⠀⠈⢿⡄⠀⠀⣸⡿⠉⠙⠛⠛⠛⠛⢻⣿⡏⢹⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀]],
[[⠀⠛⢿⣷⣦⣤⣀⡀⠀⠀⠀⣠⣿⣷⣶⣶⣶⣶⣶⣦⣤⣿⣿⡜⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀]],
[[⠀⠀⠀⠈⠙⠛⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⢻⡿⣷⣶⣤⣀⠀⠀⠀⠀]],
[[⠀⠀⠀⠀⠀⠀⠸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣏⣁⡸⠟⠈⣩⣿⣿⣿⠶⠀⠀]],
[[⠀⠀⠀⣠⣴⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣿⠟⠋⠁⠀⠀⠀⠀]],
[[⠀⠀⠀⠙⠿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠋⠉⠀⠀⠀⠀⠀⠀⠀⠀]],
[[⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]],
[[ WADDLE WADDLE WADDLE ]],
}
for _, line in ipairs(header) do
comp:text_component_render({ comp:text_component(line, "center", "ProfileBlue") })
end
comp:separator_render()
handle = io.popen("curl -s -m 3 https://vtip.43z.one")
result = handle:read("*a")
handle:close()
comp:text_component_render({
comp:text_component("Neovim Tip of the Day:", "center", "ProfileGreen"),
comp:text_component(result or "Could not fetch tip.", "center", "ProfileGreen"),
})
end,
})
vim.api.nvim_set_keymap("n", "<leader>p", "<cmd>Profile<cr>", { silent = true })
end,
},
}