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

2016-09-15 Thread Amit Gold
> On 2016-09-13 15:23:57 +, 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 = ["", "", "", ""]

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 vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-09-15 Thread Tim Chase
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 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 vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-09-15 Thread 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 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 vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-09-15 Thread 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 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 vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-09-15 Thread Boyko Bantchev
> 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 vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-09-14 Thread Amit Christian
On Tuesday, September 13, 2016 at 3:10:36 PM UTC-5, Nicola wrote:
> On 2016-09-13 15:23:57 +, 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 vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-09-14 Thread Erik Christiansen
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 vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-09-13 Thread Shawn H Corey
On Tue, 13 Sep 2016 08:23:57 -0700 (PDT)
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?

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 vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-09-13 Thread Nicola

On 2016-09-13 15:23:57 +, 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 vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-09-13 Thread Amit Christian
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 vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-09-13 Thread Tim Chase
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 vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.