4 ms·
I'll add that all Jetbrains products (IntelliJ, PyCharm, WebStorm etc) have the IdeaVim plugin which is also great, and it also respects some vimrc configuratio
by i_love_limes 6y ago
I'll add that all Jetbrains products (IntelliJ, PyCharm, WebStorm etc) have the IdeaVim plugin which is also great, and it also respects some vimrc configurations too.
I always loved vims movement and editing and hated it's file traversal / project management, so this is a perfect amalgamation
- modernerd 6y agoIdeaVim is faster and less laggy than VSCodeVim in my experience. You can even use a custom ~/.ideavimrc and bind leader shortcuts to JetBrains actions. I rarely ever touch the mouse in IntelliJ now. It's an ultra-productive environment to have the power of IntelliJ, the convenience of vim, and Spacemacs/Doom Emacs style shortcuts. For example, to manage projects: nnoremap <leader>po :action ManageRecentProjects<CR> nnoremap <leader>pc :action CloseProject<CR> Or to create/switch git branches: nnoremap <leader>gb :action Git.Branches<CR> Or to bring up the nav bar to change or create new files (Ctrl/Cmd + N once the nav bar is visible): nnoremap <leader>fn :action ShowNavBar<CR> Or to summon git blame annotations in the current file (repeat to dismiss them): nnoremap <leader>ga :action Annotate<CR> Or manipulate windows: " Window movement. map <leader>wv :vsplit<CR> map <leader>ws :split<CR> map <leader>wd <C-W>c map <leader>wx <C-W>c map <leader>ww <C-W>w map <leader>wl <C-W>l map <leader>wh <C-W>h map <leader>wk <C-W>k map <leader>wj <C-W>j map <leader>wo <C-W>o Or summon “Refactor This” at the cursor point: nnoremap <leader>rt :action Refactorings.QuickListPopupAction<CR> You can get a list of available actions for your current environment and plugins with the :actionlist command. I only started playing with this recently but my current config is here for those interested: https://gist.github.com/nickcernis/bcb5cb7f55c07ed3de8287d163ed7c28 https://gist.github.com/nickcernis/bcb5cb7f55c07ed3de8287d16... It takes a bit of searching and fiddling, but once you hide all the chrome (I even hide tabs at Editor → General → Editor Tabs → Tab Placement = None), install IdeaVim and configure shortcuts how you want them IntelliJ feels just as slick as a tricked-out Emacs/vim, but with better out-of-the-box code intelligence. On Mac I also remap Ctrl+hjkl system-wide so that I can navigate IntelliJ popovers with vim-ish shortcuts. I use Karabiner for this with the “Vi Mode, left_control + hjkl. shift/option/command + arrow working” option on this page: https://ke-complex-modifications.pqrs.org/?q=%20PC-Style%20Shortcuts https://ke-complex-modifications.pqrs.org/?q=%20PC-Style%20S...
- maxioatic 6y agoWow, I didn't realize I could map JetBrains actions. That is awesome! Thanks for the tips! There goes my afternoon...
- badhrink 6y agoAny idea if there is a way to check for presence of Ideavim in vimrc/init.vim? I have a single config for all vim related things(vimrc) and source it for neovim as well, hence I was curious. For example, has('nvim') checks for neovim. Something like this for 'ideavim' would mean I can add IntelliJ related stuff inside that check.
- modernerd 6y agoI haven’t tried it but there are a couple of suggested workarounds here: https://stackoverflow.com/questions/34528322/how-to-include-only-some-of-vimrc-in-ideavimrc https://stackoverflow.com/questions/34528322/how-to-include-...
- singron 6y agoIdeaVim has a few issues due to being thrust onto another application. E.g. Ctrl-V pastes from the clipboard instead of entering visual block mode. Also, it sometimes doesn't process input in order. E.g. pressing Esc Shift-O will sometimes type an "O" before exiting insert mode instead of creating a new line above the cursor. Also useful features that aren't basic movement tend not to work, like text reflowing with gq. I have a hot key for opening the current file in an actual vim instance whenever I want to write multiline text or use visual block mode.