RohanK99/dotfiles

Add ur whitespace damage check please

Opened this issue · 4 comments

Hi Sir,

I don't have write access to your repo so I cannot submit my PR. Please accept these changes:

commit 706fc89069d68903483190d749b3ec9fe2751500 (HEAD -> tyler/vim-fix, master)
Author: TyKeeling <tylerwkeeling@gmail.com>
Date:   Mon Jun 21 11:02:57 2021 -0600

    Improved Rohan's inferior .vimrc
    
    Whitespace checking is God-tier. If you don't have this, I'm afraid
    you're a scrub. I suggest you include it so that you may ascend into vim
    heaven.

diff --git a/dotfiles/.vimrc b/dotfiles/.vimrc
index d368738..4e86e8e 100644
--- a/dotfiles/.vimrc
+++ b/dotfiles/.vimrc
@@ -19,3 +19,7 @@ nnoremap j gj
 nnoremap k gk
 nnoremap B ^
 nnoremap E $
+
+highlight ExtraWhitespace ctermbg=red guibg=red
+match ExtraWhitespace /\s\+$/
+

I would argue that this is a better solution:

autocmd BufWritePre * :%s/\s\+$//e

automatically remove trailing whitespace on file write. :)

Wow. That's super sexy. I will close this issue for now out of respect for your divine wisdom

I am reopening this issue because I thought of a problem. If you use this, you may unintentionally modify code that already has whitespace damage and then ur PR would look super gross 🤮

@RohanK99 It's been 9 days with no response. Very unprofessional, smh