Giter Site home page Giter Site logo

penvim's Introduction


PenVim

project's root directory and documents indentation detector with project based config loader


Table Of Contents

About The Project

This plugin (Penvim) has 4 purposes:

  1. change current working directory to project's root directory.
  2. detect indentation of Document (Source Code) and set indentation related config according to detected indentation
  3. load config defined in project's root directory
  4. set options according to Language's Standard Style Guide (not implemented yet...)

Getting Started

Install PenVim using your favorite package manager.

Prerequisites

  • neovim >= 0.7

Installation

using vim-plug

Plug 'Abstract-IDE/penvim'

or using packer.nvim

use {'Abstract-IDE/penvim'}

Setup

require("penvim").setup() -- use defaults

Full Configuration

require("penvim").setup({
	rooter = {
		enable = true, -- enable/disable rooter
		patterns = {'.__nvim__.lua', '.git', 'node_modules'}
	},
	indentor = {
		enable = true, -- enable/disable indentor
		indent_length = 4, -- tab indent width
		accuracy = 5, -- positive integer. higher the number, the more accurate result (but affects the startup time)
		disable_types = {
			'help','dashboard','dashpreview','NvimTree','vista','sagahover', 'terminal',
		},
	},
	project_env = {
		enable = true, -- enable/disable project_env
		config_name = '.__nvim__.lua' -- config file name
	},
})

Examples :

sample, config defined in project's root directory
-- .__nvim__.lua
return {
	-- for all file types
	all = {
		tabstop = 4, -- spaces per tab
		cursorline = true, -- highlight current line
		relativenumber = true, -- show relative line number
		number = true, -- show line numbers
	},

	-- for filetype lua
	lua = {	
		smarttab = true, -- <tab>/<BS> indent/dedent in leading whitespace
		softtabstop = 4,
		shiftwidth = 4, -- spaces per tab (when shifting), when using the >> or << commands, shift lines by 4 spaces
	},
	
	-- for filetype python and javascript
	py_js = {
		tabstop = 4, -- spaces per tab
		wrap = false, -- don't automatically wrap on load
	}
}

To-Do

  • testing
  • implement to set option according to Language's Standard Style Guide
  • optimize code

License

Distributed under the MIT License. See LICENSE for more information.

Acknowledgements

penvim's People

Contributors

northdakotag avatar shaeinst avatar

Stargazers

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

Watchers

 avatar  avatar

penvim's Issues

[Feature request] respecting editorconfig

Hey there, pretty cool plugin.

What do you think about respecting editorconfig?

Just a little check, if .editorconfig is present in the project root, to automatically disable the parts of the plugin that interfere.

Also you probably know this, but there is a feature in vim called exrc, which allows for project specific configurations. Although it is considered unsafe, there are a few plugins doing that in a safer way, like https://github.com/embear/vim-localvimrc .
My point is, creating your own standard for defining a subset of project local settings, is like editorconfig but without cross editor support and like localvimrc but only supporting a small subset of vim options. No offense intended.

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.