diff options
author | Teddy Wing | 2017-08-11 17:39:06 +0200 |
---|---|---|
committer | Teddy Wing | 2017-08-11 17:39:06 +0200 |
commit | 1ebfa318c6dc6712fbbe7cbe881b8ec449dbc4a2 (patch) | |
tree | b7068dda5738881ae1f8565d9a16168202774521 | |
parent | 3b19528857de2c199cddabbb48278ead59b77b89 (diff) | |
download | dotvim-1ebfa318c6dc6712fbbe7cbe881b8ec449dbc4a2.tar.bz2 |
vimrc: Add window number to statusline
Thanks to "aegray" for asking how to jump to a specific window using
automatic numbers instead of using `<C-w>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 `<C-w>w`, as in
`3<C-w>w`.
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.
-rw-r--r-- | vimrc | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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 @@ -461,6 +464,9 @@ 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) set statusline+=, " Comma separator |