1- --[[
2-
3- =====================================================================
4- ==================== READ THIS BEFORE CONTINUING ====================
5- =====================================================================
6- ======== .-----. ========
7- ======== .----------------------. | === | ========
8- ======== |.-""""""""""""""""""-.| |-----| ========
9- ======== || || | === | ========
10- ======== || KICKSTART.NVIM || |-----| ========
11- ======== || || | === | ========
12- ======== || || |-----| ========
13- ======== ||:Tutor || |:::::| ========
14- ======== |'-..................-'| |____o| ========
15- ======== `"")----------------(""` ___________ ========
16- ======== /::::::::::| |::::::::::\ \ no mouse \ ========
17- ======== /:::========| |==hjkl==:::\ \ required \ ========
18- ======== '""""""""""""' '""""""""""""' '""""""""""' ========
19- ======== ========
20- =====================================================================
21- =====================================================================
22-
23- What is Kickstart?
24-
25- Kickstart.nvim is *not* a distribution.
26-
27- Kickstart.nvim is a starting point for your own configuration.
28- The goal is that you can read every line of code, top-to-bottom, understand
29- what your configuration is doing, and modify it to suit your needs.
30-
31- Once you've done that, you can start exploring, configuring and tinkering to
32- make Neovim your own! That might mean leaving Kickstart just the way it is for a while
33- or immediately breaking it into modular pieces. It's up to you!
34-
35- If you don't know anything about Lua, I recommend taking some time to read through
36- a guide. One possible example which will only take 10-15 minutes:
37- - https://learnxinyminutes.com/docs/lua/
38-
39- After understanding a bit more about Lua, you can use `:help lua-guide` as a
40- reference for how Neovim integrates Lua.
41- - :help lua-guide
42- - (or HTML version): https://neovim.io/doc/user/lua-guide.html
43-
44- Kickstart Guide:
45-
46- TODO: The very first thing you should do is to run the command `:Tutor` in Neovim.
47-
48- If you don't know what this means, type the following:
49- - <escape key>
50- - :
51- - Tutor
52- - <enter key>
53-
54- (If you already know the Neovim basics, you can skip this step.)
55-
56- Once you've completed that, you can continue working through **AND READING** the rest
57- of the kickstart init.lua.
58-
59- Next, run AND READ `:help`.
60- This will open up a help window with some basic information
61- about reading, navigating and searching the builtin help documentation.
62-
63- This should be the first place you go to look when you're stuck or confused
64- with something. It's one of my favorite Neovim features.
65-
66- MOST IMPORTANTLY, we provide a keymap "<space>sh" to [s]earch the [h]elp documentation,
67- which is very useful when you're not exactly sure of what you're looking for.
68-
69- I have left several `:help X` comments throughout the init.lua
70- These are hints about where to find more information about the relevant settings,
71- plugins or Neovim features used in Kickstart.
72-
73- NOTE: Look for lines like this
74-
75- Throughout the file. These are for you, the reader, to help you understand what is happening.
76- Feel free to delete them once you know what you're doing, but they should serve as a guide
77- for when you are first encountering a few different constructs in your Neovim config.
78-
79- If you experience any errors while trying to install kickstart, run `:checkhealth` for more info.
80-
81- I hope you enjoy your Neovim journey,
82- - TJ
83-
84- P.S. You can delete this when you're done too. It's your config now! :)
85- --]]
86-
871-- Set <space> as the leader key
882-- See `:help mapleader`
893-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
904vim .g .mapleader = ' '
915vim .g .maplocalleader = ' '
926
937-- Set to true if you have a Nerd Font installed and selected in the terminal
94- vim .g .have_nerd_font = false
8+ vim .g .have_nerd_font = true
959
9610-- [[ Setting options ]]
9711-- See `:help vim.o`
@@ -102,7 +16,7 @@ vim.g.have_nerd_font = false
10216vim .o .number = true
10317-- You can also add relative line numbers, to help with jumping.
10418-- Experiment for yourself to see if you like it!
105- -- vim.o.relativenumber = true
19+ vim .o .relativenumber = true
10620
10721-- Enable mouse mode, can be useful for resizing splits for example!
10822vim .o .mouse = ' a'
12034
12135-- Enable break indent
12236vim .o .breakindent = true
37+ vim .o .shiftwidth = 4
12338
12439-- Save undo history
12540vim .o .undofile = true
@@ -149,8 +64,8 @@ vim.o.splitbelow = true
14964-- It is very similar to `vim.o` but offers an interface for conveniently interacting with tables.
15065-- See `:help lua-options`
15166-- and `:help lua-options-guide`
152- vim .o .list = true
153- vim .opt .listchars = { tab = ' » ' , trail = ' ·' , nbsp = ' ␣' }
67+ vim .o .list = false
68+ -- vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
15469
15570-- Preview substitutions live, as you type!
15671vim .o .inccommand = ' split'
@@ -194,17 +109,21 @@ vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' }
194109-- Use CTRL+<hjkl> to switch between windows
195110--
196111-- See `:help wincmd` for a list of all window commands
197- vim .keymap .set (' n' , ' <C-h>' , ' <C-w><C-h>' , { desc = ' Move focus to the left window' })
198- vim .keymap .set (' n' , ' <C-l>' , ' <C-w><C-l>' , { desc = ' Move focus to the right window' })
199- vim .keymap .set (' n' , ' <C-j>' , ' <C-w><C-j>' , { desc = ' Move focus to the lower window' })
200- vim .keymap .set (' n' , ' <C-k>' , ' <C-w><C-k>' , { desc = ' Move focus to the upper window' })
201-
112+ -- vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' })
113+ -- vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
114+ -- vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
115+ -- vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
116+ --
202117-- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes
203118-- vim.keymap.set("n", "<C-S-h>", "<C-w>H", { desc = "Move window to the left" })
204119-- vim.keymap.set("n", "<C-S-l>", "<C-w>L", { desc = "Move window to the right" })
205120-- vim.keymap.set("n", "<C-S-j>", "<C-w>J", { desc = "Move window to the lower" })
206121-- vim.keymap.set("n", "<C-S-k>", "<C-w>K", { desc = "Move window to the upper" })
207122
123+ -- Navigating quickfix list easier
124+ vim .keymap .set (' n' , ' <C-j>' , ' <cmd>cnext<CR>' , { desc = ' Next item in quickfix list' })
125+ vim .keymap .set (' n' , ' <C-k>' , ' <cmd>cprev<CR>' , { desc = ' Previous item in quickfix list' })
126+
208127-- [[ Basic Autocommands ]]
209128-- See `:help lua-guide-autocommands`
210129
@@ -672,7 +591,7 @@ require('lazy').setup({
672591 -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
673592 local servers = {
674593 -- clangd = {},
675- -- gopls = {},
594+ gopls = {},
676595 -- pyright = {},
677596 -- rust_analyzer = {},
678597 -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
@@ -773,6 +692,7 @@ require('lazy').setup({
773692 --
774693 -- You can use 'stop_after_first' to run the first available formatter from the list
775694 -- javascript = { "prettierd", "prettier", stop_after_first = true },
695+ go = { ' gofumpt' },
776696 },
777697 },
778698 },
@@ -875,94 +795,8 @@ require('lazy').setup({
875795 signature = { enabled = true },
876796 },
877797 },
878-
879- { -- You can easily change to a different colorscheme.
880- -- Change the name of the colorscheme plugin below, and then
881- -- change the command in the config to whatever the name of that colorscheme is.
882- --
883- -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
884- ' folke/tokyonight.nvim' ,
885- priority = 1000 , -- Make sure to load this before all the other start plugins.
886- config = function ()
887- --- @diagnostic disable-next-line : missing-fields
888- require (' tokyonight' ).setup {
889- styles = {
890- comments = { italic = false }, -- Disable italics in comments
891- },
892- }
893-
894- -- Load the colorscheme here.
895- -- Like many other themes, this one has different styles, and you could load
896- -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
897- vim .cmd .colorscheme ' tokyonight-night'
898- end ,
899- },
900-
901- -- Highlight todo, notes, etc in comments
902- { ' folke/todo-comments.nvim' , event = ' VimEnter' , dependencies = { ' nvim-lua/plenary.nvim' }, opts = { signs = false } },
903-
904- { -- Collection of various small independent plugins/modules
905- ' echasnovski/mini.nvim' ,
906- config = function ()
907- -- Better Around/Inside textobjects
908- --
909- -- Examples:
910- -- - va) - [V]isually select [A]round [)]paren
911- -- - yinq - [Y]ank [I]nside [N]ext [Q]uote
912- -- - ci' - [C]hange [I]nside [']quote
913- require (' mini.ai' ).setup { n_lines = 500 }
914-
915- -- Add/delete/replace surroundings (brackets, quotes, etc.)
916- --
917- -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren
918- -- - sd' - [S]urround [D]elete [']quotes
919- -- - sr)' - [S]urround [R]eplace [)] [']
920- require (' mini.surround' ).setup ()
921-
922- -- Simple and easy statusline.
923- -- You could remove this setup call if you don't like it,
924- -- and try some other statusline plugin
925- local statusline = require ' mini.statusline'
926- -- set use_icons to true if you have a Nerd Font
927- statusline .setup { use_icons = vim .g .have_nerd_font }
928-
929- -- You can configure sections in the statusline by overriding their
930- -- default behavior. For example, here we set the section for
931- -- cursor location to LINE:COLUMN
932- --- @diagnostic disable-next-line : duplicate-set-field
933- statusline .section_location = function ()
934- return ' %2l:%-2v'
935- end
936-
937- -- ... and there is more!
938- -- Check out: https://github.com/echasnovski/mini.nvim
939- end ,
940- },
941- { -- Highlight, edit, and navigate code
942- ' nvim-treesitter/nvim-treesitter' ,
943- build = ' :TSUpdate' ,
944- main = ' nvim-treesitter.configs' , -- Sets main module to use for opts
945- -- [[ Configure Treesitter ]] See `:help nvim-treesitter`
946- opts = {
947- ensure_installed = { ' bash' , ' c' , ' diff' , ' html' , ' lua' , ' luadoc' , ' markdown' , ' markdown_inline' , ' query' , ' vim' , ' vimdoc' },
948- -- Autoinstall languages that are not installed
949- auto_install = true ,
950- highlight = {
951- enable = true ,
952- -- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules.
953- -- If you are experiencing weird indenting issues, add the language to
954- -- the list of additional_vim_regex_highlighting and disabled languages for indent.
955- additional_vim_regex_highlighting = { ' ruby' },
956- },
957- indent = { enable = true , disable = { ' ruby' } },
958- },
959- -- There are additional nvim-treesitter modules that you can use to interact
960- -- with nvim-treesitter. You should go explore a few and see what interests you:
961- --
962- -- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod`
963- -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
964- -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
965- },
798+ -- import everything under custom/plugins
799+ { import = ' custom.plugins' },
966800
967801 -- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the
968802 -- init.lua. If you want these files, they are in the repository, so you can just download them and
0 commit comments