Earlier quoted context omitted.
Most of those are plain vi ( and ed ) commands. All of my machines have the vim-tiny package to stay as close to stock vi as possible. I open and close the editor dozens of times a day to make simple changes and I don't tolerate any lag. I can see that vim would be great for long-form programming but plain old vi was just fine for most admin tasks.
Use Plug to load the plugins that you only need for a specific file. For example, this only load this plugins if I'm working wiht LESS/SCSS/CSS or Vue files : Plug 'groenewege/vim-less', { 'for': ['less']} Plug 'cakebaker/scss-syntax.vim', { 'for': ['scss'] } Plug 'othree/csscomplete.vim', { 'for': ['less', 'scss', 'css', 'vue'] }
Ten Years of Vim
111–120 of 123 posts
Re: Ten Years of Vim
#112Earlier quoted context omitted.
'[d|c]iw', to delete/change the word your inside of is another small improvement.
I'm also a big fan of `ci[(|'|"]` to change all the text between a pair of delimiters. I can type `ci"` while my cursor's at the start of the line, and it'll jump to the first set of double quotes, remove the text that's currently between them, and enter edit mode.
Re: Ten Years of Vim
#113> I don't use arrow keys to move around in text anymore but forced myself to use h, j, k, l. Many people say that this is faster. After trying this for a few years, I don't think that is true (at least for me). I now just stick to it out of habit. Sounds like he's not a touch-typist. And as a general note; learning and mastering vim can hardly be a pleasant activity for non touch-typists, or otherwise typing heroes.
Re: Ten Years of Vim
#114Earlier quoted context omitted.
For mutating programs (as opposed to general text-editing), this text-centrism seems to me like a limitation. I use a combination of IntelliJ & emacs, and the former's deeper model of the programming language syntax definitely leads me to me thinking in terms of a syntax tree units rather than 'text', such that programming in emacs feels like going down a cognitive-abstraction step. The gap can probably be bridged wi…
In general, I agree that a syntax-tree would make more sense, but I think the text centrism is some sort of greatest common denominator as that approach works for many languages (more or less). A syntax tree on the other hand, would work better but probably required some sort of training for every new language :-/
This is partial and patchy at best, but IMO a move in the right direction (towards affording higher levels of cognitive chunking when coding). Some languages have elements of this kind of thing working with traditional editors (eg Go Doctor for golang), and I'd ultimately prefer this less monolithic approach, but it's not really there yet.
Re: Ten Years of Vim
#115Maybe hjkl is a little faster than arrow keys. I don't care. I just like doing my editing with less hand movement.
I'm sure that I could perform many operations faster with a mouse. Select text, drag it a little below. Probably faster than d}}p even. The point is, mouse is finicky and annoying. The context switch between typing and moving the mouse breaks flow. Aiming the pointer is hell, and even worse if the target is small or the mouse of low quality. Anyone who plays click-heavy video games (RTS, many MMOs, 4X) can probably understand the pain of dragging the cursor between two points and clicking repeatedly.
Vim is terrible. It takes a while to learn and when you've learned it well enough you're spoiled and everything else feels painful. Vim is the closest I can get with current technology to a neurally linked brain-controlled editor. It feels like the cursor obeys my thoughts, not the limits of my manual dexterity. The next step would be an editor actually wired to my brain where I just think what the text should look like.
Re: Ten Years of Vim
#116I use (Vim IMproved - not vi) vim all the time. I find it interesting to see what features other people tend to use in vim, there seems to be some minor differences in their workflows, but it's not clear who "wins" the productivity battle. I only use a very small number of it's features: * `:tabe` Create a new tab * `:e .` Start browsing files in that tab * `:w` Write the file * `:q` Quit the file (`:q!`, seriously,…
Regarding the replace thing: If you are used to sed it should be easy, as it is pretty much the same. I keep using this pattern over and over again: :%s/search/replace/gc The '%' is some sort of reference to the file you are currently editing and therefore you are doing a replace on the whole file. You can see the difference in combination with some visual selection. When you select some text and press ':' it opens a…
Re: Ten Years of Vim
#117Earlier quoted context omitted.
I would either: * SHIFT+V to highlight a line, `d` to delete * `:d` to delete the current line Not experimented with `dd` (or `yy`).
SHIFT+V + 'd' is a longer way of doing 'dd'. SHIFT+V + 'y' is a longer way of doing 'yy'. You can also delete and yank multiple lines by using 'd2d' (delete two lines) or similar. You can also delete lines upwards by using a movement command like 'dk' (or 'd2k' if you want to delete the two lines above).
And I jump between enough systems that I doubt myself with stuff like: is `d1d` or `d0d` or `dd` equal?
Re: Ten Years of Vim
#118Re: Ten Years of Vim
#119Earlier quoted context omitted.
I'm also a big fan of `ci[(|'|"]` to change all the text between a pair of delimiters. I can type `ci"` while my cursor's at the start of the line, and it'll jump to the first set of double quotes, remove the text that's currently between them, and enter edit mode.
Isn't this part of vim-surround? http://github.com/tpope/vim-surround
Re: Ten Years of Vim
#120Earlier quoted context omitted.
OP here. Thanks for the tips. I've used vim-sneak for quite a while (it's even built into Visual Studio Code's Vim plugin), but it just didn't work with me. I'm more of an easymotion ( https://github.com/easymotion/vim-easymotion ) type of guy. But even easymotion vanished from my workflow, because `/` works almost equally well for me and easymotion is not available on every system I use. I guess what I'm trying to s…
I think vim-expand-region ( https://github.com/terryma/vim-expand-region ) is what you're looking for. It allows you to repeatedly 'v' to select ever larger parts of text.