@ -29,7 +29,7 @@ What is Kickstart?
what your configuration is doing , and modify it to suit your needs .
Once you ' ve done that, you can start exploring, configuring and tinkering to
make Neovim your own ! That might mean leaving k ickstart just the way it is for a while
make Neovim your own ! That might mean leaving K ickstart just the way it is for a while
or immediately breaking it into modular pieces . It ' s up to you!
If you don ' t know anything about Lua, I recommend taking some time to read through
@ -51,32 +51,32 @@ Kickstart Guide:
- Tutor
- < enter key >
( If you already know how the Neovim basics , you can skip this step )
( If you already know the Neovim basics , you can skip this step . )
Once you ' ve completed that, you can continue working through **AND READING** the rest
of the kickstart init.lua
of the kickstart init.lua .
Next , run AND READ ` : help ` .
This will open up a help window with some basic information
about reading , navigating and searching the builtin help documentation .
This should be the first place you go to look when you ' re stuck or confused
with something . It ' s one of my favorite n eovim features.
with something . It ' s one of my favorite N eovim features.
MOST IMPORTANTLY , we provide a keymap " <space>sh " to [ s ] earch the [ h ] elp documentation ,
which is very useful when you ' re not sure exactly what you' re looking for .
which is very useful when you ' re not exactly sure of what you' re looking for .
I have left several ` : help X ` comments throughout the init.lua
These are hints about where to find more information about the relevant settings ,
plugins or neovim features used in k ickstart.
plugins or Neovim features used in K ickstart.
NOTE : Look for lines like this
Throughout the file . These are for you , the reader , to help understand what is happening .
Throughout the file . These are for you , the reader , to help you understand what is happening .
Feel free to delete them once you know what you ' re doing, but they should serve as a guide
for when you are first encountering a few different constructs in your n vim config .
for when you are first encountering a few different constructs in your Neo vim config .
If you experience any errors while trying to install kickstart , run ` : checkhealth ` for more info
If you experience any errors while trying to install kickstart , run ` : checkhealth ` for more info .
I hope you enjoy your Neovim journey ,
- TJ
@ -98,13 +98,12 @@ vim.g.have_nerd_font = false
-- Make line numbers default
-- vim.opt.number = true
-- You can also add relative line numbers, for help with jumping.
-- Experiment for yourself to see if you like it!
vim.opt . relativenumber = true
-- Enable mouse mode, can be useful for resizing splits for example!
vim.opt . mouse = ' a '
-- Don't show the mode, since it's already in status line
-- Don't show the mode, since it's already in the status line
vim.opt . showmode = false
-- Sync clipboard between OS and Neovim.
@ -118,7 +117,7 @@ vim.opt.breakindent = true
-- Save undo history
vim.opt . undofile = true
-- Case-insensitive searching UNLESS \C or capital in search
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
vim.opt . ignorecase = true
vim.opt . smartcase = true
@ -136,7 +135,7 @@ vim.opt.timeoutlen = 300
vim.opt . splitright = true
vim.opt . splitbelow = true
-- Sets how neovim will display certain whitespace in the editor.
-- Sets how neovim will display certain whitespace characters in the editor.
-- See `:help 'list'`
-- and `:help 'listchars'`
vim.opt . list = true
@ -217,7 +216,7 @@ vim.opt.rtp:prepend(lazypath)
--
-- You can press `?` in this menu for help. Use `:q` to close the window
--
-- To update plugins , you can run
-- To update plugins you can run
-- :Lazy update
--
-- NOTE: Here is where you install your plugins.
@ -241,7 +240,7 @@ require('lazy').setup({
{ ' nvim-neotest/nvim-nio ' } ,
-- Here is a more advanced example where we pass configuration
-- options to `gitsigns.nvim`. This is equivalent to the following l ua:
-- options to `gitsigns.nvim`. This is equivalent to the following L ua:
-- require('gitsigns').setup({ ... })
--
-- See `:help gitsigns` to understand what the configuration keys do
@ -258,7 +257,7 @@ require('lazy').setup({
} ,
} ,
-- NOTE: Plugins can also be configured to run l ua code when they are loaded.
-- NOTE: Plugins can also be configured to run L ua code when they are loaded.
--
-- This is often very useful to both group configuration, as well as handle
-- lazy loading plugins that don't need to be loaded immediately at startup.
@ -303,7 +302,7 @@ require('lazy').setup({
branch = ' 0.1.x ' ,
dependencies = {
' nvim-lua/plenary.nvim ' ,
{ -- If encountering errors, see telescope-fzf-native README for install instructions
{ -- If encountering errors, see telescope-fzf-native README for install ation instructions
' nvim-telescope/telescope-fzf-native.nvim ' ,
-- `build` is used to run some command when the plugin is installed/updated.
@ -326,19 +325,19 @@ require('lazy').setup({
-- it can fuzzy find! It's more than just a "file finder", it can search
-- many different aspects of Neovim, your workspace, LSP, and more!
--
-- The easiest way to use t elescope, is to start by doing something like:
-- The easiest way to use T elescope, is to start by doing something like:
-- :Telescope help_tags
--
-- After running this command, a window will open up and you're able to
-- type in the prompt window. You'll see a list of help_tags options and
-- type in the prompt window. You'll see a list of ` help_tags` options and
-- a corresponding preview of the help.
--
-- Two important keymaps to use while in t elescope are:
-- Two important keymaps to use while in T elescope are:
-- - Insert mode: <c-/>
-- - Normal mode: ?
--
-- This opens a window that shows you all of the keymaps for the current
-- t elescope picker. This is really useful to discover what Telescope can
-- T elescope picker. This is really useful to discover what Telescope can
-- do as well as how to actually do it!
-- [[ Configure Telescope ]]
@ -360,7 +359,7 @@ require('lazy').setup({
} ,
}
-- Enable telescope extensions, if they are installed
-- Enable Telescope extensions if they are installed
pcall ( require ( ' telescope ' ) . load_extension , ' fzf ' )
pcall ( require ( ' telescope ' ) . load_extension , ' ui-select ' )
@ -379,14 +378,14 @@ require('lazy').setup({
-- Slightly advanced example of overriding default behavior and theme
vim.keymap . set ( ' n ' , ' <leader>/ ' , function ( )
-- You can pass additional configuration to telescope to chang e theme, layout, etc.
-- You can pass additional configuration to Telescope to change th e theme, layout, etc.
builtin.current_buffer_fuzzy_find ( require ( ' telescope.themes ' ) . get_dropdown {
winblend = 10 ,
previewer = false ,
} )
end , { desc = ' [/] Fuzzily search in current buffer ' } )
-- A lso possible to pass additional configuration options.
-- It's a lso possible to pass additional configuration options.
-- See `:help telescope.builtin.live_grep()` for information about particular keys
vim.keymap . set ( ' n ' , ' <leader>s/ ' , function ( )
builtin.live_grep {
@ -395,7 +394,7 @@ require('lazy').setup({
}
end , { desc = ' [S]earch [/] in Open Files ' } )
-- Shortcut for searching your n eovim configuration files
-- Shortcut for searching your N eovim configuration files
vim.keymap . set ( ' n ' , ' <leader>sn ' , function ( )
builtin.find_files { cwd = vim.fn . stdpath ' config ' }
end , { desc = ' [S]earch [N]eovim files ' } )
@ -405,7 +404,7 @@ require('lazy').setup({
{ -- LSP Configuration & Plugins
' neovim/nvim-lspconfig ' ,
dependencies = {
-- Automatically install LSPs and related tools to stdpath for n eovim
-- Automatically install LSPs and related tools to stdpath for N eovim
' williamboman/mason.nvim ' ,
' williamboman/mason-lspconfig.nvim ' ,
' WhoIsSethDaniel/mason-tool-installer.nvim ' ,
@ -419,15 +418,15 @@ require('lazy').setup({
{ ' folke/neodev.nvim ' , opts = { } } ,
} ,
config = function ( )
-- Brief A side: **What is LSP?**
-- Brief a side: **What is LSP?**
--
-- LSP is an acrony m you've probably heard, but might not understand what it is.
-- LSP is an initialis m you've probably heard, but might not understand what it is.
--
-- LSP stands for Language Server Protocol. It's a protocol that helps editors
-- and language tooling communicate in a standardized fashion.
--
-- In general, you have a "server" which is some tool built to understand a particular
-- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc ). These Language Servers
-- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc . ). These Language Servers
-- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone
-- processes that communicate with some "client" - in this case, Neovim!
--
@ -451,9 +450,8 @@ require('lazy').setup({
vim.api . nvim_create_autocmd ( ' LspAttach ' , {
group = vim.api . nvim_create_augroup ( ' kickstart-lsp-attach ' , { clear = true } ) ,
callback = function ( event )
-- NOTE: Remember that lua is a real programming language, and as such it is possible
-- to define small helper and utility functions so you don't have to repeat yourself
-- many times.
-- NOTE: Remember that Lua is a real programming language, and as such it is possible
-- to define small helper and utility functions so you don't have to repeat yourself.
--
-- In this case, we create a function that lets us more easily define mappings specific
-- for LSP related items. It sets the mode, buffer and description for us each time.
@ -482,11 +480,11 @@ require('lazy').setup({
-- Symbols are things like variables, functions, types, etc.
map ( ' <leader>ds ' , require ( ' telescope.builtin ' ) . lsp_document_symbols , ' [D]ocument [S]ymbols ' )
-- Fuzzy find all the symbols in your current workspace
-- Similar to document symbols, except searches over your whol e project.
-- Fuzzy find all the symbols in your current workspace .
-- Similar to document symbols, except searches over your entir e project.
map ( ' <leader>ws ' , require ( ' telescope.builtin ' ) . lsp_dynamic_workspace_symbols , ' [W]orkspace [S]ymbols ' )
-- Rename the variable under your cursor
-- Rename the variable under your cursor .
-- Most Language Servers support renaming across files, etc.
map ( ' <leader>rn ' , vim.lsp . buf.rename , ' [R]e[n]ame ' )
@ -495,11 +493,11 @@ require('lazy').setup({
map ( ' <leader>ca ' , vim.lsp . buf.code_action , ' [C]ode [A]ction ' )
-- Opens a popup that displays documentation about the word under your cursor
-- See `:help K` for why this keymap
-- See `:help K` for why this keymap .
map ( ' K ' , vim.lsp . buf.hover , ' Hover Documentation ' )
-- WARN: This is not Goto Definition, this is Goto Declaration.
-- For example, in C this would take you to the header
-- For example, in C this would take you to the header .
map ( ' gD ' , vim.lsp . buf.declaration , ' [G]oto [D]eclaration ' )
-- The following two autocommands are used to highlight references of the
@ -523,7 +521,7 @@ require('lazy').setup({
} )
-- LSP servers and clients are able to communicate to each other what features they support.
-- By default, Neovim doesn't support everything that is in the LSP S pecification.
-- By default, Neovim doesn't support everything that is in the LSP s pecification.
-- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities.
-- So, we create new capabilities with nvim cmp, and then broadcast that to the servers.
local capabilities = vim.lsp . protocol.make_client_capabilities ( )
@ -554,7 +552,7 @@ require('lazy').setup({
lua_ls = {
-- cmd = {...},
-- filetypes { ...},
-- filetypes = { ...},
-- capabilities = {},
settings = {
Lua = {
@ -573,14 +571,14 @@ require('lazy').setup({
-- other tools, you can run
-- :Mason
--
-- You can press `g?` for help in this menu
-- You can press `g?` for help in this menu .
require ( ' mason ' ) . setup ( )
-- You can add other tools here that you want Mason to install
-- for you, so that they are available from within Neovim.
local ensure_installed = vim.tbl_keys ( servers or { } )
vim.list_extend ( ensure_installed , {
' stylua ' , -- Used to format l ua code
' stylua ' , -- Used to format L ua code
} )
require ( ' mason-tool-installer ' ) . setup { ensure_installed = ensure_installed }
@ -633,9 +631,9 @@ require('lazy').setup({
{
' L3MON4D3/LuaSnip ' ,
build = ( function ( )
-- Build Step is needed for regex support in snippets
-- This step is not supported in many windows environments
-- Remove the below condition to re-enable on windows
-- Build Step is needed for regex support in snippets .
-- This step is not supported in many windows environments .
-- Remove the below condition to re-enable on windows .
if vim.fn . has ' win32 ' == 1 or vim.fn . executable ' make ' == 0 then
return
end
@ -685,7 +683,7 @@ require('lazy').setup({
-- Select the [p]revious item
[ ' <C-p> ' ] = cmp.mapping . select_prev_item ( ) ,
-- s croll the documentation window [b]ack / [f]orward
-- S croll the documentation window [b]ack / [f]orward
[ ' <C-b> ' ] = cmp.mapping . scroll_docs ( - 4 ) ,
[ ' <C-f> ' ] = cmp.mapping . scroll_docs ( 4 ) ,
@ -718,7 +716,7 @@ require('lazy').setup({
end
end , { ' i ' , ' s ' } ) ,
-- For more advanced l uasnip keymaps (e.g. selecting choice nodes, expansion) see:
-- For more advanced L uasnip keymaps (e.g. selecting choice nodes, expansion) see:
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
} ,
sources = {
@ -732,18 +730,18 @@ require('lazy').setup({
{ -- You can easily change to a different colorscheme.
-- Change the name of the colorscheme plugin below, and then
-- change the command in the config to whatever the name of that colorscheme is
-- change the command in the config to whatever the name of that colorscheme is .
--
-- 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 ' ,
priority = 1000 , -- m ake sure to load this before all the other start plugins
priority = 1000 , -- M ake sure to load this before all the other start plugins.
init = function ( )
-- Load the colorscheme here.
-- Like many other themes, this one has different styles, and you could load
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
vim.cmd . colorscheme ' tokyonight-night '
-- You can configure highlights by doing something like
-- You can configure highlights by doing something like :
vim.cmd . hi ' Comment gui=none '
end ,
} ,
@ -788,12 +786,11 @@ require('lazy').setup({
-- Check out: https://github.com/echasnovski/mini.nvim
end ,
} ,
{ -- Highlight, edit, and navigate code
' nvim-treesitter/nvim-treesitter ' ,
build = ' :TSUpdate ' ,
opts = {
ensure_installed = { ' bash ' , ' c ' , ' html ' , ' lua ' , ' markdown' , ' vim ' , ' vimdoc ' } ,
ensure_installed = { ' bash ' , ' c ' , ' html ' , ' lua ' , ' luadoc' , ' markdown' , ' vim ' , ' vimdoc ' } ,
-- Autoinstall languages that are not installed
auto_install = true ,
highlight = {
@ -833,15 +830,16 @@ require('lazy').setup({
-- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the
-- init.lua. If you want these files, they are in the repository, so you can just download them and
-- p ut them in the right spots if you want .
-- p lace them in the correct locations .
-- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for k ickstart
-- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for K ickstart
--
-- Here are some example plugins that I've included in the k ickstart repository.
-- Here are some example plugins that I've included in the K ickstart repository.
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
--
require ' kickstart.plugins.debug ' ,
require ' kickstart.plugins.indent_line ' ,
require ' kickstart.plugins.lint ' ,
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
-- This is the easiest way to modularize your config.
@ -851,8 +849,8 @@ require('lazy').setup({
-- { import = 'custom.plugins' },
} , {
ui = {
-- If you have a Nerd Font, set icons to an empty table which will use the
-- default lazy.nvim defined Nerd Font icons otherwise define a unicode icons table
-- If you are using a Nerd Font: set icons to an empty table which will use the
-- default lazy.nvim defined Nerd Font icons , otherwise define a unicode icons table
icons = vim.g . have_nerd_font and { } or {
cmd = ' ⌘ ' ,
config = ' 🛠 ' ,