comparison .chezmoitemplates/init.lua @ 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
comparison
equal deleted inserted replaced
724:e442bbd36b87 725:624d8036f5ae
583 end, 583 end,
584 name = 'heirline_diagnostics', 584 name = 'heirline_diagnostics',
585 }, 585 },
586 } 586 }
587 587
588 local Window = {
589 provider = function() return '- ' .. vim.api.nvim_win_get_number(0) .. ' -' end,
590 hl = { fg = 'blue' },
591 }
592
588 local statusline_default = { lbound, FileNameBlock, align, Diagnostics, Lsp, space, Ruler, rbound } 593 local statusline_default = { lbound, FileNameBlock, align, Diagnostics, Lsp, space, Ruler, rbound }
589 local statusline_inactive = { 594 local statusline_inactive = {
590 condition = function() return not conditions.is_active() end, 595 condition = function() return not conditions.is_active() end,
591 lbound, 596 lbound,
592 FileNameBlock, 597 FileNameBlock,
593 align, 598 align,
599 Window,
594 rbound, 600 rbound,
595 } 601 }
596 local statusline = { 602 local statusline = {
597 fallthrough = false, 603 fallthrough = false,
598 hl = { bg = 'bg' }, 604 hl = { bg = 'bg' },
1103 local current_line = vim.fn.line '.' 1109 local current_line = vim.fn.line '.'
1104 require('osc52').copy(current_file:make_relative(root) .. ':' .. current_line) 1110 require('osc52').copy(current_file:make_relative(root) .. ':' .. current_line)
1105 vim.notify 'Copied file path and line number' 1111 vim.notify 'Copied file path and line number'
1106 end, { desc = 'Yank current path and line number' }) 1112 end, { desc = 'Yank current path and line number' })
1107 1113
1114 -- Navigate between open windows
1115 for i = 1, 6 do
1116 vim.keymap.set('n', '<leader>' .. i, i .. '<c-w>w', { desc = 'Go to window ' .. i })
1117 end
1118
1108 -- LSP config 1119 -- LSP config
1109 local lsp = require 'lspconfig' 1120 local lsp = require 'lspconfig'
1110 local null_ls = require 'null-ls' 1121 local null_ls = require 'null-ls'
1111 1122
1112 local lsp_formatting = function(bufnr) 1123 local lsp_formatting = function(bufnr)