Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ls command inside Vim is showing a weird result

Tags:

vim

When trying to save a file in vim I used the ls command to see the folder I want to save in. I got the following output after using the ls command:

1 %a + "[No Name]"           line 1

Obviously that's not the contents of the folder. Can anyone tell me why that's happening and how to fix it? Thanks :)

like image 1000
matanc1 Avatar asked Nov 22 '12 16:11

matanc1


People also ask

What does ls do in Vim?

ls is a call to ls command in the shell == list of your files in the working dir. :ls is a Vim built-in command, which shows content of buffer list == list of your open files.

How run ls command in Vim editor?

First Go to command mode in vi editor by pressing 'esc' key and then type “:“, followed by “!” and the command, example is shown below. Example : Run the ifconfig command within the /etc/hosts file.

What is the result of the command ls?

The ls command is used to list files. "ls" on its own lists all files in the current directory except for hidden files.

What does GG mean in Vim?

gg | G. These commands let you move around the entire file. gg will move you to the first line in the file, and G will move you to the last line in the file. Alternatively, if you type nG where n is a number, you'll jump to that to that line.


1 Answers

Try these two commands

:help :ls
:!ls
like image 197
steffen Avatar answered Sep 18 '22 13:09

steffen