RohanK99 / dotfiles

0 stars 0 forks source link

Add ur whitespace damage check please #1

Open TyKeeling opened 3 years ago

TyKeeling commented 3 years ago

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\+$/
+
RohanK99 commented 3 years ago

I would argue that this is a better solution:

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

automatically remove trailing whitespace on file write. :)

TyKeeling commented 3 years ago

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

TyKeeling commented 3 years ago

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 🤮

TyKeeling commented 3 years ago

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