🔧 Overhaul for performance
This commit is contained in:
parent
9e1b046074
commit
6365ecfe66
37 changed files with 487 additions and 345 deletions
|
|
@ -1,3 +0,0 @@
|
|||
require("nvim-autopairs").setup({
|
||||
ignored_next_char = "[%w%\"]"
|
||||
})
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
require'colorizer'.setup({
|
||||
'*';
|
||||
css = { css = true; };
|
||||
html = { css = true; };
|
||||
javascript = { css = true; };
|
||||
})
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
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",
|
||||
},
|
||||
})
|
||||
|
|
@ -1 +0,0 @@
|
|||
require("crates").setup()
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
require("gitblame").setup({
|
||||
enabled = false,
|
||||
})
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
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)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
require("ibl").setup({
|
||||
indent = { char = "¦" },
|
||||
})
|
||||
|
|
@ -1,59 +1,4 @@
|
|||
local lsp = require("lsp-zero")
|
||||
local lspconfig = require("lspconfig")
|
||||
local cmp = require("cmp")
|
||||
require("mason").setup()
|
||||
|
||||
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md
|
||||
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",
|
||||
}
|
||||
|
||||
for _, server in ipairs(servers) do
|
||||
lspconfig[server].setup({})
|
||||
end
|
||||
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = servers,
|
||||
})
|
||||
|
||||
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 }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
}),
|
||||
})
|
||||
|
||||
-- function that is used with keybinding cm to toggle autocompletion
|
||||
Mode = require("cmp.types").cmp.TriggerEvent.TextChanged
|
||||
|
|
@ -76,50 +21,3 @@ function SetAutoCmp(mode)
|
|||
end
|
||||
|
||||
SetAutoCmp(Mode)
|
||||
lsp.setup()
|
||||
|
||||
-- configure diagnostic lsp err msgs
|
||||
vim.diagnostic.config({
|
||||
underline = true,
|
||||
virtual_text = true,
|
||||
float = {
|
||||
source = "always",
|
||||
focusable = false,
|
||||
},
|
||||
})
|
||||
|
||||
-- toggles floating error messages
|
||||
vim.keymap.set("n", "<space>e", "<cmd>lua vim.diagnostic.open_float()<CR>")
|
||||
|
||||
-- LSP Specific Settings
|
||||
-- require("mason-lspconfig").setup_handlers({}
|
||||
|
||||
-- Vue TypeScript Setup
|
||||
-- https://lsp-zero.netlify.app/blog/configure-volar-v2.html
|
||||
-- NOTE: Don't install volar through Mason, this is done manually:
|
||||
-- npm install -g @vue/language-server
|
||||
-- npm install -g @vue/typescript-plugin
|
||||
local vue_typescript_plugin = "/usr/lib/node_modules"
|
||||
.. "/usr/lib/node_modules/@vue/language-server"
|
||||
.. "/usr/lib/node_modules/@vue/typescript-plugin"
|
||||
|
||||
lspconfig.ts_ls.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",
|
||||
},
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
local function show_codeium_status()
|
||||
return "{…}" .. vim.fn["codeium#GetStatusString"]()
|
||||
end
|
||||
|
||||
require("lualine").setup({
|
||||
options = { theme = "nord" },
|
||||
sections = {
|
||||
lualine_x = {
|
||||
{
|
||||
show_codeium_status,
|
||||
cond = function()
|
||||
return vim.bo.filetype ~= "TelescopePrompt"
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
vim.g.mkdp_browser = "librewolf"
|
||||
vim.g.mkdp_theme = "dark"
|
||||
|
|
@ -1 +0,0 @@
|
|||
vim.opt.cursorcolumn = true
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
-- Create Default Mappings for NerdCommenter
|
||||
vim.g.NERDCreateDefaultMappings = 1
|
||||
-- Add spaces after NerdCommenter delimiters by default
|
||||
vim.g.NERDSpaceDelims = 1
|
||||
-- Enable Comments with Italics
|
||||
-- vim.cmd[[highlight Comment cterm=italic gui=italic]]
|
||||
|
|
@ -1,113 +0,0 @@
|
|||
-- 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
|
||||
|
||||
-- Automatically closes Nvim tree if last window open
|
||||
vim.cmd([[autocmd BufEnter * ++nested if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif]])
|
||||
|
|
@ -1 +0,0 @@
|
|||
vim.g.rainbow_active = 1
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
-- Enable use of ripgrep
|
||||
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,
|
||||
})
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
require("telescope").setup({
|
||||
extensions = {
|
||||
undo = {
|
||||
layout_strategy = "vertical",
|
||||
layout_config = {
|
||||
preview_height = 0.8,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
vim.g.undotree_DiffAutoOpen = 0
|
||||
vim.g.undotree_SetFocusWhenToggle = 1
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
-- Use experimental features of vim-smoothie (gg and G)
|
||||
vim.g.smoothie_experimental_mappings = 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue