From bfe6875e67385b9494d3ca929799eb4b65c6d338 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 11 Jan 2024 15:37:11 +0100 Subject: [PATCH] feat(extras): Add a repro.lua --- extras/README.md | 9 +++++++ extras/repro.lua | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 extras/README.md create mode 100644 extras/repro.lua diff --git a/extras/README.md b/extras/README.md new file mode 100644 index 0000000..08d268e --- /dev/null +++ b/extras/README.md @@ -0,0 +1,9 @@ +# Extras + +## Reproducer + +Download the [reproducer](https://raw.githubusercontent.com/nvim-focus/focus.nvim/master/extras/repro.lua) and start it with: + + nvim -u repro.lua + +Once done zip the `repro.lua` and `.repro` directory and upload it. diff --git a/extras/repro.lua b/extras/repro.lua new file mode 100644 index 0000000..e97737c --- /dev/null +++ b/extras/repro.lua @@ -0,0 +1,62 @@ +-- DO NOT change the paths +local root = vim.fn.fnamemodify('./.repro', ':p') + +-- set stdpaths to use .repro +for _, name in ipairs({ 'config', 'data', 'state', 'cache' }) do + vim.env[('XDG_%s_HOME'):format(name:upper())] = root .. '/' .. name +end + +-- bootstrap lazy +local lazypath = root .. '/plugins/lazy.nvim' +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + 'git', + 'clone', + '--filter=blob:none', + 'https://github.com/folke/lazy.nvim', + lazypath, + }) +end +vim.opt.runtimepath:prepend(lazypath) + +-- install plugins +local plugins = { + 'nvim-focus/focus.nvim', + -- add any other plugins here +} +require('lazy').setup(plugins, { + root = root .. '/plugins', +}) + +require("focus").setup({ + enable = true, -- Enable module + commands = true, -- Create Focus commands + autoresize = { + enable = true, -- Enable or disable auto-resizing of splits + width = 0, -- Force width for the focused window + height = 0, -- Force height for the focused window + minwidth = 0, -- Force minimum width for the unfocused window + minheight = 0, -- Force minimum height for the unfocused window + height_quickfix = 10, -- Set the height of quickfix panel + }, + split = { + bufnew = false, -- Create blank buffer for new split windows + tmux = false, -- Create tmux splits instead of neovim splits + }, + ui = { + number = false, -- Display line numbers in the focussed window only + relativenumber = false, -- Display relative line numbers in the focussed window only + hybridnumber = false, -- Display hybrid line numbers in the focussed window only + absolutenumber_unfocussed = false, -- Preserve absolute numbers in the unfocussed windows + + cursorline = true, -- Display a cursorline in the focussed window only + cursorcolumn = false, -- Display cursorcolumn in the focussed window only + colorcolumn = { + enable = false, -- Display colorcolumn in the foccused window only + list = '+1', -- Set the comma-saperated list for the colorcolumn + }, + signcolumn = true, -- Display signcolumn in the focussed window only + winhighlight = false, -- Auto highlighting for focussed/unfocussed windows + } +}) +-- add anything else here