final stretch
This commit is contained in:
parent
95d8863806
commit
532dbef6b4
2 changed files with 51 additions and 106 deletions
117
README.md
117
README.md
|
@ -1,7 +1,5 @@
|
||||||
# kickstart.nvim
|
# kickstart.nvim
|
||||||
|
|
||||||
https://github.com/kdheepak/kickstart.nvim/assets/1813121/f3ff9a2b-c31f-44df-a4fa-8a0d7b17cf7b
|
|
||||||
|
|
||||||
### Introduction
|
### Introduction
|
||||||
|
|
||||||
A starting point for Neovim that is:
|
A starting point for Neovim that is:
|
||||||
|
@ -32,28 +30,38 @@ Neovim's configurations are located under the following paths, depending on your
|
||||||
|
|
||||||
| OS | PATH |
|
| OS | PATH |
|
||||||
| :- | :--- |
|
| :- | :--- |
|
||||||
| Linux | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` |
|
| Linux, MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` |
|
||||||
| MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` |
|
|
||||||
| Windows (cmd)| `%userprofile%\AppData\Local\nvim\` |
|
| Windows (cmd)| `%userprofile%\AppData\Local\nvim\` |
|
||||||
| Windows (powershell)| `$env:USERPROFILE\AppData\Local\nvim\` |
|
| Windows (powershell)| `$env:USERPROFILE\AppData\Local\nvim\` |
|
||||||
|
|
||||||
Clone kickstart.nvim:
|
Clone kickstart.nvim:
|
||||||
|
|
||||||
- on Linux and Mac
|
<details>
|
||||||
|
<summary> Linux and Mac </summary>
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim
|
git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim
|
||||||
```
|
```
|
||||||
|
|
||||||
- on Windows (cmd)
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary> Windows </summary>
|
||||||
|
|
||||||
|
If you're using `cmd.exe`:
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\Local\nvim\
|
git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\Local\nvim\
|
||||||
```
|
```
|
||||||
|
|
||||||
- on Windows (powershell)
|
If you're using `powershell.exe`
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone https://github.com/nvim-lua/kickstart.nvim.git $env:USERPROFILE\AppData\Local\nvim\
|
git clone https://github.com/nvim-lua/kickstart.nvim.git $env:USERPROFILE\AppData\Local\nvim\
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
|
||||||
### Post Installation
|
### Post Installation
|
||||||
|
|
||||||
|
@ -63,13 +71,9 @@ Start Neovim
|
||||||
nvim
|
nvim
|
||||||
```
|
```
|
||||||
|
|
||||||
The `Lazy` plugin manager will start automatically on the first run and install the configured plugins - as can be seen in the introduction video. After the installation is complete you can press `q` to close the `Lazy` UI and **you are ready to go**! Next time you run nvim `Lazy` will no longer show up.
|
That's it! Lazy will install all the plugins you have. Use `:Lazy` to view current plugin status.
|
||||||
|
|
||||||
If you would prefer to hide this step and run the plugin sync from the command line, you can use:
|
Read through the `init.lua` file in your configuration folder for more information about extending and exploring Neovim.
|
||||||
|
|
||||||
```sh
|
|
||||||
nvim --headless "+Lazy! sync" +qa
|
|
||||||
```
|
|
||||||
|
|
||||||
### Getting Started
|
### Getting Started
|
||||||
|
|
||||||
|
@ -82,18 +86,12 @@ See [Effective Neovim: Instant IDE](https://youtu.be/stqUbv-5u2s), covering the
|
||||||
> **NOTE**
|
> **NOTE**
|
||||||
> Your fork's url will be something like this: `https://github.com/<your_github_username>/kickstart.nvim.git`
|
> Your fork's url will be something like this: `https://github.com/<your_github_username>/kickstart.nvim.git`
|
||||||
|
|
||||||
### Configuration And Extension
|
#### Examples of adding popularly requested plugins
|
||||||
|
|
||||||
* Inside of your copy, feel free to modify any file you like! It's your copy!
|
<details>
|
||||||
* Feel free to change any of the default options in `init.lua` to better suit your needs.
|
<summary>Adding autopairs</summary>
|
||||||
* For adding plugins, there are 3 primary options:
|
|
||||||
* Add new configuration in `lua/custom/plugins/*` files, which will be auto sourced using `lazy.nvim` (uncomment the line importing the `custom/plugins` directory in the `init.lua` file to enable this)
|
|
||||||
* Modify `init.lua` with additional plugins.
|
|
||||||
* Include the `lua/kickstart/plugins/*` files in your configuration.
|
|
||||||
|
|
||||||
You can also merge updates/changes from the repo back into your fork, to keep up-to-date with any changes for the default configuration.
|
This will automatically install [windwp/nvim-autopairs](https://github.com/windwp/nvim-autopairs) and enable it on startup. For more information, see documentation for [lazy.nvim](https://github.com/folke/lazy.nvim).
|
||||||
|
|
||||||
#### Example: Adding an autopairs plugin
|
|
||||||
|
|
||||||
In the file: `lua/custom/plugins/autopairs.lua`, add:
|
In the file: `lua/custom/plugins/autopairs.lua`, add:
|
||||||
|
|
||||||
|
@ -118,9 +116,13 @@ return {
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
This will automatically install [windwp/nvim-autopairs](https://github.com/windwp/nvim-autopairs) and enable it on startup. For more information, see documentation for [lazy.nvim](https://github.com/folke/lazy.nvim).
|
|
||||||
|
|
||||||
#### Example: Adding a file tree plugin
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Adding a file tree plugin</summary>
|
||||||
|
|
||||||
|
This will install the tree plugin and add the command `:Neotree` for you. You can explore the documentation at [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim) for more information.
|
||||||
|
|
||||||
In the file: `lua/custom/plugins/filetree.lua`, add:
|
In the file: `lua/custom/plugins/filetree.lua`, add:
|
||||||
|
|
||||||
|
@ -142,23 +144,13 @@ return {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
This will install the tree plugin and add the command `:Neotree` for you. You can explore the documentation at [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim) for more information.
|
</details>
|
||||||
|
|
||||||
### Contribution
|
|
||||||
|
|
||||||
Pull-requests are welcome. The goal of this repo is not to create a Neovim configuration framework, but to offer a starting template that shows, by example, available features in Neovim. Some things that will not be included:
|
|
||||||
|
|
||||||
* Custom language server configuration (null-ls templates)
|
|
||||||
* Theming beyond a default colorscheme necessary for LSP highlight groups
|
|
||||||
|
|
||||||
Each PR, especially those which increase the line count, should have a description as to why the PR is necessary.
|
|
||||||
|
|
||||||
### FAQ
|
### FAQ
|
||||||
|
|
||||||
* What should I do if I already have a pre-existing neovim configuration?
|
* What should I do if I already have a pre-existing neovim configuration?
|
||||||
* You should back it up, then delete all files associated with it.
|
* You should back it up, then delete all files associated with it.
|
||||||
* This includes your existing init.lua and the neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/`
|
* This includes your existing init.lua and the neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/`
|
||||||
* You may also want to look at the [migration guide for lazy.nvim](https://github.com/folke/lazy.nvim#-migration-guide)
|
|
||||||
* Can I keep my existing configuration in parallel to kickstart?
|
* Can I keep my existing configuration in parallel to kickstart?
|
||||||
* Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME` to maintain multiple configurations. For example you can install the kickstart configuration in `~/.config/nvim-kickstart` and create an alias:
|
* Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME` to maintain multiple configurations. For example you can install the kickstart configuration in `~/.config/nvim-kickstart` and create an alias:
|
||||||
```
|
```
|
||||||
|
@ -191,56 +183,3 @@ This requires:
|
||||||
```lua
|
```lua
|
||||||
{'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' }
|
{'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' }
|
||||||
```
|
```
|
||||||
|
|
||||||
### Hints And Tips For New Neovimmers
|
|
||||||
|
|
||||||
Neovim is a very rich and powerful environment, but it can also feel a bit
|
|
||||||
intimidating for new users trying to find their way around, especially if
|
|
||||||
they're coming from other environments like Visual Studio Code or a traditional
|
|
||||||
IDE.
|
|
||||||
|
|
||||||
There's no way this README can provide you with everything you need to know, but
|
|
||||||
here are a few tips so you can learn how to learn.
|
|
||||||
|
|
||||||
### Use The Help, Luke!
|
|
||||||
|
|
||||||
Neovim's help system is incredibly thorough and extensive. You should really
|
|
||||||
take a moment to get comfortable navigating through help topics, going back and
|
|
||||||
forth, navigating the menus, etc. This won't just help you read the help, it
|
|
||||||
will empower you in the rest of your Neovim journey.
|
|
||||||
|
|
||||||
You can double click on a topic to drill down, and hit Ctrl-o (Hold down the
|
|
||||||
Control key and the 'o' key) to go back.
|
|
||||||
|
|
||||||
Read the first page you get when you run :help carefully. it will serve you
|
|
||||||
well.
|
|
||||||
|
|
||||||
You can also get help on a particular thing by typing ":help <topic>".
|
|
||||||
|
|
||||||
Like, let's say we want to learn more about folding, just type ":help folding".
|
|
||||||
|
|
||||||
### To The Telescope!
|
|
||||||
|
|
||||||
One of the more powerful features you get by installing this project is the
|
|
||||||
brilliant Telescope plugin co-written by @tjdevries.
|
|
||||||
|
|
||||||
Take a minute to browse through ":help telescope" and get a sense for all the
|
|
||||||
amazing superpowers you've gained.
|
|
||||||
|
|
||||||
In particular, there are two Telescope features that are incredible for helping
|
|
||||||
you understand how to do a particular thing or how to configure a particular
|
|
||||||
feature.
|
|
||||||
|
|
||||||
If you're not sure what to look for, try ":Telescope help_tags". Let's say we
|
|
||||||
want to configure Neovim to automatically word wrap. We might type ":Telescope
|
|
||||||
help_tags" and then type w, r, a, p. Notice how the list of results changes with
|
|
||||||
each new letter you type? When you're done you've got a screen full of topics
|
|
||||||
involving word wrap.
|
|
||||||
|
|
||||||
Another common question is "What keys do I hit to make a thing happen?". To get
|
|
||||||
an answer, one way is to use ":Telescope keymaps". You'll get the same list of
|
|
||||||
results that changes to adapt with each new key you press.
|
|
||||||
|
|
||||||
With these hints in mind you should be in good shape to get learning. Remember,
|
|
||||||
you are on a journey of discovery here, adapting your programming environment to
|
|
||||||
your needs. It will take effort, but the rewards are worth it! :)
|
|
||||||
|
|
40
init.lua
40
init.lua
|
@ -11,7 +11,7 @@
|
||||||
======== || || | === | ========
|
======== || || | === | ========
|
||||||
======== || || |-----| ========
|
======== || || |-----| ========
|
||||||
======== ||:Tutor || |:::::| ========
|
======== ||:Tutor || |:::::| ========
|
||||||
======== |'-..................-'| |____.| ========
|
======== |'-..................-'| |____o| ========
|
||||||
======== `"")----------------(""` ___________ ========
|
======== `"")----------------(""` ___________ ========
|
||||||
======== /::::::::::| |::::::::::\ \ no mouse \ ========
|
======== /::::::::::| |::::::::::\ \ no mouse \ ========
|
||||||
======== /:::========| |==hjkl==:::\ \ required \ ========
|
======== /:::========| |==hjkl==:::\ \ required \ ========
|
||||||
|
@ -22,19 +22,22 @@
|
||||||
|
|
||||||
Kickstart.nvim is *not* a distribution.
|
Kickstart.nvim is *not* a distribution.
|
||||||
|
|
||||||
Kickstart.nvim is a template for your own configuration.
|
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
|
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.
|
what your configuration is doing, and modify it to suit your needs.
|
||||||
|
|
||||||
Once you've done that, you should start exploring, configuring and tinkering to
|
Once you've done that, you can start exploring, configuring and tinkering to
|
||||||
explore Neovim!
|
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
|
If you don't know anything about Lua, I recommend taking some time to read through
|
||||||
a guide. One possible example:
|
a guide. One possible example which will only take 10-15 minutes:
|
||||||
- https://learnxinyminutes.com/docs/lua/
|
- https://learnxinyminutes.com/docs/lua/
|
||||||
|
|
||||||
And then you can explore or search through `:help lua-guide`
|
After understanding a bit more about Lua, you can use `:help lua-guide` as a
|
||||||
- https://neovim.io/doc/user/lua-guide.html
|
reference for how Neovim integrates Lua.
|
||||||
|
- :help lua-guide
|
||||||
|
- (or HTML version): https://neovim.io/doc/user/lua-guide.html
|
||||||
|
|
||||||
Kickstart Guide:
|
Kickstart Guide:
|
||||||
|
|
||||||
|
@ -385,9 +388,6 @@ require('lazy').setup({
|
||||||
'williamboman/mason-lspconfig.nvim',
|
'williamboman/mason-lspconfig.nvim',
|
||||||
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
||||||
|
|
||||||
-- Additional lua configuration, makes nvim stuff amazing!
|
|
||||||
'folke/neodev.nvim',
|
|
||||||
|
|
||||||
-- Useful status updates for LSP.
|
-- Useful status updates for LSP.
|
||||||
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
|
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
|
||||||
{ 'j-hui/fidget.nvim', opts = {} },
|
{ 'j-hui/fidget.nvim', opts = {} },
|
||||||
|
@ -418,10 +418,6 @@ require('lazy').setup({
|
||||||
-- If you're wondering about lsp vs treesitter, you can check out the wonderfully
|
-- If you're wondering about lsp vs treesitter, you can check out the wonderfully
|
||||||
-- and elegantly composed help section, :help lsp-vs-treesitter
|
-- and elegantly composed help section, :help lsp-vs-treesitter
|
||||||
|
|
||||||
-- First, enable neodev. This is helpful for auto-configuring the Lua LSP
|
|
||||||
-- to understand your Neovim environment
|
|
||||||
require('neodev').setup()
|
|
||||||
|
|
||||||
-- This function gets run when an LSP connects to a particular buffer.
|
-- This function gets run when an LSP connects to a particular buffer.
|
||||||
-- That is to say, every time a new file is opened that is associated with
|
-- That is to say, every time a new file is opened that is associated with
|
||||||
-- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this
|
-- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this
|
||||||
|
@ -507,7 +503,16 @@ require('lazy').setup({
|
||||||
-- capabilities = {},
|
-- capabilities = {},
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
workspace = { checkThirdParty = false },
|
runtime = { version = 'LuaJIT' },
|
||||||
|
workspace = {
|
||||||
|
checkThirdParty = false,
|
||||||
|
library = {
|
||||||
|
'${3rd}/luv/library',
|
||||||
|
unpack(vim.api.nvim_get_runtime_file('', true)),
|
||||||
|
},
|
||||||
|
-- If lua_ls is really slow on your computer, you can try this instead:
|
||||||
|
-- library = { vim.env.VIMRUNTIME },
|
||||||
|
},
|
||||||
telemetry = { enable = false },
|
telemetry = { enable = false },
|
||||||
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
|
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
|
||||||
-- diagnostics = { disable = { 'missing-fields' } },
|
-- diagnostics = { disable = { 'missing-fields' } },
|
||||||
|
@ -677,12 +682,13 @@ require('lazy').setup({
|
||||||
-- Better Around/Inside textobjects
|
-- Better Around/Inside textobjects
|
||||||
--
|
--
|
||||||
-- Examples:
|
-- Examples:
|
||||||
-- - ya) - [Y]ank [A]round [)]parenthen
|
-- - va) - [V]isually select [A]round [)]parenthen
|
||||||
-- - yinq - [Y]ank [I]nside [N]ext [']quote
|
-- - yinq - [Y]ank [I]nside [N]ext [']quote
|
||||||
-- - ci' - [C]hange [I]nside [']quote
|
-- - ci' - [C]hange [I]nside [']quote
|
||||||
require('mini.ai').setup { n_lines = 500 }
|
require('mini.ai').setup { n_lines = 500 }
|
||||||
|
|
||||||
-- Add/delete/replace surroundings (brackets, quotes, etc.)
|
-- Add/delete/replace surroundings (brackets, quotes, etc.)
|
||||||
|
--
|
||||||
-- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren
|
-- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren
|
||||||
-- - sd' - [S]urround [D]elete [']quotes
|
-- - sd' - [S]urround [D]elete [']quotes
|
||||||
-- - sr)' - [S]urround [R]eplace [)] [']
|
-- - sr)' - [S]urround [R]eplace [)] [']
|
||||||
|
|
Loading…
Reference in a new issue