Skip to content
Discussion options

You must be logged in to vote

There used to be a command workspace <name> exec <command> which worked like a simple workspace rule, but since I added Lua scripting, I saw you could do much more interesting things with it. In the case you mention, you would create a my_set_mode.lua script:

local scroll = require("scroll")

local function on_create_ws(workspace, _)
  -- For example
  scroll.workspace_set_mode(workspace, { insert = "before", center_horizontal = true})
end

scroll.add_callback("workspace_create", on_create_ws, nil)

and every time you create a new workspace, it will modify the mode settings. This also allows you to do much more complicated things, like filtering by workspace name or output, etc., and that …

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@zenzoa
Comment options

@dawsers
Comment options

@zenzoa
Comment options

@dawsers
Comment options

Answer selected by zenzoa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants