diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-10-30 17:21:41 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-10-30 17:23:51 +1300 |
commit | dc5d23f3b64d82ac692151d6141023baf4cd3397 (patch) | |
tree | 18f81692ba07d262440353c96676f6a337f5d177 /vim | |
parent | Update submodules (diff) | |
download | dotfiles-dc5d23f3b64d82ac692151d6141023baf4cd3397.tar.gz dotfiles-dc5d23f3b64d82ac692151d6141023baf4cd3397.zip |
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.
Diffstat (limited to 'vim')
-rw-r--r-- | vim/config/format.vim | 2 | ||||
-rw-r--r-- | vim/config/linebreak.vim | 6 | ||||
-rw-r--r-- | vim/config/syntax.vim | 2 | ||||
-rw-r--r-- | vim/vimrc | 4 |
4 files changed, 7 insertions, 7 deletions
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 @@ -26,8 +26,8 @@ if v:version >= 701 " The 'sahara' colorscheme only works for dark backgrounds with 256 colors if has('syntax') - \ && &background == 'dark' - \ && (has('gui_running') || &t_Co == 256) + \ && &background ==# 'dark' + \ && (has('gui_running') || &t_Co ==# 256) silent! colorscheme sahara endif endif |