|
|
|
|
@ -1,89 +1,3 @@
|
|
|
|
|
--[[
|
|
|
|
|
|
|
|
|
|
=====================================================================
|
|
|
|
|
==================== 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
|
|
|
|
|
-- See `:help mapleader`
|
|
|
|
|
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
|
|
|
|
|
@ -91,7 +5,7 @@ vim.g.mapleader = ' '
|
|
|
|
|
vim.g.maplocalleader = ' '
|
|
|
|
|
|
|
|
|
|
-- 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 ]]
|
|
|
|
|
-- See `:help vim.opt`
|
|
|
|
|
@ -102,7 +16,7 @@ vim.g.have_nerd_font = false
|
|
|
|
|
vim.opt.number = true
|
|
|
|
|
-- You can also add relative line numbers, to help with jumping.
|
|
|
|
|
-- 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!
|
|
|
|
|
vim.opt.mouse = 'a'
|
|
|
|
|
@ -154,7 +68,7 @@ vim.opt.inccommand = 'split'
|
|
|
|
|
vim.opt.cursorline = true
|
|
|
|
|
|
|
|
|
|
-- Minimal number of screen lines to keep above and below the cursor.
|
|
|
|
|
vim.opt.scrolloff = 10
|
|
|
|
|
vim.opt.scrolloff = 25
|
|
|
|
|
|
|
|
|
|
-- [[ Basic Keymaps ]]
|
|
|
|
|
-- See `:help vim.keymap.set()`
|
|
|
|
|
@ -246,11 +160,12 @@ require('lazy').setup({
|
|
|
|
|
'lewis6991/gitsigns.nvim',
|
|
|
|
|
opts = {
|
|
|
|
|
signs = {
|
|
|
|
|
add = { text = '+' },
|
|
|
|
|
change = { text = '~' },
|
|
|
|
|
add = { text = '┃' },
|
|
|
|
|
change = { text = '┃' },
|
|
|
|
|
delete = { text = '_' },
|
|
|
|
|
topdelete = { text = '‾' },
|
|
|
|
|
changedelete = { text = '~' },
|
|
|
|
|
untracked = { text = '┆' },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
@ -317,7 +232,7 @@ require('lazy').setup({
|
|
|
|
|
spec = {
|
|
|
|
|
{ '<leader>c', group = '[C]ode', mode = { 'n', 'x' } },
|
|
|
|
|
{ '<leader>d', group = '[D]ocument' },
|
|
|
|
|
{ '<leader>r', group = '[R]ename' },
|
|
|
|
|
{ '<leader>r', group = '[R]un' },
|
|
|
|
|
{ '<leader>s', group = '[S]earch' },
|
|
|
|
|
{ '<leader>w', group = '[W]orkspace' },
|
|
|
|
|
{ '<leader>t', group = '[T]oggle' },
|
|
|
|
|
@ -355,7 +270,7 @@ require('lazy').setup({
|
|
|
|
|
{ 'nvim-telescope/telescope-ui-select.nvim' },
|
|
|
|
|
|
|
|
|
|
-- Useful for getting pretty icons, but requires a Nerd Font.
|
|
|
|
|
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
|
|
|
|
|
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.havedescnerd_font },
|
|
|
|
|
},
|
|
|
|
|
config = function()
|
|
|
|
|
-- Telescope is a fuzzy finder that comes with a lot of different things that
|
|
|
|
|
@ -538,7 +453,7 @@ require('lazy').setup({
|
|
|
|
|
|
|
|
|
|
-- 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')
|
|
|
|
|
map('<leader>cr', vim.lsp.buf.rename, '[C]ode [R]ename')
|
|
|
|
|
|
|
|
|
|
-- Execute a code action, usually your cursor needs to be on top of an error
|
|
|
|
|
-- or a suggestion from your LSP for this to activate.
|
|
|
|
|
@ -618,7 +533,20 @@ require('lazy').setup({
|
|
|
|
|
local servers = {
|
|
|
|
|
-- clangd = {},
|
|
|
|
|
-- gopls = {},
|
|
|
|
|
-- pyright = {},
|
|
|
|
|
pyright = {
|
|
|
|
|
settings = {
|
|
|
|
|
pyright = { autoImportCompletion = true },
|
|
|
|
|
python = {
|
|
|
|
|
analysis = {
|
|
|
|
|
autoSearchPaths = true,
|
|
|
|
|
diagnosticMode = 'openFilesOnly',
|
|
|
|
|
useLibraryCodeForTypes = true,
|
|
|
|
|
typeCheckingMode = 'off',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
jedi_language_server = {},
|
|
|
|
|
-- rust_analyzer = {},
|
|
|
|
|
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
|
|
|
|
--
|
|
|
|
|
@ -643,6 +571,8 @@ require('lazy').setup({
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
-- Zig
|
|
|
|
|
-- zls = {},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-- Ensure the servers and tools above are installed
|
|
|
|
|
@ -661,6 +591,10 @@ require('lazy').setup({
|
|
|
|
|
local ensure_installed = vim.tbl_keys(servers or {})
|
|
|
|
|
vim.list_extend(ensure_installed, {
|
|
|
|
|
'stylua', -- Used to format Lua code
|
|
|
|
|
'black', -- Used to format python code
|
|
|
|
|
'sonarlint-language-server', -- Helpful linting and diagnostics
|
|
|
|
|
'css-lsp', -- css
|
|
|
|
|
'emmet-language-server', -- emmet
|
|
|
|
|
})
|
|
|
|
|
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
|
|
|
|
|
|
|
|
|
@ -694,7 +628,7 @@ require('lazy').setup({
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
opts = {
|
|
|
|
|
notify_on_error = false,
|
|
|
|
|
notify_on_error = true,
|
|
|
|
|
format_on_save = function(bufnr)
|
|
|
|
|
-- Disable "format_on_save lsp_fallback" for languages that don't
|
|
|
|
|
-- have a well standardized coding style. You can add additional
|
|
|
|
|
@ -714,10 +648,20 @@ require('lazy').setup({
|
|
|
|
|
formatters_by_ft = {
|
|
|
|
|
lua = { 'stylua' },
|
|
|
|
|
-- Conform can also run multiple formatters sequentially
|
|
|
|
|
-- python = { "isort", "black" },
|
|
|
|
|
python = { 'isort', 'black' },
|
|
|
|
|
--
|
|
|
|
|
-- You can use 'stop_after_first' to run the first available formatter from the list
|
|
|
|
|
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
|
|
|
|
-- You can use a sub-list to tell conform to run *until* a formatter
|
|
|
|
|
-- is found.
|
|
|
|
|
javascript = { { 'prettierd', 'prettier' } },
|
|
|
|
|
javascriptreact = { { 'prettierd', 'prettier' } },
|
|
|
|
|
typescript = { { 'prettierd', 'prettier' } },
|
|
|
|
|
typescriptreact = { { 'prettierd', 'prettier' } },
|
|
|
|
|
css = { { 'prettierd', 'prettier' } },
|
|
|
|
|
scss = { { 'prettierd', 'prettier' } },
|
|
|
|
|
json = { { 'prettierd', 'prettier' } },
|
|
|
|
|
graphql = { { 'prettierd', 'prettier' } },
|
|
|
|
|
markdown = { { 'prettierd', 'prettier' } },
|
|
|
|
|
yaml = { { 'prettierd', 'prettier' } },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
@ -742,12 +686,12 @@ require('lazy').setup({
|
|
|
|
|
-- `friendly-snippets` contains a variety of premade snippets.
|
|
|
|
|
-- See the README about individual language/framework/plugin snippets:
|
|
|
|
|
-- https://github.com/rafamadriz/friendly-snippets
|
|
|
|
|
-- {
|
|
|
|
|
-- 'rafamadriz/friendly-snippets',
|
|
|
|
|
-- config = function()
|
|
|
|
|
-- require('luasnip.loaders.from_vscode').lazy_load()
|
|
|
|
|
-- end,
|
|
|
|
|
-- },
|
|
|
|
|
{
|
|
|
|
|
'rafamadriz/friendly-snippets',
|
|
|
|
|
config = function()
|
|
|
|
|
require('luasnip.loaders.from_vscode').lazy_load()
|
|
|
|
|
end,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
'saadparwaiz1/cmp_luasnip',
|
|
|
|
|
@ -757,6 +701,9 @@ require('lazy').setup({
|
|
|
|
|
-- into multiple repos for maintenance purposes.
|
|
|
|
|
'hrsh7th/cmp-nvim-lsp',
|
|
|
|
|
'hrsh7th/cmp-path',
|
|
|
|
|
'hrsh7th/cmp-buffer',
|
|
|
|
|
'hrsh7th/cmp-cmdline',
|
|
|
|
|
'hrsh7th/nvim-cmp',
|
|
|
|
|
},
|
|
|
|
|
config = function()
|
|
|
|
|
-- See `:help cmp`
|
|
|
|
|
@ -793,9 +740,9 @@ require('lazy').setup({
|
|
|
|
|
|
|
|
|
|
-- If you prefer more traditional completion keymaps,
|
|
|
|
|
-- you can uncomment the following lines
|
|
|
|
|
--['<CR>'] = cmp.mapping.confirm { select = true },
|
|
|
|
|
--['<Tab>'] = cmp.mapping.select_next_item(),
|
|
|
|
|
--['<S-Tab>'] = cmp.mapping.select_prev_item(),
|
|
|
|
|
['<CR>'] = cmp.mapping.confirm { select = true },
|
|
|
|
|
['<Tab>'] = cmp.mapping.select_next_item(),
|
|
|
|
|
['<S-Tab>'] = cmp.mapping.select_prev_item(),
|
|
|
|
|
|
|
|
|
|
-- Manually trigger a completion from nvim-cmp.
|
|
|
|
|
-- Generally you don't need this, because nvim-cmp will display
|
|
|
|
|
@ -931,23 +878,19 @@ require('lazy').setup({
|
|
|
|
|
-- Here are some example plugins that I've included in the Kickstart 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',
|
|
|
|
|
-- require 'kickstart.plugins.autopairs',
|
|
|
|
|
-- require 'kickstart.plugins.neo-tree',
|
|
|
|
|
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
|
|
|
|
require 'kickstart.plugins.debug',
|
|
|
|
|
require 'kickstart.plugins.indent_line',
|
|
|
|
|
require 'kickstart.plugins.lint',
|
|
|
|
|
require 'kickstart.plugins.autopairs',
|
|
|
|
|
require 'kickstart.plugins.neo-tree',
|
|
|
|
|
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`
|
|
|
|
|
-- 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.
|
|
|
|
|
-- { import = 'custom.plugins' },
|
|
|
|
|
--
|
|
|
|
|
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
|
|
|
|
|
-- Or use telescope!
|
|
|
|
|
-- In normal mode type `<space>sh` then write `lazy.nvim-plugin`
|
|
|
|
|
-- you can continue same window with `<space>sr` which resumes last telescope search
|
|
|
|
|
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
|
|
|
|
|
{ import = 'custom.plugins' },
|
|
|
|
|
}, {
|
|
|
|
|
ui = {
|
|
|
|
|
-- If you are using a Nerd Font: set icons to an empty table which will use the
|
|
|
|
|
|