Raj
Raj

Reputation: 3462

VIM Airline status line does not show caps lock

I would like to see if the caps-lock is ON or OFF in my vim-airline status bar for reasons mentioned here. I installed vim-capslock in my bundle and set the variable as let g:airline#extensions#capslock#enabled = 1. However, I don't see any difference after opening the VIM. I don't see a caps-lock status in the status line. My airline configuration is as below in ~/.vimrc

let g:airline_theme='wombat'

" Enable the list of buffers
let g:airline#extensions#tabline#enabled = 1

" Show just the filename
let g:airline#extensions#tabline#fnamemod = ':t'

" Show capslock status in the statusline
let g:airline#extensions#capslock#enabled = 1

I was expecting CAPS in the status line if the caps-lock was ON. Am I doing anything wrong?

Upvotes: 1

Views: 925

Answers (1)

Dan Lowe
Dan Lowe

Reputation: 56657

I think you're misunderstanding how vim-capslock works. It implements a software caps-lock in Vim, which affects text you type, but does not affect command keys. And it exports that status so Airline can display it. But it has nothing to do with the hardware caps lock key on your keyboard. I'm not aware of a way to detect the capslock on a keyboard reliably.

Upvotes: 3

Related Questions