less: Open file (also stdin) in vim with e/E
The current file can be edited with `v` already, but this doesn't work when reading from stdin.
This commit is contained in:
@@ -1,6 +1,17 @@
|
|||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
# Copyright (c) 2025 Julian Prein
|
# Copyright (c) 2025 Julian Prein
|
||||||
|
|
||||||
|
#command
|
||||||
|
|
||||||
|
# NOTE: the current file can be edited with `v` already, but this doesn't work
|
||||||
|
# when reading from stdin
|
||||||
|
# NOTE: ^P omits the "done" message
|
||||||
|
#
|
||||||
|
# edit in vim without any ANSI SGR sequences (e.g. color)
|
||||||
|
e noaction g|$no-ansi-sgr | nvim -\n
|
||||||
|
# edit in vim while keeping them
|
||||||
|
E noaction g|$nvim -\n
|
||||||
|
|
||||||
#env
|
#env
|
||||||
# NOTE: Lines need a trailing space when concatenating
|
# NOTE: Lines need a trailing space when concatenating
|
||||||
|
|
||||||
|
|||||||
8
.local/bin/no-ansi-sgr
Executable file
8
.local/bin/no-ansi-sgr
Executable file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sed -f
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
# Copyright (c) 2025 Julian Prein
|
||||||
|
#
|
||||||
|
# Remove ANSI SGR (Select Graphic Rendition) escape sequences, e.g. setting
|
||||||
|
# color or bold font.
|
||||||
|
|
||||||
|
s/\[[^m]*m//g
|
||||||
Reference in New Issue
Block a user