Back to Ideavim

What's New in IdeaVim __VERSION__

src/main/resources/whatsnew-2.45.0.html

2.45.05.4 KB
Original Source

ideavim — whats-new — 80×24

~ $ ideavim

Here's what landed in __VERSION__.

new plugin · text objects

textobj-user — build your own text objects

The bundled textobj-user extension lets you declare custom text objects straight from your ~/.ideavimrc — no plugin code required. Describe a pattern (or a head/tail delimiter pair) and the keys that select it, and IdeaVim wires up the matching i/a objects and motions for you.

Plug 'kana/vim-textobj-user'" a spec maps a name to a pattern and the keys that select itcall textobj#user#plugin('datetime', {
\'date': {
\'pattern':'\\<\d\d\d\d-\d\d-\d\d\\>',
\'select': ['ad','id'],
\ },
\ })" now 'dad' deletes a date like 2013-03-16, and 'cid' changes it

Objects support select-a/select-i, next/previous motions, a charwise/linewise/blockwise region-type, and remappable <Plug> mappings.

operators · motions

Force a motion's shape mid-command

Slot v, V, or <C-V> between an operator and its motion to force the range's shape. v forces charwise and flips the motion's inclusive/exclusive nature, V forces linewise, and <C-V> forces blockwise.

dvw" charwise — includes the landing chardv$" charwise — leaves the last chardVe" linewise — deletes the whole lined\<C-V\>j" blockwise — deletes a vertical block

insert mode · completion

Line and file-path completion with CTRL-X

Vim's <C-X> completion submode arrives in Insert mode. Start it with <C-X>, then complete whole lines from the current buffer or file paths from disk.

\<C-X\>\<C-L\>" complete the current line from matching lines\<C-X\>\<C-F\>" complete a file path from the file system

input · keyboard layouts

Type another language without switching layouts

The new 'keymap' option loads a set of language mappings so you can type non-English text while your system keyboard stays on its usual layout. Choose one of the dozens of bundled keymaps — from russian-jcukenwin to greek, dvorak, or accents — or drop your own file into ~/.config/ideavim/keymap/. The mappings apply to typed text only while 'iminsert' is on; toggle it any time with <C-^> in Insert mode.

set keymap=russian-jcukenwin" load a bundled keymapset iminsert=1" enable it for typed text (or press \<C-^\>)

Also adds the :loadkeymap command and the :lmap / :lnoremap / :lunmap / :lmapclear language-mapping commands.

spelling · dictionary

Fix a misspelling from Normal mode

Vim's spelling commands now talk to the IDE's own spell checker. Put the caret on a word and press zg to accept it as correctly spelled, zw to take it back out of your dictionary, or z= to choose from a list of suggested replacements.

zg" mark the word under the caret as correctzw" remove it from the dictionary againz=" pick a replacement from the suggestions

Accepted words go into the IDE's spelling dictionary, so the rest of the IDE stops flagging them too.

also worth a look

Jump matches while searching

With incsearch on, press <C-G> to jump to the next match and <C-T> to the previous one — without leaving the / or ? prompt.

Your .ideavimrc, anywhere

Set the IDEA_VIM_CUSTOM_VIMRC environment variable to load your .ideavimrc from a custom path instead of the default locations.

Press gx in Normal mode to open the URL under the caret with your OS default handler — any scheme:// address works, and the program is overridable via g:netrw_browsex_viewer.

Write to another file

:w {file} saves the buffer to a new path, a range like :1,2w out.txt writes only those lines, and :w! overwrites while plain :w refuses to clobber an existing file.

Vim in the Python console

Normal mode, motions, and Esc now work in the Python console input, while the console keeps handling Enter, the history keys, and the horizontal arrows.

polish & fixes

  • No more stray Visual mode after a refactor — with idearefactormode=keep, a rename (or similar action) no longer leaves you in Visual mode; the mode you were in beforehand is restored.
  • Trailing % respects your range — running a command on a Visual selection with a % appended (e.g. :'<,'>%d) no longer expands to the whole file; the % is now ignored, matching Vim.
  • Panels follow your theme — the : output panel and command line now refresh their text colors when you switch the IDE theme or editor color scheme while they are open.
  • :s///g on indented lines — a global substitute such as %s/Cinema/Other/g now replaces every match on lines that start with tabs, not just the first one.
  • No crash while navigating methods — [m and]m no longer crash when an element in the file structure has no text range.
  • Caret after delete-to-end from <C-O> — running D, d$, or d3w after <C-O> now leaves the caret in the right place when you return to Insert mode.
  • Search lands on the match you stepped to — after walking through matches with <C-G>/<C-T> during an incremental search, pressing Enter now takes the caret to that match.
  • Vimscript errors are no longer swallowed — parse errors in your config are shown instead of failing quietly, and an error on the last line no longer discards the whole script.
  • Literal square brackets in patterns — searches such as /heap[, /[[[, or /[a-z work again: an unmatched [ is a plain bracket, and a ] right after [ or [^ belongs to the collection (so /[]] matches a ]), just like Vim.