diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 63df688..797dc5f 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -55,12 +55,16 @@ require("util").keymaps({ desc = "Show diagnostic list", }, ["lz"] = { ":LspRestart", desc = "Restart LSP Server" }, - [",uu"] = { ':let @u = trim(tolower(system("uuidgen")))au', desc = "Generate and insert UUID" }, + [",uu"] = { ':let @u = trim(tolower(system("uuidgen")))au', desc = "Generate and insert UUID" }, + ["b"] = { "b#", desc = "Switch to last buffer" }, }, v = { ["J"] = { ":m '>+1gv=gv", desc = "Visually move block down" }, ["K"] = { ":m '<-2gv=gv", desc = "Visually move block up" }, - [",uu"] = { 'd:let @u = trim(tolower(system("uuidgen")))iu', desc = "Generate and replace UUID" }, + [",uu"] = { + 'd:let @u = trim(tolower(system("uuidgen")))iu', + desc = "Generate and replace UUID", + }, }, i = { [""] = { "", desc = "Up" }, diff --git a/lua/options.lua b/lua/options.lua index 24cd8c1..4d8baa7 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -1,6 +1,9 @@ -- allow use of system keyboard -- vim.opt.clipboard = "unnamedplus" +-- global status line +vim.opt.laststatus = 3 + -- allow use of mouse vim.opt.mouse = "a" diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index f4a6d6c..781c3bb 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -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 { - "nvim-lualine/lualine.nvim", - --dependencies = { - -- "RingOfStorms/lualine-lsp-progress", - --}, - opts = { - options = { - theme = "codedark", - section_separators = { left = "", right = "" }, - component_separators = "|", - }, - sections = { - lualine_a = { "mode" }, - lualine_b = { "branch", "diff", "diagnostics" }, - lualine_c = { "filename" }, - lualine_x = { "encoding", "filetype", "filesize" }, - lualine_y = { "searchcount", "selectioncount" }, - lualine_z = { "location" }, - }, - }, + "nvim-lualine/lualine.nvim", + opts = { + options = { + theme = "codedark", + section_separators = { left = "", right = "" }, + component_separators = "|", + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch", "diff", "diagnostics" }, + lualine_c = { "filename" }, + lualine_x = { lsp_clients, langs, "encoding", "filetype", "filesize" }, + lualine_y = { "searchcount", "selectioncount" }, + lualine_z = { "location" }, + }, + refresh = { + 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 + }, + }, + }, + }, + }, } diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 5b6d40f..bb4ffd3 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -60,17 +60,5 @@ return { sort_lastused = true, } }, - defaults = { - vimgrep_arguments = { - "rg", - "-L", - "--color=never", - "--no-heading", - "--with-filename", - "--line-number", - "--column", - "--smart-case", - }, - }, }, }