GithubHelp home page GithubHelp logo

gatekeeper.nvim's Introduction

Gatekeeper.nvim

This plugin intends to make buffers with from files outside of the current working directory read only and non modifiable. To do that it sets an auto command for every time a buffer gets loaded.

The purpose for the existence of this plugin is basically allowing to set white lists for folders or files.

Usage

Install with your favorite package manager and call

require('gatekeeper').setup({
-- default values
    exclude = {},
    exclude_regex = {},
    debug = false, -- will call vim.notify with info when it is being evaluated
})

Options

exclude

Specifies fully qualified folders or files to be excluded and being editable. It won't expand ~ to your home so you have to concatenate vim.fn.expand('~') to your desired folder, if that's the case. Example:

require('gatekeeper').setup({
    exclude = {
        vim.fn.expand('~/.config/nvim')
    }
})

exclude_regex

Specifies regex patterns to evaluate files to be excluded and being editable. If the buffer name matches the regex it won't be blocked from being edited. Example:

require('gatekeeper').setup({
    exclude_regex = {
        '.*\.config/nvim/.*' -- any file that contains ".config/nvim" in its full path
    }
})

debug

Will notify if a file is being blocked or not when it is evaluated.

Commands

You can call :GTForceWrite on any buffer to revert and force it to be writable and modifiable.

If you want to check why some buffer is or is not being blocked, you can call :GTExplain. It will print all checks on your settings against the current buffer until one evaluates to true (which means it found an exclusion/reason to not block).

gatekeeper.nvim's People

Contributors

augustocdias avatar

Stargazers

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