技术控

    今日:47| 主题:49507
收藏本版 (1)
最新软件应用技术尽在掌握

[其他] Vim: you don't need NERDtree or (maybe) netrw

[复制链接]
蜜彩儿 发表于 2016-10-18 21:40:48
127 3

立即注册CoLaBug.com会员,免费获得投稿人的专业资料,享用更多功能,玩转个人品牌!

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
Table of contents

     
       

    •       
    • netrw - the unloved directory browser      
    • Changing the directory view in netrw      
    • Changing how files are opened      
    • Set the width of the directory explorer      
    • You may not need netrw     
       
     
Vim: you don't need NERDtree or (maybe) netrw-1 (horizontal,available,default,contents,achieved)

  netrw - the unloved directory browser

   The netrw plugin normally ships with vim and is the default filebrowser. It gets a bad rap and ships with all kinds of features likes remote editing over SSH and FTP, and anecdotally has many bugs . Most developers just jump straight for the  NERDtree plugin  but in my opinion the default netrw plugin does most of what people use NERDtree for. Moreover, for opening files and traversing codebases there are other native vim options available.
  Invoking netrw

  Invoking netrw can be achieved in three ways
  
       
  • :Explore - opens netrw in the current window   
  • :Sexplore - opens netrw in a horizontal split   
  • :Vexplore - opens netrw in a horizontal split  
   You can also snigger by typing :Sex to invoke a horizontal split.
  Changing the directory view in netrw

  The directory listing view can be modified to show more or less information on files and directories, change the sorting order and hiding certain files.
   With the directory browser open hit i to cycle through the view types. There are four different view types: thin, long, wide and tree. A preferred view type can be made permanent by setting it in a .vimrc file.
  [code]let g:netrw_liststyle = 3[/code]

Vim: you don't need NERDtree or (maybe) netrw-2 (horizontal,available,default,contents,achieved)

  The tree list view in netrw.
  Removing the banner

   The directory banner is mostly useless. To remove it temporarily press I . To remove it permanently add the following to your .vimrc .
  [code]let g:netrw_banner = 0[/code]  Changing how files are opened

   By default files will be opened in the same window as the netrw directory browser. To change this behaviour the netrw_browse_split option may be set. The options are as follows
  
       
  • 1 - open files in a new horizontal split   
  • 2 - open files in a new vertical split   
  • 3 - open files in a new tab  
   To make the selection permanent add the following to your .vimrc .
  [code]let g:netrw_browse_split = 1[/code]  Set the width of the directory explorer

   The width of the directory explorer can be fixed with the netrw_browse_split option. The following sets the width to 25% of the page.
  [code]let g:netrw_winsize = 25[/code]  NERDtree like setup

   If NERDtree is your thing netrw can give you a similar experience with the following settings
  [code]let g:netrw_banner = 0
let g:netrw_liststyle = 3
let g:netrw_browse_split = 4
let g:netrw_altv = 1
let g:netrw_winsize = 25
let g:netrw_banner = 0
augroup ProjectDrawer
  autocmd!
  autocmd VimEnter * :Vexplore
augroup END[/code]
12下一页
友荐云推荐




上一篇:Introducing VMware Workspace ONE Essentials
下一篇:iOS App组件化开发实践之需要思考的问题
酷辣虫提示酷辣虫禁止发表任何与中华人民共和国法律有抵触的内容!所有内容由用户发布,并不代表酷辣虫的观点,酷辣虫无法对用户发布内容真实性提供任何的保证,请自行验证并承担风险与后果。如您有版权、违规等问题,请通过"联系我们"或"违规举报"告知我们处理。

槑92 发表于 2016-10-22 02:55:26
先顶再看!
回复 支持 反对

使用道具 举报

刘红艳 发表于 2016-11-7 11:01:10
轻轻的手滑
回复 支持 反对

使用道具 举报

AliciaMl 发表于 2016-11-21 17:56:14
土豪,我们做朋友吧。
回复 支持 反对

使用道具 举报

*滑动验证:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

我要投稿

推荐阅读

扫码访问 @iTTTTT瑞翔 的微博
回页顶回复上一篇下一篇回列表手机版
手机版/CoLaBug.com ( 粤ICP备05003221号 | 文网文[2010]257号 )|网站地图 酷辣虫

© 2001-2016 Comsenz Inc. Design: Dean. DiscuzFans.

返回顶部 返回列表