feat(nvim): notify, gitsigns, pre-commit, lazy types

This commit is contained in:
winston 2023-05-14 13:40:39 +02:00
parent c6ff52199a
commit 576989abe8
Signed by: winston
GPG key ID: 3786770EDBC2B481
27 changed files with 94 additions and 86 deletions

14
.luacheckrc Normal file
View file

@ -0,0 +1,14 @@
---@diagnostic disable: undefined-global
files["home/apps/neovim"] = {
globals = { "vim" },
std = "lua51+luajit",
}
return {
exclude_files = {
".direnv/*",
"result/*",
},
max_line_length = false,
}

View file

@ -162,20 +162,17 @@
alejandra.enable = true;
commitizen.enable = true;
editorconfig-checker.enable = true;
nil.enable = true;
shellcheck.enable = true;
stylua.enable = true;
flake-check = {
enable = false;
enable = true;
types = ["nix"];
language = "system";
entry = "just check";
pass_filenames = false;
};
};
settings.deadnix = {
noLambdaPatternNames = true;
noLambdaArg = true;
luacheck.enable = true;
nil.enable = true;
shellcheck.enable = true;
stylua.enable = true;
};
};
};

View file

@ -0,0 +1,4 @@
{
"Lua.runtime.version": "Lua 5.1",
"$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json"
}

View file

@ -23,7 +23,7 @@
"guihua.lua": { "branch": "master", "commit": "ab8b1f09603cc268770efd057115035dc6cfa83d" },
"headlines.nvim": { "branch": "master", "commit": "ddef41b2664f0ce25fe76520d708e2dc9dfebd70" },
"indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" },
"lazy.nvim": { "branch": "main", "commit": "652b6febf8d5c99eb8cf4a1cec63da6db62e77d2" },
"lazy.nvim": { "branch": "main", "commit": "aba872ec78ffe7f7367764ab0fff6f0170421fde" },
"lightspeed.nvim": { "branch": "main", "commit": "299eefa6a9e2d881f1194587c573dad619fdb96f" },
"lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" },
"lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" },
@ -37,14 +37,15 @@
"nvim-cmp": { "branch": "main", "commit": "d153771162bd9795d9f7142df5c674b61066a585" },
"nvim-colorizer.lua": { "branch": "master", "commit": "dde3084106a70b9a79d48f426f6d6fec6fd203f7" },
"nvim-dap": { "branch": "master", "commit": "6cedcb527e264c8f25e86afa8dae74c6692dee51" },
"nvim-dap-ui": { "branch": "master", "commit": "078972d39338a49ec13fc43a44e235cc43189276" },
"nvim-dap-ui": { "branch": "master", "commit": "4ce7b97dd8f50b4f672948a34bf8f3a56214fdb8" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "ab988dbb7d20cdaebf9b3ef7554a89f6895de042" },
"nvim-lspconfig": { "branch": "master", "commit": "df58d91c9351a9dc5be6cf8d54f49ab0d9a64e73" },
"nvim-navic": { "branch": "master", "commit": "15704c607569d6c5cfeab486d3ef9459645a70ce" },
"nvim-notify": { "branch": "master", "commit": "f3024b912073774111202f5fa6518b0cd2a74432" },
"nvim-spectre": { "branch": "master", "commit": "1abe23ec9b7bc3082164f4cb842d521ef70e080e" },
"nvim-surround": { "branch": "main", "commit": "219bd66585aa467b1c90fd01b54a2a423aaed4ab" },
"nvim-tree.lua": { "branch": "master", "commit": "270c95556cad96d18ca547d86ae65927334b108b" },
"nvim-treesitter": { "branch": "master", "commit": "ec0d0ffe51fab458a346b8a8d6f9d69490f3d7e1" },
"nvim-tree.lua": { "branch": "master", "commit": "89816ace70642e9d3db0dab3dc68918f8979ec31" },
"nvim-treesitter": { "branch": "master", "commit": "680807fa6a482c639119098bc48ca3831c66db13" },
"nvim-ts-autotag": { "branch": "main", "commit": "40615e96075c743ef47aaf9de966dc348bec6459" },
"nvim-ts-rainbow2": { "branch": "master", "commit": "1ffe68cdd594633dfee0762feebfef81ed6f1fbb" },
"nvim-web-devicons": { "branch": "master", "commit": "986875b7364095d6535e28bd4aac3a9357e91bbe" },
@ -66,7 +67,7 @@
"vim-astro": { "branch": "main", "commit": "34732be5e9a5c28c2409f4490edf92d46d8b55a9" },
"vim-dadbod": { "branch": "master", "commit": "3f57c0cd41523423fd781422dfc833820095a3e8" },
"vim-dadbod-completion": { "branch": "master", "commit": "fc7321a17f4c55db11fae89a884ddf4724020bae" },
"vim-dadbod-ui": { "branch": "master", "commit": "4c306bef457ebfdbe71c76b49672d48ef310ddd3" },
"vim-dadbod-ui": { "branch": "master", "commit": "5f6a11d80128e05fcc8e5d5025b8acf6d77faa99" },
"vim-fugitive": { "branch": "master", "commit": "5f0d280b517cacb16f59316659966c7ca5e2bea2" },
"vim-gnupg": { "branch": "main", "commit": "f9b608f29003dfde6450931dc0f495a912973a88" },
"vim-helm": { "branch": "master", "commit": "c2e7b85711d410e1d73e64eb5df7b70b1c4c10eb" },

View file

@ -1,3 +1,4 @@
---@type LazyPluginSpec[]
return {
{
"goolord/alpha-nvim",

View file

@ -1,3 +1,4 @@
---@type LazyPluginSpec[]
return {
{
"f-person/auto-dark-mode.nvim",

View file

@ -1,3 +1,4 @@
---@type LazyPluginSpec[]
return {
{
"windwp/nvim-autopairs",

View file

@ -1,3 +1,4 @@
---@type LazyPluginSpec[]
return {
{
"akinsho/bufferline.nvim",

View file

@ -1,3 +1,4 @@
---@type LazySpec[]
return {
{
"catppuccin/nvim",
@ -50,6 +51,7 @@ return {
symbols_outline = true,
ts_rainbow = true,
vimwiki = true,
notify = true,
},
highlight_overrides = {
all = function(colors)

View file

@ -1,3 +1,4 @@
---@type LazyPluginSpec[]
return {
{
"nvchad/nvim-colorizer.lua",

View file

@ -1,3 +1,4 @@
---@type LazyPluginSpec[]
return {
{
"zbirenbaum/copilot.lua",

View file

@ -1,3 +1,4 @@
---@type LazyPluginSpec[]
return {
"tpope/vim-dadbod",
"kristijanhusak/vim-dadbod-completion",

View file

@ -1,6 +1,5 @@
---@type LazyPluginSpec[]
return {
-- TODO: remove in nvim 0.9 because of upstream merge
"luukvbaal/stabilize.nvim",
-- zen mode
"pocco81/true-zen.nvim",
-- respect project settings

View file

@ -1,3 +1,4 @@
---@type LazyPluginSpec[]
return {
{
"j-hui/fidget.nvim",

View file

@ -1,3 +1,4 @@
---@type LazyPluginSpec[]
return {
"tpope/vim-fugitive",
{
@ -25,7 +26,7 @@ return {
local gs = require("gitsigns")
gs.setup({
on_attach = function(bufnr)
on_attach = function(_)
-- Gitsigns
wk.register({
["<leader>h"] = {
@ -98,67 +99,8 @@ return {
["ih"] = { ":<C-U>Gitsigns select_hunk<CR>", "Select inside Hunk" },
}, { mode = { "o", "x" } })
end,
signs = {
add = {
hl = "GitSignsAdd",
text = "+",
numhl = "GitSignsAddNr",
linehl = "GitSignsAddLn",
},
change = {
hl = "GitSignsChange",
text = "~",
numhl = "GitSignsChangeNr",
linehl = "GitSignsChangeLn",
},
delete = {
hl = "GitSignsDelete",
text = "_",
numhl = "GitSignsDeleteNr",
linehl = "GitSignsDeleteLn",
},
topdelete = {
hl = "GitSignsDelete",
text = "",
numhl = "GitSignsDeleteNr",
linehl = "GitSignsDeleteLn",
},
changedelete = {
hl = "GitSignsChange",
text = "x",
numhl = "GitSignsChangeNr",
linehl = "GitSignsChangeLn",
},
},
linehl = false,
numhl = false,
signcolumn = true,
word_diff = false,
watch_gitdir = { enable = false, interval = 1000, follow_files = true },
attach_to_untracked = true,
-- current line highlighting
current_line_blame = false,
current_line_blame_opts = {
delay = 1000,
ignore_whitespace = true,
virt_text = true,
virt_text_pos = "eol",
},
current_line_blame = true,
current_line_blame_formatter = "<author>, <author_time:%R> - <summary> | <abbrev_sha>",
-- perf
max_file_length = 40000,
sign_priority = 6,
update_debounce = 100,
-- use the included status formatter
status_formatter = nil,
preview_config = {
border = "single",
style = "minimal",
relative = "cursor",
row = 0,
col = 1,
},
yadm = { enable = false },
})
end,
},

View file

@ -1,3 +1,4 @@
---@type LazyPluginSpec[]
return {
{
"lukas-reineke/indent-blankline.nvim",

View file

@ -1,3 +1,4 @@
---@type LazyPluginSpec[]
return {
{
"neovim/nvim-lspconfig",

View file

@ -1,3 +1,4 @@
---@type LazyPluginSpec[]
return {
{
"nvim-lualine/lualine.nvim",

View file

@ -1,3 +1,4 @@
---@type LazyPluginSpec[]
return {
{
"dhruvasagar/vim-table-mode",

View file

@ -1,3 +1,4 @@
---@type LazyPluginSpec[]
return {
{
"nvim-neorg/neorg",

View file

@ -0,0 +1,25 @@
---@type LazyPluginSpec[]
return {
{
"rcarriga/nvim-notify",
config = function()
local notify = require("notify")
local stages = require("notify.stages.static")("top_down")
notify.setup({
background_colour = "#000000",
delay = 5000,
stages = {
function(...)
local opts = stages[1](...)
if opts then
opts.border = "double"
end
return opts
end,
unpack(stages, 2),
},
})
vim.notify = notify
end,
},
}

View file

@ -1,3 +1,4 @@
---@type LazyPluginSpec[]
return {
{
"nvim-tree/nvim-tree.lua",

View file

@ -1,3 +1,4 @@
---@type LazyPluginSpec[]
return {
{
"andweeb/presence.nvim",
@ -5,7 +6,7 @@ return {
config = function()
local presence = require("presence")
function string.starts(self, str)
local function starts_with(self, str)
return self:find("^" .. str) ~= nil
end
@ -22,7 +23,7 @@ return {
local conceal = function(activity, info)
local cur_file = vim.fn.expand("%:p")
for k, v in pairs(blacklist) do
if cur_file:starts(k) then
if starts_with(cur_file, k) then
return v
end
end
@ -42,7 +43,7 @@ return {
-- Main image display (either "neovim" or "file")
main_image = "file",
show_time = false,
buttons = function(buffer, repo_url)
buttons = function(_, repo_url)
local concealed = conceal()
if concealed then
return {

View file

@ -1,3 +1,4 @@
---@type LazyPluginSpec[]
return {
{
"nvim-pack/nvim-spectre",

View file

@ -1,3 +1,4 @@
---@type LazySpec[]
return {
{
{
@ -9,6 +10,7 @@ return {
pcall(telescope.load_extension, "asynctasks")
pcall(telescope.load_extension, "file_browser")
pcall(telescope.load_extension, "project")
pcall(telescope.load_extension, "notify")
telescope.setup({
defaults = {
@ -25,6 +27,10 @@ return {
},
},
extensions = {
file_browser = {
grouped = true,
sorting_strategy = "ascending",
},
fzf = {
fuzzy = true,
override_generic_sorter = true,

View file

@ -1,3 +1,4 @@
---@type LazyPluginSpec[]
return {
{
"nvim-treesitter/nvim-treesitter",

View file

@ -1,3 +1,4 @@
---@type LazyPluginSpec[]
return {
{
"folke/which-key.nvim",
@ -22,12 +23,13 @@ return {
wk.register({
["<leader>f"] = {
name = "+Telescope",
b = { "<cmd>Telescope buffers<cr>", "File Browser" },
d = { "<cmd>Telescope find_files<cr>", "Find File" },
g = { "<cmd>Telescope live_grep<cr>", "Live Grep" },
h = { "<cmd>Telescope help_tags<cr>", "Help Tags" },
b = { "<cmd>Telescope file_browser grouped=true<cr>", "File browser" },
d = { "<cmd>Telescope find_files<cr>", "Find file" },
g = { "<cmd>Telescope live_grep<cr>", "Live grep" },
h = { "<cmd>Telescope help_tags<cr>", "Help tags" },
n = { "<cmd>Telescope notify<cr>", "Show notifications" },
p = { "<cmd>Telescope project<cr>", "Project" },
r = { "<cmd>Telescope asynctasks all<cr>", "Run Asynctasks" },
r = { "<cmd>Telescope asynctasks all<cr>", "Run asynctasks" },
s = {
function()
local confpath = vim.fn.resolve(vim.fn.stdpath("config"))
@ -44,9 +46,8 @@ return {
y = { '"+y', "Copy to clipboard" },
p = { '"+p', "Paste from clipboard" },
db = { "<cmd>DBUIToggle<cr>", "Toggle DBUI" },
gd = { "<cmd>Gvdiff!<CR>", "Git Diff" },
gd = { "<cmd>Gvdiff!<CR>", "Git diff" },
ng = { "<cmd>Neogit<cr>", "Neogit" },
sl = { "<cmd>SessionLoad<cr>", "Load Session" },
},
}, { mode = { "n", "v" } })
end,