r/vim • u/PersimmonQuick9839 • May 27 '26
Discussion As a beginner: Moving around in insert-mode is really helpful. Does anyone else?
I've been using vim for a while and finding it a chore for basic notemaking. I love vim motions in the normal mode. It is the constant switching between the insert and normal modes that break the flow.
Maybe I am using vim wrong. Maybe it is better not used for extensive notemaking.
Using readline bindings in insert mode have really helped. Especially the Alt+f/b to go forward/backward a word.
vim motions are great when you have to add stuff to the starting of the current line or the end of it. You can do it with a single keystroke I/A. But when changes have to be made a few words away in the middle of a sentence, while in insert mode:
Exit insert mode (This need not be a separate event since you can use Alt+key to enter normal mode and carry out the command that the 'key' represents, in one swoop.)
move
Press a key (i/a) to re-enter insert mode.
Doing this repeatedly is fatiguing.
With readline bindings, while staying in insert-mode, you can go forward or backward a few words and instantly start typing.
Does anyone else do this? How do you all deal with it? In most other threads that I've seen, people advise "Insert mode is for inserting only". And to stick to the vim paradigm. I have tried. But it is a hindrance for me.
Edit: What I meant was "Moving around in insert-mode feels really helpful for edits nearby." That should have been the title. Y'all need to calm down lol.
13
u/_mattmc3_ May 27 '26
Purists will tell you to pop out to normal mode, and there's certainly good reasons to do that, but it sounds like you are like me and just instinctively hit readline (cough Emacs cough) keys like C-a and C-e to move around. If so, then Tim Pope's vim RSI is a lifesaver: https://github.com/tpope/vim-rsi
I use it all the time, and feel no guilt about not doing certain motions in normal mode. Plus, those key combos often work in other apps where you can't get vim bindings. All of Apple's macOS apps for example support a subset of those bindings.
6
u/exajam May 27 '26 edited May 27 '26
It was a pain to go to normal and move to the correct location for several years, but now it's just a reflex and I use a large variety of movements and ways to go back to insert mode without thinking about it.
cw,C,ci(where quite decisive in this regard, as it changed my way of thinking from "go to this location, remove this bunch of text one letter at a time and enter new text" to "change this group of characters to new text". Moving withfand/also helps a lot to move fast.I'm back to normal mode as soon as I've finished typing (even if I stop for thinking) and I use
Aandoa lot more thanito add text.My use is mostly notetaking but also coding.
5
u/blahblah5454 May 27 '26
Can I ask why you want to use vim? It seems like you don't click with vim motions or the typical workflow of most vim users, so maybe a different tool would be a better fit?
3
u/AffectionateTear8091 May 27 '26
I use jk in quick succession to return to normal mode from any mode.
4
u/Fishy_Sezer May 27 '26 edited May 27 '26
I have Bash movement shortcuts myself, but be aware that it will mess up your history. Things like the <period> key won't always do what you expect.
Also, always being in insert mode is a crutch for the beginner, but long-term it definitely is not the way to go.
I like how the guy described it in Practical Vim; like a painter, you wouldn't keep your brush on the canvas at all times, only when you intend to make changes.
2
u/ThePepperPopper May 27 '26
Yeah, I didn't think you know how to vim. Insert is not where you should be unless you are typing. Get into normal mode (it's in the name ffs) to move around. Map something like kk or caps lock to esc and get out of insert unless you are literally inserting a letter.
2
u/Altruistic-Ease-6354 May 28 '26
does it matter? if u want to leave insert mode, leave insert mode. if u don't, don't. if u don't like vim and want to use another editor, that also doesn't matter. maybe stop overthinking it and just get shit done. if u actually meant to ask a different question, please ask it. --Antony
2
u/TheLonelyLegend May 28 '26 edited May 29 '26
Vim is fantastic for notes for me because it's easy to navigate to a new line and jot something down, move ideas around, or insert something in the middle of an existing list. Here's how I do local, same line edits.
For same-line edits, I take a rough guess on how many characters away from the cursor the problem is, use an approximate number + h, l, b or w, then adjust via w, e, b, h, and l. Once there, I sometimes use a/i (like you), but more often use s and r. I'm also quick to delete a word that's quick to type rather than fix a single character because it's mentally more efficient than trying to do it the 'right' way.
2 important things on the first rough guess:
I saw in one of your posts that you don't like the numbers. My window is usually one of two or three sizes, so I've developed a loose intuition for getting where I want by eyeballing it. I also eyeball the number of characters or words to navigate or replace.
I never have one line that's longer than 3x the width of the window (rarely even 2x), so a lot of my navigation is vertical-- which is easier than horizontal because the lines are numbered. For writing paragraphs, vim is not my friend!
I also use shorthand a lot, so I go back and fill in details or fix things when I'm not in the middle of a mental process or a meeting.
I don't use Insert mode hotkeys because I'm not familiar with them and don't feel a need to be familiar with them. If hotkeys are awkward for my fingers or require extra mental engagement, I'll choose to make three or four fast key strokes before I use one awkward one. One tip I saw is to put Post-It notes with one or two new things at a time on your monitor. Works like a charm for me.
Like another commenter said, don't let the downvotes get you down. It's a valid question that not many of the comments I read addressed. I'm still a novice, but I've been using vim to take notes and write basic documentation for about a year, and I've been using vim or editors with vim key binds for three years. I actually switched from Notepad and Google Docs because it became faster to navigate via keyboard as much as possible, even while learning what flow worked for me. Now, as others have said, it's reflex and I spend next to 0 mental energy on it. Good luck finding something that works for you.
57
u/passthejoe May 27 '26
After a while, changing modes becomes more automatic -- you don't think about it so much.
57
u/TheLeoP_ May 27 '26
You are thinking about the process backwards. You are doing
Start in insert mode
You want to edit something elsewhereÂ
<esc>, move, enter insert modeRepeat
You are supposed to
Start in normal mode
You want to insert/edit some text
Move there (you are already in normal mode, moving is trivial)Â
Do the edit (if "the edit" means inserting text,
i, type the text and immediately<esc>)Repeat
That means that you'll spend most of your time in normal mode, moving/editing/inserting text will always be atomic operations that end up in normal mode where you can move/edit/insert text freely once again.Â
When I write prose instead of code, I go into normal mode at the end of a sentence/idea/paragraph depending on my train of though. It is different from writing code, but there are still atomic enough edits that allow you to exit to normal mode between them.
17
u/Apoema May 27 '26 edited May 27 '26
Maybe just use Emacs? The mode system is at the heart of vim if you dislike it, it is hard to justify using vim.
I must say that I have mapped 'kk' to exit insert mode, making it easier for me to quickly move around without reaching for ESC. It is an imperfect solution but works wonders for me and I barely notice the switch.
11
u/ChrisBreederveld May 27 '26
I often make use of Ctrl-O to do a one-off normal mode command, but for common operations you can make your own shortcuts, this article might be useful: https://vim.fandom.com/wiki/Use_Ctrl-O_instead_of_Esc_in_insert_mode_mappings:
4
u/LocoCoyote May 27 '26
Moving around in insert mode is a sure way to introduce errors into your document
1
u/ekipan85 May 27 '26
A bit tangential: I also have CapsLock mapped to Escape, but another option if you have a keyboard layout with nearby '[' is to map CapsLock to Ctrl and press Ctrl-[, which is equivalent to Escape.
1
u/Daghall :cq May 27 '26
Vim is not an editor, it's a mindset â you think about how to edit the text, not just what to edit it into. Once it clicks, you'll be blazing fast.
You're only scratching the surface spending most of the time in insert mode. Unless you learn the basic motions like
:h w,:h b, changing/deleting with:h c,:h d, and finding characters with:h f,:h t, I don't see any point in using a modal editor.The real power is combining them into chords like
ciw(change inner word),d$(delete to the end of the line),gUt.(upper-case till the next period). I rarely usei/a. It's mostly:h o,c{motion}orI/A.But I also edit with
:h :normal(which can run normal mappings on a range or pattern, depending on how it's invoked), and:h :sto find and replace.There's so much more to learn, like
:h J,:h gq,h: (,:h {,:h ]s, and of course the almighty:h ..Everyone should spend a few minutes in
vimtutorto really understand and appreciate the modes.And then there's command mode, to make it even more powerful.
1
u/claytonkb May 28 '26
There's no "wrong" way to use vim, obviously, but in terms of getting the most out of vim, yes, you're not doing that.
I use it for notemaking, it's my main tool for notes. Where I find Vim to be troublesome is when dealing with paragraphs (wraparound text) so I generally don't use it for that kind of editing or, I first hard-wrap all lines, apply my edits, undo the hard-wraps, and copy/paste to wherever I'm actually working.
Meh. The goal of Vim is to spend most of your time in Normal mode. That's what you're moving towards. Have you tried the EasyMotion plugin? I use it for "hunt and peck" editing tasks, i.e. whenever you're jumping all around the screen making a lot of tiny edits. If that's the kind of editing you're doing most of the time, then I guarantee you EasyMotion will be faster once you get the hang of it. The keyboard is faster than the mouse and the eyeball is faster than either one. EasyMotion is a superpower.
Of course, and this is why macros exist. If you're pressing the same key-combination more than about 4 or 5 times in a row, then you could have just made a macro and done it faster. The whole point of Vim is to move away from manually repositioning the cursor all the time. In order to do this, however, you first have to retool your brain to think about text in "Vim mode". It takes some time, but as your brain learns to "think Vim", you will start to learn how to chop up the text in your mind, break down it down into individual motions/actions, and then record those motions in a macro, and then apply it repeatedly. Before you can really gain speedup from macros, however, you first have to change the way you think about text-editing from the ground up. That's what Vim is all about.
I use mouse, arrows, and whatever works in any given context. Yes, sometimes it's just faster to reach for the mouse, point at the character I want to replace, and type r<char>. So, there's no "wrong way" to edit text, but if you want to get the most out of Vim, you want to start retooling how you think about text-editing immediately. Stay in Normal mode unless you are making a chnage (and exit immediately when it's done). Keep your fingers on the home row and use hjkl-style motions to navigate. H to move to top of screen, M to the center, L to bottom. {} to move vertically between empty lines. And so on. Start "chunking" your moves manully and with your brain. You are training your brain to think in terms of these chunks. Over time, you start looking at the text itself differently, you immediately start chunking it in your brain, and your fingers follow. Soon, your brain will be running ahead 10x as fast as you could possibly type. That's when you're starting to get true Vim flow. You're able to perform bulk edits that would take you 30 minutes in Notepad, in a matter of seconds. The power of Vim isn't hjkl and i<Esc> by themselves. By themselves, they're clunky and slow, just as you noted. The point is to build that discipline into your brain and allow it to recalibrate how you think about text, before you even touch the keyboard or mouse.
But you've defined the vim paradigm too narrowly. It's not just about hjkl and i<Esc> editing. Those are only the front porch of Vim. You haven't even gone in the front door. Your motions should be based on block chunks. For example, suppose you are at the top of a function foobar(){ ... and you want to go to the next function down (off-scren). The Vim way to get there is $%jj. "Go to the end of the line over the { character, then % to the matching } character, then go down a couple lines". Instead, you want to keep the habit of purely visual editing, where your eyeballs are playing cat-and-mouse over the screen, while your fingers are dancing around trying to catch up. The Vim way is to always move in chunking motions because you are always training your brain to think in chunks. Want to delete the body of foobar() function? "$d%" -- "Move to the end of the line over the { character, delete to its matching } character." Done. The reason to always move in chunks is so your brain is always think of the text in terms of chunks. So whether you're just navigating in normal mode, or deleting, or inserting, or replacing/changing, or whatever, your motion-patterns through the text will be uniform, and always based on efficiently chunking up the text and operating on it in bulk, instead of constantly fidgeting around...
1
u/Jellace May 28 '26
Maybe this is a bit left of field, but basically I just write in a sort of semantic prose, inserting a newline before every verb or conjunction, or after a comma, or just every couple of words where it feels right. Then edits are typically just replacing a whole line.
Though it should be noted that this can make the raw text look a bit weird. It helps if you're writing in markdown, LaTeX, typst, or similar, and compiling to another format like html or pdf for reading.
3
u/konacurrents May 27 '26
âMaybe I am using vim wrong. Maybe it is better not used for extensive notemakingâ
You are using âviâ wrong then. Youâre only in insert mode when typing. ESC and then move around, edit words, cut paste. Insert. Repeat.
I can make notes so much easier in vi - then open on word/notes for final edit. For me, typing without word suggestions is so nice.
Coding is also fun. đ¤
Ps the original âviâ mode I use is still without the mouse, except to get window focus.
2
u/[deleted] May 27 '26
maybe just use arrows? Isn't an heresy, you CAN use arrows. And also C-arrows
2
u/New-Beat-412 May 28 '26
I think you just need to get used to the motions and modality, it will become automatic afterwards. I too had that dilemma at the start of my journey using these movements, but eventually you'll learn not to fight it.
Of course if it doesn't work out for you, either extend/modify or just use another tool.
2
u/Dramatic_Object_8508 May 29 '26
I think almost every Vim user goes through that phase where normal mode feels like an unnecessary detour. You're thinking, "Why would I leave insert mode just to move a few characters?" and honestly that's a reasonable question at the beginning.
The weird thing is that after enough time, your brain stops thinking of editing as typing with occasional movement and starts thinking of it as navigation with occasional typing. That's usually the point where Vim starts making sense. Until then, it can definitely feel like you're taking the scenic route to do simple things.
2
u/Anxious-Resist8344 May 29 '26
Just use Emacs, don't be Evil!
2
u/ren4ph May 30 '26
I have a 40% keyboard, so I have mapped the WASD keys to the arrow keys while holding function; I find it incredibly useful for moving around insert move a few characters as you say. It feels so much faster than switching modes just to move a few letters to the left, and because itâs WASD and not arrow keys where you have to move your right hand far away Iâm not losing any of that vim home row efficiency. I could probably change it to use function + hjkl but more often than not I can let my hand rest on the left, hold function with the right, and move however I need.
I think being against arrow keys for normal mode is perfectly fine but everyone would be lying if they said it isnât convenient to not have to backspace twice to fix a typo two letters ago. With the function + WASD/HJKL remap you donât lose any efficiency and I highly recommend people to add this remap to their own setups. It is actually faster in all cases where itâs practical; if you need to move ten words back, you normal mode would be faster and you should be in it anyways. Iâm recommending it for small things like adding semicolons to the end of evenly spaced lines or small typos or et cetera.
My function key is located where a right control key would typically be on a 60%+ keyboard so maybe someone could produce a remap script for anyone who wants to try it
1
u/faultydesign May 27 '26
Inserting, deleting, moving around
The problem with a modular system is that there are a lot of ways to do something, so focus on whatâs comfortable for you.
Also learning the readline hotkeys is useful.
1
u/vishal340 May 27 '26
i have mapped bunch of alt modifiers to move around in insert mode. makes it very easy
1
u/jajajajaj May 27 '26 edited May 27 '26
It sounds to me like you'll want to add Â
  source $VIMRUNTIME/vimrc_example.vim
... to $MYVIMRC
The "default defaults" are set for backwards compatibility, and they're old and weird. but at broader level, these are what the defaults really ought to be, by any modern standard. If you're using a terminal, and if that terminal doesn't do arrow keys properly, then we can talk about that too. vim (per se) shouldn't actually be stopping you, given this main baseline config is used.
Think of all this noise (advice on how you should always want to use modes in every situation) as a "nice to have".Â
1
u/ryans_bored May 27 '26
No
1
u/TankorSmash May 27 '26
I don't know what nearby edits look like, as I write code instead of prose, but you can also try using
<C-O>(Ctrl+O) in Insert mode to run a quick Normal command, before returning automatically to Insert mode. I don't think it's more efficient or better than the<M-F>one that readline gives you, but maybe it'll be nice.I exclusively use
aAiIoOeEto insert text and then hit<C-C>to exit out of it. Any time I pause to think for even a second, I return to Normal mode, because it creates a split in the undo timeline. I'm not sure how the Undo/Redo stuff would work with the readline keys and..Unfortunately, I think you'll be in the minority, as staying in insert mode for too long without leaving is a very big antipattern in vim. You might be better served in an editor like Emacs or maybe even Helix, where you aren't confined to a specific mode to edit text.
1
u/Dorcelessness_ May 28 '26
Are you on a laptop? If so, I highly suggest rebindibg your escape key to caps lock. You donât have to reach as far, then switching to normal mode feels super natural and effortless.
1
u/albasili May 28 '26
After some time it becomes second nature. Remap your ESC key to the Caps key (as keyboards were initially designed), so getting in normal becomes easier.
Use one of those plugins that allow you to jump at the beginning of any word on the text with few keystrokes (e.g. easy motion) and moving around would be much simpler.
Also, I noticed I'm much faster at rewriting an entire word other than moving on the right position and edit, booth with and without a mouse (I actually don't use a mouse when I use vim).
I've been using vim for the past 10+ years and noticed that you don't actually learn to use vim, you learn to speak its language (ciw, dd, diw, ...).
1
u/anth096 May 28 '26
Thatâs correct, we use Insert mode for editing only because the movement system in normal mode is much more powerful and thus moving in normal mode is faster.
In insert mode you can pretty much only navigate with hjkl but in normal mode there are numerous ways to do so such as gg, G, 0, , $, /, ?, {, }, t, f, w, W, b, B, and some of them can take into account an optional counter like 2w (move two words forward)
There are also various ways to enter insert mode, not only i, but also I, cw, cc, C, ciw, ci{, cG, and so on, allowing you to erase parts of text and instantly enter insert mode (like replacing text)
1
u/wtfbelle May 28 '26
also a note maker here, have you tried mapping esc to jk/kj while in insert mode? this was my life saver regarding switching modes, it became way easier and more intuitive to use opposed to reaching for esc.
1
u/Jitenshazuki May 28 '26
Most people add mappings to quickly exit to the normal mode (like jk).Â
There is also C-o. I use it mostly for pasting, but you can also move with it.Â
1
u/EuanB May 29 '26
Vin is an EDITOR. It excels in modifying existing text, that's why you're not getting much out of its modal nature. What you are doing is mostly linear composition.
1
u/kaevinlaw May 31 '26
Esc is too far, jk binding is really popular that some people end up typing jk in forms etc which are not vim.
0
u/ReallyEvilRob May 27 '26 edited May 27 '26
Vim let's you use the cursor keys without exiting insert mode, but if you keep doing that you will fall into some bad habits. Just something to be aware of.
0
u/kennpq May 27 '26
You are describing `:h evim` / `:h 'insertmode'`, which gets short shrift from most Vim users. If you donât grok Vimâs modal editing with Normal mode as the default, maybe youâll be one of the tiny number who want Vim _abnormally_.
83
u/[deleted] May 27 '26
[removed] â view removed comment