32 }) |
32 }) |
33 |
33 |
34 -- >> auto session ? |
34 -- >> auto session ? |
35 |
35 |
36 -- >> jump to last position on open |
36 -- >> jump to last position on open |
|
37 local nojump = vim.regex([[mail\|commit\|rebase]]) |
|
38 assert(nojump, "Couldn't compile nojump regexp?") |
|
39 |
37 autocmd(g, "BufReadPost", "*", function() |
40 autocmd(g, "BufReadPost", "*", function() |
38 local ft = vim.bo.filetype |
41 if nojump:match_str(vim.bo.filetype or "") then |
39 if ft == "mail" or string.match(ft, "^git") or string.match(ft, "^hg") then |
42 return |
40 return "" |
|
41 end |
43 end |
42 |
44 |
43 local lastpos = fn.line([['"]]) |
45 local lastpos = fn.line([['"]]) |
44 if lastpos >= 1 and lastpos <= fn.line("$") then |
46 if lastpos >= 1 and lastpos <= fn.line("$") then |
45 vim.cmd([[normal! g`"]]) |
47 vim.cmd([[normal! g`"]]) |