Re-add lualine now without custom theme.

main
Joshua Potter 2023-11-30 06:17:58 -07:00
parent 0775ad0789
commit 7d290eb1d4
3 changed files with 56 additions and 2 deletions

View File

@ -2,7 +2,7 @@ args @ { config, pkgs, lib, ... }:
let let
utils = import ./utils.nix args; utils = import ./utils.nix args;
nightfox = { colorscheme = {
plugin = utils.pluginGit plugin = utils.pluginGit
"eb82712f86319272f4b7b9dbb4ec6df650e6987f" "eb82712f86319272f4b7b9dbb4ec6df650e6987f"
"EdenEast/nightfox.nvim"; "EdenEast/nightfox.nvim";
@ -11,6 +11,22 @@ let
''; '';
}; };
lualine = {
plugin = pkgs.vimPlugins.lualine-nvim;
config = ''
require('lualine').setup {
sections = {
lualine_x = {'encoding', 'filetype'},
lualine_y = {
require('init.statusline').get_active_lsp,
require('init.statusline').get_dap_status,
},
lualine_z = {'%c:%l:%%%p'},
},
}
'';
};
nvim-cmp = { nvim-cmp = {
plugin = pkgs.vimPlugins.nvim-cmp; plugin = pkgs.vimPlugins.nvim-cmp;
config = '' config = ''
@ -93,7 +109,8 @@ in
inherit (p) plugin; inherit (p) plugin;
config = "lua << EOF\n${p.config}\nEOF"; config = "lua << EOF\n${p.config}\nEOF";
} else p) [ } else p) [
nightfox colorscheme # Is always first.
lualine
nvim-cmp nvim-cmp
nvim-dap nvim-dap
nvim-lspconfig nvim-lspconfig
@ -103,6 +120,7 @@ in
pkgs.vimPlugins.cmp-nvim-lsp pkgs.vimPlugins.cmp-nvim-lsp
pkgs.vimPlugins.cmp_luasnip pkgs.vimPlugins.cmp_luasnip
pkgs.vimPlugins.luasnip pkgs.vimPlugins.luasnip
pkgs.vimPlugins.nvim-web-devicons
]; ];
viAlias = true; viAlias = true;
vimAlias = true; vimAlias = true;

View File

@ -0,0 +1,9 @@
{ pkgs }:
pkgs.stdenv.mkDerivation {
name = "lua";
src = ./.;
installPhase = ''
mkdir -p $out/
cp -r ./* $out/
'';
}

View File

@ -0,0 +1,27 @@
local M = {}
function M.get_active_lsp()
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype')
local clients = vim.lsp.get_active_clients()
if next(clients) == nil then
return ""
end
for _, client in ipairs(clients) do
local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
return string.format(" %s", client.name)
end
end
return ""
end
function M.get_dap_status()
local status = require('dap').status()
if string.len(status) > 0 then
return string.format("🪳 %s", status)
else
return ""
end
end
return M