Created
December 16, 2025 15:01
-
-
Save SalahEddineGhamri/1d48b48c5dadfed628284bbf6ea8264f to your computer and use it in GitHub Desktop.
How to create a custom command in neovim
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Define your function | |
| local function my_function() | |
| print("Hello from my function!") | |
| -- Your code here | |
| end | |
| -- Create a user command | |
| vim.api.nvim_create_user_command('MyCommand', my_function, {}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment