Join/split current line to align bilingual sentence pairs.
- Neovim >= 0.9.0
- Using lazy.nvim
{
'tanloong/interlaced.nvim',
config = function()
require("interlaced").setup()
-- or setup with your own config (see Configuration in README)
-- require("interlaced").setup(config)
end,
ft = "text",
},
Bellow is a linked snippet with the default values.
interlaced.nvim/lua/interlaced/config.lua
Lines 1 to 19 in a291394
-
SplitEnglishSentences
andSplitChineseSentences
: These commands are used for sentence segmentation in a monolingual buffer. It is important to note that they may not handle all cases perfectly, as they use simple regex patterns to identify sentence boundaries. For more accurate splitting, it is recommended to use an NLP tool. However, if you just want a quick and not-that-accurate splitting, these commands can be helpful. -
MapInterlaced
andUnmapInterlaced
:MapInterlaced
sets keybindings for text manipulations;UnmapInterlaced
restores them to their previous mappings, if any. -
InterlaceWithL1
andInterlaceWithL2
: Take lines from the current buffer and interlaces them with lines from a specified file, forming an array of(l1, l2)
pairs. These commands also filter out any empty lines from both the buffer and the file to ensure that only non-empty lines are interlaced. The resulting interlaced text is then saved to a new file and opened for further editing. After openning the interlaced file, keybindings are setup if they have not been previously.