mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
refactor: resume edit position --> resume cursor position
This commit is contained in:
parent
9adc3fdf16
commit
85de00f374
@ -19,14 +19,14 @@ augroup accurate_syn_highlight
|
||||
autocmd BufEnter * :syntax sync fromstart
|
||||
augroup END
|
||||
|
||||
" Return to last edit position when opening a file
|
||||
augroup resume_edit_position
|
||||
" Return to last cursor position when opening a file
|
||||
augroup resume_cursor_position
|
||||
autocmd!
|
||||
autocmd BufReadPost * call s:resume_edit_pos()
|
||||
autocmd BufReadPost * call s:resume_cursor_position()
|
||||
augroup END
|
||||
|
||||
" Only resume last edit position when there is no go-to-line command (something like '+23').
|
||||
function s:resume_edit_pos() abort
|
||||
" Only resume last cursor position when there is no go-to-line command (something like '+23').
|
||||
function s:resume_cursor_position() abort
|
||||
if line("'\"") > 1 && line("'\"") <= line("$") && &ft !~# 'commit'
|
||||
let l:args = v:argv " command line arguments
|
||||
for l:cur_arg in l:args
|
||||
|
||||
@ -345,3 +345,13 @@ teardown
|
||||
github
|
||||
fastgit
|
||||
EOL
|
||||
PyCharm
|
||||
deduplication
|
||||
STL
|
||||
delimitMate
|
||||
lspconfig
|
||||
lualine
|
||||
Keymap
|
||||
iCloud
|
||||
keyframe
|
||||
maskRCNN
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user