Giter Site home page Giter Site logo

vwd.nvim's Introduction

vwd.nvim

A Virtual working directory for Neovim.

Features

This plugin aims to provide a Virtual Working Directory (VWD) to use with other plugins. When working with large repositories, targeting searches to specific directories becomes essential. This plugin exposes an API and commands to set, get and reset the working directory. It also provides a Telescope extension to search from the VWD.

Installing

Install the plugin with your preferred package manager:

lazy.nvim { 'prichrd/vwd.nvim', opts = {} }
vim-plug Plug 'prichrd/vwd.nvim'
packer use 'prichrd/vwd.nvim'

Configuration

The plugin currently doesn't have any configuration options. The setup function still has to be called to configure the commands:

  require('vwd').setup({})

Telescope

vwd.nvim extends Telescope's find_files, live_grep and grep_string functionalities by setting the CWD to the VWD. Here is a sample Telescope configuration:

  local telescope = require('telescope')

  -- Register the vwd extension.
  telescope.load_extension('vwd')

  -- Configures find_files, live_grep and grep_string to use VWD. You can still provide
  -- regular Telescope arguments to the finders.
  vim.api.nvim_set_keymap('n', '<Leader>ff', '<cmd>lua require"telescope".extensions.vwd.find_files({})<CR>', opts)
  vim.api.nvim_set_keymap('n', '<Leader>fg', '<cmd>lua require"telescope".extensions.vwd.live_grep({})<CR>', opts)
  vim.api.nvim_set_keymap('n', '<Leader>fs', '<cmd>lua require"telescope".extensions.vwd.grep_string({})<CR>', opts)

Usage

Commands

Get the VWD with:

:VWD get

Set the VWD with:

:VWD set {vwd}

Reset the VWD with:

:VWD reset

API

Get the VWD with:

require('vwd').get_vwd()

Set the VWD with:

require('vwd').set_vwd(vwd, absolute)

Reset the VWD with:

require('vwd').reset_vwd()

Contributing

This project accepts contributions. Feel free to open issues for questions, feature ideas, bugs, etc. Before submitting a PR, make sure you run make lint with stylua and luacheck installed.

vwd.nvim's People

Contributors

prichrd avatar

Stargazers

 avatar  avatar Kunju Perath avatar Takuma Kimura avatar Yuta Katayama 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.