Since I was in university 15 years ago I promised myself to learn Vim commands seriously. Well I see that finally I did my programmer life learning only switching insert mode / edit mode, maybe 5 commands like A x etc...,and :q or :wq!
I relate quite heavily to this when using vi to do all my git-related activities. git rebase -i ... followed by ↓dw ↓←dw ↓←dw ↓←dw ↓←dw ↓←dw i s ↓s ↓s ↓s ↓s ↓s because I keep forgetting :s/pick/s/g is a thing i, a, :q, :wq, dd, xdd, and D are all the ones I remember, but cutting/yanking pasting is still something I don't have the muscle memory for. Shift+G takes me to the bottom of a file, but I don't know how to get…
Vim – Minimal Setup Explained
51–60 of 114 posts
Re: Vim – Minimal Setup Explained
#52Earlier quoted context omitted.
I wish Ctrl+[ wasn't tied to Esc. I hit that often instead of Ctrl+P. Haven't yet found a way to map Ctrl+[ to Ctrl+P without affecting behavior of Esc as well.
It's because your computer can't tell the difference. c-[ and ESC send the same key-code. Same with c-i and tab. What you can do to get around this is to remap one of them to something like f20 using Karabiner, then map f20 to what you like in vim.
Re: Vim – Minimal Setup Explained
#53Question for Vim users: how do you get used to hitting Esc very often? I know some switch Cap with Esc but still clunky.
The remapping was originally for Vim, but now at least a third of my Esc usage is outside of it.
Re: Vim – Minimal Setup Explained
#54Since I was in university 15 years ago I promised myself to learn Vim commands seriously. Well I see that finally I did my programmer life learning only switching insert mode / edit mode, maybe 5 commands like A x etc...,and :q or :wq!
I relate quite heavily to this when using vi to do all my git-related activities. git rebase -i ... followed by ↓dw ↓←dw ↓←dw ↓←dw ↓←dw ↓←dw i s ↓s ↓s ↓s ↓s ↓s because I keep forgetting :s/pick/s/g is a thing i, a, :q, :wq, dd, xdd, and D are all the ones I remember, but cutting/yanking pasting is still something I don't have the muscle memory for. Shift+G takes me to the bottom of a file, but I don't know how to get…
The whole thing would be something like 5jecs. Ctrl-v starts rectangular block mode, go down 5 lines and to the end of the word, change selection to "s", return to normal mode.
Re: Vim – Minimal Setup Explained
#55How do vim people quickly navigate their code without going "what was the name of that file with that function"?
Re: Vim – Minimal Setup Explained
#56Question for Vim users: how do you get used to hitting Esc very often? I know some switch Cap with Esc but still clunky.
Re: Vim – Minimal Setup Explained
#57Question for Vim users: how do you get used to hitting Esc very often? I know some switch Cap with Esc but still clunky.
Its the weakest part of the vim keyboard scheme IMO for ergonomics, and switching modes in general. I wish there was an alternative that gave a nod to vim but remained in 'input' mode without loss of capability, you know...without having to be vscode. If the key layout wasnt even worse, and it wasn't a bloated mess (on windows at least) I'd have switched to Emacs. Capslock is mostly a redundant button so I wholey sup…
Problem is, without modes, we lose capability that comes from the fact that modes exist, such as simple characters being compositeable commands;
How should a non-modal editor know whether that [d] I just pressed is me wanting the letter `d` or the delete command? It can't;
Either I have to somehow tell it "the next letter I press is to be interpreted as a command", or "interpret what I press as commands until I say otherwise". The former gets tiresome rather quickly (what if I have to do several commands?), the latter would again be a modal editor.
Re: Vim – Minimal Setup Explained
#58The only thing I've really struggled with when trying to get into using vim full-time is navigating my project. In VSCode I basically hit CTRL+SHIT+F -> "portion_of_a_function_name_or_something" constantly. I abuse the heck out of global search. Is there a way of navigating your project in vim that's similar/easier? How do vim people quickly navigate their code without going "what was the name of that file with that…
It lets you do pretty much what you say allowing me to type -f and partially type things to remember where I am with a preview pane. Seems moderately fast most of the time for the monolith I work on.
Re: Vim – Minimal Setup Explained
#59The only thing I've really struggled with when trying to get into using vim full-time is navigating my project. In VSCode I basically hit CTRL+SHIT+F -> "portion_of_a_function_name_or_something" constantly. I abuse the heck out of global search. Is there a way of navigating your project in vim that's similar/easier? How do vim people quickly navigate their code without going "what was the name of that file with that…
These days people generally use some kind of fuzzy finder plugin thats basically the same as the vscode experience. Exactly which one you use depends on various factors, but Telescope and Fzf are two big names and both allow searching through a bunch of other stuff, setting names, edit history etc. (You can also save the fuzzy search results to the quicklist so you've basically got a reusable index).
And neovim is heavily embracing the LSP paradigm, where you'd use something like gd to jump to definition when on top of a function and a language specific LSP server will tell Neovim where to jump to.
Re: Vim – Minimal Setup Explained
#60The only thing I've really struggled with when trying to get into using vim full-time is navigating my project. In VSCode I basically hit CTRL+SHIT+F -> "portion_of_a_function_name_or_something" constantly. I abuse the heck out of global search. Is there a way of navigating your project in vim that's similar/easier? How do vim people quickly navigate their code without going "what was the name of that file with that…
I tend to use FZF[1] which has functions for leveraging ripgrep and silver surfer for searches. It can also use find. FZF also has dialogues for paring down results in real time (i.e., as you type)
There are also plugins that are much more nuanced and more involved for searching symbols and providing autocomplete. Duoplete, vimcomplete, youcompleteme spring to mind.
[0]: https://ctags.io/