Compare commits
5 Commits
1ee41e1c5b
...
fc0cf2ff0a
| Author | SHA1 | Date | |
|---|---|---|---|
|
fc0cf2ff0a
|
|||
|
4a12ed8567
|
|||
|
8380d4cc29
|
|||
|
bbf9a1da58
|
|||
|
75fb2f56a2
|
@@ -153,9 +153,10 @@ nmap <leader>grc :let subject=system('git show -s --date=short --pretty="format:
|
|||||||
nmap <leader>gso :r!git config --get user.name<CR>:r!git config --get user.email<CR>I<<ESC>A><ESC>kJISigned-off-by: <ESC>
|
nmap <leader>gso :r!git config --get user.name<CR>:r!git config --get user.email<CR>I<<ESC>A><ESC>kJISigned-off-by: <ESC>
|
||||||
|
|
||||||
" Add, stash or checkout the current file
|
" Add, stash or checkout the current file
|
||||||
nmap <leader>ga <Cmd>!git add -- %<CR>
|
" TODO: Conflict with <leader>gf
|
||||||
nmap <leader>gs <Cmd>!git stash -- %<CR>
|
"nmap <leader>gfa <Cmd>!git add -- %<CR>
|
||||||
nmap <leader>gu <Cmd>!git checkout -- %<CR>
|
"nmap <leader>gfs <Cmd>!git stash -- %<CR>
|
||||||
|
"nmap <leader>gfu <Cmd>!git checkout -- %<CR>
|
||||||
|
|
||||||
if exists('g:loaded_fugitive')
|
if exists('g:loaded_fugitive')
|
||||||
" Interactive `git status`
|
" Interactive `git status`
|
||||||
@@ -176,15 +177,12 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if exists('g:loaded_gitgutter')
|
if exists('g:loaded_gitgutter')
|
||||||
" Add `g` prefix to hunk bindings
|
" Mnemonic: "git <add|undo|preview>"
|
||||||
" Mnemonic: "git hunk <add|undo|preview>"
|
nmap <leader>ga <Plug>(GitGutterStageHunk)
|
||||||
nmap <leader>gha <Plug>(GitGutterStageHunk)
|
|
||||||
" TODO: nmap <leader>ghs <Plug>(GitGutterStashHunk)
|
|
||||||
nmap <leader>ghu <Plug>(GitGutterUndoHunk)
|
|
||||||
nmap <leader>ghp <Plug>(GitGutterPreviewHunk)
|
|
||||||
|
|
||||||
" StageHunk can be used for single lines. Mnemonic w/o `h`unk
|
|
||||||
xmap <leader>ga <Plug>(GitGutterStageHunk)
|
xmap <leader>ga <Plug>(GitGutterStageHunk)
|
||||||
|
" TODO: nmap <leader>gs <Plug>(GitGutterStashHunk)
|
||||||
|
nmap <leader>gu <Plug>(GitGutterUndoHunk)
|
||||||
|
nmap <leader>gp <Plug>(GitGutterPreviewHunk)
|
||||||
|
|
||||||
" Add hunk/h version to textobject bindings that use `c` (for `change I
|
" Add hunk/h version to textobject bindings that use `c` (for `change I
|
||||||
" presume?) (e.g. ic -> ih)
|
" presume?) (e.g. ic -> ih)
|
||||||
|
|||||||
7
.local/bin/no-ansi
Executable file
7
.local/bin/no-ansi
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
# Copyright (c) 2025 Julian Prein
|
||||||
|
#
|
||||||
|
# Remove ANSI escape sequences.
|
||||||
|
|
||||||
|
env LC_ALL=C sed 's/\[[0-?]*[ -/]*[@-z]//g'
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
#!/bin/sed -f
|
#!/bin/sh
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
# Copyright (c) 2025 Julian Prein
|
# Copyright (c) 2025 Julian Prein
|
||||||
#
|
#
|
||||||
# Remove ANSI SGR (Select Graphic Rendition) escape sequences, e.g. setting
|
# Remove ANSI SGR (Select Graphic Rendition) escape sequences, e.g. setting
|
||||||
# color or bold font.
|
# color or bold font.
|
||||||
|
|
||||||
s/\[[^m]*m//g
|
env LC_ALL=C sed 's/\[[0-?]*[ -/]*m//g'
|
||||||
|
|||||||
@@ -68,6 +68,11 @@ BKP_IFS="$IFS"
|
|||||||
IFS='
|
IFS='
|
||||||
'
|
'
|
||||||
for line in $body; do
|
for line in $body; do
|
||||||
[[ ${#line} -le 72 ]] || die "Body lines too long. (<= 72)"
|
[[ ${#line} -gt 72 ]] || continue
|
||||||
|
|
||||||
|
# Allow links on single lines and in trailers
|
||||||
|
[[ ! $line =~ ^([-A-Za-z0-9]*:)?[\ \ ]*https?://[^\ ]*$ ]] || continue
|
||||||
|
|
||||||
|
die "Body lines too long. (<= 72)"
|
||||||
done
|
done
|
||||||
IFS="$BKP_IFS"
|
IFS="$BKP_IFS"
|
||||||
|
|||||||
Reference in New Issue
Block a user