Skip to content

Commit

Permalink
enhance: tweak statusline
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangyinzuo committed Oct 19, 2024
1 parent e31c32c commit c6477f4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ if has('autocmd') " vim-tiny does not have autocmd
endfunction
autocmd FileType c,cpp,cuda setlocal completefunc=MyCppCompleteFunc
set laststatus=2
set statusline=%1*%F%m%r%h%w%=%l/%L,%v\ %Y\ %{&fenc}
set statusline=%1*%F%m%r%h%w%=%l/%L:%v\ %Y\ %{&fenc}\ %{&ff}

function! MyRead(file)
" 获取文件大小
Expand Down
13 changes: 7 additions & 6 deletions root/.config/nvim/lua/plugins_setup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ function M.lualine()
local lualine_c = {}
local winbar = {}
if vim.g.vimrc_lsp == "nvim-lsp" then
lualine_b = { "branch", "diagnostics" }
lualine_b = { "branch" }
lualine_c = {
"diagnostics",
-- invoke `progress` to get lsp progress status.
require("lsp-progress").progress,
}
Expand Down Expand Up @@ -166,7 +167,7 @@ function M.lualine()
require("lualine").setup({
options = {
icons_enabled = true,
-- theme = 'solarized',
theme = "auto",
component_separators = { left = "", right = "" },
-- leave them blank, or lualine will kill intro.
-- https://github.com/nvim-lualine/lualine.nvim/issues/259#issuecomment-1890485361
Expand Down Expand Up @@ -196,17 +197,17 @@ function M.lualine()
-- 'diff' is slow
lualine_b = lualine_b,
lualine_c = lualine_c,
lualine_x = { "encoding", "fileformat", "filetype" },
lualine_x = {},
lualine_y = {},
-- file location
lualine_z = { "%l/%L,%v" },
lualine_z = { "%l/%L:%v", { "filetype", icons_enabled = false }, "encoding", "fileformat" },
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { filename },
-- file location
lualine_x = { "%l/%L,%v" },
lualine_x = { "%l/%L:%v" },
lualine_y = {},
lualine_z = {},
},
Expand Down Expand Up @@ -258,7 +259,7 @@ function M.gitsigns()
-- Text object
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>")
end,
base = vim.g.gitsign_default_base
base = vim.g.gitsign_default_base,
})
end

Expand Down
4 changes: 2 additions & 2 deletions root/.vim/vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ if has('autocmd') " vim-tiny does not have autocmd
elseif g:asyncrun_status == 'failure'
let l:result .= ''
endif
let l:result .= '%l/%L,%v %Y %{&fenc}'
let l:result .= '%l/%L:%v %Y %{&fenc} %{&ff}'
endif
return l:result
endfunction
Expand All @@ -429,7 +429,7 @@ if has('autocmd') " vim-tiny does not have autocmd
set statusline+=%2*%{%RightStatusLine()%}
endif
else
set statusline+=%l/%L,%v\ %Y\ %{&fenc}
set statusline+=%l/%L:%v\ %Y\ %{&fenc}\ %{&ff}
endif
endif

Expand Down

0 comments on commit c6477f4

Please sign in to comment.