mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-26 11:14:08 +00:00
feat(nvim): Switched to LazyVim with tweaks
This commit is contained in:
9
config/nvim/.gitignore
vendored
9
config/nvim/.gitignore
vendored
@@ -1 +1,8 @@
|
||||
session.vim
|
||||
tt.*
|
||||
.tests
|
||||
doc/tags
|
||||
debug
|
||||
.repro
|
||||
foo.*
|
||||
*.log
|
||||
data
|
||||
|
||||
15
config/nvim/.neoconf.json
Normal file
15
config/nvim/.neoconf.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"neodev": {
|
||||
"library": {
|
||||
"enabled": true,
|
||||
"plugins": true
|
||||
}
|
||||
},
|
||||
"neoconf": {
|
||||
"plugins": {
|
||||
"lua_ls": {
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
column_width = 160
|
||||
line_endings = "Unix"
|
||||
indent_type = "Spaces"
|
||||
indent_width = 2
|
||||
quote_style = "AutoPreferDouble"
|
||||
call_parentheses = "Always"
|
||||
collapse_simple_statement = "Always"
|
||||
|
||||
[sort_requires]
|
||||
enabled = true
|
||||
4
config/nvim/README.md
Normal file
4
config/nvim/README.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# 💤 LazyVim
|
||||
|
||||
A starter template for [LazyVim](https://github.com/LazyVim/LazyVim).
|
||||
Refer to the [documentation](https://lazyvim.github.io/installation) to get started.
|
||||
@@ -1 +0,0 @@
|
||||
vim.api.nvim_command("set formatoptions-=cro")
|
||||
@@ -1,31 +1,2 @@
|
||||
-- luacheck: globals vim
|
||||
local key = vim.api.nvim_set_keymap
|
||||
local remap = { noremap = true, silent = true }
|
||||
|
||||
-- Set with normal Vim opts, 'Space' as mapleader
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
-- Set 'Space' as <NOP> key to leadermap key
|
||||
key("n", "<Space>", "<NOP>", remap)
|
||||
|
||||
-- Global, windows options of neovim:
|
||||
require("options")
|
||||
|
||||
-- Filetype specialties.
|
||||
require("filetype")
|
||||
|
||||
-- To adminstrate packages:
|
||||
require("plugin-manager")
|
||||
|
||||
-- LSP for editing.
|
||||
require("lsp")
|
||||
|
||||
-- Autocmd commands from Vimscript
|
||||
require("autocmd")
|
||||
|
||||
-- Personal Keymaps of neovim:
|
||||
require("keymappings")
|
||||
|
||||
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
-- bootstrap lazy.nvim, LazyVim and your plugins
|
||||
require("config.lazy")
|
||||
|
||||
@@ -1,52 +1,62 @@
|
||||
{
|
||||
"barbecue.nvim": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" },
|
||||
"LazyVim": { "branch": "main", "commit": "a72a84972d85e5bbc6b9d60a0983b37efef21b8a" },
|
||||
"LuaSnip": { "branch": "master", "commit": "ea7d7ea510c641c4f15042becd27f35b3e5b3c2b" },
|
||||
"SchemaStore.nvim": { "branch": "main", "commit": "0305d00d4e9fd9ed643432b488c51d8002e17c28" },
|
||||
"alpha-nvim": { "branch": "main", "commit": "234822140b265ec4ba3203e3e0be0e0bb826dff5" },
|
||||
"bufdelete.nvim": { "branch": "master", "commit": "07d1f8ba79dec59d42b975a4df1c732b2e4e37b4" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "9961d87bb3ec008213c46ba14b3f384a5f520eb5" },
|
||||
"catppuccin": { "branch": "main", "commit": "85e93601e0f0b48aa2c6bbfae4d0e9d7a1898280" },
|
||||
"close-buffers.nvim": { "branch": "master", "commit": "3acbcad1211572342632a6c0151f839e7dead27f" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
|
||||
"comment-box.nvim": { "branch": "main", "commit": "dd1a48f8d06102e9b87ae1e0069bc365c006979b" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "c1e1d5fa44fe08811b6ef4aadac2b50e602f9504" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "89b633f3bd0b7187f070236b348697de176860e2" },
|
||||
"flash.nvim": { "branch": "main", "commit": "8a8e74922a383c253b7f92e042b749150140c8d1" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "ebf6d6e83494cdd88a54a429340256f4dbb6a052" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "907ae8636016aab2f283576fc60d46ca3427e579" },
|
||||
"harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "2a9354c7d2368d78cbd5575a51a2af5bd8a6ad01" },
|
||||
"lspkind-nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "dfdd771b792fbb4bad8e057d72558255695aa1a7" },
|
||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "6148b51db945b55b3b725da39eaea6441e59dff8" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "9637670896b68805430e2f72cf5d16be5b97a22a" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "3ad55ae678876516156cca2f361c51f7952a924b" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "f014db32437aa61c86fc0ef1067cd2bc6a37205c" },
|
||||
"mason.nvim": { "branch": "main", "commit": "d66c60e17dd6fd8165194b1d14d21f7eb2c1697a" },
|
||||
"mini.nvim": { "branch": "main", "commit": "707dca4f4152c2d9c9b4c5e02635f78dfd33db50" },
|
||||
"neo-tree.nvim": { "branch": "v2.x", "commit": "80dc74d081823649809f78370fa5b204aa9a853a" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "dcd34653b0f1d3e7ea9aeb3e37dc7c8da445c4fe" },
|
||||
"mini.ai": { "branch": "main", "commit": "7ae226f331885e6f30e9a8229e113debc59308ae" },
|
||||
"mini.animate": { "branch": "main", "commit": "230140aa0b06af87c9d345573aab1aaf50d8b539" },
|
||||
"mini.bufremove": { "branch": "main", "commit": "7821606e35c1ac931b56d8e3155f45ffe76ee7e5" },
|
||||
"mini.comment": { "branch": "main", "commit": "877acea5b2a32ff55f808fc0ebe9aa898648318c" },
|
||||
"mini.indentscope": { "branch": "main", "commit": "f60e9b51a6214c73a170ffc5445ce91560981031" },
|
||||
"mini.pairs": { "branch": "main", "commit": "dfa9f6e2576bb8853be277d96b735af59d9be7c2" },
|
||||
"mini.surround": { "branch": "main", "commit": "9d1956b576d7051da3a483b251dfc778121c60db" },
|
||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "2d89ca96e08eb6e9c8e50e1bb4738bc5125c9f12" },
|
||||
"neoconf.nvim": { "branch": "main", "commit": "06afabe121ec01784e7c4da20340a338ae78f7c7" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "471324e6c746284dbbdc1d357799d1911bb7e120" },
|
||||
"neogen": { "branch": "main", "commit": "cb1f384df804c1bf729332c4f728253fe17962d4" },
|
||||
"noice.nvim": { "branch": "main", "commit": "74c2902146b080035beb19944baf6f014a954720" },
|
||||
"nui.nvim": { "branch": "main", "commit": "c8de23342caf8d50b15d6b28368d36a56a69d76f" },
|
||||
"null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
|
||||
"nvim-dap": { "branch": "master", "commit": "0e6b7c47dd70e80793ed39271b2aa712d9366dbc" },
|
||||
"nvim-dap-go": { "branch": "main", "commit": "1b508e9db330108d3b5d62a6d9cc01fe6bbdd4e0" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "34160a7ce6072ef332f350ae1d4a6a501daf0159" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "360a895125ac4f39df6aa8f763635eff07e69fff" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "cc388d3f6b9c7c943ae2b2dcd46ad470fd257f91" },
|
||||
"nvim-navic": { "branch": "master", "commit": "9c89730da6a05acfeb6a197e212dfadf5aa60ca0" },
|
||||
"nvim-notify": { "branch": "master", "commit": "94859430020f5cf32a1b97ddd9e596fed9db7981" },
|
||||
"nvim-regexplainer": { "branch": "main", "commit": "4250c8f3c1307876384e70eeedde5149249e154f" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "2461e5ac21c59950457fea4b3f9f184f0daa8913" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "b6c763db8cc486215ba96e0a67418848a710ab25" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "925e2aa30dc9fe9332060199c19f132ec0f3d493" },
|
||||
"nvim-window-picker": { "branch": "main", "commit": "1b1bb834b0acb9eebb11a61664efc665757f1ba2" },
|
||||
"nvim-spectre": { "branch": "master", "commit": "97cfd1b0f5a6ab35979ce1bee6c17f54745fd1e5" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "bf8b089eecef9e9e8c1765f81613a2fd5e49175c" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "bd103502252027434ec42f628d2dbf54821d4ce6" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "95e9ba9de4289d221666b66fd930d157c7ca08c6" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "973ab742f143a796a779af4d786ec409116a0d87" },
|
||||
"persistence.nvim": { "branch": "main", "commit": "4b8051c01f696d8849a5cb8afa9767be8db16e40" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "9ce85b0f7dcfe5358c0be937ad23e456907d410b" },
|
||||
"popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" },
|
||||
"refactoring.nvim": { "branch": "master", "commit": "2ec9bc0fb5f3c8c6a0f776f0159dd2a3b1663554" },
|
||||
"restoreview": { "branch": "main", "commit": "03d00d59a9ba640db6b44192ed0fcc9d7261dcd2" },
|
||||
"schemastore.nvim": { "branch": "main", "commit": "8c388a1a38ae1b618eef06a6b0388f5ff33867bd" },
|
||||
"smartcolumn.nvim": { "branch": "main", "commit": "c6abf3917fcec487c7475e208ae37f5788af5b04" },
|
||||
"stickybuf.nvim": { "branch": "master", "commit": "4c667bc837e5e3fec5a8857ee99f1a229fc76df9" },
|
||||
"symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" },
|
||||
"tabnine": { "branch": "master", "commit": "cceef1024aa1d8a17698a77c499a124fe85f1f79" },
|
||||
"telescope-file-browser.nvim": { "branch": "master", "commit": "ad7b637c72549713b9aaed7c4f9c79c62bcbdff0" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "a19770625aed49ad2a9f591a5e3946707f7359f6" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "b90a1381e9b5b8596f49070ee86c71db267ac868" },
|
||||
"tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "bc25c56083939f274edcfe395c6ff7de23b67c50" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "59812c26d826e8c717e29406267ea1260f71e103" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "9a01eada39558dc3243278e6805d90e8dff45dc0" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "3f85d8ed30e97ceeddbbcf80224245d347053711" },
|
||||
"twilight.nvim": { "branch": "main", "commit": "a4843e6e67092a1e6fa9666f02bf0ab59174c1df" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" },
|
||||
"typescript.nvim": { "branch": "main", "commit": "4de85ef699d7e6010528dcfbddc2ed4c2c421467" },
|
||||
"vim-illuminate": { "branch": "master", "commit": "8c910b2f84ae6acd9b4b17330bb94dd783c0c11a" },
|
||||
"vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" },
|
||||
"vim-wakatime": { "branch": "master", "commit": "0d2efa2daff34b27b0d227d4c3b136811c93db93" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" },
|
||||
"wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" }
|
||||
"which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" }
|
||||
}
|
||||
@@ -1,146 +0,0 @@
|
||||
local vim = vim
|
||||
local api = vim.api
|
||||
local M = {}
|
||||
|
||||
--- function to create a list of commands and convert them to autocommands
|
||||
--- This function is taken from https://github.com/norcalli/nvim_utils
|
||||
function M.nvim_create_augroups(definitions)
|
||||
for group_name, definition in pairs(definitions) do
|
||||
api.nvim_command("augroup " .. group_name)
|
||||
api.nvim_command("autocmd!")
|
||||
for _, def in ipairs(definition) do
|
||||
local command = table.concat(vim.tbl_flatten({ "autocmd", def }), " ")
|
||||
api.nvim_command(command)
|
||||
end
|
||||
api.nvim_command("augroup END")
|
||||
end
|
||||
end
|
||||
|
||||
local autoCommands = {
|
||||
-- To save the current session (may be restored later).
|
||||
-- autocmd! VimLeavePre * :mks! ~/.config/nvim/session.vim
|
||||
save_session = {
|
||||
{ "VimLeavePre", "*", ":mks! ~/.local/state/nvim/session.vim" },
|
||||
},
|
||||
-- other autocommands
|
||||
open_folds = {
|
||||
{ "BufReadPost,FileReadPost", "*", "normal zR<cr>" },
|
||||
},
|
||||
}
|
||||
|
||||
M.nvim_create_augroups(autoCommands)
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
"help",
|
||||
"alpha",
|
||||
"dashboard",
|
||||
"neo-tree",
|
||||
"Trouble",
|
||||
"lazy",
|
||||
"mason",
|
||||
"notify",
|
||||
"toggleterm",
|
||||
"lazyterm",
|
||||
},
|
||||
callback = function(event)
|
||||
vim.b[event.buf].miniindentscope_disable = true
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
-- ╭──────────────────────────────────────────────────────────╮
|
||||
-- │ taken from LazyVim repository │
|
||||
-- ╭─────────────────────────────────────────────────────────────────────────────╮
|
||||
-- │ https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua│
|
||||
-- ╰─────────────────────────────────────────────────────────────────────────────╯
|
||||
|
||||
local function augroup(name)
|
||||
return vim.api.nvim_create_augroup("ivuorinen_" .. name, { clear = true })
|
||||
end
|
||||
-- Check if we need to reload the file when it changed
|
||||
vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, {
|
||||
group = augroup("checktime"),
|
||||
command = "checktime",
|
||||
})
|
||||
|
||||
-- Highlight on yank
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
group = augroup("highlight_yank"),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
|
||||
-- resize splits if window got resized
|
||||
vim.api.nvim_create_autocmd({ "VimResized" }, {
|
||||
group = augroup("resize_splits"),
|
||||
callback = function()
|
||||
local current_tab = vim.fn.tabpagenr()
|
||||
vim.cmd("tabdo wincmd =")
|
||||
vim.cmd("tabnext " .. current_tab)
|
||||
end,
|
||||
})
|
||||
|
||||
-- go to last loc when opening a buffer
|
||||
vim.api.nvim_create_autocmd("BufReadPost", {
|
||||
group = augroup("last_loc"),
|
||||
callback = function()
|
||||
local exclude = { "gitcommit" }
|
||||
local buf = vim.api.nvim_get_current_buf()
|
||||
if vim.tbl_contains(exclude, vim.bo[buf].filetype) then
|
||||
return
|
||||
end
|
||||
local mark = vim.api.nvim_buf_get_mark(buf, '"')
|
||||
local lcount = vim.api.nvim_buf_line_count(buf)
|
||||
if mark[1] > 0 and mark[1] <= lcount then
|
||||
pcall(vim.api.nvim_win_set_cursor, 0, mark)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- close some filetypes with <q>
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = augroup("close_with_q"),
|
||||
pattern = {
|
||||
"PlenaryTestPopup",
|
||||
"help",
|
||||
"lspinfo",
|
||||
"man",
|
||||
"notify",
|
||||
"qf",
|
||||
"spectre_panel",
|
||||
"startuptime",
|
||||
"tsplayground",
|
||||
"neotest-output",
|
||||
"checkhealth",
|
||||
"neotest-summary",
|
||||
"neotest-output-panel",
|
||||
},
|
||||
callback = function(event)
|
||||
vim.bo[event.buf].buflisted = false
|
||||
vim.keymap.set("n", "q", "<cmd>close<cr>", { buffer = event.buf, silent = true })
|
||||
end,
|
||||
})
|
||||
|
||||
-- wrap and check for spell in text filetypes
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = augroup("wrap_spell"),
|
||||
pattern = { "gitcommit", "markdown" },
|
||||
callback = function()
|
||||
vim.opt_local.wrap = true
|
||||
vim.opt_local.spell = true
|
||||
end,
|
||||
})
|
||||
|
||||
-- Auto create dir when saving a file, in case some intermediate directory does not exist
|
||||
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
||||
group = augroup("auto_create_dir"),
|
||||
callback = function(event)
|
||||
if event.match:match("^%w%w+://") then
|
||||
return
|
||||
end
|
||||
local file = vim.loop.fs_realpath(event.match) or event.match
|
||||
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
|
||||
end,
|
||||
})
|
||||
3
config/nvim/lua/config/autocmds.lua
Normal file
3
config/nvim/lua/config/autocmds.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
-- Autocmds are automatically loaded on the VeryLazy event
|
||||
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
|
||||
-- Add any additional autocmds here
|
||||
3
config/nvim/lua/config/keymaps.lua
Normal file
3
config/nvim/lua/config/keymaps.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
-- Keymaps are automatically loaded on the VeryLazy event
|
||||
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
|
||||
-- Add any additional keymaps here
|
||||
58
config/nvim/lua/config/lazy.lua
Normal file
58
config/nvim/lua/config/lazy.lua
Normal file
@@ -0,0 +1,58 @@
|
||||
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 })
|
||||
end
|
||||
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
|
||||
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- add LazyVim and import its plugins
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
import = "lazyvim.plugins",
|
||||
opts = {
|
||||
colorscheme = "catppuccin",
|
||||
},
|
||||
},
|
||||
-- import any extras modules here
|
||||
{ import = "lazyvim.plugins.extras.formatting.prettier" },
|
||||
{ import = "lazyvim.plugins.extras.lang.docker" },
|
||||
{ import = "lazyvim.plugins.extras.lang.go" },
|
||||
{ import = "lazyvim.plugins.extras.lang.tailwind" },
|
||||
{ import = "lazyvim.plugins.extras.lang.terraform" },
|
||||
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||
{ import = "lazyvim.plugins.extras.lang.json" },
|
||||
{ import = "lazyvim.plugins.extras.linting.eslint" },
|
||||
{ import = "lazyvim.plugins.extras.ui.mini-animate" },
|
||||
-- import/override with your plugins
|
||||
{ import = "plugins" },
|
||||
},
|
||||
defaults = {
|
||||
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
|
||||
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
|
||||
lazy = false,
|
||||
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
|
||||
-- have outdated releases, which may break your Neovim install.
|
||||
version = false, -- always use the latest git commit
|
||||
-- version = "*", -- try installing the latest stable version for plugins that support semver
|
||||
},
|
||||
install = { colorscheme = { "catppuccin", "tokyonight", "habamax" } },
|
||||
checker = { enabled = true }, -- automatically check for plugin updates
|
||||
performance = {
|
||||
rtp = {
|
||||
-- disable some rtp plugins
|
||||
disabled_plugins = {
|
||||
"gzip",
|
||||
-- "matchit",
|
||||
-- "matchparen",
|
||||
-- "netrwPlugin",
|
||||
"tarPlugin",
|
||||
"tohtml",
|
||||
"tutor",
|
||||
"zipPlugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
11
config/nvim/lua/config/options.lua
Normal file
11
config/nvim/lua/config/options.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
-- 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
|
||||
|
||||
local opt = vim.opt
|
||||
|
||||
opt.number = true
|
||||
opt.relativenumber = true
|
||||
|
||||
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
@@ -1,73 +0,0 @@
|
||||
-- luacheck: globals vim
|
||||
|
||||
-- To be used anywhere.
|
||||
-- local function job(command) vim.api.nvim_command("call jobstart('" .. command .. "')") end
|
||||
|
||||
local function yaml_ft(path, bufnr)
|
||||
-- get content of buffer as string
|
||||
local content = vim.filetype.getlines(bufnr)
|
||||
if type(content) == "table" then content = table.concat(content, "\n") end
|
||||
|
||||
-- check if file is in roles, tasks, or handlers folder
|
||||
local path_regex = vim.regex("(tasks\\|roles\\|handlers)/")
|
||||
if path_regex and path_regex:match_str(path) then return "yaml.ansible" end
|
||||
-- check for known ansible playbook text and if found, return yaml.ansible
|
||||
local regex = vim.regex("hosts:\\|tasks:")
|
||||
if regex and regex:match_str(content) then return "yaml.ansible" end
|
||||
|
||||
-- return yaml if nothing else
|
||||
return "yaml"
|
||||
end
|
||||
|
||||
-- In init.lua or filetype.nvim's config file
|
||||
vim.filetype.add({
|
||||
extension = {
|
||||
|
||||
h = function()
|
||||
-- Use a lazy heuristic that #including a C++ header means it's a
|
||||
-- C++ header
|
||||
if vim.fn.search("\\C^#include <[^>.]\\+>$", "nw") == 1 then return "cpp" end
|
||||
return "c"
|
||||
end,
|
||||
|
||||
-- Spelling fix.
|
||||
md = function() vim.api.nvim_command("setlocal spell!") end,
|
||||
|
||||
yml = yaml_ft,
|
||||
yaml = yaml_ft,
|
||||
|
||||
--
|
||||
csv = "csv",
|
||||
cl = "opencl",
|
||||
env = "env",
|
||||
sh = "bash",
|
||||
--
|
||||
},
|
||||
pattern = {
|
||||
|
||||
-- Go to root configuration of some projects.
|
||||
-- [".*config/nvim/.*"] = function() vim.api.nvim_command "cd ~/.config/nvim/" end,
|
||||
|
||||
---- Typescript Projects
|
||||
-- [".*/src/.*ts"] = function() format() end,
|
||||
-- [".*/src/.*json"] = function() format() end,
|
||||
-- [".*/src/.*scss"] = function() format() end,
|
||||
-- [".*/src/.*html"] = function() format() end,
|
||||
|
||||
--[".*Code/ivuorinen/[project]/src/.*ts"] = function()
|
||||
-- vim.api.nvim_command('cd ~/Code/ivuorinen/[project]/')
|
||||
-- build('ts index')
|
||||
--end,
|
||||
},
|
||||
|
||||
filename = {
|
||||
-- For eslint_d configuration file.
|
||||
[".eslintrc"] = "jsonc",
|
||||
|
||||
-- For Typescript projects.
|
||||
["tsconfig.json"] = "json5",
|
||||
|
||||
[".ignore"] = "gitignore",
|
||||
["docker-compose.yml"] = "yaml.docker-compose",
|
||||
},
|
||||
})
|
||||
@@ -1,222 +0,0 @@
|
||||
--[[
|
||||
Keymappings for nvim experience.
|
||||
|
||||
I use combination of both nvim default vim.api.nvim_set_keymap
|
||||
and WhichKey register. Slowly migrating to the WhichKey system,
|
||||
and tweaking the groupings as I go.
|
||||
--]]
|
||||
-- luacheck: globals vim CAPABILITIES
|
||||
|
||||
local wk = require("which-key")
|
||||
|
||||
-- ╭──────────────────────────────────────────────────────────╮
|
||||
-- │ Register keybindings │
|
||||
-- ╰──────────────────────────────────────────────────────────╯
|
||||
|
||||
-- ╭──────────────────────────────────────────────────────────╮
|
||||
-- │ Register in all modes, prefix <leader> │
|
||||
-- ╰──────────────────────────────────────────────────────────╯
|
||||
wk.register({
|
||||
b = {
|
||||
name = "+buffer",
|
||||
n = { "<cmd>tabnew<cr>", "[n]ew tab" },
|
||||
a = {
|
||||
name = "+annotate",
|
||||
-- defined in plugins/neogen.lua
|
||||
},
|
||||
c = {
|
||||
name = "+comments",
|
||||
b = {
|
||||
"<cmd>lua require('comment-box').lbox()<cr>",
|
||||
"Left aligned fixed size box with left aligned text",
|
||||
},
|
||||
c = {
|
||||
"<cmd>lua require('comment-box').ccbox()<cr>",
|
||||
desc = "Centered adapted box with centered text",
|
||||
},
|
||||
l = {
|
||||
"<cmd>lua require('comment-box').cline()<cr>",
|
||||
desc = "Centered line",
|
||||
},
|
||||
},
|
||||
d = {
|
||||
name = "+delete buffers",
|
||||
h = {
|
||||
"<CMD>lua require('close_buffers').delete({type = 'hidden'})<CR>",
|
||||
"Delete hidden buffers",
|
||||
},
|
||||
},
|
||||
t = { ":TabnineToggle<cr>", "Toggle TabNine" },
|
||||
},
|
||||
D = {
|
||||
name = "+Diagnostics (Trouble)",
|
||||
t = { ":TroubleToggle<CR>", "[D]iagnostics [t]oggle" },
|
||||
-- Quick navigation between diagonostics.
|
||||
f = { ":lua vim.diagnostic.open_float()<CR>", "[D]iagnostics: Open [f]loat" },
|
||||
n = { ":lua vim.diagnostic.goto_next()<CR>", "[D]iagnostics: [n]ext" },
|
||||
p = { ":lua vim.diagnostic.goto_prev()<CR>", "[D]iagnostics: [p]rev" },
|
||||
---
|
||||
x = { function() require("trouble").open() end, "Open Trouble" },
|
||||
w = { function() require("trouble").open("workspace_diagnostics") end, "Workspace diagnostics" },
|
||||
d = { function() require("trouble").open("document_diagnostics") end, "Document diagnostics" },
|
||||
q = { function() require("trouble").open("quickfix") end, "Quickfix" },
|
||||
l = { function() require("trouble").open("loclist") end, "Loclist" },
|
||||
r = { function() require("trouble").open("lsp_references") end, "LSP References" },
|
||||
},
|
||||
e = {
|
||||
function() vim.cmd("Neotree focus source=filesystem position=left") end,
|
||||
"Toggle the sidebar tree",
|
||||
},
|
||||
f = {
|
||||
name = "+find",
|
||||
-- Find recursively files across the root folder subfiles.
|
||||
f = { ':lua require("telescope.builtin").find_files()<cr>', "[f]ind [f]iles" },
|
||||
-- Find recursively a text across the root folder subfiles.
|
||||
g = { ':lua require("telescope.builtin").live_grep()<cr>', "[f]ind text with [g]rep" },
|
||||
},
|
||||
h = {
|
||||
name = "+harpoon",
|
||||
a = { "<cmd>lua require('harpoon.mark').add_file()<cr>", "[h]arpoon: [A]dd file" },
|
||||
r = { "<cmd>lua require('harpoon.mark').rm_file()<cr>", "[h]arpoon: [r]emove file" },
|
||||
m = { "<cmd>lua require('harpoon.ui').toggle_quick_menu()<cr>", "[h]arpoon: harpoon [m]enu" },
|
||||
n = { "<cmd>lua require('harpoon.ui').nav_next()<cr>", "[h]arpoon: [n]ext file" },
|
||||
p = { "<cmd>lua require('harpoon.ui').nav_prev()<cr>", "[h]arpoon: [p]revious file" },
|
||||
["1"] = { "<cmd> lua require('harpoon.ui').nav_file(1)<cr>", "[h]arpoon: file 1" },
|
||||
["2"] = { "<cmd> lua require('harpoon.ui').nav_file(2)<cr>", "[h]arpoon: file 2" },
|
||||
["3"] = { "<cmd> lua require('harpoon.ui').nav_file(3)<cr>", "[h]arpoon: file 3" },
|
||||
},
|
||||
--- Remap debugging to "H" from LV default of "h"
|
||||
H = {
|
||||
name = "+help/Conceal/Treesitter",
|
||||
c = {
|
||||
name = "+conceal",
|
||||
h = { ":set conceallevel=1<cr>", "hide/conceal" },
|
||||
s = { ":set conceallevel=0<cr>", "show/unconceal" },
|
||||
},
|
||||
t = {
|
||||
name = "+treesitter",
|
||||
t = { vim.treesitter.inspect_tree, "show tree" },
|
||||
c = { ":=vim.treesitter.get_captures_at_cursor()<cr>", "show capture" },
|
||||
n = { ":=vim.treesitter.get_node():type()<cr>", "show node" },
|
||||
},
|
||||
},
|
||||
o = {
|
||||
g = {
|
||||
-- defined in plugins/gitsigns.lua
|
||||
name = "+git",
|
||||
b = {
|
||||
name = "+blame",
|
||||
},
|
||||
},
|
||||
},
|
||||
p = {
|
||||
name = "+plugins",
|
||||
i = { function() require("lazy").install() end, "plugins [i]nstall" },
|
||||
s = { function() require("lazy").home() end, "plugins [s]tatus" },
|
||||
S = { function() require("lazy").sync() end, "plugins [S]ync" },
|
||||
u = { function() require("lazy").check() end, "plugins Check [u]pdates" },
|
||||
U = { function() require("lazy").update() end, "plugins [U]pdate" },
|
||||
},
|
||||
q = {
|
||||
name = "+quit",
|
||||
q = { ":qa<cr>", "quit: [q]uit all" },
|
||||
f = { ":qa!<cr>", "quit: all with [f]orce" },
|
||||
},
|
||||
r = {
|
||||
-- defined in plugins/refactoring-nvim.lua
|
||||
name = "+refactor",
|
||||
},
|
||||
t = {
|
||||
name = "+telescope",
|
||||
-- Find recursively TODOs, NOTEs, FIXITs, ... across the root folder subfiles.
|
||||
t = { ":TodoTelescope<cr>", "[t]elescope: [t]odo" },
|
||||
},
|
||||
x = { ":Bdelete<CR>", "Close current buffer" },
|
||||
}, { prefix = "<leader>" })
|
||||
|
||||
--
|
||||
-- ╭──────────────────────────────────────────────────────────╮
|
||||
-- │ Normal mode, prefix <leader> │
|
||||
-- ╰──────────────────────────────────────────────────────────╯
|
||||
wk.register({
|
||||
b = { name = "Buffer" },
|
||||
}, { mode = "n", prefix = "<leader>" })
|
||||
|
||||
--
|
||||
-- ╭──────────────────────────────────────────────────────────╮
|
||||
-- │ Insert mode, prefix <leader> │
|
||||
-- ╰──────────────────────────────────────────────────────────╯
|
||||
wk.register({
|
||||
b = { name = "Buffer" },
|
||||
}, { mode = "i", prefix = "<leader>" })
|
||||
|
||||
--
|
||||
-- ╭──────────────────────────────────────────────────────────╮
|
||||
-- │ Insert mode, no prefix │
|
||||
-- ╰──────────────────────────────────────────────────────────╯
|
||||
wk.register({
|
||||
["<C-s>"] = { "<cmd>w<cr>", "Save file" },
|
||||
["<C-Home>"] = { "<Home>", "Do just Home on CTRL + Home" },
|
||||
}, { mode = "i", prefix = "" })
|
||||
|
||||
--
|
||||
-- ╭──────────────────────────────────────────────────────────╮
|
||||
-- │ All modes, no prefix │
|
||||
-- ╰──────────────────────────────────────────────────────────╯
|
||||
wk.register({
|
||||
["<C-s>"] = { "<cmd>w<cr>", "Save file" },
|
||||
["<C-End>"] = { "<End>", "Do just End on CTRL + End" },
|
||||
}, { prefix = "" })
|
||||
|
||||
--
|
||||
-- ╭──────────────────────────────────────────────────────────╮
|
||||
-- │ Other keymappings, still to move │
|
||||
-- ╰──────────────────────────────────────────────────────────╯
|
||||
|
||||
local key = vim.api.nvim_set_keymap
|
||||
local remap = { noremap = true, silent = true }
|
||||
|
||||
-- Go to the next block.
|
||||
--key('n', '<C-Down>', 'g%', remap )
|
||||
|
||||
-- Loop through brackets blocks.
|
||||
--key('n', '<C-Up>', 'z%', remap )
|
||||
|
||||
-- Move lines normally like an IDE when line wraps
|
||||
key("i", "<Down>", [[v:count ? 'j' : '<c-o>gj']], { expr = true, noremap = true, silent = true })
|
||||
key("i", "<Up>", [[v:count ? 'k' : '<c-o>gk']], { expr = true, noremap = true, silent = true })
|
||||
key("n", "<Down>", [[v:count ? 'j' : 'gj']], { expr = true, noremap = true, silent = true })
|
||||
key("n", "<Up>", [[v:count ? 'k' : 'gk']], { expr = true, noremap = true, silent = true })
|
||||
|
||||
-- Move normaly bottom and up with C+Up and C+Down.
|
||||
key("i", "<C-Up>", "<C-o>gk", remap)
|
||||
key("i", "<C-Down>", "<C-o>gj", remap)
|
||||
key("n", "<C-Up>", "gk", remap)
|
||||
key("n", "<C-Down>", "gj", remap)
|
||||
|
||||
-- Set 'CTRL + z' as 'undo'
|
||||
key("i", "<C-z>", "<Esc>ui", remap)
|
||||
|
||||
-- Set 'CTRL + y' as 'redo'
|
||||
key("i", "<C-y>", "<Esc><C-r>", remap)
|
||||
|
||||
-- Set 'SHIFT + arrows' as 'select' like modern text-editor.
|
||||
key("n", "<S-Up>", "v<Up>", remap)
|
||||
key("n", "<S-Down>", "v<Down>", remap)
|
||||
key("n", "<S-Left>", "v<Left>", remap)
|
||||
key("n", "<S-Right>", "v<Right>", remap)
|
||||
key("v", "<S-Up>", "<Up>", remap)
|
||||
key("v", "<S-Down>", "<Down>", remap)
|
||||
key("v", "<S-Left>", "<Left>", remap)
|
||||
key("v", "<S-Right>", "<Right>", remap)
|
||||
key("i", "<S-Up>", "<Esc>v<Up>", remap)
|
||||
key("i", "<S-Down>", "<C-o>v<Down>", remap)
|
||||
key("i", "<S-Left>", "<Esc>v<Left>", remap)
|
||||
key("i", "<S-Right>", "<C-o>v<Right>", remap)
|
||||
|
||||
-- Indent the current visual selection.
|
||||
key("v", "<", "<gv", remap)
|
||||
key("v", ">", ">gv", remap)
|
||||
|
||||
-- Set 'Backspace' as 'delete selection' for the visual selection.
|
||||
key("v", "<BS>", '"_di', remap)
|
||||
@@ -1,144 +0,0 @@
|
||||
-- Completion for snippets.
|
||||
-- luacheck: globals vim CAPABILITIES
|
||||
local vim = vim
|
||||
CAPABILITIES = vim.lsp.protocol.make_client_capabilities()
|
||||
CAPABILITIES.textDocument.completion.completionItem.snippetSupport = true
|
||||
|
||||
-- [[ Configure LSP ]]
|
||||
-- This function gets run when an LSP connects to a particular buffer.
|
||||
local on_attach = function(client, bufnr)
|
||||
local nmap = function(keys, func, desc)
|
||||
if desc then desc = "LSP: " .. desc end
|
||||
|
||||
vim.keymap.set("n", keys, func, { buffer = bufnr, desc = desc })
|
||||
end
|
||||
|
||||
if client.server_capabilities.documentSymbolProvider then require("nvim-navic").attach(client, bufnr) end
|
||||
|
||||
local wk = require("which-key")
|
||||
|
||||
wk.register({
|
||||
l = {
|
||||
name = "+lsp",
|
||||
n = { vim.lsp.buf.rename, "Rename" },
|
||||
c = { vim.lsp.buf.code_action, "Code Action" },
|
||||
f = { "<cmd>Format", "Format current buffer with LSP" },
|
||||
D = { vim.lsp.buf.declaration, "[G]oto [D]eclaration" },
|
||||
w = {
|
||||
name = "[w]orkspace",
|
||||
a = { vim.lsp.buf.add_workspace_folder, "[w]orkspace: [a]dd folder" },
|
||||
r = { vim.lsp.buf.remove_workspace_folder, "[w]orkspace: [r]emove folder" },
|
||||
l = {
|
||||
function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end,
|
||||
"[w]orkspace [l]ist folders",
|
||||
},
|
||||
},
|
||||
},
|
||||
g = {
|
||||
name = "+goto",
|
||||
d = { vim.lsp.buf.definition, "[G]oto [D]efinition" },
|
||||
r = { require("telescope.builtin").lsp_references, "[G]oto [R]eferences" },
|
||||
I = { vim.lsp.buf.implementation, "[G]oto [I]mplementation" },
|
||||
D = { vim.lsp.buf.type_definition, "Type [D]efinition" },
|
||||
s = { require("telescope.builtin").lsp_document_symbols, "[D]ocument [S]ymbols" },
|
||||
w = { require("telescope.builtin").lsp_dynamic_workspace_symbols, "[W]orkspace [S]ymbols" },
|
||||
},
|
||||
}, { prefix = "<leader>" })
|
||||
|
||||
-- See `:help K` for why this keymap
|
||||
nmap("K", vim.lsp.buf.hover, "Hover Documentation")
|
||||
nmap("<C-k>", vim.lsp.buf.signature_help, "Signature Documentation")
|
||||
|
||||
-- Create a command `:Format` local to the LSP buffer
|
||||
-- vim.api.nvim_buf_create_user_command(
|
||||
-- bufnr,
|
||||
-- "Format",
|
||||
-- function(_) vim.lsp.buf.format() end,
|
||||
-- { desc = "Format current buffer with LSP" }
|
||||
-- )
|
||||
end
|
||||
|
||||
-- Enable the following language servers
|
||||
-- Feel free to add/remove any LSPs that you want here.
|
||||
-- They will automatically be installed.
|
||||
--
|
||||
-- Add any additional override configuration in the following
|
||||
-- tables. They will be passed to the `settings` field of the
|
||||
-- server config. You must look up that documentation yourself.
|
||||
--
|
||||
-- If you want to override the default filetypes that your
|
||||
-- language server will attach to you can define the property
|
||||
-- 'filetypes' to the map in question.
|
||||
local servers = {
|
||||
ansiblels = {},
|
||||
bashls = {},
|
||||
clangd = {},
|
||||
cssls = {
|
||||
cmd = { "vscode-css-language-server", "--stdio" },
|
||||
filetypes = { "css", "scss", "less" },
|
||||
-- root_dir = root_pattern("package.json", ".git") or bufdir,
|
||||
settings = {
|
||||
css = {
|
||||
validate = true,
|
||||
},
|
||||
less = {
|
||||
validate = true,
|
||||
},
|
||||
scss = {
|
||||
validate = true,
|
||||
},
|
||||
},
|
||||
single_file_support = true,
|
||||
capabilities = CAPABILITIES,
|
||||
},
|
||||
diagnosticls = {},
|
||||
docker_compose_language_service = {},
|
||||
dockerls = {},
|
||||
eslint = {}, -- JS
|
||||
gopls = {}, -- Go
|
||||
graphql = {},
|
||||
html = { filetypes = { "html", "twig", "hbs" } },
|
||||
intelephense = {}, -- PHP
|
||||
jsonls = {
|
||||
json = {
|
||||
schemas = require("schemastore").json.schemas(),
|
||||
validate = { enable = true },
|
||||
},
|
||||
},
|
||||
lua_ls = {
|
||||
Lua = {
|
||||
diagnostics = { globals = { "vim" } },
|
||||
workspace = { checkThirdParty = false },
|
||||
telemetry = { enable = false },
|
||||
},
|
||||
},
|
||||
marksman = {}, -- Markdown
|
||||
psalm = {}, -- PHP
|
||||
pylsp = {}, -- Python
|
||||
pyright = {}, -- Python
|
||||
rust_analyzer = {}, -- Rust
|
||||
terraformls = {}, -- Terraform
|
||||
tsserver = {}, -- TypeScript
|
||||
vuels = {}, -- Vue
|
||||
yamlls = { -- YAML
|
||||
yaml = {
|
||||
schemaStore = {
|
||||
-- You must disable built-in schemaStore support if you want to use
|
||||
-- this plugin and its advanced options like `ignore`.
|
||||
enable = false,
|
||||
-- Avoid TypeError: Cannot read properties of undefined (reading 'length')
|
||||
url = "",
|
||||
},
|
||||
schemas = require("schemastore").yaml.schemas(),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- Setup neovim lua configuration
|
||||
require("neodev").setup()
|
||||
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = vim.tbl_keys(servers),
|
||||
automatic_installtion = true,
|
||||
})
|
||||
@@ -1,59 +0,0 @@
|
||||
-- Signature for LSP
|
||||
|
||||
return {
|
||||
"ray-x/lsp_signature.nvim",
|
||||
config = {
|
||||
debug = false, -- set to true to enable debug logging
|
||||
verbose = false, -- show debug line number
|
||||
|
||||
bind = true, -- This is mandatory, otherwise border config won't get registered.
|
||||
-- If you want to hook lspsaga or other signature handler, pls set to false
|
||||
doc_lines = 10, -- will show two lines of comment/doc(if there are more than two lines in doc, will be truncated);
|
||||
-- set to 0 if you DO NOT want any API comments be shown
|
||||
-- This setting only take effect in insert mode, it does not affect signature help in normal
|
||||
-- mode, 10 by default
|
||||
|
||||
floating_window = true, -- show hint in a floating window, set to false for virtual text only mode
|
||||
|
||||
floating_window_above_cur_line = true, -- try to place the floating above the current line when possible Note:
|
||||
-- will set to true when fully tested, set to false will use whichever side has more space
|
||||
-- this setting will be helpful if you do not want the PUM and floating win overlap
|
||||
close_timeout = 4000, -- close floating window after ms when laster parameter is entered
|
||||
hint_enable = true, -- virtual hint enable
|
||||
hint_prefix = "🐼", -- Panda for parameter
|
||||
hint_scheme = "String",
|
||||
use_lspsaga = false, -- set to true if you want to use lspsaga popup
|
||||
|
||||
hi_parameter = "LspSignatureActiveParameter", -- how your parameter will be highlight
|
||||
|
||||
max_height = 12, -- max height of signature floating_window, if content is more than max_height, you can scroll down
|
||||
-- to view the hiding contents
|
||||
max_width = 90, -- max_width of signature floating_window, line will be wrapped if exceed max_width
|
||||
wrap = true,
|
||||
handler_opts = {
|
||||
border = "shadow", -- double, rounded, single, shadow, none
|
||||
},
|
||||
|
||||
always_trigger = false, -- sometime show signature on new line or in middle of parameter can be confusing, set it to false for #58
|
||||
|
||||
floating_window_off_x = 0, -- adjust float windows x position.
|
||||
-- can be either a number or function
|
||||
floating_window_off_y = 2, -- adjust float windows y position. e.g -2 move window up 2 lines; 2 move down 2 lines
|
||||
-- can be either number or function, see examples
|
||||
|
||||
auto_close_after = nil, -- autoclose signature float win after x sec, disabled if nil.
|
||||
extra_trigger_chars = { "(", ",", ";", ")", "{", "}" }, -- Array of extra characters that will trigger signature completion, e.g., {"(", ","}
|
||||
zindex = 200, -- by default it will be on top of all floating windows, set to <= 50 send it to bottom
|
||||
|
||||
padding = "", -- character to pad on left and right of signature can be ' ', or '|' etc
|
||||
|
||||
transparency = 20, -- disabled by default, allow floating win transparent value 1~100
|
||||
shadow_blend = 36, -- if you using shadow as border use this set the opacity
|
||||
shadow_guibg = "Black", -- if you using shadow as border use this set the color e.g. 'Green' or '#121315'
|
||||
timer_interval = 50, -- default timer check interval set to lower value if you want to reduce latency
|
||||
toggle_key = "<C-n>", -- toggle signature on and off in insert mode, e.g. toggle_key = '<M-x>'
|
||||
|
||||
select_signature_key = nil, -- cycle to next signature, e.g. '<M-n>' function overloading
|
||||
move_cursor_key = nil, -- imap, use nvim_set_current_win to move cursor between current win and floating
|
||||
},
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
-- luacheck: globals vim
|
||||
local vim = vim
|
||||
|
||||
-- Use the new FileType system of Neovim.
|
||||
-- let g:do_filetype_lua = 1
|
||||
vim.g.do_filetype_lua = 1
|
||||
|
||||
vim.wo.linebreak = true -- Fix moving through lines 'gk' and 'gj'
|
||||
vim.o.breakindent = true -- Enable break indent
|
||||
vim.o.undofile = true -- Save undo history
|
||||
vim.wo.number = true -- Show lines number (hybrid)
|
||||
vim.wo.relativenumber = true -- Show lines number (hybrid)
|
||||
vim.wo.signcolumn = "yes" -- Keep signcolumn on by default
|
||||
vim.o.laststatus = 3 -- Global statusline.
|
||||
vim.o.cmdheight = 0 -- To have a extra line :)
|
||||
vim.wo.wrap = true -- Set wrap for words
|
||||
vim.o.showtabline = 2 -- Always show tabs
|
||||
vim.o.list = true -- Show xtra spaces
|
||||
vim.o.wildmenu = true -- Set wildmenu for later use
|
||||
vim.o.hlsearch = true -- Highlighting search
|
||||
vim.o.ruler = true -- Set ruler for better look
|
||||
vim.o.hidden = true -- No nice message
|
||||
vim.o.showcmd = true -- Partial commands only in the screen
|
||||
vim.o.showmatch = true -- Match braces when inserting new ones
|
||||
vim.opt.backup = false -- No backups because some plugins freak out
|
||||
vim.opt.writebackup = false -- No backups because some plugins freak out
|
||||
vim.o.scrolloff = 40 -- Off scroll when moving through the buffer
|
||||
vim.go.termguicolors = true -- For terminal RGB colours
|
||||
vim.go.t_Co = "256" -- Colours, I believe
|
||||
vim.go.t_ut = "" -- Colours, I believe
|
||||
vim.o.laststatus = 3 -- Space for tabs
|
||||
vim.o.softtabstop = 2 -- Space for tabs
|
||||
vim.o.expandtab = true -- Expand tab to use spaces instead
|
||||
vim.o.tabstop = 2 -- Space for tabs
|
||||
vim.bo.shiftwidth = 2 -- Space for tabs
|
||||
vim.o.shiftwidth = 2 -- Space for tabs
|
||||
vim.o.formatoptions = "tqj" -- Format options to not create new lines with comments
|
||||
vim.o.mouse = "a" -- Mouse working with neovim
|
||||
|
||||
-- Case-insensitive searching UNLESS \C or capital in search
|
||||
vim.o.ignorecase = true
|
||||
vim.o.smartcase = true
|
||||
|
||||
-- Cursor line
|
||||
vim.o.cursorline = true
|
||||
vim.wo.cursorline = true
|
||||
vim.o.cursorcolumn = true
|
||||
vim.wo.cursorcolumn = true
|
||||
|
||||
-- Spell language to English (UK)
|
||||
vim.o.spelllang = "en_gb"
|
||||
vim.bo.spelllang = "en_gb"
|
||||
|
||||
-- When "on" the commands listed below move the cursor to the first non-blank
|
||||
-- of the line. When off the cursor is kept in the same column (if possible).
|
||||
-- https://neovim.io/doc/user/options.html#'startofline'
|
||||
vim.o.startofline = true
|
||||
|
||||
-- Complete options
|
||||
vim.o.completeopt = "menuone,longest,noselect"
|
||||
vim.o.shortmess = vim.o.shortmess .. "c"
|
||||
|
||||
-- ╭──────────────────────────────────────────────────────────╮
|
||||
-- │ Variables │
|
||||
-- ╰──────────────────────────────────────────────────────────╯
|
||||
|
||||
vim.api.nvim_set_var("one_allow_itali:set cursorlinec:set cursorlines", 1)
|
||||
vim.api.nvim_set_var("do_filetype_lua", 1)
|
||||
vim.api.nvim_set_var("MRU_File", "~/.cache/vim_mru_files")
|
||||
|
||||
-- ╭──────────────────────────────────────────────────────────╮
|
||||
-- │ API │
|
||||
-- ╰──────────────────────────────────────────────────────────╯
|
||||
|
||||
-- Change title accordingly.
|
||||
vim.api.nvim_set_option("title", true)
|
||||
|
||||
-- Set clipboard to be global across the system
|
||||
vim.api.nvim_set_option("clipboard", "unnamedplus")
|
||||
|
||||
-- Set dictionary to language spell
|
||||
vim.api.nvim_set_option("dictionary", "/usr/share/dict/words")
|
||||
|
||||
-- Wildignore for when opening files :0
|
||||
vim.api.nvim_set_option(
|
||||
"wildignore",
|
||||
"*/tmp*/,*/node_modules/*,_site,*/__pycache__/,*/venv/*,*/target/*,*/.vim$,~$,*/.log"
|
||||
)
|
||||
|
||||
-- Folding
|
||||
vim.api.nvim_set_option("foldmethod", "syntax")
|
||||
vim.api.nvim_set_option("foldenable", false)
|
||||
vim.api.nvim_set_option("foldminlines", 5)
|
||||
vim.api.nvim_set_option("foldcolumn", "1")
|
||||
@@ -1,40 +0,0 @@
|
||||
-- Package manager https://github.com/folke/lazy.nvim
|
||||
-- :help lazy.nvim.txt
|
||||
-- luacheck: globals vim
|
||||
|
||||
-- To install lazy.nvim automatically.
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
local options = {
|
||||
defaults = { lazy = false },
|
||||
install = { colorscheme = { "catppuccin" } },
|
||||
performance = {
|
||||
cache = {
|
||||
enabled = true,
|
||||
},
|
||||
rtp = {
|
||||
disabled_plugins = {
|
||||
"matchit",
|
||||
"matchparen",
|
||||
"netrwPlugin",
|
||||
"tohtml",
|
||||
"tutor",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
require("lazy").setup("plugins", options)
|
||||
@@ -1,92 +0,0 @@
|
||||
-- A VS Code like winbar for Neovim
|
||||
-- https://github.com/utilyre/barbecue.nvim
|
||||
return {
|
||||
"utilyre/barbecue.nvim",
|
||||
dependencies = {
|
||||
"neovim/nvim-lspconfig",
|
||||
"SmiteshP/nvim-navic",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
version = "*",
|
||||
opts = {
|
||||
theme = "catppuccin",
|
||||
|
||||
-- If you set this to false, floating windows will look weird
|
||||
exclude_float = true,
|
||||
|
||||
-- Instead of excluding countless number of filetypes, barbecue tries to only show on some buftypes
|
||||
-- "": file buffer
|
||||
-- "nofile": e.g. nvim-tree and nvim-dap-ui
|
||||
-- "prompt": e.g. telescope.nvim and nvim-fzf
|
||||
-- "terminal": e.g. fterm.nvim and toggleterm.nvim
|
||||
-- ...
|
||||
include_buftypes = { "" },
|
||||
|
||||
---Filetypes not to enable winbar in.
|
||||
---
|
||||
---@type string[]
|
||||
exclude_filetypes = {
|
||||
"",
|
||||
"txt",
|
||||
"markdown",
|
||||
},
|
||||
|
||||
-- :help events
|
||||
-- :help [event] (like :help BufWinEnter)
|
||||
update_events = {
|
||||
"BufWinEnter",
|
||||
"BufWritePost",
|
||||
"CursorMoved",
|
||||
"CursorMovedI",
|
||||
"TextChanged",
|
||||
"TextChangedI",
|
||||
},
|
||||
|
||||
-- Show `~ ...` instead of `/ home user ...`
|
||||
tilde_home = true,
|
||||
|
||||
-- Your winbar will have a little padding from the edge
|
||||
prefix = " ",
|
||||
|
||||
-- The sign between each entry
|
||||
separator = " ",
|
||||
|
||||
-- Show if lsp context is available but there is nothing to show
|
||||
no_info_indicator = "…",
|
||||
|
||||
-- Symbol to show if file has been modified (not saved). It's usually `[+]` in vim
|
||||
-- `nil` to disable
|
||||
modified_indicator = nil,
|
||||
|
||||
-- Icons passed to nvim-navic
|
||||
icons = {
|
||||
File = " ",
|
||||
Module = " ",
|
||||
Namespace = " ",
|
||||
Package = " ",
|
||||
Class = " ",
|
||||
Method = " ",
|
||||
Property = " ",
|
||||
Field = " ",
|
||||
Constructor = " ",
|
||||
Enum = "練",
|
||||
Interface = "練",
|
||||
Function = " ",
|
||||
Variable = " ",
|
||||
Constant = " ",
|
||||
String = " ",
|
||||
Number = " ",
|
||||
Boolean = "◩ ",
|
||||
Array = " ",
|
||||
Object = " ",
|
||||
Key = " ",
|
||||
Null = "ﳠ ",
|
||||
EnumMember = " ",
|
||||
Struct = " ",
|
||||
Event = " ",
|
||||
Operator = " ",
|
||||
TypeParameter = " ",
|
||||
Define = " ",
|
||||
},
|
||||
},
|
||||
}
|
||||
90
config/nvim/lua/plugins/coding.lua
Normal file
90
config/nvim/lua/plugins/coding.lua
Normal file
@@ -0,0 +1,90 @@
|
||||
return {
|
||||
-- A better annotation generator. Supports multiple languages and annotation conventions.
|
||||
-- https://github.com/danymat/neogen
|
||||
{
|
||||
"danymat/neogen",
|
||||
dependencies = "nvim-treesitter/nvim-treesitter",
|
||||
version = "*",
|
||||
cmd = "Neogen",
|
||||
opts = {
|
||||
snippet_engine = "luasnip",
|
||||
languages = {
|
||||
lua = { template = { annotation_convention = "ldoc" } },
|
||||
typescript = { template = { annotation_convention = "tsdoc" } },
|
||||
typescriptreact = { template = { annotation_convention = "tsdoc" } },
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>baa",
|
||||
function()
|
||||
require("neogen").generate({ type = "current" })
|
||||
end,
|
||||
desc = "Current",
|
||||
},
|
||||
{
|
||||
"<leader>bac",
|
||||
function()
|
||||
require("neogen").generate({ type = "class" })
|
||||
end,
|
||||
desc = "Class",
|
||||
},
|
||||
{
|
||||
"<leader>baf",
|
||||
function()
|
||||
require("neogen").generate({ type = "func" })
|
||||
end,
|
||||
desc = "Function",
|
||||
},
|
||||
{
|
||||
"<leader>bat",
|
||||
function()
|
||||
require("neogen").generate({ type = "type" })
|
||||
end,
|
||||
desc = "Type",
|
||||
},
|
||||
{
|
||||
"<leader>baF",
|
||||
function()
|
||||
require("neogen").generate({ type = "file" })
|
||||
end,
|
||||
desc = "File",
|
||||
},
|
||||
},
|
||||
},
|
||||
-- Describe the regexp under the cursor
|
||||
-- https://github.com/bennypowers/nvim-regexplainer
|
||||
{
|
||||
"bennypowers/nvim-regexplainer",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
opts = {
|
||||
-- automatically show the explainer when the cursor enters a regexp
|
||||
auto = true,
|
||||
},
|
||||
},
|
||||
|
||||
-- Clarify and beautify your comments using boxes and lines.
|
||||
-- https://github.com/LudoPinelli/comment-box.nvim
|
||||
{ "LudoPinelli/comment-box.nvim", opts = {} },
|
||||
|
||||
-- Tabnine Client for Neovim
|
||||
-- https://github.com/codota/tabnine-nvim
|
||||
{
|
||||
"codota/tabnine-nvim",
|
||||
name = "tabnine",
|
||||
build = vim.loop.os_uname().sysname == "Windows_NT" and "pwsh.exe -file .\\dl_binaries.ps1" or "./dl_binaries.sh",
|
||||
cmd = { "TabnineStatus", "TabnineDisable", "TabnineEnable", "TabnineToggle" },
|
||||
event = "User",
|
||||
opts = {
|
||||
accept_keymap = "<C-CR>",
|
||||
dismiss_keymap = "<C-Esc>",
|
||||
},
|
||||
},
|
||||
|
||||
-- Vim plugin for automatic time tracking and metrics generated from your programming activity.
|
||||
-- https://github.com/wakatime/vim-wakatime
|
||||
{ "wakatime/vim-wakatime", lazy = false, enabled = true },
|
||||
}
|
||||
266
config/nvim/lua/plugins/example.lua
Normal file
266
config/nvim/lua/plugins/example.lua
Normal file
@@ -0,0 +1,266 @@
|
||||
-- since this is just an example spec, don't actually load anything here and return an empty spec
|
||||
-- stylua: ignore
|
||||
if true then return {} end
|
||||
|
||||
-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim
|
||||
--
|
||||
-- In your plugin files, you can:
|
||||
-- * add extra plugins
|
||||
-- * disable/enabled LazyVim plugins
|
||||
-- * override the configuration of LazyVim plugins
|
||||
return {
|
||||
-- add gruvbox
|
||||
{ "ellisonleao/gruvbox.nvim" },
|
||||
|
||||
-- Configure LazyVim to load gruvbox
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
opts = {
|
||||
colorscheme = "gruvbox",
|
||||
},
|
||||
},
|
||||
|
||||
-- change trouble config
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
-- opts will be merged with the parent spec
|
||||
opts = { use_diagnostic_signs = true },
|
||||
},
|
||||
|
||||
-- disable trouble
|
||||
{ "folke/trouble.nvim", enabled = false },
|
||||
|
||||
-- add symbols-outline
|
||||
{
|
||||
"simrat39/symbols-outline.nvim",
|
||||
cmd = "SymbolsOutline",
|
||||
keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
|
||||
config = true,
|
||||
},
|
||||
|
||||
-- override nvim-cmp and add cmp-emoji
|
||||
{
|
||||
"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" } }))
|
||||
end,
|
||||
},
|
||||
|
||||
-- change some telescope options and a keymap to browse plugin files
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
keys = {
|
||||
-- add a keymap to browse plugin files
|
||||
-- stylua: ignore
|
||||
{
|
||||
"<leader>fp",
|
||||
function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end,
|
||||
desc = "Find Plugin File",
|
||||
},
|
||||
},
|
||||
-- change some options
|
||||
opts = {
|
||||
defaults = {
|
||||
layout_strategy = "horizontal",
|
||||
layout_config = { prompt_position = "top" },
|
||||
sorting_strategy = "ascending",
|
||||
winblend = 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- add telescope-fzf-native
|
||||
{
|
||||
"telescope.nvim",
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "make",
|
||||
config = function()
|
||||
require("telescope").load_extension("fzf")
|
||||
end,
|
||||
},
|
||||
},
|
||||
|
||||
-- add pyright to lspconfig
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
---@class PluginLspOpts
|
||||
opts = {
|
||||
---@type lspconfig.options
|
||||
servers = {
|
||||
-- pyright will be automatically installed with mason and loaded with lspconfig
|
||||
pyright = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- add tsserver and setup with typescript.nvim instead of lspconfig
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"jose-elias-alvarez/typescript.nvim",
|
||||
init = function()
|
||||
require("lazyvim.util").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 })
|
||||
end)
|
||||
end,
|
||||
},
|
||||
---@class PluginLspOpts
|
||||
opts = {
|
||||
---@type lspconfig.options
|
||||
servers = {
|
||||
-- tsserver will be automatically installed with mason and loaded with lspconfig
|
||||
tsserver = {},
|
||||
},
|
||||
-- you can do any additional lsp server setup here
|
||||
-- return true if you don't want this server to be setup with lspconfig
|
||||
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
|
||||
setup = {
|
||||
-- example to setup with typescript.nvim
|
||||
tsserver = function(_, opts)
|
||||
require("typescript").setup({ server = opts })
|
||||
return true
|
||||
end,
|
||||
-- Specify * to use this function as a fallback for any server
|
||||
-- ["*"] = function(server, opts) end,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- for typescript, LazyVim also includes extra specs to properly setup lspconfig,
|
||||
-- treesitter, mason and typescript.nvim. So instead of the above, you can use:
|
||||
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||
|
||||
-- add more treesitter parsers
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"html",
|
||||
"javascript",
|
||||
"json",
|
||||
"lua",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"python",
|
||||
"query",
|
||||
"regex",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"vim",
|
||||
"yaml",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above
|
||||
-- would overwrite `ensure_installed` with the new value.
|
||||
-- If you'd rather extend the default config, use the code below instead:
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
-- add tsx and treesitter
|
||||
vim.list_extend(opts.ensure_installed, {
|
||||
"tsx",
|
||||
"typescript",
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- the opts function can also be used to change the default opts:
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sections.lualine_x, "😄")
|
||||
end,
|
||||
},
|
||||
|
||||
-- or you can return new options to override all the defaults
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function()
|
||||
return {
|
||||
--[[add your custom lualine config here]]
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
-- use mini.starter instead of alpha
|
||||
{ import = "lazyvim.plugins.extras.ui.mini-starter" },
|
||||
|
||||
-- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc
|
||||
{ import = "lazyvim.plugins.extras.lang.json" },
|
||||
|
||||
-- add any tools you want to have installed below
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"stylua",
|
||||
"shellcheck",
|
||||
"shfmt",
|
||||
"flake8",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Use <tab> for completion and snippets (supertab)
|
||||
-- first: disable default <tab> and <s-tab> behavior in LuaSnip
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
keys = function()
|
||||
return {}
|
||||
end,
|
||||
},
|
||||
-- then: setup supertab in cmp
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-emoji",
|
||||
},
|
||||
---@param opts cmp.ConfigSchema
|
||||
opts = function(_, opts)
|
||||
local has_words_before = function()
|
||||
unpack = unpack or table.unpack
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||
end
|
||||
|
||||
local luasnip = require("luasnip")
|
||||
local cmp = require("cmp")
|
||||
|
||||
opts.mapping = vim.tbl_extend("force", opts.mapping, {
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
|
||||
-- this way you will only jump inside the snippet region
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
-- Git integration for buffers
|
||||
-- https://github.com/lewis6991/gitsigns.nvim
|
||||
-- luacheck: globals vim
|
||||
return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = {
|
||||
signs = {
|
||||
add = { hl = "GitSignsAdd", text = "┃", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
|
||||
change = { hl = "GitSignsChange", text = "┃", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
|
||||
delete = { hl = "GitSignsDelete", text = "_", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
|
||||
topdelete = { hl = "GitSignsDelete", text = "‾", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
|
||||
changedelete = { hl = "GitSignsChange", text = "~", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
|
||||
},
|
||||
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
||||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||
on_attach = function(bufnr)
|
||||
local gs = package.loaded.gitsigns
|
||||
|
||||
local function map(mode, l, r, opts)
|
||||
opts = opts or {}
|
||||
opts.buffer = bufnr
|
||||
vim.keymap.set(mode, l, r, opts)
|
||||
end
|
||||
|
||||
-- Navigation
|
||||
map("n", "]c", function()
|
||||
if vim.wo.diff then return "]c" end
|
||||
vim.schedule(function() gs.next_hunk() end)
|
||||
return "<Ignore>"
|
||||
end, { expr = true })
|
||||
|
||||
map("n", "[c", function()
|
||||
if vim.wo.diff then return "[c" end
|
||||
vim.schedule(function() gs.prev_hunk() end)
|
||||
return "<Ignore>"
|
||||
end, { expr = true })
|
||||
|
||||
-- Actions
|
||||
map("n", "<leader>oghs", gs.stage_hunk, { desc = "Stage Hunk" })
|
||||
map("n", "<leader>oghr", gs.reset_hunk, { desc = "Reset Hunk" })
|
||||
map("v", "<leader>oghs", function() gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) end)
|
||||
map("v", "<leader>oghr", function() gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) end)
|
||||
map("n", "<leader>oghS", gs.stage_buffer, { desc = "Stage Buffer" })
|
||||
map("n", "<leader>oghu", gs.undo_stage_hunk, { desc = "Undo Stage Hunk" })
|
||||
map("n", "<leader>oghR", gs.reset_buffer, { desc = "Reset Buffer" })
|
||||
map("n", "<leader>oghp", gs.preview_hunk, { desc = "Preview Hunk" })
|
||||
map("n", "<leader>ogbl", function() gs.blame_line({ full = true }) end, { desc = "Blame Line" })
|
||||
map("n", "<leader>ogbt", gs.toggle_current_line_blame, { desc = "Toggle Current Line Blame" })
|
||||
map("n", "<leader>oghd", gs.diffthis, { desc = "Diff This" })
|
||||
map("n", "<leader>oghD", function() gs.diffthis("~") end)
|
||||
map("n", "<leader>ogtd", gs.toggle_deleted, { desc = "Toggle Deleted" })
|
||||
|
||||
-- Text object
|
||||
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>")
|
||||
end,
|
||||
watch_gitdir = {
|
||||
interval = 1000,
|
||||
follow_files = true,
|
||||
},
|
||||
attach_to_untracked = true,
|
||||
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 1000,
|
||||
},
|
||||
current_line_blame_formatter_opts = {
|
||||
relative_time = false,
|
||||
},
|
||||
sign_priority = 6,
|
||||
update_debounce = 100,
|
||||
status_formatter = nil, -- Use default
|
||||
max_file_length = 40000,
|
||||
preview_config = {
|
||||
-- Options passed to nvim_open_win
|
||||
border = "single",
|
||||
style = "minimal",
|
||||
relative = "cursor",
|
||||
row = 0,
|
||||
col = 1,
|
||||
},
|
||||
yadm = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,259 +0,0 @@
|
||||
-- luacheck: globals vim
|
||||
local vim = vim
|
||||
|
||||
return {
|
||||
-- plenary: full; complete; entire; absolute; unqualified.
|
||||
-- All the lua functions I don't want to write twice.
|
||||
-- https://github.com/nvim-lua/plenary.nvim
|
||||
{ "nvim-lua/plenary.nvim", lazy = true },
|
||||
|
||||
-- lua `fork` of vim-web-devicons for neovim
|
||||
-- https://github.com/nvim-tree/nvim-web-devicons
|
||||
{ "nvim-tree/nvim-web-devicons" },
|
||||
|
||||
-- The theme of choise, catppuccin
|
||||
-- https://github.com/catppuccin/nvim
|
||||
{
|
||||
"catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
priority = 10000,
|
||||
enabled = true,
|
||||
lazy = false,
|
||||
config = function() vim.cmd.colorscheme("catppuccin") end,
|
||||
opts = {
|
||||
flavour = "mocha",
|
||||
transparent_background = true,
|
||||
dim_inactive = {
|
||||
enabled = true,
|
||||
shade = "dark",
|
||||
percentage = 0.15,
|
||||
},
|
||||
integrations = {
|
||||
aerial = true,
|
||||
barbecue = {
|
||||
-- directory name is dimmed by default
|
||||
dim_dirname = true,
|
||||
bold_basename = true,
|
||||
dim_context = false,
|
||||
alt_background = false,
|
||||
},
|
||||
cmp = true,
|
||||
dap = { enabled = true, enable_ui = true },
|
||||
fidget = true,
|
||||
gitsigns = true,
|
||||
harpoon = true,
|
||||
indent_blankline = {
|
||||
enabled = true,
|
||||
colored_indent_levels = false,
|
||||
},
|
||||
mason = true,
|
||||
mini = true,
|
||||
neotree = true,
|
||||
notify = true,
|
||||
native_lsp = {
|
||||
enabled = true,
|
||||
virtual_text = {
|
||||
errors = { "italic" },
|
||||
hints = { "italic" },
|
||||
warnings = { "italic" },
|
||||
information = { "italic" },
|
||||
},
|
||||
underlines = {
|
||||
errors = { "underline" },
|
||||
hints = { "underline" },
|
||||
warnings = { "underline" },
|
||||
information = { "underline" },
|
||||
},
|
||||
inlay_hints = {
|
||||
background = true,
|
||||
},
|
||||
},
|
||||
semantic_tokens = true,
|
||||
symbols_outline = true,
|
||||
telescope = {
|
||||
enabled = true,
|
||||
style = "catppuccin",
|
||||
},
|
||||
treesitter = true,
|
||||
lsp_trouble = true,
|
||||
which_key = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Notifications as a popup
|
||||
-- https://github.com/rcarriga/nvim-notify
|
||||
{
|
||||
"rcarriga/nvim-notify",
|
||||
keys = {
|
||||
{
|
||||
"<leader>un",
|
||||
function() require("notify").dismiss({ silent = true, pending = true }) end,
|
||||
desc = "Dismiss all Notifications",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
timeout = 3000,
|
||||
max_height = function() return math.floor(vim.o.lines * 0.75) end,
|
||||
max_width = function() return math.floor(vim.o.columns * 0.75) end,
|
||||
},
|
||||
init = function() vim.notify = require("notify") end,
|
||||
},
|
||||
|
||||
-- vscode-like pictograms for neovim lsp completion items
|
||||
-- https://github.com/onsails/lspkind.nvim
|
||||
{ "onsails/lspkind-nvim" },
|
||||
|
||||
-- Save and restore Vim views automatically
|
||||
-- https://github.com/senderle/restoreview
|
||||
{ "senderle/restoreview" },
|
||||
|
||||
-- Create key bindings that stick. WhichKey is a lua plugin for Neovim that
|
||||
-- displays a popup with possible keybindings of the command you started typing.
|
||||
-- https://github.com/folke/which-key.nvim
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
enabled = true,
|
||||
lazy = false,
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 300
|
||||
end,
|
||||
opts = {
|
||||
plugins = { spelling = true, marks = true, registers = true },
|
||||
},
|
||||
},
|
||||
|
||||
-- Neovim plugin to improve the default vim.ui interfaces
|
||||
-- https://github.com/stevearc/dressing.nvim
|
||||
{
|
||||
"stevearc/dressing.nvim",
|
||||
lazy = true,
|
||||
init = function()
|
||||
---@diagnostic disable-next-line: duplicate-set-field
|
||||
vim.ui.select = function(...)
|
||||
require("lazy").load({ plugins = { "dressing.nvim" } })
|
||||
return vim.ui.select(...)
|
||||
end
|
||||
---@diagnostic disable-next-line: duplicate-set-field
|
||||
vim.ui.input = function(...)
|
||||
require("lazy").load({ plugins = { "dressing.nvim" } })
|
||||
return vim.ui.input(...)
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- A tree like view for symbols in Neovim using the LSP.
|
||||
-- https://github.com/simrat39/symbols-outline.nvim
|
||||
{
|
||||
"simrat39/symbols-outline.nvim",
|
||||
cmd = "SymbolsOutline",
|
||||
keys = { { "<leader>bs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
|
||||
opts = {
|
||||
-- add your options that should be passed to the setup() function here
|
||||
position = "right",
|
||||
},
|
||||
},
|
||||
|
||||
-- Getting you where you want with the fewest keystrokes.
|
||||
-- https://github.com/ThePrimeagen/harpoon
|
||||
{ "ThePrimeagen/harpoon" },
|
||||
|
||||
-- A Neovim plugin hiding your colorcolumn when unneeded.
|
||||
-- https://github.com/m4xshen/smartcolumn.nvim
|
||||
{
|
||||
"m4xshen/smartcolumn.nvim",
|
||||
opts = {
|
||||
colorcolumn = { "80", "100", "120" },
|
||||
disabled_filetypes = {
|
||||
"dashboard",
|
||||
"help",
|
||||
"json",
|
||||
"lazy",
|
||||
"lazyterm",
|
||||
"mason",
|
||||
"neo-tree",
|
||||
"notify",
|
||||
"starter",
|
||||
"toggleterm",
|
||||
"Trouble",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Status information for LSP.
|
||||
-- https://github.com/j-hui/fidget.nvim
|
||||
{ "j-hui/fidget.nvim" },
|
||||
|
||||
-- A neovim lua plugin to help easily manage multiple terminal windows
|
||||
-- https://github.com/akinsho/toggleterm.nvim
|
||||
{
|
||||
"akinsho/toggleterm.nvim",
|
||||
version = "*",
|
||||
opts = {
|
||||
open_mapping = [[<c-t>]],
|
||||
insert_mappings = true,
|
||||
-- direction = "float",
|
||||
float_opts = {
|
||||
width = function() return math.floor(vim.o.columns * 0.9) end,
|
||||
height = function() return math.floor(vim.o.lines * 0.9) end,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Close buffer without messing up with the window.
|
||||
-- https://github.com/famiu/bufdelete.nvim
|
||||
{ "famiu/bufdelete.nvim" },
|
||||
|
||||
-- Delete multiple vim buffers based on different conditions
|
||||
-- https://github.com/kazhala/close-buffers.nvim
|
||||
{ "kazhala/close-buffers.nvim" },
|
||||
|
||||
-- JSON schemas for Neovim
|
||||
-- https://github.com/b0o/schemastore.nvim
|
||||
{ "b0o/schemastore.nvim" },
|
||||
|
||||
-- sleuth.vim: Heuristically set buffer options
|
||||
-- https://github.com/tpope/vim-sleuth
|
||||
{ "tpope/vim-sleuth" },
|
||||
|
||||
-- Neovim plugin for locking a buffer to a window
|
||||
-- https://github.com/stevearc/stickybuf.nvim
|
||||
{ "stevearc/stickybuf.nvim", opts = {} },
|
||||
|
||||
-- Describe the regexp under the cursor
|
||||
-- https://github.com/bennypowers/nvim-regexplainer
|
||||
{
|
||||
"bennypowers/nvim-regexplainer",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
opts = {
|
||||
-- automatically show the explainer when the cursor enters a regexp
|
||||
auto = true,
|
||||
},
|
||||
},
|
||||
|
||||
-- Clarify and beautify your comments using boxes and lines.
|
||||
-- https://github.com/LudoPinelli/comment-box.nvim
|
||||
{ "LudoPinelli/comment-box.nvim", opts = {} },
|
||||
|
||||
-- Tabnine Client for Neovim
|
||||
-- https://github.com/codota/tabnine-nvim
|
||||
{
|
||||
"codota/tabnine-nvim",
|
||||
name = "tabnine",
|
||||
build = vim.loop.os_uname().sysname == "Windows_NT" and "pwsh.exe -file .\\dl_binaries.ps1" or "./dl_binaries.sh",
|
||||
cmd = { "TabnineStatus", "TabnineDisable", "TabnineEnable", "TabnineToggle" },
|
||||
event = "User",
|
||||
opts = {
|
||||
accept_keymap = "<C-CR>",
|
||||
dismiss_keymap = "<C-Esc>",
|
||||
},
|
||||
},
|
||||
|
||||
-- Vim plugin for automatic time tracking and metrics generated from your programming activity.
|
||||
-- https://github.com/wakatime/vim-wakatime
|
||||
{ "wakatime/vim-wakatime", lazy = false, enabled = true },
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
return {
|
||||
"echasnovski/mini.nvim",
|
||||
version = "*",
|
||||
config = function()
|
||||
-- Common configuration presets
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-basics.md
|
||||
require("mini.basics").setup()
|
||||
|
||||
-- Fast and flexible start screen
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-starter.md
|
||||
local starter = require("mini.starter")
|
||||
starter.setup({
|
||||
header = table.concat({
|
||||
" ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ",
|
||||
" ▄▀░░░░░░░░░░░░▄░░░░░░░▀▄ ",
|
||||
" █░░▄░░░░▄░░░░░░░░░░░░░░█ ",
|
||||
" █░░░░░░░░░░░░▄█▄▄░░▄░░░█ ▄▄▄ ",
|
||||
"▄▄▄▄▄ █░░░░░░▀░░░░▀█░░▀▄░░░░░█▀▀░██ ",
|
||||
"██▄▀██▄█░░░▄░░░░░░░██░░░░▀▀▀▀▀░░░░██ ",
|
||||
" ▀██▄▀██░░░░░░░░▀░██▀░░░░░░░░░░░░░▀██",
|
||||
" ▀████░▀░░░░▄░░░██░░░▄█░░░░▄░▄█░░██",
|
||||
" ▀█░░░░▄░░░░░██░░░░▄░░░▄░░▄░░░██",
|
||||
" ▄█▄░░░░░░░░░░░▀▄░░▀▀▀▀▀▀▀▀░░▄▀ ",
|
||||
" █▀▀█████████▀▀▀▀████████████▀ ",
|
||||
" ████▀ ███▀ ▀███ ▀██▀ ",
|
||||
}, "\n"),
|
||||
evaluate_single = true,
|
||||
items = {
|
||||
starter.sections.telescope(),
|
||||
starter.sections.builtin_actions(),
|
||||
starter.sections.recent_files(5, true, true),
|
||||
},
|
||||
content_hooks = {
|
||||
starter.gen_hook.adding_bullet(),
|
||||
starter.gen_hook.aligning("center", "center"),
|
||||
},
|
||||
})
|
||||
|
||||
-- Miscellaneous useful functions
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-misc.md
|
||||
require("mini.misc").setup()
|
||||
|
||||
-- Extend and create a/i textobjects
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-ai.md
|
||||
require("mini.ai").setup()
|
||||
|
||||
-- Align text interactively
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-align.md
|
||||
require("mini.align").setup()
|
||||
|
||||
-- Animate common Neovim actions
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-animate.md
|
||||
-- require("mini.animate").setup()
|
||||
|
||||
-- Go forward/backward with square brackets
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-bracketed.md
|
||||
require("mini.bracketed").setup()
|
||||
|
||||
-- Comment lines
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-comment.md
|
||||
require("mini.comment").setup()
|
||||
|
||||
-- Autocompletion and signature help plugin
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-completion.md
|
||||
-- require("mini.completion").setup()
|
||||
|
||||
-- Automatic highlighting of word under cursor
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-cursorword.md
|
||||
-- require("mini.cursorword").setup()
|
||||
|
||||
-- Highlight patterns in text
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-hipatterns.md
|
||||
local hipatterns = require("mini.hipatterns")
|
||||
hipatterns.setup({
|
||||
highlighters = {
|
||||
-- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE'
|
||||
fixme = { pattern = "%f[%w]()FIXME()%f[%W]", group = "MiniHipatternsFixme" },
|
||||
hack = { pattern = "%f[%w]()HACK()%f[%W]", group = "MiniHipatternsHack" },
|
||||
todo = { pattern = "%f[%w]()TODO()%f[%W]", group = "MiniHipatternsTodo" },
|
||||
note = { pattern = "%f[%w]()NOTE()%f[%W]", group = "MiniHipatternsNote" },
|
||||
|
||||
-- Highlight hex color strings (`#rrggbb`) using that color
|
||||
hex_color = hipatterns.gen_highlighter.hex_color(),
|
||||
},
|
||||
})
|
||||
|
||||
-- Visualize and work with indent scope
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-indentscope.md
|
||||
require("mini.indentscope").setup({
|
||||
draw = {
|
||||
delay = 0,
|
||||
-- animation = require("mini.indentscope").gen_animation("none"),
|
||||
},
|
||||
})
|
||||
|
||||
-- Jump to next/previous single character
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-jump.md
|
||||
require("mini.jump").setup()
|
||||
|
||||
-- Jump within visible lines via iterative label filtering
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-jump2d.md
|
||||
require("mini.jump2d").setup()
|
||||
|
||||
-- Window with buffer text overview, scrollbar, and highlights
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-map.md
|
||||
require("mini.map").setup()
|
||||
|
||||
-- Move any selection in any direction
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-move.md
|
||||
require("mini.move").setup()
|
||||
|
||||
-- Text edit operators
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-operators.md
|
||||
-- require("mini.operators").setup()
|
||||
|
||||
-- Minimal and fast autopairs
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-pairs.md
|
||||
require("mini.pairs").setup()
|
||||
|
||||
-- Split and join arguments
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-splitjoin.md
|
||||
require("mini.splitjoin").setup()
|
||||
|
||||
-- Minimal and fast statusline module with opinionated default look
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-statusline.md
|
||||
require("mini.statusline").setup()
|
||||
|
||||
-- Fast and feature-rich surround actions
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-surround.md
|
||||
require("mini.surround").setup()
|
||||
|
||||
-- Minimal and fast tabline showing listed buffers
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-tabline.md
|
||||
require("mini.tabline").setup()
|
||||
|
||||
-- Work with trailing whitespace
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-trailspace.md
|
||||
require("mini.trailspace").setup()
|
||||
end,
|
||||
}
|
||||
@@ -1,456 +0,0 @@
|
||||
-- File-tree manager.
|
||||
-- https://github.com/nvim-neo-tree/neo-tree.nvim
|
||||
-- luacheck: globals vim
|
||||
|
||||
-- Unless you are still migrating, remove the deprecated commands from v1.x
|
||||
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
|
||||
|
||||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"MunifTanjim/nui.nvim",
|
||||
{
|
||||
-- only needed if you want to use the commands with "_with_window_picker" suffix
|
||||
"s1n7ax/nvim-window-picker",
|
||||
config = function()
|
||||
require("window-picker").setup({
|
||||
autoselect_one = true,
|
||||
include_current = false,
|
||||
filter_rules = {
|
||||
-- filter using buffer options
|
||||
bo = {
|
||||
-- if the file type is one of following, the window will be ignored
|
||||
filetype = { "neo-tree", "neo-tree-popup", "notify" },
|
||||
|
||||
-- if the buffer type is one of following, the window will be ignored
|
||||
buftype = { "terminal", "quickfix" },
|
||||
},
|
||||
},
|
||||
other_win_hl_color = "#e35e4f",
|
||||
})
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
-- If you want icons for diagnostic errors, you'll need to define them somewhere:
|
||||
vim.fn.sign_define("DiagnosticSignError", { text = " ", texthl = "DiagnosticSignError" })
|
||||
vim.fn.sign_define("DiagnosticSignWarn", { text = " ", texthl = "DiagnosticSignWarn" })
|
||||
vim.fn.sign_define("DiagnosticSignInfo", { text = " ", texthl = "DiagnosticSignInfo" })
|
||||
vim.fn.sign_define("DiagnosticSignHint", { text = "", texthl = "DiagnosticSignHint" })
|
||||
|
||||
require("neo-tree").setup({
|
||||
-- Close Neo-tree if it is the last window left in the tab
|
||||
close_if_last_window = true,
|
||||
-- "double", "none", "rounded", "shadow", "single" or "solid"
|
||||
popup_border_style = "rounded",
|
||||
enable_git_status = true,
|
||||
enable_diagnostics = true,
|
||||
-- Enable normal mode for input dialogs.
|
||||
enable_normal_mode_for_inputs = false,
|
||||
|
||||
-- when opening files, do not use windows containing these filetypes or buftypes
|
||||
open_files_do_not_replace_types = { "terminal", "trouble", "qf" },
|
||||
|
||||
-- popup_border_style is for input and confirmation dialogs.
|
||||
-- Configurtaion of floating window is done in the individual source sections.
|
||||
-- "NC" is a special style that works well with NormalNC set
|
||||
close_floats_on_escape_key = true,
|
||||
default_source = "filesystem",
|
||||
git_status_async = true,
|
||||
-- "trace", "debug", "info", "warn", "error", "fatal"
|
||||
log_level = "info",
|
||||
-- true, false, "/path/to/file.log", use :NeoTreeLogs to show the file
|
||||
log_to_file = false,
|
||||
-- false = open files in top left window
|
||||
open_files_in_last_window = true,
|
||||
-- in ms, needed for containers to redraw right aligned and faded content
|
||||
resize_timer_interval = 100,
|
||||
-- used when sorting files and directories in the tree
|
||||
sort_case_insensitive = true,
|
||||
-- If false, inputs will use vim.ui.input() instead of custom floats.
|
||||
use_popups_for_input = false,
|
||||
-- use a custom function for sorting files and directories in the tree
|
||||
sort_function = nil,
|
||||
event_handlers = {
|
||||
-- {
|
||||
-- event = "before_render",
|
||||
-- handler = function (state)
|
||||
-- -- add something to the state that can be used by custom components
|
||||
-- end
|
||||
-- },
|
||||
-- {
|
||||
-- event = "file_opened",
|
||||
-- handler = function(file_path)
|
||||
-- --auto close
|
||||
-- require("neo-tree").close_all()
|
||||
-- end
|
||||
-- },
|
||||
-- {
|
||||
-- event = "file_opened",
|
||||
-- handler = function(file_path)
|
||||
-- --clear search after opening a file
|
||||
-- require("neo-tree.sources.filesystem").reset_search()
|
||||
-- end
|
||||
-- },
|
||||
-- {
|
||||
-- event = "file_renamed",
|
||||
-- handler = function(args)
|
||||
-- -- fix references to file
|
||||
-- print(args.source, " renamed to ", args.destination)
|
||||
-- end
|
||||
-- },
|
||||
-- {
|
||||
-- event = "file_moved",
|
||||
-- handler = function(args)
|
||||
-- -- fix references to file
|
||||
-- print(args.source, " moved to ", args.destination)
|
||||
-- end
|
||||
-- },
|
||||
{
|
||||
event = "neo_tree_buffer_enter",
|
||||
handler = function()
|
||||
vim.cmd("set winbar=")
|
||||
vim.cmd("highlight CursorLine gui='bold'")
|
||||
vim.cmd("highlight CursorColumn guibg=NONE")
|
||||
--vim.cmd("set guicursor+=a:InvisibleCursor")
|
||||
--vim.cmd("highlight InvisibleCursor gui=reverse blend=100")
|
||||
end,
|
||||
},
|
||||
{
|
||||
event = "neo_tree_buffer_leave",
|
||||
handler = function()
|
||||
--vim.cmd("set guicursor-=a:InvisibleCursor")
|
||||
vim.cmd("highlight CursorLine gui=NONE")
|
||||
end,
|
||||
},
|
||||
},
|
||||
default_component_configs = {
|
||||
container = {
|
||||
enable_character_fade = true,
|
||||
},
|
||||
indent = {
|
||||
indent_size = 2,
|
||||
-- extra padding on left hand side
|
||||
padding = 1,
|
||||
-- indent guides
|
||||
with_markers = true,
|
||||
indent_marker = "│",
|
||||
last_indent_marker = "└",
|
||||
highlight = "NeoTreeIndentMarker",
|
||||
-- expander config, needed for nesting files
|
||||
-- if nil and file nesting is enabled, will enable expanders
|
||||
with_expanders = true,
|
||||
expander_collapsed = "",
|
||||
expander_expanded = "",
|
||||
expander_highlight = "NeoTreeExpander",
|
||||
},
|
||||
icon = {
|
||||
folder_closed = "",
|
||||
folder_open = "",
|
||||
folder_empty = "-",
|
||||
-- The next two settings are only a fallback,
|
||||
-- if you use nvim-web-devicons and configure default icons there
|
||||
-- then these will never be used.
|
||||
default = "*",
|
||||
highlight = "NeoTreeFileIcon",
|
||||
},
|
||||
modified = {
|
||||
symbol = "[+]",
|
||||
highlight = "NeoTreeModified",
|
||||
},
|
||||
name = {
|
||||
trailing_slash = true,
|
||||
use_git_status_colors = false,
|
||||
highlight = "NeoTreeFileName",
|
||||
},
|
||||
git_status = {
|
||||
symbols = {
|
||||
-- Change type
|
||||
added = "˖",
|
||||
modified = "±",
|
||||
deleted = "✕",
|
||||
renamed = "↪",
|
||||
-- Status type
|
||||
untracked = "?",
|
||||
ignored = "⍨",
|
||||
unstaged = "·",
|
||||
staged = "✓",
|
||||
conflict = "",
|
||||
},
|
||||
},
|
||||
},
|
||||
-- A list of functions, each representing a global custom command
|
||||
-- that will be available in all sources (if not overridden in `opts[source_name].commands`)
|
||||
-- see `:h neo-tree-custom-commands-global`
|
||||
commands = {},
|
||||
window = {
|
||||
-- see https://github.com/MunifTanjim/nui.nvim/tree/main/lua/nui/popup for
|
||||
-- possible options. These can also be functions that return these options.
|
||||
|
||||
-- left, right, float, current
|
||||
position = "left",
|
||||
-- applies to left and right positions
|
||||
width = 40,
|
||||
mapping_options = {
|
||||
noremap = true,
|
||||
nowait = true,
|
||||
},
|
||||
-- settings that apply to float position only
|
||||
popup = {
|
||||
size = {
|
||||
height = "80%",
|
||||
width = "50%",
|
||||
},
|
||||
position = "50%", -- 50% means center it
|
||||
-- you can also specify border here, if you want a different setting from
|
||||
-- the global popup_border_style.
|
||||
},
|
||||
-- Mappings for tree window. See `:h nep-tree-mappings` for a list of built-in commands.
|
||||
-- You can also create your own commands by providing a function instead of a string.
|
||||
mappings = {
|
||||
["<space>"] = {
|
||||
"toggle_node",
|
||||
-- disable `nowait` if you have existing combos
|
||||
-- starting with this char that you want to use
|
||||
nowait = false,
|
||||
},
|
||||
["<2-LeftMouse>"] = "open",
|
||||
["<cr>"] = "open",
|
||||
-- close preview or floating neo-tree window
|
||||
["<esc>"] = "cancel",
|
||||
["P"] = { "toggle_preview", config = { use_float = true } },
|
||||
["l"] = "focus_preview",
|
||||
-- ["S"] = "open_split",
|
||||
-- ["s"] = "open_vsplit",
|
||||
["S"] = "split_with_window_picker",
|
||||
["s"] = "vsplit_with_window_picker",
|
||||
["t"] = "open_tabnew",
|
||||
-- ["<cr>"] = "open_drop",
|
||||
-- ["t"] = "open_tab_drop",
|
||||
["w"] = "open_with_window_picker",
|
||||
-- -- enter preview mode, which shows the current node without focusing
|
||||
--["P"] = "toggle_preview",
|
||||
["C"] = "close_node",
|
||||
-- ['C'] = 'close_all_subnodes',
|
||||
["z"] = "close_all_nodes",
|
||||
--["Z"] = "expand_all_nodes",
|
||||
["a"] = {
|
||||
"add",
|
||||
-- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc).
|
||||
-- see `:h neo-tree-file-actions` for details
|
||||
-- some commands may take optional config options,
|
||||
-- see `:h neo-tree-mappings` for details
|
||||
config = {
|
||||
-- "none", "relative", "absolute"
|
||||
show_path = "relative",
|
||||
},
|
||||
},
|
||||
-- also accepts the optional config.show_path option like "add".
|
||||
-- this also supports BASH style brace expansion.
|
||||
["A"] = "add_directory",
|
||||
["d"] = "delete",
|
||||
["r"] = "rename",
|
||||
["y"] = "copy_to_clipboard",
|
||||
["x"] = "cut_to_clipboard",
|
||||
["p"] = "paste_from_clipboard",
|
||||
-- takes text input for destination, also accepts the optional config.show_path option like "add":
|
||||
-- ["c"] = {
|
||||
-- "copy",
|
||||
-- config = {
|
||||
-- show_path = "none" -- "none", "relative", "absolute"
|
||||
-- }
|
||||
--}
|
||||
["c"] = "copy",
|
||||
-- takes text input for destination, also accepts the optional config.show_path option like "add".
|
||||
["m"] = "move",
|
||||
["q"] = "close_window",
|
||||
["R"] = "refresh",
|
||||
["?"] = "show_help",
|
||||
["<"] = "prev_source",
|
||||
[">"] = "next_source",
|
||||
},
|
||||
},
|
||||
nesting_rules = {},
|
||||
filesystem = {
|
||||
-- Add a custom command or override a global one using the same function name
|
||||
commands = {},
|
||||
components = {
|
||||
harpoon_index = function(config, node, _)
|
||||
local Marked = require("harpoon.mark")
|
||||
local path = node:get_id()
|
||||
local succuss, index = pcall(Marked.get_index_of, path)
|
||||
if succuss and index and index > 0 then
|
||||
return {
|
||||
text = string.format(" ⥤ %d", index), -- <-- Add your favorite harpoon like arrow here
|
||||
highlight = config.highlight or "NeoTreeDirectoryIcon",
|
||||
}
|
||||
else
|
||||
return {}
|
||||
end
|
||||
end,
|
||||
},
|
||||
renderers = {
|
||||
directory = {
|
||||
{ "indent" },
|
||||
{ "icon" },
|
||||
{ "current_filter" },
|
||||
{
|
||||
"container",
|
||||
width = "100%",
|
||||
right_padding = 0,
|
||||
--max_width = 60,
|
||||
content = {
|
||||
{ "name", zindex = 10 },
|
||||
{ "clipboard", zindex = 10 },
|
||||
{ "diagnostics", errors_only = true, zindex = 20, align = "right" },
|
||||
},
|
||||
},
|
||||
},
|
||||
file = {
|
||||
{ "indent" },
|
||||
{ "icon" },
|
||||
{
|
||||
"container",
|
||||
width = "100%",
|
||||
right_padding = 0,
|
||||
--max_width = 60,
|
||||
content = {
|
||||
{
|
||||
"name",
|
||||
use_git_status_colors = false,
|
||||
zindex = 10,
|
||||
},
|
||||
-- {
|
||||
-- "symlink_target",
|
||||
-- zindex = 10,
|
||||
-- highlight = "NeoTreeSymbolicLinkTarget",
|
||||
-- },
|
||||
{ "clipboard", zindex = 10 },
|
||||
{ "bufnr", zindex = 10 },
|
||||
{ "harpoon_index", zindex = 20, align = "right" },
|
||||
{ "modified", zindex = 20, align = "right" },
|
||||
{ "diagnostics", zindex = 20, align = "right" },
|
||||
{ "git_status", zindex = 20, align = "right" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
filtered_items = {
|
||||
-- when true, they will just be displayed differently than normal items
|
||||
visible = false,
|
||||
hide_dotfiles = false,
|
||||
hide_gitignored = false,
|
||||
-- only works on Windows for hidden files/directories
|
||||
hide_hidden = true,
|
||||
hide_by_name = {
|
||||
".git",
|
||||
".DS_Store",
|
||||
"thumbs.db",
|
||||
".idea",
|
||||
".mypy_cache",
|
||||
"node_modules",
|
||||
},
|
||||
-- uses glob style patterns
|
||||
hide_by_pattern = {
|
||||
--"*.meta",
|
||||
--"*/src/*/tsconfig.json",
|
||||
"*-cache",
|
||||
"*.cache",
|
||||
".null-ls_*",
|
||||
},
|
||||
never_show = { -- remains hidden even if visible is toggled to true
|
||||
".DS_Store",
|
||||
"thumbs.db",
|
||||
},
|
||||
always_show = { -- remains visible even if other settings would normally hide it
|
||||
".gitignore",
|
||||
".gitkeep",
|
||||
},
|
||||
},
|
||||
find_by_full_path_words = true,
|
||||
-- when true, empty folders will be grouped together
|
||||
group_empty_dirs = false,
|
||||
-- true creates a 2-way binding between vim's cwd and neo-tree's root
|
||||
bind_to_cwd = false,
|
||||
-- max number of search results when using filters
|
||||
search_limit = 50,
|
||||
follow_current_file = {
|
||||
-- This will find and focus the file in the active buffer every time
|
||||
-- the current file is changed while the tree is open.
|
||||
enabled = false,
|
||||
-- `false` closes auto expanded dirs, such as with `:Neotree reveal`
|
||||
leave_dirs_open = false,
|
||||
},
|
||||
-- netrw disabled, opening a directory opens neo-tree
|
||||
-- in whatever position is specified in window.position
|
||||
-- "open_current", -- netrw disabled, opening a directory opens within the
|
||||
-- window like netrw would, regardless of window.position
|
||||
-- "disabled", -- netrw left alone, neo-tree does not handle opening dirs
|
||||
hijack_netrw_behavior = "open_default",
|
||||
-- This will use the OS level file watchers to detect changes
|
||||
-- instead of relying on nvim autocmd events.
|
||||
use_libuv_file_watcher = true,
|
||||
window = {
|
||||
mappings = {
|
||||
["."] = "set_root",
|
||||
["/"] = "fuzzy_finder",
|
||||
-- fuzzy sorting using the fzy algorithm
|
||||
["#"] = "fuzzy_sorter",
|
||||
["<bs>"] = "navigate_up",
|
||||
["<c-up>"] = "navigate_up",
|
||||
["<c-x>"] = "clear_filter",
|
||||
["D"] = "fuzzy_finder_directory",
|
||||
["f"] = "filter_on_submit",
|
||||
["gn"] = "next_git_modified",
|
||||
["gp"] = "prev_git_modified",
|
||||
["H"] = "toggle_hidden",
|
||||
},
|
||||
-- define keymaps for filter popup window in fuzzy_finder_mode
|
||||
fuzzy_finder_mappings = {
|
||||
["<down>"] = "move_cursor_down",
|
||||
["<C-n>"] = "move_cursor_down",
|
||||
["<up>"] = "move_cursor_up",
|
||||
["<C-p>"] = "move_cursor_up",
|
||||
},
|
||||
},
|
||||
},
|
||||
buffers = {
|
||||
follow_current_file = {
|
||||
-- This will find and focus the file in the active buffer every time
|
||||
-- the current file is changed while the tree is open.
|
||||
enabled = true,
|
||||
-- `false` closes auto expanded dirs, such as with `:Neotree reveal`
|
||||
leave_dirs_open = true,
|
||||
},
|
||||
-- when true, empty folders will be grouped together
|
||||
group_empty_dirs = true,
|
||||
show_unloaded = true,
|
||||
window = {
|
||||
mappings = {
|
||||
["bd"] = "buffer_delete",
|
||||
["<bs>"] = "navigate_up",
|
||||
["."] = "set_root",
|
||||
},
|
||||
},
|
||||
},
|
||||
git_status = {
|
||||
window = {
|
||||
position = "float",
|
||||
mappings = {
|
||||
["A"] = "git_add_all",
|
||||
["gu"] = "git_unstage_file",
|
||||
["ga"] = "git_add_file",
|
||||
["gr"] = "git_revert_file",
|
||||
["gc"] = "git_commit",
|
||||
["gp"] = "git_push",
|
||||
["gg"] = "git_commit_and_push",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.cmd([[nnoremap \ :Neotree reveal<cr>]])
|
||||
end,
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
-- A better annotation generator. Supports multiple languages and annotation conventions.
|
||||
-- https://github.com/danymat/neogen
|
||||
return {
|
||||
"danymat/neogen",
|
||||
dependencies = "nvim-treesitter/nvim-treesitter",
|
||||
version = "*",
|
||||
cmd = "Neogen",
|
||||
opts = {
|
||||
snippet_engine = "luasnip",
|
||||
languages = {
|
||||
lua = { template = { annotation_convention = "ldoc" } },
|
||||
typescript = { template = { annotation_convention = "tsdoc" } },
|
||||
typescriptreact = { template = { annotation_convention = "tsdoc" } },
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>baa", function() require("neogen").generate({ type = "current" }) end, desc = "Current" },
|
||||
{ "<leader>bac", function() require("neogen").generate({ type = "class" }) end, desc = "Class" },
|
||||
{ "<leader>baf", function() require("neogen").generate({ type = "func" }) end, desc = "Function" },
|
||||
{ "<leader>bat", function() require("neogen").generate({ type = "type" }) end, desc = "Type" },
|
||||
{ "<leader>baF", function() require("neogen").generate({ type = "file" }) end, desc = "File" },
|
||||
},
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
return {
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
config = function()
|
||||
local null_ls = require("null-ls")
|
||||
-- Check supported formatters and linters
|
||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting
|
||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
|
||||
|
||||
-- Register any number of sources simultaneously
|
||||
null_ls.setup({
|
||||
-- filetypes = { "markdown", "text" },
|
||||
sources = {
|
||||
|
||||
-- Code Actions
|
||||
null_ls.builtins.code_actions.eslint,
|
||||
null_ls.builtins.code_actions.gitsigns,
|
||||
null_ls.builtins.code_actions.refactoring,
|
||||
null_ls.builtins.code_actions.shellcheck,
|
||||
|
||||
-- Diagnostics
|
||||
null_ls.builtins.diagnostics.actionlint,
|
||||
null_ls.builtins.diagnostics.alex,
|
||||
null_ls.builtins.diagnostics.ansiblelint,
|
||||
null_ls.builtins.diagnostics.dotenv_linter,
|
||||
null_ls.builtins.diagnostics.editorconfig_checker,
|
||||
null_ls.builtins.diagnostics.eslint,
|
||||
null_ls.builtins.diagnostics.jsonlint,
|
||||
null_ls.builtins.diagnostics.luacheck,
|
||||
null_ls.builtins.diagnostics.php,
|
||||
null_ls.builtins.diagnostics.phpcs,
|
||||
null_ls.builtins.diagnostics.phpstan,
|
||||
null_ls.builtins.diagnostics.psalm,
|
||||
null_ls.builtins.diagnostics.semgrep,
|
||||
null_ls.builtins.diagnostics.shellcheck,
|
||||
null_ls.builtins.diagnostics.stylelint,
|
||||
null_ls.builtins.diagnostics.tfsec,
|
||||
null_ls.builtins.diagnostics.trail_space,
|
||||
null_ls.builtins.diagnostics.tsc,
|
||||
null_ls.builtins.diagnostics.write_good,
|
||||
null_ls.builtins.diagnostics.zsh,
|
||||
|
||||
-- Formatting
|
||||
null_ls.builtins.formatting.clang_format,
|
||||
null_ls.builtins.formatting.fixjson,
|
||||
null_ls.builtins.formatting.isort,
|
||||
null_ls.builtins.formatting.jq,
|
||||
null_ls.builtins.formatting.phpcsfixer,
|
||||
null_ls.builtins.formatting.prettier,
|
||||
null_ls.builtins.formatting.rome,
|
||||
null_ls.builtins.formatting.shfmt.with({
|
||||
args = { "-i", "1", "-bn", "-ci", "-sr", "-kb", "-fn" },
|
||||
}),
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
--
|
||||
-- Shows how to use the DAP plugin to debug your code.
|
||||
--
|
||||
-- https://github.com/mfussenegger/nvim-dap
|
||||
-- luacheck: globals vim
|
||||
return {
|
||||
"mfussenegger/nvim-dap",
|
||||
dependencies = {
|
||||
-- Creates a beautiful debugger UI
|
||||
"rcarriga/nvim-dap-ui",
|
||||
|
||||
-- Installs the debug adapters for you
|
||||
"williamboman/mason.nvim",
|
||||
"jay-babu/mason-nvim-dap.nvim",
|
||||
|
||||
-- Add your own debuggers here
|
||||
"leoluz/nvim-dap-go",
|
||||
},
|
||||
config = function()
|
||||
local dap = require("dap")
|
||||
local dapui = require("dapui")
|
||||
|
||||
require("mason-nvim-dap").setup({
|
||||
-- Makes a best effort to setup the various debuggers with
|
||||
-- reasonable debug configurations
|
||||
automatic_setup = true,
|
||||
automatic_installation = true,
|
||||
|
||||
-- You can provide additional configuration to the handlers,
|
||||
-- see mason-nvim-dap README for more information
|
||||
-- handlers = {},
|
||||
|
||||
-- You'll need to check that you have the required things installed
|
||||
-- online, please don't ask me how to install them :)
|
||||
ensure_installed = {
|
||||
-- Update this to ensure that you have the debuggers for the langs you want
|
||||
"bash",
|
||||
"delve",
|
||||
"jq",
|
||||
"js",
|
||||
"lua",
|
||||
"php",
|
||||
"python",
|
||||
"stylua",
|
||||
},
|
||||
handlers = {
|
||||
function(config)
|
||||
-- all sources with no handler get passed here
|
||||
|
||||
-- Keep original functionality
|
||||
require("mason-nvim-dap").default_setup(config)
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
local wk = require("which-key")
|
||||
wk.register({
|
||||
-- Basic debugging keymaps, feel free to change to your liking!
|
||||
["<F5>"] = { dap.continue, "Debug: Start/Continue" },
|
||||
["<F1>"] = { dap.step_into, "Debug: Step Into" },
|
||||
["<F2>"] = { dap.step_over, "Debug: Step Over" },
|
||||
["<F3>"] = { dap.step_out, "Debug: Step Out" },
|
||||
["<leader>Db"] = { dap.toggle_breakpoint, "Debug: Toggle Breakpoint" },
|
||||
["<leader>DB"] = {
|
||||
function() dap.set_breakpoint(vim.fn.input("Breakpoint condition: ")) end,
|
||||
"Debug: Set Breakpoint",
|
||||
},
|
||||
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
|
||||
["<F7>"] = { dapui.toggle, "Debug: See last session result." },
|
||||
}, { prefix = "", mode = "n" })
|
||||
|
||||
-- Dap UI setup
|
||||
-- For more information, see |:help nvim-dap-ui|
|
||||
dapui.setup({
|
||||
-- Set icons to characters that are more likely to work in every terminal.
|
||||
-- Feel free to remove or use ones that you like more! :)
|
||||
-- Don't feel like these are good choices.
|
||||
icons = { expanded = "▾", collapsed = "▸", current_frame = "*" },
|
||||
controls = {
|
||||
icons = {
|
||||
pause = "⏸",
|
||||
play = "▶",
|
||||
step_into = "⏎",
|
||||
step_over = "⏭",
|
||||
step_out = "⏮",
|
||||
step_back = "b",
|
||||
run_last = "▶▶",
|
||||
terminate = "⏹",
|
||||
disconnect = "⏏",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
dap.listeners.after.event_initialized["dapui_config"] = dapui.open
|
||||
dap.listeners.before.event_terminated["dapui_config"] = dapui.close
|
||||
dap.listeners.before.event_exited["dapui_config"] = dapui.close
|
||||
|
||||
-- Install golang specific config
|
||||
require("dap-go").setup()
|
||||
end,
|
||||
}
|
||||
@@ -1,87 +1,17 @@
|
||||
-- Quickstart configs for Nvim LSP
|
||||
-- https://github.com/neovim/nvim-lspconfig
|
||||
-- luacheck: globals vim
|
||||
return {
|
||||
-- LSP auto-complete.
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
-- Automatically install LSPs to stdpath for neovim
|
||||
{ "williamboman/mason.nvim", config = true },
|
||||
{ "williamboman/mason-lspconfig.nvim" },
|
||||
|
||||
-- Useful status updates for LSP
|
||||
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
|
||||
-- NOTE: using tag legacy, fidget is being re-written completely
|
||||
{ "j-hui/fidget.nvim", event = "LspAttach", tag = "legacy", opts = {} },
|
||||
|
||||
-- Additional lua configuration, makes nvim stuff amazing!
|
||||
{ "folke/neodev.nvim" },
|
||||
},
|
||||
init = function()
|
||||
-- disable lsp watcher. Too slow on linux
|
||||
local ok, wf = pcall(require, "vim.lsp._watchfiles")
|
||||
if ok then
|
||||
wf._watchfunc = function()
|
||||
return function() end
|
||||
end
|
||||
end
|
||||
end,
|
||||
config = function()
|
||||
-- Switch for controlling whether you want autoformatting.
|
||||
-- Use :KickstartFormatToggle to toggle autoformatting on or off
|
||||
local format_is_enabled = true
|
||||
vim.api.nvim_create_user_command("KickstartFormatToggle", function()
|
||||
format_is_enabled = not format_is_enabled
|
||||
print("Setting autoformatting to: " .. tostring(format_is_enabled))
|
||||
end, {})
|
||||
|
||||
-- Create an augroup that is used for managing our formatting autocmds.
|
||||
-- We need one augroup per client to make sure that multiple clients
|
||||
-- can attach to the same buffer without interfering with each other.
|
||||
local _augroups = {}
|
||||
local get_augroup = function(client)
|
||||
if not _augroups[client.id] then
|
||||
local group_name = "kickstart-lsp-format-" .. client.name
|
||||
local id = vim.api.nvim_create_augroup(group_name, { clear = true })
|
||||
_augroups[client.id] = id
|
||||
end
|
||||
|
||||
return _augroups[client.id]
|
||||
end
|
||||
|
||||
-- Whenever an LSP attaches to a buffer, we will run this function.
|
||||
--
|
||||
-- See `:help LspAttach` for more information about this autocmd event.
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("kickstart-lsp-attach-format", { clear = true }),
|
||||
-- This is where we attach the autoformatting for reasonable clients
|
||||
callback = function(args)
|
||||
local client_id = args.data.client_id
|
||||
local client = vim.lsp.get_client_by_id(client_id)
|
||||
local bufnr = args.buf
|
||||
|
||||
-- Only attach to clients that support document formatting
|
||||
if not client.server_capabilities.documentFormattingProvider then return end
|
||||
|
||||
-- Tsserver usually works poorly. Sorry you work with bad languages
|
||||
-- You can remove this line if you know what you're doing :)
|
||||
if client.name == "tsserver" then return end
|
||||
|
||||
-- Create an autocmd that will run *before* we save the buffer.
|
||||
-- Run the formatting command for the LSP that has just attached.
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
group = get_augroup(client),
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
if not format_is_enabled then return end
|
||||
|
||||
vim.lsp.buf.format({
|
||||
async = false,
|
||||
filter = function(c) return c.id == client.id end,
|
||||
})
|
||||
end,
|
||||
})
|
||||
opts = {
|
||||
servers = { eslint = {} },
|
||||
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,
|
||||
})
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
-- Nvim Treesitter configurations and abstraction layer
|
||||
-- https://github.com/nvim-treesitter/nvim-treesitter
|
||||
-- luacheck: globals vim
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
-- 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,
|
||||
|
||||
-- List of parsers to ignore installing (or "all")
|
||||
ignore_install = {},
|
||||
|
||||
modules = {},
|
||||
|
||||
-- Add languages to be installed here that you want installed for treesitter
|
||||
ensure_installed = "all",
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = {},
|
||||
--injections = {
|
||||
-- python = {
|
||||
-- docstrings: "markdown",
|
||||
-- },
|
||||
--}
|
||||
},
|
||||
indent = { enable = true },
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<c-space>",
|
||||
node_incremental = "<c-space>",
|
||||
scope_incremental = "<c-s>",
|
||||
node_decremental = "<M-space>",
|
||||
},
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
-- Automatically jump forward to textobj, similar to targets.vim
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["aa"] = "@parameter.outer",
|
||||
["ia"] = "@parameter.inner",
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
},
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
-- whether to set jumps in the jumplist
|
||||
set_jumps = true,
|
||||
goto_next_start = {
|
||||
["]m"] = "@function.outer",
|
||||
["]]"] = "@class.outer",
|
||||
},
|
||||
goto_next_end = {
|
||||
["]M"] = "@function.outer",
|
||||
["]["] = "@class.outer",
|
||||
},
|
||||
goto_previous_start = {
|
||||
["[m"] = "@function.outer",
|
||||
["[["] = "@class.outer",
|
||||
},
|
||||
goto_previous_end = {
|
||||
["[M"] = "@function.outer",
|
||||
["[]"] = "@class.outer",
|
||||
},
|
||||
},
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
["<leader>a"] = "@parameter.inner",
|
||||
},
|
||||
swap_previous = {
|
||||
["<leader>A"] = "@parameter.inner",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
lazy = false,
|
||||
enabled = true,
|
||||
opts = {
|
||||
enable = true,
|
||||
mode = "cursor", -- cursor, or topline
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
return {
|
||||
"ThePrimeagen/refactoring.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
cmd = { "Refactor" },
|
||||
opts = {},
|
||||
keys = {
|
||||
{
|
||||
"<leader>re",
|
||||
[[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function')<CR>]],
|
||||
{ silent = true, expr = false },
|
||||
mode = {
|
||||
"v",
|
||||
"x",
|
||||
},
|
||||
desc = "Extract Function",
|
||||
},
|
||||
{
|
||||
"<leader>rf",
|
||||
[[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function To File')<CR>]],
|
||||
{ silent = true, expr = false },
|
||||
mode = {
|
||||
"v",
|
||||
"x",
|
||||
},
|
||||
desc = "Extract Function To File",
|
||||
},
|
||||
{
|
||||
"<leader>rv",
|
||||
[[ <Esc><Cmd>lua require('refactoring').refactor('Extract Variable')<CR>]],
|
||||
{ silent = true, expr = false },
|
||||
mode = {
|
||||
"v",
|
||||
"x",
|
||||
},
|
||||
desc = "Extract Variable",
|
||||
},
|
||||
{
|
||||
"<leader>ri",
|
||||
[[ <Esc><Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]],
|
||||
{ silent = true, expr = false },
|
||||
mode = {
|
||||
"n",
|
||||
"v",
|
||||
"x",
|
||||
},
|
||||
desc = "Inline Variable",
|
||||
},
|
||||
{
|
||||
"<leader>rb",
|
||||
function() require("refactoring").refactor("Extract Block") end,
|
||||
{ silent = true, expr = false },
|
||||
mode = {
|
||||
"n",
|
||||
},
|
||||
desc = "Extract Block",
|
||||
},
|
||||
{
|
||||
"<leader>rbf",
|
||||
function() require("refactoring").refactor("Extract Block To File") end,
|
||||
{ silent = true, expr = false },
|
||||
mode = {
|
||||
"n",
|
||||
},
|
||||
desc = "Extract Block To File",
|
||||
},
|
||||
{
|
||||
"<leader>rr",
|
||||
function() require("refactoring").select_refactor() end,
|
||||
{ silent = true, expr = false },
|
||||
desc = "Select Refactor",
|
||||
},
|
||||
{
|
||||
"<leader>rp",
|
||||
function() require("refactoring").debug.printf({ below = false }) end,
|
||||
mode = { "n" },
|
||||
desc = "Debug: Print Function",
|
||||
},
|
||||
{
|
||||
"<leader>rd",
|
||||
function() require("refactoring").debug.print_var({ normal = true, below = false }) end,
|
||||
mode = { "n" },
|
||||
desc = "Debug: Print Variable",
|
||||
},
|
||||
{
|
||||
"<leader>rd",
|
||||
function() require("refactoring").debug.print_var({ below = false }) end,
|
||||
mode = { "v" },
|
||||
desc = "Debug: Print Variable",
|
||||
},
|
||||
{
|
||||
"<leader>rc",
|
||||
function() require("refactoring").debug.cleanup({}) end,
|
||||
mode = { "n" },
|
||||
desc = "Debug: Clean Up",
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,155 +0,0 @@
|
||||
-- Telescope, a see-all-through file manager.
|
||||
-- vim: ts=2 sw=2 si et
|
||||
-- luacheck: globals vim
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = {
|
||||
{ "nvim-lua/plenary.nvim" },
|
||||
{ "nvim-lua/popup.nvim" },
|
||||
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
|
||||
-- Only load if `make` is available. Make sure you have the system
|
||||
-- requirements installed.
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
-- NOTE: If you are having trouble with this installation,
|
||||
-- refer to the README for telescope-fzf-native for more instructions.
|
||||
build = "make",
|
||||
cond = function() return vim.fn.executable("make") == 1 end,
|
||||
},
|
||||
{ "nvim-telescope/telescope-file-browser.nvim" },
|
||||
},
|
||||
config = function()
|
||||
local actions = require("telescope.actions")
|
||||
local sorters = require("telescope.sorters")
|
||||
local previewers = require("telescope.previewers")
|
||||
|
||||
require("telescope").setup({
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<ESC>"] = actions.close,
|
||||
["<C-u>"] = false,
|
||||
["<C-d>"] = false,
|
||||
},
|
||||
},
|
||||
vimgrep_arguments = {
|
||||
"rg",
|
||||
"-L",
|
||||
"--color=never",
|
||||
"--no-heading",
|
||||
"--with-filename",
|
||||
"--line-number",
|
||||
"--column",
|
||||
"--smart-case",
|
||||
},
|
||||
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
entry_prefix = " ",
|
||||
initial_mode = "insert",
|
||||
selection_strategy = "reset",
|
||||
sorting_strategy = "ascending",
|
||||
layout_strategy = "horizontal",
|
||||
layout_config = {
|
||||
horizontal = {
|
||||
prompt_position = "top",
|
||||
preview_width = 0.55,
|
||||
results_width = 0.8,
|
||||
},
|
||||
vertical = {
|
||||
mirror = false,
|
||||
},
|
||||
width = 0.87,
|
||||
height = 0.80,
|
||||
preview_cutoff = 120,
|
||||
},
|
||||
file_sorter = sorters.get_fuzzy_file,
|
||||
file_ignore_patterns = { "node_modules", "dotbot" },
|
||||
generic_sorter = sorters.get_generic_fuzzy_sorter,
|
||||
path_display = { "truncate" },
|
||||
winblend = 0,
|
||||
border = {},
|
||||
borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" },
|
||||
color_devicons = true,
|
||||
use_less = true,
|
||||
set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil,
|
||||
file_previewer = previewers.vim_buffer_cat.new,
|
||||
grep_previewer = previewers.vim_buffer_vimgrep.new,
|
||||
qflist_previewer = previewers.vim_buffer_qflist.new,
|
||||
-- Developer configurations: Not meant for general override
|
||||
buffer_previewer_maker = previewers.buffer_previewer_maker,
|
||||
},
|
||||
pickers = {
|
||||
buffers = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<c-d>"] = actions.delete_buffer + actions.move_to_top,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
extensions_list = { "themes", "terms" },
|
||||
})
|
||||
|
||||
pcall(require("telescope").load_extension, "fzf")
|
||||
pcall(require("telescope").load_extension, "file_browser")
|
||||
pcall(require("telescope").load_extension, "harpoon")
|
||||
|
||||
-- See `:help telescope.builtin`
|
||||
local tbi = require("telescope.builtin")
|
||||
local wk = require("which-key")
|
||||
wk.register({
|
||||
["?"] = {
|
||||
function() tbi.oldfiles() end,
|
||||
"[?] Find recently opened files",
|
||||
},
|
||||
["<space>"] = {
|
||||
function() tbi.buffers() end,
|
||||
"[ ] Find existing buffers",
|
||||
},
|
||||
["/"] = {
|
||||
function()
|
||||
-- You can pass additional configuration to telescope to change theme, layout, etc.
|
||||
tbi.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
|
||||
winblend = 10,
|
||||
previewer = false,
|
||||
}))
|
||||
end,
|
||||
"[/] Fuzzily search in current buffer",
|
||||
},
|
||||
|
||||
t = {
|
||||
b = {
|
||||
"<cmd>Telescope file_browser<CR>",
|
||||
"[T]elescope: File [B]rowser",
|
||||
},
|
||||
d = {
|
||||
function() tbi.diagnostics() end,
|
||||
"[T]elescope: Search [D]iagnostics",
|
||||
},
|
||||
|
||||
f = {
|
||||
function() tbi.find_files() end,
|
||||
"[T]elescope: Search [F]iles",
|
||||
},
|
||||
g = {
|
||||
function() tbi.git_files() end,
|
||||
"[T]elescope: Search [G]it files",
|
||||
},
|
||||
h = {
|
||||
function() tbi.help_tags() end,
|
||||
"[T]elescope: Search [H]elp",
|
||||
},
|
||||
r = {
|
||||
function() tbi.live_grep() end,
|
||||
"[T]elescope: Search by G[r]ep",
|
||||
},
|
||||
w = {
|
||||
function() tbi.grep_string() end,
|
||||
"[T]elescope: Search current [W]ord",
|
||||
},
|
||||
},
|
||||
}, { prefix = "<leader>" })
|
||||
end,
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
-- A pretty diagnostics, references, telescope results,
|
||||
-- quickfix and location list to help you solve all
|
||||
-- the trouble your code is causing.
|
||||
-- https://github.com/folke/trouble.nvim
|
||||
return {
|
||||
"folke/trouble.nvim",
|
||||
dependencies = "nvim-tree/nvim-web-devicons",
|
||||
opts = {
|
||||
-- position of the list can be: bottom, top, left, right
|
||||
position = "bottom",
|
||||
-- height of the trouble list when position is top or bottom
|
||||
height = 6,
|
||||
-- width of the list when position is left or right
|
||||
width = 50,
|
||||
-- use devicons for filenames
|
||||
icons = true,
|
||||
-- "workspace_diagnostics", "document_diagnostics",
|
||||
-- "quickfix", "lsp_references", "loclist"
|
||||
mode = "workspace_diagnostics",
|
||||
-- icon used for open folds
|
||||
fold_open = "",
|
||||
-- icon used for closed folds
|
||||
fold_closed = "",
|
||||
-- group results by file
|
||||
group = true,
|
||||
-- add an extra new line on top of the list
|
||||
padding = true,
|
||||
-- key mappings for actions in the trouble list
|
||||
action_keys = {
|
||||
-- map to {} to remove a mapping, for example:
|
||||
-- close = {},
|
||||
|
||||
-- close the list
|
||||
close = "q",
|
||||
-- cancel the preview and get back to your last window / buffer / cursor
|
||||
cancel = "<esc>",
|
||||
-- manually refresh
|
||||
refresh = "r",
|
||||
-- jump to the diagnostic or open / close folds
|
||||
jump = { "<cr>", "<tab>" },
|
||||
-- open buffer in new split
|
||||
open_split = { "<c-x>" },
|
||||
-- open buffer in new vsplit
|
||||
open_vsplit = { "<c-v>" },
|
||||
-- open buffer in new tab
|
||||
open_tab = { "<c-t>" },
|
||||
-- jump to the diagnostic and close the list
|
||||
jump_close = { "o" },
|
||||
-- toggle between "workspace" and "document" diagnostics mode
|
||||
toggle_mode = "m",
|
||||
-- toggle auto_preview
|
||||
toggle_preview = "P",
|
||||
-- opens a small popup with the full multiline message
|
||||
hover = "K",
|
||||
-- preview the diagnostic location
|
||||
preview = "p",
|
||||
-- close all folds
|
||||
close_folds = { "zM", "zm" },
|
||||
-- open all folds
|
||||
open_folds = { "zR", "zr" },
|
||||
-- toggle fold of current file
|
||||
toggle_fold = { "zA", "za" },
|
||||
-- preview item
|
||||
previous = "k",
|
||||
-- next item
|
||||
next = "j",
|
||||
},
|
||||
-- add an indent guide below the fold icons
|
||||
indent_lines = true,
|
||||
-- automatically open the list when you have diagnostics
|
||||
auto_open = false,
|
||||
-- automatically close the list when you have no diagnostics
|
||||
auto_close = true,
|
||||
-- automatically preview the location of the diagnostic.
|
||||
-- <esc> to close preview and go back to last window
|
||||
auto_preview = true,
|
||||
-- automatically fold a file trouble list at creation
|
||||
auto_fold = false,
|
||||
-- for the given modes, automatically jump if there is only a single result
|
||||
auto_jump = { "lsp_definitions" },
|
||||
signs = {
|
||||
-- icons / text used for a diagnostic
|
||||
error = "",
|
||||
warning = "",
|
||||
hint = "",
|
||||
information = "",
|
||||
other = "",
|
||||
},
|
||||
-- enabling this will use the signs defined in your lsp client
|
||||
use_diagnostic_signs = false,
|
||||
},
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
-- Twilight dims inactive portions of the
|
||||
-- code you're editing using TreeSitter
|
||||
-- https://github.com/folke/twilight.nvim
|
||||
return {
|
||||
"folke/twilight.nvim",
|
||||
opts = {
|
||||
dimming = {
|
||||
-- amount of dimming
|
||||
alpha = 0.2,
|
||||
-- when true, other windows will be fully dimmed (unless they contain the same buffer)
|
||||
inactive = false,
|
||||
},
|
||||
-- amount of lines we will try to show around the current line
|
||||
context = 3,
|
||||
-- use treesitter when available for the filetype
|
||||
-- treesitter is used to automatically expand the visible text,
|
||||
-- but you can further control the types of nodes that should always be fully expanded
|
||||
|
||||
treesitter = true,
|
||||
|
||||
-- for treesitter, we we always try to expand to the top-most ancestor with these types
|
||||
expand = {
|
||||
"function",
|
||||
"while_statement",
|
||||
"for_statement",
|
||||
"switch_statement",
|
||||
"method",
|
||||
"table",
|
||||
"if_statement",
|
||||
},
|
||||
exclude = {}, -- exclude these filetypes
|
||||
},
|
||||
}
|
||||
25
config/nvim/lua/plugins/ui.lua
Normal file
25
config/nvim/lua/plugins/ui.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
return {
|
||||
-- The theme of choise, catppuccin
|
||||
-- https://github.com/catppuccin/nvim
|
||||
{
|
||||
"catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
priority = 1000,
|
||||
enabled = true,
|
||||
config = function()
|
||||
vim.cmd.colorscheme("catppuccin")
|
||||
end,
|
||||
opts = {
|
||||
flavour = "mocha",
|
||||
},
|
||||
},
|
||||
-- Getting you where you want with the fewest keystrokes.
|
||||
-- https://github.com/ThePrimeagen/harpoon
|
||||
{ "ThePrimeagen/harpoon" },
|
||||
-- Close buffer without messing up with the window.
|
||||
-- https://github.com/famiu/bufdelete.nvim
|
||||
{ "famiu/bufdelete.nvim" },
|
||||
-- Neovim plugin for locking a buffer to a window
|
||||
-- https://github.com/stevearc/stickybuf.nvim
|
||||
{ "stevearc/stickybuf.nvim", opts = {} },
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
-- A more adventurous wildmenu
|
||||
-- https://github.com/gelguy/wilder.nvim
|
||||
|
||||
return {
|
||||
'gelguy/wilder.nvim',
|
||||
config = function()
|
||||
local wilder = require('wilder')
|
||||
wilder.setup({ modes = { ':', '/', '?' } })
|
||||
|
||||
local gradient = {
|
||||
'#f4468f', '#fd4a85', '#ff507a', '#ff566f', '#ff5e63',
|
||||
'#ff6658', '#ff704e', '#ff7a45', '#ff843d', '#ff9036',
|
||||
'#f89b31', '#efa72f', '#e6b32e', '#dcbe30', '#d2c934',
|
||||
'#c8d43a', '#bfde43', '#b6e84e', '#aff05b'
|
||||
}
|
||||
|
||||
for i, fg in ipairs(gradient) do
|
||||
gradient[i] = wilder.make_hl('WilderGradient' .. i, 'Pmenu', { { a = 1 }, { a = 1 }, { foreground = fg } })
|
||||
end
|
||||
|
||||
wilder.set_option('renderer', wilder.popupmenu_renderer({
|
||||
highlights = {
|
||||
-- must be set
|
||||
-- selected_gradient key can be set to apply gradient highlighting for the selected candidate.
|
||||
gradient = gradient,
|
||||
},
|
||||
highlighter = wilder.highlighter_with_gradient({
|
||||
wilder.basic_highlighter(), -- or wilder.lua_fzy_highlighter(),
|
||||
}),
|
||||
}))
|
||||
end,
|
||||
}
|
||||
3
config/nvim/stylua.toml
Normal file
3
config/nvim/stylua.toml
Normal file
@@ -0,0 +1,3 @@
|
||||
indent_type = "Spaces"
|
||||
indent_width = 2
|
||||
column_width = 120
|
||||
Reference in New Issue
Block a user