From 975db72ec921b04d4d0bde3c9e3d26e9960e9dcf Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Thu, 21 Nov 2019 14:40:49 -0600 Subject: [PATCH] Add Rename A File Through netrw as a vim til --- README.md | 3 ++- vim/rename-a-file-through-netrw.md | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 vim/rename-a-file-through-netrw.md diff --git a/README.md b/README.md index 541cfe6..74da020 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ and pairing with smart people at Hashrocket. For a steady stream of TILs, [sign up for my newsletter](https://tinyletter.com/jbranchaud). -_871 TILs and counting..._ +_872 TILs and counting..._ --- @@ -933,6 +933,7 @@ _871 TILs and counting..._ - [Quit When There Is An Argument List](vim/quit-when-there-is-an-argument-list.md) - [Re-indenting Your Code](vim/reindenting-your-code.md) - [Read In The Contents Of A Rails File](vim/read-in-the-contents-of-a-rails-file.md) +- [Rename A File Through netrw](vim/rename-a-file-through-netrw.md) - [Rename Current File](vim/rename-current-file.md) - [Repeat The Previous Change](vim/repeat-the-previous-change.md) - [Repeating Characters](vim/repeating-characters.md) diff --git a/vim/rename-a-file-through-netrw.md b/vim/rename-a-file-through-netrw.md new file mode 100644 index 0000000..a8a41f3 --- /dev/null +++ b/vim/rename-a-file-through-netrw.md @@ -0,0 +1,23 @@ +# Rename A File Through netrw + +You can browse files in a directory through Vim using netrw. This can be done +by _editing_ a directory with Vim: + +```bash +$ vim src/ +``` + +You'll see a listing of the files and directories in `src`: + +``` +app/ +index.js +README.md +utils/ +``` + +You can move your cursor over one of those files and hit `R` to rename it. A +prompt will appear at the bottom of your Vim session with the file's current +name spelled out. You can edit inline and then hit enter to apply the renaming. + +[source](https://superuser.com/questions/767026/can-i-rename-files-in-a-directory-with-vim#)