<p>While <kbd>Ctrl</kbd><kbd>X</kbd> works fine in vim under windows, <kbd>Ctrl</kbd><kbd>A</kbd> selects all (duh).</p>

<p>Is there a way to increment a number with a keystroke under windows?</p>

[{'answer_id': 66940, 'author': 'Peter Boughton', 'author_id': 9360, 'author_profile': 'https://Stackoverflow.com/users/9360', 'pm_score': 4, 'selected': True, 'text': '<p>Try Ctrl-NumPad + ?</p>\n\n<p>(<a href="https://web.archive.org/web/20080912200928/http://www.vim.org/tips/tip.php?tip_id=305" rel="nofollow noreferrer">from here</a>)</p>\n'}, {'answer_id': 84055, 'author': 'TMealy', 'author_id': 15954, 'author_profile': 'https://Stackoverflow.com/users/15954', 'pm_score': 3, 'selected': False, 'text': '<p>You can make <kbd>Ctrl</kbd><kbd>A</kbd> to increment in windows by opening up the \'mswin.vim\' file in your vim directory and finding the section that looks like:</p>\n\n<pre><code>" CTRL-A is Select all\nnoremap &lt;C-A&gt; gggH&lt;C-O&gt;G\ninoremap &lt;C-A&gt; &lt;C-O&gt;gg&lt;C-O&gt;gH&lt;C-O&gt;G\ncnoremap &lt;C-A&gt; &lt;C-C&gt;gggH&lt;C-O&gt;G\nonoremap &lt;C-A&gt; &lt;C-C&gt;gggH&lt;C-O&gt;G\nsnoremap &lt;C-A&gt; &lt;C-C&gt;gggH&lt;C-O&gt;G\nxnoremap &lt;C-A&gt; &lt;C-C&gt;ggVG\n</code></pre>\n\n<p>Comment out all of these lines as follows:</p>\n\n<pre><code>" CTRL-A is Select all\n"noremap &lt;C-A&gt; gggH&lt;C-O&gt;G\n"inoremap &lt;C-A&gt; &lt;C-O&gt;gg&lt;C-O&gt;gH&lt;C-O&gt;G\n"cnoremap &lt;C-A&gt; &lt;C-C&gt;gggH&lt;C-O&gt;G\n"onoremap &lt;C-A&gt; &lt;C-C&gt;gggH&lt;C-O&gt;G\n"snoremap &lt;C-A&gt; &lt;C-C&gt;gggH&lt;C-O&gt;G\n"xnoremap &lt;C-A&gt; &lt;C-C&gt;ggVG\n</code></pre>\n\n<p>and the <kbd>Ctrl</kbd><kbd>A</kbd> keystroke will increment.</p>\n\n<p>This is a pretty nice option when your keyboard doesn\'t have a real number pad.</p>\n'}, {'answer_id': 3910354, 'author': 'Paul', 'author_id': 472745, 'author_profile': 'https://Stackoverflow.com/users/472745', 'pm_score': 2, 'selected': False, 'text': '<p>I modified TMealy\'s solution so that <kbd>Ctrl</kbd><kbd>A</kbd> still selects all (I find this useful), while <kbd>Ctrl</kbd><kbd>I</kbd> increments (also useful).</p>\n\n<pre><code>noremap &lt;C-I&gt; &lt;C-A&gt;\n\n" CTRL-A is Select all\nnoremap &lt;C-A&gt; gggH&lt;C-O&gt;G\ninoremap &lt;C-A&gt; &lt;C-O&gt;gg&lt;C-O&gt;gH&lt;C-O&gt;G\ncnoremap &lt;C-A&gt; &lt;C-C&gt;gggH&lt;C-O&gt;G\nonoremap &lt;C-A&gt; &lt;C-C&gt;gggH&lt;C-O&gt;G\nsnoremap &lt;C-A&gt; &lt;C-C&gt;gggH&lt;C-O&gt;G\nxnoremap &lt;C-A&gt; &lt;C-C&gt;ggVG\n</code></pre>\n'}, {'answer_id': 8620507, 'author': 'Taylor Price', 'author_id': 3805, 'author_profile': 'https://Stackoverflow.com/users/3805', 'pm_score': 3, 'selected': False, 'text': '<p>I realize that this is an old question, but I ran across another option today based on the following question. Making gvim act like it does on linux will allow CTRL-A to work as you expect it to:</p>\n\n<p><a href="https://stackoverflow.com/questions/2093578/how-to-make-gvim-on-windows-behave-exacly-like-linux-console-vim">how to make gvim on windows behave exacly like linux console vim?</a></p>\n\n<p>There is a section of the _vimrc that has the following items. These cause many of the control characters to act like they do on Windows.</p>\n\n<pre><code>set nocompatible\nsource $VIMRUNTIME/vimrc_example.vim\nsource $VIMRUNTIME/mswin.vim\nbehave mswin\n</code></pre>\n\n<p>I commented out (with <code>"</code>) the mswin lines and the <code>set nocompatible</code> line. From there, I added <code>set compatible</code>. This causes gvim to act like it does on linux. Thus, mine looks something like:</p>\n\n<pre><code>set compatible\nsource $VIMRUNTIME/vimrc_example.vim\n"set nocompatible\n"source $VIMRUNTIME/mswin.vim\n"behave mswin\n</code></pre>\n\n<p>I just learned this trick today, so if I\'m not completely correct in my information, please let me know.</p>\n'}, {'answer_id': 31992975, 'author': 'Serge Stroobandt', 'author_id': 2192488, 'author_profile': 'https://Stackoverflow.com/users/2192488', 'pm_score': 2, 'selected': False, 'text': '<p>A similar problem occurs under GNU/Linux when using Vim with <a href="http://vimdoc.sourceforge.net/htmldoc/gui_w32.html#gui-clipboard" rel="nofollow noreferrer"><code>mswin.vim</code></a>.\nRemapping <kbd>Alt</kbd>+<kbd>X</kbd> to <kbd>Ctrl</kbd>+<kbd>A</kbd> prior to evoking <code>mswin.vim</code> solved my issue.</p>\n\n<pre><code>execute "set &lt;A-x&gt;=\\ex"\nnoremap &lt;A-x&gt; &lt;C-A&gt;\nsource $VIMRUNTIME/mswin.vim\nbehave mswin\n</code></pre>\n\n<p>Now, <kbd>Alt</kbd>+<kbd>X</kbd> and <kbd>Ctrl</kbd>+<kbd>X</kbd> respectively increase and decrease numbers in Vim.</p>\n\n<p>Mapping to <kbd>Alt</kbd> key combinations is often not evident in Vim; read more about this <a href="https://vi.stackexchange.com/a/2363/3168">here</a>.</p>\n'}, {'answer_id': 40601674, 'author': 'Darrel Lee', 'author_id': 307968, 'author_profile': 'https://Stackoverflow.com/users/307968', 'pm_score': 0, 'selected': False, 'text': '<p>I am using cygwin terminal + screen, so &lt;c-a> is captured by the terminal multiplexer.   I used this mapping:</p>\n\n<p>:noremap &lt;c-i> &lt;c-a></p>\n'}, {'answer_id': 50257388, 'author': 'user1537765', 'author_id': 1537765, 'author_profile': 'https://Stackoverflow.com/users/1537765', 'pm_score': 0, 'selected': False, 'text': '<p>It seems that the  <kbd>Ctrl</kbd><kbd>A</kbd> got mapped somewhere in startup.\nAs suggested before, use:<br></p>\n\n<p>unmap &lt;c-x&gt;</p>\n\n<p>I would use unmap, not nunmap. </p>\n'}]
['https://Stackoverflow.com/questions/66919', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6984/']