by zeroxfe · 9y ago · 0 comments
I've been a multi-decade Vim user, until I switched to VSCode last year. It made me realize how much better the user experience can be for an editor. I had all kinds of complex vim configurations and plugins with special cases for linux vs. mac, server vs. desktop, GUI vs. terminal, all of which are a huge pain in the butt to maintain.
If there was one thing I could ask of Vim (or even emacs), it'd be a consistent high-quality default user experience.
(Ofcourse, the default experience in VSCode isn't perfect either, but it took me four lines in settings.json and four plugins (vim, go, eslint, clang) for a near-perfect experience.)
The problem is vim editing never quite mixes well with other editors. The vim plugin for VS Code is great, but do you let it take over Ctrl? Do you get Ctrl-R for redo, and sacrifice other VS Code usages of Ctrl for example? The vim plugin is also pretty buggy here and there and no matter what, I always find a vim plugin is missing some vim feature I depend on.
It's frustrating in a first world sense. It's hard to have your cake and eat it too with vim.
The obvious example would be using the neo-vim frontend to interact with VSCode, Eclipse, IntelliJ, etc.
What I want most is a Neo-Vim frontend to org-mode in Emacs, because it would be hilarious and because while Spacemacs is kind of cool it's still not Vim. And org-mode is awesome and unparalleled but vim > emacs all day.
Another interesting approach is VimR (http://vimr.org/), which is Neovim combined with native IDE addons such as Markdown preview, file tree, etc. The nice thing about VimR is since the whole thing is one cohesive package, the developers can ensure it has a consistent experience. Sadly it's OSX only though.
M-x customize
What the OP is saying that this doesn't have to be a perpetual state. Once you invest effort early on getting it right you often don't need to touch it, beyond a few tweaks now and then. The maintenance burden definitely declines over time.
Then all you need is a storage solution like git and GNU Stow or the various clones (plenty of good ones around or just use a basic dir).
There are a few preconfigured configs on github, ala oh my ZSH but for Vim or Emacs. That's one solution.
But otherwise if you're not a fan of this config heavy approach then it's not for you. Just like using Linux desktop vs Mac. I love the configurability of Archlinux and I've similarily reached a mature point in my configs where setting up a new machine is zero work and I rarely need to tweak it, nor does it ever 'break' (which is a side effect of constant change).
emacs on the other hand, even as an experienced programmer, I found near unusable in its default and after a week of frustration with all the inconsistencies and oddities gave up on it. Which is a shame because obviously it is the more powerful of the two. I wish someone would create a modern editor in the spirit of emacs.
To me, the real hurdle to vim (or emacs) isn't configuration : it's learning vim (or emacs). That muscle memory doesn't come from a .vimrc file, and it doesn't come overnight. Is that what you meant by "quirks"?
I tried VS Code for a couple months last year. It felt like less of a hassle than vim from 10 years ago. But with pathogen, cloning into .vim/bundle doesn't feel any more burdensome than finding the best plugins on VS Code did.
I mean, to each their own.
No extra tools (just git), no symlinks.
So in my vimrc folder, I've got a work file, a school file, a home file, and a base file (which applies everywhere). Then I have a bash script that stitches all the relevant chunks together into a cohesive file for a given location. It can even do sub-locations by adding underscores to the name. E.g. 'work_nas' will produce a file consisting of the base, work and work_nas files, concatenated together.
This all sits in a private git repo, and I just manually copy the output files to wherever they belong whenever there's an update to them. I've been thinking for a while about writing a script to copy them into place, but GNU stow looks pretty interesting.
Any change I make to a dotfile then shows up on any other machines.
Besides that, I don't see how a better way to do it.
https://github.com/RichiH/vcsh
I have separate repos for SSH, Bash, VIM, and other stuff (like .inputrc).
EDIT: The biggest problem, for me, is that since they are all dotfiles, they are invisible to normal ls operations within the stow directory. It's a minor nit, but it can be quite annoying to run up against.
Yes, it took an initial investment but now it just works everywhere and maintenance is low.
(Some people say git repos in clouds sync are bad, but I have had zero problems with them over the years.)
Furthermore, Kakoune has a JSON-RPC user interface option that new UIs could be built around:
https://github.com/mawww/kakoune/blob/7482d117cc85523e840dff...
So it could happen if you wanted it bad enough!
If you're not interested in kak because of that paradigm change why are you interested in it at all?
The thing that confuses me most since the switch is vim's visual selection mode. I used to be a really heavy user of visual selection mode (V and v), but since selection is at the core of what kak does, vim's way of doing it seems really clunky now.
If I'm going to be spending more than half an hour on a machine, I'll probably end up taking a minute to build kak on it.
I will never be forced to use vi! ^__^
Immediately, VS code took ~4 seconds to start. From there, I opened a text file and just started typing, and immediately my CPU usage spiked. From further examination, any kind of redrawing by VS code seems to cause the entire application to be redrawn on the CPU, meaning typing text in VS code causes ~30% CPU usage across most of my cores[0].
I'll pass.
I was in a similar situation. I had a lot of junk in my config files from when I started learning vim seriously, a lot of which I never really used. I've recently started to rebuild them to try and simplify things, cut out the unused but "neat" stuff I added over time, etc. Kind of the nuclear option, and largely a result of a failure to adequately comment my dotfiles.
That's the tradeoff with editors like emacs and vim, unfortunately. Pretty much everything can be customized or tweaked, but it's mostly on you to explicitly do so. Spacemacs/SpaceVim/SpaceNeovim are some impressive default experiences, but they achieve that through large, complex config files that make it difficult for beginners to parse. I was recently talking to a friend who was thinking of switching to vim, and to be honest, I was a bit unsure about recommending one of those configurations when asked for a good default. They have some fairly well-defined conventions of their own, and while that allows some pretty neat stuff, it struck me as limiting for the beginner. With a configuration that's so tightly written (not sure if that's the best way to put it), I kind of felt like I was setting them up to use vim, but not be vim users. They might make tweaks in the future, but they might never dig deeper to really customize it. Or worse yet, even realize they can beyond a sort of intellectual acknowledgement of the possibility.
At that point, they might as well be using Atom, ST, or another GUI editor.
Sure, I understand that, and it's tricky maintaining a balance between simple configuration and features. My point is that with VSCode, there's just so much I get for free, with a very pleasant user experience. I still use vim when I need a quick editor in a terminal, but VSCode is my always-on go-to editor of choice for coding.
> I suppose over the decades you used vim your vimrc accrued many layers of cruft.
Yeah, I think I've got about 2 - 4 years of cruft (because I refactor and garbage collect a little bit every year.) But not 20. :-)
Still, it's a pain point that VSCode takes away. :-/
Interesting. May I ask why you use that particular smiley then? If VS Code works better for you, isn't that a good thing?
However, I would also be interested if there's more to this for you than the configuration. VS Code is the nicest editor I'm allowed to use at work (because it's a MS product, some companies are really paranoid when it comes to other software) - but I never really warmed up to it. It feels very clunky to me when compared with Sublime Text or Neovim. Also the Vim plugins for it really haven't impressed me so far.
Am I missing something, or is this a pure matter of taste?
execute pathogen#infect()
syntax on
filetype plugin indent on
set list listchars=tab:>-,trail:-
set ff=unix
set autoread
set number
set relativenumber
set linebreak
set tabstop=2
set shiftwidth=2
set expandtab
set ignorecase
set smartcase
set timeoutlen=1000 ttimeoutlen=0
let $BASH_ENV = "~/.bash_aliases"
color desert
set cursorline
augroup linehighlight
autocmd!
autocmd InsertEnter * set nocursorline
autocmd InsertLeave * set cursorline
augroup END
:hi CursorLine cterm=NONE ctermbg=darkblue ctermfg=white
:hi Normal ctermbg=blackI've been using vim since 2009 and tmux for the last 5 years. Initially, I had to figure out how things worked, and that took some time, but I never spent any time configuring it now except if I find a new plugin and figure out a new feature I'd like to add.
If you want IDE like features i.e Autocomplete than you have to spend days to make it work and even after that it doesn't work like other "GUI" editors.
+ Terminal interface is very limiting to have nice plugins...
I'm really glad I've switched to VSCode..
Indeed, but it doesn't really matter since the default experience in VSCode or IntelliJ or Xcode or any other IDE or editor doesn't work for me out of the box either. I have to change things anyways, and I can't change VSCode or IntelliJ or Xcode to fit my liking, but I've been able to change tmux+vim to it, although it could be even better.
> If you want IDE like features i.e Autocomplete than you have to spend days to make it work and even after that it doesn't work like other "GUI" editors.
For stuff like Go, Rust, Elixir, Python and so on, it works fine with when just installing the default "brand" plugin. Taking python as an example: even though "intellisense" in vim is worse than in pycharm, the rest of pycharm is so much worse than tmux+vim. "Intellisense" not being 100% in tmux+vim is not a dealbreaker for me at all. I can get by without "intellisense". But pycharm is so much worse for everything else than "intellisense", from basic editing to opening files to running shell commands and everything else I use all the time, which is a deal-breaker for me. For something like iOS+Mac development where I feel like I can't work without proper "intellisense", I do use Xcode.
> + Terminal interface is very limiting to have nice plugins...
Indeed, but still, even though tmux+vim sucks on some points because it's text-based, it doesn't suck enough to not be usable, and all these other editors and IDEs like IntelliJ, xcode, netbeans, sublimetext, vscode, atom and so on complete sucks for all the important things I need, which is a deal-breaker.
Usually because the box doesn't have coreutils, make and exctags installed. Bloated plugins are snakeoil, they push vim to the dark^WIDE side, where the battle is too Pyrrhic to win.
I used Vim for a good 5 years. I still miss many things about it, but a shitty default UX is not one of them.
edit: Just opened VSCode again and noticed one other major thing that has been driving me crazy. In vim I often have files open in different panes and then make one pane full size while editing. Can't do that with splits in VSCode as far as I know.
So the way I feel about it now is, yes, it would be nice to not have to deal with these configurations. But so far, editors like this aren't as good as the ones that do require more complex configuration, at least in my opinion.
But as others have mentioned, it's not so bad. Once you get your config right you can mostly leave it alone.
Maybe there's a solution with SSH file systems or similar, but now I'm getting into the realm of configuration we were hoping to avoid, right?
For a while I was even using a Chromebook and doing most of my coding by SSHing to my much more powerful desktop.
FWIW I find both Prelude (https://github.com/bbatsov/prelude) and Spacemacs (http://spacemacs.org/) to offer pretty out-of-the-box experiences.
I moved quickly back to tmux/vim.
I use sublime, atom and VSCode every once in a while when pair programming but apart from intellisense/autocomplete I don't get a lot more value from the Vim alternatives.
I wish I could have had some sort of true-integrated-vim-key-bindings, none of the vim-bindings plugins feel as productive, but editor as a whole has a lot more features for a lot less work.
There are a couple of things which I think could make the default config simpler:
- Enable global-subword-mode by default.
- Enable delete-selection-mode by default.
With that, and maybe adding multiple-cursors to the default distribution (with a little bit more refinement) and I could use it out of the box. I would still probably set up colours, and I like my fonts really tiny, but those would be a matter of customization.
One other thing maybe is making M-x customize more discoverable. I think for a lot of users (including myself sometimes) it is sometimes simpler to search for an option by what you think it should be called, and select one of the known good values than it is to write the elisp expression for it.
For many, though, once you get your environment set up, it feels amazingly natural, more than an IDE could provide. It's more a matter of taste than anything.
* Autocomplete. This deserves way more recognition than it gets. Having function signatures, documentation, overloads, types, available IN-LINE while you type saves so much work from programming and is essential to delivering correct code. If you want to be an effective programmer, this is a fundamental tool.
* Debugger. Easy breakpoints, conditional breakpoints, built-in profiling... Without these features, you will consistently produce inferior code.
I don't see how someone who calls themselves a serious programmer can throw away these exceptional tools.
VIM and other lightweights have their place, their place just isnt serious programming (by which I mean large software projects).
Whats more, VIM and similar tools make each step of the process, including incredibly simplke things like compiling and running your program, take exponentially longer and are similarly more xpensive to the programmer. I think most folks who don't believe this are simply in denial. VSCode delivers on these two features and is instantly an infinitely superior programming experience.
Its a cult.
Linus uses microEMACS, Guido uses emacs, Bjarne uses sam. The list goes on. What is your point exactly? That they are all fools & idiots? Or that the Linux, python & C++ projects do not qualify as serious programming?
Is it unfathomable that they know something you don't? Is it inconceivable that some people out there have a different yet valid opinion?
My personal experience with the few large codebases I've had to work on in the past is that IDEs would choke on them. If we wanted to get any work done that day we'd have to do it in a lighter code editor. As an added bonus, if we used vim or emacs we could now be as proficient remotely as we were locally.
In general, the stronger your opinions the more you must work to ensure that they're communicated in as non-alienating a way as possible. This is one of the fundamental forces of communication/persuasion. As it stands, your current comment leans on hyperbole quite a bit, and uses unkind labels for groups of people who are quite likely to read your comment. As a result, I suspect your comment may not go over well.
Coding. This deserves way more recognition than it gets. Having function signatures, documentation, overloads, types available IN-YOUR HEAD while you type saves so much work from programming and is essential to delivering correct code. If you want to be an effective programmer, you need to stop relying only on autocompletion.
And as always.. have a nice day!
http://vimdoc.sourceforge.net/htmldoc/usr_24.html#24.3
And a debugger doesn't have to be built into an editor to be functional. PDB, GDB, PRY, your browser's built-in debugger... all are quite useful without being built-in to your code editor. As a bonus, all but the last can be easily accessed from your terminal (which, hey, you have multiple terminal windows readily available in tmux!).
Sorry, troll fed. My apologies.