Compare commits
31 Commits
stable
...
bd4b8d0888
| Author | SHA1 | Date | |
|---|---|---|---|
| bd4b8d0888 | |||
| c9a2ff9699 | |||
| bdfe1b0c64 | |||
| 2c43d15c7d | |||
| f251b39d5a | |||
| 4fcf6d7010 | |||
| c1e234f1ac | |||
| 8a7cd58c74 | |||
| 87cdec67a4 | |||
| 43cc16d73a | |||
| 593752ff28 | |||
| bb0d2cf102 | |||
| 6846260101 | |||
| c6f50bd626 | |||
| e84927ba57 | |||
| 6d402a0901 | |||
| d9807a35b5 | |||
|
|
f2309053c7 | ||
|
|
d2844a4163 | ||
|
|
3338d39206 | ||
|
|
61e8b304e5 | ||
|
|
726fabc5d5 | ||
|
|
6ba2408cdf | ||
|
|
f5a9f9cdc6 | ||
|
|
fb73617653 | ||
|
|
c92ea7ca97 | ||
|
|
2b2f0f8364 | ||
|
|
76cb865e4f | ||
|
|
f8727376ad | ||
|
|
b226b49545 | ||
|
|
d350db2449 |
@@ -25,7 +25,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),
|
||||||
|
[fd-find](https://github.com/sharkdp/fd#installation)
|
||||||
- Clipboard tool (xclip/xsel/win32yank or other depending on the platform)
|
- Clipboard tool (xclip/xsel/win32yank or other depending on the platform)
|
||||||
- A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons
|
- 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
|
- if you have it set `vim.g.have_nerd_font` in `init.lua` to true
|
||||||
@@ -85,13 +86,13 @@ git clone https://github.com/dam9000/kickstart-modular.nvim.git "${XDG_CONFIG_HO
|
|||||||
If you're using `cmd.exe`:
|
If you're using `cmd.exe`:
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone https://github.com/dam9000/kickstart.nvim.git "%localappdata%\nvim"
|
git clone https://github.com/dam9000/kickstart-modular.nvim.git "%localappdata%\nvim"
|
||||||
```
|
```
|
||||||
|
|
||||||
If you're using `powershell.exe`
|
If you're using `powershell.exe`
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone https://github.com/dam9000/kickstart.nvim.git "${env:LOCALAPPDATA}\nvim"
|
git clone https://github.com/dam9000/kickstart-modular.nvim.git "${env:LOCALAPPDATA}\nvim"
|
||||||
```
|
```
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|||||||
7
init.lua
7
init.lua
@@ -91,7 +91,12 @@ vim.g.mapleader = ' '
|
|||||||
vim.g.maplocalleader = ' '
|
vim.g.maplocalleader = ' '
|
||||||
|
|
||||||
-- Set to true if you have a Nerd Font installed and selected in the terminal
|
-- Set to true if you have a Nerd Font installed and selected in the terminal
|
||||||
vim.g.have_nerd_font = false
|
vim.g.have_nerd_font = true
|
||||||
|
|
||||||
|
vim.o.tabstop = 4 -- A TAB character looks like 4 spaces
|
||||||
|
vim.o.expandtab = true -- Pressing the TAB key will insert spaces instead of a TAB character
|
||||||
|
vim.o.softtabstop = 4 -- Number of spaces inserted instead of a TAB character
|
||||||
|
vim.o.shiftwidth = 4 -- Number of spaces inserted when indenting
|
||||||
|
|
||||||
-- [[ Setting options ]]
|
-- [[ Setting options ]]
|
||||||
require 'options'
|
require 'options'
|
||||||
|
|||||||
64
lua/custom/plugins/harpoon.lua
Normal file
64
lua/custom/plugins/harpoon.lua
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
return {
|
||||||
|
'ThePrimeagen/harpoon',
|
||||||
|
branch = 'harpoon2',
|
||||||
|
dependecies = { 'nvim-lua/plenary.nvim' },
|
||||||
|
|
||||||
|
config = function()
|
||||||
|
local harpoon = require 'harpoon'
|
||||||
|
harpoon:setup()
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>a', function()
|
||||||
|
harpoon:list():add()
|
||||||
|
end)
|
||||||
|
vim.keymap.set('n', '<leader>e', function()
|
||||||
|
harpoon.ui:toggle_quick_menu(harpoon:list())
|
||||||
|
end)
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>í', function()
|
||||||
|
harpoon:list():select(1)
|
||||||
|
end)
|
||||||
|
vim.keymap.set('n', '<leader>y', function()
|
||||||
|
harpoon:list():select(2)
|
||||||
|
end)
|
||||||
|
vim.keymap.set('n', '<leader>x', function()
|
||||||
|
harpoon:list():select(3)
|
||||||
|
end)
|
||||||
|
vim.keymap.set('n', '<leader>c', function()
|
||||||
|
harpoon:list():select(4)
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- Toggle previous & next buffers stored within Harpoon list
|
||||||
|
vim.keymap.set('n', '<C-S-P>', function()
|
||||||
|
harpoon:list():prev()
|
||||||
|
end)
|
||||||
|
vim.keymap.set('n', '<C-S-N>', function()
|
||||||
|
harpoon:list():next()
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- basic telescope configuration
|
||||||
|
local conf = require('telescope.config').values
|
||||||
|
local function toggle_telescope(harpoon_files)
|
||||||
|
local file_paths = {}
|
||||||
|
for _, item in ipairs(harpoon_files.items) do
|
||||||
|
table.insert(file_paths, item.value)
|
||||||
|
end
|
||||||
|
|
||||||
|
require('telescope.pickers')
|
||||||
|
.new({}, {
|
||||||
|
prompt_title = 'Harpoon',
|
||||||
|
finder = require('telescope.finders').new_table {
|
||||||
|
results = file_paths,
|
||||||
|
},
|
||||||
|
previewer = conf.file_previewer {},
|
||||||
|
sorter = conf.generic_sorter {},
|
||||||
|
})
|
||||||
|
:find()
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<C-e>', function()
|
||||||
|
toggle_telescope(harpoon:list())
|
||||||
|
end, { desc = 'Open harpoon window' })
|
||||||
|
end,
|
||||||
|
|
||||||
|
--keymaps
|
||||||
|
}
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
-- You can add your own plugins here or in other files in this directory!
|
|
||||||
-- I promise not to create any merge conflicts in this directory :)
|
|
||||||
--
|
|
||||||
-- See the kickstart.nvim README for more information
|
|
||||||
return {}
|
|
||||||
126
lua/custom/plugins/unity.lua
Normal file
126
lua/custom/plugins/unity.lua
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
return {
|
||||||
|
'walcht/neovim-unity',
|
||||||
|
ft = { 'cs' },
|
||||||
|
dependencies = { 'neovim/nvim-lspconfig' }, -- Ensure lspconfig is loaded first
|
||||||
|
|
||||||
|
config = function()
|
||||||
|
local function on_init_sln(client, target)
|
||||||
|
vim.notify('Initializing: ' .. target, vim.log.levels.INFO)
|
||||||
|
---@diagnostic disable-next-line: param-type-mismatch
|
||||||
|
client:notify('solution/open', {
|
||||||
|
solution = vim.uri_from_fname(target),
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
local function on_init_project(client, project_files)
|
||||||
|
vim.notify('Initializing: projects', vim.log.levels.INFO)
|
||||||
|
---@diagnostic disable-next-line: param-type-mismatch
|
||||||
|
client:notify('project/open', {
|
||||||
|
projects = vim.tbl_map(function(file)
|
||||||
|
return vim.uri_from_fname(file)
|
||||||
|
end, project_files),
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
local function project_root_dir_discovery(bufnr, cb)
|
||||||
|
local bufname = vim.api.nvim_buf_get_name(bufnr)
|
||||||
|
if not bufname:match('^' .. vim.fs.joinpath '/tmp/MetadataAsSource/') then
|
||||||
|
local root_dir = vim.fs.root(bufnr, function(fname, _)
|
||||||
|
return fname:match '%.sln$' ~= nil
|
||||||
|
end)
|
||||||
|
|
||||||
|
if not root_dir then
|
||||||
|
root_dir = vim.fs.root(bufnr, function(fname, _)
|
||||||
|
return fname:match '%.csproj$' ~= nil
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
if root_dir then
|
||||||
|
cb(root_dir)
|
||||||
|
else
|
||||||
|
vim.notify('[C# LSP] failed to find root directory', vim.log.levels.ERROR)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local roslyn_handlers = {
|
||||||
|
['workspace/projectInitializationComplete'] = function(_, _, ctx)
|
||||||
|
vim.notify('Roslyn project initialization complete', vim.log.levels.INFO)
|
||||||
|
local buffers = vim.lsp.get_buffers_by_client_id(ctx.client_id)
|
||||||
|
local client = assert(vim.lsp.get_client_by_id(ctx.client_id))
|
||||||
|
for _, buf in ipairs(buffers) do
|
||||||
|
client:request(vim.lsp.protocol.Methods.textDocument_diagnostic, {
|
||||||
|
textDocument = vim.lsp.util.make_text_document_params(buf),
|
||||||
|
}, nil, buf)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
['workspace/_roslyn_projectNeedsRestore'] = function(_, result, ctx)
|
||||||
|
local client = assert(vim.lsp.get_client_by_id(ctx.client_id))
|
||||||
|
client:request('workspace/_roslyn_restore', result, function(err, response)
|
||||||
|
if err then
|
||||||
|
vim.notify(err.message, vim.log.levels.ERROR)
|
||||||
|
end
|
||||||
|
if response then
|
||||||
|
vim.notify('Restoring project...', vim.log.levels.INFO)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
return vim.NIL
|
||||||
|
end,
|
||||||
|
['razor/provideDynamicFileInfo'] = function(_, _, _)
|
||||||
|
-- Razor not supported
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
local roslyn_ls_config = {
|
||||||
|
name = 'roslyn_ls',
|
||||||
|
offset_encoding = 'utf-8',
|
||||||
|
cmd = {
|
||||||
|
'dotnet',
|
||||||
|
'$HOME/.config/roslylsp/Microsoft.CodeAnalysis.LanguageServer.dll',
|
||||||
|
'--logLevel=Error',
|
||||||
|
'--extensionLogDirectory=' .. vim.fs.dirname(vim.lsp.get_log_path()),
|
||||||
|
'--stdio',
|
||||||
|
},
|
||||||
|
filetypes = { 'cs' },
|
||||||
|
handlers = roslyn_handlers,
|
||||||
|
root_dir = project_root_dir_discovery,
|
||||||
|
on_init = function(client)
|
||||||
|
local root_dir = client.config.root_dir
|
||||||
|
for entry, type in vim.fs.dir(root_dir) do
|
||||||
|
if type == 'file' and vim.endswith(entry, '.sln') then
|
||||||
|
on_init_sln(client, vim.fs.joinpath(root_dir, entry))
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for entry, type in vim.fs.dir(root_dir) do
|
||||||
|
if type == 'file' and vim.endswith(entry, '.csproj') then
|
||||||
|
on_init_project(client, { vim.fs.joinpath(root_dir, entry) })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
capabilities = vim.lsp.protocol.make_client_capabilities(),
|
||||||
|
settings = {
|
||||||
|
['csharp|background_analysis'] = {
|
||||||
|
dotnet_analyzer_diagnostics_scope = 'fullSolution',
|
||||||
|
dotnet_compiler_diagnostics_scope = 'fullSolution',
|
||||||
|
},
|
||||||
|
['csharp|inlay_hints'] = {
|
||||||
|
csharp_enable_inlay_hints_for_types = true,
|
||||||
|
dotnet_enable_inlay_hints_for_parameters = true,
|
||||||
|
},
|
||||||
|
['csharp|completion'] = {
|
||||||
|
dotnet_show_name_completion_suggestions = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- NOTE: 'vim.lsp.config' does not exist in standard Neovim.
|
||||||
|
-- We use an autocommand to start the LSP when a C# file opens.
|
||||||
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
|
pattern = 'cs',
|
||||||
|
callback = function()
|
||||||
|
vim.lsp.start(roslyn_ls_config)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
@@ -17,10 +17,10 @@ vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagn
|
|||||||
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
|
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
|
||||||
|
|
||||||
-- TIP: Disable arrow keys in normal mode
|
-- TIP: Disable arrow keys in normal mode
|
||||||
-- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
|
vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
|
||||||
-- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
|
vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
|
||||||
-- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
|
vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
|
||||||
-- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
|
vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
|
||||||
|
|
||||||
-- Keybinds to make split navigation easier.
|
-- Keybinds to make split navigation easier.
|
||||||
-- Use CTRL+<hjkl> to switch between windows
|
-- Use CTRL+<hjkl> to switch between windows
|
||||||
@@ -40,14 +40,16 @@ vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper win
|
|||||||
-- [[ Basic Autocommands ]]
|
-- [[ Basic Autocommands ]]
|
||||||
-- See `:help lua-guide-autocommands`
|
-- See `:help lua-guide-autocommands`
|
||||||
|
|
||||||
|
vim.keymap.set('n', 'gl', vim.diagnostic.open_float, { desc = 'Show Error/Diagnostic' })
|
||||||
|
|
||||||
-- Highlight when yanking (copying) text
|
-- Highlight when yanking (copying) text
|
||||||
-- Try it with `yap` in normal mode
|
-- Try it with `yap` in normal mode
|
||||||
-- See `:help vim.highlight.on_yank()`
|
-- See `:help vim.hl.on_yank()`
|
||||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||||
desc = 'Highlight when yanking (copying) text',
|
desc = 'Highlight when yanking (copying) text',
|
||||||
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.highlight.on_yank()
|
vim.hl.on_yank()
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -4,13 +4,5 @@
|
|||||||
return {
|
return {
|
||||||
'windwp/nvim-autopairs',
|
'windwp/nvim-autopairs',
|
||||||
event = 'InsertEnter',
|
event = 'InsertEnter',
|
||||||
-- Optional dependency
|
opts = {},
|
||||||
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,
|
|
||||||
}
|
}
|
||||||
|
|||||||
101
lua/kickstart/plugins/blink-cmp.lua
Normal file
101
lua/kickstart/plugins/blink-cmp.lua
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
return {
|
||||||
|
{ -- Autocompletion
|
||||||
|
'saghen/blink.cmp',
|
||||||
|
event = 'VimEnter',
|
||||||
|
version = '1.*',
|
||||||
|
dependencies = {
|
||||||
|
-- Snippet Engine
|
||||||
|
{
|
||||||
|
'L3MON4D3/LuaSnip',
|
||||||
|
version = '2.*',
|
||||||
|
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.
|
||||||
|
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,
|
||||||
|
-- },
|
||||||
|
},
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
'folke/lazydev.nvim',
|
||||||
|
},
|
||||||
|
--- @module 'blink.cmp'
|
||||||
|
--- @type blink.cmp.Config
|
||||||
|
opts = {
|
||||||
|
keymap = {
|
||||||
|
-- 'default' (recommended) for mappings similar to built-in completions
|
||||||
|
-- <c-y> to accept ([y]es) the completion.
|
||||||
|
-- This will auto-import if your LSP supports it.
|
||||||
|
-- This will expand snippets if the LSP sent a snippet.
|
||||||
|
-- 'super-tab' for tab to accept
|
||||||
|
-- 'enter' for enter to accept
|
||||||
|
-- 'none' for no mappings
|
||||||
|
--
|
||||||
|
-- For an understanding of why the 'default' preset is recommended,
|
||||||
|
-- you will need to read `:help ins-completion`
|
||||||
|
--
|
||||||
|
-- No, but seriously. Please read `:help ins-completion`, it is really good!
|
||||||
|
--
|
||||||
|
-- All presets have the following mappings:
|
||||||
|
-- <tab>/<s-tab>: move to right/left of your snippet expansion
|
||||||
|
-- <c-space>: Open menu or open docs if already open
|
||||||
|
-- <c-n>/<c-p> or <up>/<down>: Select next/previous item
|
||||||
|
-- <c-e>: Hide menu
|
||||||
|
-- <c-k>: Toggle signature help
|
||||||
|
--
|
||||||
|
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||||
|
preset = 'default',
|
||||||
|
|
||||||
|
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
|
||||||
|
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
|
||||||
|
},
|
||||||
|
|
||||||
|
appearance = {
|
||||||
|
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
|
||||||
|
-- Adjusts spacing to ensure icons are aligned
|
||||||
|
nerd_font_variant = 'mono',
|
||||||
|
},
|
||||||
|
|
||||||
|
completion = {
|
||||||
|
-- By default, you may press `<c-space>` to show the documentation.
|
||||||
|
-- Optionally, set `auto_show = true` to show the documentation after a delay.
|
||||||
|
documentation = { auto_show = false, auto_show_delay_ms = 500 },
|
||||||
|
},
|
||||||
|
|
||||||
|
sources = {
|
||||||
|
default = { 'lsp', 'path', 'snippets', 'lazydev' },
|
||||||
|
providers = {
|
||||||
|
lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
snippets = { preset = 'luasnip' },
|
||||||
|
|
||||||
|
-- Blink.cmp includes an optional, recommended rust fuzzy matcher,
|
||||||
|
-- which automatically downloads a prebuilt binary when enabled.
|
||||||
|
--
|
||||||
|
-- By default, we use the Lua implementation instead, but you may enable
|
||||||
|
-- the rust implementation via `'prefer_rust_with_warning'`
|
||||||
|
--
|
||||||
|
-- See :h blink-cmp-config-fuzzy for more information
|
||||||
|
fuzzy = { implementation = 'lua' },
|
||||||
|
|
||||||
|
-- Shows a signature help window while you type arguments for a function
|
||||||
|
signature = { enabled = true },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
-- vim: ts=2 sts=2 sw=2 et
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
return {
|
|
||||||
{ -- Autocompletion
|
|
||||||
'hrsh7th/nvim-cmp',
|
|
||||||
event = 'InsertEnter',
|
|
||||||
dependencies = {
|
|
||||||
-- Snippet Engine & its associated nvim-cmp source
|
|
||||||
{
|
|
||||||
'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.
|
|
||||||
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',
|
|
||||||
|
|
||||||
-- Adds other completion capabilities.
|
|
||||||
-- nvim-cmp does not ship with all sources by default. They are split
|
|
||||||
-- into multiple repos for maintenance purposes.
|
|
||||||
'hrsh7th/cmp-nvim-lsp',
|
|
||||||
'hrsh7th/cmp-path',
|
|
||||||
'hrsh7th/cmp-nvim-lsp-signature-help',
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
-- See `:help cmp`
|
|
||||||
local cmp = require 'cmp'
|
|
||||||
local luasnip = require 'luasnip'
|
|
||||||
luasnip.config.setup {}
|
|
||||||
|
|
||||||
cmp.setup {
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
luasnip.lsp_expand(args.body)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
completion = { completeopt = 'menu,menuone,noinsert' },
|
|
||||||
|
|
||||||
-- For an understanding of why these mappings were
|
|
||||||
-- chosen, you will need to read `:help ins-completion`
|
|
||||||
--
|
|
||||||
-- No, but seriously. Please read `:help ins-completion`, it is really good!
|
|
||||||
mapping = cmp.mapping.preset.insert {
|
|
||||||
-- Select the [n]ext item
|
|
||||||
['<C-n>'] = cmp.mapping.select_next_item(),
|
|
||||||
-- 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.
|
|
||||||
['<C-Space>'] = cmp.mapping.complete {},
|
|
||||||
|
|
||||||
-- Think of <c-l> as moving to the right of your snippet expansion.
|
|
||||||
-- So if you have a snippet that's like:
|
|
||||||
-- function $name($args)
|
|
||||||
-- $body
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- <c-l> will move you to the right of each of the expansion locations.
|
|
||||||
-- <c-h> is similar, except moving you backwards.
|
|
||||||
['<C-l>'] = cmp.mapping(function()
|
|
||||||
if luasnip.expand_or_locally_jumpable() then
|
|
||||||
luasnip.expand_or_jump()
|
|
||||||
end
|
|
||||||
end, { 'i', 's' }),
|
|
||||||
['<C-h>'] = cmp.mapping(function()
|
|
||||||
if luasnip.locally_jumpable(-1) then
|
|
||||||
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 = 'lazydev',
|
|
||||||
-- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
|
|
||||||
group_index = 0,
|
|
||||||
},
|
|
||||||
{ name = 'nvim_lsp' },
|
|
||||||
{ name = 'luasnip' },
|
|
||||||
{ name = 'path' },
|
|
||||||
{ name = 'nvim_lsp_signature_help' },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
-- vim: ts=2 sts=2 sw=2 et
|
|
||||||
@@ -19,7 +19,7 @@ return {
|
|||||||
-- Disable "format_on_save lsp_fallback" for languages that don't
|
-- Disable "format_on_save lsp_fallback" for languages that don't
|
||||||
-- have a well standardized coding style. You can add additional
|
-- have a well standardized coding style. You can add additional
|
||||||
-- languages here or re-enable it for the disabled ones.
|
-- languages here or re-enable it for the disabled ones.
|
||||||
local disable_filetypes = { c = true, cpp = true }
|
local disable_filetypes = { c = false, cpp = false }
|
||||||
if disable_filetypes[vim.bo[bufnr].filetype] then
|
if disable_filetypes[vim.bo[bufnr].filetype] then
|
||||||
return nil
|
return nil
|
||||||
else
|
else
|
||||||
@@ -31,12 +31,20 @@ return {
|
|||||||
end,
|
end,
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
lua = { 'stylua' },
|
lua = { 'stylua' },
|
||||||
|
c = { 'clang-format' },
|
||||||
|
cpp = { 'clang-format' },
|
||||||
-- Conform can also run multiple formatters sequentially
|
-- Conform can also run multiple formatters sequentially
|
||||||
-- python = { "isort", "black" },
|
-- python = { "isort", "black" },
|
||||||
--
|
--
|
||||||
-- You can use 'stop_after_first' to run the first available formatter from the list
|
-- You can use 'stop_after_first' to run the first available formatter from the list
|
||||||
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||||
},
|
},
|
||||||
|
formatters = {
|
||||||
|
['clang-format'] = {
|
||||||
|
-- This argument forces 4-space indentation directly in the command
|
||||||
|
prepend_args = { '--style={IndentWidth: 4, TabWidth: 4, UseTab: Never, AccessModifierOffset: -4, ColumnLimit: 220}' },
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ return {
|
|||||||
'nvim-neotest/nvim-nio',
|
'nvim-neotest/nvim-nio',
|
||||||
|
|
||||||
-- Installs the debug adapters for you
|
-- Installs the debug adapters for you
|
||||||
'williamboman/mason.nvim',
|
'mason-org/mason.nvim',
|
||||||
'jay-babu/mason-nvim-dap.nvim',
|
'jay-babu/mason-nvim-dap.nvim',
|
||||||
|
|
||||||
-- Add your own debuggers here
|
-- Add your own debuggers here
|
||||||
@@ -81,6 +81,81 @@ return {
|
|||||||
local dap = require 'dap'
|
local dap = require 'dap'
|
||||||
local dapui = require 'dapui'
|
local dapui = require 'dapui'
|
||||||
|
|
||||||
|
dap.adapters['rust-gdb'] = {
|
||||||
|
type = 'executable',
|
||||||
|
command = 'rust-gdb',
|
||||||
|
args = { '--interpreter=dap', '--eval-command', 'set print pretty on' },
|
||||||
|
}
|
||||||
|
|
||||||
|
dap.configurations.rust = {
|
||||||
|
{
|
||||||
|
name = 'Launch',
|
||||||
|
type = 'rust-gdb',
|
||||||
|
request = 'launch',
|
||||||
|
program = function()
|
||||||
|
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||||
|
end,
|
||||||
|
args = {}, -- provide arguments if needed
|
||||||
|
cwd = '${workspaceFolder}',
|
||||||
|
stopAtBeginningOfMainSubprogram = false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'Select and attach to process',
|
||||||
|
type = 'rust-gdb',
|
||||||
|
request = 'attach',
|
||||||
|
program = function()
|
||||||
|
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||||
|
end,
|
||||||
|
pid = function()
|
||||||
|
local name = vim.fn.input 'Executable name (filter): '
|
||||||
|
return require('dap.utils').pick_process { filter = name }
|
||||||
|
end,
|
||||||
|
cwd = '${workspaceFolder}',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'Attach to gdbserver :1234',
|
||||||
|
type = 'rust-gdb',
|
||||||
|
request = 'attach',
|
||||||
|
target = 'localhost:1234',
|
||||||
|
program = function()
|
||||||
|
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||||
|
end,
|
||||||
|
cwd = '${workspaceFolder}',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
dap.configurations.cpp = {
|
||||||
|
{
|
||||||
|
name = 'Auto-Debug Project (codelldb)',
|
||||||
|
type = 'codelldb',
|
||||||
|
request = 'launch',
|
||||||
|
program = function()
|
||||||
|
-- 1. Get the current working directory
|
||||||
|
local cwd = vim.fn.getcwd()
|
||||||
|
|
||||||
|
-- 2. Extract the name of the root folder (e.g., "SakuraVNE")
|
||||||
|
local project_name = vim.fn.fnamemodify(cwd, ':t')
|
||||||
|
|
||||||
|
-- 3. Construct your specific build path
|
||||||
|
local auto_path = cwd .. '/build/bin/Debug-linux-x86_64/' .. project_name .. '/' .. project_name
|
||||||
|
|
||||||
|
-- 4. Check if it actually exists. If it does, run it instantly!
|
||||||
|
if vim.fn.filereadable(auto_path) == 1 then
|
||||||
|
return auto_path
|
||||||
|
end
|
||||||
|
|
||||||
|
-- 5. Fallback: If it couldn't find it, pop open an input box so you can type it manually
|
||||||
|
return vim.fn.input('Path to executable: ', cwd .. '/build/bin/Debug-linux-x86_64/', 'file')
|
||||||
|
end,
|
||||||
|
cwd = '${workspaceFolder}',
|
||||||
|
stopOnEntry = false,
|
||||||
|
args = {}, -- Add command line arguments here if your engine ever needs them
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Tell C to use the exact same configuration as C++
|
||||||
|
dap.configurations.c = dap.configurations.cpp
|
||||||
|
|
||||||
require('mason-nvim-dap').setup {
|
require('mason-nvim-dap').setup {
|
||||||
-- Makes a best effort to setup the various debuggers with
|
-- Makes a best effort to setup the various debuggers with
|
||||||
-- reasonable debug configurations
|
-- reasonable debug configurations
|
||||||
@@ -95,6 +170,7 @@ return {
|
|||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
-- Update this to ensure that you have the debuggers for the langs you want
|
-- Update this to ensure that you have the debuggers for the langs you want
|
||||||
'delve',
|
'delve',
|
||||||
|
'codelldb',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,16 +197,16 @@ return {
|
|||||||
}
|
}
|
||||||
|
|
||||||
-- Change breakpoint icons
|
-- Change breakpoint icons
|
||||||
-- vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' })
|
vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' })
|
||||||
-- vim.api.nvim_set_hl(0, 'DapStop', { fg = '#ffcc00' })
|
vim.api.nvim_set_hl(0, 'DapStop', { fg = '#ffcc00' })
|
||||||
-- local breakpoint_icons = vim.g.have_nerd_font
|
local breakpoint_icons = vim.g.have_nerd_font
|
||||||
-- and { Breakpoint = '', BreakpointCondition = '', BreakpointRejected = '', LogPoint = '', Stopped = '' }
|
and { Breakpoint = '', BreakpointCondition = '', BreakpointRejected = '', LogPoint = '', Stopped = '' }
|
||||||
-- or { Breakpoint = '●', BreakpointCondition = '⊜', BreakpointRejected = '⊘', LogPoint = '◆', Stopped = '⭔' }
|
or { Breakpoint = '●', BreakpointCondition = '⊜', BreakpointRejected = '⊘', LogPoint = '◆', Stopped = '⭔' }
|
||||||
-- for type, icon in pairs(breakpoint_icons) do
|
for type, icon in pairs(breakpoint_icons) do
|
||||||
-- local tp = 'Dap' .. type
|
local tp = 'Dap' .. type
|
||||||
-- local hl = (type == 'Stopped') and 'DapStop' or 'DapBreak'
|
local hl = (type == 'Stopped') and 'DapStop' or 'DapBreak'
|
||||||
-- vim.fn.sign_define(tp, { text = icon, texthl = hl, numhl = hl })
|
vim.fn.sign_define(tp, { text = icon, texthl = hl, numhl = hl })
|
||||||
-- end
|
end
|
||||||
|
|
||||||
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
|
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
|
||||||
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
|
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
return {
|
|
||||||
{ -- Add indentation guides even on blank lines
|
|
||||||
'lukas-reineke/indent-blankline.nvim',
|
|
||||||
-- Enable `lukas-reineke/indent-blankline.nvim`
|
|
||||||
-- See `:help ibl`
|
|
||||||
main = 'ibl',
|
|
||||||
opts = {},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -50,7 +50,7 @@ return {
|
|||||||
-- Only run the linter in buffers that you can modify in order to
|
-- Only run the linter in buffers that you can modify in order to
|
||||||
-- avoid superfluous noise, notably within the handy LSP pop-ups that
|
-- avoid superfluous noise, notably within the handy LSP pop-ups that
|
||||||
-- describe the hovered symbol using Markdown.
|
-- describe the hovered symbol using Markdown.
|
||||||
if vim.opt_local.modifiable:get() then
|
if vim.bo.modifiable then
|
||||||
lint.try_lint()
|
lint.try_lint()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|||||||
@@ -19,15 +19,16 @@ return {
|
|||||||
-- Automatically install LSPs and related tools to stdpath for Neovim
|
-- Automatically install LSPs and related tools to stdpath for Neovim
|
||||||
-- Mason must be loaded before its dependents so we need to set it up here.
|
-- Mason must be loaded before its dependents so we need to set it up here.
|
||||||
-- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
|
-- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
|
||||||
{ 'williamboman/mason.nvim', opts = {} },
|
{ 'mason-org/mason.nvim', opts = {} },
|
||||||
'williamboman/mason-lspconfig.nvim',
|
'mason-org/mason-lspconfig.nvim',
|
||||||
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
||||||
|
'nvim-java/nvim-java',
|
||||||
|
|
||||||
-- Useful status updates for LSP.
|
-- Useful status updates for LSP.
|
||||||
{ 'j-hui/fidget.nvim', opts = {} },
|
{ 'j-hui/fidget.nvim', opts = {} },
|
||||||
|
|
||||||
-- Allows extra capabilities provided by nvim-cmp
|
-- Allows extra capabilities provided by blink.cmp
|
||||||
'hrsh7th/cmp-nvim-lsp',
|
'saghen/blink.cmp',
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
-- Brief aside: **What is LSP?**
|
-- Brief aside: **What is LSP?**
|
||||||
@@ -194,10 +195,9 @@ return {
|
|||||||
|
|
||||||
-- LSP servers and clients are able to communicate to each other what features they support.
|
-- 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.
|
-- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities.
|
||||||
-- So, we create new capabilities with nvim cmp, and then broadcast that to the servers.
|
-- So, we create new capabilities with blink.cmp, and then broadcast that to the servers.
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||||
capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
|
|
||||||
|
|
||||||
-- Enable the following language servers
|
-- Enable the following language servers
|
||||||
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
||||||
@@ -209,19 +209,19 @@ return {
|
|||||||
-- - 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 = {},
|
gopls = {},
|
||||||
-- pyright = {},
|
pyright = {},
|
||||||
-- rust_analyzer = {},
|
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:
|
||||||
-- https://github.com/pmizio/typescript-tools.nvim
|
-- https://github.com/pmizio/typescript-tools.nvim
|
||||||
--
|
--
|
||||||
-- But for many setups, the LSP (`ts_ls`) will work just fine
|
-- But for many setups, the LSP (`ts_ls`) will work just fine
|
||||||
-- ts_ls = {},
|
ts_ls = {},
|
||||||
|
--
|
||||||
--
|
--
|
||||||
|
|
||||||
lua_ls = {
|
lua_ls = {
|
||||||
-- cmd = { ... },
|
-- cmd = { ... },
|
||||||
-- filetypes = { ... },
|
-- filetypes = { ... },
|
||||||
@@ -238,6 +238,53 @@ return {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
--require('java').setup {
|
||||||
|
-- Your custom jdtls settings goes here
|
||||||
|
--}
|
||||||
|
vim.lsp.config['java'] = {}
|
||||||
|
|
||||||
|
--require('lspconfig').jdtls.setup {
|
||||||
|
-- Your custom nvim-java configuration goes here
|
||||||
|
--}
|
||||||
|
vim.lsp.config['jdtls'] = {}
|
||||||
|
|
||||||
|
-- The following loop will configure each server with the capabilities we defined above.
|
||||||
|
-- This will ensure that all servers have the same base configuration, but also
|
||||||
|
-- allow for server-specific overrides.
|
||||||
|
for server_name, server_config in pairs(servers) do
|
||||||
|
server_config.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server_config.capabilities or {})
|
||||||
|
--require('lspconfig')[server_name].setup(server_config)
|
||||||
|
vim.lsp.config(server_name, server_config)
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.lsp.config['emmet-language-server'] = {
|
||||||
|
opts = {
|
||||||
|
filetypes = { 'css', 'eruby', 'html', 'javascript', 'javascriptreact', 'less', 'sass', 'scss', 'pug', 'typescriptreact' },
|
||||||
|
-- Read more about this options in the [vscode docs](https://code.visualstudio.com/docs/editor/emmet#_emmet-configuration).
|
||||||
|
-- **Note:** only the options listed in the table are supported.
|
||||||
|
init_options = {
|
||||||
|
---@type table<string, string>
|
||||||
|
includeLanguages = {},
|
||||||
|
--- @type string[]
|
||||||
|
excludeLanguages = {},
|
||||||
|
--- @type string[]
|
||||||
|
extensionsPath = {},
|
||||||
|
--- @type table<string, any> [Emmet Docs](https://docs.emmet.io/customization/preferences/)
|
||||||
|
preferences = {},
|
||||||
|
--- @type boolean Defaults to `true`
|
||||||
|
showAbbreviationSuggestions = true,
|
||||||
|
--- @type "always" | "never" Defaults to `"always"`
|
||||||
|
showExpandedAbbreviation = 'always',
|
||||||
|
--- @type boolean Defaults to `false`
|
||||||
|
showSuggestionsAsSnippets = false,
|
||||||
|
--- @type table<string, any> [Emmet Docs](https://docs.emmet.io/customization/syntax-profiles/)
|
||||||
|
syntaxProfiles = {},
|
||||||
|
--- @type table<string, string> [Emmet Docs](https://docs.emmet.io/customization/snippets/#variables)
|
||||||
|
variables = {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
-- 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
|
||||||
@@ -254,6 +301,35 @@ return {
|
|||||||
local ensure_installed = vim.tbl_keys(servers or {})
|
local ensure_installed = vim.tbl_keys(servers or {})
|
||||||
vim.list_extend(ensure_installed, {
|
vim.list_extend(ensure_installed, {
|
||||||
'stylua', -- Used to format Lua code
|
'stylua', -- Used to format Lua code
|
||||||
|
'arduino-language-server',
|
||||||
|
'bash-debug-adapter',
|
||||||
|
'bash-language-server',
|
||||||
|
'clang-format',
|
||||||
|
'clangd',
|
||||||
|
'cmake-language-server',
|
||||||
|
'cmakelang',
|
||||||
|
'cpplint',
|
||||||
|
'cpptools',
|
||||||
|
'css-lsp',
|
||||||
|
'css-variables-language-server',
|
||||||
|
'cssmodules-language-server',
|
||||||
|
'delve',
|
||||||
|
'emmet-language-server',
|
||||||
|
'goimports-reviser',
|
||||||
|
'golangci-lint',
|
||||||
|
'golangci-lint-langserver',
|
||||||
|
'gopls',
|
||||||
|
'gradle-language-server',
|
||||||
|
'html-lsp',
|
||||||
|
'htmlhint',
|
||||||
|
'htmx-lsp',
|
||||||
|
'hyprls',
|
||||||
|
'json-lsp',
|
||||||
|
'jsonlint',
|
||||||
|
'lemminx',
|
||||||
|
'lua-language-server',
|
||||||
|
'pyright',
|
||||||
|
'xmlformatter',
|
||||||
})
|
})
|
||||||
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ return {
|
|||||||
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
|
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
|
||||||
'MunifTanjim/nui.nvim',
|
'MunifTanjim/nui.nvim',
|
||||||
},
|
},
|
||||||
cmd = 'Neotree',
|
lazy = false,
|
||||||
keys = {
|
keys = {
|
||||||
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
|
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ return {
|
|||||||
-- Load the colorscheme here.
|
-- Load the colorscheme here.
|
||||||
-- Like many other themes, this one has different styles, and you could load
|
-- Like many other themes, this one has different styles, and you could load
|
||||||
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
|
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
|
||||||
vim.cmd.colorscheme 'tokyonight-night'
|
vim.cmd.colorscheme 'tokyonight-day'
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,29 @@
|
|||||||
return {
|
return {
|
||||||
{ -- Highlight, edit, and navigate code
|
{ -- Highlight, edit, and navigate code
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
branch = 'main',
|
||||||
build = ':TSUpdate',
|
build = ':TSUpdate',
|
||||||
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
|
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
|
||||||
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
|
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
|
||||||
opts = {
|
opts = {
|
||||||
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
|
ensure_installed = {
|
||||||
|
'bash',
|
||||||
|
'c',
|
||||||
|
'diff',
|
||||||
|
'html',
|
||||||
|
'lua',
|
||||||
|
'luadoc',
|
||||||
|
'markdown',
|
||||||
|
'markdown_inline',
|
||||||
|
'query',
|
||||||
|
'vim',
|
||||||
|
'vimdoc',
|
||||||
|
'rust',
|
||||||
|
'go',
|
||||||
|
'html',
|
||||||
|
'javascript',
|
||||||
|
'python',
|
||||||
|
},
|
||||||
-- Autoinstall languages that are not installed
|
-- Autoinstall languages that are not installed
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
highlight = {
|
highlight = {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ return {
|
|||||||
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
|
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
|
||||||
opts = {
|
opts = {
|
||||||
-- delay between pressing a key and opening which-key (milliseconds)
|
-- delay between pressing a key and opening which-key (milliseconds)
|
||||||
-- this setting is independent of vim.opt.timeoutlen
|
-- this setting is independent of vim.o.timeoutlen
|
||||||
delay = 0,
|
delay = 0,
|
||||||
icons = {
|
icons = {
|
||||||
-- set icon mappings to true if you have a Nerd Font
|
-- set icon mappings to true if you have a Nerd Font
|
||||||
|
|||||||
@@ -7,7 +7,10 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
|||||||
if vim.v.shell_error ~= 0 then
|
if vim.v.shell_error ~= 0 then
|
||||||
error('Error cloning lazy.nvim:\n' .. out)
|
error('Error cloning lazy.nvim:\n' .. out)
|
||||||
end
|
end
|
||||||
end ---@diagnostic disable-next-line: undefined-field
|
end
|
||||||
vim.opt.rtp:prepend(lazypath)
|
|
||||||
|
---@type vim.Option
|
||||||
|
local rtp = vim.opt.rtp
|
||||||
|
rtp:prepend(lazypath)
|
||||||
|
|
||||||
-- vim: ts=2 sts=2 sw=2 et
|
-- vim: ts=2 sts=2 sw=2 et
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
-- 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
|
'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically
|
||||||
|
|
||||||
-- NOTE: Plugins can also be added by using a table,
|
-- NOTE: Plugins can also be added by using a table,
|
||||||
-- with the first argument being the link and the following
|
-- with the first argument being the link and the following
|
||||||
@@ -20,29 +20,30 @@ require('lazy').setup({
|
|||||||
-- Use `opts = {}` to automatically pass options to a plugin's `setup()` function, forcing the plugin to be loaded.
|
-- Use `opts = {}` to automatically pass options to a plugin's `setup()` function, forcing the plugin to be loaded.
|
||||||
--
|
--
|
||||||
|
|
||||||
|
-- modular approach: using `require 'path.name'` will
|
||||||
-- modular approach: using `require 'path/name'` will
|
|
||||||
-- include a plugin definition from file lua/path/name.lua
|
-- include a plugin definition from file lua/path/name.lua
|
||||||
|
|
||||||
require 'kickstart/plugins/gitsigns',
|
require 'kickstart.plugins.gitsigns',
|
||||||
|
|
||||||
require 'kickstart/plugins/which-key',
|
require 'kickstart.plugins.which-key',
|
||||||
|
|
||||||
require 'kickstart/plugins/telescope',
|
require 'kickstart.plugins.telescope',
|
||||||
|
|
||||||
require 'kickstart/plugins/lspconfig',
|
require 'kickstart.plugins.lspconfig',
|
||||||
|
|
||||||
require 'kickstart/plugins/conform',
|
require 'kickstart.plugins.conform',
|
||||||
|
|
||||||
require 'kickstart/plugins/cmp',
|
require 'kickstart.plugins.blink-cmp',
|
||||||
|
|
||||||
require 'kickstart/plugins/tokyonight',
|
require 'kickstart.plugins.tokyonight',
|
||||||
|
|
||||||
require 'kickstart/plugins/todo-comments',
|
require 'kickstart.plugins.todo-comments',
|
||||||
|
|
||||||
require 'kickstart/plugins/mini',
|
require 'kickstart.plugins.mini',
|
||||||
|
|
||||||
require 'kickstart/plugins/treesitter',
|
require 'kickstart.plugins.treesitter',
|
||||||
|
|
||||||
|
require 'kickstart.plugins.neo-tree',
|
||||||
|
|
||||||
-- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the
|
-- The following 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
|
-- init.lua. If you want these files, they are in the repository, so you can just download them and
|
||||||
@@ -53,17 +54,16 @@ require('lazy').setup({
|
|||||||
-- 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).
|
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
|
||||||
--
|
--
|
||||||
-- require 'kickstart.plugins.debug',
|
require 'kickstart.plugins.debug',
|
||||||
-- require 'kickstart.plugins.indent_line',
|
-- require 'kickstart.plugins.indent_line',
|
||||||
-- require 'kickstart.plugins.lint',
|
-- require 'kickstart.plugins.lint',
|
||||||
-- require 'kickstart.plugins.autopairs',
|
require 'kickstart.plugins.autopairs',
|
||||||
-- require 'kickstart.plugins.neo-tree',
|
|
||||||
|
|
||||||
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
-- 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.
|
-- 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.
|
||||||
-- { import = 'custom.plugins' },
|
{ import = 'custom.plugins' },
|
||||||
--
|
--
|
||||||
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
|
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
|
||||||
-- Or use telescope!
|
-- Or use telescope!
|
||||||
|
|||||||
@@ -1,69 +1,74 @@
|
|||||||
-- [[ Setting options ]]
|
-- [[ Setting options ]]
|
||||||
-- See `:help vim.opt`
|
-- See `:help vim.o`
|
||||||
-- NOTE: You can change these options as you wish!
|
-- NOTE: You can change these options as you wish!
|
||||||
-- For more options, you can see `:help option-list`
|
-- For more options, you can see `:help option-list`
|
||||||
|
|
||||||
-- Make line numbers default
|
-- Make line numbers default
|
||||||
vim.opt.number = true
|
vim.o.number = true
|
||||||
-- You can also add relative line numbers, to help with jumping.
|
-- You can also add relative line numbers, to help with jumping.
|
||||||
-- Experiment for yourself to see if you like it!
|
-- Experiment for yourself to see if you like it!
|
||||||
-- vim.opt.relativenumber = true
|
-- vim.o.relativenumber = true
|
||||||
|
|
||||||
-- Enable mouse mode, can be useful for resizing splits for example!
|
-- Enable mouse mode, can be useful for resizing splits for example!
|
||||||
vim.opt.mouse = 'a'
|
vim.o.mouse = 'a'
|
||||||
|
|
||||||
-- Don't show the mode, since it's already in the status line
|
-- Don't show the mode, since it's already in the status line
|
||||||
vim.opt.showmode = false
|
vim.o.showmode = false
|
||||||
|
|
||||||
-- Sync clipboard between OS and Neovim.
|
-- Sync clipboard between OS and Neovim.
|
||||||
-- Schedule the setting after `UiEnter` because it can increase startup-time.
|
-- Schedule the setting after `UiEnter` because it can increase startup-time.
|
||||||
-- Remove this option if you want your OS clipboard to remain independent.
|
-- Remove this option if you want your OS clipboard to remain independent.
|
||||||
-- See `:help 'clipboard'`
|
-- See `:help 'clipboard'`
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
vim.opt.clipboard = 'unnamedplus'
|
vim.o.clipboard = 'unnamedplus'
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Enable break indent
|
-- Enable break indent
|
||||||
vim.opt.breakindent = true
|
vim.o.breakindent = true
|
||||||
|
|
||||||
-- Save undo history
|
-- Save undo history
|
||||||
vim.opt.undofile = true
|
vim.o.undofile = true
|
||||||
|
|
||||||
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
|
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
|
||||||
vim.opt.ignorecase = true
|
vim.o.ignorecase = true
|
||||||
vim.opt.smartcase = true
|
vim.o.smartcase = true
|
||||||
|
|
||||||
-- Keep signcolumn on by default
|
-- Keep signcolumn on by default
|
||||||
vim.opt.signcolumn = 'yes'
|
vim.o.signcolumn = 'yes'
|
||||||
|
|
||||||
-- Decrease update time
|
-- Decrease update time
|
||||||
vim.opt.updatetime = 250
|
vim.o.updatetime = 250
|
||||||
|
|
||||||
-- Decrease mapped sequence wait time
|
-- Decrease mapped sequence wait time
|
||||||
vim.opt.timeoutlen = 300
|
vim.o.timeoutlen = 300
|
||||||
|
|
||||||
-- Configure how new splits should be opened
|
-- Configure how new splits should be opened
|
||||||
vim.opt.splitright = true
|
vim.o.splitright = true
|
||||||
vim.opt.splitbelow = true
|
vim.o.splitbelow = true
|
||||||
|
|
||||||
-- Sets how neovim will display certain whitespace characters in the editor.
|
-- Sets how neovim will display certain whitespace characters in the editor.
|
||||||
-- See `:help 'list'`
|
-- See `:help 'list'`
|
||||||
-- and `:help 'listchars'`
|
-- and `:help 'listchars'`
|
||||||
vim.opt.list = true
|
--
|
||||||
|
-- Notice listchars is set using `vim.opt` instead of `vim.o`.
|
||||||
|
-- It is very similar to `vim.o` but offers an interface for conveniently interacting with tables.
|
||||||
|
-- See `:help lua-options`
|
||||||
|
-- and `:help lua-options-guide`
|
||||||
|
vim.o.list = true
|
||||||
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
|
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
|
||||||
|
|
||||||
-- Preview substitutions live, as you type!
|
-- Preview substitutions live, as you type!
|
||||||
vim.opt.inccommand = 'split'
|
vim.o.inccommand = 'split'
|
||||||
|
|
||||||
-- Show which line your cursor is on
|
-- Show which line your cursor is on
|
||||||
vim.opt.cursorline = true
|
vim.o.cursorline = true
|
||||||
|
|
||||||
-- Minimal number of screen lines to keep above and below the cursor.
|
-- Minimal number of screen lines to keep above and below the cursor.
|
||||||
vim.opt.scrolloff = 10
|
vim.o.scrolloff = 10
|
||||||
|
|
||||||
-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`),
|
-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`),
|
||||||
-- instead raise a dialog asking if you wish to save the current file(s)
|
-- instead raise a dialog asking if you wish to save the current file(s)
|
||||||
-- See `:help 'confirm'`
|
-- See `:help 'confirm'`
|
||||||
vim.opt.confirm = true
|
vim.o.confirm = true
|
||||||
|
|
||||||
-- vim: ts=2 sts=2 sw=2 et
|
-- vim: ts=2 sts=2 sw=2 et
|
||||||
|
|||||||
Reference in New Issue
Block a user