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