From 1ebfa318c6dc6712fbbe7cbe881b8ec449dbc4a2 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 11 Aug 2017 17:39:06 +0200 Subject: vimrc: Add window number to statusline Thanks to "aegray" for asking how to jump to a specific window using automatic numbers instead of using `hjklw` on Freenode#vim. This prompted me to look up `:h winnr()`, which I remember from a long time ago, and learn that you can use the window numbers with `w`, as in `3w`. This will make it much easier to move around between my sometimes many windows. In order to be able to tell which window has which number, add the `winnr()` to the statusline. --- vimrc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'vimrc') diff --git a/vimrc b/vimrc index b2ab0a6..6437378 100644 --- a/vimrc +++ b/vimrc @@ -372,6 +372,9 @@ " 2017.06.05: " * Add ZA mapping to save all buffers and quit. " +" 2017.08.11: +" * Add window number to the statusline for quicker window movement. +" " Pathogen @@ -460,6 +463,9 @@ set statusline+=%m " File modified? flag set statusline+=%r " Readonly? flag set statusline+=\ " Separator set statusline+=-b%n- " Buffer number as -b{buffer #}- +set statusline+=\ " Separator + " Window number as -w{window #}- +set statusline+=-w%{winnr()}- set statusline+=\ " Separator set statusline+=%= " Switch to right side set statusline+=%5l " Line number (ensure space for 5 characters) -- cgit v1.2.3