first commit
This commit is contained in:
commit
15e643aa8e
41 changed files with 1623 additions and 0 deletions
16
lua/plugins/barbecue-nvim.lua
Normal file
16
lua/plugins/barbecue-nvim.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
-- Display LSP-based breadcrumbs
|
||||
return {
|
||||
-- https://github.com/utilyre/barbecue.nvim
|
||||
"utilyre/barbecue.nvim",
|
||||
name = "barbecue",
|
||||
version = "*",
|
||||
dependencies = {
|
||||
-- https://github.com/SmiteshP/nvim-navic
|
||||
"SmiteshP/nvim-navic",
|
||||
-- https://github.com/nvim-tree/nvim-web-devicons
|
||||
"nvim-tree/nvim-web-devicons", -- optional dependency
|
||||
},
|
||||
opts = {
|
||||
-- configurations go here
|
||||
},
|
||||
}
|
||||
12
lua/plugins/bigfile-nvim.lua
Normal file
12
lua/plugins/bigfile-nvim.lua
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
-- Improve performance of editing big files
|
||||
return {
|
||||
-- https://github.com/LunarVim/bigfile.nvim
|
||||
'LunarVim/bigfile.nvim',
|
||||
event = 'BufReadPre',
|
||||
opts = {
|
||||
filesize = 2, -- size of the file in MiB, the plugin round file sizes to the closest MiB
|
||||
},
|
||||
config = function (_, opts)
|
||||
require('bigfile').setup(opts)
|
||||
end
|
||||
}
|
||||
15
lua/plugins/black.lua
Normal file
15
lua/plugins/black.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
-- Python formatter
|
||||
return {
|
||||
-- https://github.com/psf/black
|
||||
'psf/black',
|
||||
ft = 'python',
|
||||
config =function ()
|
||||
-- Automatically format file buffer when saving
|
||||
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
||||
pattern = "*.py",
|
||||
callback = function()
|
||||
vim.cmd("Black")
|
||||
end,
|
||||
})
|
||||
end
|
||||
}
|
||||
168
lua/plugins/colorscheme.lua
Normal file
168
lua/plugins/colorscheme.lua
Normal file
|
|
@ -0,0 +1,168 @@
|
|||
-- Theme/Colorscheme (uncomment section for whichever theme you prefer or use your own)
|
||||
-- Kanagawa Theme (Custom Palette)
|
||||
return {
|
||||
-- https://github.com/rebelot/kanagawa.nvim
|
||||
'rebelot/kanagawa.nvim', -- You can replace this with your favorite colorscheme
|
||||
lazy = false, -- We want the colorscheme to load immediately when starting Neovim
|
||||
priority = 1000, -- Load the colorscheme before other non-lazy-loaded plugins
|
||||
opts = {
|
||||
-- Replace this with your scheme-specific settings or remove to use the defaults
|
||||
-- transparent = true,
|
||||
background = {
|
||||
-- light = "lotus",
|
||||
dark = "wave", -- "wave, dragon"
|
||||
},
|
||||
colors = {
|
||||
palette = {
|
||||
-- Background colors
|
||||
sumiInk0 = "#161616", -- modified
|
||||
sumiInk1 = "#181818", -- modified
|
||||
sumiInk2 = "#1a1a1a", -- modified
|
||||
sumiInk3 = "#1F1F1F", -- modified
|
||||
sumiInk4 = "#2A2A2A", -- modified
|
||||
sumiInk5 = "#363636", -- modified
|
||||
sumiInk6 = "#545454", -- modified
|
||||
|
||||
-- Popup and Floats
|
||||
waveBlue1 = "#322C47", -- modified
|
||||
waveBlue2 = "#4c4464", -- modified
|
||||
|
||||
-- Diff and Git
|
||||
winterGreen = "#2B3328",
|
||||
winterYellow = "#49443C",
|
||||
winterRed = "#43242B",
|
||||
winterBlue = "#252535",
|
||||
autumnGreen = "#76A56A", -- modified
|
||||
autumnRed = "#C34043",
|
||||
autumnYellow = "#DCA561",
|
||||
|
||||
-- Diag
|
||||
samuraiRed = "#E82424",
|
||||
roninYellow = "#FF9E3B",
|
||||
waveAqua1 = "#7E9CD8", -- modified
|
||||
dragonBlue = "#7FB4CA", -- modified
|
||||
|
||||
-- Foreground and Comments
|
||||
oldWhite = "#C8C093",
|
||||
fujiWhite = "#F9E7C0", -- modified
|
||||
fujiGray = "#727169",
|
||||
oniViolet = "#BFA3E6", -- modified
|
||||
oniViolet2 = "#BCACDB", -- modified
|
||||
crystalBlue = "#8CABFF", -- modified
|
||||
springViolet1 = "#938AA9",
|
||||
springViolet2 = "#9CABCA",
|
||||
springBlue = "#7FC4EF", -- modified
|
||||
waveAqua2 = "#77BBDD", -- modified
|
||||
|
||||
springGreen = "#98BB6C",
|
||||
boatYellow1 = "#938056",
|
||||
boatYellow2 = "#C0A36E",
|
||||
carpYellow = "#FFEE99", -- modified
|
||||
|
||||
sakuraPink = "#D27E99",
|
||||
waveRed = "#E46876",
|
||||
peachRed = "#FF5D62",
|
||||
surimiOrange = "#FFAA44", -- modified
|
||||
katanaGray = "#717C7C",
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require('kanagawa').setup(opts) -- Replace this with your favorite colorscheme
|
||||
vim.cmd("colorscheme kanagawa") -- Replace this with your favorite colorscheme
|
||||
|
||||
-- Custom diff colors
|
||||
vim.cmd([[
|
||||
autocmd VimEnter * hi DiffAdd guifg=#00FF00 guibg=#005500
|
||||
autocmd VimEnter * hi DiffDelete guifg=#FF0000 guibg=#550000
|
||||
autocmd VimEnter * hi DiffChange guifg=#CCCCCC guibg=#555555
|
||||
autocmd VimEnter * hi DiffText guifg=#00FF00 guibg=#005500
|
||||
]])
|
||||
|
||||
-- Custom border colors
|
||||
vim.cmd([[
|
||||
autocmd ColorScheme * hi NormalFloat guifg=#F9E7C0 guibg=#1F1F1F
|
||||
autocmd ColorScheme * hi FloatBorder guifg=#F9E7C0 guibg=#1F1F1F
|
||||
]])
|
||||
end
|
||||
}
|
||||
|
||||
-- Kanagawa Theme (Original)
|
||||
-- return {
|
||||
-- -- https://github.com/rebelot/kanagawa.nvim
|
||||
-- 'rebelot/kanagawa.nvim', -- You can replace this with your favorite colorscheme
|
||||
-- lazy = false, -- We want the colorscheme to load immediately when starting Neovim
|
||||
-- priority = 1000, -- Load the colorscheme before other non-lazy-loaded plugins
|
||||
-- opts = {
|
||||
-- -- Replace this with your scheme-specific settings or remove to use the defaults
|
||||
-- -- transparent = true,
|
||||
-- background = {
|
||||
-- -- light = "lotus",
|
||||
-- dark = "wave", -- "wave, dragon"
|
||||
-- },
|
||||
-- },
|
||||
-- config = function(_, opts)
|
||||
-- require('kanagawa').setup(opts) -- Replace this with your favorite colorscheme
|
||||
-- vim.cmd("colorscheme kanagawa") -- Replace this with your favorite colorscheme
|
||||
-- end
|
||||
-- }
|
||||
|
||||
-- Tokyo Night Theme
|
||||
-- return {
|
||||
-- -- https://github.com/folke/tokyonight.nvim
|
||||
-- 'folke/tokyonight.nvim', -- You can replace this with your favorite colorscheme
|
||||
-- lazy = false, -- We want the colorscheme to load immediately when starting Neovim
|
||||
-- priority = 1000, -- Load the colorscheme before other non-lazy-loaded plugins
|
||||
-- opts = {
|
||||
-- -- Replace this with your scheme-specific settings or remove to use the defaults
|
||||
-- -- transparent = true,
|
||||
-- style = "night", -- other variations "storm, night, moon, day"
|
||||
-- },
|
||||
-- config = function(_, opts)
|
||||
-- require('tokyonight').setup(opts) -- Replace this with your favorite colorscheme
|
||||
-- vim.cmd("colorscheme tokyonight") -- Replace this with your favorite colorscheme
|
||||
-- end
|
||||
-- }
|
||||
|
||||
-- Catppuccin Theme
|
||||
-- return {
|
||||
-- -- https://github.com/catppuccin/nvim
|
||||
-- 'catppuccin/nvim',
|
||||
-- name = "catppuccin", -- name is needed otherwise plugin shows up as "nvim" due to github URI
|
||||
-- lazy = false, -- We want the colorscheme to load immediately when starting Neovim
|
||||
-- priority = 1000, -- Load the colorscheme before other non-lazy-loaded plugins
|
||||
-- opts = {
|
||||
-- -- -- Replace this with your scheme-specific settings or remove to use the defaults
|
||||
-- -- transparent = true,
|
||||
-- flavour = "mocha", -- "latte, frappe, macchiato, mocha"
|
||||
-- },
|
||||
-- config = function(_, opts)
|
||||
-- require('catppuccin').setup(opts) -- Replace this with your favorite colorscheme
|
||||
-- vim.cmd("colorscheme catppuccin") -- Replace this with your favorite colorscheme
|
||||
-- end
|
||||
-- }
|
||||
|
||||
-- Sonokai Theme
|
||||
-- return {
|
||||
-- -- https://github.com/sainnhe/sonokai
|
||||
-- 'sainnhe/sonokai',
|
||||
-- lazy = false, -- We want the colorscheme to load immediately when starting Neovim
|
||||
-- priority = 1000, -- Load the colorscheme before other non-lazy-loaded plugins
|
||||
-- config = function(_, opts)
|
||||
-- vim.g.sonokai_style = "default" -- "default, atlantis, andromeda, shusia, maia, espresso"
|
||||
-- vim.cmd("colorscheme sonokai") -- Replace this with your favorite colorscheme
|
||||
-- end
|
||||
-- }
|
||||
|
||||
-- One Nord Theme
|
||||
-- return {
|
||||
-- -- https://github.com/rmehri01/onenord.nvim
|
||||
-- 'rmehri01/onenord.nvim',
|
||||
-- lazy = false, -- We want the colorscheme to load immediately when starting Neovim
|
||||
-- priority = 1000, -- Load the colorscheme before other non-lazy-loaded plugins
|
||||
-- config = function(_, opts)
|
||||
-- vim.cmd("colorscheme onenord") -- Replace this with your favorite colorscheme
|
||||
-- end
|
||||
-- }
|
||||
|
||||
|
||||
197
lua/plugins/example.lua
Normal file
197
lua/plugins/example.lua
Normal file
|
|
@ -0,0 +1,197 @@
|
|||
-- 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 },
|
||||
|
||||
-- override nvim-cmp and add cmp-emoji
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = { "hrsh7th/cmp-emoji" },
|
||||
---@param opts cmp.ConfigSchema
|
||||
opts = function(_, opts)
|
||||
table.insert(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 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").lsp.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, {
|
||||
function()
|
||||
return "😄"
|
||||
end,
|
||||
})
|
||||
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",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
11
lua/plugins/git-blame-nvim.lua
Normal file
11
lua/plugins/git-blame-nvim.lua
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
-- Git Blame
|
||||
return {
|
||||
-- https://github.com/f-person/git-blame.nvim
|
||||
'f-person/git-blame.nvim',
|
||||
event = 'VeryLazy',
|
||||
opts = {
|
||||
enabled = false, -- disable by default, enabled only on keymap
|
||||
date_format = '%m/%d/%y %H:%M:%S', -- more concise date format
|
||||
}
|
||||
}
|
||||
|
||||
17
lua/plugins/harpoon.lua
Normal file
17
lua/plugins/harpoon.lua
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
-- List of favorite files/marks per project
|
||||
return {
|
||||
-- https://github.com/ThePrimeagen/harpoon
|
||||
'ThePrimeagen/harpoon',
|
||||
branch = 'master',
|
||||
event = 'VeryLazy',
|
||||
dependencies = {
|
||||
-- https://github.com/nvim-lua/plenary.nvim
|
||||
'nvim-lua/plenary.nvim',
|
||||
},
|
||||
opts = {
|
||||
menu = {
|
||||
width = 120
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
13
lua/plugins/indent-blankline-nvim.lua
Normal file
13
lua/plugins/indent-blankline-nvim.lua
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
-- Indentation guides
|
||||
return {
|
||||
-- https://github.com/lukas-reineke/indent-blankline.nvim
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
event = 'VeryLazy',
|
||||
main = "ibl",
|
||||
opts = {
|
||||
enabled = true,
|
||||
indent = {
|
||||
char = '|',
|
||||
},
|
||||
},
|
||||
}
|
||||
36
lua/plugins/lualine-nvim.lua
Normal file
36
lua/plugins/lualine-nvim.lua
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
-- Status line
|
||||
return {
|
||||
-- https://github.com/nvim-lualine/lualine.nvim
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = {
|
||||
-- https://github.com/nvim-tree/nvim-web-devicons
|
||||
'nvim-tree/nvim-web-devicons', -- fancy icons
|
||||
-- https://github.com/linrongbin16/lsp-progress.nvim
|
||||
'linrongbin16/lsp-progress.nvim', -- LSP loading progress
|
||||
},
|
||||
opts = {
|
||||
options = {
|
||||
-- For more themes, see https://github.com/nvim-lualine/lualine.nvim/blob/master/THEMES.md
|
||||
theme = "codedark", -- "auto, tokyonight, catppuccin, codedark, nord"
|
||||
},
|
||||
sections = {
|
||||
lualine_c = {
|
||||
{
|
||||
-- Customize the filename part of lualine to be parent/filename
|
||||
'filename',
|
||||
file_status = true, -- Displays file status (readonly status, modified status)
|
||||
newfile_status = false, -- Display new file status (new file means no write after created)
|
||||
path = 4, -- 0: Just the filename
|
||||
-- 1: Relative path
|
||||
-- 2: Absolute path
|
||||
-- 3: Absolute path, with tilde as the home directory
|
||||
-- 4: Filename and parent dir, with tilde as the home directory
|
||||
symbols = {
|
||||
modified = '[+]', -- Text to show when the file is modified.
|
||||
readonly = '[-]', -- Text to show when the file is non-modifiable or readonly.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
13
lua/plugins/nvim-autopairs.lua
Normal file
13
lua/plugins/nvim-autopairs.lua
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
-- Auto-completion of bracket/paren/quote pairs
|
||||
return {
|
||||
-- https://github.com/windwp/nvim-autopairs
|
||||
'windwp/nvim-autopairs',
|
||||
event = "InsertEnter",
|
||||
opts = {
|
||||
check_ts = true, -- enable treesitter
|
||||
ts_config = {
|
||||
lua = { "string" }, -- don't add pairs in lua string treesitter nodes
|
||||
javascript = { "template_string" }, -- don't add pairs in javascript template_string
|
||||
}
|
||||
}
|
||||
}
|
||||
87
lua/plugins/nvim-cmp.lua
Normal file
87
lua/plugins/nvim-cmp.lua
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
-- Auto-completion / Snippets
|
||||
return {
|
||||
-- https://github.com/hrsh7th/nvim-cmp
|
||||
'hrsh7th/nvim-cmp',
|
||||
event = 'InsertEnter',
|
||||
dependencies = {
|
||||
-- Snippet engine & associated nvim-cmp source
|
||||
-- https://github.com/L3MON4D3/LuaSnip
|
||||
'L3MON4D3/LuaSnip',
|
||||
-- https://github.com/saadparwaiz1/cmp_luasnip
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
|
||||
-- LSP completion capabilities
|
||||
-- https://github.com/hrsh7th/cmp-nvim-lsp
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
|
||||
-- Additional user-friendly snippets
|
||||
-- https://github.com/rafamadriz/friendly-snippets
|
||||
'rafamadriz/friendly-snippets',
|
||||
-- https://github.com/hrsh7th/cmp-buffer
|
||||
'hrsh7th/cmp-buffer',
|
||||
-- https://github.com/hrsh7th/cmp-path
|
||||
'hrsh7th/cmp-path',
|
||||
-- https://github.com/hrsh7th/cmp-cmdline
|
||||
'hrsh7th/cmp-cmdline',
|
||||
},
|
||||
config = function()
|
||||
local cmp = require('cmp')
|
||||
local luasnip = require('luasnip')
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
luasnip.config.setup({})
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
completion = {
|
||||
completeopt = 'menu,menuone,noinsert',
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert {
|
||||
['<C-j>'] = cmp.mapping.select_next_item(), -- next suggestion
|
||||
['<C-k>'] = cmp.mapping.select_prev_item(), -- previous suggestion
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4), -- scroll backward
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4), -- scroll forward
|
||||
['<C-Space>'] = cmp.mapping.complete {}, -- show completion suggestions
|
||||
['<CR>'] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
},
|
||||
-- Tab through suggestions or when a snippet is active, tab to the next argument
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_locally_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
-- Tab backwards through suggestions or when a snippet is active, tab to the next argument
|
||||
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.locally_jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" }, -- lsp
|
||||
{ name = "luasnip" }, -- snippets
|
||||
{ name = "buffer" }, -- text within current buffer
|
||||
{ name = "path" }, -- file system paths
|
||||
}),
|
||||
window = {
|
||||
-- Add borders to completions popups
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
13
lua/plugins/nvim-dap-python.lua
Normal file
13
lua/plugins/nvim-dap-python.lua
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
return {
|
||||
-- https://github.com/mfussenegger/nvim-dap-python
|
||||
'mfussenegger/nvim-dap-python',
|
||||
ft = 'python',
|
||||
dependencies = {
|
||||
-- https://github.com/mfussenegger/nvim-dap
|
||||
'mfussenegger/nvim-dap',
|
||||
},
|
||||
config = function ()
|
||||
-- Update the path passed to setup to point to your system or virtual env python binary
|
||||
require('dap-python').setup('/usr/bin/python3')
|
||||
end
|
||||
}
|
||||
126
lua/plugins/nvim-dap-ui.lua
Normal file
126
lua/plugins/nvim-dap-ui.lua
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
-- Debugging Support
|
||||
return {
|
||||
-- https://github.com/rcarriga/nvim-dap-ui
|
||||
'rcarriga/nvim-dap-ui',
|
||||
event = 'VeryLazy',
|
||||
dependencies = {
|
||||
-- https://github.com/mfussenegger/nvim-dap
|
||||
'mfussenegger/nvim-dap',
|
||||
-- https://github.com/nvim-neotest/nvim-nio
|
||||
'nvim-neotest/nvim-nio',
|
||||
-- https://github.com/theHamsta/nvim-dap-virtual-text
|
||||
'theHamsta/nvim-dap-virtual-text', -- inline variable text while debugging
|
||||
-- https://github.com/nvim-telescope/telescope-dap.nvim
|
||||
'nvim-telescope/telescope-dap.nvim', -- telescope integration with dap
|
||||
},
|
||||
opts = {
|
||||
controls = {
|
||||
element = "repl",
|
||||
enabled = false,
|
||||
icons = {
|
||||
disconnect = "",
|
||||
pause = "",
|
||||
play = "",
|
||||
run_last = "",
|
||||
step_back = "",
|
||||
step_into = "",
|
||||
step_out = "",
|
||||
step_over = "",
|
||||
terminate = ""
|
||||
}
|
||||
},
|
||||
element_mappings = {},
|
||||
expand_lines = true,
|
||||
floating = {
|
||||
border = "single",
|
||||
mappings = {
|
||||
close = { "q", "<Esc>" }
|
||||
}
|
||||
},
|
||||
force_buffers = true,
|
||||
icons = {
|
||||
collapsed = "",
|
||||
current_frame = "",
|
||||
expanded = ""
|
||||
},
|
||||
layouts = {
|
||||
{
|
||||
elements = {
|
||||
{
|
||||
id = "scopes",
|
||||
size = 0.50
|
||||
},
|
||||
{
|
||||
id = "stacks",
|
||||
size = 0.30
|
||||
},
|
||||
{
|
||||
id = "watches",
|
||||
size = 0.10
|
||||
},
|
||||
{
|
||||
id = "breakpoints",
|
||||
size = 0.10
|
||||
}
|
||||
},
|
||||
size = 40,
|
||||
position = "left", -- Can be "left" or "right"
|
||||
},
|
||||
{
|
||||
elements = {
|
||||
"repl",
|
||||
"console",
|
||||
},
|
||||
size = 10,
|
||||
position = "bottom", -- Can be "bottom" or "top"
|
||||
}
|
||||
},
|
||||
mappings = {
|
||||
edit = "e",
|
||||
expand = { "<CR>", "<2-LeftMouse>" },
|
||||
open = "o",
|
||||
remove = "d",
|
||||
repl = "r",
|
||||
toggle = "t"
|
||||
},
|
||||
render = {
|
||||
indent = 1,
|
||||
max_value_lines = 100
|
||||
}
|
||||
},
|
||||
config = function (_, opts)
|
||||
local dap = require('dap')
|
||||
require('dapui').setup(opts)
|
||||
|
||||
-- Customize breakpoint signs
|
||||
vim.api.nvim_set_hl(0, "DapStoppedHl", { fg = "#98BB6C", bg = "#2A2A2A", bold = true })
|
||||
vim.api.nvim_set_hl(0, "DapStoppedLineHl", { bg = "#204028", bold = true })
|
||||
vim.fn.sign_define('DapStopped', { text='', texthl='DapStoppedHl', linehl='DapStoppedLineHl', numhl= '' })
|
||||
vim.fn.sign_define('DapBreakpoint', { text='', texthl='DiagnosticSignError', linehl='', numhl='' })
|
||||
vim.fn.sign_define('DapBreakpointCondition', { text='', texthl='DiagnosticSignWarn', linehl='', numhl='' })
|
||||
vim.fn.sign_define('DapBreakpointRejected', { text='', texthl='DiagnosticSignError', linehl='', numhl= '' })
|
||||
vim.fn.sign_define('DapLogPoint', { text='', texthl='DiagnosticSignInfo', linehl='', numhl= '' })
|
||||
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||
require('dapui').open()
|
||||
end
|
||||
|
||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||
-- Commented to prevent DAP UI from closing when unit tests finish
|
||||
-- require('dapui').close()
|
||||
end
|
||||
|
||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||
-- Commented to prevent DAP UI from closing when unit tests finish
|
||||
-- require('dapui').close()
|
||||
end
|
||||
|
||||
-- Add dap configurations based on your language/adapter settings
|
||||
-- https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation
|
||||
-- dap.configurations.xxxxxxxxxx = {
|
||||
-- {
|
||||
-- },
|
||||
-- }
|
||||
end
|
||||
}
|
||||
|
||||
19
lua/plugins/nvim-dap-virtual-text.lua
Normal file
19
lua/plugins/nvim-dap-virtual-text.lua
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
-- Inline Debug Text
|
||||
return {
|
||||
-- https://github.com/theHamsta/nvim-dap-virtual-text
|
||||
'theHamsta/nvim-dap-virtual-text',
|
||||
lazy = true,
|
||||
opts = {
|
||||
-- Display debug text as a comment
|
||||
commented = true,
|
||||
-- Customize virtual text
|
||||
display_callback = function(variable, buf, stackframe, node, options)
|
||||
if options.virt_text_pos == 'inline' then
|
||||
return ' = ' .. variable.value
|
||||
else
|
||||
return variable.name .. ' = ' .. variable.value
|
||||
end
|
||||
end,
|
||||
}
|
||||
}
|
||||
|
||||
27
lua/plugins/nvim-lint.lua
Normal file
27
lua/plugins/nvim-lint.lua
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
-- General purpose linters
|
||||
return {
|
||||
-- https://github.com/mfussenegger/nvim-lint
|
||||
'mfussenegger/nvim-lint',
|
||||
event = 'BufWritePost',
|
||||
config = function ()
|
||||
-- Define a table of linters for each filetype (not extension).
|
||||
-- Additional linters can be found here: https://github.com/mfussenegger/nvim-lint#available-linters
|
||||
require('lint').linters_by_ft = {
|
||||
python = {
|
||||
-- Uncomment whichever linters you prefer
|
||||
-- 'flake8',
|
||||
-- 'mypy',
|
||||
-- 'pylint',
|
||||
}
|
||||
}
|
||||
|
||||
-- Automatically run linters after saving. Use "InsertLeave" for more aggressive linting.
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
-- Only run linter for the following extensions. Remove this to always run.
|
||||
pattern = { "*.py", },
|
||||
callback = function()
|
||||
require("lint").try_lint()
|
||||
end,
|
||||
})
|
||||
end
|
||||
}
|
||||
98
lua/plugins/nvim-lspconfig.lua
Normal file
98
lua/plugins/nvim-lspconfig.lua
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
-- LSP Support
|
||||
return {
|
||||
-- LSP Configuration
|
||||
-- https://github.com/neovim/nvim-lspconfig
|
||||
'neovim/nvim-lspconfig',
|
||||
event = 'VeryLazy',
|
||||
dependencies = {
|
||||
-- LSP Management
|
||||
-- https://github.com/williamboman/mason.nvim
|
||||
{ 'williamboman/mason.nvim' },
|
||||
-- https://github.com/williamboman/mason-lspconfig.nvim
|
||||
{ 'williamboman/mason-lspconfig.nvim' },
|
||||
|
||||
-- Auto-Install LSPs, linters, formatters, debuggers
|
||||
-- https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim
|
||||
{ 'WhoIsSethDaniel/mason-tool-installer.nvim' },
|
||||
|
||||
-- Useful status updates for LSP
|
||||
-- https://github.com/j-hui/fidget.nvim
|
||||
{ 'j-hui/fidget.nvim', opts = {} },
|
||||
|
||||
-- Additional lua configuration, makes nvim stuff amazing!
|
||||
-- https://github.com/folke/neodev.nvim
|
||||
{ 'folke/neodev.nvim', opts = {} },
|
||||
},
|
||||
config = function ()
|
||||
require('mason').setup()
|
||||
require('mason-lspconfig').setup({
|
||||
-- Install these LSPs automatically
|
||||
ensure_installed = {
|
||||
'bashls',
|
||||
'cssls',
|
||||
'html',
|
||||
'lua_ls',
|
||||
'jsonls',
|
||||
'lemminx',
|
||||
'marksman',
|
||||
'quick_lint_js',
|
||||
'yamlls',
|
||||
'pyright',
|
||||
}
|
||||
})
|
||||
|
||||
require('mason-tool-installer').setup({
|
||||
-- Install these linters, formatters, debuggers automatically
|
||||
ensure_installed = {
|
||||
'black',
|
||||
'debugpy',
|
||||
'flake8',
|
||||
'isort',
|
||||
'mypy',
|
||||
'pylint',
|
||||
},
|
||||
})
|
||||
|
||||
-- There is an issue with mason-tools-installer running with VeryLazy, since it triggers on VimEnter which has already occurred prior to this plugin loading so we need to call install explicitly
|
||||
-- https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim/issues/39
|
||||
vim.api.nvim_command('MasonToolsInstall')
|
||||
|
||||
local lspconfig = require('lspconfig')
|
||||
local lsp_capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
local lsp_attach = function(client, bufnr)
|
||||
-- Create your keybindings here...
|
||||
end
|
||||
|
||||
-- Call setup on each LSP server
|
||||
require('mason-lspconfig').setup_handlers({
|
||||
function(server_name)
|
||||
lspconfig[server_name].setup({
|
||||
on_attach = lsp_attach,
|
||||
capabilities = lsp_capabilities,
|
||||
})
|
||||
end
|
||||
})
|
||||
|
||||
-- Lua LSP settings
|
||||
lspconfig.lua_ls.setup {
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = {'vim'},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- Globally configure all LSP floating preview popups (like hover, signature help, etc)
|
||||
local open_floating_preview = vim.lsp.util.open_floating_preview
|
||||
function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...)
|
||||
opts = opts or {}
|
||||
opts.border = opts.border or "rounded" -- Set border to rounded
|
||||
return open_floating_preview(contents, syntax, opts, ...)
|
||||
end
|
||||
|
||||
end
|
||||
}
|
||||
|
||||
9
lua/plugins/nvim-surround.lua
Normal file
9
lua/plugins/nvim-surround.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
-- Add, Change, Delete Surrounding Chars (["''"])
|
||||
return {
|
||||
-- https://github.com/kylechui/nvim-surround
|
||||
'kylechui/nvim-surround',
|
||||
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||
event = "VeryLazy",
|
||||
opts = {}
|
||||
}
|
||||
|
||||
25
lua/plugins/nvim-tree.lua
Normal file
25
lua/plugins/nvim-tree.lua
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
-- File Explorer / Tree
|
||||
return {
|
||||
-- https://github.com/nvim-tree/nvim-tree.lua
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
dependencies = {
|
||||
-- https://github.com/nvim-tree/nvim-web-devicons
|
||||
'nvim-tree/nvim-web-devicons', -- Fancy icon support
|
||||
},
|
||||
opts = {
|
||||
actions = {
|
||||
open_file = {
|
||||
window_picker = {
|
||||
enable = false
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
config = function (_, opts)
|
||||
-- Recommended settings to disable default netrw file explorer
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
require("nvim-tree").setup(opts)
|
||||
end
|
||||
}
|
||||
|
||||
26
lua/plugins/nvim-treesitter.lua
Normal file
26
lua/plugins/nvim-treesitter.lua
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
-- Code Tree Support / Syntax Highlighting
|
||||
return {
|
||||
-- https://github.com/nvim-treesitter/nvim-treesitter
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
event = 'VeryLazy',
|
||||
dependencies = {
|
||||
-- https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
},
|
||||
build = ':TSUpdate',
|
||||
opts = {
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
indent = { enable = true },
|
||||
auto_install = true, -- automatically install syntax support when entering new file type buffer
|
||||
ensure_installed = {
|
||||
'lua',
|
||||
},
|
||||
},
|
||||
config = function (_, opts)
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
configs.setup(opts)
|
||||
end
|
||||
}
|
||||
|
||||
6
lua/plugins/quickfixdd.lua
Normal file
6
lua/plugins/quickfixdd.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
-- Adds delete functionality to quickfix list (keymap dd)
|
||||
return {
|
||||
-- https://github.com/TamaMcGlinn/quickfixdd
|
||||
'TamaMcGlinn/quickfixdd',
|
||||
event = 'VeryLazy'
|
||||
}
|
||||
32
lua/plugins/telescope-nvim.lua
Normal file
32
lua/plugins/telescope-nvim.lua
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
-- Fuzzy finder
|
||||
return {
|
||||
-- https://github.com/nvim-telescope/telescope.nvim
|
||||
'nvim-telescope/telescope.nvim',
|
||||
lazy = true,
|
||||
dependencies = {
|
||||
-- https://github.com/nvim-lua/plenary.nvim
|
||||
{ 'nvim-lua/plenary.nvim' },
|
||||
{
|
||||
-- https://github.com/nvim-telescope/telescope-fzf-native.nvim
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
build = 'make',
|
||||
cond = function()
|
||||
return vim.fn.executable 'make' == 1
|
||||
end,
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
defaults = {
|
||||
layout_config = {
|
||||
vertical = {
|
||||
width = 0.75
|
||||
}
|
||||
},
|
||||
path_display = {
|
||||
filename_first = {
|
||||
reverse_directories = true
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
8
lua/plugins/vim-commentary.lua
Normal file
8
lua/plugins/vim-commentary.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
-- Comment/Uncomment Lines of Code
|
||||
return {
|
||||
-- https://github.com/tpope/vim-commentary
|
||||
'tpope/vim-commentary',
|
||||
event = 'VeryLazy',
|
||||
}
|
||||
|
||||
|
||||
17
lua/plugins/vim-isort.lua
Normal file
17
lua/plugins/vim-isort.lua
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
return {
|
||||
-- https://github.com/fisadev/vim-isort
|
||||
'fisadev/vim-isort',
|
||||
ft = 'python',
|
||||
config = function()
|
||||
-- Disable default key binding
|
||||
vim.g.vim_isort_map = ''
|
||||
|
||||
-- Automatically format file buffer when saving
|
||||
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
||||
pattern = "*.py",
|
||||
callback = function()
|
||||
vim.cmd("Isort")
|
||||
end,
|
||||
})
|
||||
end
|
||||
}
|
||||
7
lua/plugins/vim-maximizer.lua
Normal file
7
lua/plugins/vim-maximizer.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
-- Maximize and Restore Current Window
|
||||
return {
|
||||
-- https://github.com/szw/vim-maximizer
|
||||
'szw/vim-maximizer',
|
||||
event = 'VeryLazy',
|
||||
}
|
||||
|
||||
19
lua/plugins/vim-rest-console.lua
Normal file
19
lua/plugins/vim-rest-console.lua
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
-- REST Client
|
||||
return {
|
||||
-- https://github.com/diepm/vim-rest-console
|
||||
'diepm/vim-rest-console',
|
||||
event = 'VeryLazy',
|
||||
config = function ()
|
||||
-- Turn off the default key binding
|
||||
vim.g.vrc_set_default_mapping = 0
|
||||
-- Set the default response content type to JSON
|
||||
vim.g.vrc_response_default_content_type = 'application/json'
|
||||
-- Set the output buffer name (.json extension to utilize syntax hilighting)
|
||||
vim.g.vrc_output_buffer_name = '_OUTPUT.json'
|
||||
-- Run a format command on the response buffer
|
||||
vim.g.vrc_auto_format_response_patterns = {
|
||||
json = 'jq',
|
||||
}
|
||||
end
|
||||
}
|
||||
|
||||
12
lua/plugins/vim-tmux-navigator.lua
Normal file
12
lua/plugins/vim-tmux-navigator.lua
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
-- Navigate nvim and tmux windows/panels with vim bindings
|
||||
return {
|
||||
-- https://github.com/christoomey/vim-tmux-navigator
|
||||
'christoomey/vim-tmux-navigator',
|
||||
-- Only load this plugin if tmux is being used
|
||||
event = function()
|
||||
if vim.fn.exists("$TMUX") == 1 then
|
||||
return "VeryLazy"
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue