Closed davidgranstrom closed 2 years ago
Breaking change: postwin.float
now only accepts a table value
To opt-in to use a floating post window:
postwin = {
float = {
enabled = true,
-- more options here..
}
}
Breaking change: editor.flash
has moved to editor.highlight.flash
editor = {
highlight = {
color = 'IncSearch',
type = 'flash',
}
},
type
can be one of: flash
, fade
or none
use an entry with the type name to configure the highlight
editor = {
highlight = {
color = 'IncSearch',
type = 'flash',
flash = {
repeats = 4,
}
}
},
Breaking change: The postwin.float
configuration has been refactored, it is now possible to use more granular positioning and also change the default width/height.
row
, col
, width
and height
can be a number or function. The function will be evaluated when opening the post window, which makes it possible to re-position it after resizing the terminal, apply offsets etc.
Here are the new default values:
float = {
enabled = false,
row = 0,
col = function()
return vim.o.columns
end,
width = 64,
height = 14,
config = {
border = 'single',
},
callback = function(id)
vim.api.nvim_win_set_option(id, 'winblend', 10)
end,
},
Breaking change:
mapping
has been renamed to keymaps
in the user config
scnvim.setup {
keymaps = {
['<CR>'] = map('postwin.toggle'),
}
}
The map
helper function can take a string or a function as input.
When the input is a string it will be parsed as module.function
to create
the keymap. If the input is a function it will simply execute that function.
See :h scnvim-keymaps
for more examples!
Hi all,
This is a tracking issue where I will post breaking changes in the upcoming version of scnvim. If you want to try it out you can follow along in #153. It starting to become pretty stable by now but changes might still occur. I will try and post here if I break something intentionally.
Overall goals of this refactor/rewrite have been to rewrite a lot of viml code to lua to ease maintainability and coding standards (and in some cases improve performance). Fix some long standing issues in the code base that has been hard to solve because of legacy code and implement some new cool features (floating post window I'm looking at you!). I hope that the new configuration system will make it easier to start using scnvim out-of-the-box and to be able to configure the system to your liking.
I will write a more definite guide on how to transition to the new lua configuration once the API has settled.
Configuration
g:scnvim_postwin_direction
etc.) these are instead declared inscnvim.setup
<Plug>
mappings have been removed, mappings can now be defined directly in the setup functionPlease see the default configuration for what options are available. The rewrite is still in motion, so things might change without notice.
Example for setting options with the new configuration:
Custom mappings
For custom mappings that relied on the viml api
scnvim#sclang#send
you can instead usescnvim.send
API
scnvim#sclang#send_silent
) and have been replaced by equivalent lua functionsutils.path_sep
=>path.sep
utils.get_scnvim_root_dir
=>path.get_plugin_root_dir