mirror of
https://github.com/darwincereska/nvim-config.git
synced 2026-02-12 05:24:41 -05:00
feat(init): first init
This commit is contained in:
7
lua/plugins/autopairs.lua
Normal file
7
lua/plugins/autopairs.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
"windwp/nvim-autopairs",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
event = "InsertEnter",
|
||||
config = true,
|
||||
}
|
||||
3
lua/plugins/clipboard.lua
Normal file
3
lua/plugins/clipboard.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
"swaits/universal-clipboard.nvim",
|
||||
}
|
||||
9
lua/plugins/colorscheme.lua
Normal file
9
lua/plugins/colorscheme.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
"gbprod/nord.nvim",
|
||||
lazy=false,
|
||||
priority=1000,
|
||||
config = function()
|
||||
require("nord").setup({})
|
||||
vim.cmd.colorscheme("nord")
|
||||
end,
|
||||
}
|
||||
7
lua/plugins/comment.lua
Normal file
7
lua/plugins/comment.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
"numToStr/Comment.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
require("config.plugin.comment")
|
||||
end,
|
||||
}
|
||||
115
lua/plugins/completions.lua
Normal file
115
lua/plugins/completions.lua
Normal file
@@ -0,0 +1,115 @@
|
||||
return {
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
"L3MON4D3/LuaSnip",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"f3fora/cmp-spell",
|
||||
"rafamadriz/friendly-snippets",
|
||||
},
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
|
||||
vim.api.nvim_set_hl(0, "CmpBorder", { link = "FloatBorder" })
|
||||
vim.api.nvim_set_hl(0, "CmpDocBorder", { link = "FloatBorder" })
|
||||
vim.api.nvim_set_hl(0, "CmpDocNormal", { link = "NormalFloat" })
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<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 }),
|
||||
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
}),
|
||||
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
{ name = "spell" },
|
||||
}),
|
||||
|
||||
window = {
|
||||
completion = cmp.config.window.bordered({
|
||||
border = "rounded",
|
||||
winhighlight = "Normal:NormalFloat,FloatBorder:CmpBorder",
|
||||
scrollbar = true,
|
||||
winblend = 8,
|
||||
}),
|
||||
documentation = cmp.config.window.bordered({
|
||||
border = "rounded",
|
||||
winhighlight = "Normal:CmpDocNormal,FloatBorder:CmpDocBorder",
|
||||
winblend = 8,
|
||||
max_width = 60,
|
||||
max_height = 20,
|
||||
}),
|
||||
},
|
||||
|
||||
formatting = {
|
||||
format = function(entry, vim_item)
|
||||
vim_item.menu = ({
|
||||
nvim_lsp = "[LSP]",
|
||||
luasnip = "[Snippet]",
|
||||
buffer = "[Buffer]",
|
||||
path = "[Path]",
|
||||
spell = "[Spell]",
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
cmp.setup.cmdline({ "/", "?" }, {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = "buffer" },
|
||||
},
|
||||
})
|
||||
|
||||
cmp.setup.cmdline(":", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "path" },
|
||||
}, {
|
||||
{ name = "cmdline" },
|
||||
}),
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
10
lua/plugins/dropbar.lua
Normal file
10
lua/plugins/dropbar.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
"Bekaboo/dropbar.nvim",
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "make"
|
||||
},
|
||||
config = function()
|
||||
local dropbar_api = require("dropbar.api")
|
||||
end
|
||||
}
|
||||
25
lua/plugins/image.lua
Normal file
25
lua/plugins/image.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
return {
|
||||
"3rd/image.nvim",
|
||||
config = function()
|
||||
require("image").setup({
|
||||
backend = "kitty",
|
||||
processor = "magick_cli",
|
||||
integrations = {
|
||||
markdown = {
|
||||
enabled = true,
|
||||
clear_in_insert_mode = true,
|
||||
download_remote_images = true,
|
||||
only_render_image_at_cursor = true,
|
||||
floating_windows = false,
|
||||
filetypes = { "markdown", "vimwiki"},
|
||||
}
|
||||
},
|
||||
scale_factor = 1.0,
|
||||
max_width = nil,
|
||||
max_height = nil,
|
||||
max_height_window_percentage = 50,
|
||||
max_width_window_percentage = nil,
|
||||
window_overlap_clear_enabled = false
|
||||
})
|
||||
end
|
||||
}
|
||||
44
lua/plugins/lsp.lua
Normal file
44
lua/plugins/lsp.lua
Normal file
@@ -0,0 +1,44 @@
|
||||
return {
|
||||
{
|
||||
"mason-org/mason.nvim",
|
||||
config = function()
|
||||
require("mason").setup()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mason-org/mason-lspconfig.nvim",
|
||||
dependencies = { "mason-org/mason.nvim" },
|
||||
config = function()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = {
|
||||
"gopls",
|
||||
"clangd",
|
||||
"pyright",
|
||||
"lua_ls",
|
||||
"ts_ls",
|
||||
},
|
||||
automatic_installation = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"mason-org/mason-lspconfig.nvim",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
},
|
||||
config = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
||||
|
||||
local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
|
||||
-- Setup each server
|
||||
vim.lsp.enable("gopls")
|
||||
vim.lsp.enable("clangd")
|
||||
vim.lsp.enable("pyright")
|
||||
vim.lsp.enable("lua_ls")
|
||||
vim.lsp.enable("ts_ls")
|
||||
end,
|
||||
},
|
||||
}
|
||||
28
lua/plugins/markdown.lua
Normal file
28
lua/plugins/markdown.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
return {
|
||||
{
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"nvim-mini/mini.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("config.plugin.render-markdown")
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "markdown",
|
||||
callback = function()
|
||||
vim.opt_local.spell = true
|
||||
vim.opt_local.spelllang = "en_us"
|
||||
end,
|
||||
})
|
||||
|
||||
end,
|
||||
},
|
||||
{
|
||||
"dhruvasagar/vim-table-mode",
|
||||
ft = "markdown",
|
||||
config = function()
|
||||
vim.g.table_mode_corner = "|"
|
||||
vim.api.nvim_set_keymap("n", "<leader>tm", ":TableModeToggle<CR>", { noremap = true, silent = true })
|
||||
end,
|
||||
},
|
||||
}
|
||||
8
lua/plugins/notes.lua
Normal file
8
lua/plugins/notes.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
"darwincereska/notes.nvim",
|
||||
config = function()
|
||||
require("notes").setup({
|
||||
git_remote = "git@github.com:darwincereska/notes.git"
|
||||
})
|
||||
end
|
||||
}
|
||||
11
lua/plugins/oil.lua
Normal file
11
lua/plugins/oil.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
return {
|
||||
"stevearc/oil.nvim",
|
||||
---@module "oil"
|
||||
---@module oil.setupOpts
|
||||
opts = {},
|
||||
dependencies = { "nvim-mini/mini.icons" },
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("config.plugin.oil")
|
||||
end,
|
||||
}
|
||||
5
lua/plugins/presenting.lua
Normal file
5
lua/plugins/presenting.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
"sotte/presenting.nvim",
|
||||
opts = {},
|
||||
cmd = { "Presenting" }
|
||||
}
|
||||
7
lua/plugins/statusbar.lua
Normal file
7
lua/plugins/statusbar.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
require("config.plugin.statusbar")
|
||||
end,
|
||||
}
|
||||
16
lua/plugins/tabs.lua
Normal file
16
lua/plugins/tabs.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
return {
|
||||
"romgrk/barbar.nvim",
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons"
|
||||
},
|
||||
init = function() vim.g.barbar_auto_setup = false end,
|
||||
opts = {
|
||||
insert_at_start = true,
|
||||
animation = false,
|
||||
auto_hide = false,
|
||||
sidebar_filetypes = {
|
||||
NvimTree = true,
|
||||
NeoTree = false,
|
||||
},
|
||||
}
|
||||
}
|
||||
7
lua/plugins/telescope.lua
Normal file
7
lua/plugins/telescope.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
require("config.plugin.telescope")
|
||||
end,
|
||||
}
|
||||
15
lua/plugins/terminal.lua
Normal file
15
lua/plugins/terminal.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
return {
|
||||
"akinsho/toggleterm.nvim",
|
||||
version = "*",
|
||||
opt = {
|
||||
|
||||
},
|
||||
config = function()
|
||||
require("toggleterm").setup({
|
||||
direction = "float",
|
||||
close_on_exit = true,
|
||||
shell = "/bin/zsh -l",
|
||||
shade_in_terminals = true,
|
||||
})
|
||||
end,
|
||||
}
|
||||
7
lua/plugins/treesitter.lua
Normal file
7
lua/plugins/treesitter.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
require("config.plugin.treesitter")
|
||||
end,
|
||||
}
|
||||
8
lua/plugins/ufo.lua
Normal file
8
lua/plugins/ufo.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
"kevinhwang91/nvim-ufo",
|
||||
dependencies = "kevinhwang91/promise-async",
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("config.plugin.ufo")
|
||||
end
|
||||
}
|
||||
15
lua/plugins/ui.lua
Normal file
15
lua/plugins/ui.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
return {
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim", -- NVim File Tree
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("config.plugin.neo-tree")
|
||||
end,
|
||||
},
|
||||
}
|
||||
3
lua/plugins/vim-be-good.lua
Normal file
3
lua/plugins/vim-be-good.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
"ThePrimeagen/vim-be-good"
|
||||
}
|
||||
Reference in New Issue
Block a user