How to get username in vi/vim editor? -
i trying find username/fullname of current user invoked vi/vim editor.
:autocmd bufnewfile *.sh exe "1," . 10 . "g/author :.*/s//author : " .getlogin() i tried using getlogin(), getuser(), getpwnam() nothing worked.
you can use $user variable:
:echo "your username is" $user
Comments
Post a Comment