diff options
| author | Elvis Claros Castro <elvis@claros.ar> | 2024-08-23 09:40:05 -0300 |
|---|---|---|
| committer | Elvis Claros Castro <elvis@claros.ar> | 2024-08-23 09:40:05 -0300 |
| commit | 969aa6d3444f857c383b0e271febe087cd224349 (patch) | |
| tree | 626929d795c5e4c262afb00570a87f3df0212fc3 /lua/plugins | |
| parent | 59ab00e081d92db8760d65f3146f4156a962d5e4 (diff) | |
| download | nvim-conf-969aa6d3444f857c383b0e271febe087cd224349.tar.gz nvim-conf-969aa6d3444f857c383b0e271febe087cd224349.zip | |
Feat: update
Diffstat (limited to 'lua/plugins')
| -rw-r--r-- | lua/plugins/colorize.lua | 20 | ||||
| -rw-r--r-- | lua/plugins/colorscheme.lua | 115 | ||||
| -rw-r--r-- | lua/plugins/lualine.lua | 317 | ||||
| -rw-r--r-- | lua/plugins/oil.lua | 15 | ||||
| -rw-r--r-- | lua/plugins/rustaceanvim.lua | 2 |
5 files changed, 320 insertions, 149 deletions
diff --git a/lua/plugins/colorize.lua b/lua/plugins/colorize.lua index 89d4039..41a4006 100644 --- a/lua/plugins/colorize.lua +++ b/lua/plugins/colorize.lua @@ -1,5 +1,19 @@ return { - "norcalli/nvim-colorizer.lua", - event = "VeryLazy", - config = true, + 'norcalli/nvim-colorizer.lua', + config = function() + require('colorizer').setup({ + 'css', + 'lua', + }, { + RGB = true, -- Colorear valores RGB + RRGGBB = true, -- Deshabilitar otros formatos + names = false, -- Deshabilitar nombres de colores como "Red" + RRGGBBAA = true, -- Deshabilitar valores RGBA + rgb_fn = true, -- Deshabilitar funciones rgb() y rgba() + hsl_fn = true, -- Deshabilitar funciones hsl() y hsla() + css = false, -- Deshabilitar otros valores CSS + css_fn = false, -- Deshabilitar funciones CSS + }) + end } + diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua index b72b76f..376feee 100644 --- a/lua/plugins/colorscheme.lua +++ b/lua/plugins/colorscheme.lua @@ -1,40 +1,81 @@ return { - { - 'catppuccin/nvim', - name = 'catppuccin', - lazy = false, - priority = 1000, - opts = { - flavour = 'frappe', - transparent_background = true, - integrations = { - mason = true, - mini = true, - native_lsp = { - underlines = { - errors = { 'undercurl' }, - hints = { 'undercurl' }, - warnings = { 'undercurl' }, - information = { 'undercurl' }, - }, - }, - treesitter_context = true, - which_key = true, + "craftzdog/solarized-osaka.nvim", + lazy = false, + priority = 1000, + opts = {}, + config = function() + + -- Colorscheme Solarized Osaka by Takuya Matsuyama (https://github.com/craftzdog/solarized-osaka.nvim) + require("solarized-osaka").setup({ + -- your configuration comes here + -- or leave it empty to use the default settings + transparent = true, -- Enable this to disable setting the background color + terminal_colors = true, -- Configure the colors used when opening a `:terminal` in [Neovim](https://github.com/neovim/neovim) + styles = { + -- Style to be applied to different syntax groups + -- Value is any valid attr-list value for `:help nvim_set_hl` + comments = { italic = true }, + keywords = { italic = true }, + functions = { italic = true }, + variables = { bold = true}, + -- Background styles. Can be "dark", "transparent" or "normal" + sidebars = "dark", -- style for sidebars, see below + floats = "dark", -- style for floating windows }, - }, - config = function(_, opts) - require('catppuccin').setup(opts) - vim.cmd.colorscheme 'catppuccin' - end, - }, - { - 'stevearc/dressing.nvim', - event = 'VeryLazy', - opts = { - input = { - insert_only = false, - start_in_insert = false, - }, - }, - }, + sidebars = { "qf", "help" }, -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]` + day_brightness = 0.3, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors + hide_inactive_statusline = false, -- Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**. + dim_inactive = false, -- dims inactive windows + lualine_bold = true, -- When `true`, section headers in the lualine theme will be bold + + --- You can override specific color groups to use other groups or a hex color + --- function will be called with a ColorScheme table + ---@param colors ColorScheme + on_colors = function(colors) end, + + --- You can override specific highlights to use other groups or a hex color + --- function will be called with a Highlights and ColorScheme table + ---@param highlights Highlights + ---@param colors ColorScheme + on_highlights = function(hl, c) + hl.IblIndent = { fg = c.base03, nocombine = true } + hl.IndentBlanklineChar = { fg = c.blue, nocombine = true } + hl.IndentBlanklineContextChar = { fg = c.orange500, nocombine = true } + + local prompt = "#2d3149" + hl.TelescopeNormal = { + bg = c.bg_dark, + fg = c.fg_dark, + } + hl.TelescopeBorder = { + bg = c.bg_dark, + fg = c.bg_dark, + } + hl.TelescopePromptNormal = { + bg = prompt, + } + hl.TelescopePromptBorder = { + bg = prompt, + fg = prompt, + } + hl.TelescopePromptTitle = { + bg = prompt, + fg = prompt, + } + hl.TelescopePreviewTitle = { + bg = c.bg_dark, + fg = c.bg_dark, + } + hl.TelescopeResultsTitle = { + bg = c.bg_dark, + fg = c.bg_dark, + } + end, + }) + + + -- setup must be called before loading + vim.cmd.colorscheme "solarized-osaka" + + end } diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index b5a4b47..88a0fec 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -1,127 +1,232 @@ return { - { - 'nvim-lualine/lualine.nvim', - dependencies = { - 'kyazdani42/nvim-web-devicons', - 'arkav/lualine-lsp-progress', - }, - opts = function() - local function winnr() return ' ' .. vim.fn.winnr() end - local function bufnr() return ' ' .. vim.fn.bufnr() end - - local function lualine_c(filename_opts) - filename_opts = filename_opts or {} - - return { - { - 'filetype', - icon_only = true, - separator = '', - padding = { left = 1, right = 0 }, - }, - { - 'filename', - file_status = filename_opts.file_status, - padding = 0, - path = filename_opts.fullpath and 1, - separator = '', - }, - } + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function() + + local colors = require("solarized-osaka.colors").setup({ transform = true }) + local config = require("solarized-osaka.config").options + + local solarized_osaka = { + normal = { + a = { bg = colors.base03, fg = colors.blue100 }, + b = { bg = colors.fg, fg = colors.black }, + c = { bg = colors.bg_statusline, fg = colors.fg }, + }, + insert = { + a = { bg = colors.base03, fg = colors.green100 }, + }, + + command = { + a = { bg = colors.base03, fg = colors.yellow100 }, + }, + + visual = { + a = { bg = colors.base03, fg = colors.magenta100 }, + }, + + replace = { + a = { bg = colors.base03, fg = colors.red100 }, + }, + + terminal = { + a = { bg = colors.base03, fg = colors.orange100 }, + }, + + inactive = { + a = { bg = colors.bg_statusline, fg = colors.blue }, + b = { bg = colors.bg_statusline, fg = colors.fg, gui = "bold" }, + c = { bg = colors.bg_statusline, fg = colors.fg }, + } + } + + for _, mode in pairs(solarized_osaka) do + if config.lualine_bold then + mode.a.gui = "bold" end + end - local sections = { - lualine_a = { winnr }, - lualine_b = { bufnr }, - lualine_d = lualine_c { fullpath = true }, - lualine_x = { 'searchcount' }, - lualine_y = { - "diagnostics", - "diff", + -- local empty = require('lualine.component'):extend() + + -- local function jarak() + -- return ' ' + -- end + + local empty = require('lualine.component'):extend() + function empty:draw(default_highlight) + self.status = '' + self.applied_separator = '' + self:apply_highlights(default_highlight) + self:apply_section_separators() + return self.status + end + + local function process_sections(sections) + for name, section in pairs(sections) do + local left = name:sub(9, 10) < 'x' + for pos = 1, name ~= 'lualine_z' and #section or #section - 1 do + table.insert(section, pos * 2, { empty, color = { fg = colors.base03, bg = colors.base03 } }) + end + for id, comp in ipairs(section) do + if type(comp) ~= 'table' then + comp = { comp } + section[id] = comp + end + -- comp.separator = left and { right = '' } or { left = '' } + comp.separator = left and { right = ' ' } or { left = ' '} + -- comp.separator = {left = '' } and { right = '' } + end + end + return sections + end + + local lazy_status = require("lazy.status") + + require('lualine').setup{ + options = + { + theme = solarized_osaka, + -- icons_enabled = true, + -- component_separators = { left = '>', right = '┇' }, + -- section_separators = {left = '', right = '' }, + }, + sections = process_sections { + lualine_a = { + { 'mode', + -- icons_enabled = true, + icon = { + " ", + color = { fg = colors.base4, bg = colors.base03, gui = 'bold'} + }, + -- color = { fg = colors.base0, bg = colors.green300, gui = 'bold' }, + -- separator = { left = '', right = '' }, + -- left_padding = 2, right_padding = 0, + }, + }, + -- lualine_b = { 'filename', 'branch' }, + lualine_b = { { - require("noice").api.status.mode.get, - cond = require("noice").api.status.mode.has, - color = { fg = "#ff9e64" }, + 'branch', + -- separator = { left = '', right = '' }, + -- left_padding = 0, right_padding = 2, + icon = { + "", + -- align = 'left', + color = { fg = colors.orange100, bg = colors.base03, gui = 'bold'}, + -- -- separator = {left = '', right = ''} + }, + -- left_padding = 0, + color = { fg = colors.orange100, bg = colors.base03, gui = 'bold' }, }, { - require("lazy.status").updates, - cond = require("lazy.status").has_updates, - color = { fg = "ff9e64" }, + 'diff', + -- separator = { right = '',left = ''}, + colored = true, + symbols = { added = " " , modified = " " , removed = " " }, + diff_color = { + added = { fg = colors.green300, bg = colors.base03, gui = 'bold' }, + modified = { fg = colors.yellow300, bg = colors.base03, gui = 'bold' }, + removed = { fg = colors.red300, bg = colors.base03, gui = 'bold' }, + } }, }, - lualine_z = { 'progress' }, - } - - return { - options = { - disabled_filetypes = { 'pi', 'dbui', 'fugitiveblame' }, - theme = 'catppuccin', - }, - tabline = { - lualine_a = { - 'mode', - 'selectioncount', - function() return vim.fn.fnamemodify(vim.fn.getcwd(), ':p:~:h') end, + lualine_c = { + { + 'filename', + on_click = function() + require('telescope.builtin').find_files() + -- print('file name clicked') + end, + icon = ' ', + color = { fg = colors.yellow100, bg = colors.base03, gui = 'bold'}, + path = 4, + file_status = false, + -- separator = { right = '┇', left = '┇'}, }, - lualine_b = { - function() - local dap_status = require('dap').status() - - return dap_status ~= '' and ' ' .. dap_status or '' + }, + lualine_x = { + { + 'diagnostics', + on_click = function() + require('telescope.builtin').diagnostics() end, - }, - lualine_x = { 'lsp_progress' }, - lualine_y = { { "branch", icon = "" }, "db_ui#statusline" }, - lualine_z = { - { - 'tabs', - show_modified_status = false, - use_mode_colors = true, + -- separator = { left = '' }, + sources = { 'nvim_diagnostic'}, + sections = { 'error', 'warn', 'info', 'hint' }, + + diagnostics_color = { + error = { fg = colors.red300, bg = colors.base03 , gui = 'bold'}, -- Changes diagnostics' error color. + added = { fg = colors.green300, bg = colors.base03, gui = 'bold'}, + warn = { fg = colors.yellow300, bg = colors.base03, gui = 'bold' }, -- Changes diagnostics' warn color. + info = { fg = colors.blue300, bg = colors.base03, gui = 'bold' }, -- Changes diagnostics' info color. + hint = { fg = colors.cyan300, bg = colors.base03, gui = 'bold' }, -- Changes diagnostics' hint color. }, + symbols = { error = " ", warn = " ", hint = " ", info = " " }, + colored = true, -- Displays diagnostics status in color if set to true. + update_in_insert = true, -- Update diagnostics in insert mode. default = false + always_visible = false, -- Show diagnostics even if there are none. }, - }, - sections = sections, - inactive_sections = sections, - extensions = { { - filetypes = { 'fugitive', 'git' }, - sections = vim.tbl_extend('force', sections, { - lualine_c = { { 'FugitiveHead', icon = '' } }, - }), + lazy_status.updates, + cond = lazy_status.has_updates, + color = {fg=colors.orange300}, }, { - filetypes = { 'help', 'man' }, - sections = vim.tbl_extend('force', sections, { - lualine_c = lualine_c { file_status = false }, - }), + -- code from https://github.com/nvim-lualine/lualine.nvim/blob/566b7036f717f3d676362742630518a47f132fff/examples/evil_lualine.lua + -- Lsp server name . + function() + local msg = 'No LSP' + local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') + local clients = vim.lsp.get_clients() + if next(clients) == nil then + return msg + end + for _, client in ipairs(clients) do + local filetypes = client.config.filetypes + if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then + return client.name + end + end + return msg + end, + -- icon = ' LSP:', + -- icon = {' ', color = {bg = colors.base03, fg = colors.red100}}, + -- separator = { left = '', right = ''}, + -- separator = { left = ' ', right = ' '}, + color = { fg = colors.base4, gui = 'bold', bg = colors.base03 }, }, + { - filetypes = { 'oil' }, - sections = vim.tbl_extend('force', sections, { - lualine_c = { - { - function() - local dir = require('oil').get_current_dir() - - return dir and vim.fn.fnamemodify(dir, ':p:~:.') - end, - icon = { - '', - color = { - fg = require('catppuccin.palettes').get_palette('frappe').maroon, - }, - }, - }, - }, - }), - }, + 'filetype', + color = {bg = colors.base03, fg = colors.magenta100, gui = 'bold'} + -- separator = { left = '', right = ' ' }, + } + }, + lualine_y = { { - filetypes = { 'qf' }, - sections = vim.tbl_extend('force', sections, { - lualine_c = { 'w:quickfix_title' }, - }), + 'progress', left_padding = 0, + color = {bg = colors.base03, fg = colors.cyan100, gui = 'bold'} + } + }, + lualine_z = { + { + -- 'location', + -- function() + -- return "Ln:%l Col:%c" + -- end + -- separator = { right = '' }, left_padding = 2 }, + } }, }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {'filename'}, + lualine_x = {'location'}, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + extensions = {}, } - end, - }, -} + end + } diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua index 947876e..694fea9 100644 --- a/lua/plugins/oil.lua +++ b/lua/plugins/oil.lua @@ -5,7 +5,7 @@ return -- Optional dependencies dependencies = { "nvim-tree/nvim-web-devicons", - "ElvisClaros/oil-image-preview.nvim", + {"ElvisClaros/oil-image-preview.nvim", lazy = false}, }, config = function () @@ -60,7 +60,7 @@ return -- Set to `false` to disable, or "name" to keep it on the file names constrain_cursor = "editable", -- Set to true to watch the filesystem for changes and reload oil - experimental_watch_for_changes = false, + experimental_watch_for_changes = true, -- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap -- options with a `callback` (e.g. { callback = function() ... end, desc = "", mode = "n" }) -- Additionally, if it is a string that matches "actions.<name>", @@ -86,6 +86,17 @@ return ["g\\"] = "actions.toggle_trash", ["g<leader>"] = oip.openWithQuickLook, ["gp"] = oip.weztermPreview, + ["gdi"] = function() + require("oil").set_columns({ "icon", "", "", "" }) + end, + ["gdf"] = function() + require("oil").set_columns({ "icon", "permissions", "size", "mtime" }) + end, + ["g:"] = { + "actions.open_terminal", + desc = "Open terminal in current directory", + }, + }, -- Configuration for the floating keymaps help window keymaps_help = { diff --git a/lua/plugins/rustaceanvim.lua b/lua/plugins/rustaceanvim.lua index 766d52d..46c4c82 100644 --- a/lua/plugins/rustaceanvim.lua +++ b/lua/plugins/rustaceanvim.lua @@ -1,5 +1,5 @@ return { 'mrcjkb/rustaceanvim', - version = '^4', -- Recommended + version = '^5', -- Recommended lazy = false, -- This plugin is already lazy } |