Hot answers tagged

3

As discussed in the comments, autocmd ExitPre ?* tabdo windo mkview should do it. The event VimLeavePre may be better. I confess I’m not sure why the pattern is ?* on this one. Also, don’t forget to augroup.


3

You don't undo a fold, you open it with zo or delete it with zd (this doesn't delete content, only suppresses the notion that there's a fold there, closable with zc). In general, try :help followed by the keystroke you've tried to find out more. :help zf leads you to the topic of folds, and these other commands are documented there.


2

Its possible now using 'fillchars' (from the help): item default Used for ... foldopen:c '-' mark the beginning of a fold foldclose:c '+' show a closed fold foldsep:c '|' open fold middle character For example, set fillchars+=foldopen:▾,foldsep:│,foldclose:▸ Compatibility: Vim 8.2....


2

Turns out it's already answered on :help *fold-delete-marker: "zd" can be used to delete a fold defined by markers.


2

See :help 'foldopen': *'foldopen'* *'fdo'* 'foldopen' 'fdo' string (default: "block,hor,mark,percent,quickfix, search,tag,undo") global {not available when compiled without the +folding feature} Specifies for which type of commands folds will be ...


1

Found the culprit using: :verbose set foldmethod? This told me that taskwiki last set the value in an autoload file. Uncommenting line 19 in taskwiki/autoload/taskwiki.vim did the trick: setlocal foldmethod=syntax Looks like taskwiki is relying on some old vimwiki variable that is not used anymore. If you use views, the problem won't be completely solved ...


1

I guess I will attempt to answer my own question ... because I think I got an fairly nice looking solution with the first line of the fold text on the left and the line stats (number of lines & character count) aligned to the right of the window. I skipped doing words because maybe that is less useful (but then again maybe not?) Turns out there are some ...


1

A much simpler option is to set colorcolumn=80 or whatever number(s) you want: then you have a line down the screen that shows your breakpoint.


1

If you are not insisting on using matchadd you can try to use properties, here is the proof of concept you can play with: call prop_type_add('TEST', {'highlight': 'ErrorMsg'}) "screen jumps sometimes, try to find your own way func! UpdatePage(pagesize) abort let cpos = getcurpos() 1 call prop_clear(1, line('$')) while search('^|===$', '...


1

EDIT You also need to add the following line to your vimrc: filetype plugin indent on See :h :filetype-plugin-on and :h :filetype-indent-on this command enable the filetype detection and the loading of the indent scripts which are necessary to have working folding. You can't set foldmethod directly from the vimrc, see :h 'fdm': 'foldmethod' 'fdm' string (...


1

It turns out the folds that are nested inside the one you can see closing are still open. That has to do with the way zC works. I had to look at the docs myself to figure this out. (I'm still a bit clumsy with folds having only recently started using them regularly.) Here's what it says... Close all folds under the cursor recursively. Folds that don't ...


1

You can do that with some vimscript, I wrote a function doing just what you need: function! ComparePos(p1, p2) let linediff = a:p2[0] - a:p1[0] let coldiff = a:p2[1] - a:p1[1] return linediff + (!linediff) * coldiff endfunction function! CurPos() return getpos('.')[1:2] endfunction function! DiffSearch(pattern, flags) if !&diff | ...


1

While using Vim's syntax engine for folding is very powerful and can be very convenient for syntax-aware folding, it's really hard to extend an existing syntax definition with new syntax, since creating new syntax matches and regions tends to affect how other syntax elements are recognized, so it tends to produce ripple effects on existing syntax, which ...


Only top voted, non community-wiki answers of a minimum length are eligible