update nvim config

This commit is contained in:
Yevhenii Moruhyi 2024-01-06 16:47:53 -05:00
parent 965b392ace
commit fd6fa59a6e
11 changed files with 54 additions and 158 deletions

View File

@ -18,3 +18,7 @@ vim.keymap.set("x", "<leader>p", '"_dP')
-- next greatest remap ever : asbjornHaland
vim.keymap.set({ "n", "v" }, "<leader>y", '"+y')
vim.keymap.set("n", "<leader>Y", '"+Y')
vim.keymap.set("n", "<leader>pv", ":Vex<CR>")
vim.keymap.set("t", "<Esc>", "<C-\\><C-n>")
vim.keymap.set("t", "<C-v><Esc>", "<Esc>")

View File

@ -2,36 +2,20 @@ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
-- bootstrap lazy.nvim
-- stylua: ignore
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable",
lazypath })
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
local _border = "single"
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
border = _border,
})
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
border = _border,
})
vim.diagnostic.config({
float = { border = _border },
})
require("lazy").setup({
spec = {
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
-- import any extras modules here
{ import = "lazyvim.plugins.extras.lang.typescript" },
{ import = "lazyvim.plugins.extras.lang.json" },
{ import = "lazyvim.plugins.extras.util.project" },
{ import = "lazyvim.plugins.extras.lang.tailwind" },
{ import = "lazyvim.plugins.extras.dap.core" },
{ import = "lazyvim.plugins.extras.linting.eslint" },
-- { import = "lazyvim.plugins.extras.dap.core" },
-- { import = "lazyvim.plugins.extras.dap.nlua" },
-- { import = "lazyvim.plugins.extras.formatting.prettier" },
-- { import = "lazyvim.plugins.extras.linting.eslint" },
-- import/override with your plugins
{ import = "plugins" },
},

View File

@ -1,10 +1,17 @@
-- Options are automatically loaded before lazy.nvim startup
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
-- Add any additional options here
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.o.mouse = ""
vim.o.nu = true
vim.o.guicursor = ""
vim.o.cursorline = false
vim.o.clipboard = ""
vim.g.netrw_banner = 0
vim.g.netrw_browse_split = 0
vim.g.netrw_winsize = 25
local opt = vim.opt;
opt.mouse = ""
opt.nu = true
opt.guicursor = ""
opt.cursorline = false
opt.clipboard = ""
opt.scrolloff = 8
opt.conceallevel = 0

View File

@ -1,20 +0,0 @@
return {
"hrsh7th/nvim-cmp",
dependencies = { "hrsh7th/cmp-emoji" },
---@param opts cmp.ConfigSchema
opts = function(_, opts)
local cmp = require("cmp")
opts.sources = cmp.config.sources(vim.list_extend(opts.sources, { { name = "emoji" } }))
cmp.setup({
window = {
completion = {
border = "single",
-- winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,CursorLine:PmenuThumb,Search:None",
},
documentation = {
border = "single",
},
},
})
end,
}

View File

@ -0,0 +1,16 @@
return {
{
"rose-pine/neovim",
name = "rose-pine",
opts = {
variant = "moon",
dark_variant = "moon",
},
},
{
"LazyVim/LazyVim",
opts = {
colorscheme = "rose-pine",
},
},
}

View File

@ -6,4 +6,13 @@ return {
{ "indent-blankline.nvim", enabled = false },
{ "mini.indentscope", enabled = false },
{ "RRethy/vim-illuminate", enabled = false },
{ "neodev.nvim", enabled = false },
{ "neo-tree.nvim", enabled = false },
{ "bufferline.nvim", enabled = false },
{ "dashboard-nvim", enabled = false },
{ "flash.nvim", enabled = false },
{ "mini.pairs", enabled = false },
{ "mini.ai", enabled = false },
{ "nvim-ts-autotag", enabled = false },
{ "conform.nvim", enabled = false },
}

View File

@ -1,41 +0,0 @@
return {
{
"neovim/nvim-lspconfig",
-- other settings removed for brevity
opts = {
---@type lspconfig.options
servers = {
eslint = {
settings = {
-- helps eslint find the eslintrc when it's placed in a subfolder instead of the cwd root
workingDirectory = { mode = "auto" },
},
},
},
setup = {
eslint = function()
require("lazyvim.util").on_attach(function(client)
if client.name == "eslint" then
client.server_capabilities.documentFormattingProvider = true
elseif client.name == "tsserver" then
client.server_capabilities.documentFormattingProvider = false
end
end)
end,
-- eslint = function()
-- vim.api.nvim_create_autocmd("BufWritePre", {
-- callback = function(event)
-- local client = vim.lsp.get_active_clients({ bufnr = event.buf, name = "eslint" })[1]
-- if client then
-- local diag = vim.diagnostic.get(event.buf, { namespace = vim.lsp.diagnostic.get_namespace(client.id) })
-- if #diag > 0 then
-- vim.cmd("EslintFixAll")
-- end
-- end
-- end,
-- })
-- end,
},
},
},
}

View File

@ -103,7 +103,7 @@ return {
dependencies = {
"jose-elias-alvarez/typescript.nvim",
init = function()
require("lazyvim.util").on_attach(function(_, buffer)
require("lazyvim.util").lsp.on_attach(function(_, buffer)
-- stylua: ignore
vim.keymap.set( "n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
vim.keymap.set("n", "<leader>cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer })

View File

@ -1,20 +0,0 @@
-- dashboard
return {
"goolord/alpha-nvim",
event = "VimEnter",
opts = function()
local dashboard = require("alpha.themes.dashboard")
local logo = [[
Z
Z
z
z
[@ymoruhyi]
]]
dashboard.section.header.val = vim.split(logo, "\n")
end,
}

View File

@ -1,17 +0,0 @@
return {
{
"williamboman/mason.nvim",
opts = function(_, opts)
table.insert(opts.ensure_installed, "svelte-language-server")
end,
},
{
"neovim/nvim-lspconfig",
opts = {
servers = {
svelte = {},
},
},
},
"evanleck/vim-svelte",
}

View File

@ -1,26 +0,0 @@
return {
{
"rose-pine/neovim",
name = "rose-pine",
opts = {
variant = "moon",
dark_variant = "moon",
-- highlight_groups = {
-- Normal = { bg = "none" },
-- NormalFloat = { bg = "none" },
-- TelescopeBorder = { fg = "highlight_high", bg = "none" },
-- TelescopeNormal = { bg = "none" },
-- TelescopePromptNormal = { bg = "base" },
-- TelescopeResultsNormal = { fg = "subtle", bg = "none" },
-- TelescopeSelection = { fg = "text", bg = "base" },
-- TelescopeSelectionCaret = { fg = "rose", bg = "rose" },
-- },
},
},
{
"LazyVim/LazyVim",
opts = {
colorscheme = "rose-pine",
},
},
}