NvChad statusline working!
This commit is contained in:
parent
d587a8ac3e
commit
557468856d
6
init.lua
6
init.lua
|
@ -206,7 +206,7 @@ vim.g.theme = "tokyonight"
|
||||||
-- NOTE: You can change these options as you wish!
|
-- NOTE: You can change these options as you wish!
|
||||||
|
|
||||||
-- Set highlight on search
|
-- Set highlight on search
|
||||||
vim.o.hlsearch = true
|
vim.o.hlsearch = false
|
||||||
|
|
||||||
-- Make line numbers default
|
-- Make line numbers default
|
||||||
vim.wo.number = true
|
vim.wo.number = true
|
||||||
|
@ -252,8 +252,11 @@ vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
|
||||||
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||||
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||||
|
|
||||||
|
|
||||||
-- Remap for navigating between buffers
|
-- Remap for navigating between buffers
|
||||||
vim.keymap.set('n', '<leader>x', '<cmd>bd<CR>', { silent = true })
|
vim.keymap.set('n', '<leader>x', '<cmd>bd<CR>', { silent = true })
|
||||||
|
vim.keymap.set('n', '<leader>l', '<cmd>bnext<CR>', { silent = true })
|
||||||
|
vim.keymap.set('n', '<leader>h', '<cmd>bprev<CR>', { silent = true })
|
||||||
|
|
||||||
-- [[ Highlight on yank ]]
|
-- [[ Highlight on yank ]]
|
||||||
-- See `:help vim.highlight.on_yank()`
|
-- See `:help vim.highlight.on_yank()`
|
||||||
|
@ -496,6 +499,7 @@ cmp.setup {
|
||||||
behavior = cmp.ConfirmBehavior.Replace,
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
select = true,
|
select = true,
|
||||||
},
|
},
|
||||||
|
['<CR>'] = cmp.mapping.confirm({ select = false }),
|
||||||
['<Tab>'] = cmp.mapping(function(fallback)
|
['<Tab>'] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
vim.opt.statusline = "%!v:lua.require('custom.statusline.statusline').run()"
|
vim.opt.statusline = "%!v:lua.require('custom.statusline.statusline').run()"
|
||||||
|
vim.opt.laststatus = 3
|
||||||
|
|
||||||
function SetColors(theme)
|
function SetColors(theme)
|
||||||
for hlgroupName, hlgroup_vals in pairs(theme) do
|
for hlgroupName, hlgroup_vals in pairs(theme) do
|
||||||
|
|
|
@ -12,6 +12,7 @@ local separators = (type(sep_style) == "table" and sep_style) or default_sep_ico
|
||||||
|
|
||||||
local sep_l = separators["left"]
|
local sep_l = separators["left"]
|
||||||
local sep_r = separators["right"]
|
local sep_r = separators["right"]
|
||||||
|
local sep_m = default_sep_icons["block"]["left"]
|
||||||
|
|
||||||
local function stbufnr()
|
local function stbufnr()
|
||||||
return vim.api.nvim_win_get_buf(vim.g.statusline_winid)
|
return vim.api.nvim_win_get_buf(vim.g.statusline_winid)
|
||||||
|
@ -173,8 +174,9 @@ M.LSP_status = function()
|
||||||
end
|
end
|
||||||
|
|
||||||
M.cwd = function()
|
M.cwd = function()
|
||||||
local dir_icon = "%#St_cwd_icon#" .. " "
|
-- local dir_icon = "%#St_cwd_icon#" .. " "
|
||||||
local dir_name = "%#St_cwd_text#" .. " " .. fn.fnamemodify(fn.getcwd(), ":t") .. " "
|
local dir_icon = "%#St_cwd_sep#" .. sep_m
|
||||||
|
local dir_name = "%#St_file_info#" .. " " .. fn.fnamemodify(fn.getcwd(), ":t") .. " "
|
||||||
return (vim.o.columns > 85 and ("%#St_cwd_sep#" .. sep_l .. dir_icon .. dir_name)) or ""
|
return (vim.o.columns > 85 and ("%#St_cwd_sep#" .. sep_l .. dir_icon .. dir_name)) or ""
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue