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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ First run:
Afterwards, run: `make rebuild`.

## TODO

## Edit the prompt with $EDITOR.

- `alt+e` to edit the prompt.
81 changes: 13 additions & 68 deletions conf/ghostty/config
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,24 @@
theme = dark:Kanagawa Dragon,light:Builtin Solarized Light
font-family = Berkeley Mono Nerd Font
# font-family = Iosevka Nerd Font Mono
font-size = 14
font-thicken = true
font-size = 13
font-thicken = false
font-codepoint-map = U+4E00-U+9FFF,U+3400-U+4DBF=LXGW WenKai Mono
shell-integration-features = cursor,sudo,title
cursor-style = block
cursor-invert-fg-bg = true
selection-invert-fg-bg = true
macos-option-as-alt = true
macos-titlebar-style = tabs
macos-window-shadow = true
adjust-underline-position = 45%
adjust-underline-thickness = -65%
adjust-underline-thickness =
mouse-hide-while-typing = true
focus-follows-mouse = false
unfocused-split-opacity = 1
window-padding-balance = true
window-padding-x = 6
window-padding-x = 8
window-padding-y = 0

background-opacity = 1
background-blur-radius = 0
Expand All @@ -33,74 +35,17 @@ quick-terminal-position = top


# keybinds
## https://www.eso.org/~ndelmott/ascii.html
## ctrl+z is the prefix for tmux
## \x1a is ctrl+z
keybind = clear
keybind = super+shift+r=reload_config
keybind = super+backslash=toggle_quick_terminal
# keybind = super+n=text:\x1ac
# keybind = super+left_bracket=text:\x1ap
# keybind = super+right_bracket=text:\x1an
# keybind = super+slash=text:\x1a/
# keybind = super+minus=text:\x1a-
# keybind = super+w=text:\x1aw
# keybind = super+one=text:\x1a1
# keybind = super+two=text:\x1a2
# keybind = super+three=text:\x1a3
# keybind = super+four=text:\x1a4

# ====
keybind = super+v=paste_from_clipboard
keybind = super+c=copy_to_clipboard
keybind = super+n=new_window
keybind = super+t=new_tab
keybind = super+w=close_surface
keybind = super+shift+w=close_window
keybind = super+slash=new_split:right
keybind = super+minus=new_split:down
keybind = super+left_bracket=previous_tab
keybind = super+right_bracket=next_tab
keybind = super+comma=last_tab
keybind = alt+left_bracket=move_tab:-1
keybind = alt+right_bracket=move_tab:1
## goto_tab:1 and 2,3,4,5,6,7,8,9
keybind = super+one=goto_tab:1
keybind = super+two=goto_tab:2
keybind = super+three=goto_tab:3
keybind = super+four=goto_tab:4
keybind = super+five=goto_tab:5
keybind = super+six=goto_tab:6
keybind = super+seven=goto_tab:7
keybind = super+eight=goto_tab:8
keybind = super+nine=goto_tab:9

# # navigate with alt+hjkl
keybind = alt+h=goto_split:left
keybind = alt+l=goto_split:right
keybind = alt+k=goto_split:top
keybind = alt+j=goto_split:bottom
# # resize with super+shift+hjkl
keybind = alt+shift+h=resize_split:left,60
keybind = alt+shift+l=resize_split:right,60
keybind = alt+shift+k=resize_split:up,60
keybind = alt+shift+j=resize_split:down,60
keybind = alt+shift+equal=equalize_splits
# # toggle zoom on split
keybind = super+0=toggle_split_zoom
# # toggle fullscreen
keybind = ctrl+a>f=toggle_fullscreen
# select all
keybind = super+a=select_all
# clear screen
keybind = ctrl+l=clear_screen
# scroll to top
keybind = ctrl+a>y=scroll_to_top
# # scroll to bottom
keybind = ctrl+a>e=scroll_to_bottom
# scroll_page_up and scroll_page_down
keybind = super+d=scroll_page_down
keybind = super+u=scroll_page_up
# jump_to_prompt=-1, jump_to_prompt=1
keybind = alt+d=jump_to_prompt:-1
keybind = alt+u=jump_to_prompt:1
# # toggle fullscreen
keybind = super+f12=toggle_fullscreen

### custom

config-file = ?config-tmux
# config-file = ?config-default-keybind
48 changes: 48 additions & 0 deletions conf/ghostty/config-default-keybind
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
keybind = super+n=new_window
keybind = super+t=new_tab
keybind = super+w=close_surface
keybind = super+shift+w=close_window
keybind = super+slash=new_split:right
keybind = super+minus=new_split:down
keybind = super+left_bracket=previous_tab
keybind = super+right_bracket=next_tab
keybind = super+comma=last_tab
keybind = alt+left_bracket=move_tab:-1
keybind = alt+right_bracket=move_tab:1
## goto_tab:1 and 2,3,4,5,6,7,8,9
keybind = super+one=goto_tab:1
keybind = super+two=goto_tab:2
keybind = super+three=goto_tab:3
keybind = super+four=goto_tab:4
keybind = super+five=goto_tab:5
keybind = super+six=goto_tab:6
keybind = super+seven=goto_tab:7
keybind = super+eight=goto_tab:8
keybind = super+nine=goto_tab:9

# # navigate with alt+hjkl
keybind = alt+h=goto_split:left
keybind = alt+l=goto_split:right
keybind = alt+k=goto_split:top
keybind = alt+j=goto_split:bottom
# # resize with super+shift+hjkl
keybind = alt+shift+h=resize_split:left,60
keybind = alt+shift+l=resize_split:right,60
keybind = alt+shift+k=resize_split:up,60
keybind = alt+shift+j=resize_split:down,60
keybind = alt+shift+equal=equalize_splits
# # toggle zoom on split
keybind = super+0=toggle_split_zoom
# select all
keybind = super+a=select_all
# clear screen
keybind = ctrl+l=clear_screen
# scroll to top
keybind = ctrl+a>y=scroll_to_top
# # scroll to bottom
keybind = ctrl+a>e=scroll_to_bottom
# scroll_page_up and scroll_page_down
keybind = super+d=scroll_page_down
keybind = super+u=scroll_page_up
# jump_to_prompt=-1, jump_to_prompt=1

23 changes: 23 additions & 0 deletions conf/ghostty/config-tmux
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
macos-titlebar-style = hidden

#### keybinds

# https://www.eso.org/~ndelmott/ascii.html
# ctrl+z is the prefix for tmux
# \x1a is ctrl+z
#
keybind = super+n=text:\x1ac
keybind = super+left_bracket=text:\x1ap
keybind = super+right_bracket=text:\x1an
keybind = super+slash=text:\x1a/
keybind = super+minus=text:\x1a-
keybind = super+w=text:\x1aw
keybind = super+one=text:\x1a1
keybind = super+two=text:\x1a2
keybind = super+three=text:\x1a3
keybind = super+four=text:\x1a4

keybind = super+h=text:\x1bh
keybind = super+l=text:\x1bl
keybind = super+j=text:\x1bj
keybind = super+k=text:\x1bk
9 changes: 6 additions & 3 deletions conf/tig/vim.tigrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ bind generic j move-down
bind generic k move-up
bind generic l scroll-right
bind generic ge edit
bind diff ge >nvim -c "Gpedit %(commit):%(file)"
bind generic gE >nvim -c "Gedit %(commit)"
bind generic <C-R> refresh

Expand All @@ -22,9 +23,11 @@ bind generic g- parent
bind generic gb back
bind generic gn view-next
# git push to remote
bind main gup ?+git push --force-with-lease origin %(branch)
bind main gff ?+git fetch origin %(branch)
bind main gpp ?git pull origin %(branch)
bind generic guP ?+git push --force-with-lease origin %(branch)
bind generic gup !git push origin %(branch)
bind generic gff !git fetch origin %(branch)
bind generic gpp !git pull --ff --prune --no-tags origin %(branch)
bind main gfp !git fetch --prune --prune-tags
bind main gfa ?+git fetch --all
bind main gca +git commit --amend --no-edit
bind main rh ?git reset --hard %(commit)
Expand Down
4 changes: 3 additions & 1 deletion conf/tmux/bin/tmux-scratch-toggle.tmux
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

scratch_session_name="FLOAT"

if [[ $current_session == "FLOAT" ]]; then
current_session=$(tmux display-message -p '#{session_name}')

if [[ $current_session == "$scratch_session_name" ]]; then
if [[ "$TMUX_IS_POPUP" == "1" ]]; then
tmux detach
exit 0
Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
inherit mkSystemConfig inputs nixpkgs nixpkgs-stable home-manager mac-app-util darwin;
}
);
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style);
};

# =========================================================================
Expand Down
2 changes: 1 addition & 1 deletion nix/darwin/intel.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
NSAutomaticSpellingCorrectionEnabled = false;
};
dock = {
autohide = true;
autohide = false;
largesize = 42;
tilesize = 40;
magnification = true;
Expand Down
2 changes: 1 addition & 1 deletion nix/darwin/jankyborders.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let
"style=round"
"active_color=0xffbd93f9"
"inactive_color=0xffabb2bf"
"width=4.0"
"width=6.0"
"hidpi=on"
"ax_focus=on"
"blacklist='LaunchBar'"
Expand Down
6 changes: 5 additions & 1 deletion nix/hm/fish.nix
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
gtail = "git rev-list --all | tail";
ggrep = "git rev-list --all | xargs git grep --break";
tig = "TERM=xterm-256color ${pkgs.tig}/bin/tig";
lg = "lazygit";
flog = "glog";
xmerge = "git merge --ff";
xmerged = "git branch --merged master";
Expand All @@ -110,9 +111,12 @@
'';
emptytrash = "sudo rm -rf ~/.Trash/*";
kittyconf = "nvim ~/.config/kitty/kitty.conf";
stop-yabai = "yabai --stop-service";
start-yabai = "yabai --start-service";
# yabaiconf="nvim ~/.config/yabai/yabairc";
skhdconf = "nvim ~/.config/skhd/skhdrc";
tmuxin = "tmux new-session -A -s Main";
tmuxin = "tmux new-session -A -s tmux";
quickterm = "tmux new-session -A -s quickterm -c $HOME/workspace";
tm-rw = "tmux rename-window";
tm-rs = "tmux rename-session";
tail-tmp-log = "tail -f (fd --type file --search-path /tmp | fzf)";
Expand Down
2 changes: 1 addition & 1 deletion nix/hm/frontend-dev.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
];

programs.fish.interactiveShellInit = ''
eval "$(fnm env --use-on-cd)"
eval "$(fnm env)"
# otherwise in interactive shell, npm bins not available
fish_add_path "$NPM_CONFIG_PREFIX/bin"
'';
Expand Down
27 changes: 19 additions & 8 deletions nix/hm/git.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
lib,
theme,
...
}: let
}:
let
enable_delta = true;
in {
in
{
home.packages = with pkgs; [
# github cli, manage repo, gists etc.
gh
Expand All @@ -19,6 +21,12 @@ in {
guiSupport = false;
};

difftastic = {
# enable this need to disable delta.
enable = false;
background = "dark";
};

aliases = {
co = "checkout";
ad = "add";
Expand Down Expand Up @@ -139,11 +147,7 @@ in {
core = {
ignorecase = false;
autocrlf = "input";
pager = lib.mkForce (
if enable_delta
then "${pkgs.delta}/bin/delta"
else "less"
);
pager = lib.mkForce (if enable_delta then "${pkgs.delta}/bin/delta" else "less");
};
rerere = {
enabled = true;
Expand Down Expand Up @@ -174,11 +178,18 @@ in {
algorithm = "histogram";
compactionHeuristic = true;
guitool = "vscode";
tool = "nvim";
};
difftool = {
vscode = {
cmd = ''code --wait --diff $LOCAL $REMOTE'';
};
nvim = {
cmd = ''nvim -d "$REMOTE" "$LOCAL"'';
};
difft = {
cmd = ''difft --color=always "$REMOTE" "$LOCAL"'';
};
};
mergetool = {
keepBackup = false;
Expand All @@ -198,7 +209,7 @@ in {
remote = "green";
};
};
interactive = lib.mkIf enable_delta {diffFilter = "${pkgs.delta}/bin/delta --color-only";};
interactive = lib.mkIf enable_delta { diffFilter = "${pkgs.delta}/bin/delta --color-only"; };
advice = {
detachedHead = true;
};
Expand Down
10 changes: 5 additions & 5 deletions nix/hm/kitty.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
tmux = "${pkgs.tmux}/bin/tmux";
tmux_keymaps = {
"super+n" = "launch_silent ${tmux} new-window -a -c #{pane_current_path}";
"super+-" = "launch_silent ${tmux} split-window -l 25% -v -c #{pane_current_path}";
"super+\\" = "launch_silent ${tmux} split-window -l 25% -h -c #{pane_current_path}";
"super+-" = "launch_silent ${tmux} split-window -l 45% -v -c #{pane_current_path}";
# "super+\\" = "launch_silent ${tmux} split-window -l 25% -h -c #{pane_current_path}";
# don't know why, but the slash not working in some keyboard or old kitty version?
"super+/" = "launch_silent ${tmux} split-window -l 25% -h -c #{pane_current_path}";
"super+/" = "launch_silent ${tmux} split-window -l 45% -h -c #{pane_current_path}";
"super+z" = "launch_silent ${tmux} select-window -l";
# "super+w" = "launch_silent ${tmux} last-pane";
"super+w" = "launch_silent ${tmux} choose-tree -Zw -O index";
Expand Down Expand Up @@ -94,8 +94,8 @@ in {
disable_ligatures = "always";
clear_all_shortcuts = "yes";
macos_option_as_alt = "both";
# hide_window_decorations = "titlebar-only";
hide_window_decorations = "no";
hide_window_decorations = "titlebar-only";
# hide_window_decorations = "no";
notify_on_cmd_finish = "unfocused";
};
keybindings =
Expand Down
Loading
Loading