changeset 725:624d8036f5ae

feat: add window number to inactive window and a mapping to select it
author zegervdv <zegervdv@me.com>
date Sun, 11 Dec 2022 16:04:48 +0100
parents e442bbd36b87
children 2a341028a2c5
files .chezmoitemplates/init.lua
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/.chezmoitemplates/init.lua	Fri Dec 09 17:59:37 2022 +0100
+++ b/.chezmoitemplates/init.lua	Sun Dec 11 16:04:48 2022 +0100
@@ -585,12 +585,18 @@
           },
         }
 
+        local Window = {
+          provider = function() return '- ' .. vim.api.nvim_win_get_number(0) .. ' -' end,
+          hl = { fg = 'blue' },
+        }
+
         local statusline_default = { lbound, FileNameBlock, align, Diagnostics, Lsp, space, Ruler, rbound }
         local statusline_inactive = {
           condition = function() return not conditions.is_active() end,
           lbound,
           FileNameBlock,
           align,
+          Window,
           rbound,
         }
         local statusline = {
@@ -1105,6 +1111,11 @@
   vim.notify 'Copied file path and line number'
 end, { desc = 'Yank current path and line number' })
 
+-- Navigate between open windows
+for i = 1, 6 do
+  vim.keymap.set('n', '<leader>' .. i, i .. '<c-w>w', { desc = 'Go to window ' .. i })
+end
+
 -- LSP config
 local lsp = require 'lspconfig'
 local null_ls = require 'null-ls'