https://github.com/shobhit-nagpal/nvim-rafce
Neovim plugin to create RAFCE snippets
https://github.com/shobhit-nagpal/nvim-rafce
neovim neovim-plugin neovim-plugin-lua neovim-plugins
Last synced: 5 months ago
JSON representation
Neovim plugin to create RAFCE snippets
- Host: GitHub
- URL: https://github.com/shobhit-nagpal/nvim-rafce
- Owner: Shobhit-Nagpal
- Created: 2024-04-01T21:27:35.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-20T07:42:37.000Z (over 1 year ago)
- Last Synced: 2025-02-17T05:17:20.854Z (8 months ago)
- Topics: neovim, neovim-plugin, neovim-plugin-lua, neovim-plugins
- Language: Lua
- Homepage:
- Size: 303 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Nvim-Rafce
##### Write boilerplate React components with one command
[](http://www.lua.org)
[](https://neovim.io)
![]()
## TOC
- [Problem](#Problem)
- [Solution](#Solutions)
- [Installation](#Installation)
- [Commands](#Commands)
- [Socials](#Socials)## Problem
1. You left behind VSCode and installed Neovim and are new to learning Vim motions, remaps, plugins, etc. You saw either yourself or other people using the RAFCE snippet to create boilerplate React component code. You want to save time by having something similar for Neovim.
## Solution
1. The ability to write a command in Neovim and have boilerplate component code on the fly.
## Installation
Installation can be done in 2 ways:
### 1. Manually
Run the following commands to add nvim-rafce manually
1. Clone repository
```bash
git clone git@github.com:Shobhit-Nagpal/nvim-rafce.git
```2. Navigate to your neovim config directory
3. In your init.lua or if you have a after/plugin directory, create a file called rafce.lua and add the following lines:
```lua
vim.opt.runtimepath:append('/path/to/nvim-rafce')
local rafce = require('rafce')
```4. Source the file
```vim
:so
```### 2. Plugin manager
-- Lazy.nvim:
```lua
{'Shobhit-Nagpal/nvim-rafce',
config = function()
require('rafce')
end,
}
```-- Packer:
```lua
use 'Shobhit-Nagpal/nvim-rafce'
```-- Vim-plug:
```lua
Plug 'Shobhit-Nagpal/nvim-rafce'
```## Commands
There are 3 different commands to use depending on your needs:
**i.** Rafce (React functional component with arrow function and export at bottom)
```vim
:Rafce
``````jsx
import React from "react";const Component = () => {
returnComponent;
};export default Component;
```**ii.** Rfce (React functional component with export at bottom)
```vim
:Rfce
``````jsx
import React from "react";function Component() {
returnComponent;
}export default Component;
```**iii.** Rfc (React functional component)
```vim
:Rfc
``````jsx
import React from "react";export default function Component() {
returnComponent;
}
```## Socials
- [Twitter](https://twitter.com/shbhtngpl)