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:
parent
21072b364c
commit
48bbb7951d
5 changed files with 98 additions and 39 deletions
|
|
@ -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
|
||||
'';
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue