feat: random beautification

This commit is contained in:
Oliver Ladner 2025-05-04 13:11:56 +02:00
commit 9660893b91
15 changed files with 348 additions and 246 deletions

8
lsp/bicep.lua Normal file
View file

@ -0,0 +1,8 @@
---@type vim.lsp.Config
local bicep_lsp_bin = "/Users/oliver.ladner/bicep-langserver/Bicep.LangServer.dll"
return {
cmd = { "/opt/homebrew/opt/dotnet@8/libexec/dotnet", bicep_lsp_bin },
root_markers = { ".git" },
filetypes = { "bicep" },
}

7
lsp/docker-compose.lua Normal file
View file

@ -0,0 +1,7 @@
---@type vim.lsp.Config
return {
cmd = { "docker-compose-langserver", "--stdio" },
root_markers = { "docker_compose*.yml", "docker-compose.yml" },
filetypes = { "yaml.docker-compose" },
single_file_support = true,
}

5
lsp/woke.lua Normal file
View file

@ -0,0 +1,5 @@
---@type vim.lsp.Config
return {
cmd = { "woke", "--stdin" },
filetypes = { "markdown", "text", "gitcommit", "plaintext" },
}

6
lsp/write-good.lua Normal file
View file

@ -0,0 +1,6 @@
---@type vim.lsp.Config
return {
cmd = { "write-good", "/dev/stdin" },
-- root_markers = { ".md" },
filetypes = { "markdown", "text", "gitcommit" },
}

View file

@ -1,6 +1,7 @@
return { return {
"mfussenegger/nvim-lint", "mfussenegger/nvim-lint",
event = { "BufReadPre", "BufNewFile" }, -- event = { "BufReadPre", "BufNewFile" },
event = "VeryLazy",
config = function() config = function()
local lint = require("lint") local lint = require("lint")
@ -13,13 +14,14 @@ return {
python = { "pylint" }, python = { "pylint" },
ansible = { "woke" }, ansible = { "woke" },
markdown = { "woke" }, markdown = { "woke" },
text = { "woke" },
sh = { "woke" }, sh = { "woke" },
} }
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) -- local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, { vim.api.nvim_create_autocmd({ "BufEnter", "BufReadPost", "BufWritePost", "InsertLeave" }, {
group = lint_augroup, -- group = lint_augroup,
callback = function() callback = function()
lint.try_lint() lint.try_lint()
end, end,

View file

@ -37,7 +37,7 @@ return {
options = { options = {
globalstatus = false, -- true == single statusline globalstatus = false, -- true == single statusline
icons_enabled = true, icons_enabled = true,
theme = "auto", theme = "rose-pine",
component_separators = "", component_separators = "",
--section_separators = { left = "", right = "" }, --section_separators = { left = "", right = "" },
section_separators = { left = "", right = "" }, section_separators = { left = "", right = "" },
@ -69,10 +69,23 @@ return {
lualine_x = { lualine_x = {
-- specify full list of elements when adding custom things -- specify full list of elements when adding custom things
{ "encoding", cond = hide_in_width }, { "encoding", cond = hide_in_width },
{ "fileformat" }, { "fileformat", cond = hide_in_width },
{ "filetype", cond = hide_in_width }, { "filetype" },
{ lsp_client_name, cond = hide_in_width }, { lsp_client_name, cond = hide_in_width },
--{ clock, cond = hide_in_width }, --{ clock, cond = hide_in_width },
function()
local ok, pomo = pcall(require, "pomo")
if not ok then
return ""
end
local timer = pomo.get_first_to_finish()
if timer == nil then
return ""
end
return "󰄉 " .. tostring(timer)
end,
}, },
}, },
}, },

View file

@ -3,7 +3,20 @@ return {
"echasnovski/mini.nvim", "echasnovski/mini.nvim",
version = false, version = false,
config = function() config = function()
local icons = require("mini.icons") require("mini.icons").setup()
icons.setup({}) require("mini.surround").setup({
mappings = {
add = "wq", -- Add surrounding in Normal and Visual modes
delete = "wd", -- Delete surrounding
-- find = "sf", -- Find surrounding (to the right)
-- find_left = "sF", -- Find surrounding (to the left)
highlight = "hs", -- Highlight surrounding
replace = "wc", -- Replace surrounding
-- update_n_lines = "sn", -- Update `n_lines`
-- suffix_last = "l", -- Suffix to search with "prev" method
-- suffix_next = "n", -- Suffix to search with "next" method
},
})
end, end,
} }

View file

@ -5,14 +5,12 @@ return {
lazy = true, lazy = true,
cmd = "Oil", cmd = "Oil",
config = function() config = function()
local oil = require("oil") require("oil").setup({
oil.setup({
-- Leave netrw there, so we can open link with `gx`
--default_file_explorer = false,
default_file_explorer = true, default_file_explorer = true,
columns = { columns = {
-- "size", -- "size",
"icon", "icon",
-- "mtime",
}, },
view_options = { view_options = {
show_hidden = true, show_hidden = true,
@ -24,6 +22,7 @@ return {
["<C-x>"] = "actions.select_split", ["<C-x>"] = "actions.select_split",
["<C-c>"] = "actions.close", ["<C-c>"] = "actions.close",
["q"] = "actions.close", ["q"] = "actions.close",
["<Esc>"] = "actions.close",
}, },
float = { float = {

View file

@ -0,0 +1,10 @@
return {
"epwalsh/pomo.nvim",
version = "*", -- Recommended, use latest release instead of latest commit
lazy = true,
cmd = { "TimerStart", "TimerRepeat", "TimerSession" },
opts = {
-- See below for full list of options 👇
update_interval = 20000,
},
}

View file

@ -3,7 +3,7 @@ return {
lazy = true, lazy = true,
--event = "VeryLazy", --event = "VeryLazy",
cmd = "Telescope", cmd = "Telescope",
tag = "0.1.5", tag = "0.1.8",
dependencies = { dependencies = {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
}, },
@ -14,6 +14,7 @@ return {
--telescope.load_extension("file_browser") --telescope.load_extension("file_browser")
telescope.setup({ telescope.setup({
defaults = { defaults = {
border = false,
sorting_strategy = "ascending", sorting_strategy = "ascending",
wrap_result = true, wrap_result = true,
layout_strategy = "horizontal", layout_strategy = "horizontal",

View file

@ -3,57 +3,57 @@ return {
name = "catppuccin", name = "catppuccin",
tag = "stable", tag = "stable",
lazy = false, lazy = false,
enabled = false, enabled = true,
priority = 1000, priority = 1000,
opts = {}, opts = {},
-- config = function() config = function()
-- local tokyonight = require("tokyonight") require("catppuccin").setup({
-- local util = require("tokyonight.util") flavour = "auto", -- latte, frappe, macchiato, mocha
-- tokyonight.setup({ background = { -- :h background
-- styles = { light = "latte",
-- comments = { italic = true }, dark = "mocha",
-- }, },
-- on_colors = function(colors) transparent_background = false, -- disables setting the background color.
-- -- Brighten up comments a bit show_end_of_buffer = false, -- shows the '~' characters after the end of buffers
-- colors.comment = "#888fac" term_colors = false, -- sets terminal colors (e.g. `g:terminal_color_0`)
-- -- Better visible visual selection background color dim_inactive = {
-- colors.bg_visual = "#e82a86" enabled = false, -- dims the background color of inactive window
-- end, shade = "dark",
-- on_highlights = function(hl, c) percentage = 0.15, -- percentage of the shade to apply to the inactive window
-- -- Brighter line numbers },
-- hl.LineNr = { no_italic = false, -- Force no italic
-- fg = util.darken(c.dark5, 0.6), no_bold = false, -- Force no bold
-- } no_underline = false, -- Force no underline
-- -- Remove borders from Telescope windows styles = { -- Handles the styles of general hi groups (see `:h highlight-args`):
-- local prompt = "#4e3e6c" comments = { "italic" }, -- Change the style of comments
-- hl.TelescopeNormal = { conditionals = { "italic" },
-- bg = c.bg_dark, loops = {},
-- fg = c.fg_dark, functions = {},
-- } keywords = {},
-- hl.TelescopeBorder = { strings = {},
-- bg = c.bg_dark, variables = {},
-- fg = c.bg_dark, numbers = {},
-- } booleans = {},
-- hl.TelescopePromptNormal = { properties = {},
-- bg = prompt, types = {},
-- } operators = {},
-- hl.TelescopePromptBorder = { -- miscs = {}, -- Uncomment to turn off hard-coded styles
-- bg = prompt, },
-- fg = prompt, color_overrides = {},
-- } custom_highlights = {},
-- hl.TelescopePromptTitle = { default_integrations = true,
-- bg = prompt, integrations = {
-- fg = prompt, cmp = true,
-- } gitsigns = true,
-- hl.TelescopePreviewTitle = { nvimtree = true,
-- bg = c.bg_dark, treesitter = true,
-- fg = c.bg_dark, notify = false,
-- } mini = {
-- hl.TelescopeResultsTitle = { enabled = true,
-- bg = c.bg_dark, indentscope_color = "",
-- fg = c.bg_dark, },
-- } -- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations)
-- end, },
-- }) })
-- end, end,
} }

View file

@ -0,0 +1,18 @@
return {
"rebelot/kanagawa.nvim",
name = "kanagawa",
branch = "master",
lazy = false,
enabled = false,
priority = 1000,
opts = {},
config = function()
require("kanagawa").setup({
theme = "lotus", -- Load "wave" theme
background = { -- map the value of 'background' option to a theme
dark = "wave", -- try "dragon" !
light = "lotus",
},
})
end,
}

View file

@ -21,6 +21,23 @@ return {
styles = { styles = {
transparency = false, transparency = false,
}, },
highlight_groups = {
-- TelescopeResultsNormal = { fg = "subtle", bg = "none" },
TelescopeBorder = { fg = "overlay", bg = "overlay" },
TelescopeNormal = { fg = "subtle", bg = "overlay" },
TelescopeSelection = { fg = "text", bg = "highlight_med" },
-- TelescopeSelectionCaret = { fg = "love", bg = "highlight_med" },
TelescopeSelectionCaret = { fg = "rose", bg = "rose" },
TelescopeMultiSelection = { fg = "text", bg = "highlight_high" },
TelescopeTitle = { fg = "base", bg = "love" },
TelescopePromptTitle = { fg = "base", bg = "pine" },
TelescopePreviewTitle = { fg = "base", bg = "iris" },
TelescopePromptNormal = { fg = "text", bg = "surface" },
TelescopePromptBorder = { fg = "surface", bg = "surface" },
},
}) })
end, end,
} }

View file

@ -10,6 +10,7 @@ vim.lsp.enable({
"woke", "woke",
"tailwind", "tailwind",
"docker-compose", "docker-compose",
"bicep",
}) })
-- Set highlight on search -- Set highlight on search

View file

@ -1,4 +1,5 @@
-- keyboard shortcuts -- keyboard shortcuts
--
-- Leader key. Base for any key combo -- Leader key. Base for any key combo
vim.g.mapleader = ";" vim.g.mapleader = ";"
@ -43,13 +44,8 @@ vim.keymap.set("n", "<leader>gd", function()
else else
vim.cmd("DiffviewClose") vim.cmd("DiffviewClose")
end end
end, { noremap = true, desc = "Toggle diff/stage UI " }) end, { noremap = true, desc = "Git diff/stage" })
vim.keymap.set( vim.keymap.set("n", "<leader>gb", ":Gitsigns toggle_current_line_blame<CR>", { noremap = true, desc = "Git blame" })
"n",
"<leader>gb",
":Gitsigns toggle_current_line_blame<CR>",
{ noremap = true, desc = "Toggle git blame" }
)
-- Remapping of existing Vim key binds -- Remapping of existing Vim key binds
vim.keymap.set("n", "w", "W") -- skip punctuation when moving to start of next word vim.keymap.set("n", "w", "W") -- skip punctuation when moving to start of next word
@ -65,12 +61,12 @@ vim.keymap.set("n", "<C-d>", "<C-d>zz") -- eye-friendly down scrolling
vim.keymap.set("n", "<C-u>", "<C-u>zz") -- eye-friendly up scrolling vim.keymap.set("n", "<C-u>", "<C-u>zz") -- eye-friendly up scrolling
vim.keymap.set("n", "J", "mzJ`z") -- when merging lines, keep cursor at current position vim.keymap.set("n", "J", "mzJ`z") -- when merging lines, keep cursor at current position
vim.keymap.set( -- vim.keymap.set(
"n", -- "n",
"<leader>s", -- "<leader>s",
[[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]], -- [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]],
{ noremap = true, desc = "Replace word below cursor" } -- { noremap = true, desc = "Replace word below cursor" }
) -- )
-- Apply conform.nvim formatting on keypress (same as on save) -- Apply conform.nvim formatting on keypress (same as on save)
vim.keymap.set({ "n", "v" }, "<leader>o", function() vim.keymap.set({ "n", "v" }, "<leader>o", function()
@ -83,19 +79,19 @@ vim.keymap.set({ "n", "v" }, "<leader>o", function()
end, { desc = "Format file or range (in visual mode)" }) end, { desc = "Format file or range (in visual mode)" })
-- Go to next diagnostic item (any severity) -- Go to next diagnostic item (any severity)
vim.keymap.set({ "n", "v" }, "<leader>da", function() vim.keymap.set("n", "<leader>da", function()
vim.diagnostic.get_next({}) vim.diagnostic.get_next({})
vim.api.nvim_feedkeys("zz", "n", false) vim.api.nvim_feedkeys("zz", "n", false)
end, { desc = "Go to next diagnostic" }) end, { desc = "Go to next diagnostic" })
-- Go to next diagnostic item (error severity) -- Go to next diagnostic item (error severity)
vim.keymap.set({ "n", "v" }, "<leader>de", function() vim.keymap.set("n", "<leader>de", function()
vim.diagnostic.get_next({ severity = vim.diagnostic.severity.ERROR }) vim.diagnostic.get_next({ severity = vim.diagnostic.severity.ERROR })
vim.api.nvim_feedkeys("zz", "n", false) vim.api.nvim_feedkeys("zz", "n", false)
end, { desc = "Go to next error diagnostic" }) end, { desc = "Go to next error diagnostic" })
-- Go to next diagnostic item (warning severity) -- Go to next diagnostic item (warning severity)
vim.keymap.set({ "n", "v" }, "<leader>dw", function() vim.keymap.set("n", "<leader>dw", function()
vim.diagnostic.get_next({ severity = vim.diagnostic.severity.WARN }) vim.diagnostic.get_next({ severity = vim.diagnostic.severity.WARN })
vim.api.nvim_feedkeys("zz", "n", false) vim.api.nvim_feedkeys("zz", "n", false)
end, { desc = "Go to next warning diagnostic" }) end, { desc = "Go to next warning diagnostic" })
@ -114,3 +110,9 @@ vim.keymap.set("n", "<leader>tdd", function()
virtual_text = not vim.diagnostic.config().virtual_text, virtual_text = not vim.diagnostic.config().virtual_text,
}) })
end, { desc = "Toggle diagnostic virtual lines and virtual text" }) end, { desc = "Toggle diagnostic virtual lines and virtual text" })
-- Enclose word with double quotes
-- vim.keymap.set("n", "<leader>wq", 'ciw""<Esc>P', { desc = "Enclose in double quotes" })
-- Pomodoro timer
vim.keymap.set("n", "<leader>p", ":TimerStart 30m<CR>", { desc = "Pomodoro" })