Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add mapping to toggle full window width #82

Open
1 task done
mikehaertl opened this issue Feb 10, 2023 · 15 comments
Open
1 task done

feature: add mapping to toggle full window width #82

mikehaertl opened this issue Feb 10, 2023 · 15 comments
Labels
enhancement New feature or request

Comments

@mikehaertl
Copy link

Did you check the docs?

  • I have read all the zen-mode.nvim docs

Is your feature request related to a problem? Please describe.

While a window width of 120 is perfect for most code it would be nice to toggle to full width when checking a log file.

Describe the solution you'd like

I suggest a key mapping like f to toggle full width. The mapping should be restricted to the zen window.

Describe alternatives you've considered

I've tried to add a mapping via on_open but I failed due to 2 problems:

  • I don't know how to change window.width config while the window is open
  • I don't know how to restrict the mapping to the zen window. I can only restrict it to the buffer but then the f mapping is also still active when the zen window is closed.

Additional context

No response

@mikehaertl mikehaertl added the enhancement New feature or request label Feb 10, 2023
Copy link
Contributor

github-actions bot commented Jul 6, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Jul 6, 2024
@mikehaertl
Copy link
Author

This is a comment to avoid closing :-/

@github-actions github-actions bot removed the stale label Jul 7, 2024
Copy link
Contributor

github-actions bot commented Aug 7, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Aug 7, 2024
@mikehaertl
Copy link
Author

This is another comment to avoid closing :-/

@github-actions github-actions bot removed the stale label Aug 8, 2024
Copy link
Contributor

github-actions bot commented Sep 7, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Sep 7, 2024
@mikehaertl
Copy link
Author

.

@github-actions github-actions bot removed the stale label Sep 8, 2024
Copy link
Contributor

github-actions bot commented Oct 8, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Oct 8, 2024
@mikehaertl
Copy link
Author

.

@github-actions github-actions bot removed the stale label Oct 9, 2024
Copy link
Contributor

github-actions bot commented Nov 9, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Nov 9, 2024
@mikehaertl
Copy link
Author

!

@github-actions github-actions bot removed the stale label Nov 10, 2024
@asilvadesigns
Copy link

.

@majordoobie
Copy link

majordoobie commented Nov 19, 2024

This seems to do what you are asking for:

    -- centers the editor to the screen
    {
        "folke/zen-mode.nvim",
        config = function()
            require("zen-mode").setup({
                window = {
                    width = .70
                },
                plugins = {
                    options = {
                        -- you may turn on/off statusline in zen mode by setting 'laststatus' 
                        -- statusline will be shown only if 'laststatus' == 3
                        laststatus = 3, -- turn off the statusline in zen mode
                    }
                }
            })
            vim.keymap.set("n", "<leader>z", ":ZenMode<CR>", {desc="Toggle zen mode"})

        end,
    }

@mikehaertl
Copy link
Author

@majordoobie Well you're basically just configuring the width. What I wanted was a way to toggle the width while in zen-mode, e.g. from 120 (for a nice centered view) to 1 (==100%) for full width.

@majordoobie
Copy link

@majordoobie Well you're basically just configuring the width. What I wanted was a way to toggle the width while in zen-mode, e.g. from 120 (for a nice centered view) to 1 (==100%) for full width.

The toggle I made disables zen, doesn't that do the same thing? Gives you 100% of your view.

@mikehaertl
Copy link
Author

Not sure I can follow: I already have a mapping for :ZenMode. So I can already activate/deactivate Zen mode.

But what I want is, when zen mode is active I still want more control over the window width. E.g. I want to go from 120 width to 100% width (and back).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants