我国九成中小学校已接入互联网
93 questions with no upvoted or accepted answers
8
votes
0
answers
912
views
Highlight line number of folded lines
I want to have uniform highlighting of line numbers (provided by the LineNr and CursorLineNr hl-groups) but the line numbers of folded lines don't obey a particular group (as far as I know), but obey ...
5
votes
1
answer
75
views
Preserve manual folds when saving file under different name
I'm using manual folds. I issued the command :mkview before I exited a file just now, and found that, when I reopened it, the folds appear to be preserved as I left them.
But when I issue the command :...
5
votes
0
answers
45
views
How to factor fold status with scrollbind?
I'd like two scroll bound windows to factor in fold status when scrolling the other window. For example if a fold is closed, the other window would be scrolled by only 1 line rather than the size of ...
5
votes
0
answers
201
views
Is it possible to use syn match dynamically
I know that syn match can work with the regular expression to do some custom highlight settings.
I'm thinking if it can work dynamically.
For example, I'm doing a c++ project and I want to highlight ...
4
votes
1
answer
259
views
How to use different rules for highlighting trailing whitespace inside a gitcommit diff?
In my ~/.vimrc, I have:
highlight TrailingWhitespace ctermbg=blue
autocmd BufReadPost * syn match TrailingWhitespace /\s\+\%#\@<!$/
This highlights trailing spaces, except when I am still typing ...
4
votes
0
answers
201
views
How does expression folding actually work?
The following is a stripped down version of my folding function for LaTeX documents:
setlocal foldmethod=expr
setlocal foldexpr=LaTeXFoldsExpr(v:lnum)
" Sections to be folded
let g:...
4
votes
0
answers
449
views
Nested syntax folding
Assume I have a syntax as exemplified below and that I want to create a syntax folding definition for the nested begin..end pairs.
begin : label
a = 0;
begin
b = 1;
end
c = 2;
begin
...
3
votes
1
answer
164
views
How to call incremental forward/reverse search inside function in Neovim?
I'm trying to implement a search function that finds a pattern and jumps to it without overriding the current searched for & highlighted pattern.
Specifically, I want to be able to type out the ...
3
votes
0
answers
152
views
Is there an easy way to combine multiple fold methods?
I like folding a lot. I like code syntax based folding, custom marker based folding, folding multi line comments, folding parentheses, folding braces, and probably other things I am forgetting. To ...
3
votes
0
answers
581
views
Folding lists in vimwiki with custom folding enabled
vimwiki's help docs, and this answer, both explain how
setting g:vimwiki_folding='list' in my vimrc enables list folding for vimwiki files. This lets me use vim's native folding methods on vimwiki ...
3
votes
0
answers
186
views
Setup to not automatically open/close folds when writing fold-markers (in the presence of a modeline)
Say I have a file:
// vim: syntax=rust fdm=syntax
{
blah blah
}
Let's say that lines 2 through 4 are folded:
// vim: syntax=rust fdm=syntax
+ { ... }
Now I am in insert mode. I insert a newline on ...
3
votes
0
answers
204
views
how to delete a paragraph respecting the folds?
I have a file (filetype=javascript), this is how it looks without folds:
and with folds:
I can move with the { and } motions skipping the empty lines inside the folds (thanks to these question and ...
3
votes
0
answers
597
views
Is there a way in vim to determine if something is highlighted after search?
What I want to do is make CursorMoved autocmd that would check if there is a search highlight is on and if it is it would start a timer that would deactivate it.
PS
I know about all available ...
3
votes
0
answers
1k
views
multiple highlight with multiple color
When we search for a word, it gets highlighted.
I want to search for another word keeping the previous one highlighted (with a different color probably).
Please let me know if it's doable.
2
votes
0
answers
26
views
How to test if a particular FileType has syntax for folds predefined?
I wish to automatically set my foldmethod to manual if syntax fold definitions are not defined for a particular Filetype. However, I am unsure how to check if the fold syntax is defined for the ...