mirror of
https://github.com/smg1024/nix-darwin.git
synced 2026-05-22 20:32:59 +09:00
feat: home-manager config files implemented
build not tested
This commit is contained in:
parent
248170c877
commit
54297f94fd
44 changed files with 852 additions and 60 deletions
33
home/nvf/core/autocmds.nix
Executable file
33
home/nvf/core/autocmds.nix
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
{lib, ...}: [
|
||||
# autocmds
|
||||
{
|
||||
enable = true;
|
||||
event = ["BufReadPost"];
|
||||
desc = "Return to last cursor position";
|
||||
group = "LastCursorGroup";
|
||||
callback = lib.generators.mkLuaInline ''
|
||||
function()
|
||||
local mark = vim.api.nvim_buf_get_mark(0, '"')
|
||||
local line_count = vim.api.nvim_buf_line_count(0)
|
||||
if mark[1] > 0 and mark[1] <= line_count then
|
||||
pcall(vim.api.nvim_win_set_cursor, 0, mark)
|
||||
end
|
||||
end
|
||||
'';
|
||||
}
|
||||
{
|
||||
enable = true;
|
||||
event = ["TextYankPost"];
|
||||
desc = "Highlight yanks on copy";
|
||||
group = "HighlightYank";
|
||||
pattern = ["*"];
|
||||
callback = lib.generators.mkLuaInline ''
|
||||
function()
|
||||
vim.hl.on_yank({
|
||||
higroup = "IncSearch",
|
||||
timeout = 250,
|
||||
})
|
||||
end
|
||||
'';
|
||||
}
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue