🔧 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
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
require("neovim")
|
||||
require("config.lazy")
|
||||
vim.loader.enable()
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
"conform.nvim": { "branch": "master", "commit": "f9ef25a7ef00267b7d13bfc00b0dea22d78702d5" },
|
||||
"crates.nvim": { "branch": "main", "commit": "fd2bbca7aa588f24ffc3517831934b4c4a9588e9" },
|
||||
"ctrlp.vim": { "branch": "master", "commit": "564176f01d7f3f7f8ab452ff4e1f5314de7b0981" },
|
||||
"fzf": { "branch": "master", "commit": "ba6d1b8772ce5e75ff999dcca21c0fadb689d7bf" },
|
||||
"fzf.vim": { "branch": "master", "commit": "1fff637559f29d5edbdb05e03327954a8cd9e406" },
|
||||
"git-blame.nvim": { "branch": "master", "commit": "b12da2156ec1c3f53f42c129201ff0bfed69c86e" },
|
||||
"go.nvim": { "branch": "master", "commit": "0d426e87227dd14584881ecc595c173121456111" },
|
||||
|
|
@ -28,7 +29,7 @@
|
|||
"nvim-autopairs": { "branch": "master", "commit": "6522027785b305269fa17088395dfc0f456cedd2" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "1e1900b0769324a9675ef85b38f99cca29e203b3" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "d7c610491c4cbcd1dcd278eeecbab78814437bc4" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "0a1ac55d7d4ec2b2ed9616dfc5406791234d1d2b" },
|
||||
"nvim-ripgrep": { "branch": "main", "commit": "7a1b0a4da8858e3501b593c25d7ed66bc91a221d" },
|
||||
"nvim-silicon": { "branch": "main", "commit": "7f66bda8f60c97a5bf4b37e5b8acb0e829ae3c32" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "44d9b58f11d5a426c297aafd0be1c9d45617a849" },
|
||||
|
|
|
|||
|
|
@ -14,11 +14,13 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
|||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("neovim.remap")
|
||||
require("neovim.set")
|
||||
require("config.keymaps")
|
||||
require("config.options")
|
||||
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
|
||||
{ import = "plugins" },
|
||||
{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", event = "BufReadPost" },
|
||||
{ "nvim-treesitter/playground" },
|
||||
{
|
||||
|
|
@ -28,34 +30,22 @@ require("lazy").setup({
|
|||
end,
|
||||
},
|
||||
{ "preservim/nerdcommenter", event = "VeryLazy" },
|
||||
{ "nvim-lualine/lualine.nvim", event = "VeryLazy" },
|
||||
{ "kyazdani42/nvim-web-devicons", opt = true, event = "VeryLazy" },
|
||||
{ "kyazdani42/nvim-tree.lua", cmd = { "NvimTreeToggle" } },
|
||||
{ "psliwka/vim-smoothie", event = "VeryLazy" },
|
||||
{ "mg979/vim-visual-multi", keys = { "<C-j>", "<C-k>" } },
|
||||
{ "lukas-reineke/indent-blankline.nvim", event = "BufRead" },
|
||||
{ "mg979/vim-visual-multi" },
|
||||
{ "airblade/vim-gitgutter", event = "BufReadPre" },
|
||||
{ "f-person/git-blame.nvim", cmd = { "GitBlameToggle" } },
|
||||
{ "kkoomen/vim-doge", build = ":call doge#install()" },
|
||||
{ "norcalli/nvim-colorizer.lua", cmd = { "ColorizerToggle" } },
|
||||
{ "windwp/nvim-autopairs", event = "InsertEnter" },
|
||||
{ "simeji/winresizer" },
|
||||
{ "stevearc/conform.nvim" },
|
||||
{ "rhysd/vim-clang-format" },
|
||||
{ "sangdol/mintabline.vim" },
|
||||
{ "nvim-lua/plenary.nvim" },
|
||||
{ "ThePrimeagen/harpoon" },
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
tag = "0.1.0",
|
||||
},
|
||||
{ "tpope/vim-fugitive" },
|
||||
{ "tpope/vim-surround", keys = { "cs", "ds", "ys" } },
|
||||
{ "lambdalisue/suda.vim" },
|
||||
{ "junegunn/fzf" },
|
||||
{ "junegunn/fzf.vim" },
|
||||
{ "junegunn/gv.vim" },
|
||||
{ "kien/ctrlp.vim" },
|
||||
{ "rinx/nvim-ripgrep" },
|
||||
{ "mbbill/undotree", cmd = { "UndotreeToggle" } },
|
||||
{ "williamboman/mason.nvim", event = "VeryLazy" },
|
||||
{ "williamboman/mason-lspconfig.nvim", event = "VeryLazy" },
|
||||
|
|
@ -88,7 +78,6 @@ require("lazy").setup({
|
|||
{ "ray-x/guihua.lua" },
|
||||
-- rustlang
|
||||
{ "rust-lang/rust.vim" },
|
||||
{ "saecki/crates.nvim" },
|
||||
-- code snippet screenshots
|
||||
-- capture code snippets using :Silicon,
|
||||
-- in Visual mode highlight then enter command
|
||||
|
|
@ -40,6 +40,8 @@ vim.opt.cursorcolumn = true
|
|||
vim.opt.splitbelow = true
|
||||
vim.opt.splitright = true
|
||||
|
||||
vim.opt.cursorcolumn = true
|
||||
|
||||
-- Removes trailing spaces
|
||||
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
||||
pattern = { "*" },
|
||||
|
|
@ -112,6 +114,9 @@ vim.api.nvim_create_autocmd("BufReadPost", {
|
|||
end,
|
||||
})
|
||||
|
||||
-- Automatically closes Nvim tree if last window open
|
||||
vim.cmd([[autocmd BufEnter * ++nested if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif]])
|
||||
|
||||
-- turns off LSP semantic tokens by default
|
||||
-- vim.api.nvim_create_autocmd("LspAttach", {
|
||||
-- callback = function(args)
|
||||
|
|
@ -148,3 +153,23 @@ augroup END
|
|||
vim.g.codeium_disable_bindings = 1
|
||||
-- codeium enable(1)/disable(0) by default
|
||||
vim.g.codeium_enabled = 0
|
||||
|
||||
-- Markdown Previewer settings
|
||||
vim.g.mkdp_browser = "librewolf"
|
||||
vim.g.mkdp_theme = "dark"
|
||||
|
||||
-- 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]]
|
||||
|
||||
vim.g.rainbow_active = 1
|
||||
|
||||
-- UndoTree Settings
|
||||
vim.g.undotree_DiffAutoOpen = 0
|
||||
vim.g.undotree_SetFocusWhenToggle = 1
|
||||
|
||||
-- Vim Smoothie Settings
|
||||
vim.g.smoothie_experimental_mappings = 1
|
||||
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