restructure and more plugins
This commit is contained in:
3
init.lua
3
init.lua
@@ -5,7 +5,10 @@ require("config.lazy")
|
||||
vim.opt.splitbelow = true
|
||||
vim.opt.splitright = true
|
||||
|
||||
vim.o.winborder = "rounded"
|
||||
|
||||
vim.keymap.set("i", "jj", "<Esc>")
|
||||
vim.keymap.set("n", "q:", ":", { noremap = true, silent = true })
|
||||
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.softtabstop = 4
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
@@ -23,14 +23,19 @@ vim.g.maplocalleader = "\\"
|
||||
|
||||
-- Setup lazy.nvim
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- import your plugins
|
||||
{ import = "plugins" },
|
||||
{ import = "plugins.completion" },
|
||||
},
|
||||
-- Configure any other settings here. See the documentation for more details.
|
||||
-- colorscheme that will be used when installing plugins.
|
||||
install = { colorscheme = { "catppuccin" } },
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = true },
|
||||
spec = {
|
||||
-- import your plugins
|
||||
{ import = "plugins" },
|
||||
{ import = "plugins.completion" },
|
||||
{ import = "plugins.ui" },
|
||||
{ import = "plugins.functional" },
|
||||
},
|
||||
-- Configure any other settings here. See the documentation for more details.
|
||||
-- colorscheme that will be used when installing plugins.
|
||||
install = { colorscheme = { "catppuccin" } },
|
||||
ui = {
|
||||
border = "rounded",
|
||||
},
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = true },
|
||||
})
|
||||
|
||||
@@ -1,41 +1,31 @@
|
||||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = { "ts_ls", "lua_ls", "pyright", "rust_analyzer", "eslint" }, -- Add your desired LSPs
|
||||
automatic_installation = true,
|
||||
})
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
lspconfig.lua_ls.setup({})
|
||||
--Enable (broadcasting) snippet capability for completion
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
-- Enable snippet capability for completion
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
|
||||
vim.lsp.config("cssls", {
|
||||
capabilities = capabilities,
|
||||
})
|
||||
lspconfig.pyright.setup({})
|
||||
lspconfig.cssls.setup({})
|
||||
lspconfig.ts_ls.setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
lspconfig.rust_analyzer.setup({})
|
||||
lspconfig.emmet_ls.setup({
|
||||
capabilities = require("cmp_nvim_lsp").default_capabilities(),
|
||||
filetypes = { "html", "css", "javascriptreact", "typescriptreact" }, -- Add more if needed
|
||||
init_options = {
|
||||
html = {
|
||||
options = {
|
||||
["bem.enabled"] = true,
|
||||
},
|
||||
lspconfig.lua_ls.setup({})
|
||||
lspconfig.pyright.setup({})
|
||||
lspconfig.cssls.setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
lspconfig.ts_ls.setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
lspconfig.rust_analyzer.setup({})
|
||||
lspconfig.emmet_ls.setup({
|
||||
capabilities = require("cmp_nvim_lsp").default_capabilities(),
|
||||
filetypes = { "html", "css", "javascriptreact", "typescriptreact" },
|
||||
init_options = {
|
||||
html = {
|
||||
options = {
|
||||
["bem.enabled"] = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
48
lua/plugins/functional/flash.lua
Normal file
48
lua/plugins/functional/flash.lua
Normal file
@@ -0,0 +1,48 @@
|
||||
return {
|
||||
"folke/flash.nvim",
|
||||
event = "VeryLazy",
|
||||
---@type Flash.Config
|
||||
opts = {},
|
||||
keys = {
|
||||
{
|
||||
"<leader>s",
|
||||
mode = { "n", "x", "o" },
|
||||
function()
|
||||
require("flash").jump()
|
||||
end,
|
||||
desc = "Flash",
|
||||
},
|
||||
{
|
||||
"<leader>S",
|
||||
mode = { "n", "x", "o" },
|
||||
function()
|
||||
require("flash").treesitter()
|
||||
end,
|
||||
desc = "Flash Treesitter",
|
||||
},
|
||||
{
|
||||
"<leader>r",
|
||||
mode = "o",
|
||||
function()
|
||||
require("flash").remote()
|
||||
end,
|
||||
desc = "Remote Flash",
|
||||
},
|
||||
{
|
||||
"<leader>R",
|
||||
mode = { "o", "x" },
|
||||
function()
|
||||
require("flash").treesitter_search()
|
||||
end,
|
||||
desc = "Treesitter Search",
|
||||
},
|
||||
{
|
||||
"<leader><c-s>",
|
||||
mode = { "c" },
|
||||
function()
|
||||
require("flash").toggle()
|
||||
end,
|
||||
desc = "Toggle Flash Search",
|
||||
},
|
||||
},
|
||||
}
|
||||
18
lua/plugins/functional/mini.lua
Normal file
18
lua/plugins/functional/mini.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
return {
|
||||
"echasnovski/mini.nvim",
|
||||
version = "",
|
||||
|
||||
config = function()
|
||||
require("mini.pairs").setup() -- Bracket pairs and stuff
|
||||
require("mini.ai").setup() -- Around and In extension for visual mode
|
||||
require("mini.surround").setup() -- Suround selections with characters
|
||||
require("mini.move").setup({
|
||||
mappings = {
|
||||
down = "J",
|
||||
up = "K",
|
||||
},
|
||||
})
|
||||
|
||||
require("mini.icons").setup() -- Icon provider
|
||||
end,
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
return {
|
||||
"echasnovski/mini.nvim",
|
||||
version = "",
|
||||
config = function()
|
||||
require('mini.pairs').setup() -- Bracket pairs and stuff
|
||||
require("mini.ai").setup() -- Around and In extension for visual mode
|
||||
require("mini.surround").setup() -- Suround selections with characters
|
||||
|
||||
require("mini.icons").setup() -- Icon provider
|
||||
end,
|
||||
}
|
||||
60
lua/plugins/ui/lualine.lua
Normal file
60
lua/plugins/ui/lualine.lua
Normal file
@@ -0,0 +1,60 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = "auto",
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
always_show_tabline = true,
|
||||
globalstatus = false,
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
refresh_time = 16, -- ~60fps
|
||||
events = {
|
||||
"WinEnter",
|
||||
"BufEnter",
|
||||
"BufWritePost",
|
||||
"SessionLoadPost",
|
||||
"FileChangedShellPost",
|
||||
"VimResized",
|
||||
"Filetype",
|
||||
"CursorMoved",
|
||||
"CursorMovedI",
|
||||
"ModeChanged",
|
||||
},
|
||||
},
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch", "diff", "diagnostics" },
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "encoding", "fileformat", "filetype" },
|
||||
lualine_y = { "lsp_status" },
|
||||
lualine_z = { "location" },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = { "branch", "diff", "diagnostics" },
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {},
|
||||
})
|
||||
end,
|
||||
}
|
||||
6
lua/plugins/ui/tint.lua
Normal file
6
lua/plugins/ui/tint.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
return {
|
||||
"levouh/tint.nvim",
|
||||
config = function()
|
||||
require("tint").setup()
|
||||
end,
|
||||
}
|
||||
Reference in New Issue
Block a user