Giter Club home page Giter Club logo

vsnetrw's Introduction

vsnetrw

A split file explorer for vscode, inspired by netrw, vim-vinegar, dired, and vim-dirvish.

vsnetrw in action

Shortcuts

Use vsnetrw.open to open a file explorer at the parent directory of the currently active text editor. Once open the following shortcuts are available.

Default Shortcut Command Description
enter vsnetrw.openAtCursor Open the file or directory under the cursor
- vsnetrw.openParent Jump to the parent directory
~ vsnetrw.openHome Jump to the root of the current workspace folder, or user's homedir.
R vsnetrw.rename Rename the file or directory under the cursor
% vsnetrw.create Create a new file or directory (and any intermediate directories).
d vsnetrw.createDir Create a new directory (and any intermediate ones).
D vsnetrw.delete Delete the file or directory under the cursor.
ctrl+l vsnetrw.refresh Refresh the directory listing.
esc vsnetrw.close Close the active explorer.

VSCodeVim Keybindings

To make - open an explorer from any file (like vim-vinegar) add the following binding to your vim.normalModeKeyBindings.

{
  "before": ["-"],
  "commands": ["vsnetrw.open"],
  "when": "editorLangId != vsnetrw"
}

This binding can't be provided as part of the extension because native VSCode's keybindings will accidentally trigger in undesirable instances (e.g. pressing r- in normal mode).

Installation

vsnetrw can be installed from the VSCode Marketplace.

You can also download a VSIX from releases and install it by running >Extensions: Install from VSIX.

vsnetrw's People

Contributors

carlosflorencio avatar danprince avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vsnetrw's Issues

duplicate file shortcut

Would be handy to have a way to duplicate a file, even though this wasn't part of netrw's original feature set.

Looks like Y won't conflict, and the UX should be the same as renaming a file, except it'll just copy the file, rather than move it.

Could you please implement bookmarks?

Something like ranger, nnn, and others can do?
Ideally, I would save a location into a registed, and then I should be able to jump to this location by referring to that register (like vim bookmarks).

jump to dir with prompt

Fed up of not being able to do :e ~/some/dir and have it open netrw. Should add a vsnetrw command to that would prompt the user for a path and to go straight there.

Be great if it would autocomplete from the file system. No idea whether that's even possible.

netrw shortcuts

  • <F1> Causes Netrw to issue help
  • <cr> Netrw will enter the directory or read the file
  • <del> Netrw will attempt to remove the file/directory
  • <c-h> Edit file hiding list
  • <c-l> Causes Netrw to refresh the directory listing
  • <c-r> Browse using a gvim server
  • <c-tab> Shrink/expand a netrw/explore window
  • - Makes Netrw go up one directory
  • a Toggles between normal display, hiding (suppress display of files matching g:netrw_list_hide), and showing (display only files which match g:netrw_list_hide)
  • c Make browsing directory the current directory
  • C Setting the editing window
  • d Make a directory
  • D Attempt to remove the file(s)/directory(ies)
  • gb Go to previous bookmarked directory
  • gd Force treatment as directory
  • gf Force treatment as file
  • gh Quick hide/unhide of dot-files
  • gn Make top of tree the directory below the cursor
  • i Cycle between thin, long, wide, and tree listings
  • mb Bookmark current directory
  • mc Copy marked files to marked-file target directory
  • md Apply diff to marked files (up to 3)
  • me Place marked files on arg list and edit them
  • mf Mark a file
  • mF Unmark files
  • mg Apply vimgrep to marked files
  • mh Toggle marked file suffices' presence on hiding list
  • mm Move marked files to marked-file target directory
  • mp Print marked files
  • mr Mark files using a shell-style |regexp|
  • mt Current browsing directory becomes markfile target
  • mT Apply ctags to marked files
  • mu Unmark all marked files
  • mv Apply arbitrary vim command to marked files
  • mx Apply arbitrary shell command to marked files
  • mX Apply arbitrary shell command to marked files en bloc
  • mz Compress/decompress marked files
  • o Enter the file/directory under the cursor in a new browser window. A horizontal split is used.
  • O Obtain a file specified by cursor
  • p Preview the file
  • P Browse in the previously used window
  • qb List bookmarked directories and history
  • qf Display information on file
  • qF Mark files using a quickfix list
  • qL Mark files using a |location-list|
  • r Reverse sorting order
  • R Rename the designated file(s)/directory(ies)
  • s Select sorting style: by name, time, or file size
  • S Specify suffix priority for name-sorting
  • t Enter the file/directory under the cursor in a new tab
  • u Change to recently-visited directory
  • U Change to subsequently-visited directory
  • v Enter the file/directory under the cursor in a new browser window. A vertical split is used.
  • x View file with an associated program
  • X Execute filename under cursor via |system()|
  • % Open a new file in netrw's current directory
  • <leftmouse> (gvim only) selects word under mouse as if a had been pressed (ie. edit file, change directory)
  • <middlemouse> (gvim only) same as P selecting word under mouse; see |netrw-P|
  • <rightmouse> (gvim only) delete file/directory using word under mouse
  • <2-leftmouse> (gvim only) when: * in a netrw-selected file, AND * |g:netrw_retmap| == 1 AND * the user doesn't already have a <2-leftmouse> mapping defined before netrw is autoloaded, then a double clicked leftmouse button will return to the netrw browser window. See |g:netrw_retmap|.
  • <s-leftmouse> (gvim only) like mf, will mark files. Dragging the shifted leftmouse will mark multiple files. (see |netrw-mf|)

watch directories whilst explorer is open

Check what the built-in file explorer does to show changes to prevent needing to refresh manually when another process changes a dir on disk.

Would have thought the simplest thing would just be to watch the dir for changes and throw away the watcher when the explorer closes.

multiline deletion

Add the ability to delete a selection of files spanning multiple lines.

~ keybinding conflict

~ currently opens a vsnetrw explorer when pressed in a text editor. This shortcut should only be active when inside an explorer.

Add breadcrumbs functionality

image

It'd be cool if the extension showed the current directory you were in at the top of the tree using the vscode breadcrumbs. It could be tied to the breadcrumbs setting in vscode so people that don't have breadcrumbs on wouldn't have to see it.

Line numbers flashing when opening new directories

When opening a directory that hasn't been opened yet, the line numbers flash for a very brief moment:

Screen.Recording.2024-05-28.at.17.24.33.mov

I've tested this on two machines (Windows and Mac). Also, using a clean config and disabling all other extensions does not change this behaviour.

Is that something others experience too?

Close vsnetrw tab when opening a file

When a file is chosen to be open, it would be nice to have the vsnetrw file tab to be closed.

Also it would be great to have an option to close the tab without open anything with ESC for example.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.