mos_8502 :verified: on Nostr: Here's a fun one for Vim. Put this in your ~/.vimrc:<code> noremap <C-L> ...
Here's a fun one for Vim.
Put this in your ~/.vimrc:<code> noremap <C-L> 1,$fold -s<CR><br></code>
What does this do? noremap binds a key. <C-L> means "hold control and press L". Everything after that is the command that will be run after you press Control+L. In this case, the "1,$" selects everything from the first line to the end of the file, the "!" signifies a shell command to pipe the selection through (replacing the selection with the output of the command), the command "fold -s" line-wraps the file at 80 columns on space boundaries, and "" simulates pressing the enter key.
Published at
2024-09-01 12:16:30Event JSON
{
"id": "e1a6f90a73d2b2b93316ca82bbe941f299780288266d65a162d719777e91e2f7",
"pubkey": "04f8915424c713657ad6ce59443d28dbdcf5832687c9af560ae388f59276a137",
"created_at": 1725192990,
"kind": 1,
"tags": [
[
"proxy",
"https://studio8502.ca/@mos_8502/113062247848994572",
"web"
],
[
"proxy",
"https://studio8502.ca/users/mos_8502/statuses/113062247848994572",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://studio8502.ca/users/mos_8502/statuses/113062247848994572",
"pink.momostr"
],
[
"-"
]
],
"content": "Here's a fun one for Vim.\n\nPut this in your ~/.vimrc:\u003ccode\u003e noremap \u0026lt;C-L\u0026gt; 1,$fold -s\u0026lt;CR\u0026gt;\u003cbr\u003e\u003c/code\u003e\n\nWhat does this do? noremap binds a key. \u0026lt;C-L\u0026gt; means \"hold control and press L\". Everything after that is the command that will be run after you press Control+L. In this case, the \"1,$\" selects everything from the first line to the end of the file, the \"!\" signifies a shell command to pipe the selection through (replacing the selection with the output of the command), the command \"fold -s\" line-wraps the file at 80 columns on space boundaries, and \"\" simulates pressing the enter key.",
"sig": "db0deaf2798791ee2096ae633cd8244d3c7665647ab0c27beb3d5b84750ca39e7a7c5074cc0d87d93c143bc58ded8f66f207e1863fab55d9579ce58d58ca0a54"
}