Added a section on user commands
This commit is contained in:
parent
94a93643ab
commit
75940ccc48
16
init.lua
16
init.lua
|
@ -198,6 +198,16 @@ vim.api.nvim_create_autocmd('TextYankPost', {
|
||||||
end,
|
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 ]]
|
-- [[ Install `lazy.nvim` plugin manager ]]
|
||||||
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
|
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
|
||||||
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
||||||
|
@ -232,7 +242,7 @@ require('lazy').setup {
|
||||||
-- require('Comment').setup({})
|
-- require('Comment').setup({})
|
||||||
|
|
||||||
-- "gc" to comment visual regions/lines
|
-- "gc" to comment visual regions/lines
|
||||||
{ 'numToStr/Comment.nvim', opts = {} },
|
{ 'numToStr/Comment.nvim', opts = {} },
|
||||||
|
|
||||||
-- Here is a more advanced example where we pass configuration
|
-- Here is a more advanced example where we pass configuration
|
||||||
-- options to `gitsigns.nvim`. This is equivalent to the following lua:
|
-- options to `gitsigns.nvim`. This is equivalent to the following lua:
|
||||||
|
@ -267,7 +277,7 @@ require('lazy').setup {
|
||||||
-- after the plugin has been loaded:
|
-- after the plugin has been loaded:
|
||||||
-- config = function() ... end
|
-- config = function() ... end
|
||||||
|
|
||||||
{ -- Useful plugin to show you pending keybinds.
|
{ -- Useful plugin to show you pending keybinds.
|
||||||
'folke/which-key.nvim',
|
'folke/which-key.nvim',
|
||||||
event = 'VeryLazy', -- Sets the loading event to 'VeryLazy'
|
event = 'VeryLazy', -- Sets the loading event to 'VeryLazy'
|
||||||
config = function() -- This is the function that runs, AFTER loading
|
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`
|
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`
|
||||||
'folke/tokyonight.nvim',
|
'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
|
priority = 1000, -- make sure to load this before all the other start plugins
|
||||||
config = function()
|
config = function()
|
||||||
-- Load the colorscheme here
|
-- Load the colorscheme here
|
||||||
|
|
Loading…
Reference in New Issue