🔧 Overhaul for performance
This commit is contained in:
parent
9e1b046074
commit
6365ecfe66
37 changed files with 487 additions and 345 deletions
3
.config/nvim/lua/plugins/autopairs.lua
Normal file
3
.config/nvim/lua/plugins/autopairs.lua
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
return { "windwp/nvim-autopairs", event = "InsertEnter", opts = {
|
||||
ignored_next_char = '[%w%"]',
|
||||
} }
|
||||
11
.config/nvim/lua/plugins/colorizer.lua
Normal file
11
.config/nvim/lua/plugins/colorizer.lua
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
return {
|
||||
"norcalli/nvim-colorizer.lua",
|
||||
config = function()
|
||||
require("colorizer").setup({
|
||||
"*",
|
||||
css = { css = true },
|
||||
html = { css = true },
|
||||
javascript = { css = true },
|
||||
})
|
||||
end,
|
||||
}
|
||||
33
.config/nvim/lua/plugins/conform.lua
Normal file
33
.config/nvim/lua/plugins/conform.lua
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
return {
|
||||
"stevearc/conform.nvim",
|
||||
config = function()
|
||||
require("conform").setup({
|
||||
formatters_by_ft = {
|
||||
python = { "isort", "black" },
|
||||
lua = { "stylua" },
|
||||
css = { "prettierd" },
|
||||
javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||
typescript = { "prettierd", "prettier", stop_after_first = true },
|
||||
javascriptreact = { "prettierd", "prettier", stop_after_first = true },
|
||||
typescriptreact = { "prettierd", "prettier", stop_after_first = true },
|
||||
html = { "prettierd", "prettier", stop_after_first = true },
|
||||
pug = { "prettierd", "prettier", stop_after_first = true },
|
||||
vue = { "prettierd", "prettier", stop_after_first = true },
|
||||
sql = { "sql_formatter" },
|
||||
rust = { "rustfmt" },
|
||||
golang = { "gofmt" },
|
||||
sh = { "shfmt" },
|
||||
json = { "jq", "deno_fmt", stop_after_first = true },
|
||||
toml = { "taplo" },
|
||||
yaml = { "yq" },
|
||||
markdown = { "deno_fmt" },
|
||||
},
|
||||
format_on_save = {
|
||||
-- These options will be passed to conform.format()
|
||||
timeout_ms = 500,
|
||||
async = false,
|
||||
lsp_format = "fallback",
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
6
.config/nvim/lua/plugins/crates.lua
Normal file
6
.config/nvim/lua/plugins/crates.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
return {
|
||||
"saecki/crates.nvim",
|
||||
config = function()
|
||||
require("crates").setup()
|
||||
end,
|
||||
}
|
||||
3
.config/nvim/lua/plugins/gitblame.lua
Normal file
3
.config/nvim/lua/plugins/gitblame.lua
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
return { "f-person/git-blame.nvim", cmd = { "GitBlameToggle" }, opts = {
|
||||
enabled = false,
|
||||
} }
|
||||
35
.config/nvim/lua/plugins/harpoon.lua
Normal file
35
.config/nvim/lua/plugins/harpoon.lua
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
return {
|
||||
"ThePrimeagen/harpoon",
|
||||
config = function()
|
||||
local mark = require("harpoon.mark")
|
||||
local ui = require("harpoon.ui")
|
||||
|
||||
vim.keymap.set("n", "<leader>a", mark.add_file)
|
||||
vim.keymap.set("n", "<C-o>", ui.toggle_quick_menu)
|
||||
|
||||
vim.keymap.set("n", "<leader>j", function()
|
||||
ui.nav_file(1)
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>k", function()
|
||||
ui.nav_file(2)
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>l", function()
|
||||
ui.nav_file(3)
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>;", function()
|
||||
ui.nav_file(4)
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>m", function()
|
||||
ui.nav_file(5)
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>,", function()
|
||||
ui.nav_file(6)
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>.", function()
|
||||
ui.nav_file(7)
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>/", function()
|
||||
ui.nav_file(8)
|
||||
end)
|
||||
end,
|
||||
}
|
||||
9
.config/nvim/lua/plugins/indentline.lua
Normal file
9
.config/nvim/lua/plugins/indentline.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
return {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
event = "BufRead",
|
||||
config = function()
|
||||
require("ibl").setup({
|
||||
indent = { char = "¦" },
|
||||
})
|
||||
end,
|
||||
}
|
||||
107
.config/nvim/lua/plugins/lsp.lua
Normal file
107
.config/nvim/lua/plugins/lsp.lua
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
local servers = {
|
||||
"bashls",
|
||||
"biome",
|
||||
"clangd",
|
||||
"cssls",
|
||||
"dockerls",
|
||||
"emmet_ls",
|
||||
"eslint",
|
||||
"gopls",
|
||||
"jqls",
|
||||
"lua_ls",
|
||||
"pyright",
|
||||
"quick_lint_js",
|
||||
"rust_analyzer",
|
||||
"stylelint_lsp",
|
||||
"svelte",
|
||||
"ts_ls",
|
||||
"zls",
|
||||
}
|
||||
|
||||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"hrsh7th/nvim-cmp",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"VonHeikemen/lsp-zero.nvim",
|
||||
},
|
||||
event = { "BufReadPre", "BufNewFile" }, -- Load on opening files
|
||||
config = function()
|
||||
local lsp = require("lsp-zero")
|
||||
local lspconfig = require("lspconfig")
|
||||
local cmp = require("cmp")
|
||||
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = servers,
|
||||
})
|
||||
|
||||
for _, server in ipairs(servers) do
|
||||
lspconfig[server].setup({})
|
||||
end
|
||||
|
||||
cmp.setup({
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
{ name = "vsnip" },
|
||||
}),
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<Up>"] = cmp.mapping.select_prev_item(),
|
||||
["<Down>"] = cmp.mapping.select_next_item(),
|
||||
["<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 }),
|
||||
}),
|
||||
})
|
||||
|
||||
-- Floating error messages
|
||||
vim.diagnostic.config({
|
||||
underline = true,
|
||||
virtual_text = true,
|
||||
float = {
|
||||
source = "always",
|
||||
focusable = false,
|
||||
},
|
||||
})
|
||||
|
||||
-- Keybinding for diagnostics
|
||||
vim.keymap.set("n", "<space>e", "<cmd>lua vim.diagnostic.open_float()<CR>")
|
||||
|
||||
-- Vue TypeScript Setup
|
||||
local vue_typescript_plugin = "/usr/lib/node_modules/@vue/language-server"
|
||||
.. "/usr/lib/node_modules/@vue/typescript-plugin"
|
||||
|
||||
lspconfig.tsserver.setup({
|
||||
init_options = {
|
||||
plugins = {
|
||||
{
|
||||
name = "@vue/typescript-plugin",
|
||||
location = vue_typescript_plugin,
|
||||
languages = { "javascript", "typescript", "vue" },
|
||||
},
|
||||
},
|
||||
},
|
||||
filetypes = {
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"javascript.jsx",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"typescript.tsx",
|
||||
"vue",
|
||||
},
|
||||
})
|
||||
lsp.setup()
|
||||
end,
|
||||
}
|
||||
23
.config/nvim/lua/plugins/lualine.lua
Normal file
23
.config/nvim/lua/plugins/lualine.lua
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
local function show_codeium_status()
|
||||
return "{…}" .. vim.fn["codeium#GetStatusString"]()
|
||||
end
|
||||
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function()
|
||||
return {
|
||||
options = { theme = "nord" },
|
||||
sections = {
|
||||
lualine_x = {
|
||||
{
|
||||
show_codeium_status,
|
||||
cond = function()
|
||||
return vim.bo.filetype ~= "TelescopePrompt"
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
||||
11
.config/nvim/lua/plugins/markdownpreview.lua
Normal file
11
.config/nvim/lua/plugins/markdownpreview.lua
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
return {
|
||||
"iamcco/markdown-preview.nvim",
|
||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||
build = "cd app && npm install && git restore .",
|
||||
-- or if you use yarn: (I have not checked this, I use npm)
|
||||
-- build = "cd app && yarn install && git restore .",
|
||||
init = function()
|
||||
vim.g.mkdp_filetypes = { "markdown" }
|
||||
end,
|
||||
ft = { "markdown" },
|
||||
}
|
||||
116
.config/nvim/lua/plugins/nvimtree.lua
Normal file
116
.config/nvim/lua/plugins/nvimtree.lua
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
return {
|
||||
"kyazdani42/nvim-tree.lua",
|
||||
cmd = { "NvimTreeToggle" },
|
||||
config = function()
|
||||
-- Nvim_Tree configuration: -- setup with all defaults
|
||||
-- each of these are documented in `:help nvim-tree.OPTION_NAME`
|
||||
require("nvim-tree").setup({ -- BEGIN_DEFAULT_OPTS
|
||||
auto_reload_on_write = true,
|
||||
disable_netrw = false,
|
||||
-- hide_root_folder = false,
|
||||
hijack_cursor = false,
|
||||
hijack_netrw = true,
|
||||
hijack_unnamed_buffer_when_opening = false,
|
||||
open_on_tab = false,
|
||||
sort_by = "name",
|
||||
update_cwd = false,
|
||||
view = {
|
||||
width = 25,
|
||||
-- height = 30,
|
||||
side = "right",
|
||||
preserve_window_proportions = true,
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
signcolumn = "yes",
|
||||
-- mappings = {
|
||||
-- custom_only = false,
|
||||
-- list = {
|
||||
-- user mappings go here
|
||||
-- },
|
||||
-- },
|
||||
},
|
||||
renderer = {
|
||||
indent_markers = {
|
||||
enable = false,
|
||||
icons = {
|
||||
corner = "└ ",
|
||||
edge = "│ ",
|
||||
none = " ",
|
||||
},
|
||||
},
|
||||
icons = {
|
||||
webdev_colors = true,
|
||||
},
|
||||
},
|
||||
hijack_directories = {
|
||||
enable = true,
|
||||
auto_open = true,
|
||||
},
|
||||
update_focused_file = {
|
||||
enable = false,
|
||||
update_cwd = false,
|
||||
ignore_list = {},
|
||||
},
|
||||
system_open = {
|
||||
cmd = nil,
|
||||
args = {},
|
||||
},
|
||||
diagnostics = {
|
||||
enable = false,
|
||||
show_on_dirs = false,
|
||||
icons = {
|
||||
hint = "",
|
||||
info = "",
|
||||
warning = "",
|
||||
error = "",
|
||||
},
|
||||
},
|
||||
filters = {
|
||||
dotfiles = false,
|
||||
custom = {},
|
||||
exclude = {},
|
||||
},
|
||||
git = {
|
||||
enable = true,
|
||||
ignore = true,
|
||||
timeout = 400,
|
||||
},
|
||||
actions = {
|
||||
use_system_clipboard = true,
|
||||
change_dir = {
|
||||
enable = true,
|
||||
global = false,
|
||||
restrict_above_cwd = false,
|
||||
},
|
||||
open_file = {
|
||||
quit_on_open = false,
|
||||
resize_window = false,
|
||||
window_picker = {
|
||||
enable = true,
|
||||
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
|
||||
exclude = {
|
||||
filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" },
|
||||
buftype = { "nofile", "terminal", "help" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
trash = {
|
||||
cmd = "trash",
|
||||
require_confirm = true,
|
||||
},
|
||||
log = {
|
||||
enable = false,
|
||||
truncate = false,
|
||||
types = {
|
||||
all = false,
|
||||
config = false,
|
||||
copy_paste = false,
|
||||
diagnostics = false,
|
||||
git = false,
|
||||
profile = false,
|
||||
},
|
||||
},
|
||||
}) -- END_DEFAULT_OPTS for Nvim_Tree
|
||||
end,
|
||||
}
|
||||
16
.config/nvim/lua/plugins/ripgrep.lua
Normal file
16
.config/nvim/lua/plugins/ripgrep.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
return {
|
||||
"rinx/nvim-ripgrep",
|
||||
config = function()
|
||||
require("nvim-ripgrep").setup({
|
||||
runner = require("nvim-ripgrep.run").ripgrep, -- grep command
|
||||
prompt = "❯ ", -- prompt
|
||||
window = {
|
||||
width = 0.8,
|
||||
border = "rounded",
|
||||
},
|
||||
open_qf_fn = function()
|
||||
return vim.api.nvim_command("copen")
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
16
.config/nvim/lua/plugins/telescope.lua
Normal file
16
.config/nvim/lua/plugins/telescope.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
tag = "0.1.0",
|
||||
config = function()
|
||||
require("telescope").setup({
|
||||
extensions = {
|
||||
undo = {
|
||||
layout_strategy = "vertical",
|
||||
layout_config = {
|
||||
preview_height = 0.8,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
64
.config/nvim/lua/plugins/treesitter.lua
Normal file
64
.config/nvim/lua/plugins/treesitter.lua
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
event = "BufReadPost",
|
||||
config = function()
|
||||
vim.treesitter.query.set("javascript", "injections", "")
|
||||
vim.treesitter.query.set("typescript", "injections", "")
|
||||
vim.treesitter.query.set("tsx", "injections", "")
|
||||
vim.treesitter.query.set("lua", "injections", "")
|
||||
require("nvim-treesitter.configs").setup({
|
||||
-- A list of parser names, or "all"
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"c",
|
||||
"c_sharp",
|
||||
"cmake",
|
||||
"cpp",
|
||||
"css",
|
||||
"dockerfile",
|
||||
"go",
|
||||
"html",
|
||||
"http",
|
||||
"java",
|
||||
"javascript",
|
||||
"json",
|
||||
"json5",
|
||||
"jsonc",
|
||||
"lua",
|
||||
"make",
|
||||
"perl",
|
||||
"php",
|
||||
"pug",
|
||||
"python",
|
||||
"ruby",
|
||||
"toml",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"rust",
|
||||
"vim",
|
||||
"vue",
|
||||
"yaml",
|
||||
"zig",
|
||||
},
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
|
||||
highlight = {
|
||||
-- `false` will disable the whole extension
|
||||
enable = true,
|
||||
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue