Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
gVim is the GUI version of Vim (opposed to Vim running in a terminal emulator). It behaves exactly the same, but has additional graphical features.
3
votes
How can I grep to include the surrounding lines?
Another option is to write the matches + 6 lines to a temporary file. Something like:
:grep pat log
:cdo .,+6write >>search-results
:edit search-results
This should work even if your grepprg doesn’t …
2
votes
Accepted
I cannot detect where is ^M in my .gvimrc
When creating user commands with command, the trailing enter is somewhat implicit. You do not need to add <cr>. The leading colon is also implicit and not needed.
This is all in contrast to mappings.
0
votes
Why `highlight X ...` from `.vimrc` does not work in gVim (but works in VIM) and I have to t...
You probably need to add the highlight command to your gvimrc, since some things get reset when processing GUI startup.
2
votes
Accepted
Abort background process
Ctrl-\ (SIGQUIT) works in most unix terminals I’ve used and is more forceful than Ctrl-c (SIGINT). Try it when a program is misbehaving (but be careful hammering it in a nested context, where you mig …
3
votes
How to select all text and delete in vi?
To delete text, use the d operator. This can be done from visual mode, but is normally done with a motion or text object, such as
daw delete a word
d} delete to end of paragraph
dd delete a line
The …
2
votes
Accepted
Can vim/gvim save settings (e.g. spell check on/off) for individual files?
You can use views if viewoptions contains options or localoptions, but views are really meant to store window information (which happens to include the current buffer).
Sessions similarly are more ab …
1
vote
Error detected while processing BufRead Autocommands
The mailing list discussion confirmed a bug in the abaqus.vim ftplugin, which has since been patched.
Options for the current user are (according to lacygoill on the mailing list):
Wait for the next …
2
votes
How do I use the \+ quantifier?
According to :help \v,
*/\v* */\V*
Use of "\v" means that after it, all ASCII characters except '0'-'9', 'a'-'z',
'A'-'Z' and '_' have special meaning: "very magic"
"Speci …
2
votes
Delete repeating string in gvim
If available, :%!uniq is the easiest answer.
If you don't mind sorting, :sort u is nice.
The long way uses only builtins:
:let lines = getline(1, '$')->uniq()
:%delete
:call setline(1, lines)
2
votes
g[lobal] with a s[ubstitution]
The :global command takes a series of Ex commands to execute on the marked lines. :substitute is one-such, so use it directly:
:global/^\d/substitute/\v(\d)/\1.
Though as noted this (in this particul …
1
vote
Choose template option for newfiles in Vim?
A rough sketch with lots of bugs, probably. The function names could use some work, too.
function Templates(ext) abort
return glob(printf('~/Documents/Library/**/*.%s', a:ext), v:false, v:true)
endf …
1
vote
smart single or multiple character deletion of x
To make something work in visual mode, you need a visual-mode mapping (usually :x[nore]map). In this case, we need to do these steps
Save the register
Restore the selection and do the cut (x or d or …
1
vote
How can I change this comment plugin to work at the start of the line?
I think you need to change
" Comment the line
execute 'silent s/\v^(\s*)/\1' . comment_leader . ' /'
to
" Comment the line
execute 'silent s/^/\1' . co …
2
votes
Accepted
Syntax Match PLSQL Label
You don't need to use a character class around <, and you should probably not use a greedy .* match (would break on <<Label1>> <<Label1>>).
This worked for me:
syntax match PLS_label "<<[^>]\+>>"
(th …
2
votes
Accepted
Matlab syntax highlight: Avoid "reverse video" for "%%" at start of line
Try this:
" ~/.vim/after/syntax/matlab.vim
highlight link matlabCellComment SpecialComment
You can also use plain Comment