Back to Ideavim

What's New in IdeaVim __VERSION__

src/main/resources/whatsnew-2.44.0.html

2.44.04.1 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.

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.

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.