|
|
@ -1,97 +1,13 @@
|
|
|
|
--[[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
=====================================================================
|
|
|
|
|
|
|
|
==================== READ THIS BEFORE CONTINUING ====================
|
|
|
|
|
|
|
|
=====================================================================
|
|
|
|
|
|
|
|
======== .-----. ========
|
|
|
|
|
|
|
|
======== .----------------------. | === | ========
|
|
|
|
|
|
|
|
======== |.-""""""""""""""""""-.| |-----| ========
|
|
|
|
|
|
|
|
======== || || | === | ========
|
|
|
|
|
|
|
|
======== || KICKSTART.NVIM || |-----| ========
|
|
|
|
|
|
|
|
======== || || | === | ========
|
|
|
|
|
|
|
|
======== || || |-----| ========
|
|
|
|
|
|
|
|
======== ||:Tutor || |:::::| ========
|
|
|
|
|
|
|
|
======== |'-..................-'| |____o| ========
|
|
|
|
|
|
|
|
======== `"")----------------(""` ___________ ========
|
|
|
|
|
|
|
|
======== /::::::::::| |::::::::::\ \ no mouse \ ========
|
|
|
|
|
|
|
|
======== /:::========| |==hjkl==:::\ \ required \ ========
|
|
|
|
|
|
|
|
======== '""""""""""""' '""""""""""""' '""""""""""' ========
|
|
|
|
|
|
|
|
======== ========
|
|
|
|
|
|
|
|
=====================================================================
|
|
|
|
|
|
|
|
=====================================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
What is Kickstart?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Kickstart.nvim is *not* a distribution.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Kickstart.nvim is a starting point for your own configuration.
|
|
|
|
|
|
|
|
The goal is that you can read every line of code, top-to-bottom, understand
|
|
|
|
|
|
|
|
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 Kickstart 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
|
|
|
|
|
|
|
|
a guide. One possible example which will only take 10-15 minutes:
|
|
|
|
|
|
|
|
- https://learnxinyminutes.com/docs/lua/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
After understanding a bit more about Lua, you can use `:help lua-guide` as a
|
|
|
|
|
|
|
|
reference for how Neovim integrates Lua.
|
|
|
|
|
|
|
|
- :help lua-guide
|
|
|
|
|
|
|
|
- (or HTML version): https://neovim.io/doc/user/lua-guide.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Kickstart Guide:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TODO: The very first thing you should do is to run the command `:Tutor` in Neovim.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If you don't know what this means, type the following:
|
|
|
|
|
|
|
|
- <escape key>
|
|
|
|
|
|
|
|
- :
|
|
|
|
|
|
|
|
- Tutor
|
|
|
|
|
|
|
|
- <enter key>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 Neovim features.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MOST IMPORTANTLY, we provide a keymap "<space>sh" to [s]earch the [h]elp documentation,
|
|
|
|
|
|
|
|
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 Kickstart.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NOTE: Look for lines like this
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 Neovim config.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If you experience any errors while trying to install kickstart, run `:checkhealth` for more info.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
I hope you enjoy your Neovim journey,
|
|
|
|
|
|
|
|
- TJ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
P.S. You can delete this when you're done too. It's your config now! :)
|
|
|
|
|
|
|
|
--]]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Set <space> as the leader key
|
|
|
|
-- Set <space> as the leader key
|
|
|
|
-- See `:help mapleader`
|
|
|
|
-- See `:help mapleader`
|
|
|
|
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
|
|
|
|
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
|
|
|
|
vim.g.mapleader = ' '
|
|
|
|
vim.g.mapleader = ' '
|
|
|
|
vim.g.maplocalleader = ' '
|
|
|
|
vim.g.maplocalleader = ' '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
require 'custom'
|
|
|
|
|
|
|
|
|
|
|
|
-- Set to true if you have a Nerd Font installed and selected in the terminal
|
|
|
|
-- Set to true if you have a Nerd Font installed and selected in the terminal
|
|
|
|
vim.g.have_nerd_font = false
|
|
|
|
vim.g.have_nerd_font = true
|
|
|
|
|
|
|
|
|
|
|
|
-- [[ Setting options ]]
|
|
|
|
-- [[ Setting options ]]
|
|
|
|
-- See `:help vim.opt`
|
|
|
|
-- See `:help vim.opt`
|
|
|
@ -102,7 +18,7 @@ vim.g.have_nerd_font = false
|
|
|
|
vim.opt.number = true
|
|
|
|
vim.opt.number = true
|
|
|
|
-- You can also add relative line numbers, to help with jumping.
|
|
|
|
-- You can also add relative line numbers, to help with jumping.
|
|
|
|
-- Experiment for yourself to see if you like it!
|
|
|
|
-- Experiment for yourself to see if you like it!
|
|
|
|
-- vim.opt.relativenumber = true
|
|
|
|
vim.opt.relativenumber = true
|
|
|
|
|
|
|
|
|
|
|
|
-- Enable mouse mode, can be useful for resizing splits for example!
|
|
|
|
-- Enable mouse mode, can be useful for resizing splits for example!
|
|
|
|
vim.opt.mouse = 'a'
|
|
|
|
vim.opt.mouse = 'a'
|
|
|
@ -238,7 +154,20 @@ 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',
|
|
|
|
|
|
|
|
config = function()
|
|
|
|
|
|
|
|
require('Comment').setup()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local api = require 'Comment.api'
|
|
|
|
|
|
|
|
local esc = vim.api.nvim_replace_termcodes('<ESC>', true, false, true)
|
|
|
|
|
|
|
|
vim.keymap.set('n', '<leader>/', api.toggle.linewise.current)
|
|
|
|
|
|
|
|
vim.keymap.set('v', '<leader>/', function()
|
|
|
|
|
|
|
|
vim.api.nvim_feedkeys(esc, 'nx', false)
|
|
|
|
|
|
|
|
api.toggle.linewise(vim.fn.visualmode())
|
|
|
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
-- 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:
|
|
|
@ -384,13 +313,13 @@ require('lazy').setup({
|
|
|
|
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
|
|
|
|
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
|
|
|
|
|
|
|
|
|
|
|
|
-- Slightly advanced example of overriding default behavior and theme
|
|
|
|
-- Slightly advanced example of overriding default behavior and theme
|
|
|
|
vim.keymap.set('n', '<leader>/', function()
|
|
|
|
vim.keymap.set('n', '<leader>sb', function()
|
|
|
|
-- You can pass additional configuration to Telescope to change the theme, layout, etc.
|
|
|
|
-- You can pass additional configuration to Telescope to change the theme, layout, etc.
|
|
|
|
builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
|
|
|
|
builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
|
|
|
|
winblend = 10,
|
|
|
|
winblend = 10,
|
|
|
|
previewer = false,
|
|
|
|
previewer = false,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
end, { desc = '[/] Fuzzily search in current buffer' })
|
|
|
|
end, { desc = 'Fuzzily [S]earch in current [B]uffer' })
|
|
|
|
|
|
|
|
|
|
|
|
-- It's also possible to pass additional configuration options.
|
|
|
|
-- It's also possible to pass additional configuration options.
|
|
|
|
-- See `:help telescope.builtin.live_grep()` for information about particular keys
|
|
|
|
-- See `:help telescope.builtin.live_grep()` for information about particular keys
|
|
|
@ -555,7 +484,7 @@ require('lazy').setup({
|
|
|
|
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
|
|
|
|
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
|
|
|
|
local servers = {
|
|
|
|
local servers = {
|
|
|
|
-- clangd = {},
|
|
|
|
-- clangd = {},
|
|
|
|
-- gopls = {},
|
|
|
|
gopls = {},
|
|
|
|
-- pyright = {},
|
|
|
|
-- pyright = {},
|
|
|
|
-- rust_analyzer = {},
|
|
|
|
-- rust_analyzer = {},
|
|
|
|
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
|
|
|
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
|
|
@ -641,6 +570,7 @@ require('lazy').setup({
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
formatters_by_ft = {
|
|
|
|
formatters_by_ft = {
|
|
|
|
lua = { 'stylua' },
|
|
|
|
lua = { 'stylua' },
|
|
|
|
|
|
|
|
go = { 'gofmt', 'goimports' },
|
|
|
|
-- Conform can also run multiple formatters sequentially
|
|
|
|
-- Conform can also run multiple formatters sequentially
|
|
|
|
-- python = { "isort", "black" },
|
|
|
|
-- python = { "isort", "black" },
|
|
|
|
--
|
|
|
|
--
|
|
|
@ -718,7 +648,8 @@ require('lazy').setup({
|
|
|
|
-- Accept ([y]es) the completion.
|
|
|
|
-- Accept ([y]es) the completion.
|
|
|
|
-- This will auto-import if your LSP supports it.
|
|
|
|
-- This will auto-import if your LSP supports it.
|
|
|
|
-- This will expand snippets if the LSP sent a snippet.
|
|
|
|
-- This will expand snippets if the LSP sent a snippet.
|
|
|
|
['<C-y>'] = cmp.mapping.confirm { select = true },
|
|
|
|
-- ['<C-y>'] = cmp.mapping.confirm { select = true },
|
|
|
|
|
|
|
|
['<Enter>'] = cmp.mapping.confirm { select = true },
|
|
|
|
|
|
|
|
|
|
|
|
-- Manually trigger a completion from nvim-cmp.
|
|
|
|
-- Manually trigger a completion from nvim-cmp.
|
|
|
|
-- Generally you don't need this, because nvim-cmp will display
|
|
|
|
-- Generally you don't need this, because nvim-cmp will display
|
|
|
@ -859,16 +790,16 @@ require('lazy').setup({
|
|
|
|
-- require 'kickstart.plugins.debug',
|
|
|
|
-- require 'kickstart.plugins.debug',
|
|
|
|
-- require 'kickstart.plugins.indent_line',
|
|
|
|
-- require 'kickstart.plugins.indent_line',
|
|
|
|
-- require 'kickstart.plugins.lint',
|
|
|
|
-- require 'kickstart.plugins.lint',
|
|
|
|
-- require 'kickstart.plugins.autopairs',
|
|
|
|
require 'kickstart.plugins.autopairs',
|
|
|
|
-- require 'kickstart.plugins.neo-tree',
|
|
|
|
require 'kickstart.plugins.neo-tree',
|
|
|
|
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
|
|
|
require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
|
|
|
|
|
|
|
|
|
|
|
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
|
|
|
-- 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.
|
|
|
|
-- This is the easiest way to modularize your config.
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
|
|
|
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
|
|
|
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
|
|
|
|
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
|
|
|
|
-- { import = 'custom.plugins' },
|
|
|
|
{ import = 'custom.plugins' },
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
|
ui = {
|
|
|
|
ui = {
|
|
|
|
-- If you are using a Nerd Font: set icons to an empty table which will use the
|
|
|
|
-- If you are using a Nerd Font: set icons to an empty table which will use the
|
|
|
|