Coder Social home page Coder Social logo

mwd.vim's Introduction

MWD - Magic Working Directory ๐Ÿช„ Vim

Change the startup behavior of Vim to follow your path.

img

Rationale

Have you ever started Vim from the command line with a path argument and were surprised to discover that Vim was operating on a completely different path than what you expected? ๐Ÿ˜•

Do you think it would be awesome if Vim's current working directory was derived from the path argument?

Well this could be the perfect plugin for you! ๐Ÿ˜ƒ

No more fussing with having to manually change the current working directory after startup. MWD is a simple plugin that handles this task for you automatically and requires zero-configuration.

Q & A

Why not use Vim's built-in autochdir feature?

It simply doesn't fit my workflow. I would like Vim to stay in my workspace path or what is also known as the project's root. Autochdir will keep changing your directory all over the place as you jump to different files throughout your workspace tree. For this reason, I recommend turning off autochdir when using this plugin.

Why not use the vim-rooter plugin?

This looks like a great alternative! I simply didn't need any of the additional capabilities it offers. If you need something with more capabilities, please give vim-rooter a try!

Installation

Using vim-plug

Plug 'k3vinw/mwd.vim'

Manual

copy autoload/mwd.vim  -> ~/.vim/autoload/mwd.vim
copy plugin/mwd.vim -> ~/.vim/plugin/mwd.vim

Usage

vim ~/projects/magic # sets Vim's current working directory to ~/projects/magic
vim ~/projects/magic/README.md # sets Vim's current working directory to ~/projects/magic
vim # current working directory is not changed

License

MIT License. Copyright (c) 2023 Kevin Ray Wood.

mwd.vim's People

Contributors

k3vinw 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.