Skip to content

Commit 9201df8

Browse files
committed
Added stickybuf nvim, made commit msg hook better
1 parent a2e6fa5 commit 9201df8

File tree

5 files changed

+32
-20
lines changed

5 files changed

+32
-20
lines changed

.config/nvim/lazy-lock.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@
5757
"schemastore.nvim": { "branch": "main", "commit": "fe2ab14cf777a041b7c62af37346f7849400a754" },
5858
"statuscol.nvim": { "branch": "main", "commit": "98d02fc90ebd7c4674ec935074d1d09443d49318" },
5959
"stay-in-place.nvim": { "branch": "main", "commit": "0628b6db8970fc731abf9608d6f80659b58932c9" },
60+
"stickybuf.nvim": { "branch": "master", "commit": "4271bfc6c85dc035eb9e8484954f9179d90e87ab" },
6061
"telescope-dap.nvim": { "branch": "master", "commit": "4e2d5efb92062f0b865fe59b200b5ed7793833bf" },
6162
"telescope-live-grep-args.nvim": { "branch": "master", "commit": "851c0997d55601f2afd7290db0f90dc364e29f58" },
6263
"telescope-undo.nvim": { "branch": "main", "commit": "13c33c173e53f14df7eec5155c52a3d2ab022d8d" },
6364
"telescope-zf-native.nvim": { "branch": "master", "commit": "beb34b6c48154ec117930180f257a5592606d48f" },
6465
"telescope.nvim": { "branch": "0.1.x", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" },
6566
"toggleterm.nvim": { "branch": "main", "commit": "faee9d60428afc7857e0927fdc18daa6c409fa64" },
66-
"trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" },
6767
"vim-kitty-navigator": { "branch": "master", "commit": "c3d8aaaa61717b2c142ff39553fcab709fd606a7" },
6868
"vim-matchup": { "branch": "master", "commit": "d30b72d20f01478a8486f15a57c89fe3177373db" },
6969
"vim-projectionist": { "branch": "master", "commit": "e292c4e33b2c44074c47c06e8ce8b309fd8099bc" },

.config/nvim/lua/plugins/conform.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ return {
1919
svelte = { { 'prettierd', 'prettier' } },
2020
typescript = { { 'biome', 'prettierd', 'prettier' } },
2121
typescriptreact = { { 'biome', 'prettierd', 'prettier' } },
22-
yaml = { { 'prettierd', 'prettier' } },
22+
yaml = { { 'prettierd', 'prettier', 'yamlfmt' } },
2323
},
2424
})
2525

.config/nvim/lua/plugins/lint.lua

+2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ return {
88
local lint = require('lint')
99

1010
lint.linters_by_ft = {
11+
dockerfile = { 'hadolint' },
1112
fish = { 'fish' },
13+
yaml = { 'yamllint' },
1214
}
1315

1416
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })

.config/nvim/lua/plugins/other.lua

+7-2
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ return {
143143
opts = {
144144
scope = {
145145
show_start = false,
146-
}
147-
}
146+
},
147+
},
148148
},
149149
{
150150
'j-hui/fidget.nvim',
@@ -212,4 +212,9 @@ return {
212212
grace_period = 5,
213213
},
214214
},
215+
{
216+
'stevearc/stickybuf.nvim',
217+
event = 'BufReadPre',
218+
opts = {},
219+
},
215220
}

.git-templates/hooks/prepare-commit-msg

+21-16
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
# Supported parts are conventional commit types (`type`) and ticket numbers (`123` or `GH-123`)
44
# The branch name will result in a commit message template like this:
55
# - type-some-description -> type:
6-
# - type-GH-123-description -> type: [GH-123]
7-
# - type-123-description -> type: [#123]
8-
# - 123-description -> [#123]
6+
# - type-GH-123-description -> type: GH-123
7+
# - type-123-description -> type: #123
8+
# - 123-description -> #123
9+
# - 123-GH-124-description -> #123 GH-124
910
# - some-description ->
1011

12+
1113
set -l COMMIT_MSG_FILE $argv[1]
1214

1315
set -l EXCLUDE_BRANCHES master main dev
@@ -23,29 +25,32 @@ if test -n (head -n 1 $COMMIT_MSG_FILE)
2325
exit 0
2426
end
2527

26-
set -l PARTS (string split --max 3 '-' $BRANCH)
28+
set -l PARTS (string split '-' $BRANCH)
2729

2830
# building list of conventional commit types
2931
set CONVENTIONAL_COMMIT_TYPES build chore ci docs feat fix perf refactor revert style test
3032
for TYPE in $CONVENTIONAL_COMMIT_TYPES
31-
set -a CONVENTIONAL_COMMIT_TYPES "$TYPE!"
33+
set --append CONVENTIONAL_COMMIT_TYPES "$TYPE!"
3234
end
3335

3436
# checking if it includes conventional commit (scope not supported)
3537
if contains $PARTS[1] $CONVENTIONAL_COMMIT_TYPES
36-
set CC_TYPE "$PARTS[1]: "
37-
set -e PARTS[1]
38-
else
39-
set CC_TYPE ''
38+
set --append MESSAGE "$PARTS[1]:"
39+
set --erase PARTS[1]
4040
end
4141

4242
# checking if it includes ticket number
43-
if string match -q -r '^[A-Z]+$' $PARTS[1] && string match -q -r '^[0-9]+$' $PARTS[2]
44-
set TICKET "[$PARTS[1]-$PARTS[2]]"
45-
else if string match -q -r '^[0-9]+$' $PARTS[1]
46-
set TICKET "[#$PARTS[1]] "
47-
else
48-
set TICKET ''
43+
while test (count $PARTS) -ge 2
44+
echo $PARTS
45+
if string match -q -r '^[A-Z]+$' $PARTS[1] && string match -q -r '^[0-9]+$' $PARTS[2]
46+
set --append MESSAGE "$PARTS[1]-$PARTS[2]"
47+
set --erase PARTS[1 2]
48+
else if string match -q -r '^[0-9]+$' $PARTS[1]
49+
set --append MESSAGE "#$PARTS[1]"
50+
set --erase PARTS[1]
51+
else
52+
break
53+
end
4954
end
5055

51-
sed -i "1s/.*/$CC_TYPE$TICKET/" $COMMIT_MSG_FILE
56+
sed -i "1s/.*/$MESSAGE/" $COMMIT_MSG_FILE

0 commit comments

Comments
 (0)