diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 860989d..e273551 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -2,13 +2,47 @@ return { "nvim-lualine/lualine.nvim", lazy = false, config = function() - require("lualine").setup({ + -- Default from its README then customized + -- Added metals status + require('lualine').setup { options = { - icons_enabled = false, - theme = "tokyonight", - component_separators = "|", - section_separators = "", + icons_enabled = true, + theme = 'auto', + component_separators = { left = '', right = ''}, + section_separators = { left = '', right = ''}, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + globalstatus = false, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + } }, - }) + sections = { + lualine_a = {'mode'}, + lualine_b = {'branch', 'diff', 'diagnostics'}, + lualine_c = {'filename'}, + lualine_x = {'g:metals_status', 'encoding', 'fileformat', 'filetype'}, + lualine_y = {'progress'}, + lualine_z = {'location'} + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {'filename'}, + lualine_x = {'location'}, + lualine_y = {}, + lualine_z = {} + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {} + } end, } diff --git a/lua/plugins/nvim-metals.lua b/lua/plugins/nvim-metals.lua index 1a5cf1f..8cd5bf9 100644 --- a/lua/plugins/nvim-metals.lua +++ b/lua/plugins/nvim-metals.lua @@ -10,19 +10,27 @@ return { }, config = function() local metals_config = require("metals").bare_config() + metals_config.tvp = { + icons = { + enabled = true, + }, + } metals_config.settings = { serverVersion = "latest.snapshot", showImplicitArguments = true, + showImplicitConversionsAndClasses = true, showInferredType = true, bloopSbtAlreadyInstalled = true, excludedPackages = { "akka.actor.typed.javadsl", "com.github.swagger.akka.javadsl" }, - fallbackScalaVersion = "2.13.8", + -- fallbackScalaVersion = "2.13.8", superMethodLensesEnabled = true, javaHome = "/Users/salar/.nix-profile", } metals_config.on_attach = function(client, bufnr) + vim.keymap.set("n", "tt", require("metals.tvp").toggle_tree_view) + vim.keymap.set("n", "tr", require("metals.tvp").reveal_in_tree) vim.cmd([[autocmd CursorHold lua vim.lsp.buf.document_highlight()]]) vim.cmd([[autocmd CursorMoved lua vim.lsp.buf.clear_references()]]) vim.cmd([[autocmd BufEnter,CursorHold,InsertLeave lua vim.lsp.codelens.refresh()]])