aboutsummaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-03 22:29:51 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-03 22:29:51 +1200
commit30308b46d063e4be754016dbf236dea5940a0034 (patch)
treef03749fdd654e965f56d093ce8537e35bb733364 /autoload
downloadvim-keep-position-30308b46d063e4be754016dbf236dea5940a0034.tar.gz
vim-keep-position-30308b46d063e4be754016dbf236dea5940a0034.zip
Add files as they stand
Diffstat (limited to 'autoload')
-rw-r--r--autoload/keep_position.vim5
1 files changed, 5 insertions, 0 deletions
diff --git a/autoload/keep_position.vim b/autoload/keep_position.vim
new file mode 100644
index 0000000..a2f2ed4
--- /dev/null
+++ b/autoload/keep_position.vim
@@ -0,0 +1,5 @@
+function! keep_position#(command) abort
+ let view = winsaveview()
+ execute a:command
+ call winrestview(view)
+endfunction