From 20044c837d2cafdea9b0c0d395a9dbee0e76c455 Mon Sep 17 00:00:00 2001 From: andy Date: Sun, 13 Apr 2025 09:57:09 -0700 Subject: [PATCH] updates --- init.lua | 55 +++++++++++++++++----------------- lua/custom/plugins/lualine.lua | 47 +++++++++++++++++++++++++++++ lua/custom/plugins/oil.lua | 16 +++++++++- 3 files changed, 90 insertions(+), 28 deletions(-) create mode 100644 lua/custom/plugins/lualine.lua diff --git a/init.lua b/init.lua index d61be613..483cc2ef 100644 --- a/init.lua +++ b/init.lua @@ -329,7 +329,7 @@ require('lazy').setup({ -- }, defaults = { path_display = { - shorten = 2, + shorten = 4, }, }, -- pickers = {} @@ -346,7 +346,7 @@ require('lazy').setup({ -- See `:help telescope.builtin` local builtin = require 'telescope.builtin' - vim.keymap.set('n', '', builtin.find_files) + vim.keymap.set('n', '', builtin.oldfiles) vim.keymap.set('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) @@ -551,19 +551,20 @@ require('lazy').setup({ [vim.diagnostic.severity.HINT] = '󰌶 ', }, } or {}, - virtual_text = { - source = 'if_many', - spacing = 2, - format = function(diagnostic) - local diagnostic_message = { - [vim.diagnostic.severity.ERROR] = diagnostic.message, - [vim.diagnostic.severity.WARN] = diagnostic.message, - [vim.diagnostic.severity.INFO] = diagnostic.message, - [vim.diagnostic.severity.HINT] = diagnostic.message, - } - return diagnostic_message[diagnostic.severity] - end, - }, + virtual_text = false, + -- virtual_text = { + -- source = 'if_many', + -- spacing = 2, + -- format = function(diagnostic) + -- local diagnostic_message = { + -- [vim.diagnostic.severity.ERROR] = diagnostic.message, + -- [vim.diagnostic.severity.WARN] = diagnostic.message, + -- [vim.diagnostic.severity.INFO] = diagnostic.message, + -- [vim.diagnostic.severity.HINT] = diagnostic.message, + -- } + -- return diagnostic_message[diagnostic.severity] + -- end, + -- }, } -- LSP servers and clients are able to communicate to each other what features they support. @@ -850,22 +851,22 @@ require('lazy').setup({ -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren -- - sd' - [S]urround [D]elete [']quotes -- - sr)' - [S]urround [R]eplace [)] ['] - require('mini.surround').setup() + -- require('mini.surround').setup() -- Simple and easy statusline. -- You could remove this setup call if you don't like it, -- and try some other statusline plugin - local statusline = require 'mini.statusline' - -- set use_icons to true if you have a Nerd Font - statusline.setup { use_icons = vim.g.have_nerd_font } - - -- You can configure sections in the statusline by overriding their - -- default behavior. For example, here we set the section for - -- cursor location to LINE:COLUMN - ---@diagnostic disable-next-line: duplicate-set-field - statusline.section_location = function() - return '%2l:%-2v' - end + -- local statusline = require 'mini.statusline' + -- -- set use_icons to true if you have a Nerd Font + -- statusline.setup { use_icons = vim.g.have_nerd_font } + -- + -- -- You can configure sections in the statusline by overriding their + -- -- default behavior. For example, here we set the section for + -- -- cursor location to LINE:COLUMN + -- ---@diagnostic disable-next-line: duplicate-set-field + -- statusline.section_location = function() + -- return '%2l:%-2v' + -- end -- ... and there is more! -- Check out: https://github.com/echasnovski/mini.nvim diff --git a/lua/custom/plugins/lualine.lua b/lua/custom/plugins/lualine.lua new file mode 100644 index 00000000..a27d56e7 --- /dev/null +++ b/lua/custom/plugins/lualine.lua @@ -0,0 +1,47 @@ +return { + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + init = function() + require('lualine').setup { + options = { + icons_enabled = true, + theme = 'auto', + component_separators = { left = '', right = '' }, + section_separators = { left = '', right = '' }, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + always_show_tabline = true, + globalstatus = false, + refresh = { + statusline = 100, + tabline = 100, + winbar = 100, + }, + }, + sections = { + lualine_a = { 'mode' }, + lualine_b = { 'branch', 'diff' }, + lualine_c = { 'local', 'filename' }, + lualine_x = {}, + lualine_y = {}, + lualine_z = {}, + }, + 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/custom/plugins/oil.lua b/lua/custom/plugins/oil.lua index 7d41351e..7cc73bdd 100644 --- a/lua/custom/plugins/oil.lua +++ b/lua/custom/plugins/oil.lua @@ -9,10 +9,24 @@ return { skip_confirm_for_simple_edits = true, float = { - max_width = 0.8, + padding = 2, + max_width = 90, + max_height = 0, + }, + win_options = { + wrap = true, + winblend = 0, + }, + keymaps = { + [''] = false, + [''] = 'actions.close', }, view_options = { show_hidden = true, + natural_order = true, + is_always_hidden = function(name, _) + return name == '..' or name == '.git' + end, }, }, -- Optional dependencies