Compare commits

...

4 commits

Author SHA1 Message Date
958e72129f
Cleanup 2024-05-31 20:01:05 +02:00
1e89056dee
LSP Code restructuring 2024-05-31 18:59:57 +02:00
9885622e29
Add bash TODO alias 2024-05-31 18:59:25 +02:00
b830099aae
Add git FL alias (force with lease) 2024-05-31 18:59:14 +02:00
16 changed files with 263 additions and 220 deletions

View file

@ -50,6 +50,7 @@ export DOCKER_HOST=unix:///run/user/1000/podman/podman.sock
alias nvim-conf="nvim ~/.config/nvim" alias nvim-conf="nvim ~/.config/nvim"
alias bash-conf="nvim #/.bashrc" alias bash-conf="nvim #/.bashrc"
alias todo="nvim ~/Documents/Notes/Todo.md"
alias nano="nvim" alias nano="nvim"
alias neofetch="fastfetch" alias neofetch="fastfetch"

View file

@ -1 +1,13 @@
neovim lua gcc curl wget git unzip tar gzip ripgrep php composer go nodejs npm delve # Coprs
yorickpeterse/stylua
# YUM Repos
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
# Packages
neovim lua gcc curl wget git unzip tar gzip ripgrep php composer go nodejs npm delve stylua

View file

@ -4,5 +4,6 @@ return {
require("plugins.editor.editor_code_snippets"), require("plugins.editor.editor_code_snippets"),
require("plugins.editor.editor_debugging"), require("plugins.editor.editor_debugging"),
require("plugins.editor.editor_language_server"), require("plugins.editor.editor_language_server"),
require("plugins.editor.editor_markdown_preview") require("plugins.editor.editor_markdown_preview"),
require("plugins.editor.editor_nvim_dev")
} }

View file

@ -71,5 +71,5 @@ return {
) )
end, end,
}, },
require("plugins.editor.debugger.debugger_go"), require("plugins.editor.debugging.debugging_go"),
} }

View file

@ -1,5 +1,77 @@
local lua_lsp = require("plugins.editor.language_server.language_server_lua")
local generic_lsp = require("plugins.editor.language_server.language_server_generic")
local go_lsp = require("plugins.editor.language_server.language_server_go")
local web_lsp = require("plugins.editor.language_server.language_server_web")
local php_lsp = require("plugins.editor.language_server.language_server_php")
return { return {
require("plugins.editor.language_server.language_server"), {
require("plugins.editor.language_server.language_server_extra"), "williamboman/mason.nvim",
require("plugins.editor.language_server.language_server_nvim_configuration"), 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 = {
table.unpack(lua_lsp.mason_requirements),
table.unpack(generic_lsp.mason_requirements),
table.unpack(go_lsp.mason_requirements),
table.unpack(web_lsp.mason_requirements),
table.unpack(php_lsp.mason_requirements)
},
})
end,
},
{
"neovim/nvim-lspconfig",
lazy = false,
config = function()
-- Setup --
local capabilities = require("cmp_nvim_lsp").default_capabilities()
local lspconfig = require("lspconfig")
lua_lsp.setup(lspconfig, capabilities)
generic_lsp.setup(lspconfig, capabilities)
go_lsp.setup(lspconfig, capabilities)
web_lsp.setup(lspconfig, capabilities)
php_lsp.setup(lspconfig, capabilities)
-- 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")
null_ls.setup({
sources = {
table.unpack(lua_lsp.formatter(null_ls)),
table.unpack(generic_lsp.formatter(null_ls)),
table.unpack(go_lsp.formatter(null_ls)),
table.unpack(web_lsp.formatter(null_ls)),
table.unpack(php_lsp.formatter(null_ls)),
},
})
-- Keybinding --
vim.keymap.set("n", "<leader>fc", vim.lsp.buf.format, { desc = "Format Code" })
end,
}
} }

View file

@ -1,170 +0,0 @@
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 = {
"lua_ls",
"bashls",
"dotls",
"jsonls",
"sqlls",
"lemminx",
"yamlls",
"marksman",
"html",
"emmet_ls",
"cssls",
"tailwindcss",
"tsserver",
"stimulus_ls",
"svelte",
"volar",
"eslint",
"phpactor",
"gopls",
"rust_analyzer",
"jdtls",
"kotlin_language_server",
"pylsp",
},
})
end,
},
{
"neovim/nvim-lspconfig",
lazy = false,
config = function()
-- Setup --
local capabilities = require("cmp_nvim_lsp").default_capabilities()
local lspconfig = require("lspconfig")
-- Lua support --
lspconfig.lua_ls.setup({
capabilities = capabilities,
settings = {
Lua = {
diagnostics = {
globals = { "vim" },
}
}
}
})
-- Bash support --
lspconfig.bashls.setup({
capabilities = capabilities,
})
-- Dotenv support --
lspconfig.dotls.setup({
capabilities = capabilities,
})
-- JSON support --
lspconfig.jsonls.setup({
capabilities = capabilities,
})
-- SQL support --
lspconfig.sqlls.setup({
capabilities = capabilities,
})
-- XML support --
lspconfig.lemminx.setup({
capabilities = capabilities,
})
-- YAML support --
lspconfig.yamlls.setup({
capabilities = capabilities,
})
-- Markdown support --
lspconfig.marksman.setup({
capabilities = capabilities,
})
-- HTML support --
lspconfig.html.setup({
capabilities = capabilities,
})
-- Emmet support --
lspconfig.emmet_ls.setup({
capabilities = capabilities,
})
-- PHP support --
lspconfig.phpactor.setup({
capabilities = capabilities,
})
-- CSS & SCSS support --$response
lspconfig.cssls.setup({
capabilities = capabilities,
})
-- Tailwind support --
lspconfig.tailwindcss.setup({
capabilities = capabilities,
})
-- JavaScript & TypeScript support --
lspconfig.tsserver.setup({
capabilities = capabilities,
})
-- Stimulus support --
lspconfig.stimulus_ls.setup({
capabilities = capabilities,
})
-- Svelte support --
lspconfig.svelte.setup({
capabilities = capabilities,
})
-- Vue support --
lspconfig.volar.setup({
capabilities = capabilities,
})
-- Go support --
lspconfig.gopls.setup({
capabilities = capabilities,
})
-- Rust support --
lspconfig.rust_analyzer.setup({
capabilities = capabilities,
})
-- Java support --
lspconfig.jdtls.setup({
capabilities = capabilities,
})
-- Kotlin support --
lspconfig.kotlin_language_server.setup({
capabilities = capabilities,
})
-- Python support --
lspconfig.pylsp.setup({
capabilities = capabilities,
})
-- Eslint support --
lspconfig.eslint.setup({
capabilities = capabilities,
})
-- 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,
}
}

View file

@ -1,40 +0,0 @@
return {
"nvimtools/none-ls.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
-- Setup --
local null_ls = require("null-ls")
null_ls.setup({
sources = {
-- Prettier --
null_ls.builtins.formatting.prettier,
-- Php --
null_ls.builtins.diagnostics.phpstan,
null_ls.builtins.formatting.phpcsfixer.with({
prefer_local = "vendor/bin/php-cs-fixer",
args = { "fix", "--allow-risky=yes", "$FILENAME" }
}),
-- Twig --
null_ls.builtins.diagnostics.twigcs,
-- JavaScript & Typescript
--null_ls.builtins.formatting.eslint_d,
-- Lua --
null_ls.builtins.formatting.stylua,
-- Go --
null_ls.builtins.formatting.gofumpt,
null_ls.builtins.code_actions.gomodifytags,
null_ls.builtins.code_actions.impl
},
})
-- Keybinding --
vim.keymap.set("n", "<leader>fc", vim.lsp.buf.format, { desc = "Format Code" })
end,
}

View file

@ -0,0 +1,43 @@
local LSP = {}
LSP.mason_requirements = {
"bashls",
"jsonls",
"sqlls",
"lemminx",
"yamlls",
"marksman"
}
LSP.plugin_info = {
}
function LSP.setup(lspconfig, capabilities)
local config = { capabilities = capabilities }
lspconfig.bashls.setup(config)
lspconfig.jsonls.setup(config)
lspconfig.sqlls.setup(config)
lspconfig.lemminx.setup(config)
lspconfig.yamlls.setup(config)
lspconfig.marksman.setup(config)
end
function LSP.formatter(null_ls)
return {
null_ls.builtins.formatting.prettier,
null_ls.builtins.diagnostics.spectral,
null_ls.builtins.code_actions.refactoring,
null_ls.builtins.code_actions.proselint,
null_ls.builtins.diagnostics.actionlint,
null_ls.builtins.diagnostics.markdownlint,
null_ls.builtins.diagnostics.alex,
null_ls.builtins.diagnostics.checkmake,
null_ls.builtins.diagnostics.codespell,
null_ls.builtins.diagnostics.dotenv_linter,
null_ls.builtins.diagnostics.trail_space,
null_ls.builtins.diagnostics.vacuum
}
end
return LSP

View file

@ -0,0 +1,25 @@
local LSP = {}
LSP.mason_requirements = {
"gopls"
}
LSP.plugin_info = {
}
function LSP.setup(lspconfig, capabilities)
lspconfig.gopls.setup({ capabilities = capabilities })
end
function LSP.formatter(null_ls)
return {
null_ls.builtins.formatting.gofumpt,
null_ls.builtins.code_actions.gomodifytags,
null_ls.builtins.code_actions.impl,
null_ls.builtins.diagnostics.golangci_lint,
null_ls.builtins.diagnostics.staticcheck
}
end
return LSP

View file

@ -0,0 +1,31 @@
local LSP = {}
LSP.mason_requirements = {
"lua_ls"
}
LSP.plugin_info = {
}
function LSP.setup(lspconfig, capabilities)
lspconfig.lua_ls.setup({
capabilities = capabilities,
settings = {
Lua = {
diagnostics = {
globals = { "vim" },
}
}
}
})
end
function LSP.formatter(null_ls)
return {
null_ls.builtins.formatting.stylua,
null_ls.builtins.diagnostics.selene
}
end
return LSP

View file

@ -0,0 +1,30 @@
local LSP = {}
LSP.mason_requirements = {
"phpactor",
"stimulus_ls"
}
LSP.plugin_info = {
}
function LSP.setup(lspconfig, capabilities)
local config = { capabilities = capabilities }
lspconfig.phpactor.setup(config)
lspconfig.stimulus_ls.setup(config)
end
function LSP.formatter(null_ls)
return {
null_ls.builtins.diagnostics.phpstan,
null_ls.builtins.formatting.phpcsfixer.with({
prefer_local = "vendor/bin/php-cs-fixer",
args = { "fix", "--allow-risky=yes", "$FILENAME" }
}),
null_ls.builtins.diagnostics.phpcs,
null_ls.builtins.diagnostics.twigcs,
}
end
return LSP

View file

@ -0,0 +1,37 @@
local LSP = {}
LSP.mason_requirements = {
"html",
"emmet_ls",
"cssls",
"tailwindcss",
"tsserver",
"svelte",
"volar",
"eslint",
}
LSP.plugin_info = {
}
function LSP.setup(lspconfig, capabilities)
local config = { capabilities = capabilities }
lspconfig.html.setup(config)
lspconfig.emmet_ls.setup(config)
lspconfig.cssls.setup(config)
lspconfig.tailwindcss.setup(config)
lspconfig.tsserver.setup(config)
lspconfig.svelte.setup(config)
lspconfig.volar.setup(config)
lspconfig.eslint.setup(config)
end
function LSP.formatter(null_ls)
return {
require("none-ls.formatting.eslint_d"),
null_ls.builtins.diagnostics.stylelint
}
end
return LSP

View file

@ -20,3 +20,4 @@
prunetags = true prunetags = true
[alias] [alias]
adog = log --all --decorate --oneline --graph adog = log --all --decorate --oneline --graph
fl = push --force-with-lease