From e91ce78e7e9fe400a2c1820ac4b65d5b9c242c34 Mon Sep 17 00:00:00 2001 From: Blallo Date: Fri, 19 Nov 2021 23:40:37 +0100 Subject: [PATCH] Reopen at last cursor position --- init.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/init.lua b/init.lua index ec27f96..61e832b 100644 --- a/init.lua +++ b/init.lua @@ -63,6 +63,13 @@ augroup packer_user_config augroup end ]]) +-- Reopen file to last cursor position, if possible +cmd([[ +if has("autocmd") + au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif +endif +]]) + cmd [[command! WhatHighlight :call util#syntax_stack()]] cmd [[command! PackerInstall packadd packer.nvim | lua require('plugins').install()]] cmd [[command! PackerUpdate packadd packer.nvim | lua require('plugins').update()]]