init
This commit is contained in:
@@ -1,97 +1,11 @@
|
||||
--[[
|
||||
|
||||
=====================================================================
|
||||
==================== 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)
|
||||
-- this of leader like prefix for stuff, local leader is for "context" specific stuff
|
||||
-- per docs, don't understnad the diff yet
|
||||
-- NOTE: Must happen befor:e plugins are loaded (otherwise wrong leader will be used)
|
||||
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
|
||||
-- Set to true if you have a Nerd Font installed and selected in the terminal, to use icons
|
||||
vim.g.have_nerd_font = true
|
||||
|
||||
-- [[ Setting options ]]
|
||||
-- See `:help vim.o`
|
||||
@@ -173,6 +87,8 @@ vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
||||
|
||||
-- Diagnostic Config & Keymaps
|
||||
-- See :help vim.diagnostic.Opts
|
||||
-- diagnotisc are pushed in by whatever producer, this is basically how they
|
||||
-- are meant to looks
|
||||
vim.diagnostic.config {
|
||||
update_in_insert = false,
|
||||
severity_sort = true,
|
||||
@@ -195,6 +111,8 @@ vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagn
|
||||
--
|
||||
-- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping
|
||||
-- or just use <C-\><C-n> to exit terminal mode
|
||||
--
|
||||
-- the args are : mode, lhs, rhs => this is just shorthand for a more mouthful keystroke
|
||||
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
|
||||
|
||||
-- TIP: Disable arrow keys in normal mode
|
||||
@@ -220,7 +138,7 @@ vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper win
|
||||
|
||||
-- [[ Basic Autocommands ]]
|
||||
-- See `:help lua-guide-autocommands`
|
||||
|
||||
-- these basically run when some "event" happens
|
||||
-- Highlight when yanking (copying) text
|
||||
-- Try it with `yap` in normal mode
|
||||
-- See `:help vim.hl.on_yank()`
|
||||
@@ -254,6 +172,7 @@ rtp:prepend(lazypath)
|
||||
-- :Lazy update
|
||||
--
|
||||
-- NOTE: Here is where you install your plugins.
|
||||
-- all the plugins go inside of lazy
|
||||
require('lazy').setup({
|
||||
-- NOTE: Plugins can be added via a link or github org/name. To run setup automatically, use `opts = {}`
|
||||
{ 'NMAC427/guess-indent.nvim', opts = {} },
|
||||
@@ -595,6 +514,8 @@ require('lazy').setup({
|
||||
end,
|
||||
})
|
||||
|
||||
-- NOTE: LSP related settings, to enable stuff
|
||||
--
|
||||
-- Enable the following language servers
|
||||
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
||||
-- See `:help lsp-config` for information about keys and how to configure
|
||||
@@ -655,6 +576,7 @@ require('lazy').setup({
|
||||
-- :Mason
|
||||
--
|
||||
-- You can press `g?` for help in this menu.
|
||||
-- masong is the install tool for lsps basically
|
||||
local ensure_installed = vim.tbl_keys(servers or {})
|
||||
vim.list_extend(ensure_installed, {
|
||||
-- You can add other tools here that you want Mason to install
|
||||
@@ -701,6 +623,7 @@ require('lazy').setup({
|
||||
lsp_format = 'fallback', -- Use external formatters if configured below, otherwise use LSP formatting. Set to `false` to disable LSP formatting entirely.
|
||||
},
|
||||
-- You can also specify external formatters in here.
|
||||
-- NOTE: to enable formatting for different stuff
|
||||
formatters_by_ft = {
|
||||
-- rust = { 'rustfmt' },
|
||||
-- Conform can also run multiple formatters sequentially
|
||||
@@ -712,7 +635,7 @@ require('lazy').setup({
|
||||
},
|
||||
},
|
||||
|
||||
{ -- Autocompletion
|
||||
{ -- Autocompletion, all the menus that popup are handled via blink
|
||||
'saghen/blink.cmp',
|
||||
event = 'VimEnter',
|
||||
version = '1.*',
|
||||
@@ -986,5 +909,7 @@ require('lazy').setup({
|
||||
},
|
||||
})
|
||||
|
||||
-- this is basically for specifying editor tab/tab to spaces/etc
|
||||
-- settings withing the file
|
||||
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
|
||||
Reference in New Issue
Block a user