Path: csiph.com!xmission!news.alt.net!not-for-mail From: owl Newsgroups: comp.os.linux.misc,alt.os.linux Subject: Re: Linux Command-Line Editors Vulnerable to High-Severity Bug Date: Thu, 20 Jun 2019 04:16:22 +0000 (UTC) Organization: O.W.L. Lines: 84 Message-ID: References: <4edqtf-7ho.ln1@Telcontar.valinor> NNTP-Posting-Host: boom.rooftop.invalid Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Face: $BHf)vM$6p_?9L`jmOQ54JeNyL+%MZGGRfH8&grb[Y%-jU`MCPAQN=/SVDa{(/67bP(YB}rjV^h>cUh Xref: csiph.com comp.os.linux.misc:27309 alt.os.linux:57022 In comp.os.linux.misc Georges wrote: > Le 20/06/2019 à 01:09, owl a écrit : >> In comp.os.linux.misc Carlos E.R. wrote: >>> On 19/06/2019 21.23, The Natural Philosopher wrote: >>>> On 19/06/2019 20:01, Carlos E.R. wrote: >>>>> On 19/06/2019 20.47, Georges wrote: >>>>>> Le 19/06/2019 à 20:32, Tauno Voipio a écrit : >>>>>>> On 19.6.19 11:55, Georges wrote: >>>>>>>> Le 19/06/2019 à 10:20, Carlos E.R. a écrit : >>>>> >>>>> ... >>>>> >>>>>>>> if you teach students, you struggle between time and contents (what >>>>>>>> you >>>>>>>> can teach on a 20h course for instance), so 'vi' is a good choice >>>>>>>> because it's widely used... and simple... once you get the >>>>>>>> philosophy ;) >>>>>>>> >>>>>>> >>>>>>> If you really want to go backward in time, you should use ed, and no >>>>>>> newer derivatives like ex and vi with family. >>>>>>> >>>>>>> My favourite in primitive editors is nano. >>>>>>> >>>>>> >>>>>> Try this with nano... ;) >>>>>> >>>>>> Let's consider a file with 2 columns (or more of course), separated with >>>>>> or or whatever you want, you need to invert columns : >>>>>> >>>>>> aaaaa bbbbb >>>>>> aaaaa bbbbb >>>>>> >>>>>> :1,$s/^\(.*\) \(.*\)$/\2 \1/ >>>>>> >>>>>> bbbbb aaaaa >>>>>> bbbbb aaaaa >>>>>> >>>>>> ;) >>>>>> >>>>> >>>>> Jstar (joe) can do that.  Switch to vertical block mode, select the >>>>> rectangle on the left, move to the right. >>>>> >>>> in a Wysiwyg I just highlight the text and move it >>> >>> I don't know any such editor that can do that in Linux. Of course, I >>> have not tried all in existence. >>> >> >> Vim. >> >>> I can not just highlight all the 'b's. As I try, the 'a's in the >>> previous line gets highlighted. No vertical block mode. >>> >> >> Vim has Ctrl-v for visual block select. Select a column, then hit 'd' >> to cut. Move the cursor to wherever and hit 'p' to paste. >> > > Very nice !!! > > Here is : > > - select the first char of a column > - hit C-v > - select the last of the same column => highlight > - etc. > > ;) > :set nosol That will maintain column position for gg (first line) ang G (last line) navigation. Then you can be in a column and just ggG5l an get a five-char wide selection from top to bottom. Or you can have the selection extend to the next space with "f " instead of "5l" or to a tab or whatever. You can record these as a macro into a register, say register b, and then run it on a column with @b for quick and easy column selection. Successfully automating it would depend on column contents of course, but that will give you an idea of the kinds of things that can be done.