Skip to content

Commit c16c68e

Browse files
committed
feat: messy commit
1 parent 5314e9f commit c16c68e

File tree

9 files changed

+137
-98
lines changed

9 files changed

+137
-98
lines changed

flake.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
vim.opt.rtp:prepend(lazypath)
122122
123123
require("lazy").setup({
124+
lockfile = root .. "/lazy-lock.json",
124125
spec = {
125126
{ import = "plugins" },
126127
},
@@ -161,15 +162,13 @@
161162
cp -r ${pkgs.vimPlugins.lazydev-nvim} $out/local/nvim/nixpkgs/lazydev-nvim
162163
cp -r ${pkgs.vimPlugins.noice-nvim} $out/local/nvim/nixpkgs/noice-nvim
163164
cp -r ${pkgs.vimPlugins.nui-nvim} $out/local/nvim/nixpkgs/nui-nvim
164-
cp -r ${pkgs.vimPlugins.nvim-bqf} $out/local/nvim/nixpkgs/nvim-bqf
165165
cp -r ${pkgs.vimPlugins.nvim-dap} $out/local/nvim/nixpkgs/nvim-dap
166166
cp -r ${pkgs.vimPlugins.nvim-impairative} $out/local/nvim/nixpkgs/nvim-impairative
167167
cp -r ${pkgs.vimPlugins.nvim-lint} $out/local/nvim/nixpkgs/nvim-lint
168168
cp -r ${pkgs.vimPlugins.nvim-tree-lua} $out/local/nvim/nixpkgs/nvim-tree-lua
169169
cp -r ${pkgs.vimPlugins.nvim-treesitter} $out/local/nvim/nixpkgs/nvim-treesitter
170170
cp -r ${pkgs.vimPlugins.nvim-treesitter-context} $out/local/nvim/nixpkgs/nvim-treesitter-context
171171
cp -r ${pkgs.vimPlugins.nvim-treesitter-textobjects} $out/local/nvim/nixpkgs/nvim-treesitter-textobjects
172-
cp -r ${pkgs.vimPlugins.quicker-nvim} $out/local/nvim/nixpkgs/quicker-nvim
173172
cp -r ${pkgs.vimPlugins.render-markdown-nvim} $out/local/nvim/nixpkgs/render-markdown-nvim
174173
cp -r ${pkgs.vimPlugins.snacks-nvim} $out/local/nvim/nixpkgs/snacks-nvim
175174

home/git.nix

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,11 @@
2626
hunk-header-decoration-style = "blue ul box";
2727
hunk-header-style = "file line-number syntax";
2828
navigate = "true";
29+
tabs = "4";
2930
syntax-theme = "ansi";
3031
map-styles = "bold purple => syntax dim black, bold cyan => syntax #${config.colors.black}";
3132
};
3233
};
33-
difftastic = {
34-
enable = false;
35-
background = "dark";
36-
};
3734
aliases = {
3835
# shorthands for daily stuff
3936
a = "add";
@@ -42,55 +39,61 @@
4239
bv = "branch --color='always' --sort=-authordate --format='%(color:yellow)%(refname:short)\ %(color:green)%(committerdate:relative)\ %(color:blue)%(authorname)\ %(color:reset)%(contents:subject)'";
4340
ci = "commit";
4441
ch = "cherry -v";
45-
d = "diff -w";
42+
d = "diff";
4643
ds = "-c delta.side-by-side=true d";
4744
dc = "d -- :^vendor :^go.mod :^go.sum";
4845
dsc = "-c delta.side-by-side=true dc";
4946
fixup = "commit --fixup";
5047
fi = "commit --fixup";
5148
# base log
5249
log-pretty = "log --pretty=format:'%C(yellow)%h\ %C(green)%ad%Cred%d\ %C(reset)%s%C(blue)\ [%an]' --date=relative";
53-
# verbose log, i.e. with cherry marks
54-
log-pretty-verbose = "log --cherry-mark --pretty=format:'%C(yellow)%h %C(cyan)%m %C(green)%ad%C(red)%d %C(reset)%s%C(blue) [%an]' --date=relative";
50+
log-cherry = "log --cherry-mark --pretty=format:'%C(yellow)%h\ %C(cyan)%m\ %C(green)%ad%Cred%d\ %C(reset)%s%C(blue)\ [%an]' --date=relative";
5551
# aliases for use
56-
ln = "log-pretty";
5752
l = "!f() {
58-
if [ -z \"$1\" ]; then
53+
if [ $# -eq 0 ]; then
5954
if [ \"$(git main)\" = \"$(git rev-parse --abbrev-ref HEAD)\" ]; then
60-
git log-pretty -32
55+
set - -32
6156
else
62-
git log-pretty $(git main)..
57+
set -- $(git main)..
6358
fi
64-
else
65-
git log-pretty $1
6659
fi
67-
}; f";
68-
lv = "!f() {
69-
if [ -z \"$1\" ]; then
70-
if [ \"$(git main)\" = \"$(git rev-parse --abbrev-ref HEAD)\" ]; then
71-
git log-pretty-verbose -32
72-
else
73-
git log-pretty-verbose --no-merges $(git main)...
74-
fi
60+
if [[ \"$@\" == *\"...\"* ]]; then
61+
git log-cherry \"$@\"
7562
else
76-
git log-pretty-verbose --no-merges $1
63+
git log-pretty \"$@\"
7764
fi
7865
}; f";
7966
lg = "!f() {
80-
if [ -z \"$1\" ]; then
67+
if [ $# -eq 0 ]; then
8168
if [ \"$(git main)\" = \"$(git rev-parse --abbrev-ref HEAD)\" ]; then
82-
git log-pretty-verbose --graph --boundary --cherry-mark -16
69+
set - -16
8370
else
84-
git log-pretty-verbose --graph --boundary --cherry-mark $(git main)...
71+
set -- $(git main)..
8572
fi
73+
fi
74+
if [[ \"$@\" == *\"...\"* ]]; then
75+
git log-cherry --graph --boundary \"$@\"
8676
else
87-
git log-pretty-verbose --graph --boundary --cherry-mark $1
77+
git log-pretty --graph --boundary \"$@\"
8878
fi
8979
}; f";
9080
new = "log-pretty @{u}...";
9181
p = "pull --prune --all --autostash";
92-
puf = "push --force-with-lease --force-if-includes";
93-
rb = "rebase";
82+
pm = "!git fetch origin $(git main):$(git main) 2>/dev/null";
83+
stack = "!git log --decorate=short --pretty='format:%D' origin/$(git main).. | sed 's/, /\\n/g; s/HEAD -> //' | grep -Ev '^$'";
84+
puf = "!git log --decorate=short --pretty='format:%D' origin/$(git main).. | sed 's/, /\\n/g; s/HEAD -> //' | grep -Ev '^$' | xargs git push --force-with-lease --force-if-includes origin";
85+
rb = "!f() {
86+
if [ $# -eq 0 ]; then
87+
git fetch origin $(git main):$(git main)
88+
set -- $(git main);
89+
fi && git rebase \"$@\";
90+
}; f";
91+
rbi = "!f() {
92+
if [ $# -eq 0 ]; then
93+
set -- $(git main);
94+
fi;
95+
git rebase --interactive --keep-base \"$@\";
96+
}; f";
9497
rba = "rebase --abort";
9598
rbc = "rebase --continue";
9699
ours = "restore --ours";
@@ -101,26 +104,26 @@
101104

102105
# repo path
103106
root = "rev-parse --show-toplevel"; # print root
104-
cd = "!f() {cd $(git rev-parse --show-toplevel)}"; # change to root
107+
cd = "!cd $(git rev-parse --show-toplevel)"; # change to root
105108
exec = "!exec "; # make from wherever
106109

107110
# files from index or from commits
108111
f = "!f() {
109-
if [ -z \"$1\" ]; then
112+
if [ $# -eq 0 ]; then
110113
git ls-files --modified --others --exclude-standard | grep -Ev '^(vendor/|go.(mod|sum)$)'
111114
else
112115
git show -m --pretty=tformat: --name-only @ | grep -Ev '^(vendor/|go.(mod|sum)$)'
113116
fi
114117
}; f";
115118

116119
# repo main/master disambiguation
117-
main = "!f() { git symbolic-ref refs/remotes/origin/HEAD --short | cut -d/ -f2; }; f";
118-
119-
# fast ops on main/master
120-
pull-main = "!f() { test $(git rev-parse --abbrev-ref HEAD) != $(git main) && git fetch origin $(git main):$(git main) || git p; }; f"; # pull main
121-
pm = "pull-main";
122-
rbmi = "!f() { git pull-main && git rb -i $(git main); }; f"; # rebase interactively on main
123-
rbm = "!f() { git pull-main && git rb $(git main); }; f"; # rebase on main
120+
main = "!f() {
121+
if git remote | grep -qE '.+'; then
122+
git symbolic-ref refs/remotes/origin/HEAD --short | cut -d/ -f2;
123+
else
124+
echo main
125+
fi
126+
}; f";
124127

125128
# update PR with unstaged
126129
rekt = "!f() { git a -u; git amend; git puf; }; f"; # add updates to amend commit and force push
File renamed without changes.
File renamed without changes.

home/nvim/default.nix

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
"lazydev-nvim"
4242
"noice-nvim"
4343
"nui-nvim"
44-
"nvim-bqf"
4544
"nvim-dap"
4645
# "nvim-dap-view"
4746
"nvim-impairative"
@@ -50,7 +49,6 @@
5049
"nvim-treesitter"
5150
"nvim-treesitter-context"
5251
"nvim-treesitter-textobjects"
53-
"quicker-nvim"
5452
"render-markdown-nvim"
5553
"snacks-nvim"
5654
]
@@ -96,5 +94,23 @@
9694
)
9795
);
9896
in
99-
vimPlugins // miniPlugins;
97+
{
98+
# "nvim/nixpkgs/nvim-treesitter-textobjects" = {
99+
# source = pkgs.fetchFromGitHub {
100+
# owner = "nvim-treesitter";
101+
# repo = "nvim-treesitter-textobjects";
102+
# rev = "main";
103+
# sha256 = "sha256-sJdKVaGNXW4HEi6NXEqUhelr8T7/M216m7bPKHAd1do=";
104+
# };
105+
# };
106+
# "nvim/nixpkgs/nvim-treesitter" = {
107+
# source = pkgs.fetchFromGitHub {
108+
# owner = "nvim-treesitter";
109+
# repo = "nvim-treesitter";
110+
# rev = "main";
111+
# sha256 = "sha256-m3ShsTug4wSee89K+GaTKodC1cWsskR35y9SjDtVRgU=";
112+
# };
113+
# };
114+
}
115+
// vimPlugins // miniPlugins;
100116
}

home/nvim/lua/plugins.lua

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -344,22 +344,38 @@ return inject_all({
344344
config = function(_, opts)
345345
opts.custom_textobjects = {
346346
-- arg
347-
a = require("mini.ai").gen_spec.treesitter({ a = "@parameter.outer", i = "@parameter.inner" }),
347+
-- TODO: parameter.outer broke? make-range seems broken, wait for main TS
348+
a = require("mini.ai").gen_spec.treesitter(
349+
{ a = "@parameter.outer", i = "@parameter.inner" },
350+
{ use_nvim_treesitter = true }
351+
),
348352
-- braces
349353
b = { { "%b()", "%b[]", "%b{}" }, "^.().*().$" },
350354
-- block
351-
B = require("mini.ai").gen_spec.treesitter({ a = "@block.outer", i = "@block.inner" }),
355+
B = require("mini.ai").gen_spec.treesitter(
356+
{ a = "@block.outer", i = "@block.inner" },
357+
{ use_nvim_treesitter = true }
358+
),
352359
-- call
353-
c = require("mini.ai").gen_spec.treesitter({ a = "@call.outer", i = "@call.inner" }),
360+
c = require("mini.ai").gen_spec.treesitter(
361+
{ a = "@call.outer", i = "@call.inner" },
362+
{ use_nvim_treesitter = true }
363+
),
354364
-- function / method
355-
f = require("mini.ai").gen_spec.treesitter({ a = "@function.outer", i = "@function.inner" }),
365+
f = require("mini.ai").gen_spec.treesitter(
366+
{ a = "@function.outer", i = "@function.inner" },
367+
{ use_nvim_treesitter = true }
368+
),
356369
-- if
357-
i = require("mini.ai").gen_spec.treesitter({
358-
a = "@conditional.outer",
359-
i = "@conditional.inner",
360-
}),
370+
i = require("mini.ai").gen_spec.treesitter(
371+
{ a = "@conditional.outer", i = "@conditional.inner" },
372+
{ use_nvim_treesitter = true }
373+
),
361374
-- loop
362-
L = require("mini.ai").gen_spec.treesitter({ a = "@loop.outer", i = "@loop.inner" }),
375+
L = require("mini.ai").gen_spec.treesitter(
376+
{ a = "@loop.outer", i = "@loop.inner" },
377+
{ use_nvim_treesitter = true }
378+
),
363379
-- disable quote, I use string
364380
q = false,
365381
-- string
@@ -368,7 +384,7 @@ return inject_all({
368384
t = require("mini.ai").gen_spec.treesitter({
369385
a = { "@customtype.outer", "@type.outer" },
370386
i = { "@customtype.inner", "@type.inner" },
371-
}),
387+
}, { use_nvim_treesitter = true }),
372388
-- defaults include
373389
-- (, ), [, ], {, }, <, >, ", ', `, ?, t, <space>
374390
-- subword

home/wayland/default.nix

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,18 @@
102102
mimeApps = {
103103
enable = true;
104104
defaultApplications = {
105-
"text/html" = "org.firefox.firefox.desktop";
106-
"x-scheme-handler/http" = "org.firefox.firefox.desktop";
107-
"x-scheme-handler/https" = "org.firefox.firefox.desktop";
108-
"x-scheme-handler/unknown" = "org.firefox.firefox.desktop";
109-
"image/svg+xml" = "org.inkscape.Inkscape.desktop";
110105
"application/pdf" = "org.pwmt.zathura-pdf-mupdf.desktop";
106+
"application/x-extension-htm" = "firefox.desktop";
107+
"application/x-extension-html" = "firefox.desktop";
108+
"application/x-extension-shtml" = "firefox.desktop";
109+
"application/x-extension-xht" = "firefox.desktop";
110+
"application/x-extension-xhtml" = "firefox.desktop";
111+
"application/xhtml+xml" = "firefox.desktop";
112+
"image/svg+xml" = "org.inkscape.Inkscape.desktop";
113+
"text/html" = "firefox.desktop";
114+
"x-scheme-handler/chrome" = "firefox.desktop";
115+
"x-scheme-handler/http" = "firefox.desktop";
116+
"x-scheme-handler/https" = "firefox.desktop";
111117
};
112118
};
113119
};

home/wayland/mako.nix

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
{config, ...}: {
22
services.mako = {
33
enable = true;
4-
margin = "10";
5-
font = "pango:Fira Mono 9";
6-
anchor = "bottom-left";
7-
layer = "overlay";
8-
groupBy = "category,summary,body";
9-
backgroundColor = "#${config.colors.background}";
10-
borderColor = "#${config.colors.blue}";
11-
borderRadius = 5;
12-
borderSize = 3;
13-
textColor = "#${config.colors.foreground}";
14-
defaultTimeout = 7500;
15-
extraConfig = ''
16-
outer-margin=20,10
17-
[mode=dnd]
18-
invisible=1
19-
'';
4+
settings = {
5+
margin = "10";
6+
font = "pango:Fira Mono 9";
7+
anchor = "bottom-left";
8+
layer = "overlay";
9+
group-by = "category,summary,body";
10+
background-color = "#${config.colors.background}";
11+
border-color = "#${config.colors.blue}";
12+
border-radius = 5;
13+
border-size = 3;
14+
text-color = "#${config.colors.foreground}";
15+
default-timeout = 7500;
16+
outer-margin = "20,10";
17+
"mode=dnd" = {
18+
invisible = true;
19+
};
20+
};
2021
};
2122
}

0 commit comments

Comments
 (0)