Added a section on user commands

This commit is contained in:
Topy 2024-03-02 10:28:58 +01:00
parent 94a93643ab
commit 75940ccc48
1 changed files with 13 additions and 3 deletions

View File

@ -198,6 +198,16 @@ vim.api.nvim_create_autocmd('TextYankPost', {
end,
})
-- [[ Basic user commands ]]
-- See `:help lua-guide-commands-create`
-- Quickly jump to your config with this awesome custom command
-- Try it by starting nvim in a random directory and typing :Config
vim.api.nvim_create_user_command("Config", function()
local path = "~/.config/nvim/" -- You can customize the path here
vim.cmd("e" .. path) -- vim.cmd allows you to execute vim commands from lua
end, {})
-- [[ Install `lazy.nvim` plugin manager ]]
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
@ -232,7 +242,7 @@ require('lazy').setup {
-- require('Comment').setup({})
-- "gc" to comment visual regions/lines
{ 'numToStr/Comment.nvim', opts = {} },
{ 'numToStr/Comment.nvim', opts = {} },
-- Here is a more advanced example where we pass configuration
-- options to `gitsigns.nvim`. This is equivalent to the following lua:
@ -267,7 +277,7 @@ require('lazy').setup {
-- after the plugin has been loaded:
-- config = function() ... end
{ -- Useful plugin to show you pending keybinds.
{ -- Useful plugin to show you pending keybinds.
'folke/which-key.nvim',
event = 'VeryLazy', -- Sets the loading event to 'VeryLazy'
config = function() -- This is the function that runs, AFTER loading
@ -722,7 +732,7 @@ require('lazy').setup {
--
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`
'folke/tokyonight.nvim',
lazy = false, -- make sure we load this during startup if it is your main colorscheme
lazy = false, -- make sure we load this during startup if it is your main colorscheme
priority = 1000, -- make sure to load this before all the other start plugins
config = function()
-- Load the colorscheme here