Refresh neovim config
This commit is contained in:
parent
9e05f9cba8
commit
ec75c94867
@ -1,7 +1,7 @@
|
||||
require('core/keymap')
|
||||
require("core/keymap")
|
||||
|
||||
require('lazy-init')
|
||||
require("lazy-init")
|
||||
|
||||
require('core/basic-vars')
|
||||
require('core/options')
|
||||
require('core/theme')
|
||||
require("core/basic-vars")
|
||||
require("core/options")
|
||||
require("core/theme")
|
||||
|
||||
@ -1,48 +1,50 @@
|
||||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
|
||||
"LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
|
||||
"alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" },
|
||||
"auto-session": { "branch": "main", "commit": "82630e2f70be140f8dcc75a12e2ee2839e8488c2" },
|
||||
"auto-session": { "branch": "main", "commit": "00334ee24b9a05001ad50221c8daffbeedaa0842" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
|
||||
"cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"conform.nvim": { "branch": "master", "commit": "363243c03102a531a8203311d4f2ae704c620d9b" },
|
||||
"conform.nvim": { "branch": "master", "commit": "374aaf384e2e841607b8e2fe63fa3ad01d111c91" },
|
||||
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "56ef6a969a4990d938c5fed40c370f65e125fc97" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "9b36d497495436c135659902054ee637e0ba6021" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "43b0c856ae5f32a195d83f4a27fe21d63e6c966c" },
|
||||
"hererocks": { "branch": "master", "commit": "c9c5444dea1e07e005484014a8231aa667be30b6" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "e10626f7fcd51ccd56d7ffc00883ba7e0aa28f78" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "7527af40ddd4a93a02911be570b32609b9d4ea53" },
|
||||
"lazygit.nvim": { "branch": "main", "commit": "adc37c5a6d7d6e8d0a039f08f3c7837971a1c77a" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
|
||||
"lazygit.nvim": { "branch": "main", "commit": "b9eae3badab982e71abab96d3ee1d258f0c07961" },
|
||||
"lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "f75e877f5266e87523eb5a18fcde2081820d087b" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "374c78d3ebb5c53f43ea6bd906b6587b5e899b9e" },
|
||||
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||
"mini.nvim": { "branch": "main", "commit": "87fc38a8a2b8d498cecb021d057a38ea2e9f5a79" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "3d02855468f94bf435db41b661b58ec4f48a06b7" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "12509903a5723a876abd65953109f926f4634c30" },
|
||||
"nvim-lint": { "branch": "master", "commit": "789b7ada1b4f00e08d026dffde410dcfa6a0ba87" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "d39a75bbce4b8aad5d627191ea915179c77c100f" },
|
||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" },
|
||||
"mason.nvim": { "branch": "main", "commit": "7c7318e8bae7e3536ef6b9e86b9e38e74f2e125e" },
|
||||
"mini.nvim": { "branch": "main", "commit": "009435c6c3653d54bc62997ca6b2e8513bc52cf4" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
||||
"nvim-dap": { "branch": "master", "commit": "8df427aeba0a06c6577dc3ab82de3076964e3b8d" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "73a26abf4941aa27da59820fd6b028ebcdbcf932" },
|
||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "df66808cd78b5a97576bbaeee95ed5ca385a9750" },
|
||||
"nvim-lint": { "branch": "master", "commit": "c4043f48eb7e16bcfe96de1d9b718b695ff95ed6" },
|
||||
"nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "66bc018936c6ff76beb75f89d986af6442db4001" },
|
||||
"nvim-surround": { "branch": "main", "commit": "ae298105122c87bbe0a36b1ad20b06d417c0433e" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "70825f23db61ecd900c4cfea169bffe931926a9d" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "53a6b3993f5803378d4d031bf114c0b125a52ba8" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "61e5109c8cf24807e4ae29813a3a82b31821dd45" },
|
||||
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
||||
"nvim-surround": { "branch": "main", "commit": "0e62500b98f4513feaaf7425c135472457ea5b7d" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "e7d1b7dadc62fe2eccc17d814354b0a5688621ce" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "066fd6505377e3fd4aa219e61ce94c2b8bdb0b79" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "402377242b04be3f4f0f3720bd952df86e946c30" },
|
||||
"onedark.nvim": { "branch": "master", "commit": "67a74c275d1116d575ab25485d1bfa6b2a9c38a6" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" },
|
||||
"rest.nvim": { "branch": "main", "commit": "62606c3599bd304227457d6e20580965939b191e" },
|
||||
"substitute.nvim": { "branch": "main", "commit": "97f49d16f8eea7967d41db4f657dd63af53eeba1" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "415af52339215926d705cccc08145f3782c4d132" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "f1420728f59843eb2ef084406b3d0201a0a0932d" },
|
||||
"onedark.nvim": { "branch": "master", "commit": "11de4da47f3e69cb70c3ae9816bd8af166cbe121" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||
"rest.nvim": { "branch": "main", "commit": "2ded89dbda1fd3c1430685ffadf2df8beb28336d" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "6f380b8826fb819c752c8fd7daaee9ef96d4c689" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" },
|
||||
"vim-css-color": { "branch": "master", "commit": "14fd934cdd9ca1ac0e53511094e612eb9bace373" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "0e76a87ac51772569aec678dc74baa8e2a86100c" }
|
||||
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ vim.o.cursorline = true
|
||||
vim.o.expandtab = true
|
||||
|
||||
-- Mouse
|
||||
vim.o.mouse = 'a'
|
||||
vim.o.mouse = "a"
|
||||
|
||||
-- Line numbers
|
||||
vim.o.number = true
|
||||
@ -21,7 +21,7 @@ vim.o.wrap = false
|
||||
vim.o.showmode = false
|
||||
|
||||
-- Undo
|
||||
vim.o.undodir = vim.fn.expand('~/.vim/undo')
|
||||
vim.o.undodir = vim.fn.expand("~/.vim/undo")
|
||||
vim.o.undofile = true
|
||||
vim.o.undolevels = 1024
|
||||
|
||||
|
||||
@ -1,15 +1,17 @@
|
||||
vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ' '
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
-- Insert mode tweaks
|
||||
vim.keymap.set('i', 'jk', '<ESC>', { desc = 'Exit insert mode' })
|
||||
vim.keymap.set("i", "jk", "<ESC>", { desc = "Exit insert mode" })
|
||||
|
||||
-- Window management
|
||||
vim.keymap.set('n', '<leader>sv', '<C-w>v', { desc = 'Split window vertically' })
|
||||
vim.keymap.set('n', '<leader>sh', '<C-w>h', { desc = 'Split window horizonatally' })
|
||||
vim.keymap.set('n', '<leader>se', '<C-w>=', { desc = 'Make splits equal size' })
|
||||
vim.keymap.set('n', '<leader>sx', '<cmd>close<cr>', { desc = 'Close current split' })
|
||||
vim.keymap.set("n", "<leader>sv", "<C-w>v", { desc = "Split window vertically" })
|
||||
vim.keymap.set("n", "<leader>sh", "<C-w>h", { desc = "Split window horizonatally" })
|
||||
vim.keymap.set("n", "<leader>se", "<C-w>=", { desc = "Make splits equal size" })
|
||||
vim.keymap.set("n", "<leader>sx", "<cmd>close<cr>", { desc = "Close current split" })
|
||||
|
||||
-- Buffer management
|
||||
vim.keymap.set('n', '<leader>bn', '<cmd>bn<cr>', { desc = 'Next buffer' })
|
||||
vim.keymap.set('n', '<leader>bp', '<cmd>bp<cr>', { desc = 'Prev buffer' })
|
||||
vim.keymap.set("n", "<leader>bn", "<cmd>bn<cr>", { desc = "Next buffer" })
|
||||
vim.keymap.set("n", "<leader>bp", "<cmd>bp<cr>", { desc = "Prev buffer" })
|
||||
vim.keymap.set("n", "<leader>bd", "<cmd>bd<cr>", { desc = "Close buffer" })
|
||||
vim.keymap.set("n", "<leader>ba", "<cmd>1,.-bd|.+,$bd<cr>", { desc = "Close other buffers" })
|
||||
|
||||
@ -1 +1 @@
|
||||
vim.cmd('let g:netrw_liststyle = 3')
|
||||
vim.cmd("let g:netrw_liststyle = 3")
|
||||
|
||||
@ -6,14 +6,14 @@
|
||||
|
||||
-- Load nvim color scheme:
|
||||
-- Change the 'require' values with your color scheme
|
||||
local status_ok, color_scheme = pcall(require, 'onedark')
|
||||
local status_ok, color_scheme = pcall(require, "onedark")
|
||||
if not status_ok then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
-- OneDark styles: dark, darker, cool, deep, warm, warmer, light
|
||||
require('onedark').setup {
|
||||
style = 'deep',
|
||||
colors = { fg = '#b2bbcc' }, --default: #a0a8b7
|
||||
}
|
||||
require('onedark').load()
|
||||
require("onedark").setup({
|
||||
style = "deep",
|
||||
colors = { fg = "#b2bbcc" }, --default: #a0a8b7
|
||||
})
|
||||
require("onedark").load()
|
||||
|
||||
@ -3,31 +3,30 @@
|
||||
-----------------------------------------------------------
|
||||
|
||||
-- Plugin manager: lazy.nvim
|
||||
-- url: https://github.com/folke/lazy.nvim
|
||||
-- url: https://github.com/folke/lazy.nvim
|
||||
|
||||
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
|
||||
local out = vim.fn.system({ 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ 'Failed to clone lazy.nvim:\n', 'ErrorMsg' },
|
||||
{ out, 'WarningMsg' },
|
||||
{ '\nPress any key to exit...' },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require('lazy').setup('lazy-plugins', {
|
||||
checker = {
|
||||
enabled = true,
|
||||
notify = false,
|
||||
},
|
||||
change_detection = {
|
||||
notify = false,
|
||||
},
|
||||
require("lazy").setup("lazy-plugins", {
|
||||
checker = {
|
||||
enabled = true,
|
||||
notify = false,
|
||||
},
|
||||
change_detection = {
|
||||
notify = false,
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
207
nvim/.config/nvim/lua/lazy-plugins/debug-nvim-dap.lua
Normal file
207
nvim/.config/nvim/lua/lazy-plugins/debug-nvim-dap.lua
Normal file
@ -0,0 +1,207 @@
|
||||
---@param config {type?:string, args?:string[]|fun():string[]?}
|
||||
local function get_args(config)
|
||||
local args = type(config.args) == "function" and (config.args() or {}) or config.args or {} --[[@as string[] | string ]]
|
||||
local args_str = type(args) == "table" and table.concat(args, " ") or args --[[@as string]]
|
||||
|
||||
config = vim.deepcopy(config)
|
||||
---@cast args string[]
|
||||
config.args = function()
|
||||
local new_args = vim.fn.expand(vim.fn.input("Run with args: ", args_str)) --[[@as string]]
|
||||
if config.type and config.type == "java" then
|
||||
---@diagnostic disable-next-line: return-type-mismatch
|
||||
return new_args
|
||||
end
|
||||
return require("dap.utils").splitstr(new_args)
|
||||
end
|
||||
return config
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
dependencies = {
|
||||
"rcarriga/nvim-dap-ui",
|
||||
-- virtual text for the debugger
|
||||
{
|
||||
"theHamsta/nvim-dap-virtual-text",
|
||||
opts = {},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>dB",
|
||||
function()
|
||||
require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: "))
|
||||
end,
|
||||
desc = "Breakpoint Condition",
|
||||
},
|
||||
{
|
||||
"<leader>db",
|
||||
function()
|
||||
require("dap").toggle_breakpoint()
|
||||
end,
|
||||
desc = "Toggle Breakpoint",
|
||||
},
|
||||
{
|
||||
"<leader>dc",
|
||||
function()
|
||||
require("dap").continue()
|
||||
end,
|
||||
desc = "Run/Continue",
|
||||
},
|
||||
{
|
||||
"<leader>da",
|
||||
function()
|
||||
require("dap").continue({ before = get_args })
|
||||
end,
|
||||
desc = "Run with Args",
|
||||
},
|
||||
{
|
||||
"<leader>dC",
|
||||
function()
|
||||
require("dap").run_to_cursor()
|
||||
end,
|
||||
desc = "Run to Cursor",
|
||||
},
|
||||
{
|
||||
"<leader>dg",
|
||||
function()
|
||||
require("dap").goto_()
|
||||
end,
|
||||
desc = "Go to Line (No Execute)",
|
||||
},
|
||||
{
|
||||
"<leader>di",
|
||||
function()
|
||||
require("dap").step_into()
|
||||
end,
|
||||
desc = "Step Into",
|
||||
},
|
||||
{
|
||||
"<leader>dj",
|
||||
function()
|
||||
require("dap").down()
|
||||
end,
|
||||
desc = "Down",
|
||||
},
|
||||
{
|
||||
"<leader>dk",
|
||||
function()
|
||||
require("dap").up()
|
||||
end,
|
||||
desc = "Up",
|
||||
},
|
||||
{
|
||||
"<leader>dl",
|
||||
function()
|
||||
require("dap").run_last()
|
||||
end,
|
||||
desc = "Run Last",
|
||||
},
|
||||
{
|
||||
"<leader>do",
|
||||
function()
|
||||
require("dap").step_out()
|
||||
end,
|
||||
desc = "Step Out",
|
||||
},
|
||||
{
|
||||
"<leader>dO",
|
||||
function()
|
||||
require("dap").step_over()
|
||||
end,
|
||||
desc = "Step Over",
|
||||
},
|
||||
{
|
||||
"<leader>dP",
|
||||
function()
|
||||
require("dap").pause()
|
||||
end,
|
||||
desc = "Pause",
|
||||
},
|
||||
{
|
||||
"<leader>dr",
|
||||
function()
|
||||
require("dap").repl.toggle()
|
||||
end,
|
||||
desc = "Toggle REPL",
|
||||
},
|
||||
{
|
||||
"<leader>ds",
|
||||
function()
|
||||
require("dap").session()
|
||||
end,
|
||||
desc = "Session",
|
||||
},
|
||||
{
|
||||
"<leader>dt",
|
||||
function()
|
||||
require("dap").terminate()
|
||||
end,
|
||||
desc = "Terminate",
|
||||
},
|
||||
{
|
||||
"<leader>dw",
|
||||
function()
|
||||
require("dap.ui.widgets").hover()
|
||||
end,
|
||||
desc = "Widgets",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- fancy UI for the debugger
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
dependencies = { "nvim-neotest/nvim-nio" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>du",
|
||||
function()
|
||||
require("dapui").toggle({})
|
||||
end,
|
||||
desc = "Dap UI",
|
||||
},
|
||||
{
|
||||
"<leader>de",
|
||||
function()
|
||||
require("dapui").eval()
|
||||
end,
|
||||
desc = "Eval",
|
||||
mode = { "n", "v" },
|
||||
},
|
||||
},
|
||||
opts = {},
|
||||
config = function(_, opts)
|
||||
local dap = require("dap")
|
||||
local dapui = require("dapui")
|
||||
dapui.setup(opts)
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||
dapui.open({})
|
||||
end
|
||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||
dapui.close({})
|
||||
end
|
||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||
dapui.close({})
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- mason.nvim integration
|
||||
{
|
||||
"jay-babu/mason-nvim-dap.nvim",
|
||||
dependencies = "mason.nvim",
|
||||
cmd = { "DapInstall", "DapUninstall" },
|
||||
opts = {
|
||||
-- Makes a best effort to setup the various debuggers with
|
||||
-- reasonable debug configurations
|
||||
automatic_installation = true,
|
||||
automatic_config = true,
|
||||
|
||||
-- You can provide additional configuration to the handlers,
|
||||
-- see mason-nvim-dap README for more information
|
||||
handlers = {},
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -1,23 +1,23 @@
|
||||
return {
|
||||
'rmagatti/auto-session',
|
||||
event = 'VeryLazy',
|
||||
config = function()
|
||||
local auto_session = require('auto-session')
|
||||
"rmagatti/auto-session",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
local auto_session = require("auto-session")
|
||||
|
||||
auto_session.setup({
|
||||
auto_restore_enabled = false,
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
'<leader>wr',
|
||||
'<cmd>SessionRestore<cr>',
|
||||
desc = 'Session restore',
|
||||
},
|
||||
{
|
||||
'<leader>ws',
|
||||
'<cmd>SessionSave<cr>',
|
||||
desc = 'Session save',
|
||||
}
|
||||
},
|
||||
auto_session.setup({
|
||||
auto_restore_enabled = false,
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>wr",
|
||||
"<cmd>SessionRestore<cr>",
|
||||
desc = "Session restore",
|
||||
},
|
||||
{
|
||||
"<leader>ws",
|
||||
"<cmd>SessionSave<cr>",
|
||||
desc = "Session save",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@ -1,31 +1,30 @@
|
||||
-- Autopairs
|
||||
return {
|
||||
'windwp/nvim-autopairs',
|
||||
event = 'InsertEnter',
|
||||
dependencies = {
|
||||
'hrsh7th/nvim-cmp',
|
||||
},
|
||||
config = function()
|
||||
-- import nvim-autopairs
|
||||
local autopairs = require('nvim-autopairs')
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
"hrsh7th/nvim-cmp",
|
||||
},
|
||||
config = function()
|
||||
-- import nvim-autopairs
|
||||
local autopairs = require("nvim-autopairs")
|
||||
|
||||
-- configure autopairs
|
||||
autopairs.setup({
|
||||
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 javscript template_string treesitter nodes
|
||||
java = false, -- don't check treesitter on java
|
||||
},
|
||||
})
|
||||
-- configure autopairs
|
||||
autopairs.setup({
|
||||
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 javscript template_string treesitter nodes
|
||||
},
|
||||
})
|
||||
|
||||
-- import nvim-autopairs completion functionality
|
||||
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
|
||||
-- import nvim-autopairs completion functionality
|
||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||
|
||||
-- import nvim-cmp plugin (completions plugin)
|
||||
local cmp = require('cmp')
|
||||
-- import nvim-cmp plugin (completions plugin)
|
||||
local cmp = require("cmp")
|
||||
|
||||
-- make autopairs and completion work together
|
||||
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
|
||||
end,
|
||||
}
|
||||
-- make autopairs and completion work together
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
end,
|
||||
}
|
||||
|
||||
@ -1,21 +1,21 @@
|
||||
return {
|
||||
'folke/todo-comments.nvim',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
config = function()
|
||||
local todo_comments = require('todo-comments')
|
||||
"folke/todo-comments.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
local todo_comments = require("todo-comments")
|
||||
|
||||
-- set keymaps
|
||||
local keymap = vim.keymap -- for conciseness
|
||||
-- set keymaps
|
||||
local keymap = vim.keymap -- for conciseness
|
||||
|
||||
keymap.set('n', ']t', function()
|
||||
todo_comments.jump_next()
|
||||
end, { desc = 'Next todo comment' })
|
||||
keymap.set("n", "]t", function()
|
||||
todo_comments.jump_next()
|
||||
end, { desc = "Next todo comment" })
|
||||
|
||||
keymap.set('n', '[t', function()
|
||||
todo_comments.jump_prev()
|
||||
end, { desc = 'Previous todo comment' })
|
||||
keymap.set("n", "[t", function()
|
||||
todo_comments.jump_prev()
|
||||
end, { desc = "Previous todo comment" })
|
||||
|
||||
todo_comments.setup()
|
||||
end,
|
||||
todo_comments.setup()
|
||||
end,
|
||||
}
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
return {
|
||||
'numToStr/Comment.nvim',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
dependencies = {
|
||||
'JoosepAlviste/nvim-ts-context-commentstring',
|
||||
},
|
||||
config = function()
|
||||
-- import comment plugin safely
|
||||
local comment = require('Comment')
|
||||
local ts_context_commentstring = require('ts_context_commentstring.integrations.comment_nvim')
|
||||
"numToStr/Comment.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = {
|
||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||
},
|
||||
config = function()
|
||||
-- import comment plugin safely
|
||||
local comment = require("Comment")
|
||||
local ts_context_commentstring = require("ts_context_commentstring.integrations.comment_nvim")
|
||||
|
||||
-- enable comment
|
||||
comment.setup({
|
||||
-- for commenting tsx, jsx, svelte, html files
|
||||
pre_hook = ts_context_commentstring.create_pre_hook(),
|
||||
})
|
||||
end,
|
||||
-- enable comment
|
||||
comment.setup({
|
||||
-- for commenting tsx, jsx, svelte, html files
|
||||
pre_hook = ts_context_commentstring.create_pre_hook(),
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
-- CSS color
|
||||
return {
|
||||
'ap/vim-css-color',
|
||||
"ap/vim-css-color",
|
||||
ft = { "css" },
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
-- Diffview
|
||||
return {
|
||||
'sindrets/diffview.nvim',
|
||||
"sindrets/diffview.nvim",
|
||||
}
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
return {
|
||||
'kdheepak/lazygit.nvim',
|
||||
"kdheepak/lazygit.nvim",
|
||||
cmd = {
|
||||
'LazyGit',
|
||||
'LazyGitConfig',
|
||||
'LazyGitCurrentFile',
|
||||
'LazyGitFilter',
|
||||
'LazyGitFilterCurrentFile',
|
||||
"LazyGit",
|
||||
"LazyGitConfig",
|
||||
"LazyGitCurrentFile",
|
||||
"LazyGitFilter",
|
||||
"LazyGitFilterCurrentFile",
|
||||
},
|
||||
-- optional for floating window border decoration
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
-- setting the keybinding for LazyGit with 'keys' is recommended in
|
||||
-- order to load the plugin when the command is run for the first time
|
||||
keys = {
|
||||
{ '<leader>lg', '<cmd>LazyGit<cr>', desc = 'Open lazy git' },
|
||||
{ "<leader>hg", "<cmd>LazyGit<cr>", desc = "Open lazy git" },
|
||||
},
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
-- Git signs
|
||||
return {
|
||||
'lewis6991/gitsigns.nvim',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
"lewis6991/gitsigns.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
opts = {
|
||||
on_attach = function(bufnr)
|
||||
local gs = package.loaded.gitsigns
|
||||
@ -11,38 +11,38 @@ return {
|
||||
end
|
||||
|
||||
-- Navigation
|
||||
map('n', ']h', gs.next_hunk, 'Next Hunk')
|
||||
map('n', '[h', gs.prev_hunk, 'Prev Hunk')
|
||||
map("n", "]h", gs.next_hunk, "Next Hunk")
|
||||
map("n", "[h", gs.prev_hunk, "Prev Hunk")
|
||||
|
||||
-- Actions
|
||||
map('n', '<leader>hs', gs.stage_hunk, 'Stage hunk')
|
||||
map('n', '<leader>hr', gs.reset_hunk, 'Reset hunk')
|
||||
map('v', '<leader>hs', function()
|
||||
gs.stage_hunk({ vim.fn.line('.'), vim.fn.line('v') })
|
||||
end, 'Stage hunk')
|
||||
map('v', '<leader>hr', function()
|
||||
gs.reset_hunk({ vim.fn.line('.'), vim.fn.line('v') })
|
||||
end, 'Reset hunk')
|
||||
map("n", "<leader>hs", gs.stage_hunk, "Stage hunk")
|
||||
map("n", "<leader>hr", gs.reset_hunk, "Reset hunk")
|
||||
map("v", "<leader>hs", function()
|
||||
gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") })
|
||||
end, "Stage hunk")
|
||||
map("v", "<leader>hr", function()
|
||||
gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") })
|
||||
end, "Reset hunk")
|
||||
|
||||
map('n', '<leader>hS', gs.stage_buffer, 'Stage buffer')
|
||||
map('n', '<leader>hR', gs.reset_buffer, 'Reset buffer')
|
||||
map("n", "<leader>hS", gs.stage_buffer, "Stage buffer")
|
||||
map("n", "<leader>hR", gs.reset_buffer, "Reset buffer")
|
||||
|
||||
map('n', '<leader>hu', gs.undo_stage_hunk, 'Undo stage hunk')
|
||||
map("n", "<leader>hu", gs.undo_stage_hunk, "Undo stage hunk")
|
||||
|
||||
map('n', '<leader>hp', gs.preview_hunk, 'Preview hunk')
|
||||
map("n", "<leader>hp", gs.preview_hunk, "Preview hunk")
|
||||
|
||||
map('n', '<leader>hb', function()
|
||||
map("n", "<leader>hb", function()
|
||||
gs.blame_line({ full = true })
|
||||
end, 'Blame line')
|
||||
map('n', '<leader>hB', gs.toggle_current_line_blame, 'Toggle line blame')
|
||||
end, "Blame line")
|
||||
map("n", "<leader>hB", gs.toggle_current_line_blame, "Toggle line blame")
|
||||
|
||||
map('n', '<leader>hd', gs.diffthis, 'Diff this')
|
||||
map('n', '<leader>hD', function()
|
||||
gs.diffthis('~')
|
||||
end, 'Diff this ~')
|
||||
map("n", "<leader>hd", gs.diffthis, "Diff this")
|
||||
map("n", "<leader>hD", function()
|
||||
gs.diffthis("~")
|
||||
end, "Diff this ~")
|
||||
|
||||
-- Text object
|
||||
map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>', 'Gitsigns select hunk')
|
||||
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", "Gitsigns select hunk")
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
-- Indent blankline
|
||||
return {
|
||||
'lukas-reineke/indent-blankline.nvim',
|
||||
event = {
|
||||
'BufReadPre',
|
||||
'BufNewFile',
|
||||
},
|
||||
main = 'ibl',
|
||||
opts = {
|
||||
indent = { char = '┊' },
|
||||
},
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
return {
|
||||
'gbprod/substitute.nvim',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
config = function()
|
||||
local substitute = require('substitute')
|
||||
|
||||
substitute.setup()
|
||||
|
||||
-- set keymaps
|
||||
local keymap = vim.keymap -- for conciseness
|
||||
|
||||
keymap.set('n', 's', substitute.operator, { desc = 'Substitute with motion' })
|
||||
keymap.set('n', 'ss', substitute.line, { desc = 'Substitute line' })
|
||||
keymap.set('n', 'S', substitute.eol, { desc = 'Substitute to end of line' })
|
||||
keymap.set('x', 's', substitute.visual, { desc = 'Substitute in visual mode' })
|
||||
end,
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
-- Surround
|
||||
return {
|
||||
'kylechui/nvim-surround',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
version = '*', -- Use for stability; omit to use `main` branch for the latest features
|
||||
config = true,
|
||||
"kylechui/nvim-surround",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||
config = true,
|
||||
}
|
||||
|
||||
@ -1,53 +1,53 @@
|
||||
return {
|
||||
'rest-nvim/rest.nvim',
|
||||
dependencies = { { 'nvim-lua/plenary.nvim' } },
|
||||
event = 'BufEnter *.http',
|
||||
config = function()
|
||||
require('rest-nvim').setup({
|
||||
-- Open request results in a horizontal split
|
||||
result_split_horizontal = false,
|
||||
-- Keep the http file buffer above|left when split horizontal|vertical
|
||||
result_split_in_place = false,
|
||||
-- stay in current windows (.http file) or change to results window (default)
|
||||
stay_in_current_window_after_split = false,
|
||||
-- Skip SSL verification, useful for unknown certificates
|
||||
skip_ssl_verification = false,
|
||||
-- Encode URL before making request
|
||||
encode_url = true,
|
||||
-- Highlight request on run
|
||||
highlight = {
|
||||
enabled = true,
|
||||
timeout = 150,
|
||||
},
|
||||
result = {
|
||||
-- toggle showing URL, HTTP info, headers at top the of result window
|
||||
show_url = true,
|
||||
-- show the generated curl command in case you want to launch
|
||||
-- the same request via the terminal (can be verbose)
|
||||
show_curl_command = false,
|
||||
show_http_info = true,
|
||||
show_headers = true,
|
||||
-- table of curl `--write-out` variables or false if disabled
|
||||
-- for more granular control see Statistics Spec
|
||||
show_statistics = false,
|
||||
-- executables or functions for formatting response body [optional]
|
||||
-- set them to false if you want to disable them
|
||||
formatters = {
|
||||
json = 'jq',
|
||||
html = function(body)
|
||||
return vim.fn.system({'tidy', '-i', '-q', '-'}, body)
|
||||
end
|
||||
},
|
||||
},
|
||||
-- Jump to request line on run
|
||||
jump_to_request = false,
|
||||
env_file = '.env',
|
||||
-- for telescope select
|
||||
env_pattern = '\\.env$',
|
||||
env_edit_command = 'tabedit',
|
||||
custom_dynamic_variables = {},
|
||||
yank_dry_run = true,
|
||||
search_back = true,
|
||||
})
|
||||
end
|
||||
"rest-nvim/rest.nvim",
|
||||
dependencies = { { "nvim-lua/plenary.nvim" } },
|
||||
event = "BufEnter *.http",
|
||||
config = function()
|
||||
require("rest-nvim").setup({
|
||||
-- Open request results in a horizontal split
|
||||
result_split_horizontal = false,
|
||||
-- Keep the http file buffer above|left when split horizontal|vertical
|
||||
result_split_in_place = false,
|
||||
-- stay in current windows (.http file) or change to results window (default)
|
||||
stay_in_current_window_after_split = false,
|
||||
-- Skip SSL verification, useful for unknown certificates
|
||||
skip_ssl_verification = false,
|
||||
-- Encode URL before making request
|
||||
encode_url = true,
|
||||
-- Highlight request on run
|
||||
highlight = {
|
||||
enabled = true,
|
||||
timeout = 150,
|
||||
},
|
||||
result = {
|
||||
-- toggle showing URL, HTTP info, headers at top the of result window
|
||||
show_url = true,
|
||||
-- show the generated curl command in case you want to launch
|
||||
-- the same request via the terminal (can be verbose)
|
||||
show_curl_command = false,
|
||||
show_http_info = true,
|
||||
show_headers = true,
|
||||
-- table of curl `--write-out` variables or false if disabled
|
||||
-- for more granular control see Statistics Spec
|
||||
show_statistics = false,
|
||||
-- executables or functions for formatting response body [optional]
|
||||
-- set them to false if you want to disable them
|
||||
formatters = {
|
||||
json = "jq",
|
||||
html = function(body)
|
||||
return vim.fn.system({ "tidy", "-i", "-q", "-" }, body)
|
||||
end,
|
||||
},
|
||||
},
|
||||
-- Jump to request line on run
|
||||
jump_to_request = false,
|
||||
env_file = ".env",
|
||||
-- for telescope select
|
||||
env_pattern = "\\.env$",
|
||||
env_edit_command = "tabedit",
|
||||
custom_dynamic_variables = {},
|
||||
yank_dry_run = true,
|
||||
search_back = true,
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
38
nvim/.config/nvim/lua/lazy-plugins/lsp-conform.lua
Normal file
38
nvim/.config/nvim/lua/lazy-plugins/lsp-conform.lua
Normal file
@ -0,0 +1,38 @@
|
||||
return {
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
local conform = require("conform")
|
||||
|
||||
conform.setup({
|
||||
formatters_by_ft = {
|
||||
javascript = { "prettier" },
|
||||
typescript = { "prettier" },
|
||||
svelte = { "prettier" },
|
||||
css = { "prettier" },
|
||||
html = { "prettier" },
|
||||
json = { "prettier" },
|
||||
yaml = { "prettier" },
|
||||
markdown = { "prettier" },
|
||||
graphql = { "prettier" },
|
||||
liquid = { "prettier" },
|
||||
lua = { "stylua" },
|
||||
python = { "isort", "black" },
|
||||
sql = { "sqruff" },
|
||||
},
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 1000,
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set({ "n", "v" }, "<leader>mp", function()
|
||||
conform.format({
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 1000,
|
||||
})
|
||||
end, { desc = "Format file or range (in visual mode)" })
|
||||
end,
|
||||
}
|
||||
@ -1,37 +0,0 @@
|
||||
return {
|
||||
'stevearc/conform.nvim',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
config = function()
|
||||
local conform = require('conform')
|
||||
|
||||
conform.setup({
|
||||
formatters_by_ft = {
|
||||
javascript = { 'prettier' },
|
||||
typescript = { 'prettier' },
|
||||
svelte = { 'prettier' },
|
||||
css = { 'prettier' },
|
||||
html = { 'prettier' },
|
||||
json = { 'prettier' },
|
||||
yaml = { 'prettier' },
|
||||
markdown = { 'prettier' },
|
||||
graphql = { 'prettier' },
|
||||
liquid = { 'prettier' },
|
||||
lua = { 'stylua' },
|
||||
python = { 'isort', 'black' },
|
||||
},
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 1000,
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set({ 'n', 'v' }, '<leader>mp', function()
|
||||
conform.format({
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 1000,
|
||||
})
|
||||
end, { desc = 'Format file or range (in visual mode)' })
|
||||
end,
|
||||
}
|
||||
@ -1,27 +1,27 @@
|
||||
return {
|
||||
'mfussenegger/nvim-lint',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
"mfussenegger/nvim-lint",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
local lint = require('lint')
|
||||
local lint = require("lint")
|
||||
|
||||
lint.linters_by_ft = {
|
||||
javascript = { 'eslint_d' },
|
||||
typescript = { 'eslint_d' },
|
||||
svelte = { 'eslint_d' },
|
||||
python = { 'pylint' },
|
||||
javascript = { "eslint_d" },
|
||||
typescript = { "eslint_d" },
|
||||
svelte = { "eslint_d" },
|
||||
python = { "pylint" },
|
||||
}
|
||||
|
||||
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
|
||||
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||
group = lint_augroup,
|
||||
callback = function()
|
||||
lint.try_lint()
|
||||
end,
|
||||
})
|
||||
|
||||
vim.keymap.set('n', '<leader>l', function()
|
||||
vim.keymap.set("n", "<leader>l", function()
|
||||
lint.try_lint()
|
||||
end, { desc = 'Trigger linting for current file' })
|
||||
end, { desc = "Trigger linting for current file" })
|
||||
end,
|
||||
}
|
||||
|
||||
@ -1,106 +1,98 @@
|
||||
return {
|
||||
'neovim/nvim-lspconfig',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
dependencies = {
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
{ 'antosha417/nvim-lsp-file-operations', config = true },
|
||||
{ 'folke/neodev.nvim', opts = {} },
|
||||
},
|
||||
config = function()
|
||||
-- import lspconfig plugin
|
||||
local lspconfig = require('lspconfig')
|
||||
"neovim/nvim-lspconfig",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"mason-org/mason-lspconfig.nvim",
|
||||
{ "antosha417/nvim-lsp-file-operations", config = true },
|
||||
{ "folke/lazydev.nvim", opts = {} },
|
||||
},
|
||||
config = function()
|
||||
-- import lspconfig plugin
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
-- import mason_lspconfig plugin
|
||||
local mason_lspconfig = require('mason-lspconfig')
|
||||
-- import mason_lspconfig plugin
|
||||
local mason_lspconfig = require("mason-lspconfig")
|
||||
|
||||
-- import cmp-nvim-lsp plugin
|
||||
local cmp_nvim_lsp = require('cmp_nvim_lsp')
|
||||
-- import cmp-nvim-lsp plugin
|
||||
local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
||||
|
||||
local keymap = vim.keymap -- for conciseness
|
||||
local keymap = vim.keymap -- for conciseness
|
||||
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
|
||||
callback = function(ev)
|
||||
-- Buffer local mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
local opts = { buffer = ev.buf, silent = true }
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
|
||||
callback = function(ev)
|
||||
-- Buffer local mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
local opts = { buffer = ev.buf, silent = true }
|
||||
|
||||
-- set keybinds
|
||||
opts.desc = 'Show LSP references'
|
||||
keymap.set('n', 'gR', '<cmd>Telescope lsp_references<CR>', opts) -- show definition, references
|
||||
-- set keybinds
|
||||
opts.desc = "Show LSP references"
|
||||
keymap.set("n", "gR", "<cmd>Telescope lsp_references<CR>", opts) -- show definition, references
|
||||
|
||||
opts.desc = 'Go to declaration'
|
||||
keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) -- go to declaration
|
||||
opts.desc = "Go to declaration"
|
||||
keymap.set("n", "gD", vim.lsp.buf.declaration, opts) -- go to declaration
|
||||
|
||||
opts.desc = 'Show LSP definitions'
|
||||
keymap.set('n', 'gd', '<cmd>Telescope lsp_definitions<CR>', opts) -- show lsp definitions
|
||||
opts.desc = "Show LSP definitions"
|
||||
keymap.set("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts) -- show lsp definitions
|
||||
|
||||
opts.desc = 'Show LSP implementations'
|
||||
keymap.set('n', 'gi', '<cmd>Telescope lsp_implementations<CR>', opts) -- show lsp implementations
|
||||
opts.desc = "Show LSP implementations"
|
||||
keymap.set("n", "gi", "<cmd>Telescope lsp_implementations<CR>", opts) -- show lsp implementations
|
||||
|
||||
opts.desc = 'Show LSP type definitions'
|
||||
keymap.set('n', 'gt', '<cmd>Telescope lsp_type_definitions<CR>', opts) -- show lsp type definitions
|
||||
opts.desc = "Show LSP type definitions"
|
||||
keymap.set("n", "gt", "<cmd>Telescope lsp_type_definitions<CR>", opts) -- show lsp type definitions
|
||||
|
||||
opts.desc = 'See available code actions'
|
||||
keymap.set({ 'n', 'v' }, '<leader>ca', vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection
|
||||
opts.desc = "See available code actions"
|
||||
keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection
|
||||
|
||||
opts.desc = 'Smart rename'
|
||||
keymap.set('n', '<leader>rn', vim.lsp.buf.rename, opts) -- smart rename
|
||||
opts.desc = "Smart rename"
|
||||
keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts) -- smart rename
|
||||
|
||||
opts.desc = 'Show buffer diagnostics'
|
||||
keymap.set('n', '<leader>D', '<cmd>Telescope diagnostics bufnr=0<CR>', opts) -- show diagnostics for file
|
||||
opts.desc = "Show buffer diagnostics"
|
||||
keymap.set("n", "<leader>D", "<cmd>Telescope diagnostics bufnr=0<CR>", opts) -- show diagnostics for file
|
||||
|
||||
opts.desc = 'Show line diagnostics'
|
||||
keymap.set('n', '<leader>d', vim.diagnostic.open_float, opts) -- show diagnostics for line
|
||||
opts.desc = "Show line diagnostics"
|
||||
keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts) -- show diagnostics for line
|
||||
|
||||
opts.desc = 'Go to previous diagnostic'
|
||||
keymap.set('n', '[d', vim.diagnostic.goto_prev, opts) -- jump to previous diagnostic in buffer
|
||||
opts.desc = "Go to previous diagnostic"
|
||||
keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) -- jump to previous diagnostic in buffer
|
||||
|
||||
opts.desc = 'Go to next diagnostic'
|
||||
keymap.set('n', ']d', vim.diagnostic.goto_next, opts) -- jump to next diagnostic in buffer
|
||||
opts.desc = "Go to next diagnostic"
|
||||
keymap.set("n", "]d", vim.diagnostic.goto_next, opts) -- jump to next diagnostic in buffer
|
||||
|
||||
opts.desc = 'Show documentation for what is under cursor'
|
||||
keymap.set('n', 'K', vim.lsp.buf.hover, opts) -- show documentation for what is under cursor
|
||||
opts.desc = "Show documentation for what is under cursor"
|
||||
keymap.set("n", "K", vim.lsp.buf.hover, opts) -- show documentation for what is under cursor
|
||||
|
||||
opts.desc = 'Restart LSP'
|
||||
keymap.set('n', '<leader>rs', ':LspRestart<CR>', opts) -- mapping to restart lsp if necessary
|
||||
end,
|
||||
})
|
||||
opts.desc = "Restart LSP"
|
||||
keymap.set("n", "<leader>rs", ":LspRestart<CR>", opts) -- mapping to restart lsp if necessary
|
||||
end,
|
||||
})
|
||||
|
||||
-- used to enable autocompletion (assign to every lsp server config)
|
||||
local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
-- Change the Diagnostic symbols in the sign column (gutter)
|
||||
local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
|
||||
for type, icon in pairs(signs) do
|
||||
local hl = "DiagnosticSign" .. type
|
||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
|
||||
end
|
||||
|
||||
-- Change the Diagnostic symbols in the sign column (gutter)
|
||||
local signs = { Error = ' ', Warn = ' ', Hint = ' ', Info = ' ' }
|
||||
for type, icon in pairs(signs) do
|
||||
local hl = 'DiagnosticSign' .. type
|
||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = '' })
|
||||
end
|
||||
-- used to enable autocompletion (assign to every lsp server config)
|
||||
local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
|
||||
mason_lspconfig.setup_handlers({
|
||||
-- default handler for installed servers
|
||||
function(server_name)
|
||||
lspconfig[server_name].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end,
|
||||
['lua_ls'] = function()
|
||||
-- configure lua server (with special settings)
|
||||
lspconfig['lua_ls'].setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
-- make the language server recognize 'vim' global
|
||||
diagnostics = {
|
||||
globals = { 'vim' },
|
||||
},
|
||||
completion = {
|
||||
callSnippet = 'Replace',
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
})
|
||||
end,
|
||||
vim.lsp.config["lua_ls"] = {
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
-- make the language server recognize 'vim' global
|
||||
diagnostics = {
|
||||
globals = { "vim" },
|
||||
},
|
||||
completion = {
|
||||
callSnippet = "Replace",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
mason_lspconfig.setup()
|
||||
end,
|
||||
}
|
||||
|
||||
@ -1,49 +1,19 @@
|
||||
-- Plenary
|
||||
return {
|
||||
'williamboman/mason.nvim',
|
||||
dependencies = {
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
||||
},
|
||||
config = function()
|
||||
-- import mason
|
||||
local mason = require('mason')
|
||||
"mason-org/mason.nvim",
|
||||
config = function()
|
||||
-- import mason
|
||||
local mason = require("mason")
|
||||
|
||||
-- import mason-lspconfig
|
||||
local mason_lspconfig = require('mason-lspconfig')
|
||||
|
||||
local mason_tool_installer = require('mason-tool-installer')
|
||||
|
||||
-- enable mason and configure icons
|
||||
mason.setup({
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = '✓',
|
||||
package_pending = '➜',
|
||||
package_uninstalled = '✗',
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
mason_lspconfig.setup({
|
||||
-- list of servers for mason to install
|
||||
ensure_installed = {
|
||||
'html',
|
||||
'cssls',
|
||||
'svelte',
|
||||
'lua_ls',
|
||||
},
|
||||
})
|
||||
|
||||
mason_tool_installer.setup({
|
||||
ensure_installed = {
|
||||
'prettier', -- prettier formatter
|
||||
'stylua', -- lua formatter
|
||||
'isort', -- python formatter
|
||||
'black', -- python formatter
|
||||
'pylint',
|
||||
'eslint_d',
|
||||
},
|
||||
})
|
||||
end,
|
||||
-- enable mason and configure icons
|
||||
mason.setup({
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = "✓",
|
||||
package_pending = "➜",
|
||||
package_uninstalled = "✗",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
@ -1,61 +1,61 @@
|
||||
return {
|
||||
'hrsh7th/nvim-cmp',
|
||||
event = 'InsertEnter',
|
||||
dependencies = {
|
||||
'hrsh7th/cmp-buffer', -- source for text in buffer
|
||||
'hrsh7th/cmp-path', -- source for file system paths
|
||||
{
|
||||
'L3MON4D3/LuaSnip',
|
||||
-- follow latest release.
|
||||
version = 'v2.*', -- Replace <CurrentMajor> by the latest released major (first number of latest release)
|
||||
-- install jsregexp (optional!).
|
||||
build = 'make install_jsregexp',
|
||||
},
|
||||
'saadparwaiz1/cmp_luasnip', -- for autocompletion
|
||||
'rafamadriz/friendly-snippets', -- useful snippets
|
||||
'onsails/lspkind.nvim', -- vs-code like pictograms
|
||||
},
|
||||
config = function()
|
||||
local cmp = require('cmp')
|
||||
local luasnip = require('luasnip')
|
||||
local lspkind = require('lspkind')
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-buffer", -- source for text in buffer
|
||||
"hrsh7th/cmp-path", -- source for file system paths
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
-- follow latest release.
|
||||
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
|
||||
-- install jsregexp (optional!).
|
||||
build = "make install_jsregexp",
|
||||
},
|
||||
"saadparwaiz1/cmp_luasnip", -- for autocompletion
|
||||
"rafamadriz/friendly-snippets", -- useful snippets
|
||||
"onsails/lspkind.nvim", -- vs-code like pictograms
|
||||
},
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
local lspkind = require("lspkind")
|
||||
|
||||
-- loads vscode style snippets from installed plugins (e.g. friendly-snippets)
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
-- loads vscode style snippets from installed plugins (e.g. friendly-snippets)
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
|
||||
cmp.setup({
|
||||
completion = {
|
||||
completeopt = 'menu,menuone,preview,noselect',
|
||||
},
|
||||
snippet = { -- configure how nvim-cmp interacts with snippet engine
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-k>'] = cmp.mapping.select_prev_item(), -- previous suggestion
|
||||
['<C-j>'] = cmp.mapping.select_next_item(), -- next suggestion
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(), -- show completion suggestions
|
||||
['<C-e>'] = cmp.mapping.abort(), -- close completion window
|
||||
['<CR>'] = cmp.mapping.confirm({ select = false }),
|
||||
}),
|
||||
-- sources for autocompletion
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp'},
|
||||
{ name = 'luasnip' }, -- snippets
|
||||
{ name = 'buffer' }, -- text within current buffer
|
||||
{ name = 'path' }, -- file system paths
|
||||
}),
|
||||
cmp.setup({
|
||||
completion = {
|
||||
completeopt = "menu,menuone,preview,noselect",
|
||||
},
|
||||
snippet = { -- configure how nvim-cmp interacts with snippet engine
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-k>"] = cmp.mapping.select_prev_item(), -- previous suggestion
|
||||
["<C-j>"] = cmp.mapping.select_next_item(), -- next suggestion
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions
|
||||
["<C-e>"] = cmp.mapping.abort(), -- close completion window
|
||||
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
||||
}),
|
||||
-- sources for autocompletion
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" }, -- snippets
|
||||
{ name = "buffer" }, -- text within current buffer
|
||||
{ name = "path" }, -- file system paths
|
||||
}),
|
||||
|
||||
-- configure lspkind for vs-code like pictograms in completion menu
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
maxwidth = 50,
|
||||
ellipsis_char = '...',
|
||||
}),
|
||||
},
|
||||
})
|
||||
end,
|
||||
-- configure lspkind for vs-code like pictograms in completion menu
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
maxwidth = 50,
|
||||
ellipsis_char = "...",
|
||||
}),
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
@ -1,48 +1,50 @@
|
||||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
event = {
|
||||
'BufReadPre',
|
||||
'BufNewFile',
|
||||
},
|
||||
build = ':TSUpdate',
|
||||
dependencies = {
|
||||
'windwp/nvim-ts-autotag',
|
||||
},
|
||||
config = function()
|
||||
local treesitter = require('nvim-treesitter.configs')
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
event = {
|
||||
"BufReadPre",
|
||||
"BufNewFile",
|
||||
},
|
||||
build = ":TSUpdate",
|
||||
dependencies = {
|
||||
"windwp/nvim-ts-autotag",
|
||||
},
|
||||
config = function()
|
||||
local treesitter = require("nvim-treesitter.configs")
|
||||
|
||||
treesitter.setup({
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
autotag = {
|
||||
enable = true,
|
||||
},
|
||||
ensure_installed = {
|
||||
'json',
|
||||
'javascript',
|
||||
'yaml',
|
||||
'html',
|
||||
'css',
|
||||
'lua',
|
||||
'vim',
|
||||
'dockerfile',
|
||||
'gitignore',
|
||||
'markdown',
|
||||
'bash',
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = '<C-space>',
|
||||
node_incremental = '<C-space>',
|
||||
scope_incremental = false,
|
||||
node_decremental = '<bs>',
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
treesitter.setup({
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
autotag = {
|
||||
enable = true,
|
||||
},
|
||||
ensure_installed = {
|
||||
"json",
|
||||
"javascript",
|
||||
"yaml",
|
||||
"html",
|
||||
"css",
|
||||
"lua",
|
||||
"vim",
|
||||
"dockerfile",
|
||||
"gitignore",
|
||||
"markdown",
|
||||
"bash",
|
||||
"go",
|
||||
"php",
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = false,
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
@ -1,15 +1,19 @@
|
||||
return {
|
||||
'folke/trouble.nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons', 'folke/todo-comments.nvim' },
|
||||
opts = {
|
||||
focus = true,
|
||||
},
|
||||
cmd = 'Trouble',
|
||||
keys = {
|
||||
{ '<leader>xw', '<cmd>Trouble diagnostics toggle<CR>', desc = 'Open trouble workspace diagnostics' },
|
||||
{ '<leader>xd', '<cmd>Trouble diagnostics toggle filter.buf=0<CR>', desc = 'Open trouble document diagnostics' },
|
||||
{ '<leader>xq', '<cmd>Trouble quickfix toggle<CR>', desc = 'Open trouble quickfix list' },
|
||||
{ '<leader>xl', '<cmd>Trouble loclist toggle<CR>', desc = 'Open trouble location list' },
|
||||
{ '<leader>xt', '<cmd>Trouble todo toggle<CR>', desc = 'Open todos in trouble' },
|
||||
},
|
||||
"folke/trouble.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons", "folke/todo-comments.nvim" },
|
||||
opts = {
|
||||
focus = true,
|
||||
},
|
||||
cmd = "Trouble",
|
||||
keys = {
|
||||
{ "<leader>xw", "<cmd>Trouble diagnostics toggle<CR>", desc = "Open trouble workspace diagnostics" },
|
||||
{
|
||||
"<leader>xd",
|
||||
"<cmd>Trouble diagnostics toggle filter.buf=0<CR>",
|
||||
desc = "Open trouble document diagnostics",
|
||||
},
|
||||
{ "<leader>xq", "<cmd>Trouble quickfix toggle<CR>", desc = "Open trouble quickfix list" },
|
||||
{ "<leader>xl", "<cmd>Trouble loclist toggle<CR>", desc = "Open trouble location list" },
|
||||
{ "<leader>xt", "<cmd>Trouble todo toggle<CR>", desc = "Open todos in trouble" },
|
||||
},
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
-- Onedark theme
|
||||
return {
|
||||
'navarasu/onedark.nvim',
|
||||
"navarasu/onedark.nvim",
|
||||
}
|
||||
|
||||
@ -1,38 +1,38 @@
|
||||
-- Alpha (start screen/dashboard)
|
||||
return {
|
||||
'goolord/alpha-nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
event = 'VimEnter',
|
||||
config = function()
|
||||
local alpha = require('alpha')
|
||||
local dashboard = require('alpha.themes.dashboard')
|
||||
"goolord/alpha-nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
event = "VimEnter",
|
||||
config = function()
|
||||
local alpha = require("alpha")
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
|
||||
-- Set header
|
||||
dashboard.section.header.val = {
|
||||
' ',
|
||||
' ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ',
|
||||
' ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ',
|
||||
' ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ',
|
||||
' ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ',
|
||||
' ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ',
|
||||
' ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ',
|
||||
' ',
|
||||
}
|
||||
-- Set header
|
||||
dashboard.section.header.val = {
|
||||
" ",
|
||||
" ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ",
|
||||
" ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ",
|
||||
" ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ",
|
||||
" ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ",
|
||||
" ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ",
|
||||
" ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ",
|
||||
" ",
|
||||
}
|
||||
|
||||
-- Set menu
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button('e', ' > New File', '<cmd>ene<CR>'),
|
||||
dashboard.button('SPC ee', ' > Toggle file explorer', '<cmd>NvimTreeToggle<CR>'),
|
||||
dashboard.button('SPC ff', ' > Find File', '<cmd>Telescope find_files<CR>'),
|
||||
dashboard.button('SPC fs', ' > Find Word', '<cmd>Telescope live_grep<CR>'),
|
||||
dashboard.button('SPC wr', ' > Restore Session For Current Directory', '<cmd>SessionRestore<CR>'),
|
||||
dashboard.button('q', ' > Quit NVIM', '<cmd>qa<CR>'),
|
||||
}
|
||||
-- Set menu
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button("e", " > New File", "<cmd>ene<CR>"),
|
||||
dashboard.button("SPC ee", " > Toggle file explorer", "<cmd>NvimTreeToggle<CR>"),
|
||||
dashboard.button("SPC ff", " > Find File", "<cmd>Telescope find_files<CR>"),
|
||||
dashboard.button("SPC fs", " > Find Word", "<cmd>Telescope live_grep<CR>"),
|
||||
dashboard.button("SPC wr", " > Restore Session For Current Directory", "<cmd>SessionRestore<CR>"),
|
||||
dashboard.button("q", " > Quit NVIM", "<cmd>qa<CR>"),
|
||||
}
|
||||
|
||||
-- Send config to alpha
|
||||
alpha.setup(dashboard.opts)
|
||||
-- Send config to alpha
|
||||
alpha.setup(dashboard.opts)
|
||||
|
||||
-- Disable folding on alpha buffer
|
||||
vim.cmd([[autocmd FileType alpha setlocal nofoldenable]])
|
||||
end,
|
||||
-- Disable folding on alpha buffer
|
||||
vim.cmd([[autocmd FileType alpha setlocal nofoldenable]])
|
||||
end,
|
||||
}
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
-- Barbar (tabline bar)
|
||||
return {
|
||||
'romgrk/barbar.nvim',
|
||||
enabled = false,
|
||||
dependencies = {
|
||||
'lewis6991/gitsigns.nvim',
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
},
|
||||
}
|
||||
@ -1,13 +1,14 @@
|
||||
return {
|
||||
'akinsho/bufferline.nvim',
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
},
|
||||
version = '*',
|
||||
opts = {
|
||||
options = {
|
||||
-- mode = 'tabs',
|
||||
-- separator_style = 'slant',
|
||||
},
|
||||
},
|
||||
"akinsho/bufferline.nvim",
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
version = "*",
|
||||
opts = {
|
||||
options = {
|
||||
numbers = "buffer_id",
|
||||
-- mode = 'tabs',
|
||||
-- separator_style = 'slant',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
return {
|
||||
'stevearc/dressing.nvim',
|
||||
event = 'VeryLazy',
|
||||
"stevearc/dressing.nvim",
|
||||
event = "VeryLazy",
|
||||
}
|
||||
|
||||
@ -9,10 +9,11 @@ return {
|
||||
|
||||
-- configure lualine with modified theme
|
||||
lualine.setup({
|
||||
extensions = { "nvim-tree" },
|
||||
options = {
|
||||
theme = "onedark",
|
||||
disabled_filetypes = {
|
||||
statusline = { "NvimTree" },
|
||||
statusline = { "trouble" },
|
||||
},
|
||||
section_separators = "",
|
||||
component_separators = "",
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
-- Mini.nvim
|
||||
return {
|
||||
'echasnovski/mini.nvim',
|
||||
config = function()
|
||||
require('mini.icons').setup()
|
||||
end
|
||||
"echasnovski/mini.nvim",
|
||||
config = function()
|
||||
require("mini.icons").setup()
|
||||
end,
|
||||
}
|
||||
|
||||
@ -1,46 +1,38 @@
|
||||
return {
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
dependencies = 'nvim-tree/nvim-web-devicons',
|
||||
config = function()
|
||||
local nvimtree = require('nvim-tree')
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
dependencies = "nvim-tree/nvim-web-devicons",
|
||||
config = function()
|
||||
local nvimtree = require("nvim-tree")
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
nvimtree.setup({
|
||||
view = {
|
||||
width = 35,
|
||||
relativenumber = true,
|
||||
},
|
||||
-- change folder arrow icons
|
||||
renderer = {
|
||||
indent_markers = {
|
||||
enable = true,
|
||||
},
|
||||
icons = {
|
||||
glyphs = {
|
||||
folder = {
|
||||
arrow_closed = '', -- arrow when folder is closed
|
||||
arrow_open = '', -- arrow when folder is open
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
git = {
|
||||
ignore = false,
|
||||
},
|
||||
})
|
||||
nvimtree.setup({
|
||||
view = {
|
||||
width = 35,
|
||||
relativenumber = true,
|
||||
},
|
||||
-- change folder arrow icons
|
||||
renderer = {
|
||||
indent_markers = {
|
||||
enable = true,
|
||||
},
|
||||
icons = {
|
||||
glyphs = {
|
||||
folder = {
|
||||
arrow_closed = "", -- arrow when folder is closed
|
||||
arrow_open = "", -- arrow when folder is open
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
git = {
|
||||
ignore = false,
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set('n', '<leader>ef', '<cmd>NvimTreeFindFile<CR>', { desc = 'Move to file in file explorer' })
|
||||
vim.keymap.set('n', '<leader>ec', '<cmd>NvimTreeCollapse<CR>', { desc = 'Collapse file explorer' })
|
||||
vim.keymap.set('n', '<leader>er', '<cmd>NvimTreeRefresh<CR>', { desc = 'Refresh file explorer' })
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
'<leader>ee',
|
||||
function()
|
||||
require('nvim-tree.api').tree.toggle()
|
||||
end,
|
||||
desc = 'Toggle file explorer',
|
||||
},
|
||||
}
|
||||
vim.keymap.set("n", "<leader>ee", "<cmd>NvimTreeToggle<CR>", { desc = "Toggle file explorer" })
|
||||
vim.keymap.set("n", "<leader>ec", "<cmd>NvimTreeCollapse<CR>", { desc = "Collapse file explorer" })
|
||||
vim.keymap.set("n", "<leader>er", "<cmd>NvimTreeRefresh<CR>", { desc = "Refresh file explorer" })
|
||||
vim.keymap.set("n", "<leader>ef", "<cmd>NvimTreeFindFile<CR>", { desc = "Move to file in file explorer" })
|
||||
end,
|
||||
}
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
-- Tagbar
|
||||
return {
|
||||
'preservim/tagbar',
|
||||
enabled = false,
|
||||
}
|
||||
@ -1,65 +1,65 @@
|
||||
-- Telescope
|
||||
return {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' },
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
},
|
||||
config = function(_, opts)
|
||||
local telescope = require('telescope')
|
||||
local actions = require('telescope.actions')
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
config = function()
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
path_display = { 'smart' },
|
||||
mappings = {
|
||||
i = {
|
||||
['<C-k>'] = actions.move_selection_previous, -- move to prev result
|
||||
['<C-j>'] = actions.move_selection_next, -- move to next result
|
||||
['<C-q>'] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
['<C-d>'] = actions.delete_buffer,
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
telescope.load_extension('fzf')
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
'<leader>ff',
|
||||
'<cmd>Telescope find_files<cr>',
|
||||
desc = 'Find files',
|
||||
},
|
||||
{
|
||||
'<leader>fg',
|
||||
'<cmd>Telescope live_grep<cr>',
|
||||
desc = 'Live grep',
|
||||
},
|
||||
{
|
||||
'<leader>fb',
|
||||
'<cmd>Telescope buffers<cr>',
|
||||
desc = 'Buffers'
|
||||
},
|
||||
{
|
||||
'<leader>fh',
|
||||
'<cmd>Telescope help_tags<cr>',
|
||||
desc = 'Help tags',
|
||||
},
|
||||
{
|
||||
'<leader>fr',
|
||||
'<cmd>Telescope oldfiles<cr>`',
|
||||
desc = 'Recent files',
|
||||
},
|
||||
{
|
||||
'<leader>fs',
|
||||
'<cmd>Telescope grep_string<cr>',
|
||||
desc = 'Find string',
|
||||
},
|
||||
{
|
||||
'<leader>ft',
|
||||
'<cmd>TodoTelescope<cr>',
|
||||
desc = 'Find todos',
|
||||
}
|
||||
},
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
path_display = { "smart" },
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-k>"] = actions.move_selection_previous, -- move to prev result
|
||||
["<C-j>"] = actions.move_selection_next, -- move to next result
|
||||
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
["<C-d>"] = actions.delete_buffer,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
telescope.load_extension("fzf")
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>ff",
|
||||
"<cmd>Telescope find_files<cr>",
|
||||
desc = "Find files",
|
||||
},
|
||||
{
|
||||
"<leader>fg",
|
||||
"<cmd>Telescope live_grep<cr>",
|
||||
desc = "Live grep",
|
||||
},
|
||||
{
|
||||
"<leader>fb",
|
||||
"<cmd>Telescope buffers<cr>",
|
||||
desc = "Buffers",
|
||||
},
|
||||
{
|
||||
"<leader>fh",
|
||||
"<cmd>Telescope help_tags<cr>",
|
||||
desc = "Help tags",
|
||||
},
|
||||
{
|
||||
"<leader>fr",
|
||||
"<cmd>Telescope oldfiles<cr>`",
|
||||
desc = "Recent files",
|
||||
},
|
||||
{
|
||||
"<leader>fs",
|
||||
"<cmd>Telescope grep_string<cr>",
|
||||
desc = "Find string",
|
||||
},
|
||||
{
|
||||
"<leader>ft",
|
||||
"<cmd>TodoTelescope<cr>",
|
||||
desc = "Find todos",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@ -1,17 +1,23 @@
|
||||
return {
|
||||
'folke/which-key.nvim',
|
||||
event = 'VeryLazy',
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 500
|
||||
end,
|
||||
config = function()
|
||||
local wk = require('which-key')
|
||||
wk.register({
|
||||
{ '<leader>e', group = 'NeoTree' },
|
||||
{ '<leader>f', group = 'Telescope' },
|
||||
{ '<leader>s', group = 'splits' },
|
||||
})
|
||||
end,
|
||||
opts = { },
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 500
|
||||
end,
|
||||
config = function()
|
||||
local wk = require("which-key")
|
||||
wk.add({
|
||||
{ "<leader>b", group = "🗄️ Buffers" },
|
||||
{ "<leader>c", group = "💻 Code" },
|
||||
{ "<leader>e", group = "🌲 NeoTree" },
|
||||
{ "<leader>f", group = "🔭 Telescope" },
|
||||
{ "<leader>h", group = "✏️ Version control" },
|
||||
{ "<leader>r", group = "🪐 LSP" },
|
||||
{ "<leader>s", group = "🪟 Splits" },
|
||||
{ "<leader>w", group = "💾 Session" },
|
||||
{ "<leader>x", group = "🚧 Trouble" },
|
||||
})
|
||||
end,
|
||||
opts = {},
|
||||
}
|
||||
|
||||
@ -1,125 +0,0 @@
|
||||
-----------------------------------------------------------
|
||||
-- Plugin manager configuration file
|
||||
-----------------------------------------------------------
|
||||
|
||||
-- Plugin manager: packer.nvim
|
||||
-- url: https://github.com/wbthomason/packer.nvim
|
||||
|
||||
-- For information about installed plugins see the README:
|
||||
-- neovim-lua/README.md
|
||||
-- https://github.com/brainfucksec/neovim-lua#readme
|
||||
|
||||
|
||||
-- Autocommand that reloads neovim whenever you save the packer.lua file
|
||||
vim.cmd [[
|
||||
augroup packer_user_config
|
||||
autocmd!
|
||||
autocmd BufWritePost packer.lua source <afile> | PackerCompile
|
||||
augroup end
|
||||
]]
|
||||
|
||||
-- Install plugins
|
||||
require('packer').startup(function(use)
|
||||
-- Add you plugins here:
|
||||
use 'wbthomason/packer.nvim' -- packer can manage itself
|
||||
|
||||
-- Sensible defaults
|
||||
use 'tpope/vim-sensible'
|
||||
|
||||
-- Plenary
|
||||
use 'nvim-lua/plenary.nvim'
|
||||
|
||||
-- File explorer
|
||||
use 'kyazdani42/nvim-tree.lua'
|
||||
|
||||
-- Indent line
|
||||
use 'lukas-reineke/indent-blankline.nvim'
|
||||
|
||||
-- CSS color
|
||||
use 'ap/vim-css-color'
|
||||
|
||||
-- Symlink follow
|
||||
use 'aymericbeaumet/vim-symlink'
|
||||
|
||||
-- Git
|
||||
--use 'tpope/vim-fugitive'
|
||||
--use 'airblade/vim-gitgutter'
|
||||
use 'kdheepak/lazygit.nvim'
|
||||
use {
|
||||
'lewis6991/gitsigns.nvim',
|
||||
config = function()
|
||||
require('gitsigns').setup()
|
||||
end
|
||||
}
|
||||
|
||||
-- Lastplace
|
||||
use 'farmergreg/vim-lastplace'
|
||||
|
||||
-- Autopair
|
||||
use {
|
||||
'windwp/nvim-autopairs',
|
||||
config = function()
|
||||
require('nvim-autopairs').setup()
|
||||
end
|
||||
}
|
||||
|
||||
-- Icons
|
||||
use 'kyazdani42/nvim-web-devicons'
|
||||
|
||||
-- Tag viewer
|
||||
use 'preservim/tagbar'
|
||||
|
||||
-- Treesitter interface
|
||||
use 'nvim-treesitter/nvim-treesitter'
|
||||
|
||||
-- Color schemes
|
||||
use 'navarasu/onedark.nvim'
|
||||
use { 'kyoz/purify', rtp = 'vim' }
|
||||
|
||||
-- Surround
|
||||
use 'tpope/vim-surround'
|
||||
|
||||
-- LSP
|
||||
--use 'neovim/nvim-lspconfig'
|
||||
--use 'glepnir/lspsaga.nvim'
|
||||
|
||||
-- Autocomplete
|
||||
use {
|
||||
'hrsh7th/nvim-cmp',
|
||||
requires = {
|
||||
'L3MON4D3/LuaSnip',
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'hrsh7th/cmp-path',
|
||||
'hrsh7th/cmp-buffer',
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
},
|
||||
}
|
||||
|
||||
-- Statusline
|
||||
use {
|
||||
'famiu/feline.nvim',
|
||||
requires = { 'kyazdani42/nvim-web-devicons' },
|
||||
}
|
||||
|
||||
-- Tabline bar
|
||||
use {
|
||||
'romgrk/barbar.nvim',
|
||||
requires = {'kyazdani42/nvim-web-devicons'}
|
||||
}
|
||||
|
||||
-- Dashboard (start screen)
|
||||
use {
|
||||
'goolord/alpha-nvim',
|
||||
requires = { 'kyazdani42/nvim-web-devicons' },
|
||||
config = function ()
|
||||
require'alpha'.setup(require'alpha.themes.dashboard'.config)
|
||||
end
|
||||
}
|
||||
|
||||
-- Automatically set up your configuration after cloning packer.nvim
|
||||
-- Put this at the end after all plugins
|
||||
if packer_bootstrap then
|
||||
require('packer').sync()
|
||||
end
|
||||
end)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user