Compare commits

...

33 commits

Author SHA1 Message Date
Peter Tillemans
5c41c92563 fix java-refactor 2024-05-16 10:23:43 +02:00
Peter Tillemans
94834be9e3 add java support 2024-04-29 15:01:27 +02:00
0e61350c91 use zbirenbaum copilot cmp integration 2024-03-16 02:01:13 +01:00
Damjan 9000
d34281a630 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-16 01:27:51 +01:00
stgpepper
2ace500d85 Update README.md (#763)
Added file text to code block for consistency since the other plugin had file also inside code block.
2024-03-16 01:27:51 +01:00
TJ DeVries
9009dfc7c9 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-16 01:27:51 +01:00
TJ DeVries
368b0afe00 doc: add note about advanced luasnip features 2024-03-16 01:27:51 +01:00
Vladislav Grechannik
d5006f9407 Move friendly snippets to dependencies of LuaSnip (#759)
Co-authored-by: TJ DeVries <devries.timothyj@gmail.com>
2024-03-16 01:27:43 +01:00
Rafael Zasas
68ad1b63f9 Add <C-b>/<C-f> cmp mapping to scroll cmp docs (#750) 2024-03-16 01:25:23 +01:00
TLW
c9c8fa82af doc: add info about timeoutlen (#691)
Add separate comment for `timeoutlen` option
`timeoutlen` option was under unrelated comment with `updatetime` option.
2024-03-16 01:25:23 +01:00
Chris Patti
6570754479 Revert "Use cmp-nvim-lua as nvim-cmp source for neovim Lua API (#696)" (#755)
This reverts commit d8a1dbc4b40fc018f254be3f060061d90ad35185.
2024-03-16 01:25:23 +01:00
James Karefylakis
0d662bdbee 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-16 01:25:23 +01:00
Damjan 9000
1bca80e56a 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-16 01:25:23 +01:00
Chiller Dragon
03a2ca3273 chore: rename <C-T> to <C-t> for consistency (#719) 2024-03-16 01:25:23 +01:00
Ryan Baumgardner
fd18ddfd0a feat: allow treesitter defaults to be overwritten from custom directory (#732) 2024-03-16 01:25:23 +01:00
Damjan 9000
51889f5ac7 README.md: update neo-tree example - remove legacy setting (#744) 2024-03-16 01:25:23 +01:00
4795540b7d personalize kickstart 2024-03-11 15:31:17 +01: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
3 changed files with 258 additions and 92 deletions

View file

@ -27,6 +27,8 @@ If you are experiencing issues, please make sure you have the latest versions.
External Requirements: External Requirements:
- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`) - Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`)
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation) - [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: - Language Setup:
- If want to write Typescript, you need `npm` - If want to write Typescript, you need `npm`
- If want to write Golang, you will need `go` - If want to write Golang, you will need `go`
@ -43,6 +45,8 @@ Neovim's configurations are located under the following paths, depending on your
| 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\` |
### Install Kickstart
Clone kickstart.nvim: Clone kickstart.nvim:
<details><summary> Linux and Mac </summary> <details><summary> Linux and Mac </summary>
@ -85,21 +89,21 @@ information about extending and exploring Neovim.
### Getting Started ### Getting Started
See [Effective Neovim: Instant IDE](https://youtu.be/stqUbv-5u2s), covering the [The Only Video You Need to Get Started with Neovim](https://youtu.be/m8C0Cq9Uv9o)
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 ### Recommended Steps
[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo [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 (so that you have your own copy that you can modify) and then install. You
can install to your machine using the methods above. can install it on your machine using the methods above.
> **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`
#### Examples of adding popularly requested plugins #### Examples of adding popularly requested plugins
NOTE: You'll need to uncomment the line in the init.lua that turns on loading custom plugins.
<details> <details>
<summary>Adding autopairs</summary> <summary>Adding autopairs</summary>
@ -131,13 +135,12 @@ return {
<details> <details>
<summary>Adding a file tree plugin</summary> <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. This will install the tree plugin and add the command `:Neotree` for you. For more information, see the documentation at [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim).
In the file: `lua/custom/plugins/filetree.lua`, add: In the file: `lua/custom/plugins/filetree.lua`, add:
```lua ```lua
-- Unless you are still migrating, remove the deprecated commands from v1.x -- File: lua/custom/plugins/filetree.lua
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
return { return {
"nvim-neo-tree/neo-tree.nvim", "nvim-neo-tree/neo-tree.nvim",
@ -158,10 +161,10 @@ return {
### 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 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/` * 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? * 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' alias nvim-kickstart='NVIM_APPNAME="nvim-kickstart" nvim'
``` ```
@ -170,9 +173,9 @@ return {
* See [lazy.nvim uninstall](https://github.com/folke/lazy.nvim#-uninstalling) information * 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? * 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 * 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` 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: same functionality is available here:
* [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim) * [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim)
* Discussions on this topic can be found here: * Discussions on this topic can be found here:
@ -181,14 +184,32 @@ return {
### Windows Installation ### Windows Installation
Installation may require installing build tools, and updating the run command for `telescope-fzf-native` 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) See `telescope-fzf-native` documentation for [more details](https://github.com/nvim-telescope/telescope-fzf-native.nvim#installation)
This requires: This requires:
- Install CMake, and the Microsoft C++ Build Tools on Windows - Install CMake and the Microsoft C++ Build Tools on Windows
```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' }
``` ```
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
```
Then, continue with the [Install Kickstart](#Install-Kickstart) step.

286
init.lua
View file

@ -63,7 +63,7 @@ Kickstart Guide:
This should be the first place you go to look when you're stuck or confused 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, MOST IMPORTANTLY, we provide a keymap "<spa e>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 sure exactly what you're looking for.
I have left several `:help X` comments throughout the init.lua I have left several `:help X` comments throughout the init.lua
@ -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.mapleader = ' '
vim.g.maplocalleader = ' ' vim.g.maplocalleader = ' '
-- Set to true if you have a Nerd Font installed
vim.g.have_nerd_font = true
-- [[ Setting options ]] -- [[ Setting options ]]
-- See `:help vim.opt` -- See `:help vim.opt`
-- NOTE: You can change these options as you wish! -- NOTE: You can change these options as you wish!
@ -127,6 +130,9 @@ vim.opt.signcolumn = 'yes'
-- Decrease update time -- Decrease update time
vim.opt.updatetime = 250 vim.opt.updatetime = 250
-- Decrease mapped sequence wait time
-- Displays which-key popup sooner
vim.opt.timeoutlen = 300 vim.opt.timeoutlen = 300
-- Configure how new splits should be opened -- Configure how new splits should be opened
@ -134,8 +140,8 @@ vim.opt.splitright = true
vim.opt.splitbelow = true vim.opt.splitbelow = true
-- Sets how neovim will display certain whitespace in the editor. -- Sets how neovim will display certain whitespace in the editor.
-- See :help 'list' -- See `:help 'list'`
-- and :help 'listchars' -- and `:help 'listchars'`
vim.opt.list = true vim.opt.list = true
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '' } vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '' }
@ -151,6 +157,9 @@ vim.opt.scrolloff = 10
-- [[ Basic Keymaps ]] -- [[ Basic Keymaps ]]
-- See `:help vim.keymap.set()` -- See `:help vim.keymap.set()`
-- duplicate command mode without need for shift
vim.keymap.set('n', ';', ':', { desc = 'enter command mode', nowait = true })
-- Set highlight on search, but clear on pressing <Esc> in normal mode -- Set highlight on search, but clear on pressing <Esc> in normal mode
vim.opt.hlsearch = true vim.opt.hlsearch = true
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>') vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
@ -184,8 +193,38 @@ vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right win
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' }) vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
vim.keymap.set('n', '<C-d>', '<C-d>zz', { desc = 'scroll down centered' })
vim.keymap.set('n', '<C-u>', '<C-u>zz', { desc = 'scroll down centered' })
vim.keymap.set('n', 'J', 'mzJ`z', { desc = 'Join lines keep cursor position' })
vim.keymap.set('n', 'n', 'nzzzv', { desc = 'search forward centered' })
vim.keymap.set('n', 'N', 'Nzzzv', { desc = 'search backward centered' })
vim.keymap.set('n', '<leader>y', '"+y', { desc = 'yank to system clipboard' })
vim.keymap.set('n', '<leader>Y', '"+Y', { desc = 'yank lines to system clipboard' })
vim.keymap.set('n', '<leader>d', '_d', { desc = 'delete to void register' })
vim.keymap.set('n', '<C-f>', '<cmd>silent !tmux neww tmux-sessionizer<CR>', { desc = 'switch projects when using tmux' })
vim.keymap.set('n', '<leader>s', ':%s/<C-r><C-w>/<C-r><C-w>/gI<Left><Left><Left>', { desc = 'replace word under cursor' })
vim.keymap.set('n', '<leader>cm', ':%s/\\r$//g<CR>', { desc = 'Remove CR from end of line' })
vim.keymap.set('n', '<leader>x', '<cmd>!chmod +x %<CR>', { desc = 'set execute bit on open script' })
vim.keymap.set('n', 'x', '"_x', { desc = 'del char keep clip' })
vim.keymap.set('n', 'X', '"_X', { desc = 'del char keep clip' })
vim.keymap.set('n', '<leader>cr', function()
require('nvchad.renamer').open()
end, { desc = 'LSP Rename' })
vim.keymap.set('v', 'J', ":m '>+1<CR>gv=gv", { desc = 'Move selected text down' })
vim.keymap.set('v', 'K', ":m '<-2<CR>gv=gv", { desc = 'Move selected text up' })
vim.keymap.set('v', '<C-c>', '<Esc>', { desc = 'exit vertical edit mode' })
vim.keymap.set('i', 'jk', '<ESC>')
vim.keymap.set('t', 'jk', '<C-\\><C-n>')
-- [[ Basic Autocommands ]] -- [[ Basic Autocommands ]]
-- See :help lua-guide-autocommands -- See `:help lua-guide-autocommands`
-- Highlight when yanking (copying) text -- Highlight when yanking (copying) text
-- Try it with `yap` in normal mode -- Try it with `yap` in normal mode
@ -219,7 +258,6 @@ vim.opt.rtp:prepend(lazypath)
-- --
-- NOTE: Here is where you install your plugins. -- NOTE: Here is where you install your plugins.
require('lazy').setup({ require('lazy').setup({
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
@ -232,7 +270,7 @@ require('lazy').setup({
-- This is equivalent to: -- This is equivalent to:
-- require('Comment').setup({}) -- require('Comment').setup({})
-- "gc" to comment visual regions/lines -- "gc" to com ent visual regions/lines
{ 'numToStr/Comment.nvim', opts = {} }, { 'numToStr/Comment.nvim', opts = {} },
-- Here is a more advanced example where we pass configuration -- Here is a more advanced example where we pass configuration
@ -253,16 +291,51 @@ require('lazy').setup({
}, },
}, },
{
'NeogitOrg/neogit',
dependencies = {
'nvim-lua/plenary.nvim', -- required
'sindrets/diffview.nvim', -- optional - Diff integration
-- Only one of these is needed, not both.
'nvim-telescope/telescope.nvim', -- optional
},
config = true,
},
{
'nvim-java/nvim-java',
dependencies = {
'nvim-java/lua-async-await',
'nvim-java/nvim-java-refactor',
'nvim-java/nvim-java-core',
'nvim-java/nvim-java-test',
'nvim-java/nvim-java-dap',
'MunifTanjim/nui.nvim',
'neovim/nvim-lspconfig',
'mfussenegger/nvim-dap',
{
'williamboman/mason.nvim',
opts = {
registries = {
'github:nvim-java/mason-registry',
'github:mason-org/mason-registry',
},
},
},
},
},
-- 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 -- 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. -- lazy loading plugins that don't need to be loaded immediately at startup.
-- --
-- For example, in the following configuration, we use: -- 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 -- which loads which-key before all the UI elements are loaded. Events can be
-- normal autocommands events (:help autocomd-events). -- normal autocommands events (`:help autocmd-events`).
-- --
-- Then, because we use the `config` key, the configuration only runs -- Then, because we use the `config` key, the configuration only runs
-- after the plugin has been loaded: -- after the plugin has been loaded:
@ -270,7 +343,7 @@ require('lazy').setup({
{ -- Useful plugin to show you pending keybinds. { -- Useful plugin to show you pending keybinds.
'folke/which-key.nvim', '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 config = function() -- This is the function that runs, AFTER loading
require('which-key').setup() require('which-key').setup()
@ -294,7 +367,7 @@ require('lazy').setup({
{ -- Fuzzy Finder (files, lsp, etc) { -- Fuzzy Finder (files, lsp, etc)
'nvim-telescope/telescope.nvim', 'nvim-telescope/telescope.nvim',
event = 'VeryLazy', event = 'VimEnter',
branch = '0.1.x', branch = '0.1.x',
dependencies = { dependencies = {
'nvim-lua/plenary.nvim', 'nvim-lua/plenary.nvim',
@ -313,14 +386,12 @@ require('lazy').setup({
}, },
{ 'nvim-telescope/telescope-ui-select.nvim' }, { 'nvim-telescope/telescope-ui-select.nvim' },
-- Useful for getting pretty icons, but requires special font. -- Useful for getting pretty icons, but requires a Nerd Font.
-- If you already have a Nerd Font, or terminal set up with fallback fonts { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
-- you can enable this
-- { 'nvim-tree/nvim-web-devicons' }
}, },
config = function() config = function()
-- Telescope is a fuzzy finder that comes with a lot of different things that -- 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 -- it can fuzzy find! It's more than just a "fi e finder", it can search
-- many different aspects of Neovim, your workspace, LSP, and more! -- 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:
@ -328,13 +399,6 @@ require('lazy').setup({
-- --
-- After running this command, a window will open up and you're able to -- 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:
-- - 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! -- do as well as how to actually do it!
@ -410,6 +474,10 @@ require('lazy').setup({
-- 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 = {} },
-- `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() config = function()
-- Brief Aside: **What is LSP?** -- Brief Aside: **What is LSP?**
@ -435,7 +503,7 @@ require('lazy').setup({
-- Neovim. This is where `mason` and related plugins come into play. -- 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 -- 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. -- 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 -- That is to say, every time a new file is opened that is associated with
@ -456,7 +524,7 @@ require('lazy').setup({
-- Jump to the definition of the word under your cursor. -- 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. -- 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') map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
-- Find references for the word under your cursor. -- Find references for the word under your cursor.
@ -532,10 +600,9 @@ require('lazy').setup({
-- - settings (table): Override the default settings passed when initializing the server. -- - settings (table): Override the default settings passed when initializing the server.
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
local servers = { local servers = {
-- clangd = {}, clangd = {},
-- gopls = {}, cssls = {},
-- pyright = {}, gopls = {},
-- rust_analyzer = {},
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
-- --
-- Some languages (like typescript) have entire language plugins that can be useful: -- Some languages (like typescript) have entire language plugins that can be useful:
@ -544,32 +611,30 @@ require('lazy').setup({
-- But for many setups, the LSP (`tsserver`) will work just fine -- But for many setups, the LSP (`tsserver`) will work just fine
-- tsserver = {}, -- tsserver = {},
-- --
lua_ls = { lua_ls = {
-- cmd = {...}, -- cmd = {...},
-- filetypes { ...}, -- filetypes { ...},
-- capabilities = {}, -- capabilities = {},
settings = { settings = {
Lua = { Lua = {
runtime = { version = 'LuaJIT' }, completion = {
workspace = { callSnippet = 'Replace',
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 },
}, },
-- 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' } },
}, },
}, },
}, },
html = { filetypes = { 'html', 'twig', 'hbs' } },
htmx = {},
pyright = {},
rust_analyzer = {},
yamlls = {},
} }
-- Setup java before lspconfig
require('java').setup()
-- Ensure the servers and tools above are installed -- Ensure the servers and tools above are installed
-- To check the current status of installed tools and/or manually install -- To check the current status of installed tools and/or manually install
-- other tools, you can run -- other tools, you can run
@ -590,18 +655,16 @@ require('lazy').setup({
handlers = { handlers = {
function(server_name) function(server_name)
local server = servers[server_name] or {} local server = servers[server_name] or {}
require('lspconfig')[server_name].setup { -- This handles overriding only values explicitly passed
cmd = server.cmd, -- by the server configuration above. Useful when disabling
settings = server.settings, -- certain features of an LSP (for example, turning off formatting for tsserver)
filetypes = server.filetypes, server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
-- This handles overriding only values explicitly passed require('lspconfig')[server_name].setup(server)
-- 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 {}),
}
end, end,
}, },
} }
require('lspconfig').jdtls.setup {}
end, end,
}, },
@ -609,10 +672,16 @@ require('lazy').setup({
'stevearc/conform.nvim', 'stevearc/conform.nvim',
opts = { opts = {
notify_on_error = false, notify_on_error = false,
format_on_save = { format_on_save = function(bufnr)
timeout_ms = 500, -- Disable "format_on_save lsp_fallback" for languages that don't
lsp_fallback = true, -- 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 = { formatters_by_ft = {
lua = { 'stylua' }, lua = { 'stylua' },
-- Conform can also run multiple formatters sequentially -- Conform can also run multiple formatters sequentially
@ -625,6 +694,13 @@ require('lazy').setup({
}, },
}, },
{ -- copilot
'zbirenbaum/copilot.lua',
cmd = 'Copilot',
event = 'InsertEnter',
opts = {},
},
{ -- Autocompletion { -- Autocompletion
'hrsh7th/nvim-cmp', 'hrsh7th/nvim-cmp',
event = 'InsertEnter', event = 'InsertEnter',
@ -641,6 +717,17 @@ require('lazy').setup({
end end
return 'make install_jsregexp' return 'make install_jsregexp'
end)(), 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', 'saadparwaiz1/cmp_luasnip',
@ -655,6 +742,14 @@ require('lazy').setup({
-- for various frameworks/libraries/etc. but you will have to -- for various frameworks/libraries/etc. but you will have to
-- set up the ones that are useful for you. -- set up the ones that are useful for you.
-- 'rafamadriz/friendly-snippets', -- 'rafamadriz/friendly-snippets',
-- add copilot support
{
'zbirenbaum/copilot-cmp',
config = function()
require('copilot_cmp').setup()
end,
},
}, },
config = function() config = function()
-- See `:help cmp` -- See `:help cmp`
@ -680,6 +775,10 @@ require('lazy').setup({
-- Select the [p]revious item -- Select the [p]revious item
['<C-p>'] = cmp.mapping.select_prev_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. -- Accept ([y]es) the completion.
-- This will auto-import if your LSP supports it. -- This will auto-import if your LSP supports it.
-- This will expand snippets if the LSP sent a snippet. -- This will expand snippets if the LSP sent a snippet.
@ -708,12 +807,19 @@ require('lazy').setup({
luasnip.jump(-1) luasnip.jump(-1)
end end
end, { 'i', 's' }), 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 = { sources = {
{ name = 'nvim_lsp' }, { name = 'nvim_lsp' },
{ name = 'copilot' },
{ name = 'luasnip' }, { name = 'luasnip' },
{ name = 'path' }, { name = 'path' },
}, },
experimental = {
ghost_text = true,
},
} }
end, end,
}, },
@ -724,10 +830,11 @@ require('lazy').setup({
-- --
-- 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', '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 priority = 1000, -- make sure to load this before all the other start plugins
config = function() init = function()
-- Load the colorscheme here -- 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' vim.cmd.colorscheme 'tokyonight-night'
-- You can configure highlights by doing something like -- You can configure highlights by doing something like
@ -736,7 +843,7 @@ require('lazy').setup({
}, },
-- Highlight todo, notes, etc in comments -- 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 { -- Collection of various small independent plugins/modules
'echasnovski/mini.nvim', 'echasnovski/mini.nvim',
@ -744,7 +851,7 @@ require('lazy').setup({
-- Better Around/Inside textobjects -- Better Around/Inside textobjects
-- --
-- Examples: -- Examples:
-- - va) - [V]isually select [A]round [)]parenthen -- - va) - [V]isually select [A]round [)]paren
-- - 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 }
@ -759,7 +866,17 @@ require('lazy').setup({
-- Simple and easy statusline. -- Simple and easy statusline.
-- You could remove this setup call if you don't like it, -- You could remove this setup call if you don't like it,
-- and try some other statusline plugin -- 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! -- ... and there is more!
-- Check out: https://github.com/echasnovski/mini.nvim -- Check out: https://github.com/echasnovski/mini.nvim
@ -769,22 +886,29 @@ require('lazy').setup({
{ -- Highlight, edit, and navigate code { -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate', build = ':TSUpdate',
config = function() opts = {
ensure_installed = { 'bash', 'c', 'html', 'lua', '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` -- [[ Configure Treesitter ]] See `:help nvim-treesitter`
---@diagnostic disable-next-line: missing-fields ---@diagnostic disable-next-line: missing-fields
require('nvim-treesitter.configs').setup { require('nvim-treesitter.configs').setup(opts)
ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' },
-- Autoinstall languages that are not installed
auto_install = true,
highlight = { enable = true },
indent = { enable = true },
}
-- There are additional nvim-treesitter modules that you can use to interact -- 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: -- 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 -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
end, end,
@ -806,9 +930,29 @@ require('lazy').setup({
-- This is the easiest way to modularize your config. -- 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. -- 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' }, -- { import = 'custom.plugins' },
}, {}) }, {
ui = {
-- If you have 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` -- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et -- vim: ts=2 sts=2 sw=2 et

View file

@ -6,15 +6,16 @@
--]] --]]
local check_version = function() 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 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 return
end end
if vim.version.cmp(vim.version(), { 0, 9, 4 }) >= 0 then 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 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
end end