Add Neovim config
This commit is contained in:
parent
72b5061523
commit
a6f768ee6a
26 changed files with 725 additions and 1 deletions
11
justfile
11
justfile
|
|
@ -9,7 +9,7 @@ _echowarning text:
|
||||||
@echo -e "{{ style("warning") }}{{ text }}{{ NORMAL }}"
|
@echo -e "{{ style("warning") }}{{ text }}{{ NORMAL }}"
|
||||||
|
|
||||||
# Full auto installation
|
# Full auto installation
|
||||||
full-auto: packages dev-setup fish-shell yazi-file-manager fastfetch
|
full-auto: packages dev-setup fish-shell nvim-editor yazi-file-manager fastfetch
|
||||||
|
|
||||||
# Fuller auto (graphical) installation
|
# Fuller auto (graphical) installation
|
||||||
full-auto-gui: full-auto kitty-terminal niri-window-manager
|
full-auto-gui: full-auto kitty-terminal niri-window-manager
|
||||||
|
|
@ -100,6 +100,15 @@ niri-window-manager:
|
||||||
@just _echowarning "\n3) Enabling GNOME display manager service"
|
@just _echowarning "\n3) Enabling GNOME display manager service"
|
||||||
sudo systemctl enable gdm
|
sudo systemctl enable gdm
|
||||||
|
|
||||||
|
# Neovim text editor
|
||||||
|
[group("essentials")]
|
||||||
|
nvim-editor:
|
||||||
|
@just _echowarning "1) Installing Neovim and related tools"
|
||||||
|
paru -S lazygit luarocks neovim tree-sitter
|
||||||
|
|
||||||
|
@just _echowarning "\n2) Stowing Neovim config"
|
||||||
|
stow nvim
|
||||||
|
|
||||||
[group("other")]
|
[group("other")]
|
||||||
syncthing-file-sync:
|
syncthing-file-sync:
|
||||||
@just _echowarning "1) Installing Syncthing"
|
@just _echowarning "1) Installing Syncthing"
|
||||||
|
|
|
||||||
4
nvim/.config/nvim/after/ftplugin/markdown.lua
Normal file
4
nvim/.config/nvim/after/ftplugin/markdown.lua
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
vim.opt_local.linebreak = true
|
||||||
|
vim.opt_local.spell = true
|
||||||
|
vim.opt_local.textwidth = 80
|
||||||
|
vim.opt_local.wrap = true
|
||||||
10
nvim/.config/nvim/init.lua
Normal file
10
nvim/.config/nvim/init.lua
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
-- load plugins
|
||||||
|
require("config.lazy")
|
||||||
|
|
||||||
|
-- load configs
|
||||||
|
require("config.autocmd")
|
||||||
|
require("config.keymaps")
|
||||||
|
require("config.options")
|
||||||
|
require("config.lsp")
|
||||||
|
|
||||||
|
|
||||||
27
nvim/.config/nvim/lazy-lock.json
Normal file
27
nvim/.config/nvim/lazy-lock.json
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"SchemaStore.nvim": { "branch": "main", "commit": "3b0d7d781589ce98ce577202d25d07741ffcf479" },
|
||||||
|
"barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" },
|
||||||
|
"blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" },
|
||||||
|
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||||
|
"gitsigns.nvim": { "branch": "main", "commit": "20ad4419564d6e22b189f6738116b38871082332" },
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "f0f5bbb9e5bfae5e6468f9359ffea3d151418176" },
|
||||||
|
"lazydev.nvim": { "branch": "main", "commit": "c2dfe354571a8255c5d3e96a9a4c297c89ce2347" },
|
||||||
|
"lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" },
|
||||||
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "3590d66effccc7376d8c3dbe45e8291f9fed2843" },
|
||||||
|
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
|
||||||
|
"mini.pairs": { "branch": "main", "commit": "b9aada8c0e59f2b938e98fbf4eae0799eba96ad9" },
|
||||||
|
"noice.nvim": { "branch": "main", "commit": "5099348591f7d3ba9e547b1e631c694c65bbe0b9" },
|
||||||
|
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "87d30189b24caa496b54affd65594a309ac6d929" },
|
||||||
|
"nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" },
|
||||||
|
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" },
|
||||||
|
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||||
|
"render-markdown.nvim": { "branch": "main", "commit": "10126effbafb74541b69219711dfb2c631e7ebf8" },
|
||||||
|
"snacks.nvim": { "branch": "main", "commit": "6ca541747c09962f87fc42b858249e4f9d2bbf2d" },
|
||||||
|
"todo-comments.nvim": { "branch": "main", "commit": "411503d3bedeff88484de572f2509c248e499b38" },
|
||||||
|
"tokyonight.nvim": { "branch": "main", "commit": "2642dbb83333e0575d1c3436e1d837926871c5fb" },
|
||||||
|
"trouble.nvim": { "branch": "main", "commit": "d7494d8bc563f8ae8b3f35d78c7478cf842b0ab9" },
|
||||||
|
"ts-comments.nvim": { "branch": "main", "commit": "123a9fb12e7229342f807ec9e6de478b1102b041" },
|
||||||
|
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||||
|
}
|
||||||
14
nvim/.config/nvim/lua/config/autocmd.lua
Normal file
14
nvim/.config/nvim/lua/config/autocmd.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
vim.api.nvim_create_autocmd("BufWritePost", {
|
||||||
|
desc = "Format buffer on write",
|
||||||
|
callback = function()
|
||||||
|
vim.lsp.buf.format()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||||
|
desc = "Highlight text on yank",
|
||||||
|
group = vim.api.nvim_create_augroup("kickstart-highlight-yank", { clear = true }),
|
||||||
|
callback = function()
|
||||||
|
vim.highlight.on_yank()
|
||||||
|
end,
|
||||||
|
})
|
||||||
36
nvim/.config/nvim/lua/config/keymaps.lua
Normal file
36
nvim/.config/nvim/lua/config/keymaps.lua
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
local opts = { noremap = true }
|
||||||
|
|
||||||
|
Snacks.keymap.set("n", "<leader>l", "<Cmd>Lazy<CR>", { desc = "Open Lazy menu" })
|
||||||
|
|
||||||
|
Snacks.keymap.set("n", "<C-d>", "<C-d>zz", { desc = "Move view down and center on line" })
|
||||||
|
Snacks.keymap.set("n", "<C-u>", "<C-u>zz", { desc = "Move view up and center on line" })
|
||||||
|
|
||||||
|
Snacks.keymap.set("n", "<C-h>", "<Cmd>wincmd h<CR>")
|
||||||
|
Snacks.keymap.set("n", "<C-j>", "<Cmd>wincmd j<CR>")
|
||||||
|
Snacks.keymap.set("n", "<C-k>", "<Cmd>wincmd k<CR>")
|
||||||
|
Snacks.keymap.set("n", "<C-l>", "<Cmd>wincmd l<CR>")
|
||||||
|
|
||||||
|
Snacks.keymap.set("v", "<", "<gv", opts)
|
||||||
|
Snacks.keymap.set("v", ">", ">gv", opts)
|
||||||
|
|
||||||
|
Snacks.keymap.set("n", "<Esc>", "<Cmd>nohl<CR>", { desc = "Clear search", silent = true })
|
||||||
|
|
||||||
|
Snacks.keymap.set("n", "<leader>y", '"+yy', { desc = "Copy line to system clipboard" })
|
||||||
|
Snacks.keymap.set("v", "<leader>y", '"+y', { desc = "Copy selection to system clipboard" })
|
||||||
|
Snacks.keymap.set("n", "<leader>Y", "<Cmd>%y +<CR>", { desc = "Copy buffer to system clipboard" })
|
||||||
|
Snacks.keymap.set("n", "<leader>p", '"+p', { desc = "Paste after from system clipboard" })
|
||||||
|
Snacks.keymap.set("n", "<leader>P", '"+P', { desc = "Paste before from system clipboard" })
|
||||||
|
|
||||||
|
Snacks.keymap.set("n", "<leader>f", vim.lsp.buf.format, { desc = "Format buffer" })
|
||||||
|
|
||||||
|
Snacks.keymap.set("n", "<leader>Q", "<Cmd>qa<CR>", { desc = "Quit Nvim" })
|
||||||
|
|
||||||
|
Snacks.keymap.set("n", "<leader>uh", function()
|
||||||
|
local enabled = vim.lsp.inlay_hint.is_enabled()
|
||||||
|
if enabled then
|
||||||
|
print("Disabling inlay hints")
|
||||||
|
else
|
||||||
|
print("Enabling inlay hints")
|
||||||
|
end
|
||||||
|
vim.lsp.inlay_hint.enable(not enabled)
|
||||||
|
end, { desc = "Toggle inlay hints" })
|
||||||
35
nvim/.config/nvim/lua/config/lazy.lua
Normal file
35
nvim/.config/nvim/lua/config/lazy.lua
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
-- 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
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
-- Make sure to setup `mapleader` and `maplocalleader` before
|
||||||
|
-- loading lazy.nvim so that mappings are correct.
|
||||||
|
-- This is also a good place to setup other settings (vim.opt)
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
vim.g.maplocalleader = "\\"
|
||||||
|
|
||||||
|
-- Setup lazy.nvim
|
||||||
|
require("lazy").setup({
|
||||||
|
spec = {
|
||||||
|
-- import your plugins
|
||||||
|
{ import = "plugins" },
|
||||||
|
},
|
||||||
|
-- Configure any other settings here. See the documentation for more details.
|
||||||
|
-- colorscheme that will be used when installing plugins.
|
||||||
|
install = { colorscheme = { "tokyonight" } },
|
||||||
|
-- automatically check for plugin updates
|
||||||
|
checker = { enabled = true },
|
||||||
|
})
|
||||||
90
nvim/.config/nvim/lua/config/lsp.lua
Normal file
90
nvim/.config/nvim/lua/config/lsp.lua
Normal file
|
|
@ -0,0 +1,90 @@
|
||||||
|
vim.diagnostic.config({
|
||||||
|
float = true,
|
||||||
|
virtual_lines = true,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- JSON
|
||||||
|
vim.lsp.config("jsonls", {
|
||||||
|
-- lazy-load schemastore when needed
|
||||||
|
before_init = function(_, new_config)
|
||||||
|
new_config.settings.json.schemas = new_config.settings.json.schemas or {}
|
||||||
|
vim.list_extend(new_config.settings.json.schemas, require("schemastore").json.schemas())
|
||||||
|
end,
|
||||||
|
settings = {
|
||||||
|
json = {
|
||||||
|
format = { enable = true },
|
||||||
|
validate = { enable = true },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Lua
|
||||||
|
vim.lsp.config("lua_ls", {
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
hint = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Python
|
||||||
|
vim.lsp.config("basedpyright", {
|
||||||
|
settings = {
|
||||||
|
basedpyright = {
|
||||||
|
analysis = {
|
||||||
|
inlayHints = {
|
||||||
|
callArgumentNamesMatching = true,
|
||||||
|
functionReturnTypes = true,
|
||||||
|
genericTypes = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.config("ruff", {
|
||||||
|
cmd_env = { RUFF_TRACE = "messages" },
|
||||||
|
init_options = {
|
||||||
|
settings = {
|
||||||
|
logLevel = "error",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- YAML
|
||||||
|
vim.lsp.config("yamlls", {
|
||||||
|
-- Have to add this for yamlls to understand that we support line folding
|
||||||
|
capabilities = {
|
||||||
|
textDocument = {
|
||||||
|
foldingRange = {
|
||||||
|
dynamicRegistration = false,
|
||||||
|
lineFoldingOnly = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- lazy-load schemastore when needed
|
||||||
|
before_init = function(_, new_config)
|
||||||
|
new_config.settings.yaml.schemas = vim.tbl_deep_extend(
|
||||||
|
"force",
|
||||||
|
new_config.settings.yaml.schemas or {},
|
||||||
|
require("schemastore").yaml.schemas()
|
||||||
|
)
|
||||||
|
end,
|
||||||
|
settings = {
|
||||||
|
redhat = { telemetry = { enabled = false } },
|
||||||
|
yaml = {
|
||||||
|
keyOrdering = false,
|
||||||
|
format = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
validate = true,
|
||||||
|
schemaStore = {
|
||||||
|
-- Must disable built-in schemaStore support to use
|
||||||
|
-- schemas from SchemaStore.nvim plugin
|
||||||
|
enable = false,
|
||||||
|
-- Avoid TypeError: Cannot read properties of undefined (reading 'length')
|
||||||
|
url = "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
45
nvim/.config/nvim/lua/config/options.lua
Normal file
45
nvim/.config/nvim/lua/config/options.lua
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
vim.g.editorconfig = true -- respect editorconfig files
|
||||||
|
vim.g.snacks_animate = false -- disable snacks.nvim animations
|
||||||
|
|
||||||
|
-- appearance
|
||||||
|
vim.opt.background = "dark" --
|
||||||
|
vim.opt.colorcolumn = "80" -- highlight column 80
|
||||||
|
vim.opt.cursorline = true -- highlight line the cursor is on
|
||||||
|
vim.opt.number = true -- enable line numbers
|
||||||
|
vim.opt.signcolumn = "yes" -- prevent constant shifting when LSP is enabled
|
||||||
|
vim.opt.scrolloff = 8 -- add 8 rows of padding when scrolling
|
||||||
|
vim.opt.termguicolors = true --
|
||||||
|
|
||||||
|
-- files
|
||||||
|
vim.opt.backup = false -- disable backups
|
||||||
|
vim.opt.swapfile = false -- disable swapping
|
||||||
|
vim.opt.undofile = true -- enable persistent undo
|
||||||
|
|
||||||
|
-- indents
|
||||||
|
vim.opt.autoindent = true --
|
||||||
|
vim.opt.expandtab = true -- use spaces when pressing tab
|
||||||
|
vim.opt.shiftwidth = 4 --
|
||||||
|
vim.opt.smartindent = true -- improve indenting
|
||||||
|
vim.opt.softtabstop = 4 --
|
||||||
|
vim.opt.tabstop = 4 -- indent with 4 spaces
|
||||||
|
|
||||||
|
-- inputs
|
||||||
|
vim.g.clipboard = "wl-copy" -- use wayland wl-copy for clipboard
|
||||||
|
vim.opt.backspace = { "eol", "indent", "start" } -- improve backspace
|
||||||
|
vim.opt.mouse = "a" -- enable mouse in all modes
|
||||||
|
vim.opt.updatetime = 100 -- reduce latency
|
||||||
|
|
||||||
|
-- search
|
||||||
|
vim.opt.hlsearch = true --
|
||||||
|
vim.opt.ignorecase = true -- ignore case when searching
|
||||||
|
vim.opt.inccommand = "split" -- preview substitutions in a split
|
||||||
|
vim.opt.incsearch = true -- preview searches while typing
|
||||||
|
vim.opt.smartcase = true -- don't ignore case when capitals are used
|
||||||
|
|
||||||
|
-- splits
|
||||||
|
vim.opt.splitbelow = true -- vertical splits open below
|
||||||
|
vim.opt.splitright = true -- horizontal splits open to the right
|
||||||
|
|
||||||
|
-- wrapping
|
||||||
|
vim.opt.wrap = false -- wrapping disabled
|
||||||
|
vim.opt.showbreak = "> " -- indicate when a line is wrapped
|
||||||
42
nvim/.config/nvim/lua/plugins/barbar.lua
Normal file
42
nvim/.config/nvim/lua/plugins/barbar.lua
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
return {
|
||||||
|
"romgrk/barbar.nvim",
|
||||||
|
version = "^1.0.0",
|
||||||
|
lazy = false,
|
||||||
|
init = function() vim.g.barbar_auto_setup = false end,
|
||||||
|
keys = {
|
||||||
|
-- move to previous/next
|
||||||
|
{ "<A-,>", "<Cmd>BufferPrevious<CR>", noremap = true, silent = true },
|
||||||
|
{ "<A-.>", "<Cmd>BufferNext<CR>", noremap = true, silent = true },
|
||||||
|
-- reorder to previous/next
|
||||||
|
{ "<A-s-,>", "<Cmd>BufferMovePrevious<CR>", noremap = true, silent = true },
|
||||||
|
{ "<A-s-.>", "<Cmd>BufferMoveNext<CR>", noremap = true, silent = true },
|
||||||
|
-- move to buffer at position
|
||||||
|
{ "<A-1>", "<Cmd>BufferGoto 1<CR>", noremap = true, silent = true },
|
||||||
|
{ "<A-2>", "<Cmd>BufferGoto 2<CR>", noremap = true, silent = true },
|
||||||
|
{ "<A-3>", "<Cmd>BufferGoto 3<CR>", noremap = true, silent = true },
|
||||||
|
{ "<A-4>", "<Cmd>BufferGoto 4<CR>", noremap = true, silent = true },
|
||||||
|
{ "<A-5>", "<Cmd>BufferGoto 5<CR>", noremap = true, silent = true },
|
||||||
|
{ "<A-6>", "<Cmd>BufferGoto 6<CR>", noremap = true, silent = true },
|
||||||
|
{ "<A-7>", "<Cmd>BufferGoto 7<CR>", noremap = true, silent = true },
|
||||||
|
{ "<A-8>", "<Cmd>BufferGoto 8<CR>", noremap = true, silent = true },
|
||||||
|
{ "<A-9>", "<Cmd>BufferGoto 9<CR>", noremap = true, silent = true },
|
||||||
|
{ "<A-0>", "<Cmd>BufferLast<CR>", noremap = true, silent = true },
|
||||||
|
-- close buffer
|
||||||
|
{ "<A-c>", "<Cmd>BufferClose<CR>", noremap = true, silent = true },
|
||||||
|
-- picking mode
|
||||||
|
{ "<C-p>", "<Cmd>BufferPick<CR>", noremap = true, silent = true },
|
||||||
|
{ "<C-s-p>", "<Cmd>BufferPickDelete<CR>", noremap = true, silent = true },
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
animation = false,
|
||||||
|
tabpages = true,
|
||||||
|
focus_on_close = "previous",
|
||||||
|
sidebar_filetypes = {
|
||||||
|
NvimTree = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
dependencies = {
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
},
|
||||||
|
}
|
||||||
33
nvim/.config/nvim/lua/plugins/blink-cmp.lua
Normal file
33
nvim/.config/nvim/lua/plugins/blink-cmp.lua
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
return {
|
||||||
|
'saghen/blink.cmp',
|
||||||
|
version = '1.*',
|
||||||
|
--- @module 'blink.cmp'
|
||||||
|
--- @type blink.cmp.Cnfig
|
||||||
|
opts = {
|
||||||
|
-- C-space: Open menu or open docs if already open
|
||||||
|
-- C-n/C-p or Up/Down: Select next/previous item
|
||||||
|
-- C-e: Hide menu
|
||||||
|
-- C-k: Toggle signature help (if signature.enabled = true)
|
||||||
|
keymap = { preset = 'super-tab' },
|
||||||
|
|
||||||
|
appearance = {
|
||||||
|
-- Adjusts spacing to ensure icons are aligned
|
||||||
|
nerd_font_variant = 'normal'
|
||||||
|
},
|
||||||
|
|
||||||
|
signature = { enabled = true },
|
||||||
|
|
||||||
|
sources = {
|
||||||
|
default = { 'lsp', 'path', 'snippets', 'buffer' },
|
||||||
|
},
|
||||||
|
|
||||||
|
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
|
||||||
|
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
|
||||||
|
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
|
||||||
|
--
|
||||||
|
-- See the fuzzy documentation for more information
|
||||||
|
fuzzy = { implementation = "prefer_rust_with_warning" }
|
||||||
|
},
|
||||||
|
opts_extend = { "sources.default" },
|
||||||
|
dependencies = { 'rafamadriz/friendly-snippets' },
|
||||||
|
}
|
||||||
14
nvim/.config/nvim/lua/plugins/colorscheme.lua
Normal file
14
nvim/.config/nvim/lua/plugins/colorscheme.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"folke/tokyonight.nvim",
|
||||||
|
lazy = false, -- make sure we load this during startup if it is your main colorscheme
|
||||||
|
priority = 1000, -- make sure to load this before all the other start plugins
|
||||||
|
opts = {
|
||||||
|
transparent = true,
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("tokyonight").setup(opts)
|
||||||
|
vim.cmd([[colorscheme tokyonight]])
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
}
|
||||||
32
nvim/.config/nvim/lua/plugins/gitsigns.lua
Normal file
32
nvim/.config/nvim/lua/plugins/gitsigns.lua
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
return {
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
|
opts = {
|
||||||
|
on_attach = function()
|
||||||
|
local gs = package.loaded.gitsigns
|
||||||
|
local map = Snacks.keymap.set
|
||||||
|
|
||||||
|
map("n", "<leader>gs", gs.stage_hunk, { desc = "Stage hunk" })
|
||||||
|
map("v", "<leader>gs", function()
|
||||||
|
gs.stage_hunk({ vim.fn.line("."), vim.fn.line(".") })
|
||||||
|
end, { desc = "Stage hunk" })
|
||||||
|
map("n", "<leader>gr", gs.reset_hunk, { desc = "Reset hunk" })
|
||||||
|
map("v", "<leader>gr", function()
|
||||||
|
gs.reset_hunk({ vim.fn.line("."), vim.fn.line(".") })
|
||||||
|
end, { desc = "Reset hunk" })
|
||||||
|
map("n", "<leader>gu", gs.undo_stage_hunk, { desc = "Undo stage hunk" })
|
||||||
|
|
||||||
|
map("n", "<leader>gS", gs.stage_buffer, { desc = "Stage buffer" })
|
||||||
|
map("n", "<leader>gR", gs.reset_buffer, { desc = "Reset buffer" })
|
||||||
|
|
||||||
|
map("n", "<leader>gp", gs.preview_hunk, { desc = "Preview hunk" })
|
||||||
|
map("n", "<leader>gbl", function() gs.blame_line({ full = true }) end, { desc = "Blame line" })
|
||||||
|
map("n", "<leader>gB", gs.toggle_current_line_blame, { desc = "Toggle line blame" })
|
||||||
|
|
||||||
|
map("n", "<leader>gd", gs.diffthis, { dsc = "Diff this" })
|
||||||
|
map("n", "<leader>gD", function() gs.diffthis("~") end, { desc = "Diff this ~" })
|
||||||
|
map("n", "]h", gs.next_hunk, { desc = "Next hunk" })
|
||||||
|
map("n", "[h", gs.prev_hunk, { desc = "Previous hunk" })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
12
nvim/.config/nvim/lua/plugins/lazydev.lua
Normal file
12
nvim/.config/nvim/lua/plugins/lazydev.lua
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
return {
|
||||||
|
"folke/lazydev.nvim",
|
||||||
|
ft = "lua",
|
||||||
|
cmd = "LazyDev",
|
||||||
|
opts = {
|
||||||
|
library = {
|
||||||
|
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
||||||
|
{ path = "snacks.nvim", words = { "Snacks" } },
|
||||||
|
{ path = "lazy.nvim", words = { "LazyVim" } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
5
nvim/.config/nvim/lua/plugins/lualine.lua
Normal file
5
nvim/.config/nvim/lua/plugins/lualine.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
return {
|
||||||
|
'nvim-lualine/lualine.nvim',
|
||||||
|
opts = {},
|
||||||
|
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||||
|
}
|
||||||
66
nvim/.config/nvim/lua/plugins/mason-lspconfig.lua
Normal file
66
nvim/.config/nvim/lua/plugins/mason-lspconfig.lua
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
return {
|
||||||
|
"mason-org/mason-lspconfig.nvim",
|
||||||
|
opts = {},
|
||||||
|
dependencies = {
|
||||||
|
{
|
||||||
|
"mason-org/mason.nvim",
|
||||||
|
keys = {
|
||||||
|
{ "<leader>m", "<Cmd>Mason<CR>", desc = "Open mason" }
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("mason").setup()
|
||||||
|
|
||||||
|
local lsps = {
|
||||||
|
-- Docker
|
||||||
|
"docker-compose-language-service",
|
||||||
|
"dockerfile-language-server",
|
||||||
|
-- HTML
|
||||||
|
"emmet-language-server",
|
||||||
|
"html-lsp",
|
||||||
|
-- JavaScript
|
||||||
|
"eslint-lsp",
|
||||||
|
-- JSON
|
||||||
|
"json-lsp",
|
||||||
|
-- Lua
|
||||||
|
"lua-language-server",
|
||||||
|
-- Markdown
|
||||||
|
"markdownlint-cli2",
|
||||||
|
"marksman",
|
||||||
|
-- Python
|
||||||
|
"basedpyright",
|
||||||
|
"ruff",
|
||||||
|
-- Rust
|
||||||
|
"rust-analyzer",
|
||||||
|
-- TOML
|
||||||
|
"taplo",
|
||||||
|
-- YAML
|
||||||
|
"yaml-language-server",
|
||||||
|
}
|
||||||
|
|
||||||
|
-- automatically install required LSPs at startup
|
||||||
|
local mr = require("mason-registry")
|
||||||
|
mr.refresh(function()
|
||||||
|
for _, value in ipairs(lsps) do
|
||||||
|
local p = mr.get_package(value)
|
||||||
|
if not p:is_installed() and p:is_installable() then
|
||||||
|
print("Installing LSP: " .. value)
|
||||||
|
p:install(nil, function(success, receipt)
|
||||||
|
if success then
|
||||||
|
print("Installed LSP: " .. receipt.name)
|
||||||
|
else
|
||||||
|
error("Failed to install LSP: " .. value)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
{
|
||||||
|
"b0o/SchemaStore.nvim",
|
||||||
|
lazy = true,
|
||||||
|
version = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
18
nvim/.config/nvim/lua/plugins/mini.lua
Normal file
18
nvim/.config/nvim/lua/plugins/mini.lua
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"nvim-mini/mini.pairs",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = {
|
||||||
|
modes = { insert = true, command = true, terminal = false },
|
||||||
|
-- skip autopair when next character is one of these
|
||||||
|
skip_next = [=[[%w%%%'%[%"%.%`%$]]=],
|
||||||
|
-- skip autopair when the cursor is inside these treesitter nodes
|
||||||
|
skip_ts = { "string" },
|
||||||
|
-- skip autopair when next character is closing pair
|
||||||
|
-- and there are more closing pairs than opening pairs
|
||||||
|
skip_unbalanced = true,
|
||||||
|
-- better deal with markdown code blocks
|
||||||
|
markdown = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
28
nvim/.config/nvim/lua/plugins/noice.lua
Normal file
28
nvim/.config/nvim/lua/plugins/noice.lua
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
return {
|
||||||
|
"folke/noice.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = {
|
||||||
|
lsp = {
|
||||||
|
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
||||||
|
override = {
|
||||||
|
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||||
|
["vim.lsp.util.stylize_markdown"] = true,
|
||||||
|
["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
|
||||||
|
},
|
||||||
|
},
|
||||||
|
presets = {
|
||||||
|
command_palette = true, -- position the cmdline and popupmenu together
|
||||||
|
long_message_to_split = true, -- long messages will be sent to a split
|
||||||
|
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
||||||
|
lsp_doc_border = false, -- add a border to hover docs and signature help
|
||||||
|
},
|
||||||
|
},
|
||||||
|
dependencies = {
|
||||||
|
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
|
||||||
|
"MunifTanjim/nui.nvim",
|
||||||
|
-- OPTIONAL:
|
||||||
|
-- `nvim-notify` is only needed, if you want to use the notification view.
|
||||||
|
-- If not available, we use `mini` as the fallback
|
||||||
|
"rcarriga/nvim-notify",
|
||||||
|
}
|
||||||
|
}
|
||||||
41
nvim/.config/nvim/lua/plugins/nvim-treesitter.lua
Normal file
41
nvim/.config/nvim/lua/plugins/nvim-treesitter.lua
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
return {
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
branch = "master",
|
||||||
|
lazy = false,
|
||||||
|
build = ":TSUpdate",
|
||||||
|
opts = {
|
||||||
|
ensure_installed = {
|
||||||
|
"bash",
|
||||||
|
"comment",
|
||||||
|
"css",
|
||||||
|
"csv",
|
||||||
|
"diff",
|
||||||
|
"dockerfile",
|
||||||
|
"git_rebase",
|
||||||
|
"gitignore",
|
||||||
|
"html",
|
||||||
|
"ini",
|
||||||
|
"javascript",
|
||||||
|
"json5",
|
||||||
|
"just",
|
||||||
|
"kdl",
|
||||||
|
"lua",
|
||||||
|
"markdown",
|
||||||
|
"markdown_inline",
|
||||||
|
"ninja",
|
||||||
|
"printf",
|
||||||
|
"python",
|
||||||
|
"rst",
|
||||||
|
"rust",
|
||||||
|
"toml",
|
||||||
|
"typescript",
|
||||||
|
"vim",
|
||||||
|
"xml",
|
||||||
|
"yaml",
|
||||||
|
},
|
||||||
|
auto_install = true,
|
||||||
|
fold = {enable=true},
|
||||||
|
indent = {enable=true},
|
||||||
|
highlight = {enable = true},
|
||||||
|
},
|
||||||
|
}
|
||||||
3
nvim/.config/nvim/lua/plugins/plenary.lua
Normal file
3
nvim/.config/nvim/lua/plugins/plenary.lua
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
return {
|
||||||
|
"nvim-lua/plenary.nvim"
|
||||||
|
}
|
||||||
26
nvim/.config/nvim/lua/plugins/render-markdown.lua
Normal file
26
nvim/.config/nvim/lua/plugins/render-markdown.lua
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
return {
|
||||||
|
"MeanderingProgrammer/render-markdown.nvim",
|
||||||
|
opts = {
|
||||||
|
completions = { lsp = { enabled = true } },
|
||||||
|
heading = {
|
||||||
|
enabled = true,
|
||||||
|
sign = false,
|
||||||
|
position = "inline",
|
||||||
|
},
|
||||||
|
paragraph = { enabled = true },
|
||||||
|
code = {
|
||||||
|
enabled = true,
|
||||||
|
sign = false,
|
||||||
|
},
|
||||||
|
dash = { enabled = true },
|
||||||
|
bullet = { enabled = true },
|
||||||
|
checkbox = { enabled = true },
|
||||||
|
quote = {enabled=true},
|
||||||
|
pipe_table = {enabled=true},
|
||||||
|
link = {enabled=true},
|
||||||
|
},
|
||||||
|
dependencies = {
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
"nvim-tree/nvim-web-devicons"
|
||||||
|
},
|
||||||
|
}
|
||||||
55
nvim/.config/nvim/lua/plugins/snacks.lua
Normal file
55
nvim/.config/nvim/lua/plugins/snacks.lua
Normal file
|
|
@ -0,0 +1,55 @@
|
||||||
|
return {
|
||||||
|
"folke/snacks.nvim",
|
||||||
|
lazy = false,
|
||||||
|
prioerity = 1000,
|
||||||
|
opts = {
|
||||||
|
bigfile = { enabled = true },
|
||||||
|
explorer = {
|
||||||
|
replace_netrw = true, -- Replace netrw with the snacks explorer
|
||||||
|
trash = true, -- Use the system trash when deleting files
|
||||||
|
},
|
||||||
|
indent = { enabled = true },
|
||||||
|
input = { enabled = true },
|
||||||
|
notifier = { enabled = true },
|
||||||
|
picker = {
|
||||||
|
enabled = true,
|
||||||
|
matchers = {
|
||||||
|
cwd_bonus = true,
|
||||||
|
frequency = true,
|
||||||
|
},
|
||||||
|
sources = {
|
||||||
|
explorer = {
|
||||||
|
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
scope = { enabled = true },
|
||||||
|
scroll = { enabled = true },
|
||||||
|
statuscolumn = { enabled = false }, -- we set this in options.lua
|
||||||
|
words = { enabled = true },
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>n",
|
||||||
|
function()
|
||||||
|
Snacks.picker.notifications()
|
||||||
|
end,
|
||||||
|
desc = "Notification History"
|
||||||
|
},
|
||||||
|
{ "<leader>un", function() Snacks.notifier.hide() end, desc = "Dismiss All Notifications" },
|
||||||
|
|
||||||
|
{ "<leader>,", function() Snacks.picker.buffers() end, desc = "Buffers" },
|
||||||
|
{ "<leader>/", function() Snacks.picker.grep() end, desc = "Grep" },
|
||||||
|
{ "<leader>W", function() Snacks.picker.grep_word() end, desc = "Grep word" },
|
||||||
|
{ "<leader>:", function() Snacks.picker.command_history() end, desc = "Command History" },
|
||||||
|
{ "<leader>n", function() Snacks.picker.notifications() end, desc = "Notification History" },
|
||||||
|
{ "<leader>e", function() Snacks.explorer() end, desc = "File Explorer" },
|
||||||
|
{ "<leader>C", function() Snacks.picker.files({ cwd = vim.fn.stdpath("config") }) end, desc = "Open config files" },
|
||||||
|
{ "<leader>h", function() Snacks.picker.help() end, desc = "Help" },
|
||||||
|
|
||||||
|
{ "<leader>lg", function() Snacks.lazygit() end, desc = "Open Lazygit" },
|
||||||
|
{ "<leader>gl", function() Snacks.lazygit.log() end, desc = "Open git log in Lazygit" },
|
||||||
|
|
||||||
|
{ "<leader>dB", function() Snacks.bufdelete() end, desc = "Delete buffer" }
|
||||||
|
},
|
||||||
|
}
|
||||||
13
nvim/.config/nvim/lua/plugins/todo-comments.lua
Normal file
13
nvim/.config/nvim/lua/plugins/todo-comments.lua
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
return {
|
||||||
|
"folke/todo-comments.nvim",
|
||||||
|
cmd = { "TodoTrouble", "TodoTelescope" },
|
||||||
|
opts = {},
|
||||||
|
keys = {
|
||||||
|
{ "]t", function() require("todo-comments").jump_next() end, desc = "Next Todo Comment" },
|
||||||
|
{ "[t", function() require("todo-comments").jump_prev() end, desc = "Previous Todo Comment" },
|
||||||
|
{ "<leader>xt", "<cmd>Trouble todo toggle<cr>", desc = "Todo (Trouble)" },
|
||||||
|
{ "<leader>xT", "<cmd>Trouble todo toggle filter = {tag = {TODO,FIX,FIXME}}<cr>", desc = "Todo/Fix/Fixme (Trouble)" },
|
||||||
|
{ "<leader>st", "<cmd>TodoTelescope<cr>", desc = "Todo" },
|
||||||
|
{ "<leader>sT", "<cmd>TodoTelescope keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme" },
|
||||||
|
},
|
||||||
|
}
|
||||||
47
nvim/.config/nvim/lua/plugins/trouble.lua
Normal file
47
nvim/.config/nvim/lua/plugins/trouble.lua
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
return {
|
||||||
|
"folke/trouble.nvim",
|
||||||
|
cmd = { "Trouble" },
|
||||||
|
opts = {
|
||||||
|
modes = {
|
||||||
|
lsp = {
|
||||||
|
win = { position = "right" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{ "<leader>xx", "<cmd>Trouble diagnostics toggle<cr>", desc = "Diagnostics (Trouble)" },
|
||||||
|
{ "<leader>xX", "<cmd>Trouble diagnostics toggle filter.buf=0<cr>", desc = "Buffer Diagnostics (Trouble)" },
|
||||||
|
{ "<leader>cs", "<cmd>Trouble symbols toggle<cr>", desc = "Symbols (Trouble)" },
|
||||||
|
{ "<leader>cS", "<cmd>Trouble lsp toggle<cr>", desc = "LSP references/definitions/... (Trouble)" },
|
||||||
|
{ "<leader>xL", "<cmd>Trouble loclist toggle<cr>", desc = "Location List (Trouble)" },
|
||||||
|
{ "<leader>xQ", "<cmd>Trouble qflist toggle<cr>", desc = "Quickfix List (Trouble)" },
|
||||||
|
{
|
||||||
|
"[q",
|
||||||
|
function()
|
||||||
|
if require("trouble").is_open() then
|
||||||
|
require("trouble").prev({ skip_groups = true, jump = true })
|
||||||
|
else
|
||||||
|
local ok, err = pcall(vim.cmd.cprev)
|
||||||
|
if not ok then
|
||||||
|
vim.notify(err, vim.log.levels.ERROR)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
desc = "Previous Trouble/Quickfix Item",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"]q",
|
||||||
|
function()
|
||||||
|
if require("trouble").is_open() then
|
||||||
|
require("trouble").next({ skip_groups = true, jump = true })
|
||||||
|
else
|
||||||
|
local ok, err = pcall(vim.cmd.cnext)
|
||||||
|
if not ok then
|
||||||
|
vim.notify(err, vim.log.levels.ERROR)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
desc = "Next Trouble/Quickfix Item",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
5
nvim/.config/nvim/lua/plugins/ts-comments.lua
Normal file
5
nvim/.config/nvim/lua/plugins/ts-comments.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
return {
|
||||||
|
"folke/ts-comments.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = {},
|
||||||
|
}
|
||||||
14
nvim/.config/nvim/lua/plugins/which-key.lua
Normal file
14
nvim/.config/nvim/lua/plugins/which-key.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
return {
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = {},
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>?",
|
||||||
|
function()
|
||||||
|
require("which-key").show({ global = false })
|
||||||
|
end,
|
||||||
|
desc = "Buffer Local Keymaps (which-key)",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue