Created
May 4, 2023 17:54
-
-
Save tshirtman/d3fbc3dcdb59851489864cfc10695069 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! ShowWindowNumbers() | |
for i in range(1, winnr('$')) | |
" Get the buffer and window associated with this number | |
let bufnr = winbufnr(i) | |
let winid = win_getid(i) | |
let figlet_output = system('figlet -f small ' . i ) | |
let popup_content = split(figlet_output, "\n") | |
let popup_height = 5 | |
let popup_width = 8 | |
let row = win_screenpos(i)[0] + (winheight(i) - popup_height) / 2 | |
let col = win_screenpos(i)[1] + (winwidth(i) - popup_width) / 2 | |
let popup_options = { | |
\ 'win': winid, | |
\ 'wrap': 0, | |
\ 'maxheight': popup_height, | |
\ 'maxwidth': popup_width, | |
\ 'minheight': popup_height, | |
\ 'minwidth': popup_width, | |
\ 'line': row, | |
\ 'col': col, | |
\ 'time': 3000, | |
\ 'style': 'minimal', | |
\ 'title': 'Window ' . i, | |
\ 'border': [], | |
\ } | |
call popup_create(popup_content, popup_options) | |
endfor | |
endfunction | |
nnoremap <silent> <C-w>n :call ShowWindowNumbers()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment