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

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -