From dc5d23f3b64d82ac692151d6141023baf4cd3397 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 30 Oct 2017 17:21:41 +1300 Subject: Use ==# consistently in Vim config I got a set of warnings from vim-vint about using just "==" for these comparisons: >Use robust operators `==#` or `==?` instead of `==` (see Google >VimScript Style Guide (Matching)) It does seem a lot more sensible to be explicit about case sensitivity, and not to lean on the configured 'ignorecase' value, especially if the user changes it. --- vim/config/format.vim | 2 +- vim/config/linebreak.vim | 6 +++--- vim/config/syntax.vim | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'vim/config') diff --git a/vim/config/format.vim b/vim/config/format.vim index cbc995af..fadbd8f7 100644 --- a/vim/config/format.vim +++ b/vim/config/format.vim @@ -1,6 +1,6 @@ " If we can, add j to the format options to get rid of comment leaders when " joining lines -if v:version > 703 || v:version == 703 && has('patch541') +if v:version > 703 || v:version ==# 703 && has('patch541') set formatoptions+=j endif diff --git a/vim/config/linebreak.vim b/vim/config/linebreak.vim index 887d5f39..5abdabd1 100644 --- a/vim/config/linebreak.vim +++ b/vim/config/linebreak.vim @@ -4,7 +4,7 @@ if has('linebreak') set linebreak set showbreak=... - if v:version > 704 || v:version == 704 && has('patch338') + if v:version > 704 || v:version ==# 704 && has('patch338') set breakindent endif @@ -15,13 +15,13 @@ if has('linebreak') if &linebreak set nolinebreak set showbreak= - if v:version > 704 || v:version == 704 && has('patch338') + if v:version > 704 || v:version ==# 704 && has('patch338') set nobreakindent endif else set linebreak set showbreak=... - if v:version > 704 || v:version == 704 && has('patch338') + if v:version > 704 || v:version ==# 704 && has('patch338') set breakindent endif endif diff --git a/vim/config/syntax.vim b/vim/config/syntax.vim index df75b3f0..08b908c8 100644 --- a/vim/config/syntax.vim +++ b/vim/config/syntax.vim @@ -19,7 +19,7 @@ if has('syntax') let l:bg = len(l:colorfgbg) ? l:colorfgbg[-1] : '' " Choose the background setting based on this value - if l:bg == 'default' || l:bg == '7' || l:bg == '15' + if l:bg ==# 'default' || l:bg ==# '7' || l:bg ==# '15' set background=light else set background=dark -- cgit v1.2.3