Compare commits
33 commits
Author | SHA1 | Date | |
---|---|---|---|
0721e7fac7 | |||
478a16e9f1 | |||
d5e5049274 | |||
4f41b7e861 | |||
6e77692d26 | |||
1e5ab8b964 | |||
2a811dbcfd | |||
9388a41ff1 | |||
505dd0dda0 | |||
3dc92d1d5b | |||
202e49f4c5 | |||
7758f2115f | |||
e91d499703 | |||
376a47bec3 | |||
58a6274c3c | |||
37ff8d6fdb | |||
a2f6403fd5 | |||
4033f5fe94 | |||
a3c86ac0db | |||
473301ab94 | |||
979448ef57 | |||
17eb69ad94 | |||
5e07d14aff | |||
4637a21474 | |||
3a62146db4 | |||
79d6a52c9c | |||
2386de2158 | |||
96c638f4bc | |||
6ce682a3fc | |||
cebf16e11d | |||
55e3a1902f | |||
acfa1d98a0 | |||
255bb78fa1 |
19 changed files with 1385 additions and 153 deletions
5
init.lua
5
init.lua
|
@ -79,7 +79,7 @@ vim.opt.scrolloff = 6 -- Keep at least n lines above/below
|
||||||
vim.opt.sidescrolloff = 10 -- Keep at least n lines left/right
|
vim.opt.sidescrolloff = 10 -- Keep at least n lines left/right
|
||||||
vim.opt.numberwidth = 2 -- Minimum number of columns to use for the line number
|
vim.opt.numberwidth = 2 -- Minimum number of columns to use for the line number
|
||||||
vim.opt.number = true -- Show line numbers
|
vim.opt.number = true -- Show line numbers
|
||||||
vim.opt.relativenumber = true -- Show relative line numbers
|
vim.opt.relativenumber = false -- Show relative line numbers
|
||||||
vim.opt.ruler = true -- Default status ruler
|
vim.opt.ruler = true -- Default status ruler
|
||||||
vim.opt.showtabline = 1 -- Don't change this, goes back to a vanilla vim default
|
vim.opt.showtabline = 1 -- Don't change this, goes back to a vanilla vim default
|
||||||
vim.opt.laststatus = 3 -- Always show laststatus
|
vim.opt.laststatus = 3 -- Always show laststatus
|
||||||
|
@ -209,6 +209,7 @@ require 'custom.maps'
|
||||||
require 'custom.autocmds'
|
require 'custom.autocmds'
|
||||||
require('lazy').setup({
|
require('lazy').setup({
|
||||||
{ import = 'custom.plugins' },
|
{ import = 'custom.plugins' },
|
||||||
|
{ import = 'kickstart.plugins.debug' },
|
||||||
}, {
|
}, {
|
||||||
ui = {
|
ui = {
|
||||||
-- If you are using a Nerd Font: set icons to an empty table which will use the
|
-- If you are using a Nerd Font: set icons to an empty table which will use the
|
||||||
|
@ -231,5 +232,7 @@ require('lazy').setup({
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
require 'kickstart.health'
|
||||||
|
|
||||||
-- 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
|
||||||
|
|
|
@ -90,17 +90,3 @@ vim.api.nvim_create_autocmd('ColorScheme', {
|
||||||
vim.cmd [[highlight Comment gui=NONE]] -- no italics for comments
|
vim.cmd [[highlight Comment gui=NONE]] -- no italics for comments
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- pin main.typ for typst projects
|
|
||||||
vim.api.nvim_create_autocmd('FileType', {
|
|
||||||
group = augroup,
|
|
||||||
pattern = {
|
|
||||||
'typst',
|
|
||||||
},
|
|
||||||
callback = function()
|
|
||||||
-- pin the main file
|
|
||||||
vim.lsp.buf.execute_command { command = 'tinymist.pinMain', arguments = { vim.api.nvim_buf_get_name(0) } }
|
|
||||||
-- -- unpin the main file
|
|
||||||
-- vim.lsp.buf.execute_command { command = 'tinymist.pinMain', arguments = { nil } }
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
232
lua/custom/plugins/configs/lsp.lua
Normal file
232
lua/custom/plugins/configs/lsp.lua
Normal file
|
@ -0,0 +1,232 @@
|
||||||
|
local completion = require 'null-ls.builtins._meta.completion'
|
||||||
|
-- Brief aside: **What is LSP?**
|
||||||
|
--
|
||||||
|
-- LSP is an initialism you've probably heard, but might not understand what it is.
|
||||||
|
--
|
||||||
|
-- LSP stands for Language Server Protocol. It's a protocol that helps editors
|
||||||
|
-- and language tooling communicate in a standardized fashion.
|
||||||
|
--
|
||||||
|
-- In general, you have a "server" which is some tool built to understand a particular
|
||||||
|
-- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc.). These Language Servers
|
||||||
|
-- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone
|
||||||
|
-- processes that communicate with some "client" - in this case, Neovim!
|
||||||
|
--
|
||||||
|
-- LSP provides Neovim with features like:
|
||||||
|
-- - Go to definition
|
||||||
|
-- - Find references
|
||||||
|
-- - Autocompletion
|
||||||
|
-- - Symbol Search
|
||||||
|
-- - and more!
|
||||||
|
--
|
||||||
|
-- Thus, Language Servers are external tools that must be installed separately from
|
||||||
|
-- Neovim. This is where `mason` and related plugins come into play.
|
||||||
|
--
|
||||||
|
-- If you're wondering about lsp vs treesitter, you can check out the wonderfully
|
||||||
|
-- and elegantly composed help section, `:help lsp-vs-treesitter`
|
||||||
|
|
||||||
|
-- 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
|
||||||
|
-- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this
|
||||||
|
-- function will be executed to configure the current buffer
|
||||||
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
|
group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),
|
||||||
|
callback = function(event)
|
||||||
|
-- NOTE: Remember that Lua is a real programming language, and as such it is possible
|
||||||
|
-- to define small helper and utility functions so you don't have to repeat yourself.
|
||||||
|
--
|
||||||
|
-- In this case, we create a function that lets us more easily define mappings specific
|
||||||
|
-- for LSP related items. It sets the mode, buffer and description for us each time.
|
||||||
|
local map = function(keys, func, desc)
|
||||||
|
vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Jump to the definition of the word under your cursor.
|
||||||
|
-- This is where a variable was first declared, or where a function is defined, etc.
|
||||||
|
-- To jump back, press <C-t>.
|
||||||
|
map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
||||||
|
|
||||||
|
-- Find references for the word under your cursor.
|
||||||
|
map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
||||||
|
|
||||||
|
-- Jump to the implementation of the word under your cursor.
|
||||||
|
-- Useful when your language has ways of declaring types without an actual implementation.
|
||||||
|
map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
|
||||||
|
|
||||||
|
-- Rename the variable under your cursor.
|
||||||
|
-- Most Language Servers support renaming across files, etc.
|
||||||
|
map('<leader>cr', vim.lsp.buf.rename, '[R]ename')
|
||||||
|
|
||||||
|
-- Execute a code action, usually your cursor needs to be on top of an error
|
||||||
|
-- or a suggestion from your LSP for this to activate.
|
||||||
|
map('<leader>ca', vim.lsp.buf.code_action, '[A]ction')
|
||||||
|
|
||||||
|
-- Opens a popup that displays documentation about the word under your cursor
|
||||||
|
-- See `:help K` for why this keymap.
|
||||||
|
map('K', vim.lsp.buf.hover, 'Hover Documentation')
|
||||||
|
|
||||||
|
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
||||||
|
-- For example, in C this would take you to the header.
|
||||||
|
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||||
|
|
||||||
|
map('gl', vim.diagnostic.open_float, 'Make the diagnostic big')
|
||||||
|
|
||||||
|
-- The following two autocommands are used to highlight references of the
|
||||||
|
-- word under your cursor when your cursor rests there for a little while.
|
||||||
|
-- See `:help CursorHold` for information about when this is executed
|
||||||
|
--
|
||||||
|
-- When you move your cursor, the highlights will be cleared (the second autocommand).
|
||||||
|
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||||
|
if client and client.server_capabilities.documentHighlightProvider then
|
||||||
|
local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
|
||||||
|
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
||||||
|
buffer = event.buf,
|
||||||
|
group = highlight_augroup,
|
||||||
|
callback = vim.lsp.buf.document_highlight,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {
|
||||||
|
buffer = event.buf,
|
||||||
|
group = highlight_augroup,
|
||||||
|
callback = vim.lsp.buf.clear_references,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('LspDetach', {
|
||||||
|
group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }),
|
||||||
|
callback = function(event2)
|
||||||
|
vim.lsp.buf.clear_references()
|
||||||
|
vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf }
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- The following autocommand is used to enable inlay hints in your
|
||||||
|
-- code, if the language server you are using supports them
|
||||||
|
--
|
||||||
|
-- This may be unwanted, since they displace some of your code
|
||||||
|
if client and client.server_capabilities.inlayHintProvider and vim.lsp.inlay_hint then
|
||||||
|
map('<leader>th', function()
|
||||||
|
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
|
||||||
|
end, '[T]oggle Inlay [H]ints')
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- 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.
|
||||||
|
-- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities.
|
||||||
|
-- So, we create new capabilities with nvim cmp, and then broadcast that to the servers.
|
||||||
|
CAPABILITIES = vim.lsp.protocol.make_client_capabilities()
|
||||||
|
CAPABILITIES = vim.tbl_deep_extend('force', CAPABILITIES, require('cmp_nvim_lsp').default_capabilities())
|
||||||
|
|
||||||
|
DEFAULT_ON_ATTACH = function(client, bufnr)
|
||||||
|
vim.keymap.set('n', '<leader>tp', function()
|
||||||
|
print('pinning this file: ', vim.api.nvim_buf_get_name(0), 'bufnr: ', bufnr)
|
||||||
|
client:exec_cmd({
|
||||||
|
title = 'pin',
|
||||||
|
command = 'tinymist.pinMain',
|
||||||
|
arguments = { vim.api.nvim_buf_get_name(0) },
|
||||||
|
}, { bufnr = bufnr })
|
||||||
|
end, { desc = '[T]oggle [P]in (pin this file as main file)', noremap = true })
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>tu', function()
|
||||||
|
client:exec_cmd({
|
||||||
|
title = 'unpin',
|
||||||
|
command = 'tinymist.pinMain',
|
||||||
|
arguments = { vim.v.null },
|
||||||
|
}, { bufnr = bufnr })
|
||||||
|
end, { desc = '[T]oggle [U]npin (unpin this file as main file)', noremap = true })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Enable the following language servers
|
||||||
|
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
||||||
|
--
|
||||||
|
-- Add any additional override configuration in the following tables. Available keys are:
|
||||||
|
-- - cmd (table): Override the default command used to start the server
|
||||||
|
-- - filetypes (table): Override the default list of associated filetypes for the server
|
||||||
|
-- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features.
|
||||||
|
-- - 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/
|
||||||
|
local servers = {
|
||||||
|
tinymist = {
|
||||||
|
settings = {
|
||||||
|
formatterMode = 'typstyle',
|
||||||
|
exportPdf = 'never',
|
||||||
|
semanticTokens = 'disable',
|
||||||
|
},
|
||||||
|
on_attach = DEFAULT_ON_ATTACH,
|
||||||
|
},
|
||||||
|
html = {},
|
||||||
|
taplo = {},
|
||||||
|
cssls = {},
|
||||||
|
ts_ls = {},
|
||||||
|
clangd = {},
|
||||||
|
pyright = {},
|
||||||
|
bashls = {},
|
||||||
|
yamlls = {},
|
||||||
|
rust_analyzer = {
|
||||||
|
settings = {
|
||||||
|
['rust-analyzer'] = {
|
||||||
|
check = {
|
||||||
|
command = 'clippy',
|
||||||
|
},
|
||||||
|
imports = {
|
||||||
|
preferPrelude = true,
|
||||||
|
},
|
||||||
|
cargo = {
|
||||||
|
features = 'all',
|
||||||
|
buildScripts = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
procMacro = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
assist = {
|
||||||
|
emitMustUse = true,
|
||||||
|
expressionFillDefault = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
lua_ls = {
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
completion = {
|
||||||
|
callSnippet = 'Replace',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Ensure the servers and tools above are installed
|
||||||
|
-- To check the current status of installed tools and/or manually install
|
||||||
|
-- other tools, you can run
|
||||||
|
-- :Mason
|
||||||
|
--
|
||||||
|
-- You can press `g?` for help in this menu.
|
||||||
|
require('mason').setup()
|
||||||
|
|
||||||
|
-- You can add other tools here that you want Mason to install
|
||||||
|
-- for you, so that they are available from within Neovim.
|
||||||
|
local ensure_installed = vim.tbl_keys(servers or {})
|
||||||
|
vim.list_extend(ensure_installed, {})
|
||||||
|
|
||||||
|
require('mason-lspconfig').setup {
|
||||||
|
ensure_installed = ensure_installed,
|
||||||
|
automatic_installation = true,
|
||||||
|
automatic_enable = false,
|
||||||
|
}
|
||||||
|
|
||||||
|
-- some things work weird
|
||||||
|
local lspconfig = require 'lspconfig'
|
||||||
|
|
||||||
|
for server_name, server in pairs(servers) do
|
||||||
|
-- This handles overriding only values explicitly passed
|
||||||
|
-- by the server configuration above. Useful when disabling
|
||||||
|
-- certain features of an LSP (for example, turning off formatting for tsserver)
|
||||||
|
server.capabilities = vim.tbl_deep_extend('force', {}, CAPABILITIES, server.capabilities or {})
|
||||||
|
require('lspconfig')[server_name].setup(server)
|
||||||
|
end
|
||||||
|
|
||||||
|
lspconfig.gdscript.setup {}
|
|
@ -36,7 +36,9 @@ return {
|
||||||
end,
|
end,
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
['_'] = { 'prettier' },
|
['_'] = { 'prettier' },
|
||||||
|
rust = { 'rust-analyzer' },
|
||||||
lua = { 'stylua' },
|
lua = { 'stylua' },
|
||||||
|
typst = { 'typstyle' },
|
||||||
json = { 'jq' },
|
json = { 'jq' },
|
||||||
-- rust = { 'rustfmt' }, -- does not need one with the lsp there
|
-- rust = { 'rustfmt' }, -- does not need one with the lsp there
|
||||||
c = { 'clang-format' },
|
c = { 'clang-format' },
|
||||||
|
@ -47,7 +49,7 @@ return {
|
||||||
--
|
--
|
||||||
-- You can use a sub-list to tell conform to run *until* a formatter
|
-- You can use a sub-list to tell conform to run *until* a formatter
|
||||||
-- is found.
|
-- is found.
|
||||||
javascript = { 'prettierd', 'prettier' },
|
javascript = { 'prettier' },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -80,5 +82,22 @@ return {
|
||||||
'tpope/vim-eunuch',
|
'tpope/vim-eunuch',
|
||||||
lazy = false,
|
lazy = false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'mikesmithgh/kitty-scrollback.nvim',
|
||||||
|
enabled = true,
|
||||||
|
lazy = true,
|
||||||
|
cmd = { 'KittyScrollbackGenerateKittens', 'KittyScrollbackCheckHealth' },
|
||||||
|
event = { 'User KittyScrollbackLaunch' },
|
||||||
|
-- version = '*', -- latest stable version, may have breaking changes if major version changed
|
||||||
|
-- version = '^3.0.0', -- pin major version, include fixes and features that do not have breaking changes
|
||||||
|
config = function()
|
||||||
|
require('kitty-scrollback').setup {
|
||||||
|
myconfig = function()
|
||||||
|
return { keymaps_enabled = false }
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
{ import = 'custom.plugins' },
|
{ import = 'custom.plugins' },
|
||||||
}
|
}
|
||||||
|
|
350
lua/custom/plugins/lsp.lua
Normal file
350
lua/custom/plugins/lsp.lua
Normal file
|
@ -0,0 +1,350 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
'neovim/nvim-lspconfig',
|
||||||
|
dependencies = {
|
||||||
|
-- Automatically install LSPs and related tools to stdpath for Neovim
|
||||||
|
{ 'williamboman/mason.nvim', config = true }, -- NOTE: Must be loaded before dependants
|
||||||
|
'williamboman/mason-lspconfig.nvim',
|
||||||
|
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
||||||
|
|
||||||
|
-- Useful status updates for LSP.
|
||||||
|
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
|
||||||
|
{ 'j-hui/fidget.nvim', opts = {} },
|
||||||
|
|
||||||
|
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
|
||||||
|
-- used for completion, annotations and signatures of Neovim apis
|
||||||
|
{ 'folke/lazydev.nvim' },
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require 'custom.plugins.configs.lsp'
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
-- See `:help gitsigns` to understand what the configuration keys do
|
||||||
|
{ -- Adds git related signs to the gutter, as well as utilities for managing changes
|
||||||
|
'lewis6991/gitsigns.nvim',
|
||||||
|
opts = {
|
||||||
|
signs = {
|
||||||
|
add = { text = '+' },
|
||||||
|
change = { text = '~' },
|
||||||
|
delete = { text = '_' },
|
||||||
|
topdelete = { text = '‾' },
|
||||||
|
changedelete = { text = '~' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'folke/trouble.nvim',
|
||||||
|
cmd = 'Trouble',
|
||||||
|
opts = { use_diagnostic_signs = true },
|
||||||
|
keys = {
|
||||||
|
{ '<leader>ctb', '<cmd>Trouble diagnostics toggle filter.buf=0<cr>', desc = 'Document Diagnostics (Trouble)' },
|
||||||
|
{ '<leader>ctr', '<cmd>Trouble diagnostics toggle<cr>', desc = 'Workspace Diagnostics (Trouble)' },
|
||||||
|
{ '<leader>ctq', '<cmd>Trouble qflist toggle<cr>', desc = 'Quickfix List (Trouble)' },
|
||||||
|
{ '<leader>ctl', '<cmd>Trouble loclist toggle<cr>', desc = 'Location List (Trouble)' },
|
||||||
|
{ '<leader>ctd', '<cmd>Trouble symbols<cr>', desc = 'LSP symbols (Trouble)' },
|
||||||
|
{ '<leader>ctt', '<cmd>Trouble todo<cr>', desc = 'Todos (Trouble)' },
|
||||||
|
{ '<leader>cts', '<cmd>Trouble lsp_document_symbols toggle win.position=right<cr>', desc = 'Document [S]ymbols side (Trouble)' },
|
||||||
|
{
|
||||||
|
'[q',
|
||||||
|
function()
|
||||||
|
if require('trouble').is_open() then
|
||||||
|
require('trouble').previous { skip_groups = true, jump = true }
|
||||||
|
else
|
||||||
|
vim.cmd.cprev()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
desc = 'Previous trouble/quickfix item',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
']q',
|
||||||
|
function()
|
||||||
|
if require('trouble').is_open() then
|
||||||
|
require('trouble').next { skip_groups = true, jump = true }
|
||||||
|
else
|
||||||
|
vim.cmd.cnext()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
desc = 'Next trouble/quickfix item',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ -- Autocompletion
|
||||||
|
'hrsh7th/nvim-cmp',
|
||||||
|
enabled = not vim.g.started_by_firenvim,
|
||||||
|
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',
|
||||||
|
},
|
||||||
|
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 = 'nvim_lsp' },
|
||||||
|
{ name = 'luasnip' },
|
||||||
|
{ name = 'path' },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{ -- Highlight, edit, and navigate code
|
||||||
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
build = ':TSUpdate',
|
||||||
|
opts = {
|
||||||
|
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' },
|
||||||
|
-- Autoinstall languages that are not installed
|
||||||
|
auto_install = true,
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
-- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules.
|
||||||
|
-- If you are experiencing weird indenting issues, add the language to
|
||||||
|
-- the list of additional_vim_regex_highlighting and disabled languages for indent.
|
||||||
|
additional_vim_regex_highlighting = { 'ruby' },
|
||||||
|
},
|
||||||
|
indent = { enable = true, disable = { 'ruby' } },
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
|
||||||
|
|
||||||
|
-- Prefer git instead of curl in order to improve connectivity in some environments
|
||||||
|
require('nvim-treesitter.install').prefer_git = true
|
||||||
|
---@diagnostic disable-next-line: missing-fields
|
||||||
|
require('nvim-treesitter.configs').setup(opts)
|
||||||
|
|
||||||
|
-- There are additional nvim-treesitter modules that you can use to interact
|
||||||
|
-- with nvim-treesitter. You should go explore a few and see what interests you:
|
||||||
|
--
|
||||||
|
-- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod`
|
||||||
|
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
|
||||||
|
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'kevinhwang91/nvim-bqf',
|
||||||
|
ft = 'qf',
|
||||||
|
cmd = 'BqfAutoToggle',
|
||||||
|
event = 'QuickFixCmdPost',
|
||||||
|
opts = {
|
||||||
|
auto_resize_height = false,
|
||||||
|
func_map = {
|
||||||
|
tab = 'st',
|
||||||
|
split = 'sv',
|
||||||
|
vsplit = 'sg',
|
||||||
|
|
||||||
|
stoggleup = 'K',
|
||||||
|
stoggledown = 'J',
|
||||||
|
stogglevm = '<Space>',
|
||||||
|
|
||||||
|
ptoggleitem = 'p',
|
||||||
|
ptoggleauto = 'P',
|
||||||
|
ptogglemode = 'zp',
|
||||||
|
|
||||||
|
pscrollup = '<C-b>',
|
||||||
|
pscrolldown = '<C-f>',
|
||||||
|
|
||||||
|
prevfile = 'gk',
|
||||||
|
nextfile = 'gj',
|
||||||
|
|
||||||
|
prevhist = '<S-Tab>',
|
||||||
|
nexthist = '<Tab>',
|
||||||
|
},
|
||||||
|
preview = {
|
||||||
|
auto_preview = true,
|
||||||
|
should_preview_cb = function(bufnr)
|
||||||
|
-- file size greater than 100kb can't be previewed automatically
|
||||||
|
local filename = vim.api.nvim_buf_get_name(bufnr)
|
||||||
|
local fsize = vim.fn.getfsize(filename)
|
||||||
|
if fsize > 100 * 1024 then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'rmagatti/goto-preview',
|
||||||
|
event = 'FileType',
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
'gpd',
|
||||||
|
function()
|
||||||
|
require('goto-preview').goto_preview_definition()
|
||||||
|
end,
|
||||||
|
desc = 'Go to definition preview',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'gpD',
|
||||||
|
function()
|
||||||
|
require('goto-preview').goto_preview_declaration()
|
||||||
|
end,
|
||||||
|
desc = 'Go to declaration preview',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'gpi',
|
||||||
|
function()
|
||||||
|
require('goto-preview').goto_preview_implementation()
|
||||||
|
end,
|
||||||
|
desc = 'Go to implementaion preview',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'gpt',
|
||||||
|
function()
|
||||||
|
require('goto-preview').goto_preview_type_definition()
|
||||||
|
end,
|
||||||
|
desc = 'Go to type preview',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'gpt',
|
||||||
|
function()
|
||||||
|
require('goto-preview').goto_preview_type_references()
|
||||||
|
end,
|
||||||
|
desc = 'Preview references',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'gpc',
|
||||||
|
function()
|
||||||
|
require('goto-preview').close_all_win()
|
||||||
|
end,
|
||||||
|
desc = 'Close all preview windows',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require('goto-preview').setup {}
|
||||||
|
end,
|
||||||
|
dependencies = 'nvim-telescope/telescope.nvim',
|
||||||
|
opts = {
|
||||||
|
width = 78,
|
||||||
|
height = 15,
|
||||||
|
default_mappings = false,
|
||||||
|
opacity = 10,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ 'kosayoda/nvim-lightbulb', event = { 'BufReadPre', 'BufNewFile' } },
|
||||||
|
{
|
||||||
|
'folke/lazydev.nvim',
|
||||||
|
ft = 'lua', -- only load on lua files
|
||||||
|
opts = {
|
||||||
|
library = {
|
||||||
|
-- See the configuration section for more details
|
||||||
|
-- Load luvit types when the `vim.uv` word is found
|
||||||
|
{ path = 'luvit-meta/library', words = { 'vim%.uv' } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ 'Bilal2453/luvit-meta', lazy = true }, -- optional `vim.uv` typings
|
||||||
|
{
|
||||||
|
'nvimtools/none-ls.nvim',
|
||||||
|
config = function()
|
||||||
|
local null_ls = require 'null-ls'
|
||||||
|
|
||||||
|
null_ls.setup {
|
||||||
|
sources = {
|
||||||
|
null_ls.builtins.formatting.stylua,
|
||||||
|
null_ls.builtins.formatting.gdformat,
|
||||||
|
null_ls.builtins.diagnostics.gdlint,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'chomosuke/typst-preview.nvim',
|
||||||
|
ft = 'typst',
|
||||||
|
version = '1.*',
|
||||||
|
opts = {
|
||||||
|
dependencies_bin = { ['tinymist'] = 'tinymist' }, -- use mason
|
||||||
|
}, -- lazy.nvim will implicitly calls `setup {}`
|
||||||
|
},
|
||||||
|
}
|
100
lua/custom/plugins/ltex.lua
Normal file
100
lua/custom/plugins/ltex.lua
Normal file
|
@ -0,0 +1,100 @@
|
||||||
|
local utils = require 'custom.utils'
|
||||||
|
|
||||||
|
local ltex_fts = {
|
||||||
|
'bibtex',
|
||||||
|
'bib',
|
||||||
|
'tex',
|
||||||
|
'typst',
|
||||||
|
'latex',
|
||||||
|
'gitcommit',
|
||||||
|
'markdown',
|
||||||
|
'org',
|
||||||
|
'restructuredtext',
|
||||||
|
'rsweave',
|
||||||
|
'quarto',
|
||||||
|
'rmd',
|
||||||
|
'context',
|
||||||
|
'text',
|
||||||
|
'html',
|
||||||
|
'pandoc',
|
||||||
|
'xhtml',
|
||||||
|
'plaintex',
|
||||||
|
'quarto',
|
||||||
|
'mail',
|
||||||
|
'mdx',
|
||||||
|
'rmd',
|
||||||
|
'rnoweb',
|
||||||
|
'rst',
|
||||||
|
}
|
||||||
|
|
||||||
|
local map = function(keys, func, desc)
|
||||||
|
vim.keymap.set('n', keys, func, { buffer = vim.buf, desc = 'LSP[LTEX]: ' .. desc })
|
||||||
|
end
|
||||||
|
|
||||||
|
LTEX_SETTINGS = {
|
||||||
|
capabilities = CAPABILITIES,
|
||||||
|
on_attach = function(client, bufnr)
|
||||||
|
DEFAULT_ON_ATTACH(client, bufnr)
|
||||||
|
end,
|
||||||
|
autostart = false,
|
||||||
|
filetypes = ltex_fts,
|
||||||
|
settings = {
|
||||||
|
ltex = {
|
||||||
|
checkFrequency = 'save', -- shut up while i'm just editing, see <https://github.com/folke/noice.nvim/issues/166>
|
||||||
|
-- specific language (such as en-GB or de-DE is recommended, but I
|
||||||
|
-- want multilingual)
|
||||||
|
language = 'auto',
|
||||||
|
enabled = ltex_fts,
|
||||||
|
additionalRules = {
|
||||||
|
enablePickyRules = true,
|
||||||
|
-- thats cool, but often adds diagnostics in
|
||||||
|
-- places where a german might confuse words that are similar
|
||||||
|
-- between english and german REGARDLESS of context. I seem to use the
|
||||||
|
-- english words only in the proper contexts, so leaving this on
|
||||||
|
-- just adds annoying hints like 'Hinweis: "list/NN.*" (English) bedeutet "Liste",
|
||||||
|
-- "Verzeichnis" (German). Meinten Sie vielleicht 'cunning', 'trick'?'
|
||||||
|
-- everytime I use the word "list". I liked that this makes the hints be
|
||||||
|
-- in german regardless of the language I'm working in through...
|
||||||
|
motherTongue = 'de',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- load token and additional languagetool items later if specified
|
||||||
|
local do_not_use_api_key = true
|
||||||
|
local has_api_key, apiKey = utils.try_require 'custom.secret.languagetool'
|
||||||
|
if not do_not_use_api_key and has_api_key and apiKey ~= '' then
|
||||||
|
LTEX_SETTINGS = vim.tbl_deep_extend('keep', LTEX_SETTINGS, {
|
||||||
|
settings = {
|
||||||
|
languageToolOrg = {
|
||||||
|
apiKey = apiKey,
|
||||||
|
username = 'accounts@cscherr.de',
|
||||||
|
},
|
||||||
|
languageToolHttpServerUrl = 'https://api.languagetoolplus.com/',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
else
|
||||||
|
if not do_not_use_api_key then
|
||||||
|
print 'apiKey for ltex/languagetool is not specified'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
'barreiroleo/ltex_extra.nvim',
|
||||||
|
ft = ltex_fts,
|
||||||
|
dependencies = { 'neovim/nvim-lspconfig' },
|
||||||
|
config = function()
|
||||||
|
require('ltex_extra').setup {
|
||||||
|
load_langs = { 'en-US', 'de-DE' },
|
||||||
|
init_check = true,
|
||||||
|
server_opts = LTEX_SETTINGS, -- or use lspconfig regularly
|
||||||
|
}
|
||||||
|
map('<leader>tS', function()
|
||||||
|
vim.opt.spell = true -- manually enable spell with `set spell` or `<leader>ts`
|
||||||
|
vim.opt.spelllang = 'en,de_de'
|
||||||
|
vim.opt.spellsuggest = 'double,50,timeout:5000'
|
||||||
|
vim.cmd 'LspStart ltex'
|
||||||
|
end, 'Enable spell checking with languagetool')
|
||||||
|
end,
|
||||||
|
}
|
|
@ -22,6 +22,7 @@ return {
|
||||||
|
|
||||||
-- Useful for getting pretty icons, but requires a Nerd Font.
|
-- Useful for getting pretty icons, but requires a Nerd Font.
|
||||||
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
|
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
|
||||||
|
{ 'echasnovski/mini.icons', version = '*' },
|
||||||
},
|
},
|
||||||
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
|
||||||
|
|
|
@ -1,117 +1,124 @@
|
||||||
|
the_themes = {
|
||||||
|
-- Dark Themes
|
||||||
|
{
|
||||||
|
name = '==========Dark Themes==========',
|
||||||
|
colorscheme = '', -- this actually keeps the selected theme, but it wont work with persistence
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'nvim default',
|
||||||
|
colorscheme = 'default',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'nvim lunaperche',
|
||||||
|
colorscheme = 'lunaperche',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'nvim quiet',
|
||||||
|
colorscheme = 'quiet',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'nvim retrobox',
|
||||||
|
colorscheme = 'retrobox',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'nvim slate',
|
||||||
|
colorscheme = 'slate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'nvim vim',
|
||||||
|
colorscheme = 'vim',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'tokyonight',
|
||||||
|
colorscheme = 'tokyonight',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'tokyonight-moon',
|
||||||
|
colorscheme = 'tokyonight-moon',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'tokyonight-storm',
|
||||||
|
colorscheme = 'tokyonight-storm',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'kanagawa',
|
||||||
|
colorscheme = 'kanagawa',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'kanagawa-dragon',
|
||||||
|
colorscheme = 'kanagawa-dragon',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'kanagawa-wave',
|
||||||
|
colorscheme = 'kanagawa-wave',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'zenbones',
|
||||||
|
colorscheme = 'zenbones',
|
||||||
|
before = [[
|
||||||
|
-- It's a major hack from the themery guys that this is a string
|
||||||
|
vim.opt.background = "dark"
|
||||||
|
]],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'tokyobones',
|
||||||
|
colorscheme = 'tokyobones',
|
||||||
|
before = [[
|
||||||
|
-- It's a major hack from the themery guys that this is a string
|
||||||
|
vim.opt.background = "dark"
|
||||||
|
]],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'kanagawabones',
|
||||||
|
colorscheme = 'kanagawabones',
|
||||||
|
before = [[
|
||||||
|
-- It's a major hack from the themery guys that this is a string
|
||||||
|
vim.opt.background = "dark"
|
||||||
|
]],
|
||||||
|
},
|
||||||
|
'catppuccin-frappe',
|
||||||
|
'catppuccin-macchiato',
|
||||||
|
'catppuccin-mocha',
|
||||||
|
'rose-pine-main',
|
||||||
|
'rose-pine-moon',
|
||||||
|
'cyberdream',
|
||||||
|
-- Light themes
|
||||||
|
{
|
||||||
|
name = '==========Light Themes==========',
|
||||||
|
colorscheme = '', -- this actually keeps the selected theme, but it wont work with persistence
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'tokyonight-day',
|
||||||
|
colorscheme = 'tokyonight-day',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'kanagawa-lotus',
|
||||||
|
colorscheme = 'kanagawa-lotus',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'zenbones',
|
||||||
|
colorscheme = 'zenbones',
|
||||||
|
before = [[
|
||||||
|
-- It's a major hack from the themery guys that this is a string
|
||||||
|
vim.opt.background = "light"
|
||||||
|
]],
|
||||||
|
},
|
||||||
|
'catppuccin-latte',
|
||||||
|
'rose-pine-dawn',
|
||||||
|
'cyberdream-light',
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'zaldih/themery.nvim',
|
'zaldih/themery.nvim',
|
||||||
priority = 1000, -- Make sure to load this before all the other start plugins.
|
lazy = false,
|
||||||
cmd = 'Themery',
|
cmd = 'Themery',
|
||||||
keys = {
|
keys = {
|
||||||
{ ';ft', '<cmd> Themery <cr>', desc = '[F]ind [T]heme' },
|
{ ';ft', '<cmd> Themery <cr>', desc = '[F]ind [T]heme' },
|
||||||
},
|
},
|
||||||
init = function()
|
|
||||||
require 'settings.theme'
|
|
||||||
end,
|
|
||||||
config = function()
|
config = function()
|
||||||
require('themery').setup {
|
require('themery').setup {
|
||||||
themes = {
|
themes = the_themes,
|
||||||
-- Dark Themes
|
|
||||||
{
|
|
||||||
name = '==========Dark Themes==========',
|
|
||||||
colorscheme = '', -- this actually keeps the selected theme, but it wont work with persistence
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'nvim default',
|
|
||||||
colorscheme = 'default',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'nvim lunaperche',
|
|
||||||
colorscheme = 'lunaperche',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'nvim quiet',
|
|
||||||
colorscheme = 'quiet',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'nvim retrobox',
|
|
||||||
colorscheme = 'retrobox',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'nvim slate',
|
|
||||||
colorscheme = 'slate',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'nvim vim',
|
|
||||||
colorscheme = 'vim',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'tokyonight',
|
|
||||||
colorscheme = 'tokyonight',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'tokyonight-moon',
|
|
||||||
colorscheme = 'tokyonight-moon',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'tokyonight-storm',
|
|
||||||
colorscheme = 'tokyonight-storm',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'kanagawa',
|
|
||||||
colorscheme = 'kanagawa',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'kanagawa-dragon',
|
|
||||||
colorscheme = 'kanagawa-dragon',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'kanagawa-wave',
|
|
||||||
colorscheme = 'kanagawa-wave',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'zenbones',
|
|
||||||
colorscheme = 'zenbones',
|
|
||||||
before = [[
|
|
||||||
-- It's a major hack from the themery guys that this is a string
|
|
||||||
vim.opt.background = "dark"
|
|
||||||
]],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'tokyobones',
|
|
||||||
colorscheme = 'tokyobones',
|
|
||||||
before = [[
|
|
||||||
-- It's a major hack from the themery guys that this is a string
|
|
||||||
vim.opt.background = "dark"
|
|
||||||
]],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'kanagawabones',
|
|
||||||
colorscheme = 'kanagawabones',
|
|
||||||
before = [[
|
|
||||||
-- It's a major hack from the themery guys that this is a string
|
|
||||||
vim.opt.background = "dark"
|
|
||||||
]],
|
|
||||||
},
|
|
||||||
-- Light themes
|
|
||||||
{
|
|
||||||
name = '==========Light Themes==========',
|
|
||||||
colorscheme = '', -- this actually keeps the selected theme, but it wont work with persistence
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'tokyonight-day',
|
|
||||||
colorscheme = 'tokyonight-day',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'kanagawa-lotus',
|
|
||||||
colorscheme = 'kanagawa-lotus',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'zenbones',
|
|
||||||
colorscheme = 'zenbones',
|
|
||||||
before = [[
|
|
||||||
-- It's a major hack from the themery guys that this is a string
|
|
||||||
vim.opt.background = "light"
|
|
||||||
]],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
themeConfigFile = '~/.config/nvim/lua/settings/theme.lua',
|
|
||||||
livePreview = true, -- Apply theme while browsing. Default to true.
|
livePreview = true, -- Apply theme while browsing. Default to true.
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
|
@ -119,4 +126,26 @@ return {
|
||||||
'folke/tokyonight.nvim',
|
'folke/tokyonight.nvim',
|
||||||
'rebelot/kanagawa.nvim',
|
'rebelot/kanagawa.nvim',
|
||||||
{ 'zenbones-theme/zenbones.nvim', dependencies = { 'rktjmp/lush.nvim' } },
|
{ 'zenbones-theme/zenbones.nvim', dependencies = { 'rktjmp/lush.nvim' } },
|
||||||
|
{ 'catppuccin/nvim', name = 'catppuccin', priority = 1000 },
|
||||||
|
{ 'rose-pine/neovim', name = 'rose-pine' },
|
||||||
|
{
|
||||||
|
'scottmckendry/cyberdream.nvim',
|
||||||
|
setup = function()
|
||||||
|
require('cyberdream').setup {
|
||||||
|
-- Enable transparent background
|
||||||
|
transparent = true,
|
||||||
|
italic_comments = false,
|
||||||
|
-- Replace all fillchars with ' ' for the ultimate clean look
|
||||||
|
hide_fillchars = false,
|
||||||
|
borderless_pickers = true,
|
||||||
|
terminal_colors = true,
|
||||||
|
cache = true,
|
||||||
|
extensions = {
|
||||||
|
telescope = true,
|
||||||
|
notify = true,
|
||||||
|
mini = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,6 +143,81 @@ return {
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
{ 'echasnovski/mini.trailspace', lazy = false, version = false, opts = { only_in_normal_buffers = true } },
|
||||||
|
{
|
||||||
|
'folke/which-key.nvim',
|
||||||
|
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
|
||||||
|
opts = {
|
||||||
|
triggers_nowait = {
|
||||||
|
-- marks
|
||||||
|
'`',
|
||||||
|
"'",
|
||||||
|
'g`',
|
||||||
|
"g'",
|
||||||
|
-- registers
|
||||||
|
'"',
|
||||||
|
'<c-r>',
|
||||||
|
-- spelling
|
||||||
|
'z=',
|
||||||
|
'o',
|
||||||
|
'O',
|
||||||
|
},
|
||||||
|
triggers_blacklist = {
|
||||||
|
-- list of mode / prefixes that should never be hooked by WhichKey
|
||||||
|
-- this is mostly relevant for keymaps that start with a native binding
|
||||||
|
i = { 'j', 'k' },
|
||||||
|
v = { 'j', 'k' },
|
||||||
|
n = { 'o', 'O' },
|
||||||
|
},
|
||||||
|
-- plugins = {
|
||||||
|
-- marks = true, -- shows a list of your marks on ' and `
|
||||||
|
-- registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
|
||||||
|
-- -- the presets plugin, adds help for a bunch of default keybindings in Neovim
|
||||||
|
-- -- No actual key bindings are created
|
||||||
|
-- spelling = {
|
||||||
|
-- enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions
|
||||||
|
-- suggestions = 20, -- how many suggestions should be shown in the list?
|
||||||
|
-- },
|
||||||
|
-- presets = {
|
||||||
|
-- operators = true, -- adds help for operators like d, y, ...
|
||||||
|
-- motions = true, -- adds help for motions
|
||||||
|
-- text_objects = true, -- help for text objects triggered after entering an operator
|
||||||
|
-- windows = true, -- default bindings on <c-w>
|
||||||
|
-- nav = true, -- misc bindings to work with windows
|
||||||
|
-- z = true, -- bindings for folds, spelling and others prefixed with z
|
||||||
|
-- g = true, -- bindings for prefixed with g
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
icons = {
|
||||||
|
breadcrumb = '»', -- symbol used in the command line area that shows your active key combo
|
||||||
|
separator = '➜', -- symbol used between a key and it's label
|
||||||
|
group = '+', -- symbol prepended to a group
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function(opts)
|
||||||
|
local wk = require 'which-key'
|
||||||
|
local defaults = {
|
||||||
|
mode = { 'n', 'v' },
|
||||||
|
{ '<leader>c', group = '[C]ode/[C]olor' },
|
||||||
|
{ '<leader>ct', group = '[T]rouble' },
|
||||||
|
{ '<leader>d', group = '[D]ebug' },
|
||||||
|
{ '<leader>dc', group = '[C]hange' },
|
||||||
|
{ '<leader>dw', group = '[W]indow' },
|
||||||
|
{ '<leader>f', group = '[F]ormatting' },
|
||||||
|
{ '<leader>g', group = '[G]ood tools' },
|
||||||
|
{ '<leader>r', group = '[R]ename' },
|
||||||
|
{ '<leader>t', group = '[T]oggle' },
|
||||||
|
{ '<leader>w', group = '[W]orkspace' },
|
||||||
|
{ '<leader>wb', group = 'buffer' },
|
||||||
|
{ '<localleader>', group = 'select' },
|
||||||
|
{ '<localleader>f', group = '[F]ind' },
|
||||||
|
{ '[', group = 'prev' },
|
||||||
|
{ ']', group = 'next' },
|
||||||
|
{ 'g', group = 'goto' },
|
||||||
|
}
|
||||||
|
wk.add(defaults, opts)
|
||||||
|
end,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'echasnovski/mini.trailspace',
|
'echasnovski/mini.trailspace',
|
||||||
lazy = false,
|
lazy = false,
|
||||||
|
@ -255,12 +330,12 @@ return {
|
||||||
'folke/todo-comments.nvim',
|
'folke/todo-comments.nvim',
|
||||||
lazy = false,
|
lazy = false,
|
||||||
dependencies = 'nvim-telescope/telescope.nvim',
|
dependencies = 'nvim-telescope/telescope.nvim',
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
keys = {
|
keys = {
|
||||||
{ ']t', function() require('todo-comments').jump_next() end, desc = 'Next todo comment' },
|
{ ']t', function() require('todo-comments').jump_next() end, desc = 'Next todo comment' },
|
||||||
{ '[t', function() require('todo-comments').jump_prev() end, desc = 'Previous todo comment' },
|
{ '[t', function() require('todo-comments').jump_prev() end, desc = 'Previous todo comment' },
|
||||||
{ '<LocalLeader>fdt', '<cmd>TodoTelescope<CR>', desc = 'todo' },
|
{ '<LocalLeader>fT', '<cmd>TodoTelescope<CR>', desc = 'todo' },
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
signs = true,
|
signs = true,
|
||||||
keywords = {
|
keywords = {
|
||||||
|
@ -411,11 +486,11 @@ return {
|
||||||
{
|
{
|
||||||
'kevinhwang91/nvim-ufo',
|
'kevinhwang91/nvim-ufo',
|
||||||
event = { 'BufReadPost', 'BufNewFile' },
|
event = { 'BufReadPost', 'BufNewFile' },
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
keys = {
|
keys = {
|
||||||
{ 'zR', function() require('ufo').openAllFolds() end },
|
{ 'zR', function() require('ufo').openAllFolds() end },
|
||||||
{ 'zM', function() require('ufo').closeAllFolds() end },
|
{ 'zM', function() require('ufo').closeAllFolds() end },
|
||||||
},
|
},
|
||||||
dependencies = {
|
dependencies = {
|
||||||
'kevinhwang91/promise-async',
|
'kevinhwang91/promise-async',
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
@ -567,8 +642,8 @@ return {
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.b.minitrailspace_disable = true
|
vim.b.minitrailspace_disable = true
|
||||||
vim.opt_local.list = false
|
vim.opt_local.list = false
|
||||||
vim.opt_local.colorcolumn = '0'
|
|
||||||
vim.opt_local.spell = false
|
vim.opt_local.spell = false
|
||||||
|
vim.opt_local.colorcolumn = '0'
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -16,14 +16,14 @@ M.tokenize_args = function(raw)
|
||||||
--
|
--
|
||||||
-- This means we're better of implementing the lexer with an algorithm.
|
-- This means we're better of implementing the lexer with an algorithm.
|
||||||
local t = {}
|
local t = {}
|
||||||
local current = ""
|
local current = ''
|
||||||
local in_str = false
|
local in_str = false
|
||||||
local str_seek
|
local str_seek
|
||||||
for c in string.gmatch(raw, ".") do -- iterate through all chars
|
for c in string.gmatch(raw, '.') do -- iterate through all chars
|
||||||
if c == " " and not in_str then
|
if c == ' ' and not in_str then
|
||||||
if string.len(current) > 0 then
|
if string.len(current) > 0 then
|
||||||
table.insert(t, current)
|
table.insert(t, current)
|
||||||
current = ""
|
current = ''
|
||||||
end
|
end
|
||||||
elseif c == '"' and not in_str then
|
elseif c == '"' and not in_str then
|
||||||
in_str = true
|
in_str = true
|
||||||
|
@ -34,7 +34,7 @@ M.tokenize_args = function(raw)
|
||||||
elseif c == str_seek and in_str then
|
elseif c == str_seek and in_str then
|
||||||
in_str = false
|
in_str = false
|
||||||
table.insert(t, current)
|
table.insert(t, current)
|
||||||
current = ""
|
current = ''
|
||||||
else
|
else
|
||||||
current = current .. c
|
current = current .. c
|
||||||
end
|
end
|
||||||
|
@ -50,18 +50,18 @@ end
|
||||||
--- @param t any variable
|
--- @param t any variable
|
||||||
--- @return string t_dumped t dumped to string
|
--- @return string t_dumped t dumped to string
|
||||||
M.dump = function(t)
|
M.dump = function(t)
|
||||||
if type(t) == "table" then
|
if type(t) == 'table' then
|
||||||
local s = "{ "
|
local s = '{ '
|
||||||
for k, v in pairs(t) do
|
for k, v in pairs(t) do
|
||||||
if type(k) ~= "number" then
|
if type(k) ~= 'number' then
|
||||||
k = '"' .. k .. '"'
|
k = '"' .. k .. '"'
|
||||||
end
|
end
|
||||||
if k ~= 1 then
|
if k ~= 1 then
|
||||||
s = s .. ", "
|
s = s .. ', '
|
||||||
end
|
end
|
||||||
s = s .. "[" .. k .. "] = '" .. M.dump(v) .. "'"
|
s = s .. '[' .. k .. "] = '" .. M.dump(v) .. "'\n"
|
||||||
end
|
end
|
||||||
return s .. " }"
|
return s .. ' }'
|
||||||
else
|
else
|
||||||
return tostring(t)
|
return tostring(t)
|
||||||
end
|
end
|
||||||
|
@ -81,4 +81,3 @@ M.try_require = function(module)
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
||||||
|
|
52
lua/kickstart/health.lua
Normal file
52
lua/kickstart/health.lua
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
--[[
|
||||||
|
--
|
||||||
|
-- This file is not required for your own configuration,
|
||||||
|
-- but helps people determine if their system is setup correctly.
|
||||||
|
--
|
||||||
|
--]]
|
||||||
|
|
||||||
|
local check_version = function()
|
||||||
|
local verstr = string.format('%s.%s.%s', vim.version().major, vim.version().minor, vim.version().patch)
|
||||||
|
if not vim.version.cmp then
|
||||||
|
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if vim.version.cmp(vim.version(), { 0, 9, 4 }) >= 0 then
|
||||||
|
vim.health.ok(string.format("Neovim version is: '%s'", verstr))
|
||||||
|
else
|
||||||
|
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local check_external_reqs = function()
|
||||||
|
-- Basic utils: `git`, `make`, `unzip`
|
||||||
|
for _, exe in ipairs { 'git', 'make', 'unzip', 'rg' } do
|
||||||
|
local is_executable = vim.fn.executable(exe) == 1
|
||||||
|
if is_executable then
|
||||||
|
vim.health.ok(string.format("Found executable: '%s'", exe))
|
||||||
|
else
|
||||||
|
vim.health.warn(string.format("Could not find executable: '%s'", exe))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
check = function()
|
||||||
|
vim.health.start 'kickstart.nvim'
|
||||||
|
|
||||||
|
vim.health.info [[NOTE: Not every warning is a 'must-fix' in `:checkhealth`
|
||||||
|
|
||||||
|
Fix only warnings for plugins and languages you intend to use.
|
||||||
|
Mason will give warnings for languages that are not installed.
|
||||||
|
You do not need to install, unless you want to use those languages!]]
|
||||||
|
|
||||||
|
local uv = vim.uv or vim.loop
|
||||||
|
vim.health.info('System Information: ' .. vim.inspect(uv.os_uname()))
|
||||||
|
|
||||||
|
check_version()
|
||||||
|
check_external_reqs()
|
||||||
|
end,
|
||||||
|
}
|
212
lua/kickstart/plugins/debug.lua
Normal file
212
lua/kickstart/plugins/debug.lua
Normal file
|
@ -0,0 +1,212 @@
|
||||||
|
-- debug.lua
|
||||||
|
--
|
||||||
|
-- Shows how to use the DAP plugin to debug your code.
|
||||||
|
--
|
||||||
|
-- Primarily focused on configuring the debugger for Go, but can
|
||||||
|
-- be extended to other languages as well. That's why it's called
|
||||||
|
-- kickstart.nvim and not kitchen-sink.nvim ;)
|
||||||
|
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
-- NOTE: Yes, you can install new plugins here!
|
||||||
|
'mfussenegger/nvim-dap',
|
||||||
|
-- NOTE: And you can specify dependencies as well
|
||||||
|
dependencies = {
|
||||||
|
-- Creates a beautiful debugger UI
|
||||||
|
|
||||||
|
-- Required dependency for nvim-dap-ui
|
||||||
|
'nvim-neotest/nvim-nio',
|
||||||
|
|
||||||
|
-- Installs the debug adapters for you
|
||||||
|
'williamboman/mason.nvim',
|
||||||
|
'jay-babu/mason-nvim-dap.nvim',
|
||||||
|
|
||||||
|
'theHamsta/nvim-dap-virtual-text',
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local dap = require 'dap'
|
||||||
|
local dapui = require 'dapui'
|
||||||
|
|
||||||
|
require('mason-nvim-dap').setup {
|
||||||
|
-- Makes a best effort to setup the various debuggers with
|
||||||
|
-- reasonable debug configurations
|
||||||
|
automatic_installation = true,
|
||||||
|
|
||||||
|
-- You can provide additional configuration to the handlers,
|
||||||
|
-- see mason-nvim-dap README for more information
|
||||||
|
handlers = {},
|
||||||
|
|
||||||
|
-- You'll need to check that you have the required things installed
|
||||||
|
-- online, please don't ask me how to install them :)
|
||||||
|
ensure_installed = {
|
||||||
|
-- Update this to ensure that you have the debuggers for the langs you want
|
||||||
|
'codelldb',
|
||||||
|
'debugpy',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Basic debugging keymaps, feel free to change to your liking!
|
||||||
|
vim.keymap.set('n', '<leader>dB', function() end, { desc = 'Debug: Set Breakpoint' })
|
||||||
|
|
||||||
|
-- Dap UI setup
|
||||||
|
-- For more information, see |:help nvim-dap-ui|
|
||||||
|
dapui.setup {
|
||||||
|
-- Set icons to characters that are more likely to work in every terminal.
|
||||||
|
-- Feel free to remove or use ones that you like more! :)
|
||||||
|
-- Don't feel like these are good choices.
|
||||||
|
icons = { expanded = '▾', collapsed = '▸', current_frame = '*' },
|
||||||
|
controls = {
|
||||||
|
icons = {
|
||||||
|
pause = '⏸',
|
||||||
|
play = '▶',
|
||||||
|
step_into = '⏎',
|
||||||
|
step_over = '⏭',
|
||||||
|
step_out = '⏮',
|
||||||
|
step_back = 'b',
|
||||||
|
run_last = '▶▶',
|
||||||
|
terminate = '⏹',
|
||||||
|
disconnect = '⏏',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
|
||||||
|
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
|
||||||
|
dap.listeners.before.event_exited['dapui_config'] = dapui.close
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'rcarriga/nvim-dap-ui',
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
'<leader>du',
|
||||||
|
function()
|
||||||
|
require('dapui').toggle()
|
||||||
|
end,
|
||||||
|
|
||||||
|
desc = 'Open [D]ebug [U]i',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>dso',
|
||||||
|
function()
|
||||||
|
require('dap').step_over()
|
||||||
|
end,
|
||||||
|
|
||||||
|
desc = 'Toggle [D]ebug [S]tep [O]ver',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>dsi',
|
||||||
|
function()
|
||||||
|
require('dap').step_into()
|
||||||
|
end,
|
||||||
|
|
||||||
|
desc = 'Toggle [D]ebug [S]tep [I]nto',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>dc',
|
||||||
|
function()
|
||||||
|
require('dap').continue()
|
||||||
|
end,
|
||||||
|
|
||||||
|
desc = 'Toggle [D]ebug [C]ontinue / Start',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>db',
|
||||||
|
function()
|
||||||
|
require('dap').toggle_breakpoint()
|
||||||
|
end,
|
||||||
|
|
||||||
|
desc = 'Toggle [D]ebug [B]reakpoint',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>dB',
|
||||||
|
function()
|
||||||
|
require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ')
|
||||||
|
end,
|
||||||
|
|
||||||
|
desc = 'Toggle [D]ebug [B]reakpoint condition',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>dK',
|
||||||
|
function()
|
||||||
|
require('dap.ui.widgets').hover()
|
||||||
|
end,
|
||||||
|
|
||||||
|
desc = 'Open [D]ebug [K] hover',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>dws',
|
||||||
|
function()
|
||||||
|
local widgets = require 'dap.ui.widgets'
|
||||||
|
local my_sidebar = widgets.sidebar(widgets.scopes)
|
||||||
|
my_sidebar.open()
|
||||||
|
end,
|
||||||
|
desc = 'Open [D]ebug [W]indow [S]copes',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>dwr',
|
||||||
|
function()
|
||||||
|
require('dap').repl.toggle()
|
||||||
|
end,
|
||||||
|
|
||||||
|
desc = 'Open [D]ebug [W]indow [R]epl',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>dwf',
|
||||||
|
function()
|
||||||
|
local widgets = require 'dap.ui.widgets'
|
||||||
|
local my_sidebar = widgets.sidebar(widgets.frames)
|
||||||
|
my_sidebar.open()
|
||||||
|
end,
|
||||||
|
|
||||||
|
desc = 'Open [D]ebug [W]indow [F]rames',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>dwi',
|
||||||
|
function()
|
||||||
|
local widgets = require 'dap.ui.widgets'
|
||||||
|
local my_sidebar = widgets.sidebar(widgets.sessions)
|
||||||
|
my_sidebar.open()
|
||||||
|
end,
|
||||||
|
desc = 'Open [D]ebug [W]indow sess[I]ons',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>dwt',
|
||||||
|
function()
|
||||||
|
local widgets = require 'dap.ui.widgets'
|
||||||
|
local my_sidebar = widgets.sidebar(widgets.threads)
|
||||||
|
my_sidebar.open()
|
||||||
|
end,
|
||||||
|
desc = 'Open [D]ebug [W]indow [T]hreads',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>dwe',
|
||||||
|
function()
|
||||||
|
local widgets = require 'dap.ui.widgets'
|
||||||
|
local my_sidebar = widgets.sidebar(widgets.expression)
|
||||||
|
my_sidebar.open()
|
||||||
|
end,
|
||||||
|
|
||||||
|
desc = 'Open [D]ebug [W]indow [E]xpression',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
dependencies = {
|
||||||
|
'mfussenegger/nvim-dap',
|
||||||
|
'nvim-neotest/nvim-nio',
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
local dap = require 'dap'
|
||||||
|
local dapui = require 'dapui'
|
||||||
|
dapui.setup(opts)
|
||||||
|
dap.listeners.after.event_initialized['dapui_config'] = function()
|
||||||
|
dapui.open {}
|
||||||
|
end
|
||||||
|
dap.listeners.before.event_terminated['dapui_config'] = function()
|
||||||
|
-- dapui.close {}
|
||||||
|
end
|
||||||
|
dap.listeners.before.event_exited['dapui_config'] = function()
|
||||||
|
-- dapui.close {}
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
61
lua/kickstart/plugins/gitsigns.lua
Normal file
61
lua/kickstart/plugins/gitsigns.lua
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
-- Adds git related signs to the gutter, as well as utilities for managing changes
|
||||||
|
-- NOTE: gitsigns is already included in init.lua but contains only the base
|
||||||
|
-- config. This will add also the recommended keymaps.
|
||||||
|
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
'lewis6991/gitsigns.nvim',
|
||||||
|
opts = {
|
||||||
|
on_attach = function(bufnr)
|
||||||
|
local gitsigns = require 'gitsigns'
|
||||||
|
|
||||||
|
local function map(mode, l, r, opts)
|
||||||
|
opts = opts or {}
|
||||||
|
opts.buffer = bufnr
|
||||||
|
vim.keymap.set(mode, l, r, opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Navigation
|
||||||
|
map('n', ']c', function()
|
||||||
|
if vim.wo.diff then
|
||||||
|
vim.cmd.normal { ']c', bang = true }
|
||||||
|
else
|
||||||
|
gitsigns.nav_hunk 'next'
|
||||||
|
end
|
||||||
|
end, { desc = 'Jump to next git [c]hange' })
|
||||||
|
|
||||||
|
map('n', '[c', function()
|
||||||
|
if vim.wo.diff then
|
||||||
|
vim.cmd.normal { '[c', bang = true }
|
||||||
|
else
|
||||||
|
gitsigns.nav_hunk 'prev'
|
||||||
|
end
|
||||||
|
end, { desc = 'Jump to previous git [c]hange' })
|
||||||
|
|
||||||
|
-- Actions
|
||||||
|
-- visual mode
|
||||||
|
map('v', '<leader>hs', function()
|
||||||
|
gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' }
|
||||||
|
end, { desc = 'stage git hunk' })
|
||||||
|
map('v', '<leader>hr', function()
|
||||||
|
gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
|
||||||
|
end, { desc = 'reset git hunk' })
|
||||||
|
-- normal mode
|
||||||
|
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
|
||||||
|
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
|
||||||
|
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
|
||||||
|
map('n', '<leader>hu', gitsigns.undo_stage_hunk, { desc = 'git [u]ndo stage hunk' })
|
||||||
|
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
|
||||||
|
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
|
||||||
|
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
|
||||||
|
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
|
||||||
|
map('n', '<leader>hD', function()
|
||||||
|
gitsigns.diffthis '@'
|
||||||
|
end, { desc = 'git [D]iff against last commit' })
|
||||||
|
-- Toggles
|
||||||
|
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
|
||||||
|
map('n', '<leader>tD', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
55
lua/kickstart/plugins/lint.lua
Normal file
55
lua/kickstart/plugins/lint.lua
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
return {
|
||||||
|
|
||||||
|
{ -- Linting
|
||||||
|
'mfussenegger/nvim-lint',
|
||||||
|
event = { 'BufReadPre', 'BufNewFile' },
|
||||||
|
config = function()
|
||||||
|
local lint = require 'lint'
|
||||||
|
lint.linters_by_ft = {
|
||||||
|
markdown = { 'markdownlint' },
|
||||||
|
}
|
||||||
|
|
||||||
|
-- To allow other plugins to add linters to require('lint').linters_by_ft,
|
||||||
|
-- instead set linters_by_ft like this:
|
||||||
|
-- lint.linters_by_ft = lint.linters_by_ft or {}
|
||||||
|
-- lint.linters_by_ft['markdown'] = { 'markdownlint' }
|
||||||
|
--
|
||||||
|
-- However, note that this will enable a set of default linters,
|
||||||
|
-- which will cause errors unless these tools are available:
|
||||||
|
-- {
|
||||||
|
-- clojure = { "clj-kondo" },
|
||||||
|
-- dockerfile = { "hadolint" },
|
||||||
|
-- inko = { "inko" },
|
||||||
|
-- janet = { "janet" },
|
||||||
|
-- json = { "jsonlint" },
|
||||||
|
-- markdown = { "vale" },
|
||||||
|
-- rst = { "vale" },
|
||||||
|
-- ruby = { "ruby" },
|
||||||
|
-- terraform = { "tflint" },
|
||||||
|
-- text = { "vale" }
|
||||||
|
-- }
|
||||||
|
--
|
||||||
|
-- You can disable the default linters by setting their filetypes to nil:
|
||||||
|
-- lint.linters_by_ft['clojure'] = nil
|
||||||
|
-- lint.linters_by_ft['dockerfile'] = nil
|
||||||
|
-- lint.linters_by_ft['inko'] = nil
|
||||||
|
-- lint.linters_by_ft['janet'] = nil
|
||||||
|
-- lint.linters_by_ft['json'] = nil
|
||||||
|
-- lint.linters_by_ft['markdown'] = nil
|
||||||
|
-- lint.linters_by_ft['rst'] = nil
|
||||||
|
-- lint.linters_by_ft['ruby'] = nil
|
||||||
|
-- lint.linters_by_ft['terraform'] = nil
|
||||||
|
-- lint.linters_by_ft['text'] = nil
|
||||||
|
|
||||||
|
-- Create autocommand which carries out the actual linting
|
||||||
|
-- on the specified events.
|
||||||
|
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
|
||||||
|
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
|
||||||
|
group = lint_augroup,
|
||||||
|
callback = function()
|
||||||
|
require('lint').try_lint()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
25
lua/kickstart/plugins/neo-tree.lua
Normal file
25
lua/kickstart/plugins/neo-tree.lua
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
-- Neo-tree is a Neovim plugin to browse the file system
|
||||||
|
-- https://github.com/nvim-neo-tree/neo-tree.nvim
|
||||||
|
|
||||||
|
return {
|
||||||
|
'nvim-neo-tree/neo-tree.nvim',
|
||||||
|
version = '*',
|
||||||
|
dependencies = {
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
|
||||||
|
'MunifTanjim/nui.nvim',
|
||||||
|
},
|
||||||
|
cmd = 'Neotree',
|
||||||
|
keys = {
|
||||||
|
{ '\\', ':Neotree reveal<CR>', { desc = 'NeoTree reveal' } },
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
filesystem = {
|
||||||
|
window = {
|
||||||
|
mappings = {
|
||||||
|
['\\'] = 'close_window',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
|
@ -1,7 +0,0 @@
|
||||||
-- Use `git update-index --assume-unchanged <file>` to ignore changes in this file
|
|
||||||
--
|
|
||||||
-- Themery block
|
|
||||||
-- This block will be replaced by Themery.
|
|
||||||
vim.cmd("colorscheme tokyonight-storm")
|
|
||||||
vim.g.theme_id = 10
|
|
||||||
-- end themery block
|
|
|
@ -1 +1,5 @@
|
||||||
gings
|
gings
|
||||||
|
Safety
|
||||||
|
NewTec
|
||||||
|
Rust
|
||||||
|
Cybersecurity
|
||||||
|
|
|
@ -411,7 +411,7 @@ Konfuguration/!
|
||||||
typ
|
typ
|
||||||
Wooly
|
Wooly
|
||||||
addr
|
addr
|
||||||
adress
|
#dress
|
||||||
tokio
|
tokio
|
||||||
address/!
|
address/!
|
||||||
i32
|
i32
|
||||||
|
@ -532,3 +532,39 @@ Stabilitätsfaktor
|
||||||
herrscherial
|
herrscherial
|
||||||
decisionmaker
|
decisionmaker
|
||||||
reconnections
|
reconnections
|
||||||
|
Grischtoffshofian
|
||||||
|
Schutzteinheit
|
||||||
|
Baumaßnahmen
|
||||||
|
Grischtoffshofians
|
||||||
|
GAX
|
||||||
|
MSCI
|
||||||
|
ACWI
|
||||||
|
STMicroelectronics
|
||||||
|
Nucleo
|
||||||
|
STM32
|
||||||
|
ohneweiteres/!
|
||||||
|
STM32CubeIDE
|
||||||
|
vor
|
||||||
|
Möglich/!
|
||||||
|
Systemprogrammiesprachen
|
||||||
|
StableRef
|
||||||
|
StableRefMut
|
||||||
|
IntrusiveList
|
||||||
|
datastructurs
|
||||||
|
mut
|
||||||
|
ptr
|
||||||
|
NonNull
|
||||||
|
vec
|
||||||
|
const
|
||||||
|
adress/!
|
||||||
|
address
|
||||||
|
日本語
|
||||||
|
ICMP
|
||||||
|
IPv4
|
||||||
|
IPv6
|
||||||
|
Cloudflare's
|
||||||
|
SystemD
|
||||||
|
ZSTD
|
||||||
|
netpulsed
|
||||||
|
sudo
|
||||||
|
netpulse
|
||||||
|
|
Binary file not shown.
Loading…
Add table
Reference in a new issue