(Change <tt> to <code>, perhaps also minor tweak.)
Line 3:
Line 3:
|previous=104
|previous=104
|next=106
|next=106
−
|created=September 3, 2001
+
|created=2001
|complexity=basic
|complexity=basic
|author=Andrew Pimlott
|author=Andrew Pimlott
Line 13:
Line 13:
It can be convenient to scroll down or up by one line, while not changing the cursor screen line.
It can be convenient to scroll down or up by one line, while not changing the cursor screen line.
−
You can scroll down in this way by typing <tt><C-e>j</tt> (Ctrl-e to scroll down to see more text at the bottom, and <tt>j</tt> to move the cursor down so its screen line hasn't changed). An alternative is <tt>1<C-d></tt> (Ctrl-d to scroll down, with a count of <tt>1</tt> which sets the <tt>'scroll'</tt> option to 1 so one line is scrolled).
+
You can scroll down in this way by typing <code><C-e>j</code> (Ctrl-e to scroll down to see more text at the bottom, and <code>j</code> to move the cursor down so its screen line hasn't changed). An alternative is <code>1<C-d></code> (Ctrl-d to scroll down, with a count of <code>1</code> which sets the <code>'scroll'</code> option to 1 so one line is scrolled).
−
A superior solution is to place the following in your [[vimrc]]. This script behaves better at the top and bottom of the buffer, and does not change the <tt>'scroll'</tt> option. Press Ctrl-J to scroll down or Ctrl-K to scroll up, in normal and visual modes.
+
A superior solution is to place the following in your [[vimrc]]. This script behaves better at the top and bottom of the buffer, and does not change the <code>'scroll'</code> option. Press Ctrl-J to scroll down or Ctrl-K to scroll up, in normal and visual modes.
created 2001 · complexity basic · author Andrew Pimlott · version 5.7
It can be convenient to scroll down or up by one line, while not changing the cursor screen line.
You can scroll down in this way by typing <C-e>j (Ctrl-e to scroll down to see more text at the bottom, and j to move the cursor down so its screen line hasn't changed). An alternative is 1<C-d> (Ctrl-d to scroll down, with a count of 1 which sets the 'scroll' option to 1 so one line is scrolled).
A superior solution is to place the following in your vimrc. This script behaves better at the top and bottom of the buffer, and does not change the 'scroll' option. Press Ctrl-J to scroll down or Ctrl-K to scroll up, in normal and visual modes.