Back to Ideavim

What's New in IdeaVim __VERSION__

src/main/resources/whatsnew-2.46.1.html

2.47.0-eap.16.2 KB
Original Source

ideavim — whats-new — 80×24

~ $ ideavim

Here's what landed in __VERSION__.

new plugin · yank history

YankRing — every yank you make is kept

The bundled YankRing extension keeps a history of everything you yank, delete or change. Right after a paste, <C-P> and <C-N> swap the pasted text for the previous or next entry in the ring — so you can reach for something you copied a few yanks ago without going back for it. It works after p, P, gp, gP and the ]p / [p / ]P / [P variants.

Plug 'YankRing.vim'" right after pasting, cycle the paste through your yank history\<C-P\>" replace it with the previous entry\<C-N\>" ... or the next one:YRShow" list the ring:YRClear" empty it:YRReplace 3" cycle by an explicit offsetlet g:yankring\_max\_history = 100" how many entries to keep

mouse · selection

Select with the mouse where Vim doesn't own it

For the modes your 'mouse' option leaves out, dragging with the left button now makes a modeless selection : the text is selected so you can copy it, but the caret stays put, Visual mode doesn't start, and operators won't act on it. It disappears as soon as you type a command or start another selection.

set mouse=n" Vim handles the mouse in Normal mode only —" a drag anywhere else just selects text

Turning the mouse off for a mode no longer takes the IDE's mouse features with it: the context menu, gutter clicks, middle-click paste and Ctrl/Alt/Shift gestures keep working, since only a plain left-button click over text is Vim's to interpret.

search · highlighting

See which match you're actually on

The match under the caret is now highlighted differently from all the others. After /lorem or n, the match you land on is drawn with a box around it while the rest keep the plain search highlight, and the box follows you as you move between matches. Previously only the 'incsearch' preview looked like that, so once the search was accepted every match became indistinguishable.

set hlsearch/lorem" the match you land on gets the box; n and N move it

ex commands · autocommands

Always come back to Normal mode

The new :stopinsert command leaves Insert or Replace mode as if you had pressed Esc, and does nothing in any other mode. It is meant for an autocommand, which is Vim's answer to "put me back in Normal mode whenever I switch files".

autocmd BufEnter \* stopinsert" back to Normal mode on every file you open

Leaving Insert mode is now something a handler has to ask for: the buffer and window events no longer end an insert session merely because you registered an autocommand for them.

also worth a look

sethandler on the command line

The new c mode letter says who owns a shortcut while the : command line is active. sethandler <F2> a:ide c:vim gives it to the IDE everywhere except there, which keeps a cnoremap <F2> … mapping working.

macOS key repeat, any time

"Enable repeating keys in macOS on press and hold" is now a checkbox in Settings | Editor | Vim, instead of a one-time question the first time IdeaVim started. macOS reads it at startup, so the IDE asks to restart.

polish & fixes

  • Backspace in Replace mode brings the text back — Vim remembers what each typed character replaced, so R, mushroom and eight backspaces leave the original word exactly as it was. <C-W> restores the characters it steps over too, rather than deleting the word.
  • "Reformat on paste: None" is respected — a linewise paste no longer reindents the pasted lines when you've turned that Smart Keys setting off, so yyp repeats the line as it was written.
  • <CR> survives :execute:exe "normal! iX\<CR>Y" used to type only X; the Enter key now reaches :normal, and a register built the same way (let @q = "iX\<CR>Y\<Esc>") inserts both lines.
  • :normal gives your mode back — run from an autocommand while you are typing, it executes its keys as Normal mode commands and returns you to Insert mode instead of dropping you out of it.
  • Paragraph motions and the blank line betweend} no longer swallows the blank line that separates two paragraphs, y} no longer yanks a trailing new line, and d} / y} on the very first character of the file are linewise again.
  • Word motions at the end of the filedw, dW and de on the last character of a file now delete it instead of doing nothing.
  • Motions across writing systems — a WORD is any run of non-blanks, so E on abcあいう def lands on ; and non-ASCII punctuation ends a word, so w on foo—bar stops at the em dash.
  • Sentences and quotes) no longer lands past the end of a file that ends with a new line, da" treats a tab after the closing quote as trailing white space, and a count for the inner quote object works (d2i" takes the quotes themselves).
  • Counting matches with :s — the n flag now only reports how many matches there are (:%s/foo/bar/n2 matches on 2 lines) and leaves your text alone. A backslash delimiter no longer fails either: :s\/new/ reuses the last search pattern.
  • Regex corners\zs and \ze in an alternative that ultimately fails no longer move the match, a look-behind with alternatives of different lengths keeps trying (\%(a\|ab\)\@<=c matches in abc), and \c no longer makes [[:upper:]] match lowercase.
  • A clean slate on startup — with 'hlsearch' on, projects no longer open with the previous session's search still highlighted.
  • Clipboard registers keep their type on Linux — a linewise yank stays linewise in the * and + registers, so yy then "*p pastes on a new line. And with clipboard=unnamed, pasting no longer overwrites the very register it pasted from.
  • Vim in a console started from a file — a Python console launched with "Run file in Python Console" is now recognised, so Normal mode, motions and Esc work in its input.
  • Autocommands ignore internal editors — the command-line window, the :substitute preview and the control characters editor are an implementation detail, so autocmd BufEnter * … no longer fires when one of them opens.
  • "See What's New" works in split mode — the release notes page now opens as expected in the frontend/backend architecture used by remote development.