https://github.com/956mb/ncks.nvim
Tiny utility plugin to append Discord nickname ideas to a file without having to leave Neovim
https://github.com/956mb/ncks.nvim
lua neovim neovim-plugin nicknames telescope textfile
Last synced: 2 months ago
JSON representation
Tiny utility plugin to append Discord nickname ideas to a file without having to leave Neovim
- Host: GitHub
- URL: https://github.com/956mb/ncks.nvim
- Owner: 956MB
- License: mit
- Created: 2024-04-20T09:06:42.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-20T09:11:14.000Z (about 1 year ago)
- Last Synced: 2024-04-20T10:26:57.661Z (about 1 year ago)
- Topics: lua, neovim, neovim-plugin, nicknames, telescope, textfile
- Language: Lua
- Homepage:
- Size: 640 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ncks.nvim
Adding random Discord nicknames to an endlessly expanding and rarely used text file... **WITHOUT LEAVING NEOVIM**!
This is my first [Neovim](https://github.com/neovim/neovim) plugin, and it's just a tiny little time saver utility I've been wanting for personal use, and I thought it'd be a simple starting point for learning plugin dev.

## Install
#### Requirements
- [Neovim](https://github.com/neovim/neovim) 0.7 or later
- [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) (optional, for the Telescope integration)[lazy.nvim:](https://github.com/folke/lazy.nvim)
```lua
{
"956MB/ncks.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
},
config = function()
require('ncks').setup {} -- requiredvim.keymap.set('n', 'nn', 'NcksNew', { desc = 'Add [N]ew [N]ickname' })
vim.keymap.set('n', 'ni', 'NcksInfo', { desc = 'Show [N]cks file [I]nfo' })
vim.keymap.set('n', 'ns', 'NcksSearch', { desc = 'Search [N]cks file' })
vim.keymap.set('n', 'no', 'NcksOpen', { desc = '[O]pen [N]cks file' })
vim.keymap.set('n', 'nl', 'NcksList', { desc = '[L]ist [N]cks files' })
vim.keymap.set('n', 'nc', 'NcksCopyAll', { desc = '[C]opy all [N]icknames from file to clipboard' })
vim.keymap.set('n', 'nr', 'NcksRandom', { desc = 'Pick [R]andom [N]ick from file' })
end
}
```## Commands
- `:NcksInfo`
- Displays various information on ncks file, like ***file location*** and ***entry count***.
- `:NcksSearch`
- Search nicknames and copy selection to clipboard
- `:NcksOpen`
- Opens ncks file in new buffer.
- `:NcksCopyAll`
- Copies all entries from ncks file to clipboard.
- `:NcksRandom`
- Picks random entry from ncks file, copies it to clipboard.
- `:NcksList`
- Returns all lines of ncks file in list.
- `:NcksNew` {optional_pass}
- Adds new name entry to your ncks file, by default opens dialog.
- `{optional_pass}` pass new entry to file inline, instead of opening the dialog.## Configuration
```lua
{
-- Default file ~/.ncks, but can use literally anything
location = '~/.ncks',
-- Telescope layout configuration
layout_config = {
prompt_position = 'top',
width = 0.50,
height = 0.20,
},
-- Default settings
telescope_defaults = {
include_location = true, -- Include file location in prompt title
selection_caret = '┃ ',
},
new_nickname = {
prompt_title = 'New Nickname',
prompt_prefix = ' ', -- Plus icon for adding new nickname
},
search = {
prompt_title = 'Search Nicknames',
prompt_prefix = ' ', -- Search icon for searching nicknames
},
}
```## Aknowledgements
Both [`ThePrimeagen/harpoon`](https://github.com/ThePrimeagen/harpoon/tree/harpoon2) and [`tamton-aquib/stuff.nvim`](https://github.com/tamton-aquib/stuff.nvim) served as inspiration and helped me build up the structure of this tiny plugin.
## TODO
- [ ] Multiple lists?
- [ ] More commands (delete, edit, etc):## License
[MIT license](./LICENSE)