All Projects → Pocco81 → AbbrevMan.nvim

Pocco81 / AbbrevMan.nvim

Licence: GPL-3.0 license
🍍 A NeoVim plugin for managing vim abbreviations.

Programming Languages

lua
6591 projects
Vim Script
2826 projects

Projects that are alternatives of or similar to AbbrevMan.nvim

Vim Monokai Tasty
VIM Colour scheme
Stars: ✭ 279 (+240.24%)
Mutual labels:  vimrc, neovim-plugin
vimrc
⌨️ My opininonated config for vim
Stars: ✭ 49 (-40.24%)
Mutual labels:  vimrc
GodSpeed
Fast and intuitive manager for multiple reverse shells
Stars: ✭ 75 (-8.54%)
Mutual labels:  manager
Passky-Server
API and Database for Passky (password manager)
Stars: ✭ 77 (-6.1%)
Mutual labels:  manager
vim-config
My .vimrc config
Stars: ✭ 20 (-75.61%)
Mutual labels:  vimrc
Dotfiles
Well documented awesome dotfiles 😍 Many neovim lua configs, handy zsh/bash functions, fzf functions + more
Stars: ✭ 64 (-21.95%)
Mutual labels:  vimrc
dotfiles
shell, git, vim, tmux .etc dotfiles, managed via gnu stow
Stars: ✭ 20 (-75.61%)
Mutual labels:  vimrc
navigator.lua
Source code analysis & navigation plugin for Neovim. Navigate codes like a breeze🎐. Exploring LSP and 🌲Treesitter symbols a piece of 🍰. Take control like a boss 🦍.
Stars: ✭ 781 (+852.44%)
Mutual labels:  neovim-plugin
dotfiles
PJ's dotfiles - There are many like it but this one is mine
Stars: ✭ 24 (-70.73%)
Mutual labels:  vimrc
mysql-connection-pool-manager
This is a mySQL Connection Pool Manager wrapper powered by mysqljs/mysql and allows for intelligent management & load balancing mysql connection pools.
Stars: ✭ 15 (-81.71%)
Mutual labels:  manager
nvim-highlite
A colorscheme template that is "lite" on logic for the developer.
Stars: ✭ 163 (+98.78%)
Mutual labels:  neovim-plugin
vim-tips-wiki
1500+ tips downloaded from Vim Tips Wiki, parsed and formatted to look and work like native Vim help files
Stars: ✭ 56 (-31.71%)
Mutual labels:  neovim-plugin
Tasks
Simple tasks & notes manager written in PHP, jQuery and Bootstrap using a custom flat file database.
Stars: ✭ 102 (+24.39%)
Mutual labels:  manager
denops-docker.vim
Manage Docker in Vim/Neovim
Stars: ✭ 48 (-41.46%)
Mutual labels:  neovim-plugin
denops-gh.vim
Vim/Neovim plugin for GitHub
Stars: ✭ 27 (-67.07%)
Mutual labels:  neovim-plugin
vim-counterpoint
Cycle between file counterparts in vim or neovim.
Stars: ✭ 12 (-85.37%)
Mutual labels:  neovim-plugin
vimfiles
Just my personal little vimfiles
Stars: ✭ 21 (-74.39%)
Mutual labels:  vimrc
PASSY
This project has moved to GitLab.com
Stars: ✭ 14 (-82.93%)
Mutual labels:  manager
nvim-gomove
A complete plugin for moving and duplicating blocks and lines, with complete fold handling, reindenting, and undoing in one go.
Stars: ✭ 142 (+73.17%)
Mutual labels:  neovim-plugin
employeeManager
自己尝试写的一个简单的考勤管理系统,包含管理成员信息以及成员考勤,管理员审批的功能,采用SpringMVC+Hibernate4+Spring搭建
Stars: ✭ 40 (-51.22%)
Mutual labels:  manager

🍍 AbbrevMan.nvim

A NeoVim plugin that manages abbreviations for various natural and programming languages!

Repository's starts Issues License
Say thanks Latest commit GitHub repository size

Demo


TL;DR

AbbrevMan.nvim is a NeoVim plugin written in lua that ehances (n)vim's built-in abbreviations (`:h iab`) by giving users the possibility to manage different "dictionaries" for various natural (e.g. English, Spanish) and programming (e.g. Bash, Lua) languages; the idea is that the users will create their own dictionaries, however there are also some built-in ones that are worth checking out. It can be installed using your package manager of preference and it will work out of the box (the English dictionary enabled by default).

🌲 Table of Contents

🎁 Features

  • Users can create custom dictionaries.
  • Users can override and delete elements in the built-in dictionaries.
  • Has commands to load and unload dictionaries at any given time.
  • Can be set to load or not at startup.
  • Tab auto-completion for the commands.

📺 Notices

Checkout the CHANGELOG.md file for more information on the notices below:

📦 Installation

Prerequisites

Adding the plugin

You can use your favorite plugin manager for this. Here are some examples with the most popular ones:

Vim-plug

Plug 'Pocco81/AbbrevMan.nvim'

Packer.nvim

use "Pocco81/AbbrevMan.nvim"

Vundle

Plugin 'Pocco81/AbbrevMan.nvim'

NeoBundle

NeoBundleFetch 'Pocco81/AbbrevMan.nvim'

Setup (configuration)

As it's stated in the TL;DR, there are already some sane defaults that you may like, however you can change them to match your taste. These are the defaults:

load_natural_dictionaries_at_startup = true,
load_programming_dictionaries_at_startup = true,
natural_dictionaries = {
	["nt_en"] = {}
},
programming_dictionaries = {
	["pr_py"] = {}
}

The way you setup the settings on your config varies on whether you are using vimscript for this or Lua.

For init.lua

local abbrev_man = require("abbrev-man")

abbrev_man.setup({
	load_natural_dictionaries_at_startup = true,
	load_programming_dictionaries_at_startup = true,
	natural_dictionaries = {
		["nt_en"] = {}
	},
	programming_dictionaries = {
		["pr_py"] = {}
	}

})

For init.vim

lua << EOF
local abbrev_man = require("abbrev-man")

abbrev_man.setup({
	load_natural_dictionaries_at_startup = true,
	load_programming_dictionaries_at_startup = true,
	natural_dictionaries = {
		["nt_en"] = {}
	},
	programming_dictionaries = {
		["pr_py"] = {}
	}

})
EOF

For instructions on how to configure the plugin, check out the configuration section.

Updating

This depends on your plugin manager. If, for example, you are using Packer.nvim, you can update it with this command:

:PackerUpdate

🤖 Usage (commands)

All the commands follow the camel casing naming convention and have the AM (Abbreviation Manager) prefix so that it's easy to remember that they are part of the AbbrevMan.nvim plugin. These are all of them:

Default

  • :AMLoad <dictionary> Loads a dictionary. If <dictionary> hasn't been loaded, it will load it, otherwise it will show a message explaining the error.
  • :AMUnload <dictionary> Unloads a dictionary. If <dictionary> has been loaded, it will unload it, otherwise it will show a message explaining the error.

🐬 Configuration

Although the settings already have self-explanatory names, here is where you can find info about each one of them and their classifications!

General

These settings are unrelated to any group and are independent.

  • load_natural_dictionaries_at_startup: (Boolean) if true, it will load the dictionaries in the natural_dictionaries table at startup.
  • load_programming_dictionaries_at_startup: (Boolean) if true, it will load the dictionaries in the programming_dictionaries tables at startup.

Dictionaries

The following tables contain the dictionaries that you want to be enabled (either at startup or by loading them with :AMLoad <dictionary>). Although each table has its own "rules" (mentioned below), this is the general syntax that a dictionary must have:

["<prefix><name>"] = {
	["<abbreviation>"] = "<element>"
}
  • <prefix>: represents the group the dictionary belongs to. It can either be nt_ (if you put it in the natural_dictionaries tables) or pr_ (if you put it in the programming_dictionaries table).
  • <name>: the name you'd like to give to your dictionary.
  • <abbreviation>: the abbreviation itself.
  • <element>: what the abbreviation means (aka what will be put after you press space after the typing the abbreviation.)

Here is an example:

natural_dictionaries = {
	["nt_en"] = {
		["adn"] = "AND",
		["THe"] = "rm_am"
	},
	["nt_my_slangs"] {
		["lmao"] = "LMAO"
	}
},
programming_dictionaries = {
	["pr_py"] = {}
}

In this example, we are enabling the Python dictionary in the programming_dictionaries = {} table and we are enabling the English dictionary (nt_en) and custom one for slangs (nt_my_slangs) in the natural_dictionaries = {} table. In the English table we override the value of the adn (["adn"]), which is the auto-correction for mistyping the word and, and set it to auto-correct to AND. Here, we are also removing the value of THe from the auto-correction's list by setting it to "rm_am". Of course, it also added out custom dictionary (["nt_my_slangs"]).

AbbrevMan.nvim is not meant to be an spell checker or an auto-correction engine, it simply has some built-in in dictionaries that can be used for that purpose too. Again, that's not AbbrevMan's main purpose, but if you want to use it like that, feel free to do so.

Natural and Programming Dictionaries

  • Natural Dictionaries: The table natural_dictionaries = {} contains all the dictionaries for the various natural languages (e.g. English). The name of each dictionary must start with the prefix nt_, followed by the name of that dictionary.
  • Programming Dictionaries: The table programming_dictionaries = {} contains all the dictionaries for the various programming languages (e.g. JavaScript). The name of each dictionary must start with the prefix pr_, followed by the extension that a file written in that language has (e.g for Python files the extension is .py, so we put py here).

Supported Languages

These are the lists with all the currently supported languages (remember that the idea is for you to add your own):

Note: In the State column, working means that the dictionary has something and it's supported, while Supported means that AbbrevMan.nvim supports the dictionary but is under development, so it's better not to use it.

Natural Languages
Nat. Language Dict. Name State
English nt_en Working
Spanish nt_es Supported
Portuguese nt_pt Supported
Polish nt_pl Working
Programming Languages
Pro. Language Dict. Name State
Python pr_py Supported
Java pr_java Supported
Lua pr_lua Supported

🧻 Key-bindings

There are no default key-bindings. However, you can set them on your own as you'd normally do! Here is an example mapping <F3> to load the English dictionary while on normal:

For init.lua

vim.api.nvim_set_keymap(
    "n",
    "<F3>",
    "AMLoad nt_en<CR>",
    {
        noremap = true,
        silent = true
    }
)

For init.vim

nnoremap <silent> <f3> :AMLoad nt_en<CR>

🙋 FAQ

  • Q: "How can I view the doc from NeoVim?"
  • A: Use :help abbrev-man

🫂 Contribute

Pull Requests are welcomed as long as they are properly justified and there are no conflicts. If your PR has something to do with the README or in general related with the documentation, I'll gladly merge it! Also, when writing code for the project you must use the .editorconfig file on your editor so as to "maintain consistent coding styles". For instructions on how to use this file refer to EditorConfig's website.

Things I currently need help on:

💭 Inspirations

The following projects inspired the creation of AbbrevMan.nvim. If possible, go check them out to see why they are so amazing :]

📜 License

AbbrevMan.nvim is released under the GPL v3.0 license. It grants open-source permissions for users including:

  • The right to download and run the software freely
  • The right to make changes to the software as desired
  • The right to redistribute copies of the software
  • The right to modify and distribute copies of new versions of the software

For more convoluted language, see the LICENSE file.

📋 TO-DO

High Priority

  • Add more dictionaries!

Low Priority

  • Refactor most of the code responsible for loading the dictionaries.

Enjoy!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].