diff --git a/docs/configuration/autocommands.md b/docs/configuration/autocommands.md index 323d5272..9cff57ea 100644 --- a/docs/configuration/autocommands.md +++ b/docs/configuration/autocommands.md @@ -47,3 +47,18 @@ lvim.autocommands = { } } ``` + +A popular feature of Vim is to remember the cursor position. You can achieve similar functionality with the following: + +```lua +lvim.autocommands = { + { + "BufWinEnter", + { + -- Remember cursor position + pattern = "*", + command = 'silent! normal! g`"zv', + }, + } +} +```