Wednesday, October 2, 2019

Re: How to let previous opened fold open reentering vim buffer.

The command `za` toggles the fold. Try instead

silent autocmd! BufEnter *.vim normal! zv

to open sufficiently many folds to show the line where the cursor is at.

Le vendredi 27 septembre 2019 12:58:23 UTC-3, Ni Va a écrit :
Hi,


I try this in _vimrc in order to let a previous opened fold, opened when I re enter buffer.

in _vimrc:
if has("autocmd")
silent autocmd! BufEnter *.vim norm za
endif

example of vim buffer :

function! sequencerutil#echomsg(startreltime,str) abort  " timestamp stolen from codi sorry :){{{
let seconds_and_microseconds = reltimestr(reltime(a:startreltime))
let decimal_i = stridx(seconds_and_microseconds, '.')
let seconds = seconds_and_microseconds[:decimal_i - 1]
let microseconds = seconds_and_microseconds[decimal_i + 1:]
let timestamp = strftime("%T.".microseconds, seconds)
echomsg strftime('%Y/%m/%d %T.').printf("%.3s",microseconds).printf(" %.3s secs %s", seconds, a:str)
endfunc "}}}
" vim: set ft=vim ff=dos fdm=marker ts=4 :expandtab:



It seems to not doing what I attempt but why ?

Thanks in advance.
NiVa

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/bc411708-aaa8-487c-bc1a-97413e70d86e%40googlegroups.com.

No comments:

Post a Comment