As I understand, in Linux directories are mostly normal files w/ some special handling (e.g. 'rm' a file is ok; 'rm' a dir will complain w/o -r).
When I execute the following bash commands:
mkdir foo; touch foo/f1.txt; touch foo/f2.txt; vim foo
Vim shows the contents of the foo directory-file as:
" ============================================================================ " Netrw Directory Listing (netrw v136) " /home/capdigi/foo " Sorted by name " Sort sequence: [\/]$,\<core\%(\.\d\+\)\=\>,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$,\.swp$,\.bak$,\~$ " Quick Help: <F1>:help -:go up dir D:delete R:rename s:sort-by x:exec " ============================================================================ ../ f1.txt f2.txt
My questions are:
1) Why is netrw used in the context of this example? According to http://www.vim.org/scripts/script.php?script_id=1075, netrw "supports reading and writing files across networks". Is this just the component that vim uses for uniform local/network directory access?
2) Why is netrw needed at all? Since directories are "mostly" normal files, can't they just be opened as a normal file without any intermediary layer? Aka why all the fanciness?