Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ syncLocalSettings.json
sync.lock
nix/foo.nix
./result
.aider*
5 changes: 3 additions & 2 deletions conf/fish/funcs/_fzf-jj-bookmarks.fish
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function _fzf-jj-bookmarks --description "Search for jujutsu bookmarks"
jj root --quiet &>/dev/null; or return
set -f lines (jj bookmark list --color always | fzf --tmux 98% --ansi --layout=reverse \
--scheme=default \
set -f lines (jj bookmark list --color always | grep -v '^[[:space:]]' | fzf --tmux 98% --ansi --layout=reverse \
--scheme=path \
--preview='jj log --color=always -r "stack($(echo {} | cut -d: -f2 | awk "{print \$1}" | string trim))" --no-graph' \
--preview-label='Commit Details' \
--bind='ctrl-y:execute-silent(echo {} | cut -d: -f2 | awk "{print \$1}" | string trim | pbcopy)' \
Expand All @@ -19,3 +19,4 @@ function _fzf-jj-bookmarks --description "Search for jujutsu bookmarks"
end
end

# _fzf-jj-bookmarks
1 change: 1 addition & 0 deletions conf/fish/funcs/_fzf-jj-revs.fish
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ function _fzf-jj-revs --description "Search for jujutsu revision ids"
--revisions 'bookmarks(towry) | (ancestors(@) & author(towry) ~ empty())' \
--template 'author.timestamp().format("%F") ++ " " ++change_id.shortest(7) ++ " " ++ description.first_line() ++ " " ++ bookmarks ++ "\n"' \
| fzf --tmux 98% --ansi --layout=reverse --multi \
--scheme=path \
--preview='jj show --color=always --git --stat {2}')

if test $status -eq 0
Expand Down
10 changes: 10 additions & 0 deletions conf/fish/funcs/jj-fork-main.fish
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ function jj-fork-main --description "Fork main branch"
set -l date_now (date +%m%d)
set -l bookmark_name "$bookmark_name-$date_now"

# check if the bookmark name is already used
# by running jj log -r $bookmark_name -n 1
# if no error, then the bookmark name is already used
# exit with error msg
jj log -r $bookmark_name -n 1 > /dev/null 2>&1
if test $status -eq 0
echo "Bookmark name $bookmark_name is already used"
return 1
end

# 确保我们能捕获所有输出,包括stderr
set -l output (jj new --no-pager --no-edit -r main@origin -m "$description" 2>&1)
if test $status -ne 0
Expand Down
6 changes: 6 additions & 0 deletions conf/fish/funcs/jj-fork-master.fish
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ function jj-fork-master --description "Fork master branch"
set -l date_now (date +%m%d)
set -l bookmark_name "$bookmark_name-$date_now"

jj log -r $bookmark_name -n 1 > /dev/null 2>&1
if test $status -eq 0
echo "Bookmark name $bookmark_name is already used"
return 1
end

# 确保我们能捕获所有输出,包括stderr
set -l output (jj new --no-pager --no-edit -r master@origin -m "$description" 2>&1)
if test $status -ne 0
Expand Down
13 changes: 13 additions & 0 deletions conf/fish/funcs/jj-review.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# usage: jj-review -r <revset>
# get diff by run jj diff -r "trunk()..<revset>" -n 10 --git --no-pager
# then pass the diff to aichat with role file: conf/llm/aichat/roles/vue-review.md
function jj-review --description "Review code with AI"
argparse 'r/revset=' -- $argv
or return

set -l revset $_flag_revset
set -l diff (jj diff -r "trunk()..$revset" --git --no-pager -w --context 800)
echo "Reviewing diff for revset: $revset"
set -l review_result (aichat --role vue-review -S -c $diff)
echo $review_result
end
8 changes: 4 additions & 4 deletions conf/ghostty/config
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
# https://github.com/ghostty-org/ghostty/blob/b8ffee7acbdd5ee97953f6e6d02e047d4bfda37b/src/input/key.zig#L255


theme = dark:kanagawabones,light:solarized-light
theme = dark:kanagawa-dragon,light:solarized-light
font-family = "Berkeley Mono"
window-title-font-family = "Berkeley Mono"
window-title-font-family = "PT Sans"
font-feature = "+calt"
# font-family = "Maple Mono"
# font-feature = "-zero, +calt, +cv01, +ss03, +ss06, +ss02, -cv35"
font-size = 17
font-size = 15
font-thicken = false
font-codepoint-map = U+4E00-U+9FFF,U+3400-U+4DBF=LXGW WenKai Mono
shell-integration-features = no-cursor,sudo,no-title
Expand All @@ -23,7 +23,7 @@ macos-window-shadow = true
adjust-underline-position = 15%
adjust-underline-thickness = -40%
adjust-box-thickness = -40%
adjust-cell-height = 20%
adjust-cell-height = 15%
mouse-hide-while-typing = true
focus-follows-mouse = false
unfocused-split-opacity = 1
Expand Down
6 changes: 4 additions & 2 deletions conf/ghostty/config-tmux
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ keybind = super+left_bracket=text:\x1ap
keybind = super+right_bracket=text:\x1an
keybind = super+slash=text:\x1a/
keybind = super+minus=text:\x1a-
# pick window
keybind = super+w=text:\x1aw
#= pick window
# keybind = super+w=text:\x1aw
# keybind = super+w=text:\x1a\x17
#= pick panels
keybind = super+w=text:\x1a\x10
# pick session
keybind = super+s=text:\x1as
# switch last session
Expand Down
29 changes: 29 additions & 0 deletions conf/llm/aichat/roles/vue-review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
model: deepseek:deepseek-chat
temperature: 0
top_p: 0.1
---

# 角色:Vue 代码审查专家

你是一名专业的 Vue 代码审查专家,专注于发现 Vue 相关代码中明显严重的**逻辑错误**和**代码错误**,忽略风格、格式、命名等 warning 类问题。

## 审查重点

- 只关注会导致功能异常、数据错误、运行报错的代码问题。
- 忽略 warning、最佳实践、风格、性能优化等建议。
- 典型错误包括:
- 应该放在 `data` 里的数据被错误地放在`props` 或其他错误地方。
- 响应式数据未正确定义,导致视图不更新。
- 生命周期钩子使用错误。
- 事件绑定、props、emit 等用法错误。
- 逻辑分支、条件判断、循环等实现有 bug。
- 组件通信、状态管理相关的致命错误。

## 审查方式

- 只输出你发现的**错误**,并简要说明原因。
- 不输出任何 warning、建议或风格类内容。
- 如未发现错误,回复"未发现明显的逻辑或代码错误"。

请严格按照上述要求,对 git diff 进行 Vue 代码审查。
72 changes: 36 additions & 36 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion nix/hm/ai.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ in
home.packages = with pkgs; [
aichat
ollama
aider-chat
];

home.file = {
Expand All @@ -22,7 +23,12 @@ in
};
"${configDir}/config.yaml" = {
source = pkgs.replaceVars ../../conf/llm/aichat/config.yaml {
DEEPSEEK_API_KEY = pkgs.nix-priv.keys.deepseek.apikey;
DEEPSEEK_API_KEY = pkgs.nix-priv.keys.deepseek.apiKey;
};
};
".aider.conf.yml" = {
text = builtins.toJSON {

};
};
};
Expand Down
4 changes: 2 additions & 2 deletions nix/hm/fzf.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ in
# "--preview-window=sharp"
"--preview-window='sharp,right,border-left,<70(bottom,50%,border-top)'"
# this keybind should match the telescope ones in nvim config
''--bind="ctrl-u:unix-line-discard+top,tab:down,shift-tab:up,ctrl-d:preview-down,ctrl-f:preview-up"''
''--bind="ctrl-u:unix-line-discard+top,tab:down,shift-tab:up,ctrl-d:preview-half-page-down,ctrl-f:preview-half-page-up"''
];
fileWidgetCommand = "${pkgs.ripgrep}/bin/rg --files";
fileWidgetCommand = "${pkgs.fd}/bin/fd --color=always --type f";
fileWidgetOptions = [
"--keep-right"
# Preview files with bat
Expand Down
2 changes: 2 additions & 0 deletions nix/hm/git.nix
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@ in
"node_modules/"
"result/"
"target/"
".aider.*"
".aider*"
];
};
}
5 changes: 5 additions & 0 deletions nix/hm/jj.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ in
programs.fish.shellAliases = {
jl = "jj log -n 8";
j = "jj";
jj-mega-add = "jj-mega-merge -t m-m -f";
jj-mega-rm = "jj-mega-merge -t m-m --remove";
};
programs.jujutsu = {
# use master version
Expand Down Expand Up @@ -746,5 +748,8 @@ in
".config/fish/functions/_fzf-jj-bookmarks.fish" = {
source = ../../conf/fish/funcs/_fzf-jj-bookmarks.fish;
};
".config/fish/functions/jj-review.fish" = {
source = ../../conf/fish/funcs/jj-review.fish;
};
};
}
2 changes: 1 addition & 1 deletion nix/hm/tmux.nix
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ in
set -g status-right-length 300
set -g status-justify left
set -g status-style bg=blue,fg=black
set-window-option -g status-position top
set-window-option -g status-position bottom
set -g message-style fg=black,bg=blue
set -g message-command-style fg=black,bg=blue
# set -g status-style bg=default,fg=yellow
Expand Down
Loading
Loading