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
commitab43821bb1b084228146c47eb5f529415e617392 (patch)
tree5d48903df54120a2b7d8a6dee4748f04bc55ffaf
parentdc3f5c683822d177001b71cc9ee6afa49f3b9969 (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 2c17fbc74..8aee31082 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
'';
}