Using vim to view the contents of a directory


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Using vim to view the contents of a directory
# 1  
Old 12-05-2013
Using vim to view the contents of a directory

When I use this command:

Code:
vi /home/bob/.vim

I expect to see.

Code:
" ============================================================================  
" Netrw Directory Listing                                        (netrw v149)
"   /home/bob/.vim
"   Sorted by      name
"   Sort sequence: [\/]$,\<core\%(\.\d\+\)\=\>,\.h$,\.c$,\.cpp$,\~\=\*$,*,\.o$,\
"   Quick Help: <F1>:help  -:go up dir  D:delete  R:rename  s:sort-by  x:exec
" ============================================================================
../
./
.netrwhist
.swp

Unfortunately this is not working unless I do this inside vim.

Code:
:e

Any idea how to fix this? It works on my other computers just fine.
# 2  
Old 12-05-2013
What computer has the problem? Are they all the exact same OS. You do know about .exrc
.vimrc
files?
# 3  
Old 12-06-2013
Quote:
Originally Posted by jim mcnamara
What computer has the problem? Are they all the exact same OS. You do know about .exrc
.vimrc
files?
Yes I know about the .vimrc. I did not know about the .exrcuntil you mentioned it. I googled it and it seems like the .exrc does the exact same thing as .vimrc. Is that correct?

I have a new laptop with Fedora 19 and that is the one that will not open directories unless I do :e. I have a desktop with Fedora 16 and an old laptop with Fedora 15. They all have identical .vimrc so I don't understand what the problem is.

Code:
set nocompatible
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
set showmatch
set vb t_vb=
set ruler
set nohls
set incsearch
set virtualedit=all
set number
set cmdheight=2
set background=dark
"set list
"This command uses unix mode
set ff=unix

"This command uses dos mode
"set ff=dos

# 4  
Old 12-07-2013
Yes, .exrc is somewhat the same as .vimrc: In fact vim tries to be an improved vi and vi started as a graphical topping for an even older editor: ex. .exrc is the configuration file for this editor, which vi uses too (and therefore is also recognized by vim)

My suspicion is that your terminal setting is wrong. Which terminal emulator do you really use (xterm, eterm, kterm, dtterm, ...) and to what is displayed when you issue

Code:
echo $TERM

on a newly opened window?

I hope this helps.

bakunin
# 5  
Old 12-08-2013
Quote:
Originally Posted by bakunin
Yes, .exrc is somewhat the same as .vimrc: In fact vim tries to be an improved vi and vi started as a graphical topping for an even older editor: ex. .exrc is the configuration file for this editor, which vi uses too (and therefore is also recognized by vim)

My suspicion is that your terminal setting is wrong. Which terminal emulator do you really use (xterm, eterm, kterm, dtterm, ...) and to what is displayed when you issue

Code:
echo $TERM

on a newly opened window?

I hope this helps.

bakunin
You lost me there. What does all this mean (xterm, eterm, kterm, dtterm, ...)?

Code:
$ echo $TERM
xterm-256color

I use Konsole the KDE terminal emulator if that makes a difference.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

View all jar files contents in one go ?

I can view a jar file contents using the below command: $ jar -tvf ./checker-compat-qual-2.0.0.jar 0 Mon May 02 18:28:46 IST 2016 META-INF/ 184 Mon May 02 18:28:44 IST 2016 META-INF/MANIFEST.MF 0 Mon May 02 17:20:16 IST 2016 afu/ 0 Mon May 02 17:20:16 IST 2016 afu/org/ ... (5 Replies)
Discussion started by: mohtashims
5 Replies

2. Shell Programming and Scripting

Cd to another directory to view a log file

Hi guys Today I have been working on a script to execute to view entries within a log file. I have successfully got the command I want to execute within the script itself. I want to view the last 5 entries within a log file and see just the last numbers. The file name would change depending... (5 Replies)
Discussion started by: simpsa27
5 Replies

3. UNIX for Beginners Questions & Answers

View file contents created by dbCAmplicons as tab delimited

I have run the following command : od -c Results_May18.fixrank | head Here is the result. I wanted the results in tab delimited. Thanks $ od -c Results_May18.fixrank | head 0000000 M 0 1 6 0 1 : 1 2 9 : 0 0 0 0 0 0000020 0 0 0 0 - A T T D Y ... (2 Replies)
Discussion started by: Benard
2 Replies

4. Shell Programming and Scripting

trying to view contents of an existing script

root#pwd /opt/tools root# cat check_traffic /opt/tools/utils/commands $1 /opt/tools/utils/DIR/check_traffic root# cat /opt/tools/utils/DIR/check_traffic gew "check_traffic -v" Hi above script works for checking traffic for an ip address im trying to view the check_traffic script by... (5 Replies)
Discussion started by: slashbash
5 Replies

5. HP-UX

[Solved] How to view the contents of the .depot files

Hi, I have one depot file. I would want to view the contents of this file with out extracting and with out installing in a machine. Like for $rpm -qlp rpmfilename will list out all the files in a rpm. Like I would want a command to view the files from a .depot file. I tried with swlist... (2 Replies)
Discussion started by: skmdu
2 Replies

6. Shell Programming and Scripting

Command to view files in Directory

Hi, Can u provide me the command to view files in a directory.Urgent Pls. -Vamsi (4 Replies)
Discussion started by: VamsiVasili
4 Replies

7. Shell Programming and Scripting

Command to view files in Directory

Hi, Can you help me in providing me a command to view all files present in a directory. Thanks a lot. -Vamsi (1 Reply)
Discussion started by: VamsiVasili
1 Replies

8. UNIX for Advanced & Expert Users

in vim how can i view the macro

in vim how can i see the definition of a macro? for example i have EOF in my file. i want to see the value of EOF how can i do this. (2 Replies)
Discussion started by: lakshmananindia
2 Replies

9. Programming

view contents of shared library

Hi , i have two doubts in Hp-Ux 1) How to View objects or contents in a shared library in HP-Ux 2) Can i added a c object file to the existing shared file from a different directory . for example : I have two directories X and Y I have a.o b.o c.o object files in X directory I... (4 Replies)
Discussion started by: naren_chella
4 Replies

10. UNIX for Dummies Questions & Answers

Unable to view contents of a directory

Hi, first post here be gentle. Very new to Unix. Using HP-UX 10.20 I CD into a remote directory on one machine $ cd /net/remote hostname yet when I do an ll in this directory none of the contents appear. It just is empty. when I do the same command from another machine, $ cd... (13 Replies)
Discussion started by: maddave
13 Replies
Login or Register to Ask a Question