Skip to content

Commit

Permalink
update + gha check
Browse files Browse the repository at this point in the history
  • Loading branch information
appaquet committed Sep 18, 2024
1 parent 9a949f1 commit cd89dfb
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 26 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/push-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "Push checker"
on:
pull_request:
push:
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable

- run: ./x check
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,9 @@
- `<leader>x` to save and then execute current buffer (as long as it's chmod +x)
- `<leader>z` to execute current visual selection in a shell
- `<leader>r` to save current buffer and then execute `rsync.sh` in working dir
- `<leader>q` to close the current buffer (equivalent to `:q`)
- `<leader>w` to close the current buffer by trying not to messup the layout
- `<leader>o` to close all buffers except the current one
- `<leader>q` to quit vim
- `<leader><tab>` to switch between tab and spaces
- `<ctrl>e` to toggle file etree
- `<ctrl>p` fuzzy finding file
Expand Down
8 changes: 4 additions & 4 deletions flake.lock

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

19 changes: 16 additions & 3 deletions home-manager/modules/fish.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,17 @@
gds = "git diff --staged";
gp = "git pull";
gck = "git checkout";
gcm = "git commit -m";
gcm = {
expansion = "git commit -m \"%\"";
setCursor = true;
};
gchm = "git commit -m (git log -1 --pretty=format:%s)";
gpom = "git pull origin master";
gpr = "git pull --rebase --autostash";
gpf = "git push --force-with-lease";
gca = "git commit --amend";
gr = "git rev-parse --short=7 @";
grc = "GIT_EDITOR=true git rebase --continue";
grsw = "git restore --staged --worktree";
grws = "git restore --staged --worktree";
grs = "git restore --staged";
Expand All @@ -102,8 +107,16 @@
nr = "nix run nixpkgs#(fzf-nix)";
ns = "nix shell nixpkgs#(fzf-nix)";

ai = "aichat";
aie = "aichat -e";
# TODO: Fix it with cursor since need quotes most of the time. See https://github.com/fish-shell/fish-shell/pull/9313
# https://github.com/nix-community/home-manager/blob/master/modules/programs/fish.nix#L170
ai = {
expansion = "aichat \"%\"";
setCursor = true;
};
aie = {
expansion = "aichat -e \"%\"";
setCursor = true;
};
aif = "aichat -f";
};

Expand Down
11 changes: 0 additions & 11 deletions home-manager/modules/git/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@
fzf
];

programs.fish.functions.gh-pr-select = ''
set COMMAND 'gh pr list --json number,title,author,headRefName,updatedAt \
--template "{{tablerow \"Ref\" \"PR\" \"Title\" \"Author\" \"Date\"}}{{range .}}{{tablerow (.headRefName | color \"blue\") (printf \"#%v\" .number | color \"yellow\") (.title | color \"green\") (.author.name | color \"cyan\") (timeago .updatedAt)}}{{end}}"'
GH_FORCE_TTY=100% FZF_DEFAULT_COMMAND=$COMMAND fzf \
--ansi \
--header-lines=1 \
--no-multi \
--prompt 'Search Open PRs > ' \
| awk '{print $1}'
'';

programs.git = {
enable = true;
userName = "Andre-Philippe Paquet";
Expand Down
9 changes: 3 additions & 6 deletions home-manager/modules/neovim/conf/keymap.vim
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,22 @@ map <Leader>] :bn!<CR>
map <Leader>[ :bp!<CR>
" Cleanly close buffer
map <D-0> :Bclose<CR>
nmap <leader>w :Bclose<CR>
map <leader>w :BufDel<CR>
map <leader>o :BufDelOthers<CR>
" Execute current file or selection
map <Leader>x :w<CR>:!./%<CR>
map <Leader>z :'<,'>w !sh<CR>
map <D-r>r :!./rsync.sh<CR>
map <Leader>r :!./rsync.sh<CR>
" Clipboard
map <Leader>y :w !pbcopy<CR><CR>
map <Leader>p :read !pbpaste<CR>
" Save & quit
map <D-x> :w<CR>:!./%<CR>
map <D-s> :w<CR>
map <Leader>s :w<CR>
map <D-q> :q<CR>
map <Leader>q :q<CR>
map <Leader>q :qa<CR>
" For when you forget to sudo.. Really Write the file.
cmap w!! w !sudo tee % >/dev/null
Expand Down
2 changes: 1 addition & 1 deletion home-manager/modules/neovim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
fzf-vim # :Files (ctrl-p), :Rg (ctrl-f), :History (ctrl-l)
Rename # :Rename <new name>
vim-multiple-cursors # ctrl-n multi cursors
bclose-vim # close buffer cleanly via <leader>w
nvim-bufdel # :BufDel, :BufDelOthers (properly close buffers)
delimitMate # auto close quotes, parens, etc
nerdcommenter # block comment (<leader>cc, <leader>cu)

Expand Down

0 comments on commit cd89dfb

Please sign in to comment.