Compare commits

...

61 Commits

Author SHA1 Message Date
931c6a48bf added plugins 2024-04-27 09:45:42 -06:00
257a9e465d changed some default values, and added transperancy 2024-04-23 17:18:24 -06:00
93ce0fa005 changed bindings 2024-04-23 15:44:59 -06:00
565f387a8b modified config 2024-04-23 13:04:04 -06:00
Adolfo Gante
8df3deb6fe
Update README.md (#875)
Line 102. Placed 'also' before the 'includes'.

"That includes also examples of adding popularly requested plugins." ---> "That also includes examples of adding popularly requested plugins."
2024-04-22 17:15:42 -04:00
Francis Belanger
942b26184c
fix: highlight group clear on each attach (#874) 2024-04-22 15:53:45 -04:00
Francis Belanger
81f270a704
Fix highlight errors when lsp crash or stop (#864)
* Fix highlight errors when lsp crash or stop

It adds a check wether the client is still available before
highlighting.

If the client is not there anymore it returns `true` to unregister the
autocommand

This fix the
`method textDocument/documentHighlight is not supported by any of the servers registered for the current buffer`
errors when doing a LspRestart or the server crashes

* Delete the highlight autocommands in the LspDetatch event

* Only delete autocmds for the current buffer with the group name

* Simplify clearing the autocommands

---------

Co-authored-by: Francis Belanger <francis.belanger@ubisoft.com>
2024-04-22 11:43:10 -04:00
Vladislav Grechannik
f92fb11d68
Fix deprecation notice of inlay hints (#873) 2024-04-22 07:27:13 -04:00
Damjan 9000
2e68a2c253
Add a commented out example of the classic complete keymaps. Fixes #866 (#868) 2024-04-20 13:14:49 -04:00
Damjan 9000
9f5176fc2a
Minor improvements of debian install instructions. Fixes #859 (#869) 2024-04-20 13:14:24 -04:00
Evan Carroll
931ec5c226
Update README.md (#860)
Attempted fix for #859, provide reasonable Debian install instructions -- comment on GitHub issue with refinement.
2024-04-20 11:55:01 -04:00
GameFuzzy
b07176aef6
fix: restore Mason config timing for DAP startup (again) (#865) 2024-04-19 13:50:42 -04:00
Damjan 9000
f5c9fe8e15
Add gitsigns recommended keymaps as an optional plugin (#858) 2024-04-17 21:00:39 -04:00
Damjan 9000
5e258d276f
Move plugin examples from README to optional plugin files (#831)
* Move autopairs example from README to an optional plugin

* Move neo-tree example from README to an optional plugin
2024-04-17 15:25:54 -04:00
Vladislav Grechannik
5540527fab
Enable inlay hints for the supporting servers (#843) 2024-04-17 14:04:55 -04:00
Chris Patti
6d6b3f38c1
Fix: #847 - add prefer_git to treesitter config (#856) 2024-04-17 14:02:24 -04:00
Damjan 9000
fabeb86d8b
Comment about nerd font selection. Fixes #853 (#854) 2024-04-17 09:59:14 -04:00
rdvm
e2bfa0c66f
Arch, btw (#852)
* Arch, btw

* Add unzip

* Add unzip for Fedora and --needed arg for Arch
2024-04-16 11:29:27 -04:00
Viet
23773900d9
Update README (#832) 2024-04-08 16:13:22 -04:00
Damjan 9000
c4363e4ad8
Add a pull request template (#825) 2024-04-04 10:31:37 -04:00
Damjan 9000
19afab1641
README: move backup and paths from external deps to install section (#819) 2024-04-01 10:36:32 -04:00
Damjan 9000
d605b840a2
Don't lazy load conform plugin (#818) 2024-03-31 20:00:11 -04:00
Damjan 9000
1175f6d25a
Add a keymap space-f to format buffer using conform (#817)
This works also for visual range selection
Copied from conform recipe:
https://github.com/stevearc/conform.nvim/blob/master/doc/recipes.md
2024-03-31 13:36:43 -04:00
Chris Patti
93fde0556e Add instructions to quit :lazy. Fixes #761 2024-03-27 11:22:28 -04:00
Liu Qisheng
2877a60e00
fix #799 (#800)
Add `'luadoc'`, to the `ensure_installed` of `nvim-treesitter/nvim-treesitter`
2024-03-27 10:16:48 -04:00
Damjan 9000
dbba54cfd8
README: wrap long lines (#784) 2024-03-21 15:47:55 -04:00
E
4c02e29e49
Update README.md (#781)
The recommended step of forking the repo coming sequentially after the step instructing users to clone the current repo doesn't make sense.

This commit orders the install instructions in a manner that's more logical.
2024-03-20 14:27:18 -04:00
José Miguel Sarasola
773e482d4b
Add nvim-nio as dependency for nvim-dap-ui (#774)
It's a dependency now
2024-03-18 17:38:14 -04:00
Togglebit
65a5ac404b
Some suggestions and capitalised a few words (#771) 2024-03-18 13:35:53 -04:00
Fredrik Averpil
8e24ca32e3
feat: add linter plugin (#699) 2024-03-18 10:00:48 -04:00
Shane Crowley
b81115d002
assign table to filetype in lua_ls config comment (#770) 2024-03-18 09:57:48 -04:00
Damjan 9000
a222805c61
README: additional install recipes for various OS (#767) 2024-03-17 16:22:58 -04:00
Damjan 9000
ea4335f5af
conform: disable autoformat on save for specified filetypes (#694)
Provide a method to disable autoformat on save lsp fallback for
specified filetypes. By default disable for C/C++ as an example,
because it does not have a well standardized coding style.

Based on conform recipe:
https://github.com/stevearc/conform.nvim/blob/master/doc/recipes.md
2024-03-15 16:53:33 -04:00
stgpepper
da1271db4d
Update README.md (#763)
Added file text to code block for consistency since the other plugin had file also inside code block.
2024-03-15 16:51:41 -04:00
TJ DeVries
7892c0c354 fix: disable ts indenting for Ruby
Tree-sitter indenting for ruby is pretty terrible.
But the fix requires a few steps, so showed those
and documented how you could do that for other languages
as well (with the tricky part being the
additional_vim_regex_highlighting trick)
2024-03-15 11:35:07 -04:00
TJ DeVries
5ac4b58f85 doc: add note about advanced luasnip features 2024-03-15 11:18:43 -04:00
Vladislav Grechannik
2f494e59ca
Move friendly snippets to dependencies of LuaSnip (#759)
Co-authored-by: TJ DeVries <devries.timothyj@gmail.com>
2024-03-15 10:35:42 -04:00
Rafael Zasas
452e3a73cf
Add <C-b>/<C-f> cmp mapping to scroll cmp docs (#750) 2024-03-15 10:12:41 -04:00
TLW
7715b7c2ee
doc: add info about timeoutlen (#691)
Add separate comment for `timeoutlen` option
`timeoutlen` option was under unrelated comment with `updatetime` option.
2024-03-15 09:54:49 -04:00
Chris Patti
b529bc3359
Revert "Use cmp-nvim-lua as nvim-cmp source for neovim Lua API (#696)" (#755)
This reverts commit d8a1dbc4b4.
2024-03-12 18:09:47 -04:00
James Karefylakis
d8a1dbc4b4
Use cmp-nvim-lua as nvim-cmp source for neovim Lua API (#696)
* Use cmp-nvim-lua as nvim-cmp source for neovim Lua API

* Move the dependency to a more suitable place
2024-03-12 17:12:35 -04:00
Damjan 9000
000a5c42b0
Added folke/neodev.nvim for proper nvim api completion and annotation (#754)
Fixes nvim-lua/kickstart.nvim#692

`neodev` configures Lua LSP for your Neovim config, runtime and plugins
used for completion, annotations and signatures of Neovim apis

With neodev, there's no more need to manually set lua_ls workspace
settings which don't seem to work properly anyway as currently nvim
api completion does not work.
2024-03-12 17:06:12 -04:00
Chiller Dragon
cb1f16b8ca
chore: rename <C-T> to <C-t> for consistency (#719) 2024-03-11 19:20:39 -04:00
Ryan Baumgardner
c0d6f98924
feat: allow treesitter defaults to be overwritten from custom directory (#732) 2024-03-11 19:18:45 -04:00
Damjan 9000
8de494fff2
README.md: update neo-tree example - remove legacy setting (#744) 2024-03-11 17:52:18 -04:00
name.tar.xz
3cfccc01be
use init for colorscheme (#715) 2024-03-09 15:25:08 -05:00
Nora Ayesha
8fae6798b9
Fix typos and whatnot (#731) 2024-03-08 15:26:32 -05:00
Damjan 9000
66e2a5a425
Make the Nerd Font an optional requirement (#716) 2024-03-06 11:49:44 -05:00
Ryan Winchester
f764b7bacd
Add more detail to colorscheme comment (#713) 2024-03-05 20:19:06 -05:00
Chiller Dragon
b83b2b061c
chore: link new installation youtube video (#678) 2024-03-04 08:47:45 -05:00
Chiller Dragon
a02abdb161
chore: remove trailing spaces from readme (#679) 2024-03-04 08:47:11 -05:00
Damjan 9000
c3127f1226
Change statusline location to LINE:COLUMN (#689) 2024-03-04 08:16:50 -05:00
Damjan 9000
c9122e89e3
fix: checkhealth reported nvim version (#685) 2024-03-03 19:32:06 -05:00
TJ DeVries
e6710a461a fix: add note in readme for custom plugins 2024-03-03 03:13:16 -05:00
Damjan 9000
23fc4e59dc
README.md: updated windows install instructions (#674) 2024-03-02 21:12:55 -05:00
Taulant Aliraj
b99af2d6a3
feat: use VimEnter event instead of VeryLazy (#673) 2024-03-02 21:07:58 -05:00
Nhan Luu
94a93643ab
chore: fix typos (#666) 2024-03-01 16:07:34 -05:00
Anton Kastritskii
38828dcaf7
feat: enable lua lsp snipppets (#660) 2024-02-29 13:14:36 -05:00
TJ DeVries
b58666dd15 fixup: updated some style stuff 2024-02-29 12:08:01 -05:00
Damjan 9000
465d6f25c2
Change mini.statusline location format to LINE:COLUMN (#659)
Default mini.statusline location format is:
  'cursor line | total lines │ cursor column | total columns'
2024-02-28 13:23:13 -05:00
brxxlstxrs
18b919c61e
add plugin specs docstring, remove lazy.nvim configuration (empty) table (#652) 2024-02-27 13:08:37 -05:00
9 changed files with 522 additions and 205 deletions

8
.github/pull_request_template.md vendored Normal file
View File

@ -0,0 +1,8 @@
***************************************************************************
**NOTE**
Please verify that the `base repository` above has the intended destination!
Github by default opens Pull Requests against the parent of a forked repository.
If this is your personal fork and you didn't intend to open a PR for contribution
to the original project then adjust the `base repository` accordingly.
**************************************************************************

208
README.md
View File

@ -21,19 +21,24 @@ If you are experiencing issues, please make sure you have the latest versions.
### Install External Dependencies
> **NOTE**
> [Backup](#FAQ) your previous configuration (if any exists)
External Requirements:
- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`)
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation)
- A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons
- if you have it set `vim.g.have_nerd_font` in `init.lua` to true
- Language Setup:
- If want to write Typescript, you need `npm`
- If want to write Golang, you will need `go`
- etc.
> **NOTE**
> See [Windows Installation](#Windows-Installation) to double check any additional Windows notes
> See [Install Recipes](#Install-Recipes) for additional Windows and Linux specific notes
> and quick install snippets
### Install Kickstart
> **NOTE**
> [Backup](#FAQ) your previous configuration (if any exists)
Neovim's configurations are located under the following paths, depending on your OS:
@ -43,7 +48,20 @@ Neovim's configurations are located under the following paths, depending on your
| Windows (cmd)| `%userprofile%\AppData\Local\nvim\` |
| Windows (powershell)| `$env:USERPROFILE\AppData\Local\nvim\` |
Clone kickstart.nvim:
#### Recommended Step
[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo
so that you have your own copy that you can modify, then install by cloning the
fork to your machine using one of the commands below, depending on your OS.
> **NOTE**
> Your fork's url will be something like this:
> `https://github.com/<your_github_username>/kickstart.nvim.git`
#### Clone kickstart.nvim
> **NOTE**
> If following the recommended step above (i.e., forking the repo), replace
> `nvim-lua` with `<your_github_username>` in the commands below
<details><summary> Linux and Mac </summary>
@ -58,13 +76,13 @@ git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HO
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\
```
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>
@ -78,117 +96,133 @@ nvim
```
That's it! Lazy will install all the plugins you have. Use `:Lazy` to view
current plugin status.
current plugin status. Hit `q` to close the window.
Read through the `init.lua` file in your configuration folder for more
information about extending and exploring Neovim.
information about extending and exploring Neovim. That also includes
examples of adding popularly requested plugins.
### Getting Started
See [Effective Neovim: Instant IDE](https://youtu.be/stqUbv-5u2s), covering the
previous version. Note: The install via init.lua is outdated, please follow the
install instructions in this file instead. An updated video is coming soon.
### Recommended Steps
[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo
(so that you have your own copy that you can modify) and then installing you
can install to your machine using the methods above.
> **NOTE**
> Your fork's url will be something like this: `https://github.com/<your_github_username>/kickstart.nvim.git`
#### Examples of adding popularly requested plugins
<details>
<summary>Adding autopairs</summary>
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).
In the file: `lua/custom/plugins/autopairs.lua`, add:
```lua
-- File: lua/custom/plugins/autopairs.lua
return {
"windwp/nvim-autopairs",
-- Optional dependency
dependencies = { 'hrsh7th/nvim-cmp' },
config = function()
require("nvim-autopairs").setup {}
-- If you want to automatically add `(` after selecting a function or method
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
local cmp = require('cmp')
cmp.event:on(
'confirm_done',
cmp_autopairs.on_confirm_done()
)
end,
}
```
</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:
```lua
-- Unless you are still migrating, remove the deprecated commands from v1.x
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
return {
"nvim-neo-tree/neo-tree.nvim",
version = "*",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim",
},
config = function ()
require('neo-tree').setup {}
end,
}
```
</details>
[The Only Video You Need to Get Started with Neovim](https://youtu.be/m8C0Cq9Uv9o)
### FAQ
* 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.
* This includes your existing init.lua and the neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/`
* You should back it up and then delete all associated files.
* This includes your existing init.lua and the neovim files in `~/.local`
which can be deleted with `rm -rf ~/.local/share/nvim/`
* 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:
```
alias nvim-kickstart='NVIM_APPNAME="nvim-kickstart" nvim'
```
When you run Neovim using `nvim-kickstart` alias it will use the alternative config directory and the matching local directory `~/.local/share/nvim-kickstart`. You can apply this approach to any Neovim distribution that you would like to try out.
When you run Neovim using `nvim-kickstart` alias it will use the alternative
config directory and the matching local directory
`~/.local/share/nvim-kickstart`. You can apply this approach to any Neovim
distribution that you would like to try out.
* What if I want to "uninstall" this configuration:
* See [lazy.nvim uninstall](https://github.com/folke/lazy.nvim#-uninstalling) information
* Why is the kickstart `init.lua` a single file? Wouldn't it make sense to split it into multiple files?
* The main purpose of kickstart is to serve as a teaching tool and a reference
configuration that someone can easily `git clone` as a basis for their own.
configuration that someone can easily use to `git clone` as a basis for their own.
As you progress in learning Neovim and Lua, you might consider splitting `init.lua`
into smaller parts. A fork of kickstart that does this while maintaining the exact
into smaller parts. A fork of kickstart that does this while maintaining the
same functionality is available here:
* [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim)
* Discussions on this topic can be found here:
* [Restructure the configuration](https://github.com/nvim-lua/kickstart.nvim/issues/218)
* [Reorganize init.lua into a multi-file setup](https://github.com/nvim-lua/kickstart.nvim/pull/473)
### Windows Installation
### Install Recipes
Installation may require installing build tools, and updating the run command for `telescope-fzf-native`
Below you can find OS specific install instructions for Neovim and dependencies.
After installing all the dependencies continue with the [Install Kickstart](#Install-Kickstart) step.
#### Windows Installation
<details><summary>Windows with Microsoft C++ Build Tools and CMake</summary>
Installation may require installing build tools and updating the run command for `telescope-fzf-native`
See `telescope-fzf-native` documentation for [more details](https://github.com/nvim-telescope/telescope-fzf-native.nvim#installation)
This requires:
- Install CMake, and the Microsoft C++ Build Tools on Windows
- Install CMake and the Microsoft C++ Build Tools on Windows
```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' }
```
</details>
<details><summary>Windows with gcc/make using chocolatey</summary>
Alternatively, one can install gcc and make which don't require changing the config,
the easiest way is to use choco:
1. install [chocolatey](https://chocolatey.org/install)
either follow the instructions on the page or use winget,
run in cmd as **admin**:
```
winget install --accept-source-agreements chocolatey.chocolatey
```
2. install all requirements using choco, exit previous cmd and
open a new one so that choco path is set, and run in cmd as **admin**:
```
choco install -y neovim git ripgrep wget fd unzip gzip mingw make
```
</details>
<details><summary>WSL (Windows Subsystem for Linux)</summary>
```
wsl --install
wsl
sudo add-apt-repository ppa:neovim-ppa/unstable -y
sudo apt update
sudo apt install make gcc ripgrep unzip neovim
```
</details>
#### Linux Install
<details><summary>Ubuntu Install Steps</summary>
```
sudo add-apt-repository ppa:neovim-ppa/unstable -y
sudo apt update
sudo apt install make gcc ripgrep unzip git neovim
```
</details>
<details><summary>Debian Install Steps</summary>
```
sudo apt update
sudo apt install make gcc ripgrep unzip git curl
# Now we install nvim
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz
sudo rm -rf /opt/nvim-linux64
sudo mkdir -p /opt/nvim-linux64
sudo chmod a+rX /opt/nvim-linux64
sudo tar -C /opt -xzf nvim-linux64.tar.gz
# make it available in /usr/local/bin, distro installs to /usr/bin
sudo ln -sf /opt/nvim-linux64/bin/nvim /usr/local/bin/
```
</details>
<details><summary>Fedora Install Steps</summary>
```
sudo dnf install -y gcc make git ripgrep fd-find unzip neovim
```
</details>
<details><summary>Arch Install Steps</summary>
```
sudo pacman -S --noconfirm --needed gcc make git ripgrep fd unzip neovim
```
</details>

344
init.lua
View File

@ -29,7 +29,7 @@ What is Kickstart?
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
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
@ -51,32 +51,32 @@ Kickstart Guide:
- Tutor
- <enter key>
(If you already know how the Neovim basics, you can skip this step)
(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
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.
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 sure exactly what you're looking for.
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.
plugins or Neovim features used in Kickstart.
NOTE: Look for lines like this
Throughout the file. These are for you, the reader, to help understand what is happening.
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 nvim config.
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
If you experience any errors while trying to install kickstart, run `:checkhealth` for more info.
I hope you enjoy your Neovim journey,
- TJ
@ -90,6 +90,9 @@ P.S. You can delete this when you're done too. It's your config now! :)
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
-- [[ Setting options ]]
-- See `:help vim.opt`
-- NOTE: You can change these options as you wish!
@ -97,14 +100,14 @@ vim.g.maplocalleader = ' '
-- Make line numbers default
vim.opt.number = true
-- You can also add relative line numbers, for help with jumping.
-- You can also add relative line numbers, to help with jumping.
-- Experiment for yourself to see if you like it!
-- vim.opt.relativenumber = true
-- Enable mouse mode, can be useful for resizing splits for example!
vim.opt.mouse = 'a'
-- Don't show the mode, since it's already in status line
-- Don't show the mode, since it's already in the status line
vim.opt.showmode = false
-- Sync clipboard between OS and Neovim.
@ -118,7 +121,7 @@ vim.opt.breakindent = true
-- Save undo history
vim.opt.undofile = true
-- Case-insensitive searching UNLESS \C or capital in search
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
vim.opt.ignorecase = true
vim.opt.smartcase = true
@ -127,15 +130,18 @@ vim.opt.signcolumn = 'yes'
-- Decrease update time
vim.opt.updatetime = 250
-- Decrease mapped sequence wait time
-- Displays which-key popup sooner
vim.opt.timeoutlen = 300
-- Configure how new splits should be opened
vim.opt.splitright = true
vim.opt.splitbelow = true
-- Sets how neovim will display certain whitespace in the editor.
-- See :help 'list'
-- and :help 'listchars'
-- Sets how neovim will display certain whitespace characters in the editor.
-- See `:help 'list'`
-- and `:help 'listchars'`
vim.opt.list = true
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '' }
@ -154,6 +160,13 @@ vim.opt.scrolloff = 10
-- Set highlight on search, but clear on pressing <Esc> in normal mode
vim.opt.hlsearch = true
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
vim.keymap.set('n', '<F5>', vim.cmd.UndotreeToggle)
vim.keymap.set('n', '<C-M>', ':lua require("harpoon.mark").add_file()<CR>')
vim.keymap.set('n', '<C-n>', ':lua require("harpoon.mark").rm_file()<CR>')
vim.keymap.set('n', '<C-o>', ':lua require("harpoon.ui").toggle_quick_menu()<CR>')
vim.keymap.set('n', '<C-p>', ":call fzf#run({'source': 'find . ! -name *.o ! -path \"./.*\"', 'sink': 'e'})<CR>")
vim.keymap.set('n', '<tab>', '<C-n>')
-- Diagnostic keymaps
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' })
@ -185,7 +198,7 @@ vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower win
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
-- [[ Basic Autocommands ]]
-- See :help lua-guide-autocommands
-- See `:help lua-guide-autocommands`
-- Highlight when yanking (copying) text
-- Try it with `yap` in normal mode
@ -214,14 +227,19 @@ vim.opt.rtp:prepend(lazypath)
--
-- You can press `?` in this menu for help. Use `:q` to close the window
--
-- To update plugins, you can run
-- To update plugins you can run
-- :Lazy update
--
-- NOTE: Here is where you install your plugins.
require('lazy').setup({
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
'nvim-lua/plenary.nvim',
'ThePrimeagen/harpoon',
'neoclide/coc.nvim',
'junegunn/fzf',
'xiyaowong/transparent.nvim',
'mbbill/undotree',
-- NOTE: Plugins can also be added by using a table,
-- with the first argument being the link and the following
@ -236,7 +254,7 @@ require('lazy').setup({
{ 'numToStr/Comment.nvim', opts = {} },
-- 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:
-- require('gitsigns').setup({ ... })
--
-- See `:help gitsigns` to understand what the configuration keys do
@ -253,16 +271,16 @@ require('lazy').setup({
},
},
-- NOTE: Plugins can also be configured to run lua code when they are loaded.
-- NOTE: Plugins can also be configured to run Lua code when they are loaded.
--
-- This is often very useful to both group configuration, as well as handle
-- lazy loading plugins that don't need to be loaded immediately at startup.
--
-- For example, in the following configuration, we use:
-- event = 'VeryLazy'
-- event = 'VimEnter'
--
-- which loads which-key after all the UI elements are loaded. Events can be
-- normal autocommands events (:help autocomd-events).
-- which loads which-key before all the UI elements are loaded. Events can be
-- normal autocommands events (`:help autocmd-events`).
--
-- Then, because we use the `config` key, the configuration only runs
-- after the plugin has been loaded:
@ -270,7 +288,7 @@ require('lazy').setup({
{ -- Useful plugin to show you pending keybinds.
'folke/which-key.nvim',
event = 'VeryLazy', -- Sets the loading event to 'VeryLazy'
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
config = function() -- This is the function that runs, AFTER loading
require('which-key').setup()
@ -281,7 +299,13 @@ require('lazy').setup({
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
['<leader>t'] = { name = '[T]oggle', _ = 'which_key_ignore' },
['<leader>h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' },
}
-- visual mode
require('which-key').register({
['<leader>h'] = { 'Git [H]unk' },
}, { mode = 'v' })
end,
},
@ -294,11 +318,11 @@ require('lazy').setup({
{ -- Fuzzy Finder (files, lsp, etc)
'nvim-telescope/telescope.nvim',
event = 'VeryLazy',
event = 'VimEnter',
branch = '0.1.x',
dependencies = {
'nvim-lua/plenary.nvim',
{ -- If encountering errors, see telescope-fzf-native README for install instructions
{ -- If encountering errors, see telescope-fzf-native README for installation instructions
'nvim-telescope/telescope-fzf-native.nvim',
-- `build` is used to run some command when the plugin is installed/updated.
@ -313,29 +337,27 @@ require('lazy').setup({
},
{ 'nvim-telescope/telescope-ui-select.nvim' },
-- Useful for getting pretty icons, but requires special font.
-- If you already have a Nerd Font, or terminal set up with fallback fonts
-- you can enable this
-- { 'nvim-tree/nvim-web-devicons' }
-- Useful for getting pretty icons, but requires a Nerd Font.
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
},
config = function()
-- Telescope is a fuzzy finder that comes with a lot of different things that
-- it can fuzzy find! It's more than just a "file finder", it can search
-- many different aspects of Neovim, your workspace, LSP, and more!
--
-- The easiest way to use telescope, is to start by doing something like:
-- The easiest way to use Telescope, is to start by doing something like:
-- :Telescope help_tags
--
-- After running this command, a window will open up and you're able to
-- type in the prompt window. You'll see a list of help_tags options and
-- type in the prompt window. You'll see a list of `help_tags` options and
-- a corresponding preview of the help.
--
-- Two important keymaps to use while in telescope are:
-- Two important keymaps to use while in Telescope are:
-- - Insert mode: <c-/>
-- - Normal mode: ?
--
-- This opens a window that shows you all of the keymaps for the current
-- telescope picker. This is really useful to discover what Telescope can
-- Telescope picker. This is really useful to discover what Telescope can
-- do as well as how to actually do it!
-- [[ Configure Telescope ]]
@ -357,7 +379,7 @@ require('lazy').setup({
},
}
-- Enable telescope extensions, if they are installed
-- Enable Telescope extensions if they are installed
pcall(require('telescope').load_extension, 'fzf')
pcall(require('telescope').load_extension, 'ui-select')
@ -376,14 +398,14 @@ require('lazy').setup({
-- Slightly advanced example of overriding default behavior and theme
vim.keymap.set('n', '<leader>/', function()
-- You can pass additional configuration to telescope to change 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 {
winblend = 10,
previewer = false,
})
end, { desc = '[/] Fuzzily search in current buffer' })
-- 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
vim.keymap.set('n', '<leader>s/', function()
builtin.live_grep {
@ -392,7 +414,7 @@ require('lazy').setup({
}
end, { desc = '[S]earch [/] in Open Files' })
-- Shortcut for searching your neovim configuration files
-- Shortcut for searching your Neovim configuration files
vim.keymap.set('n', '<leader>sn', function()
builtin.find_files { cwd = vim.fn.stdpath 'config' }
end, { desc = '[S]earch [N]eovim files' })
@ -402,25 +424,29 @@ require('lazy').setup({
{ -- LSP Configuration & Plugins
'neovim/nvim-lspconfig',
dependencies = {
-- Automatically install LSPs and related tools to stdpath for neovim
'williamboman/mason.nvim',
-- Automatically install LSPs and related tools to stdpath for Neovim
{ 'williamboman/mason.nvim', config = true }, -- NOTE: Must be loaded before dependants
'williamboman/mason-lspconfig.nvim',
'WhoIsSethDaniel/mason-tool-installer.nvim',
-- Useful status updates for LSP.
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
{ 'j-hui/fidget.nvim', opts = {} },
-- `neodev` configures Lua LSP for your Neovim config, runtime and plugins
-- used for completion, annotations and signatures of Neovim apis
{ 'folke/neodev.nvim', opts = {} },
},
config = function()
-- Brief Aside: **What is LSP?**
-- Brief aside: **What is LSP?**
--
-- LSP is an acronym you've probably heard, but might not understand what it is.
-- LSP is an initialism you've probably heard, but might not understand what it is.
--
-- LSP stands for Language Server Protocol. It's a protocol that helps editors
-- and language tooling communicate in a standardized fashion.
--
-- In general, you have a "server" which is some tool built to understand a particular
-- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc). These Language Servers
-- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc.). These Language Servers
-- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone
-- processes that communicate with some "client" - in this case, Neovim!
--
@ -435,7 +461,7 @@ require('lazy').setup({
-- Neovim. This is where `mason` and related plugins come into play.
--
-- 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`
-- This function gets run when an LSP attaches to a particular buffer.
-- That is to say, every time a new file is opened that is associated with
@ -444,9 +470,8 @@ require('lazy').setup({
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),
callback = function(event)
-- NOTE: Remember that lua is a real programming language, and as such it is possible
-- to define small helper and utility functions so you don't have to repeat yourself
-- many times.
-- NOTE: Remember that Lua is a real programming language, and as such it is possible
-- to define small helper and utility functions so you don't have to repeat yourself.
--
-- In this case, we create a function that lets us more easily define mappings specific
-- for LSP related items. It sets the mode, buffer and description for us each time.
@ -456,7 +481,7 @@ require('lazy').setup({
-- Jump to the definition of the word under your cursor.
-- This is where a variable was first declared, or where a function is defined, etc.
-- To jump back, press <C-T>.
-- To jump back, press <C-t>.
map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
-- Find references for the word under your cursor.
@ -475,11 +500,11 @@ require('lazy').setup({
-- Symbols are things like variables, functions, types, etc.
map('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
-- Fuzzy find all the symbols in your current workspace
-- Similar to document symbols, except searches over your whole project.
-- Fuzzy find all the symbols in your current workspace.
-- Similar to document symbols, except searches over your entire project.
map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
-- Rename the variable under your cursor
-- 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')
@ -488,11 +513,11 @@ require('lazy').setup({
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
-- Opens a popup that displays documentation about the word under your cursor
-- See `:help K` for why this keymap
-- See `:help K` for why this keymap.
map('K', vim.lsp.buf.hover, 'Hover Documentation')
-- WARN: This is not Goto Definition, this is Goto Declaration.
-- For example, in C this would take you to the header
-- For example, in C this would take you to the header.
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
-- The following two autocommands are used to highlight references of the
@ -502,21 +527,42 @@ require('lazy').setup({
-- When you move your cursor, the highlights will be cleared (the second autocommand).
local client = vim.lsp.get_client_by_id(event.data.client_id)
if client and client.server_capabilities.documentHighlightProvider then
local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
buffer = event.buf,
group = highlight_augroup,
callback = vim.lsp.buf.document_highlight,
})
vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {
buffer = event.buf,
group = highlight_augroup,
callback = vim.lsp.buf.clear_references,
})
end
-- The following autocommand is used to enable inlay hints in your
-- code, if the language server you are using supports them
--
-- This may be unwanted, since they displace some of your code
if client and client.server_capabilities.inlayHintProvider and vim.lsp.inlay_hint then
map('<leader>th', function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
end, '[T]oggle Inlay [H]ints')
end
end,
})
vim.api.nvim_create_autocmd('LspDetach', {
group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }),
callback = function(event)
vim.lsp.buf.clear_references()
vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event.buf }
end,
})
-- LSP servers and clients are able to communicate to each other what features they support.
-- By default, Neovim doesn't support everything that is in the LSP Specification.
-- By default, Neovim doesn't support everything that is in the LSP specification.
-- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities.
-- So, we create new capabilities with nvim cmp, and then broadcast that to the servers.
local capabilities = vim.lsp.protocol.make_client_capabilities()
@ -547,21 +593,12 @@ require('lazy').setup({
lua_ls = {
-- cmd = {...},
-- filetypes { ...},
-- filetypes = { ...},
-- capabilities = {},
settings = {
Lua = {
runtime = { version = 'LuaJIT' },
workspace = {
checkThirdParty = false,
-- Tells lua_ls where to find all the Lua files that you have loaded
-- for your neovim configuration.
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 },
completion = {
callSnippet = 'Replace',
},
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
-- diagnostics = { disable = { 'missing-fields' } },
@ -575,14 +612,14 @@ require('lazy').setup({
-- other tools, you can run
-- :Mason
--
-- You can press `g?` for help in this menu
-- You can press `g?` for help in this menu.
require('mason').setup()
-- You can add other tools here that you want Mason to install
-- for you, so that they are available from within Neovim.
local ensure_installed = vim.tbl_keys(servers or {})
vim.list_extend(ensure_installed, {
'stylua', -- Used to format lua code
'stylua', -- Used to format Lua code
})
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
@ -590,15 +627,11 @@ require('lazy').setup({
handlers = {
function(server_name)
local server = servers[server_name] or {}
require('lspconfig')[server_name].setup {
cmd = server.cmd,
settings = server.settings,
filetypes = server.filetypes,
-- This handles overriding only values explicitly passed
-- by the server configuration above. Useful when disabling
-- certain features of an LSP (for example, turning off formatting for tsserver)
capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}),
}
-- This handles overriding only values explicitly passed
-- by the server configuration above. Useful when disabling
-- certain features of an LSP (for example, turning off formatting for tsserver)
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
require('lspconfig')[server_name].setup(server)
end,
},
}
@ -607,12 +640,29 @@ require('lazy').setup({
{ -- Autoformat
'stevearc/conform.nvim',
lazy = false,
keys = {
{
'<leader>f',
function()
require('conform').format { async = true, lsp_fallback = true }
end,
mode = '',
desc = '[F]ormat buffer',
},
},
opts = {
notify_on_error = false,
format_on_save = {
timeout_ms = 500,
lsp_fallback = 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
-- languages here or re-enable it for the disabled ones.
local disable_filetypes = { c = true, cpp = true }
return {
timeout_ms = 500,
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
}
end,
formatters_by_ft = {
lua = { 'stylua' },
-- Conform can also run multiple formatters sequentially
@ -633,14 +683,25 @@ require('lazy').setup({
{
'L3MON4D3/LuaSnip',
build = (function()
-- Build Step is needed for regex support in snippets
-- This step is not supported in many windows environments
-- Remove the below condition to re-enable on windows
-- Build Step is needed for regex support in snippets.
-- This step is not supported in many windows environments.
-- Remove the below condition to re-enable on windows.
if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then
return
end
return 'make install_jsregexp'
end)(),
dependencies = {
-- `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,
-- },
},
},
'saadparwaiz1/cmp_luasnip',
@ -649,12 +710,6 @@ require('lazy').setup({
-- into multiple repos for maintenance purposes.
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-path',
-- If you want to add a bunch of pre-configured snippets,
-- you can use this plugin to help you. It even has snippets
-- for various frameworks/libraries/etc. but you will have to
-- set up the ones that are useful for you.
-- 'rafamadriz/friendly-snippets',
},
config = function()
-- See `:help cmp`
@ -680,11 +735,21 @@ require('lazy').setup({
-- Select the [p]revious item
['<C-p>'] = cmp.mapping.select_prev_item(),
-- Scroll the documentation window [b]ack / [f]orward
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
-- Accept ([y]es) the completion.
-- This will auto-import if your LSP supports it.
-- This will expand snippets if the LSP sent a snippet.
['<C-y>'] = cmp.mapping.confirm { select = true },
-- 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(),
-- Manually trigger a completion from nvim-cmp.
-- Generally you don't need this, because nvim-cmp will display
-- completions whenever it has completion options available.
@ -708,6 +773,9 @@ require('lazy').setup({
luasnip.jump(-1)
end
end, { 'i', 's' }),
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
},
sources = {
{ name = 'nvim_lsp' },
@ -720,23 +788,24 @@ require('lazy').setup({
{ -- You can easily change to a different colorscheme.
-- Change the name of the colorscheme plugin below, and then
-- change the command in the config to whatever the name of that colorscheme is
-- change the command in the config to whatever the name of that colorscheme is.
--
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
'folke/tokyonight.nvim',
lazy = false, -- make sure we load this during startup if it is your main colorscheme
priority = 1000, -- make sure to load this before all the other start plugins
config = function()
-- Load the colorscheme here
priority = 1000, -- Make sure to load this before all the other start plugins.
init = function()
-- Load the colorscheme here.
-- Like many other themes, this one has different styles, and you could load
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
vim.cmd.colorscheme 'tokyonight-night'
-- You can configure highlights by doing something like
-- You can configure highlights by doing something like:
vim.cmd.hi 'Comment gui=none'
end,
},
-- Highlight todo, notes, etc in comments
{ 'folke/todo-comments.nvim', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
{ -- Collection of various small independent plugins/modules
'echasnovski/mini.nvim',
@ -744,7 +813,7 @@ require('lazy').setup({
-- Better Around/Inside textobjects
--
-- Examples:
-- - va) - [V]isually select [A]round [)]parenthen
-- - va) - [V]isually select [A]round [)]paren
-- - yinq - [Y]ank [I]nside [N]ext [']quote
-- - ci' - [C]hange [I]nside [']quote
require('mini.ai').setup { n_lines = 500 }
@ -759,32 +828,50 @@ require('lazy').setup({
-- Simple and easy statusline.
-- You could remove this setup call if you don't like it,
-- and try some other statusline plugin
require('mini.statusline').setup()
local statusline = require 'mini.statusline'
-- set use_icons to true if you have a Nerd Font
statusline.setup { use_icons = vim.g.have_nerd_font }
-- You can configure sections in the statusline by overriding their
-- default behavior. For example, here we set the section for
-- cursor location to LINE:COLUMN
---@diagnostic disable-next-line: duplicate-set-field
statusline.section_location = function()
return '%2l:%-2v'
end
-- ... and there is more!
-- Check out: https://github.com/echasnovski/mini.nvim
end,
},
{ -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
config = function()
opts = {
ensure_installed = { 'bash', 'c', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' },
-- Autoinstall languages that are not installed
auto_install = true,
highlight = {
enable = true,
-- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules.
-- If you are experiencing weird indenting issues, add the language to
-- the list of additional_vim_regex_highlighting and disabled languages for indent.
additional_vim_regex_highlighting = { 'ruby' },
},
indent = { enable = true, disable = { 'ruby' } },
},
config = function(_, opts)
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
-- Prefer git instead of curl in order to improve connectivity in some environments
require('nvim-treesitter.install').prefer_git = true
---@diagnostic disable-next-line: missing-fields
require('nvim-treesitter.configs').setup {
ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' },
-- Autoinstall languages that are not installed
auto_install = true,
highlight = { enable = true },
indent = { enable = true },
}
require('nvim-treesitter.configs').setup(opts)
-- There are additional nvim-treesitter modules that you can use to interact
-- with nvim-treesitter. You should go explore a few and see what interests you:
--
-- - Incremental selection: Included, see :help nvim-treesitter-incremental-selection-mod
-- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod`
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
end,
@ -792,23 +879,50 @@ require('lazy').setup({
-- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the
-- init.lua. If you want these files, they are in the repository, so you can just download them and
-- put them in the right spots if you want.
-- place them in the correct locations.
-- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for kickstart
-- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for Kickstart
--
-- Here are some example plugins that I've included in the kickstart repository.
-- 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
-- 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.
-- 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' },
}, {})
}, {
ui = {
-- If you are using a Nerd Font: set icons to an empty table which will use the
-- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table
icons = vim.g.have_nerd_font and {} or {
cmd = '',
config = '🛠',
event = '📅',
ft = '📂',
init = '',
keys = '🗝',
plugin = '🔌',
runtime = '💻',
require = '🌙',
source = '📄',
start = '🚀',
task = '📌',
lazy = '💤 ',
},
},
})
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4

View File

@ -6,15 +6,16 @@
--]]
local check_version = function()
local verstr = string.format('%s.%s.%s', vim.version().major, vim.version().minor, vim.version().patch)
if not vim.version.cmp then
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", tostring(vim.version())))
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
return
end
if vim.version.cmp(vim.version(), { 0, 9, 4 }) >= 0 then
vim.health.ok(string.format("Neovim version is: '%s'", tostring(vim.version())))
vim.health.ok(string.format("Neovim version is: '%s'", verstr))
else
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", tostring(vim.version())))
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
end
end

View File

@ -0,0 +1,16 @@
-- autopairs
-- https://github.com/windwp/nvim-autopairs
return {
'windwp/nvim-autopairs',
event = 'InsertEnter',
-- Optional dependency
dependencies = { 'hrsh7th/nvim-cmp' },
config = function()
require('nvim-autopairs').setup {}
-- If you want to automatically add `(` after selecting a function or method
local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
local cmp = require 'cmp'
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
end,
}

View File

@ -14,6 +14,9 @@ return {
-- Creates a beautiful debugger UI
'rcarriga/nvim-dap-ui',
-- Required dependency for nvim-dap-ui
'nvim-neotest/nvim-nio',
-- Installs the debug adapters for you
'williamboman/mason.nvim',
'jay-babu/mason-nvim-dap.nvim',

View File

@ -0,0 +1,61 @@
-- Adds git related signs to the gutter, as well as utilities for managing changes
-- NOTE: gitsigns is already included in init.lua but contains only the base
-- config. This will add also the recommended keymaps.
return {
{
'lewis6991/gitsigns.nvim',
opts = {
on_attach = function(bufnr)
local gitsigns = require 'gitsigns'
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
-- Navigation
map('n', ']c', function()
if vim.wo.diff then
vim.cmd.normal { ']c', bang = true }
else
gitsigns.nav_hunk 'next'
end
end, { desc = 'Jump to next git [c]hange' })
map('n', '[c', function()
if vim.wo.diff then
vim.cmd.normal { '[c', bang = true }
else
gitsigns.nav_hunk 'prev'
end
end, { desc = 'Jump to previous git [c]hange' })
-- Actions
-- visual mode
map('v', '<leader>hs', function()
gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' }
end, { desc = 'stage git hunk' })
map('v', '<leader>hr', function()
gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
end, { desc = 'reset git hunk' })
-- normal mode
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
map('n', '<leader>hu', gitsigns.undo_stage_hunk, { desc = 'git [u]ndo stage hunk' })
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
map('n', '<leader>hD', function()
gitsigns.diffthis '@'
end, { desc = 'git [D]iff against last commit' })
-- Toggles
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
map('n', '<leader>tD', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' })
end,
},
},
}

View File

@ -0,0 +1,55 @@
return {
{ -- Linting
'mfussenegger/nvim-lint',
event = { 'BufReadPre', 'BufNewFile' },
config = function()
local lint = require 'lint'
lint.linters_by_ft = {
markdown = { 'markdownlint' },
}
-- To allow other plugins to add linters to require('lint').linters_by_ft,
-- instead set linters_by_ft like this:
-- lint.linters_by_ft = lint.linters_by_ft or {}
-- lint.linters_by_ft['markdown'] = { 'markdownlint' }
--
-- However, note that this will enable a set of default linters,
-- which will cause errors unless these tools are available:
-- {
-- clojure = { "clj-kondo" },
-- dockerfile = { "hadolint" },
-- inko = { "inko" },
-- janet = { "janet" },
-- json = { "jsonlint" },
-- markdown = { "vale" },
-- rst = { "vale" },
-- ruby = { "ruby" },
-- terraform = { "tflint" },
-- text = { "vale" }
-- }
--
-- You can disable the default linters by setting their filetypes to nil:
-- lint.linters_by_ft['clojure'] = nil
-- lint.linters_by_ft['dockerfile'] = nil
-- lint.linters_by_ft['inko'] = nil
-- lint.linters_by_ft['janet'] = nil
-- lint.linters_by_ft['json'] = nil
-- lint.linters_by_ft['markdown'] = nil
-- lint.linters_by_ft['rst'] = nil
-- lint.linters_by_ft['ruby'] = nil
-- lint.linters_by_ft['terraform'] = nil
-- lint.linters_by_ft['text'] = nil
-- Create autocommand which carries out the actual linting
-- on the specified events.
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
group = lint_augroup,
callback = function()
require('lint').try_lint()
end,
})
end,
},
}

View File

@ -0,0 +1,25 @@
-- Neo-tree is a Neovim plugin to browse the file system
-- https://github.com/nvim-neo-tree/neo-tree.nvim
return {
'nvim-neo-tree/neo-tree.nvim',
version = '*',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
'MunifTanjim/nui.nvim',
},
cmd = 'Neotree',
keys = {
{ '\\', ':Neotree reveal<CR>', { desc = 'NeoTree reveal' } },
},
opts = {
filesystem = {
window = {
mappings = {
['\\'] = 'close_window',
},
},
},
},
}