Skip to main content
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
Results tagged with
Search options not deleted user 26108

Vim reads initialization commands from a file called vimrc on startup. This can be used to set settings, define functions, execute autocommands, and more.

8 votes
7 answers
2k views

How to quickly type a C expression where the assigned-to variable is repeated?

I sometimes want to type an expression like this: table[row][col] = std::max(table[row][col], other_table[row+1][col+1]) (this is C++ code. Unfortunately there's no way in C++ to eliminate the dupl …
user202729's user avatar
3 votes

How to quickly type a C expression where the assigned-to variable is repeated?

It's possible to use a mapping: inoremap <silent> sf <c-r><c-r>=getline('.')[:col('.')-2]->substitute('.*;','','')->substitute('=.*','','')->trim()<cr> Or an abbreviation (if the keychain consists …
user202729's user avatar
0 votes

How do I swap key bindings without breaking plugins?

First, if the plugin exposes <Plug>something, then just use it. <Plug> ​ is visible outside of the script. It is used for mappings which the ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ user might want to map a …
user202729's user avatar