Skip to content

Commit 483ab07

Browse files
committed
accumulated changes
1 parent baf1481 commit 483ab07

File tree

15 files changed

+250
-43
lines changed

15 files changed

+250
-43
lines changed

modules/home/class-laptop/ai.nix

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{pkgs, ...}: {
2+
home = {
3+
packages = with pkgs; [
4+
awsume
5+
claude-code
6+
copilot-language-server
7+
github-copilot-cli
8+
amp-cli
9+
];
10+
};
11+
}

modules/home/class-laptop/default.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{pkgs, ...}: {
22
imports = [
3+
./ai.nix
34
./applications.nix
45
./clipman.nix
56
./ghostty.nix
@@ -47,6 +48,7 @@
4748
# cli apps with graphical deps
4849
imagemagick
4950
pdftk
51+
qmk
5052
];
5153
};
5254

modules/home/class-laptop/kitty.nix

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@
106106
'';
107107
keybindings = {
108108
# os windows
109-
"ctrl+shift+n" = "launch --type=os-window --cwd=current";
110-
"ctrl+shift+r" = "set_window_title";
109+
"alt+n" = "launch --type=os-window --cwd=current";
110+
"alt+r" = "set_window_title";
111111

112112
# clipboard
113113
"ctrl+shift+c" = "copy_to_clipboard";
@@ -116,33 +116,30 @@
116116
# scrolling
117117
"shift+page_up" = "scroll_page_up";
118118
"shift+page_down" = "scroll_page_down";
119-
"shift+end" = "scroll_end";
120-
"ctrl+shift+page_up" = "scroll_to_prompt -1";
121-
"ctrl+shift+page_down" = "scroll_to_prompt +1";
119+
"alt+page_up" = "scroll_to_prompt -1";
120+
"alt+page_down" = "scroll_to_prompt +1";
122121

123122
# font size
124-
"ctrl+shift+equal" = "change_font_size current +2.0";
125-
"ctrl+shift+minus" = "change_font_size current -2.0";
126-
"ctrl+shift+0" = "change_font_size current 0";
123+
"alt+plus" = "change_font_size current +2.0";
124+
"alt+equal" = "change_font_size current +2.0";
125+
"alt+minus" = "change_font_size current -2.0";
126+
"alt+0" = "change_font_size current 0";
127127

128128
# dump output to vim
129-
"ctrl+shift+h" = "show_scrollback";
129+
"alt+h" = "show_scrollback";
130130

131131
# paste things
132-
"ctrl+shift+g" = "kitten hints --hints-text-color=red --type hash --program -";
133-
"ctrl+shift+w" = "kitten hints --hints-text-color=red --type word --program -";
134-
"ctrl+shift+l" = "kitten hints --hints-text-color=red --type line --program -";
132+
"alt+g" = "kitten hints --hints-text-color=red --type hash --program -";
133+
"alt+w" = "kitten hints --hints-text-color=red --type word --program -";
134+
"alt+f" = "kitten hints --hints-text-color=red --type path --program -";
135135

136-
# quick actions
137-
"ctrl+shift+f" = "kitten hints --hints-text-color=red --type path";
138-
"ctrl+shift+e" = "kitten hints --hints-text-color=red --type url --program default";
139-
"ctrl+shift+u" = "kitten hints --hints-text-color=red --type url --program default";
140-
"ctrl+shift+shift+u" = "kitten unicode_input";
136+
# urls
137+
"alt+e" = "kitten hints --hints-text-color=red --type url --program default";
138+
"alt+u" = "kitten hints --hints-text-color=red --type url --program default";
141139

142140
# markers
143-
"ctrl+shift+m" = "create_marker";
144-
"ctrl+shift+," = "remove_marker";
145-
"ctrl+shift+f1" = "toggle_marker iregex 1 \\\\berr(or)?\\\\b 2 \\\\bwarn(ing)?\\\\b 3 \\\\b(info|debug|trace)\\\\b";
141+
"alt+m" = "create_marker";
142+
"alt+shift+m" = "remove_marker";
146143
};
147144
};
148145
}

modules/home/class-laptop/niri.nix

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
screenshot-path = "~/pictures/screenshot-%d-%m-%Y-%T.png";
1515
input = {
1616
workspace-auto-back-and-forth = true;
17+
# warp-mouse-to-focus.enable = true;
1718
focus-follows-mouse = {
1819
enable = true;
1920
max-scroll-amount = "0%";
@@ -23,7 +24,7 @@
2324
layout = "us";
2425
model = "pc105";
2526
variant = "altgr-intl";
26-
options = "compose:rctrl,lv3:caps_switch";
27+
options = "compose:rctrl,lv3:ralt_switch_multikey";
2728
};
2829
};
2930
touchpad = {
@@ -208,7 +209,7 @@
208209

209210
# lock and suspend
210211
"Mod+Backslash".action = spawn "${pkgs.swaylock-effects}/bin/swaylock" "-f";
211-
"Mod+Ctrl+Shift+Backslash".action = spawn "systemctl" "suspend";
212+
"Mod+Ctrl+Backslash".action = spawn "systemctl" "suspend";
212213
"Cancel".action = spawn "${pkgs.swaylock-effects}/bin/swaylock" "-f";
213214

214215
# window actions

modules/home/common/cloud.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
programs = {
1010
rbw.enable = true;
1111
tmate.enable = true;
12+
granted.enable = true;
1213
gh = {
1314
enable = true;
1415
settings = {

modules/home/common/extra.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
ripgrep
5959
tailspin
6060
tcpdump
61-
qsv
61+
xan
6262
];
6363
};
6464
}

modules/home/common/git.nix

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
home = {
77
packages = with pkgs; [
88
git
9+
jjui
10+
jj-pre-push
11+
jujutsu
912
gitAndTools.git-absorb
1013
gitAndTools.git-trim
1114
mergiraf
@@ -17,6 +20,15 @@
1720
'';
1821
};
1922
};
23+
programs.jujutsu = {
24+
enable = true;
25+
settings = {
26+
user = {
27+
email = "[email protected]";
28+
name = "Daniel Nägele";
29+
};
30+
};
31+
};
2032
programs.git = {
2133
enable = true;
2234
userName = "Daniel Nägele";
@@ -114,7 +126,7 @@
114126
if [ $# -eq 0 ]; then
115127
git ls-files --modified --others --exclude-standard | grep -Ev '^(vendor/|go.(mod|sum)$)'
116128
else
117-
git show -m --pretty=tformat: --name-only @ | grep -Ev '^(vendor/|go.(mod|sum)$)'
129+
git diff --name-only $@ | grep -Ev '^(vendor/|go.(mod|sum)$)'
118130
fi
119131
}; f";
120132

modules/home/common/nvim/default.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@
5858
"nvim-treesitter-textobjects" # uses master
5959
"quicker-nvim"
6060
"snacks-nvim"
61+
# "amp-nvim"
62+
"copilot-lua"
63+
"claudecode-nvim"
6164
]
6265
(
6366
name: {

modules/home/common/nvim/lua/lsp.lua

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,87 @@ vim.lsp.config("rust_analyzer", {
188188
end,
189189
})
190190

191+
vim.lsp.config("copilot", {
192+
cmd = {
193+
"copilot-language-server",
194+
"--stdio",
195+
},
196+
root_markers = { ".git" },
197+
init_options = {
198+
editorInfo = {
199+
name = "Neovim",
200+
version = tostring(vim.version()),
201+
},
202+
editorPluginInfo = {
203+
name = "Neovim",
204+
version = tostring(vim.version()),
205+
},
206+
},
207+
settings = {
208+
telemetry = {
209+
telemetryLevel = "all",
210+
},
211+
},
212+
on_attach = function(client, bufnr)
213+
vim.api.nvim_buf_create_user_command(bufnr, "LspCopilotSignIn", function()
214+
client:request(
215+
---@diagnostic disable-next-line: param-type-mismatch
216+
"signIn",
217+
vim.empty_dict(),
218+
function(err, result)
219+
if err then
220+
vim.notify(err.message, vim.log.levels.ERROR)
221+
return
222+
end
223+
if result.command then
224+
local code = result.userCode
225+
local command = result.command
226+
vim.fn.setreg("+", code)
227+
vim.fn.setreg("*", code)
228+
local continue = vim.fn.confirm(
229+
"Copied your one-time code to clipboard.\n" .. "Open the browser to complete the sign-in process?",
230+
"&Yes\n&No"
231+
)
232+
if continue == 1 then
233+
client:exec_cmd(command, { bufnr = bufnr }, function(cmd_err, cmd_result)
234+
if cmd_err then
235+
vim.notify(err.message, vim.log.levels.ERROR)
236+
return
237+
end
238+
if cmd_result.status == "OK" then
239+
vim.notify("Signed in as " .. cmd_result.user .. ".")
240+
end
241+
end)
242+
end
243+
end
244+
245+
if result.status == "PromptUserDeviceFlow" then
246+
vim.notify("Enter your one-time code " .. result.userCode .. " in " .. result.verificationUri)
247+
elseif result.status == "AlreadySignedIn" then
248+
vim.notify("Already signed in as " .. result.user .. ".")
249+
end
250+
end
251+
)
252+
end, { desc = "Sign in Copilot with GitHub" })
253+
vim.api.nvim_buf_create_user_command(bufnr, "LspCopilotSignOut", function()
254+
client:request(
255+
---@diagnostic disable-next-line: param-type-mismatch
256+
"signOut",
257+
vim.empty_dict(),
258+
function(err, result)
259+
if err then
260+
vim.notify(err.message, vim.log.levels.ERROR)
261+
return
262+
end
263+
if result.status == "NotSignedIn" then
264+
vim.notify("Not signed in.")
265+
end
266+
end
267+
)
268+
end, { desc = "Sign out Copilot with GitHub" })
269+
end,
270+
})
271+
191272
vim.lsp.enable({
192273
"gopls",
193274
"typos-lsp",
@@ -198,4 +279,5 @@ vim.lsp.enable({
198279
"harper",
199280
"fish",
200281
"rust_analyzer",
282+
-- "copilot",
201283
})

modules/home/common/nvim/lua/maps.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
vim.g.mapleader = " "
22

3+
vim.keymap.set("n", "<c-s>", ":w<cr>", { desc = "write" })
4+
vim.keymap.set("n", "<c-q>", ":wqa<cr>", { desc = "write and quit all" })
5+
36
-- better up/down
47
vim.keymap.set("n", "j", [[ v:count > 1 ? "m'" . v:count . "j" : "gj" ]], { expr = true, silent = true })
58
vim.keymap.set("n", "k", [[ v:count > 1 ? "m'" . v:count . "k" : "gk" ]], { expr = true, silent = true })
@@ -13,6 +16,7 @@ vim.keymap.set("n", "H", function()
1316
end
1417
end, { desc = "go to start of line" })
1518
vim.keymap.set({ "o", "x" }, "H", "^", { desc = "go to start of line" })
19+
-- TODO: add map to L before comment
1620
vim.keymap.set({ "n", "o", "x" }, "L", "$", { desc = "go to end of line" })
1721

1822
-- better paste

0 commit comments

Comments
 (0)