Skip to main content
use T and t
Source Link
Gilles 'SO- stop being evil'
  • 866.2k
  • 205
  • 1.8k
  • 2.3k

T/ puts the cursor after the last / character, so:

Up Esc c Shift+FT / w00t.txt lEnter

or, to replace the just first word in the file name:

Up CEsc Shift+T / c w w00t.txt Enter

or, if there are multiple words before the extension and you want to keep the extension:

Up Esc Shift+T / c t . w00t Enter

Alternatively, with history expansion:

!!:h/w00t.txt

Up Esc Shift+F / l C w00t.txt Enter

Alternatively, with history expansion:

!!:h/w00t.txt

T/ puts the cursor after the last / character, so:

Up Esc c Shift+T / w00t.txt Enter

or, to replace the just first word in the file name:

Up Esc Shift+T / c w w00t Enter

or, if there are multiple words before the extension and you want to keep the extension:

Up Esc Shift+T / c t . w00t Enter

Alternatively, with history expansion:

!!:h/w00t.txt
Source Link
Gilles 'SO- stop being evil'
  • 866.2k
  • 205
  • 1.8k
  • 2.3k

Up Esc Shift+F / l C w00t.txt Enter

Alternatively, with history expansion:

!!:h/w00t.txt