11 ms·
Actualvim – Sublime Text 3 input mode powered by Vim itself
- xutopia 13y agoThis makes me want to ask... why not just use vim?
- terhechte 13y agoI'm just guessing here, but you can use all the Sublime Plugins and Key combos while in INSERT mode. The Vim Insert Mode is rather limiting since you're supposed to do mostly just typing in there. I always add the basic emacs keybindings to my vimrc so that I can jump by word, to the beginning of the line / the end or move by character, without leaving insert mode. I really don't like leaving insert mode for just 2 char movements. I know there's CMD-O for that, but I find it too cumbersome still. Apart from that, many people like the looks of Sublime, and (at least for me) the Sublime text view scrolls a lot better for large documents than either Vim, MacVim, or Emacs. Edit: I'm not a Sublime user, I switched from longtime Vim to Emacs + Evil a couple of months ago and couldn't be happier (well, I'd like better scrolling, but I mostly jump anyway)
- recuter 13y agoVim can be setup to look and scroll exactly like Sublime, I recall a mapping where the key for 'go down a screen' is overridden with multiple 'go down 1 line' which makes it feel smooth. (I generally just go '{L,H,M}', 'z{t,m,b}') As for jumping around while in insert mode, I totally understand that instinct but it goes against the grain of Vim. Don't spend extra time in insert mode. I think the real problem with Vim is that you have to wrangle it with a lot of tweaks to make it sane and comfortable and that's a rabbit hole a lot of people (justifiably) don't want to go down. Sublime is very friendly, I like it a lot, Vim demands a long weekend of your life to customize but it really does leapfrog everything once you get it right.
- TheSmoke 13y agoand then there is this: https://github.com/fatih/subvim https://github.com/fatih/subvim sublime in vim :-)
- MetaCosm 13y agoor vim in emacs: http://www.emacswiki.org/emacs/Evil http://www.emacswiki.org/emacs/Evil ... I for one, look forward to running emacs in sublime, and in an eterm in emacs running vim, which will of course, be running subvim, full circle.
- beaumartinez 13y agoBecause with this you can use Sublime Text's UI (chrome, file browser, and smooth scrolling—all better than Vim's) with Vim's input mode. Best of both worlds.
- 0X1A 13y agoThe point of vim and its key bindings is to not have to use anything other than the keyboard (and keys that are not too off from the home row), so it's not the best of both worlds at all. Having to click on something forces someone to use their mouse, breaking their concentration and wasting time on clicking on a tab.
- shawabawa3 13y agoYou never have to click anything in sublime
- jonknee 13y agoHaving to click on something is different from being able to click on something. Vim doesn't let you use one of the two primary input tools of your computer--Sublime lets you use both. To borrow your situation, if you are already using the mouse it's distracting to have to use the keyboard.
- s0l1dsnak3123 13y agoThat's actually not true - vim does let you use your mouse: http://vim.wikia.com/wiki/Using_the_mouse_for_Vim_in_an_xterm http://vim.wikia.com/wiki/Using_the_mouse_for_Vim_in_an_xter...
- 0X1A 13y agoMaybe you should actually use something before forming an opinion on it. Your lack of knowledge with vim is pretty obvious given that you didn't know that you could use your mouse.
- w1ntermute 13y agoThe main reason (for me) is Ctrl+P. Working on a project with lots of files (like Rails) without that is a huge pain.
- L8D 13y agoNot only does Vim have a Ctrl+P plugin, but the Ctrl+P feature of Sublime originated from the Vim plugin.
- w1ntermute 13y agoI know. But it doesn't work the way I want it to. It needs to fuzzy search the directory that I've opened, prioritizing first by reverse chronological order of when they were opened. It's been a while, but I played with the settings for both the CtrlP and the Command-T plug-in, but neither worked like in Sublime.
- johncoltrane 13y agoNo. Kien's CtrlP plugin is inspired by Sublime's Ctrl+P (the name is the hint) feature which itself extends TextMate's Cmd+T and Cmd+Shift+T which inspired numerous other Vim plugins like Command-T (hint), FuzzyFinder, LustyExplorer, Unite and many others.
- leokun 13y agoBecause vim is broken. I gave up vim after 7 years because of all the segfaults, in-extensibility and just horrible code. Some of the files in the vim code base are over 20,000 lines with hundreds of ifdefs, and littered with unsafe pointer use. The code is a horrible experience to just look at, pre 1989 C style functions, mixed tabs and spaces everywhere, and the files aren't even a valid encoding of any kind whatsoever, instead it has this broken mbyte that will ruin your day if you touch a vim source file in anything but vim. If you use vim as is you may not notice much, but vim will forever be limited to responding only to user interaction with no hope of ever getting any kind of timers, async actions or event loop. Try making a simple clock for your status line that updates every second. You can't. And it will never be possible. Because vim is broken.
- TallboyOne 13y agoHow much of a challenge would it be to rewrite vim properly? Or is that a crazy idea..
- recuter 13y agoNot that crazy. Vim itself is a reboot of Vi, and there were/are other minimal Vi clones that are very small (couple of KLOCs). You'd be throwing away the horrible Vimscript, and sadly the community is married to it. As a result your neat little Vim2 reboot thing will not be nearly as useful for a long time, so you've lost backwards compatibility for what? Cleaner internals? Doesn't really benefit the end user much. :)
- lightblade 13y agoI really don't care much about backward compatibility with existing plugins. We're using vim not the plugins anyway. I justed wanted an terminal editor with vi bindings.
- eyko 13y agoAs long as it can parse my .vimrc (but then, that's vimscript)
- msoad 13y agoBecause this happens when you open a large file in Vim http://i.imgur.com/erVrk5j.png http://i.imgur.com/erVrk5j.png
- kozikow 13y agoBetter question: why not emacs with evil mode?
- DannoHung 13y agoThings I would actually be interested in for Vim: Some sort of type-validation plugin for languages like C, C++, Scala, Haskell, etc. There are ways to get around it, but getting the error in the editor window is very nice for dummies like me.
- L8D 13y agohttps://github.com/scrooloose/syntastic https://github.com/scrooloose/syntastic
- DannoHung 13y agoHuh, do the syntax checkers for those languages actually do type checking too?
- bennylope 13y agoSyntastic is great for flagging syntax errors, but I don't think it provides for type checking like DannoHung is after.
- burke 13y agoActually, it does: http://cl.ly/image/2Z2U080T0L2A http://cl.ly/image/2Z2U080T0L2A
- lunixbochs 13y agoSublime Text in-editor linting is one of my projects too (sublimelint/SublimeLinter).
- madmax96 13y agoWhy wouldn't I just use Vim (or better yet, Emacs) in the first place?
- naiyt 13y agoBecause you get all of the benefit of Sublime AND Vim. There's plenty of benefits to using Sublime over Vim, and vice-verse. This way you can have the best of both worlds. There are already Sublime plugins that do this, but they are kind of lackluster to be honest.
- faizshah 13y agoLots of vim stuff is implemented in emacs lisp and there are a few different efforts to emulate the unique parts of LightTable and Sublime into emacs. It just comes down to preference. I enjoy using all three, but emacs is the one which has everything I personally need. http://www.emacswiki.org/emacs/LightTable http://www.emacswiki.org/emacs/LightTable http://www.emacswiki.org/emacs/MiniMap http://www.emacswiki.org/emacs/MiniMap http://www.emacswiki.org/emacs/Evil http://www.emacswiki.org/emacs/Evil https://github.com/emacs-helm/helm https://github.com/emacs-helm/helm (go to anything)
- beaumartinez 13y agoI've said this elsewhere in this thread, but— With this you can use Sublime Text's UI (chrome, file browser, and smooth scrolling—all better than Vim's) with Vim's input mode. Best of both worlds.
- dllthomas 13y agoThere do seem to be things that Sublime does better, but some of us don't want chrome. I work mostly in terminals in ratpoison for a reason...
- lunixbochs 13y agoI split the difference. I use Vim if I'm in a server somewhere or if I'm already looking at the command line for git or ag or something. I usually use Sublime when working on a whole project at once.
- aeon10 13y agoI love vim's keybindings and cant work without them. I really like sublime but i just cant leave vim's keybindings which makes me so much efficient. Last time I tried a vim emulator for sublime it didn't go so well. it wasnt as smooth and limiting. I hope someone perfects the vim+sublime combo because that would be killer.
- prawks 13y agoDitto, in Visual Studio. I use viEmu a lot, but it has strange behavior sometimes and missing features.
- city41 13y agoIt's still the best vi emulator I've found. If you know of better ones, I'd love to hear about them.
- et1337 13y agoCheck out VsVim. It's pretty solid. http://visualstudiogallery.msdn.microsoft.com/59ca71b3-a4a3-46ca-8fe1-0e90e3f79329 http://visualstudiogallery.msdn.microsoft.com/59ca71b3-a4a3-...
- et1337 13y agoVsVim's implementation is very complete. http://visualstudiogallery.msdn.microsoft.com/59ca71b3-a4a3-46ca-8fe1-0e90e3f79329 http://visualstudiogallery.msdn.microsoft.com/59ca71b3-a4a3-...
- city41 13y agoMe too. I really love the way vim manipulates text. But I really dislike vim as a dev environment. I currently run with a bunch of plugins (nerdtree, YouCompleteMe, vim-indent-guides, ctrlp.vim, etc etc) and they all roughly do what they intend to do. But at the end of the day, I find myself tweaking my vim config a lot just to get a decent experience. Vim feels a lot like Linux to me. When I was young I loved Linux as I really enjoyed tweaking it and hacking on it. But now I just want my OS to work and get out of the way, so I use OSX. I want the "OSX of editors", which is probably Sublime. But man do I love vim's text manipulation. When I was a .NET dev, Visual Studio+viemu was pretty much perfect. Text manipulation via vim, project management via VS. viemu is the only vi emulator I've found that is really well done.
- kal00ma 13y agoJust installed it on ubuntu using sublime text 3 (installed from sublime-text_build-3047_amd64.deb). I get into vim mode when creating new files; however, when opening existing .py files on disk I don't get the vim editor.
- lunixbochs 13y agoCan you report this on the issue tracker? https://github.com/lunixbochs/actualvim/issues https://github.com/lunixbochs/actualvim/issues Also can you check the console when opening a file to make sure there's no error?
- zombie_hitler 13y agoThis is like using vim-mode on emacs.
- lunixbochs 13y agoVim-mode on emacs probably uses an internal emulator and doesn't slave a real Vim instance to do the work. In that case, you have at least Vintage, Vintageous, and my original project sublimevim (that was mostly a proof of concept before we had any of this) as "vim-mode" in Sublime Text.
- lunixbochs 13y agoAuthor here: This works using Vim's NetBeans control protocol (inside Vim, do `:help netbeans` to get an overview. Also see the VimSocket class in vim.py) and minimal help from a simple VT100 emulator I wrote (found in term.py). Open the command panel (cmd|ctrl+shift+p) and run the "ActualVim: Monitor TTY" command if you want to see what's going on in the terminal for any open view. I actually wrote the first Vim emulation mode in Sublime Text a couple years back ( https://github.com/lunixbochs/sublimevim https://github.com/lunixbochs/sublimevim ) that possibly inspired the other similar plugins. I consistently ran into enough unsupported motions with both my own and other plugins that I caved and wrote ActualVim.
- aidos 13y agoReally nice work. I'm happy where I am in vim but if I ever decided to move this looks like the way to go. OT It's funny how conditioned I am to seeing __Beans and instantly dismissing it as something I can't be bothered to look into. Silly biased me; it looks like a really powerful protocol.
- lunixbochs 13y agoI have my share of complaints about the NetBeans protocol. It's actually pretty weird and incomplete, but it's supported by default so I'm using it. I think it's meant to be used the other way - using Vim as your frontend to edit code while using NetBeans to manage the project, lint, compile, etc - but it had enough functionality I was able to barely make it work the other way.
- justinmk 13y ago> NetBeans protocol ... I think it's meant to be used the other way - using Vim as your frontend to edit code while using NetBeans to manage the project eclim[1] is probably an excellent reference-implementation of both approaches. Did you look at it, and if so was it useful? [1] https://github.com/ervandew/eclim https://github.com/ervandew/eclim
- 13y ago