Add lualine updates
This commit is contained in:
parent
b58786f5b4
commit
bcb3c76419
4 changed files with 80 additions and 33 deletions
|
@ -55,12 +55,16 @@ require("util").keymaps({
|
||||||
desc = "Show diagnostic list",
|
desc = "Show diagnostic list",
|
||||||
},
|
},
|
||||||
["<leader>lz"] = { ":LspRestart<CR>", desc = "Restart LSP Server" },
|
["<leader>lz"] = { ":LspRestart<CR>", desc = "Restart LSP Server" },
|
||||||
["<leader>,uu"] = { ':let @u = trim(tolower(system("uuidgen")))<cr>a<C-r>u', desc = "Generate and insert UUID" },
|
["<leader>,uu"] = { ':let @u = trim(tolower(system("uuidgen")))<cr>a<C-r>u', desc = "Generate and insert UUID" },
|
||||||
|
["<leader>b"] = { "<cmd>b#<cr>", desc = "Switch to last buffer" },
|
||||||
},
|
},
|
||||||
v = {
|
v = {
|
||||||
["J"] = { ":m '>+1<CR>gv=gv", desc = "Visually move block down" },
|
["J"] = { ":m '>+1<CR>gv=gv", desc = "Visually move block down" },
|
||||||
["K"] = { ":m '<-2<CR>gv=gv", desc = "Visually move block up" },
|
["K"] = { ":m '<-2<CR>gv=gv", desc = "Visually move block up" },
|
||||||
["<leader>,uu"] = { 'd:let @u = trim(tolower(system("uuidgen")))<cr>i<C-r>u', desc = "Generate and replace UUID" },
|
["<leader>,uu"] = {
|
||||||
|
'd:let @u = trim(tolower(system("uuidgen")))<cr>i<C-r>u',
|
||||||
|
desc = "Generate and replace UUID",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
i = {
|
i = {
|
||||||
["<C-k>"] = { "<Up>", desc = "Up" },
|
["<C-k>"] = { "<Up>", desc = "Up" },
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
-- allow use of system keyboard
|
-- allow use of system keyboard
|
||||||
-- vim.opt.clipboard = "unnamedplus"
|
-- vim.opt.clipboard = "unnamedplus"
|
||||||
|
|
||||||
|
-- global status line
|
||||||
|
vim.opt.laststatus = 3
|
||||||
|
|
||||||
-- allow use of mouse
|
-- allow use of mouse
|
||||||
vim.opt.mouse = "a"
|
vim.opt.mouse = "a"
|
||||||
|
|
||||||
|
|
|
@ -1,21 +1,73 @@
|
||||||
|
local function lsp_clients()
|
||||||
|
local clients = {}
|
||||||
|
for _, client in pairs(vim.lsp.buf_get_clients(0)) do
|
||||||
|
clients[#clients + 1] = client.name
|
||||||
|
end
|
||||||
|
|
||||||
|
return table.concat(clients, " • "), " "
|
||||||
|
end
|
||||||
|
|
||||||
|
local function langs()
|
||||||
|
local langs = {}
|
||||||
|
for _, client in pairs(vim.lsp.buf_get_clients(0)) do
|
||||||
|
local out = nil
|
||||||
|
if client.name == "pyright" then
|
||||||
|
out = vim.fn.system({ "python", "-V" })
|
||||||
|
elseif client.name == "tsserver" then
|
||||||
|
out = 'node ' .. vim.fn.system({ "node", "--version" })
|
||||||
|
end
|
||||||
|
if out ~= nil and out ~= "" then
|
||||||
|
langs[#langs + 1] = vim.trim(out)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return table.concat(langs, " • "), " "
|
||||||
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
--dependencies = {
|
opts = {
|
||||||
-- "RingOfStorms/lualine-lsp-progress",
|
options = {
|
||||||
--},
|
theme = "codedark",
|
||||||
opts = {
|
section_separators = { left = "", right = "" },
|
||||||
options = {
|
component_separators = "|",
|
||||||
theme = "codedark",
|
},
|
||||||
section_separators = { left = "", right = "" },
|
sections = {
|
||||||
component_separators = "|",
|
lualine_a = { "mode" },
|
||||||
},
|
lualine_b = { "branch", "diff", "diagnostics" },
|
||||||
sections = {
|
lualine_c = { "filename" },
|
||||||
lualine_a = { "mode" },
|
lualine_x = { lsp_clients, langs, "encoding", "filetype", "filesize" },
|
||||||
lualine_b = { "branch", "diff", "diagnostics" },
|
lualine_y = { "searchcount", "selectioncount" },
|
||||||
lualine_c = { "filename" },
|
lualine_z = { "location" },
|
||||||
lualine_x = { "encoding", "filetype", "filesize" },
|
},
|
||||||
lualine_y = { "searchcount", "selectioncount" },
|
refresh = {
|
||||||
lualine_z = { "location" },
|
statusline = 200,
|
||||||
},
|
},
|
||||||
},
|
winbar = {
|
||||||
|
lualine_a = {
|
||||||
|
{
|
||||||
|
"filename",
|
||||||
|
symbols = {
|
||||||
|
modified = "", -- Text to show when the file is modified.
|
||||||
|
readonly = "[-]", -- Text to show when the file is non-modifiable or readonly.
|
||||||
|
unnamed = "[No Name]", -- Text to show for unnamed buffers.
|
||||||
|
newfile = "[New]", -- Text to show for newly created file before first write
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
inactive_winbar = {
|
||||||
|
lualine_a = {
|
||||||
|
{
|
||||||
|
"filename",
|
||||||
|
symbols = {
|
||||||
|
modified = "", -- Text to show when the file is modified.
|
||||||
|
readonly = "[-]", -- Text to show when the file is non-modifiable or readonly.
|
||||||
|
unnamed = "[No Name]", -- Text to show for unnamed buffers.
|
||||||
|
newfile = "[New]", -- Text to show for newly created file before first write
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,17 +60,5 @@ return {
|
||||||
sort_lastused = true,
|
sort_lastused = true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
defaults = {
|
|
||||||
vimgrep_arguments = {
|
|
||||||
"rg",
|
|
||||||
"-L",
|
|
||||||
"--color=never",
|
|
||||||
"--no-heading",
|
|
||||||
"--with-filename",
|
|
||||||
"--line-number",
|
|
||||||
"--column",
|
|
||||||
"--smart-case",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue