Skip to content

Commit

Permalink
Title off, NvChad like statusline
Browse files Browse the repository at this point in the history
  • Loading branch information
vishnu-prabu-17366 committed Dec 17, 2023
1 parent a012acd commit 3de52e7
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 30 deletions.
2 changes: 2 additions & 0 deletions lua/astronvim/icons/nerd_font.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
return {
VimIcon = "",
ScrollText = "",
ActiveLSP = "",
ActiveTS = "",
ArrowLeft = "",
Expand Down
2 changes: 1 addition & 1 deletion lua/astronvim/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ local options = astronvim.user_opts("options", {
tabstop = 2, -- number of space in a tab
termguicolors = true, -- enable 24-bit RGB color in the TUI
timeoutlen = 500, -- shorten key timeout length a little bit for which-key
title = true, -- set terminal title to the filename and path
title = false, -- set terminal title to the filename and path
undofile = true, -- enable persistent undo
updatetime = 300, -- length of time to wait before triggering the plugin
virtualedit = "block", -- allow going past end of line in visual block mode
Expand Down
3 changes: 3 additions & 0 deletions lua/astronvim/utils/status/env.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ M.separators = astronvim.user_opts("heirline.separators", {
tab = { "", " " },
breadcrumbs = "",
path = "",
nvchad_left = { "", "" },
nvchad_right = { "", "" },
nvchad_tab = { "", "" },
})

M.attributes = astronvim.user_opts("heirline.attributes", {
Expand Down
23 changes: 14 additions & 9 deletions lua/plugins/configs/nvim-dap-ui.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
return function(_, opts)
local dap, dapui = require "dap", require "dapui"
dap.configurations.java = {
{
type = 'java';
request = 'attach';
name = "Debug";
hostName = "127.0.0.1";
port = 8000;
},
}
-- dap.adapters.java = {
-- type = 'executable',
-- command = '/usr/lib/jvm/java-1.18.0-openjdk-amd64/bin/java',
-- name = 'java',
-- }
-- dap.configurations.java = {
-- {
-- type = 'java',
-- request = 'attach',
-- name = 'Debug',
-- hostName = '127.0.0.1',
-- port = 8000,
-- },
-- }
dap.listeners.after.event_initialized["dapui_config"] = function() dapui.open() end
dap.listeners.before.event_terminated["dapui_config"] = function() dapui.close() end
dap.listeners.before.event_exited["dapui_config"] = function() dapui.close() end
Expand Down
98 changes: 78 additions & 20 deletions lua/plugins/heirline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,90 @@ return {
}, args.buf)
end,
},
statusline = { -- statusline
statusline = {
-- default highlight for the entire statusline
hl = { fg = "fg", bg = "bg" },
-- status.component.mode(),
status.component.mode({
mode_text = {
padding = {
left = 1, right = 1,
},
},
-- each element following is a component in astronvim.utils.status module
-- NvChad Statusline Styles
status.component.mode {
mode_text = { icon = { kind = "VimIcon", padding = { right = 1, left = 1 } } },
padding = { right = 1 },
surround = {
separator = "left",
color = function() return { main = status.hl.mode_bg(), } end,
separator = "nvchad_left",
color = function() return { main = status.hl.mode_bg() } end,
},
}),
status.component.git_branch(),
status.component.file_info { filetype = {}, filename = false, file_modified = false },
status.component.git_diff(),
status.component.diagnostics(),
},
status.component.file_info {
file_icon = { padding = { left = 0 } },
filename = false,
filetype = {},
padding = { right = 1 },
surround = { separator = "nvchad_left", condition = false },
},
status.component.git_branch { surround = { separator = "none" } },
status.component.git_diff { padding = { left = 1 }, surround = { separator = "none" } },
status.component.fill(),
status.component.cmd_info(),
status.component.lsp { lsp_client_names = false, surround = { separator = "none", color = "bg" } },
status.component.fill(),
status.component.lsp(),
status.component.treesitter(),
status.component.nav(),
-- status.component.mode { surround = { separator = "right" } },
status.component.diagnostics { surround = { separator = "nvchad_right" } },
status.component.lsp { lsp_progress = false, surround = { separator = "nvchad_right" } },
{
status.component.builder {
{ provider = require("astronvim.utils").get_icon "FolderClosed" },
padding = { right = 1 },
hl = { fg = "bg" },
surround = { separator = "nvchad_right", color = "buffer_picker_fg" },
},
status.component.file_info {
filename = { fname = function(nr) return vim.fn.getcwd(nr) end, padding = { left = 1 } },
file_icon = false,
file_modified = false,
file_read_only = false,
surround = { separator = "none", condition = false },
},
},
{
status.component.builder {
{ provider = require("astronvim.utils").get_icon "ScrollText" },
padding = { right = 1 },
hl = { fg = "bg" },
surround = { separator = "nvchad_right", color = { main = "treesitter_fg" } },
},
status.component.nav {
percentage = { padding = { left = 1, right = 1 }, },
ruler = { padding = { left = 1 }, },
scrollbar = false,
surround = { separator = "none" },
},
},
},
-- AstroNvim Statusline Styles
-- statusline = { -- statusline
-- hl = { fg = "fg", bg = "bg" },
-- -- status.component.mode(),
-- status.component.mode({
-- mode_text = {
-- padding = {
-- left = 1, right = 1,
-- },
-- },
-- surround = {
-- separator = "left",
-- color = function() return { main = status.hl.mode_bg(), } end,
-- },
-- }),
-- status.component.git_branch(),
-- status.component.file_info { filetype = {}, filename = false, file_modified = false },
-- status.component.git_diff(),
-- status.component.diagnostics(),
-- status.component.fill(),
-- status.component.cmd_info(),
-- status.component.fill(),
-- status.component.lsp(),
-- status.component.treesitter(),
-- status.component.nav(),
-- -- status.component.mode { surround = { separator = "right" } },
-- },
winbar = { -- winbar
init = function(self) self.bufnr = vim.api.nvim_get_current_buf() end,
fallthrough = false,
Expand Down

0 comments on commit 3de52e7

Please sign in to comment.