editor.lua
1 --- Editor plugins: diffview, colorizer, aerial, flash, smartcolumn, zen-mode. Customizations from original Lazy spec. 2 return { 3 specs = { 4 { src = 'https://github.com/sindrets/diffview.nvim', name = 'diffview.nvim' }, 5 { src = 'https://github.com/norcalli/nvim-colorizer.lua', name = 'nvim-colorizer.lua' }, 6 { src = 'https://github.com/stevearc/aerial.nvim', name = 'aerial.nvim' }, 7 { src = 'https://github.com/folke/flash.nvim', name = 'flash.nvim' }, 8 { src = 'https://github.com/m4xshen/smartcolumn.nvim', name = 'smartcolumn.nvim' }, 9 { src = 'https://github.com/folke/zen-mode.nvim', name = 'zen-mode.nvim' }, 10 }, 11 config = function() 12 -- Shim deprecated vim.tbl_flatten for plugins that still use it (e.g. nvim-colorizer.lua) 13 if vim.tbl_flatten and vim.iter then 14 ---@diagnostic disable: duplicate-set-field 15 vim.tbl_flatten = function(t) 16 return vim.iter(t):flatten():totable() 17 end 18 end 19 pcall(function() 20 require('colorizer').setup({ '*' }) 21 end) 22 local aerial = require('aerial') 23 if type(aerial) == 'table' and aerial.setup then 24 aerial.setup({ layout = { width = 50 } }) 25 end 26 local flash = require('flash') 27 if type(flash) == 'table' and flash.setup then 28 flash.setup({ search = { modes = { search = { enabled = true } } } }) 29 end 30 local smartcolumn = require('smartcolumn') 31 if type(smartcolumn) == 'table' and smartcolumn.setup then 32 smartcolumn.setup({ 33 disabled_filetypes = { 34 'Outline', 35 'aerial', 36 'alpha', 37 'help', 38 'lazy', 39 'mason', 40 'neo-tree', 41 'noice', 42 'spectre_panel', 43 'text', 44 }, 45 custom_colorcolumn = { python = { '160', '200' } }, 46 }) 47 end 48 vim.keymap.set('n', '<leader>z', '<cmd>ZenMode<cr>', { desc = 'ZenMode' }) 49 local zen = require('zen-mode') 50 if type(zen) == 'table' and zen.setup then 51 zen.setup({ 52 plugins = { options = { laststatus = 0 }, tmux = { enabled = true } }, 53 window = { height = 1, width = 200, options = { signcolumn = 'number', foldcolumn = '0' } }, 54 }) 55 end 56 end, 57 }