diff --git a/nvim/.config/nvim/after/plugin/statusline.lua b/nvim/.config/nvim/after/plugin/statusline.lua index 3d1194c..904967a 100644 --- a/nvim/.config/nvim/after/plugin/statusline.lua +++ b/nvim/.config/nvim/after/plugin/statusline.lua @@ -1,7 +1,10 @@ +local gps = require 'nvim-gps' local fn = vim.fn local api = vim.api local cmd = vim.cmd +gps.setup({ disable_icons = true }) + local M = {} local colors = { @@ -33,6 +36,7 @@ highlight("DiffAdded" , colors.green , colors.bg) highlight("DiffChanged" , colors.orange , colors.bg) highlight("DiffRemoved" , colors.red , colors.bg) +highlight("TSStatus" , colors.magenta, colors.bg) highlight("DiagnosticsE", colors.red , colors.bg) highlight("DiagnosticsW", colors.yellow , colors.bg) highlight("DiagnosticsI", colors.cyan , colors.bg) @@ -164,11 +168,17 @@ M.progress = function() return string.format(" %s%s", "%#Progress#", "%3p%% ") end +M.treesitter_status = function() + if gps.is_available then + return string.format("%s%s", ' %#TSStatus#', gps.get_location()) + end +end + M.set_active = function(self) return table.concat { - self:get_current_mode(), self:get_filename(), self:get_git_status(), + self:treesitter_status(), "%=", self:diagnostic_status(), self:get_line_col(), diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index c478932..8f6e82d 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -101,6 +101,7 @@ local init = function () 'chentau/marks.nvim', } use 'andymass/vim-matchup' + use 'SmiteshP/nvim-gps' end return require('packer').startup(init)