vim: fix string comparisons that should be case-insensitive

Regardless of the 'ignorecase' option:

    ==#   does case sensitive comparisons
    ==?   does case INsensitive comparisons

All the comparisons that were fixed here should really be case
insensitive (e.g. we want to handle BACKGROUND set to DARK instead of
dark and so on...).
This commit is contained in:
Fernando Schauenburg 2020-12-28 01:00:41 +01:00
parent 5298d16c90
commit 3c1341c2b8

View file

@ -10,7 +10,7 @@ let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc"
" Options {{{ " Options {{{
set autoindent " take indent for new line from previous line set autoindent " take indent for new line from previous line
set autoread " autom. read file when changed outside of Vim set autoread " autom. read file when changed outside of Vim
let &background = $BACKGROUND ==# 'light' ? 'light' : 'dark' let &background = $BACKGROUND ==? 'light' ? 'light' : 'dark'
set backspace=indent,eol,start " sane backspace behavior set backspace=indent,eol,start " sane backspace behavior
set nobackup " don't keep backup file after overwriting a file set nobackup " don't keep backup file after overwriting a file
set clipboard=unnamed " synchronize with system clipboard set clipboard=unnamed " synchronize with system clipboard
@ -80,7 +80,7 @@ set wrap " wrap long lines
set writebackup " make a backup before overwriting a file set writebackup " make a backup before overwriting a file
" Overrides when UTF-8 is available " Overrides when UTF-8 is available
if has('multi_byte') && &encoding ==# 'utf-8' if has('multi_byte') && &encoding ==? 'utf-8'
set fillchars=vert:┃,fold set fillchars=vert:┃,fold
set showbreak=" prefix for wrapped lines set showbreak=" prefix for wrapped lines
set listchars=tab:▷\ ,extends,precedes,trail" invisible chars set listchars=tab:▷\ ,extends,precedes,trail" invisible chars
@ -196,7 +196,7 @@ nnoremap <c-m> :tabnext<cr>
" quickly change background " quickly change background
nnoremap <leader>bg nnoremap <leader>bg
\ :let &background = &background ==# 'light' ? 'dark' : 'light'<cr> \ :let &background = &background ==? 'light' ? 'dark' : 'light'<cr>
" turn off search highlight " turn off search highlight
nnoremap <leader>h :nohlsearch<cr> nnoremap <leader>h :nohlsearch<cr>