summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2023-01-17 01:05:26 +0100
committertv <tv@krebsco.de>2023-01-18 17:23:38 +0100
commit6e0c2f1927eea59a3f8b8e58bfdc9193fc20d324 (patch)
tree37adebfec2f47ac7428b69c500c07d21ec540166
parent3dad353ecb8e0b4b87b171eca8b091f62f28c17c (diff)
tv vim: remember last position
-rw-r--r--tv/2configs/vim.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix
index 2c17fbc..8aee310 100644
--- a/tv/2configs/vim.nix
+++ b/tv/2configs/vim.nix
@@ -173,5 +173,11 @@ with import ./lib;
nnoremap <C-S-ScrollWheelUp> <PageUp>
nnoremap <C-S-ScrollWheelDown> <PageDown>
endif
+
+ # remember last position
+ autocmd BufReadPost *
+ \ if line("'\"") > 0 && line("'\"") <= line("$") |
+ \ exe "normal! g`\"" |
+ \ endif
'';
}