fix(config): new config, it's been a while
This commit is contained in:
commit
1fe92c532b
11 changed files with 385 additions and 0 deletions
39
lua/plugins/completion.lua
Normal file
39
lua/plugins/completion.lua
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
return {
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
dependencies = {
|
||||
{ "rafamadriz/friendly-snippets" },
|
||||
},
|
||||
version = "1.*",
|
||||
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
|
||||
opts = {
|
||||
keymap = {
|
||||
preset = "none",
|
||||
['<Tab>'] = { 'select_next', 'fallback' },
|
||||
['<S-Tab>'] = { 'select_prev', 'fallback' },
|
||||
["<CR>"] = { 'select_and_accept', 'fallback' },
|
||||
['<C-e>'] = { 'hide', 'fallback' }
|
||||
},
|
||||
|
||||
completion = {
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
treesitter_highlighting = true
|
||||
},
|
||||
menu = { auto_show = true },
|
||||
ghost_text = { enabled = true }
|
||||
},
|
||||
|
||||
sources = {
|
||||
default = { 'lsp', 'path', 'snippets', 'buffer' },
|
||||
},
|
||||
|
||||
signature = { enabled = true },
|
||||
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" }
|
||||
}
|
||||
}
|
||||
}
|
||||
84
lua/plugins/dev-utils.lua
Normal file
84
lua/plugins/dev-utils.lua
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
return {
|
||||
-- Parser that does syntax highlighting
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
branch = 'master',
|
||||
lazy = false,
|
||||
build = ":TSUpdate",
|
||||
config = function ()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {
|
||||
"lua",
|
||||
"cpp",
|
||||
"java",
|
||||
"javascript",
|
||||
"bash",
|
||||
"python",
|
||||
"typescript",
|
||||
"css",
|
||||
"html",
|
||||
"jsdoc",
|
||||
"http",
|
||||
"sql",
|
||||
"ssh_config",
|
||||
"json",
|
||||
"tsx",
|
||||
"xml",
|
||||
"yaml",
|
||||
"nginx",
|
||||
"gitcommit",
|
||||
"gitignore",
|
||||
"cmake"
|
||||
},
|
||||
indent = { enable = true },
|
||||
highlight = { enable = true }
|
||||
})
|
||||
end
|
||||
},
|
||||
|
||||
-- Allows pairs for {}, '', "", ()
|
||||
{
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
config = true,
|
||||
opts = {}
|
||||
},
|
||||
|
||||
-- Allows automatic tagging on HTML or JSON (E.g: <div>test</div> )
|
||||
{
|
||||
"windwp/nvim-ts-autotag",
|
||||
config = function()
|
||||
require("nvim-ts-autotag").setup()
|
||||
end,
|
||||
},
|
||||
|
||||
-- Provides highlighting on TODO's, E.g:
|
||||
-- NOTE: This is a note.
|
||||
-- WARN: This is warning note.
|
||||
-- TODO: This is a to-do note.
|
||||
-- FIX: This is a fix note.
|
||||
-- PERF: This is a performance note.
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
require("todo-comments").setup()
|
||||
end,
|
||||
},
|
||||
|
||||
-- Allows highlighting for hexadecimal colors for RGB characters.
|
||||
-- E.g: #FFFFFF
|
||||
{
|
||||
"brenoprata10/nvim-highlight-colors",
|
||||
config = function()
|
||||
require("nvim-highlight-colors").setup()
|
||||
end,
|
||||
},
|
||||
|
||||
-- Shows line(s) indicating indentation.
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
main = "ibl",
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
16
lua/plugins/discord.lua
Normal file
16
lua/plugins/discord.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
-- Just Discord Rich Presence for Neovim, neat huh?
|
||||
return {
|
||||
"vyfor/cord.nvim",
|
||||
build = ":Cord update",
|
||||
config = function()
|
||||
require("cord").setup({
|
||||
display = {
|
||||
flavor = "dark",
|
||||
},
|
||||
text = {
|
||||
default = "programming most likely",
|
||||
workspace = "",
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
18
lua/plugins/file-explorer.lua
Normal file
18
lua/plugins/file-explorer.lua
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"MunifTanjim/nui.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
lazy = false,
|
||||
opts = {
|
||||
window = {
|
||||
mappings = {
|
||||
["P"] = "toggle_preview",
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
38
lua/plugins/formatter.lua
Normal file
38
lua/plugins/formatter.lua
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
-- Formatter plugin, helps with formatting code on saving the file.
|
||||
|
||||
return {
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufWritePre" },
|
||||
cmd = { "ConformInfo" },
|
||||
|
||||
-- This will provide type hinting with LuaLS
|
||||
---@module "conform"
|
||||
---@type conform.setupOpts
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
python = { "black" },
|
||||
javascript = { "prettier" }, -- add stop_after_first for n > 1
|
||||
typescript = { "prettier" },
|
||||
sh = { "shfmt", "shellcheck" },
|
||||
bash = { "shfmt", "shellcheck" },
|
||||
},
|
||||
formatters = {
|
||||
prettier = {
|
||||
prepend_args = function()
|
||||
return { "" }
|
||||
end,
|
||||
},
|
||||
},
|
||||
default_format_opts = {
|
||||
lsp_format = "fallback",
|
||||
},
|
||||
format_on_save = {
|
||||
timeout_ms = 500,
|
||||
},
|
||||
},
|
||||
|
||||
init = function()
|
||||
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
||||
end,
|
||||
}
|
||||
75
lua/plugins/lsp.lua
Normal file
75
lua/plugins/lsp.lua
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
return {
|
||||
{
|
||||
"mason-org/mason.nvim",
|
||||
dependencies = {
|
||||
"mason-org/mason-lspconfig.nvim",
|
||||
},
|
||||
opts = function()
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup({
|
||||
-- Ensure the install of these language servers
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"clangd",
|
||||
"bashls",
|
||||
"ts_ls",
|
||||
"cssls",
|
||||
"html",
|
||||
"tailwindcss",
|
||||
"pylsp",
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
lazy = false,
|
||||
config = function()
|
||||
local caps = vim.lsp.protocol.make_client_capabilities()
|
||||
local capabilities = require("blink.cmp").get_lsp_capabilities(caps)
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
|
||||
vim.lsp.config("*", {
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
vim.lsp.config("lua_ls", {
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { "vim" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.lsp.config("ts_ls", {
|
||||
init_options = { preferences = { disableSuggestions = false } },
|
||||
})
|
||||
|
||||
vim.lsp.enable({
|
||||
"lua_ls",
|
||||
"clangd",
|
||||
"bashls",
|
||||
"ts_ls",
|
||||
"cssls",
|
||||
"html",
|
||||
"tailwindcss",
|
||||
"pylsp",
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"esmuellert/nvim-eslint",
|
||||
config = function()
|
||||
require("nvim-eslint").setup({
|
||||
settings = {
|
||||
workingDirectory = function(bufnr)
|
||||
return { directory = vim.fs.root(bufnr, { "package.json" }) }
|
||||
end,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
9
lua/plugins/ui.lua
Normal file
9
lua/plugins/ui.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
return {
|
||||
-- Colorscheme
|
||||
{
|
||||
"rebelot/kanagawa.nvim",
|
||||
config = function()
|
||||
vim.cmd([[colorscheme kanagawa-dragon]])
|
||||
end,
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue