+/config

my dotfiles and nix configuration

git clone https://git.julia.blue/+/config

Julia RyanStart reworking musicd8b84e8

main
3.4 KiB92 linesraw
1require("catppuccin").setup {
2    flavour = "mocha",
3    -- stylua: ignore
4    integrations = {
5        fidget = true, hop = true, notify = true,
6        treesitter = true, which_key = true, nvim_surround = true
7    },
8    color_overrides = {
9        -- mocha = { base = "#000000", mantle = "#000000", crust = "#000000" },
10    },
11    custom_highlights = function(c)
12        return {
13            StatusLine = { fg = c.base, bg = c.blue, bold = true },
14            StatusLineModified = { fg = c.base, bg = c.mauve, bold = true },
15
16            SignColumn = { bg = c.surface0 },
17            GitSignsAdd = { fg = c.green, bg = c.surface0 },
18            GitSignsChange = { fg = c.yellow, bg = c.surface0 },
19            GitSignsDelete = { fg = c.red, bg = c.surface0 },
20            DiagnosticSignError = { fg = c.red, bg = c.surface0 },
21            DiagnosticSignWarn = { fg = c.yellow, bg = c.surface0 },
22            DiagnosticSignInfo = { fg = c.sky, bg = c.surface0 },
23            DiagnosticSignHint = { fg = c.teal, bg = c.surface0 },
24            DapBreakpoint = { fg = c.red, bg = c.surface0 },
25            DapBreakpointCondition = { fg = c.yellow, bg = c.surface0 },
26            DapBreakpointRejected = { fg = c.mauve, bg = c.surface0 },
27            DapLogPoint = { fg = c.sky, bg = c.surface0 },
28            DapStopped = { fg = c.maroon, bg = c.surface0 },
29
30            TrailingWhitespace = { fg = c.maroon, reverse = true },
31        }
32    end,
33}
34
35vim.cmd [[colorscheme catppuccin]]
36
37MyFoldText = function()
38    -- stylua: ignore
39    return vim.fn.getline(vim.v.foldstart) .. "    ("
40        .. (vim.v.foldend - vim.v.foldstart) .. " lines) "
41end
42vim.opt.foldtext = "v:lua.MyFoldText()"
43
44require("image").setup()
45require("colorizer").setup { user_default_options = { names = false } }
46require("gitsigns").setup { current_line_blame_opts = { delay = 500 } }
47vim.api.nvim_create_user_command("Dismiss", require("notify").dismiss, {})
48local notify = require "notify"
49notify.setup { render = "compact", background_colour = "#000000" }
50vim.notify = notify
51require("fidget").setup { notification = { window = { winblend = 0 } } }
52require("dressing").setup {}
53
54local pretty = vim.api.nvim_create_augroup("pretty", {})
55local autocmd = function(event, f)
56    vim.api.nvim_create_autocmd(event, { group = pretty, callback = f })
57end
58
59-- highlight on yank
60autocmd("TextYankPost", function() vim.highlight.on_yank { timeout = 150 } end)
61
62-- highlight lsp references
63autocmd({ "CursorHold", "CursorHoldI" }, function()
64    for _, c in pairs(vim.lsp.get_clients()) do
65        if c.supports_method "textDocument/documentHighlight" then
66            vim.lsp.buf.document_highlight()
67        end
68    end
69end)
70autocmd({ "CursorMoved", "CursorMovedI" }, vim.lsp.buf.clear_references)
71
72-- trim whitespace when saving
73autocmd("BufWritePre", function()
74    G.inplace(function() vim.cmd [[keeppatterns %s_\s\+$__e]] end)
75end)
76
77-- highlight trailing whitespace
78local ft_exclude = G.makeset { "lspinfo", "diff", "man", "checkhealth" }
79local buftype_exclude = G.makeset { "terminal", "help", "nofile", "prompt", "quickfix" }
80local pat = "\\s\\+$"
81autocmd({ "BufEnter", "TextChanged", "BufModifiedSet" }, function()
82    if
83        not vim.opt.modifiable:get()
84        or buftype_exclude[vim.bo.buftype]
85        or ft_exclude[vim.bo.filetype]
86        or vim.api.nvim_win_get_config(0).relative ~= ""
87        or G.inplace(function() return vim.fn.search(pat) == 0 end)
88    then
89        return
90    end
91    vim.fn.matchadd("TrailingWhitespace", pat)
92end)