Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: owl Newsgroups: alt.os.linux Subject: Re: vim all the way Date: Fri, 8 Nov 2019 16:54:51 -0000 (UTC) Organization: O.W.L. Lines: 118 Message-ID: References: <4VmuF.55422$NI41.43708@fx12.am4> <195v8g-opo.ln1@Telcontar.valinor> Injection-Date: Fri, 8 Nov 2019 16:54:51 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="1de8676832536aaf892d7e477819e96a"; logging-data="5083"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18BZxSCAZ7E7BXN9kFLxJeHQSNWEBC01Tk=" User-Agent: tin/2.4.3-20181224 ("Glen Mhor") (UNIX) (Linux/4.19.0-5-amd64 (x86_64)) Cancel-Lock: sha1:6++ayKNbFTnf6jYlsQjDMYWootI= X-Face: $BHf)vM$6p_?9L`jmOQ54JeNyL+%MZGGRfH8&grb[Y%-jU`MCPAQN=/SVDa{(/67bP(YB}rjV^h>cUh Xref: csiph.com alt.os.linux:60418 RonB wrote: > On 2019-11-08, owl wrote: >> RonB wrote: >>> On 2019-11-06, owl wrote: >>>>>>>>>>>> >> >>>> Well, 7w or 8w will jump to approximately the center of the current line, then >>>> you can narrow it with w or b. 2b, 3w, or just bb or www. >>>> 10j - down ten lines. >>>> 10k - up ten lines. >>>> etc. >>> >>> I guess I mostly use Jstar for writing and these commands seem more oriented >>> towards programming. To go to the center of the line (not sure why I would >>> want to) I would just press ^f four or five times. >>> >>> To center a line, I just press ^ka >>> >>> To indent a block I can mark the block and use ^k. If I want to >>> indent it more ^k. again. Less indentation, ^k, ??? etc. >>> >>> I don't use these features often because I usually don't format in Jstar, >>> it's just that this is a very powerful editor with the added benefit (to me) >>> of using keystrokes that I've known for about 35 years. There's no reason >>> for me to use vim. >>> >> >> In vim, you can either select visually, then hit '>' to indent, or you >> can just hit '>>' in normal mode. '5>>' in normal mode would indent five >> lines. If you need more indent, just use the dot command ('.') to repeat. >> '<<' similarly gets rid of an indent, with dot command working to repeat >> that change too. But if you just did some indents, and maybe did too >> many, you can just hit 'u' however many times to back out of them. > > Okay. So Jstar and Vim are similar for indentation. Does Vim have an easy > line centering option? Yes: :center or just :ce That can be done easily over a range, say from current line including next three lines: :.,+3ce Explanation: .,+3 - range from current line (.) to next three lines (+3) ce - center that stuff Or it can be applied to a visually selected block: V3j:ce Explanation: V - start linewise visual selection 3j - extend selection down three lines (or just jjj) :ce - center that selected block > >>>> a block of text, etc. All of that can be done in normal mode with just >>>> a couple of keystrokes. So, for example, you might jump to a word with >>>> 5w, then delete it with dw, all while staying in normal mode. >>> >>> Okay, but if you are editing (and editing often requires changing words), >>> then you will have to change modes back and forth. Correct? Admittedly, I >>> don't know much about vim, but I thought it was a "modal" editor. >>> >> >> Sure, you change to insert mode to insert stuff. Then just hit >> to go back to normal mode when you are done inserting. You can have >> an insert-mode mapping of the char sequence 'jk' to the key, so >> that you don't have to reach for , 'jk' being a rarely used char >> sequence in english so you are not likely to stumble with it. > > One of the main selling points of WordStar (and JOE or its Jstar variant) is > that your hands stay at the "home" key position. Using the key to > change modes is a reach. Using the keys is not. > Odd that you say this in response to text stating that you can map a home-row key sequence to the escape key. >> But the real benefit of it being modal is that it keeps you from having to >> uses or modifiers to do everything, allowing for single-key >> commands. Once you have a draft of a document, and you are in the >> process of editing it, a great deal of your work will involve navigating >> the document, not necessarily inserting text, so it is of great benefit >> not to have to constantly use modifier keys for navigation commands. > > You keep separating "editing" and "inserting" as if they're two different > things. They are. Inserting is a subset of editing tasks. > Almost always, when I'm editing, I'm also changing text. That's what > editing is. It's not just a separation of navigation from inserting. Even making changes does not always mean inserting new text by typing it in character by character. Sometimes you are just deleting a word or character, changing case, or moving a block of text. All of those actions can be done in normal mode. > I don't "get" your distinction. I guess I don't think the "Vim" > way. > > But choice is good. > Yes it is.