Code Monkey home page Code Monkey logo

netrw_keepdir_fix's Introduction

netrw_keepdir_fix

A small plugin to fix netrw's mc and mm commands for netrw_keepdir=1. E.g.:

**error** (netrw) tried using g:netrw_localcopycmd<cp>; it doesn't work!

Written in vimscript, so works for both vim and neovim.

Why?

Atm, netrw's mc and mm commands don't work properly when netrw_keepdir=1 because under the hood they require either correct lcd every time or keepdir_dir=0.

All the internet advises to just set keepdir_dir=0 and be happy, or manually lcd and be happy. This is the Vim way™ baby. But this may not be the case for all users and interferes with other plugin defaults or simply I want netrw not to crash and work properly.

On the other side, upstream fixes to netrw are extremely slow and may take years. And on a rainy day, I may open a PR to fix it properly and wait.

How it works

The only thing this plugin does is wrap mc and mm commands in a function that correctly prepends the correct current directory and restores it to the original directory afterward.

Installation

Just use whatever plugin manager you like or check the source and copy-paste it to your local config. But IMO, using a plugin manager is marginally better, as potentially there might be fixes.

vim-plug

Plug 'dzirtusss/netrw_keepdir_fix'

lazy.nvim

{ 'dzirtusss/netrw_keepdir_fix' }

License

MIT

netrw_keepdir_fix's People

Contributors

dzirtusss avatar

Stargazers

 avatar

Watchers

 avatar

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.