Trying to learn to Work with Text without using J,K,H,L and arrow keys

classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

Trying to learn to Work with Text without using J,K,H,L and arrow keys

Amit Christian
I came across this webpage (http://vimcasts.org/blog/2013/02/habit-breaking-habit-making/), which recommends to stop using j,k,h,l and arrow keys and promote use of other more efficient keys to browse through the code. I am intermediate level of Vim user.

I have disabled (temporarily) the use of j, k, h, l (using HardMode vim plugin). It has been a little challenge to work with the code since then. But I know it will help me to be more efficient with Vim.

- I have so far used, w, b, e, ge etc to move around the lines.
- Also have been using f + character to move through the line.
- And have been using little bit of marks and / search to find through the code.


Here is my question:

I find it still difficult to go to next lines or browsing up or down through the text. Can any one please help me with efficient use of working with text without a usual j,k,h,l use? Are there resources or help on internet? What are your strategies to work with text?

Thank you for your time and reading this.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: without using J,K,H,L and arrow keys -> motion.txt

Sven Guckes-3
* Amit Christian <[hidden email]> [2016-09-13 17:31]:
> I find it still difficult to go to next lines or browsing
> up or down through the text.  Can any one please help me
> with efficient use of working with text without a usual
> j,k,h,l use?  Are there resources or help on internet?
> What are your strategies to work with text?

i dont really see a reason not to use hjkl for moving the cursor. ;)
but of course there are many more command for motions/movements.
have you read the text on motions yet?  see ":help motion.txt".
sure.. it is 1300+ lines.. but that's how much there is! :-)

Sven

--
Vim for Programmers - by Julius Plenz (and Sven Guckes) 2008-09-03
http://www.guckes.net/talks/vim_for_programmers.en.txt  2010-07-16
An overview to the most important commands for programming within C -
and some important options - all in 4000bytes, 68 rows, and 80 columns.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Trying to learn to Work with Text without using J,K,H,L and arrow keys

Tim Chase
In reply to this post by Amit Christian
On 2016-09-13 08:23, Amit Christian wrote:
> I find it still difficult to go to next lines or browsing up or
> down through the text. Can any one please help me with efficient
> use of working with text without a usual j,k,h,l use? Are there
> resources or help on internet? What are your strategies to work
> with text?

Depends on what you're trying to do.

For basic reading, I usually read about half a screen-full at a time,
so I tend to use ctrl+U and ctrl+D to scroll by half a screen. You
might also find setting 'scrolloff' to a big number helps.  In such a
case, I don't have any issues with using j/k because I *am* reading
one line at a time.

For code, I tend to use things like ]] to navigate by code units.
Jump to the beginning/end of the next block/function/section.  Vim
has a rich set of features (and plugins for additional features) that
allow you to jump around code with more refined motions.

Also, it would depend on whether you're trying to *read* the content,
or *edit* the content.  Rather than moving to the start, going
visual, and moving to the end, the use of "text objects" are one of
Vim's killer features.  You can address conceptual objects from
anywhere within them.

  :help text-objects

-tim



--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Trying to learn to Work with Text without using J,K,H,L and arrow keys

Shawn H Corey
In reply to this post by Amit Christian
On Tue, 13 Sep 2016 08:23:57 -0700 (PDT)
Amit Christian <[hidden email]> wrote:

> I find it still difficult to go to next lines or browsing up or down
> through the text. Can any one please help me with efficient use of
> working with text without a usual j,k,h,l use? Are there resources or
> help on internet? What are your strategies to work with text?

I use search. It's the fastest to get anywhere. :)

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Trying to learn to Work with Text without using J,K,H,L and arrow keys

Amit Christian
In reply to this post by Tim Chase
On Tuesday, September 13, 2016 at 10:49:23 AM UTC-5, Tim Chase wrote:

> On 2016-09-13 08:23, Amit Christian wrote:
> > I find it still difficult to go to next lines or browsing up or
> > down through the text. Can any one please help me with efficient
> > use of working with text without a usual j,k,h,l use? Are there
> > resources or help on internet? What are your strategies to work
> > with text?
>
> Depends on what you're trying to do.
>
> For basic reading, I usually read about half a screen-full at a time,
> so I tend to use ctrl+U and ctrl+D to scroll by half a screen. You
> might also find setting 'scrolloff' to a big number helps.  In such a
> case, I don't have any issues with using j/k because I *am* reading
> one line at a time.
>
> For code, I tend to use things like ]] to navigate by code units.
> Jump to the beginning/end of the next block/function/section.  Vim
> has a rich set of features (and plugins for additional features) that
> allow you to jump around code with more refined motions.
>
> Also, it would depend on whether you're trying to *read* the content,
> or *edit* the content.  Rather than moving to the start, going
> visual, and moving to the end, the use of "text objects" are one of
> Vim's killer features.  You can address conceptual objects from
> anywhere within them.
>
>   :help text-objects
>
> -tim
Thanks Tim. I set the scrolloff to high number. its pretty handy. Will explore text-objects.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Trying to learn to Work with Text without using J,K,H,L and arrow keys

Nicola
In reply to this post by Amit Christian
On 2016-09-13 15:23:57 +0000, Amit Christian said:

> I came across this webpage
> (http://vimcasts.org/blog/2013/02/habit-breaking-habit-making/), which
> recommends to stop using j,k,h,l and arrow keys and promote use of
> other more efficient keys to browse through the code. I am intermediate
> level of Vim user.
>
> I have disabled (temporarily) the use of j, k, h, l (using HardMode vim
> plugin). It has been a little challenge to work with the code since
> then. But I know it will help me to be more efficient with Vim.
>
> - I have so far used, w, b, e, ge etc to move around the lines.
> - Also have been using f + character to move through the line.
> - And have been using little bit of marks and / search to find through
> the code.
>
>
> Here is my question:
>
> I find it still difficult to go to next lines or browsing up or down
> through the text. Can any one please help me with efficient use of
> working with text without a usual j,k,h,l use? Are there resources or
> help on internet? What are your strategies to work with text?

I find tags one of the fastest way to browse through code. Plugins like
CtrlP come with support for tags with minimal configuration (install
ctags and put `let g:ctrlp_extensions = ['buffertag']` in your vimrc
should be enough for a single file), but using ctags with built-in Vim
mappings is not difficult either, and pretty efficient.

When I started learning Vim, I used to write down the mappings I was
learning into a text file that I always kept open in Vim. You may use
something like Cheat40 for such purpose (Cheat40 comes with a default
list of mappings, you may especially be interested in the “Go” section).

Regarding jklm, do you use them with counts? Do you have relative line
numbers on (:h 'rnu')? Often, the simplest way to jump to the desired
line is just to type something like  8j or 14k.

Last suggestion: if you don't mind installing plugins, there are
several extensions to built-in movements. The most popular is probably
EasyMotion, but my personal favourite is Sneak.

Nicola


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: without using J,K,H,L and arrow keys -> motion.txt

Tony Mechelynck
In reply to this post by Sven Guckes-3
On Tue, Sep 13, 2016 at 5:43 PM, Sven Guckes <[hidden email]> wrote:

> * Amit Christian <[hidden email]> [2016-09-13 17:31]:
>> I find it still difficult to go to next lines or browsing
>> up or down through the text.  Can any one please help me
>> with efficient use of working with text without a usual
>> j,k,h,l use?  Are there resources or help on internet?
>> What are your strategies to work with text?
>
> i dont really see a reason not to use hjkl for moving the cursor. ;)
> but of course there are many more command for motions/movements.
> have you read the text on motions yet?  see ":help motion.txt".
> sure.. it is 1300+ lines.. but that's how much there is! :-)
>
> Sven
>
> --
> Vim for Programmers - by Julius Plenz (and Sven Guckes) 2008-09-03
> http://www.guckes.net/talks/vim_for_programmers.en.txt  2010-07-16
> An overview to the most important commands for programming within C -
> and some important options - all in 4000bytes, 68 rows, and 80 columns.

Personally I see no reason to restrict oneself to only part of the
capabilities of Vim. For moving the cursor, and depending on
circumstances, I use h, j, k, l, gj, gk, →, ↓, ↑, ←, <Home>, <End>,
Ctrl+←, Ctrl+→, f<character>, t<character>, <LeftMouse>, gg, G, :1234,
/pattern, ?pattern, :0/pattern, n, N, and possibly others still.

Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: VIM MOTION Commands - 67 lines

Sven Guckes-3
In reply to this post by Sven Guckes-3
so yet again i have compiled some motion commands for
a beginner's course in "moving about in some text".
enjoy! :)

Sven

--
Vimfest 2016 on Sep16-18 in Berlin at IN-Berlin
2016-09-16/18 Fr-Sa VimFest http://vimfest.de/
2016-09-17 14-16h Bram Moolenaar: "Vim-8"
location/venue:  Individual Network Berlin e.V.

---------------------------------------------------------------------
VIM MOTION Commands - 67 lines - compiled by Sven Guckes [2016-09-14]
moving up+down:
h  ←  →  l  jump onto left/right character
j  ↓  ↑  k  jump onto next/prev line, keeping column (if possible)
gj gk       jump onto next/prev *screen* line
jump to start/end of line:
0  $        jump to first column, last column of current line
^           jump to first non-whitespace char of current line
jump to begin/end of words/WORDs:
b w         jump to prev/next begin-of-word
B W         jump to prev/next begin-of-WORD
e ge        jump to next/prev   end-of-word
E gE        jump to next/prev   end-of-WORD
scrolling:
^B ^F       page backward/forward by full page
^D ^U       page     down/up      by 1/2  page
^E ^Y       scroll     up/down    by one line
repositioning the cursor/line on screen:
 H  M  L      position cursor at home, middle, last line of window
zt zz zb    reposition current line at top, middle, bottom line of window
jumping *to* a line by number:
gg G        jump to first/last line
:23         jump to line number 23
42G         jump to line number 42
searching within the current line:
fX FX       jump onto   next/prev char 'X' within current line
tX TX       jump before next/prev char 'X' within current line
f. f:       jump onto next dot/colon.
t( t]       jump before next closing parenthesis/bracket.
;           repeat latest f,F,t,T command in             latest used direction
,           repeat latest f,F,t,T command in opposite of latest used direction
searching with patterns and repetitions:
/pattern    search  forward for next match of "pattern"
?pattern    search backward for next match of "pattern"
:0/pattern
 *  #       search for the next/prev match of the current word
g* g#       search for the next/prev match of the current word with word boundary
n N         search again forward/backward for next match of last used pattern
window commands:
CTRL-W n    window new   -> open  a new   window
CTRL-W c    window close -> close current window
CTRL-W s    window split -> split current window
CTRL-W v    window split vertical -> vertically split current window
switching buffers/files:
:bn :bp     switch to next/prev buffer (by number)
:b #        switch to alternate/previous buffer
:b foo      switch to buffer name containing "foo" in dir or file
gf          switch to current filename ("under cursor")
jumping by text objects:
{ }         jump onto empty line before/after  current paragraph
( )         jump   to             begin/end of current sentence
copy+paste:
dip         delete inner paragraph
yip         copY   inner paragraph
using a number prefix for "repetitions":
6b          jump back by six words
3j          jump down by 3 lines
9k          jump   up by 9 lines
23}         jump over 23 paragraphs
42)         jump over 42 sentences
42G         jump onto line number 42
3H          jump onto 3rd line from Highest line
5L          jump onto 5th line from Lowest  line
using marks:
ma mb .. mz mark current line by letter 'a/b/../z'
'a 'b .. 'z jump onto first non-whitespace of marked line 'a/b/../z'
`a `b .. `z jump onto the exact character  of marked line 'a/b/../z'

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Trying to learn to Work with Text without using J,K,H,L and arrow keys

Erik Christiansen
In reply to this post by Amit Christian
On 13.09.16 08:23, Amit Christian wrote:
> Here is my question:
>
> I find it still difficult to go to next lines or browsing up or down
> through the text. Can any one please help me with efficient use of
> working with text without a usual j,k,h,l use? Are there resources or
> help on internet? What are your strategies to work with text?

One thing I didn't see explicitly described so far is:

:set rnumber

Now the current line is 0, and all other lines bear their offset
therefrom. If I wished e.g. to go up to trim the sentence after "j,k,h,l
use?" in the above quoted text, I could use 9k) from here - without the
delay and effort of counting lines first.

Mind you, my natural behaviour would be to use (from here) 4{( ,
i.e. back 4 paragraphs plus one sentence, find that was one sentence
short, and whack ( again. If it's late at night, then just whacking {
then ( , until the cursor arrives, is about as much as available
brainpower supports.

Either way, we're spot on for a d) to delete the sentence, without any
hjkl hocus-pocus. (I use the cursor keys within a word, and for up/down
a few lines.)

With rnumber set in .vimrc, it is handy to put "set norumber" in a
modeline at the end of files in which it would be annoying.

Erik

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Trying to learn to Work with Text without using J,K,H,L and arrow keys

Amit Christian
In reply to this post by Nicola
On Tuesday, September 13, 2016 at 3:10:36 PM UTC-5, Nicola wrote:

> On 2016-09-13 15:23:57 +0000, Amit Christian said:
>
> > I came across this webpage
> > (http://vimcasts.org/blog/2013/02/habit-breaking-habit-making/), which
> > recommends to stop using j,k,h,l and arrow keys and promote use of
> > other more efficient keys to browse through the code. I am intermediate
> > level of Vim user.
> >
> > I have disabled (temporarily) the use of j, k, h, l (using HardMode vim
> > plugin). It has been a little challenge to work with the code since
> > then. But I know it will help me to be more efficient with Vim.
> >
> > - I have so far used, w, b, e, ge etc to move around the lines.
> > - Also have been using f + character to move through the line.
> > - And have been using little bit of marks and / search to find through
> > the code.
> >
> >
> > Here is my question:
> >
> > I find it still difficult to go to next lines or browsing up or down
> > through the text. Can any one please help me with efficient use of
> > working with text without a usual j,k,h,l use? Are there resources or
> > help on internet? What are your strategies to work with text?
>
> I find tags one of the fastest way to browse through code. Plugins like
> CtrlP come with support for tags with minimal configuration (install
> ctags and put `let g:ctrlp_extensions = ['buffertag']` in your vimrc
> should be enough for a single file), but using ctags with built-in Vim
> mappings is not difficult either, and pretty efficient.
>
> When I started learning Vim, I used to write down the mappings I was
> learning into a text file that I always kept open in Vim. You may use
> something like Cheat40 for such purpose (Cheat40 comes with a default
> list of mappings, you may especially be interested in the “Go” section).
>
> Regarding jklm, do you use them with counts? Do you have relative line
> numbers on (:h 'rnu')? Often, the simplest way to jump to the desired
> line is just to type something like  8j or 14k.
>
> Last suggestion: if you don't mind installing plugins, there are
> several extensions to built-in movements. The most popular is probably
> EasyMotion, but my personal favourite is Sneak.
>
> Nicola
Thanks. Nicola. I had heard about EasyMotion, but never tried it. I just started using it, it does cover most of my needs (without using j,k,h,l!!!). Thanks.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: without using J,K,H,L and arrow keys -> motion.txt

Amit Christian
In reply to this post by Tony Mechelynck
On Tuesday, September 13, 2016 at 4:08:41 PM UTC-5, Tony Mechelynck wrote:

> On Tue, Sep 13, 2016 at 5:43 PM, Sven Guckes <[hidden email]> wrote:
> > * Amit Christian <[hidden email]> [2016-09-13 17:31]:
> >> I find it still difficult to go to next lines or browsing
> >> up or down through the text.  Can any one please help me
> >> with efficient use of working with text without a usual
> >> j,k,h,l use?  Are there resources or help on internet?
> >> What are your strategies to work with text?
> >
> > i dont really see a reason not to use hjkl for moving the cursor. ;)
> > but of course there are many more command for motions/movements.
> > have you read the text on motions yet?  see ":help motion.txt".
> > sure.. it is 1300+ lines.. but that's how much there is! :-)
> >
> > Sven
> >
> > --
> > Vim for Programmers - by Julius Plenz (and Sven Guckes) 2008-09-03
> > http://www.guckes.net/talks/vim_for_programmers.en.txt  2010-07-16
> > An overview to the most important commands for programming within C -
> > and some important options - all in 4000bytes, 68 rows, and 80 columns.
>
> Personally I see no reason to restrict oneself to only part of the
> capabilities of Vim. For moving the cursor, and depending on
> circumstances, I use h, j, k, l, gj, gk, →, ↓, ↑, ←, <Home>, <End>,
> Ctrl+←, Ctrl+→, f<character>, t<character>, <LeftMouse>, gg, G, :1234,
> /pattern, ?pattern, :0/pattern, n, N, and possibly others still.
>
> Best regards,
> Tony.
Thanks Tony for your comment.

I definitely am not planning to disable those keys forever. But just to learn, develop habit (and possibly muscle memory!) to use other quicker motion keys.

Honestly, from my experience in last few days, I already have become more efficient than my habit of hitting j,k's multiple times to browse/edit code. It has been little frustrating at times, when I felt I can code it much faster with those keys enabled. But I have started to see the benefits.

Thanks.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: without using J,K,H,L and arrow keys -> motion.txt

Tony Mechelynck
On Wed, Sep 14, 2016 at 10:29 PM, Amit Christian
<[hidden email]> wrote:

> On Tuesday, September 13, 2016 at 4:08:41 PM UTC-5, Tony Mechelynck wrote:
>> On Tue, Sep 13, 2016 at 5:43 PM, Sven Guckes <[hidden email]> wrote:
>> > * Amit Christian <[hidden email]> [2016-09-13 17:31]:
>> >> I find it still difficult to go to next lines or browsing
>> >> up or down through the text.  Can any one please help me
>> >> with efficient use of working with text without a usual
>> >> j,k,h,l use?  Are there resources or help on internet?
>> >> What are your strategies to work with text?
>> >
>> > i dont really see a reason not to use hjkl for moving the cursor. ;)
>> > but of course there are many more command for motions/movements.
>> > have you read the text on motions yet?  see ":help motion.txt".
>> > sure.. it is 1300+ lines.. but that's how much there is! :-)
>> >
>> > Sven
>> >
>> > --
>> > Vim for Programmers - by Julius Plenz (and Sven Guckes) 2008-09-03
>> > http://www.guckes.net/talks/vim_for_programmers.en.txt  2010-07-16
>> > An overview to the most important commands for programming within C -
>> > and some important options - all in 4000bytes, 68 rows, and 80 columns.
>>
>> Personally I see no reason to restrict oneself to only part of the
>> capabilities of Vim. For moving the cursor, and depending on
>> circumstances, I use h, j, k, l, gj, gk, →, ↓, ↑, ←, <Home>, <End>,
>> Ctrl+←, Ctrl+→, f<character>, t<character>, <LeftMouse>, gg, G, :1234,
>> /pattern, ?pattern, :0/pattern, n, N, and possibly others still.
>>
>> Best regards,
>> Tony.
>
> Thanks Tony for your comment.
>
> I definitely am not planning to disable those keys forever. But just to learn, develop habit (and possibly muscle memory!) to use other quicker motion keys.
>
> Honestly, from my experience in last few days, I already have become more efficient than my habit of hitting j,k's multiple times to browse/edit code. It has been little frustrating at times, when I felt I can code it much faster with those keys enabled. But I have started to see the benefits.
>
> Thanks.

Rather than hit the same key multiple times, use a count. For
instance, 5j brings you five lines down. Similarly, 3e advances to the
3rd end-of-word from the present position. This, of course, applies to
Normal mode. See ":help i_CTRL-O" about doing one Normal-mode command
from Insert mode (and : is also a Normal-mode command so Ctrl-O also
allows one Ex command).

Then there are searches: / and ? (and n and N) search within the whole
file, or there are f and F (and t and T and , and ;) which search for
one character in the current line and are quite useful in
operator-pending mode: e.g. "cdt. (double-quote little-C-for-Charlie
little-D-for-Delta little-t-for-Tango Dot-for-Decimal) deletes into
register c from the current position forward until, but not including,
the next full stop.

Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: without using J,K,H,L and arrow keys -> motion.txt

Shawn H Corey
In reply to this post by Amit Christian
On Wed, 14 Sep 2016 13:29:29 -0700 (PDT)
Amit Christian <[hidden email]> wrote:

> I definitely am not planning to disable those keys forever. But just
> to learn, develop habit (and possibly muscle memory!) to use other
> quicker motion keys.
>
> Honestly, from my experience in last few days, I already have become
> more efficient than my habit of hitting j,k's multiple times to
> browse/edit code. It has been little frustrating at times, when I
> felt I can code it much faster with those keys enabled. But I have
> started to see the benefits.

Keys I use from quicker navigation: w W b B ^ 0 f F ; ,
and finally: /

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Trying to learn to Work with Text without using J,K,H,L and arrow keys

Boyko Bantchev
In reply to this post by Amit Christian
> I find it still difficult to go to next lines or browsing up or down through the text.
> Can any one please help me with efficient use of working with text without a usual j,k,h,l use?

You may want to move the cursor within the text, or scroll the text
itself, or both.  There are means for doing each of these.

To move the cursor fast within the window in vertical direction
(without scrolling), there is e.g. L/H/M.  And for smooth scrolling
there is Ctrl-E/Ctrl-Y.  By means of mapping, one may combine
Ctrl-E with j, as well as Ctrl-Y with k, so that smooth scrolling
would not affect the relative position of the cursor within the
window, where possible.

I see no reason to disable hjkl.  If you want to learn and use new
means of navigating, then do so -- how does hjkl interfere?  Besides,
as others have pointed out, hjkl can be prefixed by counts, which is
very useful.  If you disable or ignore hjkl, how would you move the
cursor ten lines up or down fast?  Or how would you yank fast e.g.
five characters to the right of where the cursor is (i.e., do y5l)?

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Trying to learn to Work with Text without using J,K,H,L and arrow keys

Amit Christian
On Thursday, September 15, 2016 at 2:26:18 AM UTC-5, Boyko Bantchev wrote:

> > I find it still difficult to go to next lines or browsing up or down through the text.
> > Can any one please help me with efficient use of working with text without a usual j,k,h,l use?
>
> You may want to move the cursor within the text, or scroll the text
> itself, or both.  There are means for doing each of these.
>
> To move the cursor fast within the window in vertical direction
> (without scrolling), there is e.g. L/H/M.  And for smooth scrolling
> there is Ctrl-E/Ctrl-Y.  By means of mapping, one may combine
> Ctrl-E with j, as well as Ctrl-Y with k, so that smooth scrolling
> would not affect the relative position of the cursor within the
> window, where possible.
>
> I see no reason to disable hjkl.  If you want to learn and use new
> means of navigating, then do so -- how does hjkl interfere?  Besides,
> as others have pointed out, hjkl can be prefixed by counts, which is
> very useful.  If you disable or ignore hjkl, how would you move the
> cursor ten lines up or down fast?  Or how would you yank fast e.g.
> five characters to the right of where the cursor is (i.e., do y5l)?
I think my comment about disabling hljk is not . I know, it is not recommended to disable an obvious capability. But In my case, I am just getting used to many other motion keys.

As I pointed out, I am beginner/intermediate level vim user. Still learning to get around things. I have already learned a lot from this forum. Thank you all for it.

Here are some of takeaways so far (for me).

 - Use <number>jkhl,w,e,b,ge etc.
 - Use relative numbers.
 - Use easymotion plugin. (which is pretty awesome!)
 - Use / for search. Start using marks for quick yanking/delete. (for example, to copy a block, mark at the start (ma). Go to end of the block, type y'a to copy, or d'a to delete.
  - Use control+o in insert mode. (e.g. control+o+3j) etc


Please share any other tips/suggestions you may have. Thanks.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Trying to learn to Work with Text without using J,K,H,L and arrow keys

Amit Christian
In reply to this post by Amit Christian
On Tuesday, September 13, 2016 at 10:23:57 AM UTC-5, Amit Christian wrote:

> I came across this webpage (http://vimcasts.org/blog/2013/02/habit-breaking-habit-making/), which recommends to stop using j,k,h,l and arrow keys and promote use of other more efficient keys to browse through the code. I am intermediate level of Vim user.
>
> I have disabled (temporarily) the use of j, k, h, l (using HardMode vim plugin). It has been a little challenge to work with the code since then. But I know it will help me to be more efficient with Vim.
>
> - I have so far used, w, b, e, ge etc to move around the lines.
> - Also have been using f + character to move through the line.
> - And have been using little bit of marks and / search to find through the code.
>
>
> Here is my question:
>
> I find it still difficult to go to next lines or browsing up or down through the text. Can any one please help me with efficient use of working with text without a usual j,k,h,l use? Are there resources or help on internet? What are your strategies to work with text?
>
> Thank you for your time and reading this.

I think my decision about disabling hljk (even temporarily) may not be good. I userstand that it is not recommended to disable an inbuilt capability. But In my case, I am just getting used to many other motion keys.

As I pointed out, I am beginner/intermediate level vim user. Still learning to get around things. I have already learned a lot from this forum. Thank you all for it.

Here are some of takeaways so far (for me).

 - Use <number>jkhl,w,e,b,ge etc.
 - Use relative numbers.
 - Use easymotion plugin. (which is pretty awesome!)
 - Use / for search. Start using marks for quick yanking/delete. (for example, to copy a block, mark at the start (ma). Go to end of the block, type y'a to copy, or d'a to delete.
  - Use control+o in insert mode. (e.g. control+o+3j) etc


Please share any other tips/suggestions you may have. Thanks.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Trying to learn to Work with Text without using J,K,H,L and arrow keys

Amit Gold
In reply to this post by Nicola

On 2016-09-13 15:23:57 +0000, Amit Christian said:

I came across this webpage (http://vimcasts.org/blog/2013/02/habit-breaking-habit-making/), which recommends to stop using j,k,h,l and arrow keys and promote use of other more efficient keys to browse through the code. I am intermediate level of Vim user.

I have disabled (temporarily) the use of j, k, h, l (using HardMode vim plugin). It has been a little challenge to work with the code since then. But I know it will help me to be more efficient with Vim.

- I have so far used, w, b, e, ge etc to move around the lines.
- Also have been using f + character to move through the line.
- And have been using little bit of marks and / search to find through the code.


Here is my question:

I find it still difficult to go to next lines or browsing up or down through the text. Can any one please help me with efficient use of working with text without a usual j,k,h,l use? Are there resources or help on internet? What are your strategies to work with text?
 

I suggest using the plugin HardTime, instead of HardMode. Here it is: https://github.com/takac/vim-hardtime
Instead of disabling the buttons, it puts a cooldown on them. I use (and suggest) the following settings for HardTime:

let g:hardtime_allow_different_key = 1
let g:hardtime_default_on = 1
let g:list_of_disabled_keys = ["<UP>", "<DOWN>", "<LEFT>", "<RIGHT>"]

The allow_different_key will let you do something like jh quickly, while without it it would put a cooldown anyways. However it's abusable by doing jhjhjhjhjhjhjh :D

Other options are self-explanatory.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Trying to learn to Work with Text without using J,K,H,L and arrow keys

Tim Chase
In reply to this post by Amit Christian
On 2016-09-15 07:53, Amit Christian wrote:
> > I have disabled (temporarily) the use of j, k, h, l (using
> > HardMode vim plugin).
>
> I think my decision about disabling hljk (even temporarily) may not
> be good. I userstand that it is not recommended to disable an
> inbuilt capability. But In my case, I am just getting used to many
> other motion keys.

While I haven't used hardmode.vim, I seem to recall that it doesn't
*disable* h/j/k/l but rather detects when you're using them
repeatedly and slows you down to think about finding another way to
do it.  Or that might be some other plugin.  I think that's a good
compromise between encouraging laziness and disabling them completely.

And I'd only suggest it as training-wheels, and disable it once you
find more ways to navigate and get them into your muscle memory.


> Here are some of takeaways so far (for me).
>
>  - Use <number>jkhl,w,e,b,ge etc.
>  - Use relative numbers.
>  - Use easymotion plugin. (which is pretty awesome!)
>  - Use / for search. Start using marks for quick yanking/delete.
> (for example, to copy a block, mark at the start (ma). Go to end of
> the block, type y'a to copy, or d'a to delete.
>   - Use control+o in insert mode. (e.g. control+o+3j) etc
>
> Please share any other tips/suggestions you may have. Thanks.

Jumping by paragraph with } and { are another common one.  I also
like the ] and [ family of functions

   :helpgrep \*].\*
   :copen

will pull back lots of them, including navigating C-style blocks,
between mis-spelled words, diff blocks, etc.

-tim




--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.