nvim lualine
This commit is contained in:
parent
ff3ff9548b
commit
fb8fe48182
@ -17,7 +17,7 @@ opt.shortmess:append{a = true, s = true, I = true, c = true, S = true} -- disab
|
||||
opt.cmdheight = 1
|
||||
vim.wo.signcolumn = "yes:1"
|
||||
|
||||
opt.shell = 'zsh'
|
||||
opt.shell = vim.env.SHELL
|
||||
|
||||
opt.ttimeoutlen = 50
|
||||
opt.timeoutlen = 500
|
||||
@ -28,6 +28,7 @@ opt.compatible = false
|
||||
|
||||
opt.hidden = true
|
||||
|
||||
-- indent
|
||||
opt.expandtab = true -- spaces instead of tab
|
||||
opt.smarttab = true
|
||||
opt.tabstop = 4 -- 1 tab appears number spaces
|
||||
@ -35,7 +36,9 @@ opt.softtabstop = 4
|
||||
opt.shiftwidth = vim.bo.tabstop -- insert tab or shift inserting .shiftwidth*.tabstop spaces or .shiftwidth/.tabstop tabs
|
||||
opt.autoindent = true
|
||||
opt.smartindent = true
|
||||
opt.showtabline = 2
|
||||
|
||||
-- tabline
|
||||
opt.showtabline = 1
|
||||
|
||||
opt.cursorline = true
|
||||
opt.wrap = false
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
|
||||
function get_formatted_cwd()
|
||||
function GET_FORMATTED_CWD()
|
||||
return vim.fn.getcwd():gsub(os.getenv("HOME"), "~")
|
||||
end
|
||||
|
||||
@ -7,14 +7,14 @@ local function get_virtual_env()
|
||||
return vim.fs.basename(os.getenv("VIRTUAL_ENV"))
|
||||
end
|
||||
|
||||
function get_formatted_virtual_env()
|
||||
function GET_FORMATTED_VIRTUAL_ENV()
|
||||
if vim.bo.filetype == 'python' then
|
||||
return "<" .. get_virtual_env() .. ">"
|
||||
end
|
||||
return ""
|
||||
end
|
||||
|
||||
function detect_indent_type()
|
||||
function DETECT_INDENT_TYPE()
|
||||
if vim.bo.expandtab then
|
||||
return vim.bo.shiftwidth .. " spaces"
|
||||
else
|
||||
@ -29,12 +29,19 @@ return {
|
||||
sections = {
|
||||
lualine_a = {'mode'},
|
||||
lualine_b = {'branch', 'diff', 'diagnostics'},
|
||||
lualine_c = {'get_formatted_cwd()'},
|
||||
lualine_x = {'get_formatted_virtual_env()', 'detect_indent_type()', 'filetype'},
|
||||
lualine_c = {
|
||||
'GET_FORMATTED_CWD()',
|
||||
{
|
||||
'filename',
|
||||
file_status = true,
|
||||
path = 1
|
||||
},
|
||||
},
|
||||
lualine_x = {'GET_FORMATTED_VIRTUAL_ENV()', 'DETECT_INDENT_TYPE()', 'filetype'},
|
||||
lualine_y = {'progress'},
|
||||
lualine_z = {'location'},
|
||||
},
|
||||
})
|
||||
end,
|
||||
dependencies = { 'kyazdani42/nvim-web-devicons' }
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user