How to go to the end of the file in vim while preserving the current column under the cursor? -
often when use visual mode, expand selection whole file. hitting vg takes me first character of last line. take me same column of last line before used command. there easy way achieve that? use 200000j or something, that's not elegant. thanks.
if add set nostartofline
vimrc typing g
while in visual mode go bottom line without changing column. might change of other behaviors used because changes other commands. (which might undesirable).
help startofline copied below can see commands affected setting.
*'startofline'* *'sol'* *'nostartofline'* *'nosol'* 'startofline' 'sol' boolean (default on) global {not in vi} when "on" commands listed below move cursor first non-blank of line. when off cursor kept in same column (if possible). applies commands: ctrl-d, ctrl-u, ctrl-b, ctrl-f, "g", "h", "m", "l", gg, , commands "d", "<<" , ">>" linewise operator, "%" count , buffer changing commands (ctrl-^, :bnext, :bnext, etc.). ex command has line number, e.g., ":25" or ":+". in case of buffer changing commands cursor placed @ column last time buffer edited. note: option set when 'compatible' set.
Comments
Post a Comment