feat: autopairs, cursor restore and rename option (#15)

Add the nvim-autopairs so "'{[ characters will auto close.
Add AutoCmd to restore the cursor position when re-opening file.
Fix treesitter option name.
This commit is contained in:
Roel de Cort 2024-07-25 22:57:29 +02:00 committed by GitHub
parent 21072b364c
commit 48bbb7951d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 98 additions and 39 deletions

View file

@ -3,6 +3,7 @@
highlight_yank = {};
vim_enter = {};
indentscope = {};
restore_cursor = {};
};
autoCmd = [
@ -50,5 +51,25 @@
'';
};
}
## from NVChad https://nvchad.com/docs/recipes (this autocmd will restore the cursor position when opening a file)
{
group = "restore_cursor";
event = ["BufReadPost"];
pattern = "*";
callback = {
__raw = ''
function()
if
vim.fn.line "'\"" > 1
and vim.fn.line "'\"" <= vim.fn.line "$"
and vim.bo.filetype ~= "commit"
and vim.fn.index({ "xxd", "gitrebase" }, vim.bo.filetype) == -1
then
vim.cmd "normal! g`\""
end
end
'';
};
}
];
}