From 92702dee8f38c61655c2c13a7ca38a9ce12408b6 Mon Sep 17 00:00:00 2001 From: Kevin Cotugno Date: Thu, 13 Dec 2018 07:24:01 -0800 Subject: [PATCH] Do not remove trailing whitespaces if the file is a diff --- .config/nvim/init.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index ffebe5c..209d831 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -52,6 +52,8 @@ set mouse=a set list set listchars=tab:――,space:·,trail:· +let g:NoClean = ["diff"] + autocmd BufRead,BufNewFile \ *.cs, \*.java @@ -105,6 +107,7 @@ endfunction function Writeable() return &buftype == '' + \ && index(g:NoClean, &filetype) == -1 \ && !&readonly \ && &modifiable \ && &modified