Emre.xyz

vim

I didn't know it is possible to enable vim mode, in bash before. I learned today and this feature is awesome.

You can enable vim mode in the bash with only change a parameter in your .bashrc file, like that.

set -o vi

That's it. You can use bash with vim strokes.

#tips #vim #en #bash

You can get file path in vim with % (percent) symbol. Sometimes you need to run a command with the current file path, for example git add filepath or sh filepath.

You can add the current file to git with this command in vim:

:!git add %

or you can run any file with this command:

:!%:p

For example, you write a bash script and saved it. But you don't want to close vim or you don't want to go to another terminal screen. Just you need to write :!%:p and vim run the file for you.

#tips #en #vim #git