Setup
This commit is contained in:
commit
67c224a398
111 changed files with 1822 additions and 0 deletions
36
Readme.md
Normal file
36
Readme.md
Normal file
|
@ -0,0 +1,36 @@
|
|||
# Dotfiles/nvim
|
||||
|
||||
## Install dependencies
|
||||
|
||||
### Fedora
|
||||
|
||||
#### Enable Coprs
|
||||
```sh
|
||||
dnf copr enable yorickpeterse/stylua -y
|
||||
```
|
||||
|
||||
#### Add YUM Repos
|
||||
```sh
|
||||
echo '[charm]
|
||||
name=Charm
|
||||
baseurl=https://repo.charm.sh/yum/
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
gpgkey=https://repo.charm.sh/yum/gpg.key' | sudo tee /etc/yum.repos.d/charm.repo
|
||||
```
|
||||
|
||||
#### Install System Packages
|
||||
```sh
|
||||
dnf install -y neovim lua gcc curl wget git unzip tar gzip ripgrep php composer go nodejs npm delve stylua codespell cargo
|
||||
```
|
||||
|
||||
#### Install Cargo packages
|
||||
```sh
|
||||
cargo install selene
|
||||
```
|
||||
|
||||
#### Install NPM packages
|
||||
```sh
|
||||
npm install -g @fsouza/prettierd
|
||||
npm install -g eslint_d
|
||||
```
|
1
init.lua
Normal file
1
init.lua
Normal file
|
@ -0,0 +1 @@
|
|||
require('core')
|
8
lua/core/editor.lua
Normal file
8
lua/core/editor.lua
Normal file
|
@ -0,0 +1,8 @@
|
|||
-- Use 2 Spaces Instead of Tabs --
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
|
||||
-- Enable Line Number --
|
||||
vim.opt.number = true
|
3
lua/core/init.lua
Normal file
3
lua/core/init.lua
Normal file
|
@ -0,0 +1,3 @@
|
|||
require('core.keymap')
|
||||
require('core.editor')
|
||||
require('core.package_manager')
|
5
lua/core/keymap.lua
Normal file
5
lua/core/keymap.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
vim.g.mapleader = ' '
|
||||
|
||||
--[[ Indentation ]]
|
||||
vim.keymap.set('n', '<Tab>', '>>')
|
||||
vim.keymap.set('n', '<S-Tab>', '<<')
|
19
lua/core/package_manager.lua
Normal file
19
lua/core/package_manager.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
'git',
|
||||
'clone',
|
||||
'--filter=blob:none',
|
||||
'https://github.com/folke/lazy.nvim.git',
|
||||
'--branch=stable',
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
local plugins = require('util.toolchain').plugins
|
||||
table.insert(plugins, 1, { import = 'editor' })
|
||||
|
||||
require('lazy').setup({
|
||||
spec = plugins,
|
||||
})
|
4
lua/editor/auto_brackets.lua
Normal file
4
lua/editor/auto_brackets.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
return {
|
||||
'm4xshen/autoclose.nvim',
|
||||
config = function() require('autoclose').setup() end,
|
||||
}
|
32
lua/editor/dashboard.lua
Normal file
32
lua/editor/dashboard.lua
Normal file
|
@ -0,0 +1,32 @@
|
|||
return {
|
||||
'goolord/alpha-nvim',
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
},
|
||||
config = function()
|
||||
-- Setup --
|
||||
local alpha = require('alpha')
|
||||
local dashboard = require('alpha.themes.startify')
|
||||
|
||||
-- Header --
|
||||
dashboard.section.header.val = {
|
||||
[[ ]],
|
||||
[[ ]],
|
||||
[[ ]],
|
||||
[[ ]],
|
||||
[[ ]],
|
||||
[[ ████ ██████ █████ ██ ]],
|
||||
[[ ███████████ █████ ]],
|
||||
[[ █████████ ███████████████████ ███ ███████████ ]],
|
||||
[[ █████████ ███ █████████████ █████ ██████████████ ]],
|
||||
[[ █████████ ██████████ █████████ █████ █████ ████ █████ ]],
|
||||
[[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]],
|
||||
[[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]],
|
||||
[[ ]],
|
||||
[[ ]],
|
||||
[[ ]],
|
||||
}
|
||||
|
||||
alpha.setup(dashboard.opts)
|
||||
end,
|
||||
}
|
115
lua/editor/debugging.lua
Normal file
115
lua/editor/debugging.lua
Normal file
|
@ -0,0 +1,115 @@
|
|||
return {
|
||||
'mfussenegger/nvim-dap',
|
||||
dependencies = {
|
||||
'rcarriga/nvim-dap-ui',
|
||||
'nvim-neotest/nvim-nio',
|
||||
},
|
||||
config = function()
|
||||
-- Setup Debugging --
|
||||
local dap = require('dap')
|
||||
|
||||
-- Open UI on Debugging --
|
||||
local dapui = require('dapui')
|
||||
dapui.setup({
|
||||
layouts = {
|
||||
{
|
||||
elements = {
|
||||
{ id = 'scopes', size = 0.65 },
|
||||
{ id = 'breakpoints', size = 0.35 },
|
||||
},
|
||||
position = 'left',
|
||||
size = 40,
|
||||
},
|
||||
{
|
||||
elements = {
|
||||
{ id = 'repl', size = 0.5 },
|
||||
{ id = 'console', size = 0.5 },
|
||||
},
|
||||
position = 'bottom',
|
||||
size = 10,
|
||||
},
|
||||
},
|
||||
})
|
||||
dap.listeners.before.attach.dapui_config = function() dapui.open() end
|
||||
dap.listeners.before.launch.dapui_config = function() dapui.open() end
|
||||
|
||||
-- Keybinding --
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<Leader>dt',
|
||||
dapui.toggle,
|
||||
{ desc = 'Toggle Debugger UI' }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<Leader>db',
|
||||
dap.toggle_breakpoint,
|
||||
{ desc = 'Toggle Breakpoint' }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<Leader>dc',
|
||||
dap.continue,
|
||||
{ desc = 'Debugger Continue' }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<Leader>dx',
|
||||
dap.terminate,
|
||||
{ desc = 'Debugger Terminate' }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<Leader>ds',
|
||||
dap.step_over,
|
||||
{ desc = 'Debugger Step Over' }
|
||||
)
|
||||
|
||||
-- Breakpoints --
|
||||
vim.api.nvim_set_hl(
|
||||
0,
|
||||
'DapBreakpoint',
|
||||
{ ctermbg = 0, fg = '#993939', bg = '#31353f' }
|
||||
)
|
||||
vim.api.nvim_set_hl(
|
||||
0,
|
||||
'DapLogPoint',
|
||||
{ ctermbg = 0, fg = '#61afef', bg = '#31353f' }
|
||||
)
|
||||
vim.api.nvim_set_hl(
|
||||
0,
|
||||
'DapStopped',
|
||||
{ ctermbg = 0, fg = '#98c379', bg = '#31353f' }
|
||||
)
|
||||
vim.fn.sign_define('DapBreakpoint', {
|
||||
text = '',
|
||||
texthl = 'DapBreakpoint',
|
||||
linehl = 'DapBreakpoint',
|
||||
numhl = 'DapBreakpoint',
|
||||
})
|
||||
vim.fn.sign_define('DapBreakpointCondition', {
|
||||
text = '',
|
||||
texthl = 'DapBreakpoint',
|
||||
linehl = 'DapBreakpoint',
|
||||
numhl = 'DapBreakpoint',
|
||||
})
|
||||
vim.fn.sign_define('DapBreakpointRejected', {
|
||||
text = '',
|
||||
texthl = 'DapBreakpoint',
|
||||
linehl = 'DapBreakpoint',
|
||||
numhl = 'DapBreakpoint',
|
||||
})
|
||||
vim.fn.sign_define('DapLogPoint', {
|
||||
text = '',
|
||||
texthl = 'DapLogPoint',
|
||||
linehl = 'DapLogPoint',
|
||||
numhl = 'DapLogPoint',
|
||||
})
|
||||
vim.fn.sign_define('DapStopped', {
|
||||
text = '',
|
||||
texthl = 'DapStopped',
|
||||
linehl = 'DapStopped',
|
||||
numhl = 'DapStopped',
|
||||
})
|
||||
end,
|
||||
}
|
81
lua/editor/file_tree.lua
Normal file
81
lua/editor/file_tree.lua
Normal file
|
@ -0,0 +1,81 @@
|
|||
return {
|
||||
'nvim-neo-tree/neo-tree.nvim',
|
||||
branch = 'v3.x',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
'MunifTanjim/nui.nvim',
|
||||
},
|
||||
config = function()
|
||||
-- Setup --
|
||||
require('neo-tree').setup({
|
||||
close_if_last_window = false,
|
||||
enable_git_status = true,
|
||||
enable_diagnostics = true,
|
||||
name = {
|
||||
trailing_slash = false,
|
||||
use_git_status_colors = true,
|
||||
highlight = 'NeoTreeFileName',
|
||||
},
|
||||
git_status = {
|
||||
symbols = {
|
||||
-- Git Change type Icon --
|
||||
added = '✚',
|
||||
modified = '',
|
||||
deleted = '✖',
|
||||
renamed = '',
|
||||
-- Git Status type Icon --
|
||||
untracked = '',
|
||||
ignored = '',
|
||||
unstaged = '',
|
||||
staged = '',
|
||||
conflict = '',
|
||||
},
|
||||
},
|
||||
symlink_target = {
|
||||
enabled = false,
|
||||
},
|
||||
filesystem = {
|
||||
hijack_netrw_behavior = 'open_default',
|
||||
},
|
||||
-- Keybinding --
|
||||
window = {
|
||||
mappings = {
|
||||
['<space>'] = 'open',
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Dignostic Icons --
|
||||
vim.fn.sign_define('DiagnosticSignError', {
|
||||
text = ' ',
|
||||
texthl = 'DiagnosticSignError',
|
||||
})
|
||||
vim.fn.sign_define('DiagnosticSignWarn', {
|
||||
text = ' ',
|
||||
texthl = 'DiagnosticSignWarn',
|
||||
})
|
||||
vim.fn.sign_define('DiagnosticSignInfo', {
|
||||
text = ' ',
|
||||
texthl = 'DiagnosticSignInfo',
|
||||
})
|
||||
vim.fn.sign_define('DiagnosticSignHint', {
|
||||
text = '',
|
||||
texthl = 'DiagnosticSignHint',
|
||||
})
|
||||
|
||||
-- Keybinding --
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>ft',
|
||||
':Neotree toggle reveal left<CR>',
|
||||
{ desc = 'Toggle File Tree' }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>fo',
|
||||
':Neotree buffers reveal float<CR>',
|
||||
{ desc = 'Show Open Files' }
|
||||
)
|
||||
end,
|
||||
}
|
14
lua/editor/highlighting.lua
Normal file
14
lua/editor/highlighting.lua
Normal file
|
@ -0,0 +1,14 @@
|
|||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
build = ':TSUpdate',
|
||||
config = function()
|
||||
-- Setup --
|
||||
local config = require('nvim-treesitter.configs')
|
||||
config.setup({
|
||||
auto_install = true,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
ensure_installed = require('util.toolchain').highlighters,
|
||||
})
|
||||
end,
|
||||
}
|
8
lua/editor/key_list.lua
Normal file
8
lua/editor/key_list.lua
Normal file
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
'folke/which-key.nvim',
|
||||
config = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 300
|
||||
require('which-key').setup({})
|
||||
end,
|
||||
}
|
118
lua/editor/language_server.lua
Normal file
118
lua/editor/language_server.lua
Normal file
|
@ -0,0 +1,118 @@
|
|||
local TOOLCHAIN = require('util.toolchain')
|
||||
|
||||
return {
|
||||
{
|
||||
'williamboman/mason.nvim',
|
||||
lazy = false,
|
||||
config = function() require('mason').setup() end,
|
||||
},
|
||||
{
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
lazy = false,
|
||||
opts = {
|
||||
auto_install = true,
|
||||
},
|
||||
config = function()
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = TOOLCHAIN.lsp_requriemts,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
'neovim/nvim-lspconfig',
|
||||
lazy = false,
|
||||
config = function()
|
||||
-- Setup --
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
local lspconfig = require('lspconfig')
|
||||
|
||||
for _, setup in ipairs(TOOLCHAIN.lsp_setups) do
|
||||
setup(lspconfig, capabilities)
|
||||
end
|
||||
|
||||
-- Keybinding --
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>cd',
|
||||
vim.lsp.buf.hover,
|
||||
{ desc = 'Show Code Definition' }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>gd',
|
||||
vim.lsp.buf.definition,
|
||||
{ desc = 'Go to Definition' }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>gr',
|
||||
vim.lsp.buf.references,
|
||||
{ desc = 'Go to References' }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>ca',
|
||||
vim.lsp.buf.code_action,
|
||||
{ desc = 'Do Code Actions' }
|
||||
)
|
||||
end,
|
||||
},
|
||||
{
|
||||
'nvimtools/none-ls.nvim',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvimtools/none-ls-extras.nvim',
|
||||
},
|
||||
config = function()
|
||||
-- Setup --
|
||||
local null_ls = require('null-ls')
|
||||
|
||||
local null_ls_sources = {}
|
||||
for _, setup_function in ipairs(TOOLCHAIN.null_ls) do
|
||||
local conf = setup_function(null_ls)
|
||||
if #conf ~= 0 then
|
||||
for _, _conf in pairs(conf) do
|
||||
table.insert(null_ls_sources, _conf)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
null_ls.setup({
|
||||
sources = null_ls_sources,
|
||||
})
|
||||
|
||||
-- Keybinding --
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>fc',
|
||||
vim.lsp.buf.format,
|
||||
{ desc = 'Format Code' }
|
||||
)
|
||||
end,
|
||||
},
|
||||
{
|
||||
'nvimdev/lspsaga.nvim',
|
||||
after = 'nvim-lspconfig',
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
},
|
||||
config = function()
|
||||
require('lspsaga').setup({})
|
||||
|
||||
-- Keybinding --
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>cr',
|
||||
':Lspsaga rename<CR>',
|
||||
{ desc = 'Rename Variable' }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>cp',
|
||||
':Lspsaga peek_definition<CR>',
|
||||
{ desc = 'Peek Code Definition' }
|
||||
)
|
||||
end,
|
||||
},
|
||||
}
|
57
lua/editor/llm.lua
Normal file
57
lua/editor/llm.lua
Normal file
|
@ -0,0 +1,57 @@
|
|||
local explain_prompt = [[
|
||||
Explain this Code short and Precise:
|
||||
$fname
|
||||
```$ftype
|
||||
$buf
|
||||
```
|
||||
---
|
||||
]]
|
||||
|
||||
local generate_prompt = [[
|
||||
<|fim_prefix|>$before<|fim_suffix|>$after<|fim_middle|>
|
||||
]]
|
||||
|
||||
return {
|
||||
dir = '~/Workspace/nvim/ollama.nvim',
|
||||
--"nomnivore/ollama.nvim",
|
||||
config = function()
|
||||
local ollama = require('ollama')
|
||||
ollama.setup({
|
||||
model = 'codegemma:instruct',
|
||||
prompts = {
|
||||
Ask_About_Code = false,
|
||||
Modify_Code = false,
|
||||
Raw = false,
|
||||
Simplify_Code = false,
|
||||
Explain_Code = {
|
||||
model = 'codegemma:instruct',
|
||||
prompt = explain_prompt,
|
||||
input_label = '>',
|
||||
action = require('ollama.actions.factory').create_action({
|
||||
display = true,
|
||||
window = 'vsplit',
|
||||
}),
|
||||
},
|
||||
Generate_Code = {
|
||||
model = 'codegemma:2b-code',
|
||||
prompt = generate_prompt,
|
||||
input_label = '>',
|
||||
action = 'display',
|
||||
options = {
|
||||
num_predict = 128,
|
||||
temperature = 0.0,
|
||||
top_p = 0.9,
|
||||
stop = { '<|file_separator|>' },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>op',
|
||||
ollama.prompt,
|
||||
{ desc = 'Ollama Prompt' }
|
||||
)
|
||||
end,
|
||||
}
|
68
lua/editor/search.lua
Normal file
68
lua/editor/search.lua
Normal file
|
@ -0,0 +1,68 @@
|
|||
return {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
tag = '0.1.5',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-telescope/telescope-ui-select.nvim',
|
||||
},
|
||||
config = function()
|
||||
-- Setup --
|
||||
require('telescope').setup({
|
||||
extensions = {
|
||||
['ui-select'] = {
|
||||
require('telescope.themes').get_dropdown({}),
|
||||
},
|
||||
},
|
||||
})
|
||||
require('telescope').load_extension('ui-select')
|
||||
|
||||
-- Keybinding --
|
||||
local function setTelescopeBinding(
|
||||
mode,
|
||||
keymap,
|
||||
method,
|
||||
search_global,
|
||||
description
|
||||
)
|
||||
local function binding()
|
||||
local path = search_global and '~'
|
||||
or require('neo-tree.sources.manager').get_state(
|
||||
'filesystem'
|
||||
).path
|
||||
method({ search_dirs = { path } })
|
||||
end
|
||||
vim.keymap.set(mode, keymap, binding, { desc = description })
|
||||
end
|
||||
|
||||
local telescope = require('telescope.builtin')
|
||||
|
||||
setTelescopeBinding(
|
||||
'n',
|
||||
'<leader>ff',
|
||||
telescope.find_files,
|
||||
false,
|
||||
'Find File'
|
||||
)
|
||||
setTelescopeBinding(
|
||||
'n',
|
||||
'<leader>fz',
|
||||
telescope.live_grep,
|
||||
false,
|
||||
'Fuzzy Find'
|
||||
)
|
||||
setTelescopeBinding(
|
||||
'n',
|
||||
'<leader>gff',
|
||||
telescope.find_files,
|
||||
true,
|
||||
'Global Find File'
|
||||
)
|
||||
setTelescopeBinding(
|
||||
'n',
|
||||
'<leader>gfz',
|
||||
telescope.live_grep,
|
||||
true,
|
||||
'Global Fuzzy Find'
|
||||
)
|
||||
end,
|
||||
}
|
76
lua/editor/snippets.lua
Normal file
76
lua/editor/snippets.lua
Normal file
|
@ -0,0 +1,76 @@
|
|||
return {
|
||||
{
|
||||
'L3MON4D3/LuaSnip',
|
||||
version = '2.*',
|
||||
dependencies = {
|
||||
'rafamadriz/friendly-snippets',
|
||||
'mireq/luasnip-snippets',
|
||||
},
|
||||
build = 'make install_jsregexp',
|
||||
config = function()
|
||||
-- Setup --
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
require('luasnip.loaders.from_snipmate').lazy_load()
|
||||
require('luasnip_snippets.common.snip_utils').setup()
|
||||
end,
|
||||
},
|
||||
{
|
||||
'hrsh7th/nvim-cmp',
|
||||
dependencies = {
|
||||
'L3MON4D3/LuaSnip',
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
},
|
||||
config = function()
|
||||
-- Setup --
|
||||
local cmp = require('cmp')
|
||||
local luasnip = require('luasnip')
|
||||
luasnip.setup({
|
||||
load_ft_func = require('luasnip_snippets.common.snip_utils').load_ft_func,
|
||||
ft_func = require('luasnip_snippets.common.snip_utils').ft_func,
|
||||
enable_autosnippets = true,
|
||||
})
|
||||
|
||||
-- Keybinding --
|
||||
vim.keymap.set({ 'i', 's' }, '<Tab>', function()
|
||||
if luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
vim.api.nvim_input('<C-V><Tab>')
|
||||
end
|
||||
end, { silent = true })
|
||||
|
||||
vim.keymap.set(
|
||||
{ 'i', 's' },
|
||||
'<S-Tab>',
|
||||
function() luasnip.jump(-1) end,
|
||||
{ silent = true }
|
||||
)
|
||||
|
||||
local doc_keybindings = {
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
}
|
||||
|
||||
-- Setup --
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args) luasnip.lsp_expand(args.body) end,
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert(doc_keybindings),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'lazydev', group_index = 0 },
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
}, { { name = 'buffer' } }),
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
77
lua/editor/status_bar.lua
Normal file
77
lua/editor/status_bar.lua
Normal file
|
@ -0,0 +1,77 @@
|
|||
return {
|
||||
{
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
'nvimdev/lspsaga.nvim',
|
||||
},
|
||||
after = 'rcarriga/nvim-dap-ui',
|
||||
config = function()
|
||||
-- Setup --
|
||||
local lspsaga_breadcrumbs = require('lspsaga.symbol.winbar').get_bar
|
||||
|
||||
require('lualine').setup({
|
||||
options = {
|
||||
component_separators = { left = '', right = '' },
|
||||
section_separators = { left = '', right = '' },
|
||||
disabled_filetypes = {
|
||||
'neo-tree',
|
||||
'fugitive',
|
||||
'help',
|
||||
statusline = {
|
||||
'dap-repl',
|
||||
'dapui_console',
|
||||
'dapui_console',
|
||||
'dapui_watches',
|
||||
'dapui_stacks',
|
||||
'dapui_breakpoints',
|
||||
'dapui_scopes',
|
||||
},
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
globalstatus = false,
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
},
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { 'mode' },
|
||||
lualine_b = { 'diagnostics' },
|
||||
lualine_c = { lspsaga_breadcrumbs },
|
||||
lualine_x = { 'location' },
|
||||
lualine_y = { 'diff', 'branch' },
|
||||
lualine_z = { 'filetype' },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = { 'mode' },
|
||||
lualine_b = { 'diagnostics' },
|
||||
lualine_c = {},
|
||||
lualine_x = { 'location' },
|
||||
lualine_y = { 'diff', 'branch' },
|
||||
lualine_z = { 'filetype' },
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {
|
||||
lualine_a = { 'filename' },
|
||||
},
|
||||
inactive_winbar = {
|
||||
lualine_a = { 'filename' },
|
||||
},
|
||||
extensions = {
|
||||
require('temp.status_bar_plugin'),
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
'romgrk/barbar.nvim',
|
||||
dependencies = {
|
||||
'lewis6991/gitsigns.nvim',
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
},
|
||||
config = function() require('barbar').setup() end,
|
||||
},
|
||||
}
|
30
lua/editor/terminal.lua
Normal file
30
lua/editor/terminal.lua
Normal file
|
@ -0,0 +1,30 @@
|
|||
return {
|
||||
'rebelot/terminal.nvim',
|
||||
config = function()
|
||||
local terminal = require('terminal')
|
||||
terminal.setup({
|
||||
layout = {
|
||||
open_cmd = 'vertical new',
|
||||
},
|
||||
cmd = { 'bash' },
|
||||
autoclose = true,
|
||||
})
|
||||
|
||||
local project_dir = require('util.finder').get_opened_folder()
|
||||
local term
|
||||
local function toggle()
|
||||
if term == nil then
|
||||
term = terminal.terminal:new()
|
||||
term.cwd = project_dir
|
||||
end
|
||||
term:toggle()
|
||||
end
|
||||
|
||||
vim.keymap.set(
|
||||
{ 'n', 't' },
|
||||
'<F6>',
|
||||
toggle,
|
||||
{ desc = 'Toggle Terminal' }
|
||||
)
|
||||
end,
|
||||
}
|
9
lua/editor/theme.lua
Normal file
9
lua/editor/theme.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
return {
|
||||
'catppuccin/nvim',
|
||||
name = 'catppuccin',
|
||||
priority = 1000,
|
||||
config = function()
|
||||
-- Set Theme --
|
||||
vim.cmd('colorscheme catppuccin')
|
||||
end,
|
||||
}
|
65
lua/temp/status_bar_plugin.lua
Normal file
65
lua/temp/status_bar_plugin.lua
Normal file
|
@ -0,0 +1,65 @@
|
|||
local M = {}
|
||||
|
||||
M.filetypes = {
|
||||
'dap-repl',
|
||||
'dapui_console',
|
||||
'dapui_console',
|
||||
'dapui_watches',
|
||||
'dapui_stacks',
|
||||
'dapui_breakpoints',
|
||||
'dapui_scopes',
|
||||
}
|
||||
|
||||
local function merge_colors(foreground, background)
|
||||
local new_name = foreground .. background
|
||||
|
||||
local hl_fg = vim.api.nvim_get_hl(0, { name = foreground })
|
||||
local hl_bg = vim.api.nvim_get_hl(0, { name = background })
|
||||
|
||||
local fg = string.format('#%06x', hl_fg.fg and hl_fg.fg or 0)
|
||||
local bg = string.format('#%06x', hl_bg.bg and hl_bg.bg or 0)
|
||||
|
||||
vim.api.nvim_set_hl(0, new_name, { fg = fg, bg = bg })
|
||||
return new_name
|
||||
end
|
||||
|
||||
local function get_dap_repl_winbar(active)
|
||||
local get_mode = require('lualine.highlight').get_mode_suffix
|
||||
|
||||
return function()
|
||||
local filetype = vim.bo.filetype
|
||||
local disabled_filetypes = { 'dap-repl' }
|
||||
|
||||
if not vim.tbl_contains(disabled_filetypes, filetype) then
|
||||
return ''
|
||||
end
|
||||
|
||||
local background_color = string.format(
|
||||
'lualine_b' .. '%s',
|
||||
active and get_mode() or '_inactive'
|
||||
)
|
||||
|
||||
local controls_string = '%#' .. background_color .. '#'
|
||||
for element in require('dapui.controls').controls():gmatch('%S+') do
|
||||
local color, action = string.match(element, '%%#(.*)#(%%.*)%%#0#')
|
||||
controls_string = controls_string
|
||||
.. ' %#'
|
||||
.. merge_colors(color, background_color)
|
||||
.. '#'
|
||||
.. action
|
||||
end
|
||||
return controls_string
|
||||
end
|
||||
end
|
||||
|
||||
M.winbar = {
|
||||
lualine_a = { { 'filename', file_status = false } },
|
||||
lualine_b = { get_dap_repl_winbar(true) },
|
||||
}
|
||||
|
||||
M.inactive_winbar = {
|
||||
lualine_a = { { 'filename', file_status = false } },
|
||||
lualine_b = { get_dap_repl_winbar(false) },
|
||||
}
|
||||
|
||||
return M
|
5
lua/toolchain/config/actions.lua
Normal file
5
lua/toolchain/config/actions.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
---@type ToolchainActions
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(_null_ls) return {} end,
|
||||
}
|
4
lua/toolchain/config/debugger.lua
Normal file
4
lua/toolchain/config/debugger.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
---@type ToolchainDebuggers
|
||||
return {
|
||||
plugins = {},
|
||||
}
|
10
lua/toolchain/config/diagnostics.lua
Normal file
10
lua/toolchain/config/diagnostics.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
---@type ToolchainDiagnostics
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(null_ls)
|
||||
return {
|
||||
null_ls.builtins.diagnostics.spectral,
|
||||
--null_ls.builtins.diagnostics.vacuum --Pure Openapi linter
|
||||
}
|
||||
end,
|
||||
}
|
5
lua/toolchain/config/formatter.lua
Normal file
5
lua/toolchain/config/formatter.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
---@type ToolchainFormatters
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(_null_ls) return {} end,
|
||||
}
|
10
lua/toolchain/config/init.lua
Normal file
10
lua/toolchain/config/init.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
---@type Toolchain
|
||||
return {
|
||||
requirements = require('toolchain.config.requirements'),
|
||||
language_servers = require('toolchain.config.language_server'),
|
||||
formatters = require('toolchain.config.formatter'),
|
||||
actions = require('toolchain.config.actions'),
|
||||
diagnostics = require('toolchain.config.diagnostics'),
|
||||
debuggers = require('toolchain.config.debugger'),
|
||||
should_init = function() return true end,
|
||||
}
|
16
lua/toolchain/config/language_server.lua
Normal file
16
lua/toolchain/config/language_server.lua
Normal file
|
@ -0,0 +1,16 @@
|
|||
---@type ToolchainLanguageServers
|
||||
return {
|
||||
requirements = {
|
||||
'jsonls',
|
||||
'lemminx',
|
||||
'yamlls',
|
||||
'taplo',
|
||||
},
|
||||
setup = function(lspconfig, capabilities)
|
||||
local config = { capabilities = capabilities }
|
||||
lspconfig.jsonls.setup(config)
|
||||
lspconfig.lemminx.setup(config)
|
||||
lspconfig.yamlls.setup(config)
|
||||
lspconfig.taplo.setup(config)
|
||||
end,
|
||||
}
|
9
lua/toolchain/config/plugins.lua
Normal file
9
lua/toolchain/config/plugins.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
return {
|
||||
{
|
||||
'folke/lazydev.nvim',
|
||||
ft = 'lua',
|
||||
opts = {
|
||||
library = {},
|
||||
},
|
||||
},
|
||||
}
|
17
lua/toolchain/config/requirements.lua
Normal file
17
lua/toolchain/config/requirements.lua
Normal file
|
@ -0,0 +1,17 @@
|
|||
---@type ToolchainRequirements
|
||||
return {
|
||||
plugins = {
|
||||
table.unpack(require('toolchain.config.formatter').plugins),
|
||||
table.unpack(require('toolchain.config.actions').plugins),
|
||||
table.unpack(require('toolchain.config.diagnostics').plugins),
|
||||
table.unpack(require('toolchain.config.debugger').plugins),
|
||||
table.unpack(require('toolchain.config.plugins')),
|
||||
},
|
||||
highlighters = {
|
||||
'json',
|
||||
'xml',
|
||||
'yaml',
|
||||
'toml',
|
||||
},
|
||||
language_servers = require('toolchain.config.language_server').requirements,
|
||||
}
|
5
lua/toolchain/database/actions.lua
Normal file
5
lua/toolchain/database/actions.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
---@type ToolchainActions
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(_null_ls) return {} end,
|
||||
}
|
4
lua/toolchain/database/debugger.lua
Normal file
4
lua/toolchain/database/debugger.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
---@type ToolchainDebuggers
|
||||
return {
|
||||
plugins = {},
|
||||
}
|
5
lua/toolchain/database/diagnostics.lua
Normal file
5
lua/toolchain/database/diagnostics.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
---@type ToolchainDiagnostics
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(_null_ls) return {} end,
|
||||
}
|
5
lua/toolchain/database/formatter.lua
Normal file
5
lua/toolchain/database/formatter.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
---@type ToolchainFormatters
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(_null_ls) return {} end,
|
||||
}
|
10
lua/toolchain/database/init.lua
Normal file
10
lua/toolchain/database/init.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
---@type Toolchain
|
||||
return {
|
||||
requirements = require('toolchain.database.requirements'),
|
||||
language_servers = require('toolchain.database.language_server'),
|
||||
formatters = require('toolchain.database.formatter'),
|
||||
actions = require('toolchain.database.actions'),
|
||||
diagnostics = require('toolchain.database.diagnostics'),
|
||||
debuggers = require('toolchain.database.debugger'),
|
||||
should_init = function() return true end,
|
||||
}
|
10
lua/toolchain/database/language_server.lua
Normal file
10
lua/toolchain/database/language_server.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
---@type ToolchainLanguageServers
|
||||
return {
|
||||
requirements = {
|
||||
'sqlls',
|
||||
},
|
||||
setup = function(lspconfig, capabilities)
|
||||
local config = { capabilities = capabilities }
|
||||
lspconfig.sqlls.setup(config)
|
||||
end,
|
||||
}
|
1
lua/toolchain/database/plugins.lua
Normal file
1
lua/toolchain/database/plugins.lua
Normal file
|
@ -0,0 +1 @@
|
|||
return {}
|
14
lua/toolchain/database/requirements.lua
Normal file
14
lua/toolchain/database/requirements.lua
Normal file
|
@ -0,0 +1,14 @@
|
|||
---@type ToolchainRequirements
|
||||
return {
|
||||
plugins = {
|
||||
table.unpack(require('toolchain.database.formatter').plugins),
|
||||
table.unpack(require('toolchain.database.actions').plugins),
|
||||
table.unpack(require('toolchain.database.diagnostics').plugins),
|
||||
table.unpack(require('toolchain.database.debugger').plugins),
|
||||
table.unpack(require('toolchain.database.plugins')),
|
||||
},
|
||||
highlighters = {
|
||||
'sql',
|
||||
},
|
||||
language_servers = require('toolchain.database.language_server').requirements,
|
||||
}
|
5
lua/toolchain/frontend/actions.lua
Normal file
5
lua/toolchain/frontend/actions.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
---@type ToolchainActions
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(_null_ls) return {} end,
|
||||
}
|
4
lua/toolchain/frontend/debugger.lua
Normal file
4
lua/toolchain/frontend/debugger.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
---@type ToolchainDebuggers
|
||||
return {
|
||||
plugins = {},
|
||||
}
|
5
lua/toolchain/frontend/diagnostics.lua
Normal file
5
lua/toolchain/frontend/diagnostics.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
---@type ToolchainDiagnostics
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(_null_ls) return {} end,
|
||||
}
|
5
lua/toolchain/frontend/formatter.lua
Normal file
5
lua/toolchain/frontend/formatter.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
---@type ToolchainFormatters
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(_null_ls) return {} end,
|
||||
}
|
10
lua/toolchain/frontend/init.lua
Normal file
10
lua/toolchain/frontend/init.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
---@type Toolchain
|
||||
return {
|
||||
requirements = require('toolchain.frontend.requirements'),
|
||||
language_servers = require('toolchain.frontend.language_server'),
|
||||
formatters = require('toolchain.frontend.formatter'),
|
||||
actions = require('toolchain.frontend.actions'),
|
||||
diagnostics = require('toolchain.frontend.diagnostics'),
|
||||
debuggers = require('toolchain.frontend.debugger'),
|
||||
should_init = function() return true end,
|
||||
}
|
12
lua/toolchain/frontend/language_server.lua
Normal file
12
lua/toolchain/frontend/language_server.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
---@type ToolchainLanguageServers
|
||||
return {
|
||||
requirements = {
|
||||
'svelte',
|
||||
'volar',
|
||||
},
|
||||
setup = function(lspconfig, capabilities)
|
||||
local config = { capabilities = capabilities }
|
||||
lspconfig.svelte.setup(config)
|
||||
lspconfig.volar.setup(config)
|
||||
end,
|
||||
}
|
1
lua/toolchain/frontend/plugins.lua
Normal file
1
lua/toolchain/frontend/plugins.lua
Normal file
|
@ -0,0 +1 @@
|
|||
return {}
|
16
lua/toolchain/frontend/requirements.lua
Normal file
16
lua/toolchain/frontend/requirements.lua
Normal file
|
@ -0,0 +1,16 @@
|
|||
---@type ToolchainRequirements
|
||||
return {
|
||||
plugins = {
|
||||
table.unpack(require('toolchain.frontend.formatter').plugins),
|
||||
table.unpack(require('toolchain.frontend.actions').plugins),
|
||||
table.unpack(require('toolchain.frontend.diagnostics').plugins),
|
||||
table.unpack(require('toolchain.frontend.debugger').plugins),
|
||||
table.unpack(require('toolchain.frontend.plugins')),
|
||||
},
|
||||
|
||||
highlighters = {
|
||||
'svelte',
|
||||
'vue',
|
||||
},
|
||||
language_servers = require('toolchain.frontend.language_server').requirements,
|
||||
}
|
9
lua/toolchain/generic/actions.lua
Normal file
9
lua/toolchain/generic/actions.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
---@type ToolchainActions
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(null_ls)
|
||||
return {
|
||||
null_ls.builtins.code_actions.refactoring,
|
||||
}
|
||||
end,
|
||||
}
|
4
lua/toolchain/generic/debugger.lua
Normal file
4
lua/toolchain/generic/debugger.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
---@type ToolchainDebuggers
|
||||
return {
|
||||
plugins = {},
|
||||
}
|
5
lua/toolchain/generic/diagnostics.lua
Normal file
5
lua/toolchain/generic/diagnostics.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
---@type ToolchainDiagnostics
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(_null_ls) return {} end,
|
||||
}
|
5
lua/toolchain/generic/formatter.lua
Normal file
5
lua/toolchain/generic/formatter.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
---@type ToolchainFormatters
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(_null_ls) return {} end,
|
||||
}
|
10
lua/toolchain/generic/init.lua
Normal file
10
lua/toolchain/generic/init.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
---@type Toolchain
|
||||
return {
|
||||
requirements = require('toolchain.generic.requirements'),
|
||||
language_servers = require('toolchain.generic.language_server'),
|
||||
formatters = require('toolchain.generic.formatter'),
|
||||
actions = require('toolchain.generic.actions'),
|
||||
diagnostics = require('toolchain.generic.diagnostics'),
|
||||
debuggers = require('toolchain.generic.debugger'),
|
||||
should_init = function() return true end,
|
||||
}
|
5
lua/toolchain/generic/language_server.lua
Normal file
5
lua/toolchain/generic/language_server.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
---@type ToolchainLanguageServers
|
||||
return {
|
||||
requirements = {},
|
||||
setup = function(_lspgeneric, _capabilities) end,
|
||||
}
|
1
lua/toolchain/generic/plugins.lua
Normal file
1
lua/toolchain/generic/plugins.lua
Normal file
|
@ -0,0 +1 @@
|
|||
return {}
|
12
lua/toolchain/generic/requirements.lua
Normal file
12
lua/toolchain/generic/requirements.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
---@type ToolchainRequirements
|
||||
return {
|
||||
plugins = {
|
||||
table.unpack(require('toolchain.generic.formatter').plugins),
|
||||
table.unpack(require('toolchain.generic.actions').plugins),
|
||||
table.unpack(require('toolchain.generic.diagnostics').plugins),
|
||||
table.unpack(require('toolchain.generic.debugger').plugins),
|
||||
table.unpack(require('toolchain.generic.plugins')),
|
||||
},
|
||||
highlighters = {},
|
||||
language_servers = require('toolchain.generic.language_server').requirements,
|
||||
}
|
5
lua/toolchain/git/actions.lua
Normal file
5
lua/toolchain/git/actions.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
---@type ToolchainActions
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(_null_ls) return {} end,
|
||||
}
|
4
lua/toolchain/git/debugger.lua
Normal file
4
lua/toolchain/git/debugger.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
---@type ToolchainDebuggers
|
||||
return {
|
||||
plugins = {},
|
||||
}
|
5
lua/toolchain/git/diagnostics.lua
Normal file
5
lua/toolchain/git/diagnostics.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
---@type ToolchainDiagnostics
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(_null_ls) return {} end,
|
||||
}
|
5
lua/toolchain/git/formatter.lua
Normal file
5
lua/toolchain/git/formatter.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
---@type ToolchainFormatters
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(_null_ls) return {} end,
|
||||
}
|
10
lua/toolchain/git/init.lua
Normal file
10
lua/toolchain/git/init.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
---@type Toolchain
|
||||
return {
|
||||
requirements = require('toolchain.git.requirements'),
|
||||
language_servers = require('toolchain.git.language_server'),
|
||||
formatters = require('toolchain.git.formatter'),
|
||||
actions = require('toolchain.git.actions'),
|
||||
diagnostics = require('toolchain.git.diagnostics'),
|
||||
debuggers = require('toolchain.git.debugger'),
|
||||
should_init = function() return true end,
|
||||
}
|
5
lua/toolchain/git/language_server.lua
Normal file
5
lua/toolchain/git/language_server.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
---@type ToolchainLanguageServers
|
||||
return {
|
||||
requirements = {},
|
||||
setup = function(_lspconfig, _capabilities) end,
|
||||
}
|
38
lua/toolchain/git/plugins.lua
Normal file
38
lua/toolchain/git/plugins.lua
Normal file
|
@ -0,0 +1,38 @@
|
|||
return {
|
||||
{
|
||||
'tpope/vim-fugitive',
|
||||
},
|
||||
{
|
||||
'lewis6991/gitsigns.nvim',
|
||||
config = function()
|
||||
-- Setup --
|
||||
require('gitsigns').setup()
|
||||
|
||||
-- Keybinding --
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>gh',
|
||||
':Gitsigns preview_hunk_inline<CR>',
|
||||
{ desc = 'Toggle Inline Git Diff' }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>gb',
|
||||
':Gitsigns toggle_current_line_blame<CR>',
|
||||
{ desc = 'Toggle Inline Git Blame' }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>go',
|
||||
':Git <CR>',
|
||||
{ desc = 'Open Git' }
|
||||
)
|
||||
end,
|
||||
},
|
||||
{
|
||||
'moyiz/git-dev.nvim',
|
||||
lazy = true,
|
||||
cmd = { 'GitDevOpen', 'GitDevCleanAll' },
|
||||
opts = {},
|
||||
},
|
||||
}
|
18
lua/toolchain/git/requirements.lua
Normal file
18
lua/toolchain/git/requirements.lua
Normal file
|
@ -0,0 +1,18 @@
|
|||
---@type ToolchainRequirements
|
||||
return {
|
||||
plugins = {
|
||||
table.unpack(require('toolchain.git.formatter').plugins),
|
||||
table.unpack(require('toolchain.git.actions').plugins),
|
||||
table.unpack(require('toolchain.git.diagnostics').plugins),
|
||||
table.unpack(require('toolchain.git.debugger').plugins),
|
||||
table.unpack(require('toolchain.git.plugins')),
|
||||
},
|
||||
highlighters = {
|
||||
'gitcommit',
|
||||
'gitignore',
|
||||
'gitattributes',
|
||||
'git_rebase',
|
||||
'git_config',
|
||||
},
|
||||
language_servers = require('toolchain.git.language_server').requirements,
|
||||
}
|
10
lua/toolchain/go/actions.lua
Normal file
10
lua/toolchain/go/actions.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
---@type ToolchainActions
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(null_ls)
|
||||
return {
|
||||
null_ls.builtins.code_actions.gomodifytags,
|
||||
null_ls.builtins.code_actions.impl,
|
||||
}
|
||||
end,
|
||||
}
|
18
lua/toolchain/go/debugger.lua
Normal file
18
lua/toolchain/go/debugger.lua
Normal file
|
@ -0,0 +1,18 @@
|
|||
---@type ToolchainDebuggers
|
||||
return {
|
||||
plugins = {
|
||||
{
|
||||
'leoluz/nvim-dap-go',
|
||||
config = function()
|
||||
local dir = require('util.finder').find_project_dir(
|
||||
'go.mod',
|
||||
3,
|
||||
{ 'src', 'app', 'pkg' },
|
||||
{ 'test' },
|
||||
true
|
||||
)
|
||||
require('dap-go').setup({ delve = { cwd = dir } })
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
10
lua/toolchain/go/diagnostics.lua
Normal file
10
lua/toolchain/go/diagnostics.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
---@type ToolchainDiagnostics
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(null_ls)
|
||||
return {
|
||||
null_ls.builtins.diagnostics.golangci_lint,
|
||||
null_ls.builtins.diagnostics.staticcheck,
|
||||
}
|
||||
end,
|
||||
}
|
9
lua/toolchain/go/formatter.lua
Normal file
9
lua/toolchain/go/formatter.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
---@type ToolchainFormatters
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(null_ls)
|
||||
return {
|
||||
null_ls.builtins.formatting.gofumpt,
|
||||
}
|
||||
end,
|
||||
}
|
10
lua/toolchain/go/init.lua
Normal file
10
lua/toolchain/go/init.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
---@type Toolchain
|
||||
return {
|
||||
requirements = require('toolchain.go.requirements'),
|
||||
language_servers = require('toolchain.go.language_server'),
|
||||
formatters = require('toolchain.go.formatter'),
|
||||
actions = require('toolchain.go.actions'),
|
||||
diagnostics = require('toolchain.go.diagnostics'),
|
||||
debuggers = require('toolchain.go.debugger'),
|
||||
should_init = function() return true end,
|
||||
}
|
9
lua/toolchain/go/language_server.lua
Normal file
9
lua/toolchain/go/language_server.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
---@type ToolchainLanguageServers
|
||||
return {
|
||||
requirements = {
|
||||
'gopls',
|
||||
},
|
||||
setup = function(lspconfig, capabilities)
|
||||
lspconfig.gopls.setup({ capabilities = capabilities })
|
||||
end,
|
||||
}
|
1
lua/toolchain/go/plugins.lua
Normal file
1
lua/toolchain/go/plugins.lua
Normal file
|
@ -0,0 +1 @@
|
|||
return {}
|
17
lua/toolchain/go/requirements.lua
Normal file
17
lua/toolchain/go/requirements.lua
Normal file
|
@ -0,0 +1,17 @@
|
|||
---@type ToolchainRequirements
|
||||
return {
|
||||
plugins = {
|
||||
table.unpack(require('toolchain.go.formatter').plugins),
|
||||
table.unpack(require('toolchain.go.actions').plugins),
|
||||
table.unpack(require('toolchain.go.diagnostics').plugins),
|
||||
table.unpack(require('toolchain.go.debugger').plugins),
|
||||
table.unpack(require('toolchain.go.plugins')),
|
||||
},
|
||||
highlighters = {
|
||||
'go',
|
||||
'gomod',
|
||||
'gosum',
|
||||
'gotmpl',
|
||||
},
|
||||
language_servers = require('toolchain.go.language_server').requirements,
|
||||
}
|
5
lua/toolchain/lua/actions.lua
Normal file
5
lua/toolchain/lua/actions.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
---@type ToolchainActions
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(_null_ls) return {} end,
|
||||
}
|
4
lua/toolchain/lua/debugger.lua
Normal file
4
lua/toolchain/lua/debugger.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
---@type ToolchainDebuggers
|
||||
return {
|
||||
plugins = {},
|
||||
}
|
9
lua/toolchain/lua/diagnostics.lua
Normal file
9
lua/toolchain/lua/diagnostics.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
---@type ToolchainDiagnostics
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(null_ls)
|
||||
return {
|
||||
null_ls.builtins.diagnostics.selene,
|
||||
}
|
||||
end,
|
||||
}
|
9
lua/toolchain/lua/formatter.lua
Normal file
9
lua/toolchain/lua/formatter.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
---@type ToolchainFormatters
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(null_ls)
|
||||
return {
|
||||
null_ls.builtins.formatting.stylua,
|
||||
}
|
||||
end,
|
||||
}
|
10
lua/toolchain/lua/init.lua
Normal file
10
lua/toolchain/lua/init.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
---@type Toolchain
|
||||
return {
|
||||
requirements = require('toolchain.lua.requirements'),
|
||||
language_servers = require('toolchain.lua.language_server'),
|
||||
formatters = require('toolchain.lua.formatter'),
|
||||
actions = require('toolchain.lua.actions'),
|
||||
diagnostics = require('toolchain.lua.diagnostics'),
|
||||
debuggers = require('toolchain.lua.debugger'),
|
||||
should_init = function() return true end,
|
||||
}
|
18
lua/toolchain/lua/language_server.lua
Normal file
18
lua/toolchain/lua/language_server.lua
Normal file
|
@ -0,0 +1,18 @@
|
|||
---@type ToolchainLanguageServers
|
||||
return {
|
||||
requirements = {
|
||||
'lua_ls',
|
||||
},
|
||||
setup = function(lspconfig, capabilities)
|
||||
lspconfig.lua_ls.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { 'vim' },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
1
lua/toolchain/lua/plugins.lua
Normal file
1
lua/toolchain/lua/plugins.lua
Normal file
|
@ -0,0 +1 @@
|
|||
return {}
|
15
lua/toolchain/lua/requirements.lua
Normal file
15
lua/toolchain/lua/requirements.lua
Normal file
|
@ -0,0 +1,15 @@
|
|||
---@type ToolchainRequirements
|
||||
return {
|
||||
plugins = {
|
||||
table.unpack(require('toolchain.lua.formatter').plugins),
|
||||
table.unpack(require('toolchain.lua.actions').plugins),
|
||||
table.unpack(require('toolchain.lua.diagnostics').plugins),
|
||||
table.unpack(require('toolchain.lua.debugger').plugins),
|
||||
table.unpack(require('toolchain.lua.plugins')),
|
||||
},
|
||||
highlighters = {
|
||||
'lua',
|
||||
'luadoc',
|
||||
},
|
||||
language_servers = require('toolchain.lua.language_server').requirements,
|
||||
}
|
5
lua/toolchain/php/actions.lua
Normal file
5
lua/toolchain/php/actions.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
---@type ToolchainActions
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(_null_ls) return {} end,
|
||||
}
|
4
lua/toolchain/php/debugger.lua
Normal file
4
lua/toolchain/php/debugger.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
---@type ToolchainDebuggers
|
||||
return {
|
||||
plugins = {},
|
||||
}
|
11
lua/toolchain/php/diagnostics.lua
Normal file
11
lua/toolchain/php/diagnostics.lua
Normal file
|
@ -0,0 +1,11 @@
|
|||
---@type ToolchainDiagnostics
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(null_ls)
|
||||
return {
|
||||
null_ls.builtins.diagnostics.phpstan,
|
||||
null_ls.builtins.diagnostics.phpcs,
|
||||
null_ls.builtins.diagnostics.twigcs,
|
||||
}
|
||||
end,
|
||||
}
|
12
lua/toolchain/php/formatter.lua
Normal file
12
lua/toolchain/php/formatter.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
---@type ToolchainFormatters
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(null_ls)
|
||||
return {
|
||||
null_ls.builtins.formatting.phpcsfixer.with({
|
||||
prefer_local = 'vendor/bin/php-cs-fixer',
|
||||
args = { 'fix', '--allow-risky=yes', '$FILENAME' },
|
||||
}),
|
||||
}
|
||||
end,
|
||||
}
|
10
lua/toolchain/php/init.lua
Normal file
10
lua/toolchain/php/init.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
---@type Toolchain
|
||||
return {
|
||||
requirements = require('toolchain.php.requirements'),
|
||||
language_servers = require('toolchain.php.language_server'),
|
||||
formatters = require('toolchain.php.formatter'),
|
||||
actions = require('toolchain.php.actions'),
|
||||
diagnostics = require('toolchain.php.diagnostics'),
|
||||
debuggers = require('toolchain.php.debugger'),
|
||||
should_init = function() return true end,
|
||||
}
|
13
lua/toolchain/php/language_server.lua
Normal file
13
lua/toolchain/php/language_server.lua
Normal file
|
@ -0,0 +1,13 @@
|
|||
---@type ToolchainLanguageServers
|
||||
return {
|
||||
requirements = {
|
||||
'phpactor',
|
||||
'twiggy_language_server',
|
||||
'stimulus_ls',
|
||||
},
|
||||
setup = function(lspconfig, capabilities)
|
||||
local config = { capabilities = capabilities }
|
||||
lspconfig.phpactor.setup(config)
|
||||
lspconfig.stimulus_ls.setup(config)
|
||||
end,
|
||||
}
|
1
lua/toolchain/php/plugins.lua
Normal file
1
lua/toolchain/php/plugins.lua
Normal file
|
@ -0,0 +1 @@
|
|||
return {}
|
16
lua/toolchain/php/requirements.lua
Normal file
16
lua/toolchain/php/requirements.lua
Normal file
|
@ -0,0 +1,16 @@
|
|||
---@type ToolchainRequirements
|
||||
return {
|
||||
plugins = {
|
||||
table.unpack(require('toolchain.php.formatter').plugins),
|
||||
table.unpack(require('toolchain.php.actions').plugins),
|
||||
table.unpack(require('toolchain.php.diagnostics').plugins),
|
||||
table.unpack(require('toolchain.php.debugger').plugins),
|
||||
table.unpack(require('toolchain.php.plugins')),
|
||||
},
|
||||
highlighters = {
|
||||
'php',
|
||||
'phpdoc',
|
||||
'twig',
|
||||
},
|
||||
language_servers = require('toolchain.php.language_server').requirements,
|
||||
}
|
5
lua/toolchain/scripts/actions.lua
Normal file
5
lua/toolchain/scripts/actions.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
---@type ToolchainActions
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(_null_ls) return {} end,
|
||||
}
|
4
lua/toolchain/scripts/debugger.lua
Normal file
4
lua/toolchain/scripts/debugger.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
---@type ToolchainDebuggers
|
||||
return {
|
||||
plugins = {},
|
||||
}
|
11
lua/toolchain/scripts/diagnostics.lua
Normal file
11
lua/toolchain/scripts/diagnostics.lua
Normal file
|
@ -0,0 +1,11 @@
|
|||
---@type ToolchainDiagnostics
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(null_ls)
|
||||
return {
|
||||
null_ls.builtins.diagnostics.actionlint,
|
||||
null_ls.builtins.diagnostics.checkmake,
|
||||
null_ls.builtins.diagnostics.dotenv_linter,
|
||||
}
|
||||
end,
|
||||
}
|
10
lua/toolchain/scripts/formatter.lua
Normal file
10
lua/toolchain/scripts/formatter.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
---@type ToolchainFormatters
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(null_ls)
|
||||
return {
|
||||
null_ls.builtins.formatting.shfmt,
|
||||
null_ls.builtins.formatting.shellharden,
|
||||
}
|
||||
end,
|
||||
}
|
10
lua/toolchain/scripts/init.lua
Normal file
10
lua/toolchain/scripts/init.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
---@type Toolchain
|
||||
return {
|
||||
requirements = require('toolchain.scripts.requirements'),
|
||||
language_servers = require('toolchain.scripts.language_server'),
|
||||
formatters = require('toolchain.scripts.formatter'),
|
||||
actions = require('toolchain.scripts.actions'),
|
||||
diagnostics = require('toolchain.scripts.diagnostics'),
|
||||
debuggers = require('toolchain.scripts.debugger'),
|
||||
should_init = function() return true end,
|
||||
}
|
10
lua/toolchain/scripts/language_server.lua
Normal file
10
lua/toolchain/scripts/language_server.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
---@type ToolchainLanguageServers
|
||||
return {
|
||||
requirements = {
|
||||
'bashls',
|
||||
},
|
||||
setup = function(lspconfig, capabilities)
|
||||
local config = { capabilities = capabilities }
|
||||
lspconfig.bashls.setup(config)
|
||||
end,
|
||||
}
|
1
lua/toolchain/scripts/plugins.lua
Normal file
1
lua/toolchain/scripts/plugins.lua
Normal file
|
@ -0,0 +1 @@
|
|||
return {}
|
17
lua/toolchain/scripts/requirements.lua
Normal file
17
lua/toolchain/scripts/requirements.lua
Normal file
|
@ -0,0 +1,17 @@
|
|||
---@type ToolchainRequirements
|
||||
return {
|
||||
plugins = {
|
||||
table.unpack(require('toolchain.scripts.formatter').plugins),
|
||||
table.unpack(require('toolchain.scripts.actions').plugins),
|
||||
table.unpack(require('toolchain.scripts.diagnostics').plugins),
|
||||
table.unpack(require('toolchain.scripts.debugger').plugins),
|
||||
table.unpack(require('toolchain.scripts.plugins')),
|
||||
},
|
||||
highlighters = {
|
||||
'bash',
|
||||
'make',
|
||||
'just',
|
||||
'dockerfile',
|
||||
},
|
||||
language_servers = require('toolchain.scripts.language_server').requirements,
|
||||
}
|
9
lua/toolchain/text/actions.lua
Normal file
9
lua/toolchain/text/actions.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
---@type ToolchainActions
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(null_ls)
|
||||
return {
|
||||
null_ls.builtins.code_actions.proselint,
|
||||
}
|
||||
end,
|
||||
}
|
4
lua/toolchain/text/debugger.lua
Normal file
4
lua/toolchain/text/debugger.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
---@type ToolchainDebuggers
|
||||
return {
|
||||
plugins = {},
|
||||
}
|
11
lua/toolchain/text/diagnostics.lua
Normal file
11
lua/toolchain/text/diagnostics.lua
Normal file
|
@ -0,0 +1,11 @@
|
|||
---@type ToolchainDiagnostics
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(null_ls)
|
||||
return {
|
||||
null_ls.builtins.diagnostics.alex,
|
||||
null_ls.builtins.diagnostics.codespell,
|
||||
null_ls.builtins.diagnostics.trail_space,
|
||||
}
|
||||
end,
|
||||
}
|
9
lua/toolchain/text/formatter.lua
Normal file
9
lua/toolchain/text/formatter.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
---@type ToolchainFormatters
|
||||
return {
|
||||
plugins = {},
|
||||
setup = function(null_ls)
|
||||
return {
|
||||
null_ls.builtins.diagnostics.markdownlint,
|
||||
}
|
||||
end,
|
||||
}
|
10
lua/toolchain/text/init.lua
Normal file
10
lua/toolchain/text/init.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
---@type Toolchain
|
||||
return {
|
||||
requirements = require('toolchain.text.requirements'),
|
||||
language_servers = require('toolchain.text.language_server'),
|
||||
formatters = require('toolchain.text.formatter'),
|
||||
actions = require('toolchain.text.actions'),
|
||||
diagnostics = require('toolchain.text.diagnostics'),
|
||||
debuggers = require('toolchain.text.debugger'),
|
||||
should_init = function() return true end,
|
||||
}
|
10
lua/toolchain/text/language_server.lua
Normal file
10
lua/toolchain/text/language_server.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
---@type ToolchainLanguageServers
|
||||
return {
|
||||
requirements = {
|
||||
'marksman',
|
||||
},
|
||||
setup = function(lspconfig, capabilities)
|
||||
local config = { capabilities = capabilities }
|
||||
lspconfig.marksman.setup(config)
|
||||
end,
|
||||
}
|
36
lua/toolchain/text/plugins.lua
Normal file
36
lua/toolchain/text/plugins.lua
Normal file
|
@ -0,0 +1,36 @@
|
|||
return {
|
||||
{
|
||||
'mrjones2014/mdpreview.nvim',
|
||||
ft = 'markdown',
|
||||
dependencies = {
|
||||
'norcalli/nvim-terminal.lua',
|
||||
},
|
||||
config = function()
|
||||
require('mdpreview').setup({
|
||||
cli_args = {
|
||||
'glow',
|
||||
'-s',
|
||||
'~/.config/glow/catppuccin-macchiato.json',
|
||||
'-w',
|
||||
'1',
|
||||
'--local',
|
||||
},
|
||||
renderer = {
|
||||
opts = {
|
||||
win_opts = {
|
||||
number = true,
|
||||
wrap = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<Leader>mp',
|
||||
':Mdpreview<CR>',
|
||||
{ desc = 'Show Markdown Preview' }
|
||||
)
|
||||
end,
|
||||
},
|
||||
}
|
14
lua/toolchain/text/requirements.lua
Normal file
14
lua/toolchain/text/requirements.lua
Normal file
|
@ -0,0 +1,14 @@
|
|||
---@type ToolchainRequirements
|
||||
return {
|
||||
plugins = {
|
||||
table.unpack(require('toolchain.text.formatter').plugins),
|
||||
table.unpack(require('toolchain.text.actions').plugins),
|
||||
table.unpack(require('toolchain.text.diagnostics').plugins),
|
||||
table.unpack(require('toolchain.text.debugger').plugins),
|
||||
table.unpack(require('toolchain.text.plugins')),
|
||||
},
|
||||
highlighters = {
|
||||
'markdown',
|
||||
},
|
||||
language_servers = require('toolchain.text.language_server').requirements,
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue