flippity fuck
This commit is contained in:
parent
e9a8b28907
commit
d5faa08253
11 changed files with 201 additions and 57 deletions
1
init.lua
1
init.lua
|
@ -1,4 +1,3 @@
|
|||
require("config.lazy")
|
||||
require("config.general")
|
||||
require("config.autocmd")
|
||||
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
pattern = "*",
|
||||
callback = function(args)
|
||||
require("conform").format({ bufnr = args.buf })
|
||||
end,
|
||||
})
|
|
@ -23,3 +23,5 @@ vim.opt.scrolloff = 6
|
|||
|
||||
vim.cmd("nnoremap j gj")
|
||||
vim.cmd("nnoremap k gk")
|
||||
|
||||
vim.g.zig_fmt_parse_errors = 0
|
||||
|
|
|
@ -1,12 +1,50 @@
|
|||
return {
|
||||
"stevearc/conform.nvim",
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
js = { "prettierd" },
|
||||
html = { "prettierd" },
|
||||
c = { "clang-format" },
|
||||
cpp = { "clang-format" },
|
||||
},
|
||||
},
|
||||
event = { "BufWritePre" },
|
||||
cmd = { "ConformInfo" },
|
||||
init = function()
|
||||
require "conform".setup(
|
||||
{
|
||||
format_on_save = function(bufnr)
|
||||
require("conform").formatters_by_ft = require "mason-bridge".get_formatters()
|
||||
return { timeout_ms = 200, lsp_fallback = true }, on_format
|
||||
end,
|
||||
formatters_by_ft = require("mason-bridge").get_formatters(), --[[ = {
|
||||
lua = { "stylua" },
|
||||
javascript = { "prettier" },
|
||||
html = { "prettier" },
|
||||
css = { "prettier" },
|
||||
c = { "clang-format" },
|
||||
cpp = { "clang-format" },
|
||||
arduino = { "clang-format" },
|
||||
sh = { "shfmt" },
|
||||
bash = { "shfmt" },
|
||||
mksh = { "shfmt" },
|
||||
json = { "jq" },
|
||||
}, ]] --
|
||||
|
||||
-- This will provide type hinting with LuaLS
|
||||
---@module "conform"
|
||||
---@type conform.setupOpts
|
||||
formatters = {
|
||||
prettier = {
|
||||
prepend_args = { "--use-tabs", "true" },
|
||||
},
|
||||
jq = {
|
||||
prepend_args = { "--tab" },
|
||||
},
|
||||
["clang-format"] = {
|
||||
prepend_args = function(self, ctx)
|
||||
return { "-style=file:/home/Dario48/.config/.clang-format" }
|
||||
end,
|
||||
},
|
||||
default_format_opts = {
|
||||
lsp_format = "fallback",
|
||||
},
|
||||
},
|
||||
})
|
||||
-- If you want the formatexpr, here is the place to set it
|
||||
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
||||
vim.g.arduino_recommended_style = 0
|
||||
end,
|
||||
}
|
||||
|
|
4
lua/plugins/darioline.lua
Normal file
4
lua/plugins/darioline.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
return {
|
||||
url = "https://codeberg.org/Dario48/darioline.git",
|
||||
config = true
|
||||
}
|
|
@ -1,39 +1,59 @@
|
|||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
{'hrsh7th/cmp-nvim-lsp'},
|
||||
{'hrsh7th/nvim-cmp'},
|
||||
{ "hrsh7th/cmp-nvim-lsp" },
|
||||
{ "hrsh7th/nvim-cmp" },
|
||||
},
|
||||
config = function()
|
||||
-- Reserve a space in the gutter
|
||||
-- This will avoid an annoying layout shift in the screen
|
||||
vim.opt.signcolumn = 'yes'
|
||||
vim.opt.signcolumn = "yes"
|
||||
|
||||
-- Add cmp_nvim_lsp capabilities settings to lspconfig
|
||||
-- This should be executed before you configure any language server
|
||||
local lspconfig_defaults = require('lspconfig').util.default_config
|
||||
local lspconfig_defaults = require("lspconfig").util.default_config
|
||||
lspconfig_defaults.capabilities = vim.tbl_deep_extend(
|
||||
'force',
|
||||
lspconfig_defaults.capabilities,
|
||||
require('cmp_nvim_lsp').default_capabilities()
|
||||
"force",
|
||||
lspconfig_defaults.capabilities,
|
||||
require("cmp_nvim_lsp").default_capabilities()
|
||||
)
|
||||
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
desc = 'LSP actions',
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
desc = "LSP actions",
|
||||
callback = function(event)
|
||||
local opts = {buffer = event.buf}
|
||||
local opts = { buffer = event.buf }
|
||||
|
||||
vim.keymap.set('n', 'K', function () vim.lsp.buf.hover() end, opts)
|
||||
vim.keymap.set('n', 'gd', function () vim.lsp.buf.definition() end, opts)
|
||||
vim.keymap.set('n', 'gD', function () vim.lsp.buf.declaration() end, opts)
|
||||
vim.keymap.set('n', 'gi', function () vim.lsp.buf.implementation() end, opts)
|
||||
vim.keymap.set('n', 'go', function () vim.lsp.buf.type_definition() end, opts)
|
||||
vim.keymap.set('n', 'gr', function () vim.lsp.buf.references() end, opts)
|
||||
vim.keymap.set('n', 'gs', function () vim.lsp.buf.signature_help() end, opts)
|
||||
vim.keymap.set('n', '<F2>', function () vim.lsp.buf.rename() end, opts)
|
||||
vim.keymap.set({'n', 'x'}, '<F3>', function () vim.lsp.buf.format({async = true}) end, opts)
|
||||
vim.keymap.set('n', '<F4>', function () vim.lsp.buf.code_action() end, opts)
|
||||
vim.keymap.set("n", "K", function()
|
||||
vim.lsp.buf.hover()
|
||||
end, opts)
|
||||
vim.keymap.set("n", "gd", function()
|
||||
vim.lsp.buf.definition()
|
||||
end, opts)
|
||||
vim.keymap.set("n", "gD", function()
|
||||
vim.lsp.buf.declaration()
|
||||
end, opts)
|
||||
vim.keymap.set("n", "gi", function()
|
||||
vim.lsp.buf.implementation()
|
||||
end, opts)
|
||||
vim.keymap.set("n", "go", function()
|
||||
vim.lsp.buf.type_definition()
|
||||
end, opts)
|
||||
vim.keymap.set("n", "gr", function()
|
||||
vim.lsp.buf.references()
|
||||
end, opts)
|
||||
vim.keymap.set("n", "gs", function()
|
||||
vim.lsp.buf.signature_help()
|
||||
end, opts)
|
||||
vim.keymap.set("n", "<F2>", function()
|
||||
vim.lsp.buf.rename()
|
||||
end, opts)
|
||||
vim.keymap.set({ "n", "x" }, "<F3>", function()
|
||||
vim.lsp.buf.format({ async = true })
|
||||
end, opts)
|
||||
vim.keymap.set("n", "<leader>f", function()
|
||||
vim.lsp.buf.code_action()
|
||||
end, opts)
|
||||
end,
|
||||
})
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -2,24 +2,62 @@ return {
|
|||
{
|
||||
"williamboman/mason.nvim",
|
||||
|
||||
dependencies = {"williamboman/mason-lspconfig.nvim"},
|
||||
dependencies = { "williamboman/mason-lspconfig.nvim" },
|
||||
|
||||
keys = {
|
||||
{ "<leader>m", ":Mason <CR>", desc = "open mason" },
|
||||
},
|
||||
config = true;
|
||||
config = true,
|
||||
},
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
opts = {
|
||||
-- Replace the language servers listed here
|
||||
-- Replace the language servers listed here
|
||||
-- with the ones you want to install
|
||||
ensure_installed = {'lua_ls', 'pyright'},
|
||||
ensure_installed = { "lua_ls", "clangd", "hyprls", "lua_ls" },
|
||||
handlers = {
|
||||
function(server_name)
|
||||
require('lspconfig')[server_name].setup({})
|
||||
require("lspconfig")[server_name].setup({
|
||||
})
|
||||
end,
|
||||
|
||||
["lua_ls"] = function()
|
||||
require 'lspconfig'.lua_ls.setup {
|
||||
on_init = function(client)
|
||||
local path = client.workspace_folders[1].name
|
||||
if vim.loop.fs_stat(path .. '/.luarc.json') or vim.loop.fs_stat(path .. '/.luarc.jsonc') then
|
||||
return
|
||||
end
|
||||
|
||||
client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using
|
||||
-- (most likely LuaJIT in the case of Neovim)
|
||||
version = 'LuaJIT'
|
||||
},
|
||||
-- Make the server aware of Neovim runtime files
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
library = {
|
||||
vim.env.VIMRUNTIME
|
||||
-- Depending on the usage, you might want to add additional paths here.
|
||||
-- "${3rd}/luv/library"
|
||||
-- "${3rd}/busted/library",
|
||||
}
|
||||
-- or pull in all of 'runtimepath'. NOTE: this is a lot slower
|
||||
-- library = vim.api.nvim_get_runtime_file("", true)
|
||||
}
|
||||
})
|
||||
end,
|
||||
settings = {
|
||||
Lua = {}
|
||||
}
|
||||
}
|
||||
end
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
"frostplexx/mason-bridge.nvim",
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,19 +1,33 @@
|
|||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'hrsh7th/cmp-buffer',
|
||||
'hrsh7th/cmp-path',
|
||||
'hrsh7th/cmp-cmdline',
|
||||
'neovim/nvim-lspconfig'
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
"hrsh7th/cmp-nvim-lua",
|
||||
"neovim/nvim-lspconfig",
|
||||
"mtoohey31/cmp-fish",
|
||||
"petertriho/cmp-git",
|
||||
},
|
||||
config= function()
|
||||
local cmp = require('cmp')
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
|
||||
cmp.setup({
|
||||
sources = {
|
||||
{name = 'nvim_lsp'},
|
||||
{ name = "nvim_lua" },
|
||||
{
|
||||
name = "nvim_lsp",
|
||||
entry_filter = function(entry, ctx)
|
||||
local kind = require("cmp.types").lsp.CompletionItemKind[entry:get_kind()]
|
||||
|
||||
if kind == "Text" then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end,
|
||||
},
|
||||
{ name = "neorg" },
|
||||
{ name = "fish" },
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
|
@ -21,13 +35,25 @@ return {
|
|||
vim.snippet.expand(args.body)
|
||||
end,
|
||||
},
|
||||
cmp.setup.filetype("gitcommit", {
|
||||
sources = cmp.config.sources({
|
||||
{ name = "git" },
|
||||
}, {
|
||||
{ name = "buffer" },
|
||||
}),
|
||||
}),
|
||||
require("cmp_git").setup(),
|
||||
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<S-NL>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-S-K>'] = cmp.mapping.scroll_docs(-4),
|
||||
[' '] = cmp.mapping.confirm(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<S-NL>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-S-K>"] = cmp.mapping.scroll_docs(-4),
|
||||
[" "] = cmp.mapping.confirm(),
|
||||
}),
|
||||
})
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
|
19
lua/plugins/nvim-lint.lua
Normal file
19
lua/plugins/nvim-lint.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
return {
|
||||
"mfussenegger/nvim-lint",
|
||||
init = function()
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
callback = function()
|
||||
require "lint".try_lint()
|
||||
end,
|
||||
})
|
||||
|
||||
vim.diagnostic.config({
|
||||
signs = true,
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
virtual_text = true,
|
||||
})
|
||||
|
||||
require("lint").linters_by_ft = require("mason-bridge").get_linters()
|
||||
end
|
||||
}
|
3
lua/plugins/suda.lua
Normal file
3
lua/plugins/suda.lua
Normal file
|
@ -0,0 +1,3 @@
|
|||
return {
|
||||
"lambdalisue/vim-suda",
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
return {
|
||||
"folke/which-key.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue