From 9c2bb2fdb4335095be46b47f22152ceae967fcb5 Mon Sep 17 00:00:00 2001 From: breadcat Date: Thu, 11 Feb 2021 11:24:32 +0000 Subject: Update vim notes about line breaks --- content/posts/personal-vim-cheatsheet.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'content/posts') diff --git a/content/posts/personal-vim-cheatsheet.md b/content/posts/personal-vim-cheatsheet.md index f4fcfaf..764c9ae 100644 --- a/content/posts/personal-vim-cheatsheet.md +++ b/content/posts/personal-vim-cheatsheet.md @@ -1,6 +1,7 @@ --- title: "Personal VIM cheatsheet" date: 2020-06-14T12:58:00 +lastmod: 2021-02-11T11:23:00 tags : [ "Guides", "Learning", "Linux", "Servers", "Snippets", "Software", ] --- @@ -119,10 +120,12 @@ Add the below to your `init.vim` file (if using neovim): autocmd BufWritepre * %s/\n\+\%$//e ``` -Another point worth adding is sometimes files formatted outside vim will contain '^@' symbols scattered between letters. These represent null characters and can be removed by running: +Another point worth adding is sometimes files formatted outside vim will contain '^@' or '^M' symbols scattered between letters. These represent null or line break characters and can be removed by running: ``` %s/[\x0]//g +%s/\r//g ``` * **Edit 2020-12-02:** Added notes regarding reading file contents and command output. * **Edit 2021-01-02:** Added null character removal note. +* **Edit 2021-02-11:** Added additional line break removal note. -- cgit v1.2.3