Neovim: Enable line wrapping in Telescope preview
This commit is contained in:
@ -119,6 +119,7 @@ in {
|
|||||||
|
|
||||||
autoCmd = [
|
autoCmd = [
|
||||||
{
|
{
|
||||||
|
desc = "Lint the file if autolint is enabled";
|
||||||
event = ["BufWritePost"];
|
event = ["BufWritePost"];
|
||||||
callback.__raw = ''
|
callback.__raw = ''
|
||||||
function()
|
function()
|
||||||
@ -129,11 +130,12 @@ in {
|
|||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
desc = "Highlight yanked regions";
|
||||||
event = ["TextYankPost"];
|
event = ["TextYankPost"];
|
||||||
callback.__raw = "function() vim.highlight.on_yank() end";
|
callback.__raw = "function() vim.highlight.on_yank() end";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
# Resize splits when entire window is resized by wm
|
desc = "Resize splits when Neovim is resized by the WM";
|
||||||
event = ["VimResized"];
|
event = ["VimResized"];
|
||||||
callback.__raw = ''
|
callback.__raw = ''
|
||||||
function()
|
function()
|
||||||
@ -144,11 +146,13 @@ in {
|
|||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
desc = "Disable conceal in JSON files";
|
||||||
event = ["FileType"];
|
event = ["FileType"];
|
||||||
pattern = ["json" "jsonc" "json5"]; # Disable conceal for these filetypes
|
pattern = ["json" "jsonc" "json5"]; # Disable conceal for these filetypes
|
||||||
callback.__raw = "function() vim.opt_local.conceallevel = 0 end";
|
callback.__raw = "function() vim.opt_local.conceallevel = 0 end";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
desc = "Attach JDTLS to Java files";
|
||||||
event = ["FileType"];
|
event = ["FileType"];
|
||||||
pattern = ["Java" "java"];
|
pattern = ["Java" "java"];
|
||||||
callback.__raw = ''
|
callback.__raw = ''
|
||||||
@ -168,6 +172,20 @@ in {
|
|||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
desc = "Enable line wrapping in telescope preview";
|
||||||
|
event = ["User"];
|
||||||
|
pattern = ["TelescopePreviewerLoaded"];
|
||||||
|
callback.__raw = ''
|
||||||
|
function(args)
|
||||||
|
if args.data.bufname:match("*.csv") then
|
||||||
|
vim.wo.wrap = false
|
||||||
|
else
|
||||||
|
vim.wo.wrap = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
keymaps = import ./mappings.nix {inherit lib mylib;};
|
keymaps = import ./mappings.nix {inherit lib mylib;};
|
||||||
@ -1414,6 +1432,10 @@ in {
|
|||||||
'';
|
'';
|
||||||
opts = {
|
opts = {
|
||||||
defaults = {
|
defaults = {
|
||||||
|
wrap_results = false; # Do wrapping in the preview instead, see autoCmd
|
||||||
|
preview = {
|
||||||
|
treesitter = true;
|
||||||
|
};
|
||||||
mappings = {
|
mappings = {
|
||||||
i = {
|
i = {
|
||||||
"<Esc>" = {__raw = ''function(...) return require("telescope.actions").close(...) end'';};
|
"<Esc>" = {__raw = ''function(...) return require("telescope.actions").close(...) end'';};
|
||||||
@ -1761,7 +1783,9 @@ in {
|
|||||||
luasnip # Snippets # TODO: How to add snippets, maybe use luasnip from nixvim directly?
|
luasnip # Snippets # TODO: How to add snippets, maybe use luasnip from nixvim directly?
|
||||||
|
|
||||||
ltex-extra # Additional ltex lsp support, e.g. for add-to-dictionary action
|
ltex-extra # Additional ltex lsp support, e.g. for add-to-dictionary action
|
||||||
markview # Markdown support
|
|
||||||
|
markview # Markdown support # TODO: Disable in help buffers + confiure a bit more
|
||||||
|
|
||||||
# narrow-region # Open a buffer restricted to the selection
|
# narrow-region # Open a buffer restricted to the selection
|
||||||
navbuddy # Structural file view
|
navbuddy # Structural file view
|
||||||
neo-tree # File tree sidebar
|
neo-tree # File tree sidebar
|
||||||
|
Reference in New Issue
Block a user