migrate to lazy from packer

This commit is contained in:
Seymur Bagirov 2024-01-20 00:57:17 +04:00
parent 4b344dfd99
commit de8d0a255d
46 changed files with 783 additions and 75 deletions

View File

@ -9,6 +9,7 @@ exec-once=[workspace 1 silent] steam
exec-once= xembedsniproxy & # for wine system tray exec-once= xembedsniproxy & # for wine system tray
exec-once=solaar --window=hide exec-once=solaar --window=hide
exec-once=blueman-applet exec-once=blueman-applet
exec-once=armcord & disown
# exec-once=wallengine --screen-root HDMI-A-2 1383845959 # exec-once=wallengine --screen-root HDMI-A-2 1383845959
# exec-once=/home/themystery/.local/share/JetBrains/Toolbox/bin/jetbrains-toolbox # exec-once=/home/themystery/.local/share/JetBrains/Toolbox/bin/jetbrains-toolbox

View File

@ -11,6 +11,7 @@ require("cloak").setup({
".env*", ".env*",
"wrangler.toml", "wrangler.toml",
".dev.vars", ".dev.vars",
"*.env*"
}, },
-- Match an equals sign and any character after it. -- Match an equals sign and any character after it.
-- This can also be a table of patterns to cloak, -- This can also be a table of patterns to cloak,

View File

@ -9,12 +9,12 @@ local lsp = require("lsp-zero")
-- use csharp_ls language server("https://github.com/razzmatazz/csharp-language-server") lsp.configure('csharp_ls', {
-- i'm using this instead of Mason because the version of it is old in Mason, handlers = {
-- the version here is maintained by dotnet tool and it's the latest ["textDocument/definition"] = require("csharpls_extended").handler,
-- lsp.configure('csharp_ls', { ["textDocument/typeDefinition"] = require("csharpls_extended").handler
-- force_setup = true }
-- }) })
lsp.configure('clangd', { lsp.configure('clangd', {
cmd = { 'clangd', '--offset-encoding=utf-16' }, cmd = { 'clangd', '--offset-encoding=utf-16' },

View File

@ -1,43 +0,0 @@
-- local map = vim.api.nvim_set_keymap
-- local opts = { noremap = true, silent = true }
--
-- -- Move to previous/next
-- map('n', '<A-Right>', '<Cmd>BufferLineCycleNext<CR>', opts)
-- map('n', '<A-Left>', '<Cmd>BufferLineCyclePrev<CR>', opts)
--
-- -- Re-order to previous/next
-- map('n', '<A-,>', '<Cmd>BufferLineMovePrev<CR>', opts)
-- map('n', '<A-.>', '<Cmd>BufferLineMoveNext<CR>', opts)
-- -- Goto buffer in position...
-- map('n', '<leader>1', '<Cmd>BufferLineGoToBuffer 1<CR>', opts)
-- map('n', '<leader>2', '<Cmd>BufferLineGoToBuffer 2<CR>', opts)
-- map('n', '<leader>3', '<Cmd>BufferLineGoToBuffer 3<CR>', opts)
-- map('n', '<leader>4', '<Cmd>BufferLineGoToBuffer 4<CR>', opts)
-- map('n', '<leader>5', '<Cmd>BufferLineGoToBuffer 5<CR>', opts)
-- map('n', '<leader>6', '<Cmd>BufferLineGoToBuffer 6<CR>', opts)
-- map('n', '<leader>7', '<Cmd>BufferLineGoToBuffer 7<CR>', opts)
-- map('n', '<leader>8', '<Cmd>BufferLineGoToBuffer 8<CR>', opts)
-- map('n', '<leader>9', '<Cmd>BufferLineGoToBuffer 9<CR>', opts)
-- map('n', '<leader>0', '<Cmd>BufferLineGoToBuffer -1<CR>', opts)
--
-- -- Pin/unpin buffer
-- map('n', '<A-p>', '<Cmd>BufferLineTogglePin<CR>', opts)
-- -- Close buffer
-- map('n', '<A-c>', '<Cmd>BufferLinePickClose<CR>', opts)
--
-- -- Close commands
-- map('n', '<leader>cll', '<Cmd>BufferLineCloseLeft<CR>', opts)
-- map('n', '<leader>clr', '<Cmd>BufferLineCloseRight<CR>', opts)
--
-- require('bufferline').setup{
-- options = {
-- offsets = {
-- {
-- filetype = "neo-tree",
-- text = "Neo-tree",
-- text_align = "left",
-- highlight = "Directory",
-- }
-- },
-- }
-- }

51
nvim/lazy-lock.json Normal file
View File

@ -0,0 +1,51 @@
{
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
"Ionide-vim": { "branch": "master", "commit": "8435bae84b26b602dbb68399661b3989915cc4d3" },
"LuaSnip": { "branch": "master", "commit": "2dbef19461198630b3d7c39f414d09fb07d1fdd2" },
"barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" },
"cloak.nvim": { "branch": "main", "commit": "951b163e55ce7639eb320c450bde9283c4fe968b" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"copilot.vim": { "branch": "release", "commit": "49e0348bfb913fae63ca5ddb987a8bccd193da86" },
"csharpls-extended-lsp.nvim": { "branch": "master", "commit": "bde4aebe0dc74952188c2130c6831a1d8e4ce5c6" },
"friendly-snippets": { "branch": "main", "commit": "69a2c1675b66e002799f5eef803b87a12f593049" },
"gitsigns.nvim": { "branch": "main", "commit": "4aaacbf5e5e2218fd05eb75703fe9e0f85335803" },
"harpoon": { "branch": "harpoon2", "commit": "2cd4e03372f7ee5692c8caa220f479ea07970f17" },
"image.nvim": { "branch": "master", "commit": "245422e5c4774f0640d41c0eadec77396f2be4a9" },
"indent-blankline.nvim": { "branch": "master", "commit": "12e92044d313c54c438bd786d11684c88f6f78cd" },
"lazy.nvim": { "branch": "main", "commit": "747bb955c5bfb2dc5d51280132f00a56a53f9f6d" },
"leap.nvim": { "branch": "main", "commit": "0c2f6a27d0706fa86f2512bb0c470b68876e55fe" },
"lsp-zero.nvim": { "branch": "v3.x", "commit": "dec1c21204e2d9d49dad989b577c88958ed2c113" },
"lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "3ba1b92b771f33256b4969d696b82c8ae7075364" },
"mason.nvim": { "branch": "main", "commit": "e110bc3be1a7309617cecd77bfe4bf86ba1b8134" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "2f2d08894bbc679d4d181604c16bb7079f646384" },
"neodev.nvim": { "branch": "main", "commit": "482abc6688a028ce183719b0350d0235ae2c2e83" },
"noice.nvim": { "branch": "main", "commit": "92433164e2f7118d4122c7674c3834d9511722ba" },
"nui.nvim": { "branch": "main", "commit": "35da9ca1de0fc4dda96c2e214d93d363c145f418" },
"nvim-autopairs": { "branch": "master", "commit": "9fd41181693dd4106b3e414a822bb6569924de81" },
"nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" },
"nvim-dap": { "branch": "master", "commit": "9adbfdca13afbe646d09a8d7a86d5d031fb9c5a5" },
"nvim-dap-ui": { "branch": "master", "commit": "a6beb3a855b42faa1d0fee1081602257719c2c5e" },
"nvim-lightbulb": { "branch": "master", "commit": "8f00b89dd1b1dbde16872bee5fbcee2e58c9b8e9" },
"nvim-lspconfig": { "branch": "master", "commit": "042aa6b27b8b8d4f4e1bd42de2037c83d676a8a0" },
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
"nvim-notify": { "branch": "master", "commit": "80b67b265530632505193553d05127ae7fe09ddd" },
"nvim-treesitter": { "branch": "master", "commit": "4a4dbe1cb1da34d87fc42a40aaf8e218af4cfe0f" },
"nvim-treesitter-context": { "branch": "master", "commit": "85cf977181fb8e816e47ac05df7f756e9cb72caf" },
"nvim-ts-autotag": { "branch": "main", "commit": "8515e48a277a2f4947d91004d9aa92c29fdc5e18" },
"nvim-ufo": { "branch": "main", "commit": "b0741a647efd98d9abb6cb653e056d24a07e4581" },
"nvim-web-devicons": { "branch": "master", "commit": "140edfcf25093e8b321d13e154cbce89ee868ca0" },
"onedarkpro.nvim": { "branch": "main", "commit": "44badbaa1c4408679adc6b6979b669540db3fb46" },
"plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" },
"promise-async": { "branch": "main", "commit": "94f6f03c6c1e2aab551aacdf0c1e597a7269abb6" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "master", "commit": "9cf58f438f95f04cf1709b734bbcb9243c262d70" },
"trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" },
"undotree": { "branch": "master", "commit": "36ff7abb6b60980338344982ad4cdf03f7961ecd" },
"vim-fugitive": { "branch": "master", "commit": "ec8f7eed103c6d5b75eac69196bb87db0825629a" },
"vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }
}

View File

@ -1,8 +1,9 @@
require("themystery.set") require("themystery.set")
require("themystery.remap") require("themystery.remap")
package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?/init.lua;" package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?/init.lua;"
package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?.lua;" package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?.lua;"
require("themystery.lazy")
local augroup = vim.api.nvim_create_augroup local augroup = vim.api.nvim_create_augroup
local TheMysteryGroup = augroup('TheMystery', {}) local TheMysteryGroup = augroup('TheMystery', {})

View File

@ -0,0 +1,16 @@
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)
require("lazy").setup("themystery.plugins");

View File

@ -12,22 +12,10 @@ return require('packer').startup(function(use)
requires = { { 'nvim-lua/plenary.nvim' } } requires = { { 'nvim-lua/plenary.nvim' } }
} }
-- use({
-- 'rose-pine/neovim',
-- as = 'rose-pine',
-- config = function()
-- vim.cmd('colorscheme rose-pine')
-- end
-- })
use 'numToStr/Comment.nvim' use 'numToStr/Comment.nvim'
-- use 'navarasu/onedark.nvim'
use "olimorris/onedarkpro.nvim" use "olimorris/onedarkpro.nvim"
-- use 'folke/tokyonight.nvim'
use({ use({
"folke/trouble.nvim", "folke/trouble.nvim",
config = function() config = function()
@ -78,12 +66,6 @@ return require('packer').startup(function(use)
use("eandrju/cellular-automaton.nvim") use("eandrju/cellular-automaton.nvim")
use("laytan/cloak.nvim") use("laytan/cloak.nvim")
-- use {
-- 'nvim-tree/nvim-tree.lua',
-- requires = {
-- 'nvim-tree/nvim-web-devicons', -- optional
-- },
-- }
use { use {
"nvim-neo-tree/neo-tree.nvim", "nvim-neo-tree/neo-tree.nvim",
@ -114,11 +96,6 @@ return require('packer').startup(function(use)
use 'andweeb/presence.nvim' use 'andweeb/presence.nvim'
-- use {'romgrk/barbar.nvim', requires = {
-- 'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status
-- 'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons
-- }
-- }
use { use {
'glepnir/dashboard-nvim', 'glepnir/dashboard-nvim',
@ -153,8 +130,6 @@ return require('packer').startup(function(use)
end, end,
}) })
use { 'akinsho/bufferline.nvim', tag = "*", requires = 'nvim-tree/nvim-web-devicons' }
use { 'kosayoda/nvim-lightbulb' } use { 'kosayoda/nvim-lightbulb' }
use "lukas-reineke/indent-blankline.nvim" use "lukas-reineke/indent-blankline.nvim"
@ -188,4 +163,6 @@ return require('packer').startup(function(use)
require('leap').create_default_mappings() require('leap').create_default_mappings()
end end
}) })
use {"Decodetalkers/csharpls-extended-lsp.nvim"}
end) end)

View File

@ -0,0 +1,12 @@
return {
"utilyre/barbecue.nvim",
name = "barbecue",
version = "*",
dependencies = {
"SmiteshP/nvim-navic",
"nvim-tree/nvim-web-devicons", -- optional dependency
},
opts = {
attach_navic = false
},
}

View File

@ -0,0 +1,27 @@
return {
"laytan/cloak.nvim",
config = function()
require("cloak").setup({
enabled = true,
cloak_character = "*",
-- The applied highlight group (colors) on the cloaking, see `:h highlight`.
highlight_group = "Comment",
patterns = {
{
-- Match any file starting with ".env".
-- This can be a table to match multiple file patterns.
file_pattern = {
".env*",
"wrangler.toml",
".dev.vars",
"*.env*"
},
-- Match an equals sign and any character after it.
-- This can also be a table of patterns to cloak,
-- example: cloak_pattern = { ":.+", "-.+" } for yaml files.
cloak_pattern = "=.+"
},
},
})
end
}

View File

@ -0,0 +1,17 @@
return {
"numToStr/Comment.nvim",
config = function()
require('Comment').setup({
toggler = {
-- if you're using other terminals use '<C-_>' but for some reason in kitty this didn't work, so i used '<C-/>'
line = '<C-/>',
block = '<C-\\>',
},
opleader = {
-- look at the comment above
line = '<C-/>',
block = '<C-\\>',
},
})
end
}

View File

@ -0,0 +1,22 @@
return {
"rcarriga/nvim-dap-ui",
dependencies = { "mfussenegger/nvim-dap" },
config = function()
-- dap keymaps
vim.keymap.set("n", "<F5>", "<cmd>lua require'dap'.continue()<CR>")
vim.keymap.set("n", "<F10>", "<cmd>lua require'dap'.step_over()<CR>")
vim.keymap.set("n", "<F11>", "<cmd>lua require'dap'.step_into()<CR>")
vim.keymap.set("n", "<F12>", "<cmd>lua require'dap'.step_out()<CR>")
vim.keymap.set("n", "<leader>b", "<cmd>lua require'dap'.toggle_breakpoint()<CR>")
vim.keymap.set("n", "<leader>B",
"<cmd>lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))<CR>")
vim.keymap.set("n", "<leader>lp",
"<cmd>lua require'dap'.set_breakpoint(nil, nil, vim.fn.input('Log point message: '))<CR>")
vim.keymap.set("n", "<leader>dr", "<cmd>lua require'dap'.repl.open()<CR>")
require("dapui").setup()
-- dapui keymaps
vim.keymap.set("n", "<leader>dui", "<cmd>lua require'dapui'.toggle()<CR>")
end
}

View File

@ -0,0 +1,34 @@
return {
"tpope/vim-fugitive",
config = function()
vim.keymap.set("n", "<leader>gs", vim.cmd.Git)
local ThePrimeagen_Fugitive = vim.api.nvim_create_augroup("ThePrimeagen_Fugitive", {})
local autocmd = vim.api.nvim_create_autocmd
autocmd("BufWinEnter", {
group = ThePrimeagen_Fugitive,
pattern = "*",
callback = function()
if vim.bo.ft ~= "fugitive" then
return
end
local bufnr = vim.api.nvim_get_current_buf()
local opts = { buffer = bufnr, remap = false }
vim.keymap.set("n", "<leader>p", function()
vim.cmd.Git('push')
end, opts)
-- rebase always
vim.keymap.set("n", "<leader>P", function()
vim.cmd.Git({ 'pull', '--rebase' })
end, opts)
-- NOTE: It allows me to easily set the branch i am pushing and any tracking
-- needed if i did not set the branch up correctly
vim.keymap.set("n", "<leader>t", ":Git push -u origin ", opts);
end,
})
end
}

View File

@ -0,0 +1,21 @@
return {
"ThePrimeagen/harpoon",
branch = "harpoon2",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
local harpoon = require("harpoon")
harpoon:setup()
vim.keymap.set("n", "<leader>a", function() harpoon:list():append() end)
vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
vim.keymap.set("n", "<leader>hlc", function() harpoon:list():clear() end)
vim.keymap.set("n", "<leader>hc", function() harpoon:list():remove() end)
vim.keymap.set("n", "<leader>1", function() harpoon:list():select(1) end)
vim.keymap.set("n", "<leader>2", function() harpoon:list():select(2) end)
vim.keymap.set("n", "<leader>3", function() harpoon:list():select(3) end)
vim.keymap.set("n", "<leader>4", function() harpoon:list():select(4) end)
end
}

View File

@ -0,0 +1,33 @@
return {
"3rd/image.nvim",
config = function()
require("image").setup({
backend = "kitty",
integrations = {
markdown = {
enabled = true,
clear_in_insert_mode = false,
download_remote_images = true,
only_render_image_at_cursor = false,
filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here
},
neorg = {
enabled = true,
clear_in_insert_mode = false,
download_remote_images = true,
only_render_image_at_cursor = false,
filetypes = { "norg" },
},
},
max_width = nil,
max_height = nil,
max_width_window_percentage = nil,
max_height_window_percentage = 50,
window_overlap_clear_enabled = false, -- toggles images when windows are overlapped
window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "" },
editor_only_render_when_focused = false, -- auto show/hide images when the editor gains/looses focus
tmux_show_only_in_active_window = false, -- auto show/hide images in the correct Tmux window (needs visual-activity off)
hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp" }, -- render image files as images when opened
})
end
}

View File

@ -0,0 +1,67 @@
return {
"nvim-lua/plenary.nvim",
{
"github/copilot.vim",
config = function()
vim.g.copilot_no_tab_map = true
vim.api.nvim_set_keymap("i", "<C-J>", 'copilot#Accept("<CR>")', { silent = true, expr = true })
end
},
{
"nvim-treesitter/nvim-treesitter", build = ":TSUpdate"
},
{
"mbbill/undotree",
config = function()
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
end
},
"lewis6991/gitsigns.nvim",
"windwp/nvim-ts-autotag",
"windwp/nvim-autopairs",
{
"kosayoda/nvim-lightbulb",
opts = {
autocmd = { enabled = true }
}
},
{ "lukas-reineke/indent-blankline.nvim", main = "ibl", opts = {} },
"mfussenegger/nvim-dap",
"folke/neodev.nvim",
{
"ionide/Ionide-vim",
event = "VimEnter"
},
{
'ggandor/leap.nvim',
dependencies = { 'tpope/vim-repeat' },
config = function()
require('leap').create_default_mappings()
end
},
"SmiteshP/nvim-navic",
"Decodetalkers/csharpls-extended-lsp.nvim",
{
'VonHeikemen/lsp-zero.nvim',
branch = 'v3.x',
dependencies = {
-- LSP Support
'neovim/nvim-lspconfig',
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
-- Autocompletion
'hrsh7th/nvim-cmp',
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
'saadparwaiz1/cmp_luasnip',
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-nvim-lua',
-- Snippets
'L3MON4D3/LuaSnip',
'rafamadriz/friendly-snippets',
}
}
}

View File

@ -0,0 +1,220 @@
return {
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons', lazy = true },
config = function()
local colors = {
bg = '#202328',
fg = '#bbc2cf',
yellow = '#ECBE7B',
cyan = '#008080',
darkblue = '#081633',
green = '#98be65',
orange = '#FF8800',
violet = '#a9a1e1',
magenta = '#c678dd',
blue = '#51afef',
red = '#ec5f67',
}
local conditions = {
buffer_not_empty = function()
return vim.fn.empty(vim.fn.expand('%:t')) ~= 1
end,
hide_in_width = function()
return vim.fn.winwidth(0) > 80
end,
check_git_workspace = function()
local filepath = vim.fn.expand('%:p:h')
local gitdir = vim.fn.finddir('.git', filepath .. ';')
return gitdir and #gitdir > 0 and #gitdir < #filepath
end,
}
-- Config
local config = {
options = {
-- Disable sections and component separators
component_separators = '',
section_separators = '',
theme = 'onedark_vivid',
globalstatus = true
},
sections = {
-- these are to remove the defaults
lualine_a = {},
lualine_b = {},
lualine_y = {},
lualine_z = {},
-- These will be filled later
lualine_c = {},
lualine_x = {
{
require("noice").api.status.command.get,
cond = require("noice").api.status.command.has,
color = { fg = "#ff9e64" },
}
},
},
inactive_sections = {
-- these are to remove the defaults
lualine_a = {},
lualine_b = {},
lualine_y = {},
lualine_z = {},
lualine_c = {},
lualine_x = {},
},
}
-- Inserts a component in lualine_c at left section
local function ins_left(component)
table.insert(config.sections.lualine_c, component)
end
-- Inserts a component in lualine_x at right section
local function ins_right(component)
table.insert(config.sections.lualine_x, component)
end
ins_left {
function()
return ''
end,
color = { fg = colors.blue }, -- Sets highlighting of component
padding = { left = 0, right = 1 }, -- We don't need space before this
}
ins_left {
-- mode component
function()
return ''
end,
color = function()
-- auto change color according to neovims mode
local mode_color = {
n = colors.red,
i = colors.green,
v = colors.blue,
[''] = colors.blue,
V = colors.blue,
c = colors.magenta,
no = colors.red,
s = colors.orange,
S = colors.orange,
[''] = colors.orange,
ic = colors.yellow,
R = colors.violet,
Rv = colors.violet,
cv = colors.red,
ce = colors.red,
r = colors.cyan,
rm = colors.cyan,
['r?'] = colors.cyan,
['!'] = colors.red,
t = colors.red,
}
return { fg = mode_color[vim.fn.mode()] }
end,
padding = { right = 1 },
}
ins_left {
-- filesize component
'filesize',
cond = conditions.buffer_not_empty,
}
ins_left {
'filename',
cond = conditions.buffer_not_empty,
color = { fg = colors.magenta, gui = 'bold' },
}
ins_left { 'location' }
ins_left { 'progress', color = { fg = colors.fg, gui = 'bold' } }
ins_left {
'diagnostics',
sources = { 'nvim_diagnostic' },
symbols = { error = '', warn = '', info = '' },
diagnostics_color = {
color_error = { fg = colors.red },
color_warn = { fg = colors.yellow },
color_info = { fg = colors.cyan },
},
}
-- Insert mid section. You can make any number of sections in neovim :)
-- for lualine it's any number greater then 2
ins_left {
function()
return '%='
end,
}
ins_left {
-- Lsp server name .
function()
local msg = 'No Active Lsp'
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype')
local clients = vim.lsp.get_active_clients()
if next(clients) == nil then
return msg
end
for _, client in ipairs(clients) do
local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
return client.name
end
end
return msg
end,
icon = ' LSP:',
color = { fg = '#ffffff', gui = 'bold' },
}
-- Add components to right sections
ins_right {
'o:encoding', -- option component same as &encoding in viml
fmt = string.upper, -- I'm not sure why it's upper case either ;)
cond = conditions.hide_in_width,
color = { fg = colors.green, gui = 'bold' },
}
ins_right {
'fileformat',
fmt = string.upper,
icons_enabled = false, -- I think icons are cool but Eviline doesn't have them. sigh
color = { fg = colors.green, gui = 'bold' },
}
ins_right {
'branch',
icon = '',
color = { fg = colors.violet, gui = 'bold' },
}
ins_right {
'diff',
-- Is it me or the symbol for modified us really weird
symbols = { added = '', modified = '󰝤 ', removed = '' },
diff_color = {
added = { fg = colors.green },
modified = { fg = colors.orange },
removed = { fg = colors.red },
},
cond = conditions.hide_in_width,
}
ins_right {
function()
return ''
end,
color = { fg = colors.blue },
padding = { left = 1 },
}
require('lualine').setup(config)
end
}

View File

@ -0,0 +1,44 @@
return {
"folke/noice.nvim",
event = "VeryLazy",
dependencies = {
"MunifTanjim/nui.nvim",
"rcarriga/nvim-notify",
},
config = function()
require("noice").setup({
lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
},
-- you can enable a preset for easier configuration
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
},
routes = {
{
-- this is needed to filter out excessive lsp progress messages from Ionide(F#)
-- we just check if the message contains .fs extension and skip it
filter = {
event = "lsp",
kind = "progress",
find = ".*%.fs.*",
},
opts = { skip = true },
},
},
})
require("notify").setup({
background_colour = "#000000",
})
end
}

View File

@ -0,0 +1,61 @@
return {
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope-ui-select.nvim"
},
config = function()
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>pf', builtin.find_files, {})
vim.keymap.set('n', '<C-p>', builtin.git_files, {})
vim.keymap.set('n', '<leader>ps', function()
builtin.grep_string({ search = vim.fn.input("Grep > ") })
end)
vim.keymap.set('n', '<leader>pb', builtin.buffers, {})
vim.keymap.set('n', '<leader>vh', builtin.help_tags, {})
local actions = require('telescope.actions')
require('telescope').setup {
extensions = {
["ui-select"] = {
require("telescope.themes").get_cursor {}
}
},
defaults = {
mappings = {
i = {
["<C-s>"] = actions.select_vertical,
},
n = {
["<C-s>"] = actions.select_vertical,
},
},
},
pickers = {
find_files = {
theme = "dropdown"
},
git_files = {
theme = "dropdown"
},
grep_string = {
theme = "dropdown"
},
buffers = {
theme = "dropdown",
mappings = {
n = {
['<C-d>'] = actions.delete_buffer
},
i = {
['<C-d>'] = actions.delete_buffer
}
}
}
}
}
require("telescope").load_extension("ui-select")
end
}

View File

@ -0,0 +1,12 @@
return {
"olimorris/onedarkpro.nvim",
config = function()
require("onedarkpro").setup({
options = {
transparency = true,
}
})
vim.cmd("colorscheme onedark_vivid")
end
}

View File

@ -0,0 +1,72 @@
return {
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim",
},
config = function()
-- https://github.com/nvim-neo-tree/neo-tree.nvim/issues/202#issuecomment-1428278234
-- These two functions were taken from the issue above. So, Thanks!
local delete = function(state)
local inputs = require("neo-tree.ui.inputs")
local path = state.tree:get_node().path
local msg = "Are you sure you want to trash " .. path
inputs.confirm(msg, function(confirmed)
if not confirmed then return end
vim.fn.system { "trash", path }
require("neo-tree.sources.manager").refresh(state.name)
end)
end
-- over write default 'delete_visual' command to 'trash' x n.
local delete_visual = function(state, selected_nodes)
local inputs = require("neo-tree.ui.inputs")
-- get table items count
function GetTableLen(tbl)
local len = 0
for n in pairs(tbl) do
len = len + 1
end
return len
end
local count = GetTableLen(selected_nodes)
local msg = "Are you sure you want to trash " .. count .. " files ?"
inputs.confirm(msg, function(confirmed)
if not confirmed then return end
for _, node in ipairs(selected_nodes) do
vim.fn.system { "trash", node.path }
end
require("neo-tree.sources.manager").refresh(state.name)
end)
end
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
require("neo-tree").setup({
window = {
position = "float",
},
filesystem = {
filtered_items = {
visible = true
},
use_libuv_file_watcher = true,
commands = {
delete = delete,
delete_visual = delete_visual,
},
hijack_netrw_behavior = "open_current"
},
})
vim.keymap.set("n", "<leader>tf", vim.cmd.Neotree)
vim.keymap.set("n", "<leader>tt", "<Cmd>Neotree reveal=true position=float toggle <CR>")
end
}

View File

@ -0,0 +1,34 @@
return {
{
"nvim-treesitter/nvim-treesitter",
config = function()
require 'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all"
ensure_installed = { "vimdoc", "javascript", "typescript", "c", "lua", "rust", "c_sharp" },
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,
highlight = {
-- `false` will disable the whole extension
enable = true,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
autotag = {
enable = true,
}
}
end
},
"nvim-treesitter/nvim-treesitter-context"
}

View File

@ -0,0 +1,9 @@
return {
"folke/trouble.nvim",
config = function()
require("trouble").setup()
vim.keymap.set("n", "<leader>xq", "<cmd>TroubleToggle<cr>",
{ silent = true, noremap = true }
)
end
}

View File

@ -0,0 +1,19 @@
return {
"kevinhwang91/nvim-ufo",
dependencies = {
"kevinhwang91/promise-async"
},
config = function()
vim.o.foldcolumn = '1' -- '0' is not bad
vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
vim.o.foldlevelstart = 99
vim.o.foldenable = true
require('ufo').setup()
vim.keymap.set('n', 'zR', require('ufo').openAllFolds)
vim.keymap.set('n', 'zM', require('ufo').closeAllFolds)
vim.keymap.set('n', 'zr', require('ufo').openFoldsExceptKinds)
vim.keymap.set('n', 'zm', require('ufo').closeFoldsWith) -- closeAllFolds == closeFoldsWith(0)
end
}