4 ms·
If you're interested in vim, but hesitant about the lack of IDE bells and whistles, VSCode's vim bindings are so good - with full support for e.g. splits, macro
by darintay 6y ago
If you're interested in vim, but hesitant about the lack of IDE bells and whistles, VSCode's vim bindings are so good - with full support for e.g. splits, macros, buffers, ... - that I've finally converted to using that over raw vim.
Most anything that VSCode can do, you can make vim do with plugins, but it is often incredibly time consuming and finnicky to get up and running, whereas with VSCode everything "just works".
All the productivity of being able to edit text in vim, alongside the conveniences of a real, modern IDE.
- i_love_limes 6y agoI'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.
- Keyframe 6y agoThing is my vim setup is different than vanilla vim, and probably the same for lots of other vim users. Thus, vanilla vim bindings in other editors do not do much for me.
- notJim 6y agoVSCode's vim setup is fairly customizable, and supports features from many popular vim plugins, like vim-surround, easymotion, and many others. I'd encourage you, or anyone else who's curious to give it a shot, because it may be better than you're expecting. That being said, I haven't been able to make the switch myself yet, even though I sort of want to. The vibe is off.
- 7786655 6y agoMy experience with VSCodeVim is that it's so slow it lags behind my typing. So I went the time consuming and finicky route instead, and it actually works pretty well. I can't think of anything I would get from using VSCode.
- edanm 6y agoI've recently been using VSCode+vim, after about 10 years of using only vim, and another year or so on Spacemacs (emacs + vim mode). VSCode is awesome, it provides a ton of benefits you don't get from emacs or vanilla vim. I'm really enjoying using it, and there's a chance that it will become my new "main" editor. That said, the vim mode is not perfect. It only takes a few minutes of work before I run into a limitation of the vim mode, some binding or other that I use and that isn't replicated. More importantly, some things feel broken - there have been cases where undo didn't work properly for me, and cases where numerical arguments to commands messed things up. That said, I've actually started taking the time to customize the vim mode in VSCode, and it's starting to pay off.