Compare commits
No commits in common. "b5b26754bd6533c883ef5b5c3fb4defe8e41e9d5" and "63ae70fc67f6dc17b01b025493d3e3731aa7dd6f" have entirely different histories.
b5b26754bd
...
63ae70fc67
53
init.lua
53
init.lua
@ -1,6 +1,4 @@
|
|||||||
-- Pull in core keybindings --
|
|
||||||
require("dan.core")
|
require("dan.core")
|
||||||
|
|
||||||
-- Lazy VIM --
|
-- Lazy VIM --
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
if not vim.loop.fs_stat(lazypath) then
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
@ -15,18 +13,16 @@ if not vim.loop.fs_stat(lazypath) then
|
|||||||
end
|
end
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
require("lazy").setup("plugins")
|
require("lazy").setup("plugins")
|
||||||
|
|
||||||
-- SET NEOVIM THEME --
|
|
||||||
vim.cmd.colorscheme('catppuccin')
|
vim.cmd.colorscheme('catppuccin')
|
||||||
|
|
||||||
-- XDEBUG --
|
|
||||||
local dap = require('dap')
|
local dap = require('dap')
|
||||||
require('telescope').load_extension('dap')
|
require('telescope').load_extension('dap')
|
||||||
|
|
||||||
dap.adapters.php = {
|
dap.adapters.php = {
|
||||||
type = "executable",
|
type = "executable",
|
||||||
command = "node",
|
command = "node",
|
||||||
args = { os.getenv("HOME") .. "/vscode-php-debug/out/phpDebug.js" }
|
args = { os.getenv("HOME") .. "/vscode-php-debug/out/phpDebug.js" }
|
||||||
}
|
}
|
||||||
|
|
||||||
dap.configurations.php = {
|
dap.configurations.php = {
|
||||||
{
|
{
|
||||||
type = "php",
|
type = "php",
|
||||||
@ -40,7 +36,6 @@ dap.configurations.php = {
|
|||||||
type = "php",
|
type = "php",
|
||||||
request = "launch",
|
request = "launch",
|
||||||
port = 9003,
|
port = 9003,
|
||||||
log = true,
|
|
||||||
-- this is where your file is in the container
|
-- this is where your file is in the container
|
||||||
pathMappings = {
|
pathMappings = {
|
||||||
["/var/www/html/web"] = "${workspaceFolder}"
|
["/var/www/html/web"] = "${workspaceFolder}"
|
||||||
@ -48,15 +43,6 @@ dap.configurations.php = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
-- vim.cmd [[
|
|
||||||
-- highlight Normal guibg=none
|
|
||||||
-- highlight NonText guibg=none
|
|
||||||
-- highlight Normal ctermbg=none
|
|
||||||
-- highlight NonText ctermbg=none
|
|
||||||
-- ]]
|
|
||||||
|
|
||||||
vim.fn.sign_define('DapBreakpoint',{ text ='🟥', texthl ='', linehl ='', numhl =''})
|
|
||||||
vim.fn.sign_define('DapStopped',{ text ='▶️', texthl ='', linehl ='', numhl =''})
|
|
||||||
vim.keymap.set('n', '<leader>?', function() dap.continue() end)
|
vim.keymap.set('n', '<leader>?', function() dap.continue() end)
|
||||||
vim.keymap.set('n', '<leader>N', function() dap.step_over() end)
|
vim.keymap.set('n', '<leader>N', function() dap.step_over() end)
|
||||||
vim.keymap.set('n', '<leader>n', function() dap.step_into() end)
|
vim.keymap.set('n', '<leader>n', function() dap.step_into() end)
|
||||||
@ -65,22 +51,29 @@ vim.keymap.set('n', '<leader>b', function() dap.toggle_breakpoint() end)
|
|||||||
vim.keymap.set('n', '<leader>B', function() dap.set_breakpoint() end)
|
vim.keymap.set('n', '<leader>B', function() dap.set_breakpoint() end)
|
||||||
vim.keymap.set('n', '<leader>dr', function() dap.repl.open() end)
|
vim.keymap.set('n', '<leader>dr', function() dap.repl.open() end)
|
||||||
vim.keymap.set('n', '<leader>dl', function() dap.run_last() end)
|
vim.keymap.set('n', '<leader>dl', function() dap.run_last() end)
|
||||||
|
-- vim.keymap.set({'n', 'v'}, '<leader>dh', function()
|
||||||
|
-- require('dap.ui.widgets').hover()
|
||||||
|
-- end)
|
||||||
|
-- vim.keymap.set({'n', 'v'}, '<leader>dp', function()
|
||||||
|
-- require('dap.ui.widgets').preview()
|
||||||
|
-- end)
|
||||||
|
-- vim.keymap.set('n', '<leader>df', function()
|
||||||
|
-- local widgets = require('dap.ui.widgets')
|
||||||
|
-- widgets.centered_float(widgets.frames)
|
||||||
|
-- end)
|
||||||
vim.keymap.set('n', '<leader>db', function()
|
vim.keymap.set('n', '<leader>db', function()
|
||||||
local widgets = require('dap.ui.widgets')
|
local widgets = require('dap.ui.widgets')
|
||||||
widgets.centered_float(widgets.scopes)
|
widgets.centered_float(widgets.scopes)
|
||||||
end)
|
end)
|
||||||
|
-- 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
|
||||||
|
|
||||||
local lspconfig = require 'lspconfig'
|
|
||||||
local configs = require 'lspconfig.configs'
|
|
||||||
if not configs.drupal then
|
|
||||||
configs.drupal = {
|
|
||||||
default_config = {
|
|
||||||
cmd = {'drupal-lsp'},
|
|
||||||
filetypes = { 'php'},
|
|
||||||
root_dir = function(fname)
|
|
||||||
return lspconfig.util.root_pattern('composer.json', '.git')(fname)
|
|
||||||
end
|
|
||||||
};
|
|
||||||
}
|
|
||||||
end
|
|
||||||
lspconfig.drupal.setup{autostart = true }
|
|
||||||
|
|||||||
@ -1,36 +1,30 @@
|
|||||||
{
|
{
|
||||||
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
|
"LuaSnip": { "branch": "master", "commit": "787dee55ca364cc9119787165418fe93b74c1842" },
|
||||||
"ahoy.nvim": { "branch": "main", "commit": "a08ced2a95ac9e0b8cf7048d9daa7c39756b8261" },
|
"alpha-nvim": { "branch": "main", "commit": "bf3c8bb8c02ed3d9644cc5bbc48e2bdc39349cd7" },
|
||||||
"catppuccin": { "branch": "main", "commit": "5b5e3aef9ad7af84f463d17b5479f06b87d5c429" },
|
"catppuccin": { "branch": "main", "commit": "d9ee9a35f46f0a2bda9a15b5a763fee4095428fd" },
|
||||||
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
|
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||||
"cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" },
|
"friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
|
||||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
"harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" },
|
||||||
"harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" },
|
"lazy.nvim": { "branch": "main", "commit": "cf8ecc2c5e4332760431a33534240b0cbc6680ab" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
"lazygit.nvim": { "branch": "main", "commit": "56760339a81cd1540d5a72fd9d93010a2677b55d" },
|
||||||
"lazygit.nvim": { "branch": "main", "commit": "b9eae3badab982e71abab96d3ee1d258f0c07961" },
|
"lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" },
|
||||||
"lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "7446f47b3dfb7df801f31a6f6783c2ad119a6935" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "1517caa8fff05e4b4999857319d3b0609a7f57fa" },
|
"mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
|
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "ea387e0819ab189d536bb4067e4d8ece3801a292" },
|
"neo-tree.nvim": { "branch": "v3.x", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
|
"nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" },
|
||||||
"mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" },
|
"nvim-cmp": { "branch": "main", "commit": "29fb4854573355792df9e156cb779f0d31308796" },
|
||||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "9b5d67119c46e3262ffe1508fe6d8540b79ad75d" },
|
"nvim-dap": { "branch": "master", "commit": "7ff6936010b7222fea2caea0f67ed77f1b7c60dd" },
|
||||||
"nui.nvim": { "branch": "main", "commit": "8d3bce9764e627b62b07424e0df77f680d47ffdb" },
|
"nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "059e89495b3ec09395262f16b1ad441a38081d04" },
|
"nvim-dap-virtual-text": { "branch": "master", "commit": "52638640ae309cacdaff785fdbb854437bd1ee5c" },
|
||||||
"nvim-dap": { "branch": "master", "commit": "7aade9e99bef5f0735cf966e715b3ce45515d786" },
|
"nvim-lspconfig": { "branch": "master", "commit": "28b205ebe73a18f401e040585106f9bafd8ff21f" },
|
||||||
"nvim-dap-ui": { "branch": "master", "commit": "bc81f8d3440aede116f821114547a476b082b319" },
|
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" },
|
||||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "df66808cd78b5a97576bbaeee95ed5ca385a9750" },
|
"nvim-treesitter": { "branch": "master", "commit": "48fc5d1dfe3dded8028826dfee7526e26212c73b" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "40f120c10ea4b87311175539a183c3b75eab95a3" },
|
"nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" },
|
||||||
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "30654ee72a69e7c76a54b66d748dae088429e863" },
|
"telescope-dap.nvim": { "branch": "master", "commit": "8c88d9716c91eaef1cdea13cb9390d8ef447dbfe" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "4c3a5848ee0b09ecdea73adcd2a689190aeb728c" },
|
|
||||||
"oil.nvim": { "branch": "master", "commit": "302bbaceeafc690e6419e0c8296e804d60cb9446" },
|
|
||||||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
|
||||||
"supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" },
|
|
||||||
"telescope-dap.nvim": { "branch": "master", "commit": "783366bd6c1e7fa0a5c59c07db37f49c805a28df" },
|
|
||||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||||
"telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" },
|
"telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" },
|
||||||
"vim-commentary": { "branch": "master", "commit": "64a654ef4a20db1727938338310209b6a63f60c9" },
|
"vim-commentary": { "branch": "master", "commit": "64a654ef4a20db1727938338310209b6a63f60c9" }
|
||||||
"vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" }
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,37 +0,0 @@
|
|||||||
-- vim.opt.completeopt = { "menu", "menuone", "noselect" }
|
|
||||||
-- vim.opt.shortmess:append "c"
|
|
||||||
|
|
||||||
local lspkind = require "lspkind"
|
|
||||||
lspkind.init {}
|
|
||||||
|
|
||||||
local cmp = require "cmp"
|
|
||||||
|
|
||||||
cmp.setup {
|
|
||||||
sources = {
|
|
||||||
{ name = "nvim_lsp" },
|
|
||||||
{ name = "cody" },
|
|
||||||
{ name = "path" },
|
|
||||||
{ name = "buffer" },
|
|
||||||
},
|
|
||||||
mapping = {
|
|
||||||
["<C-n>"] = cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Insert },
|
|
||||||
["<C-p>"] = cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Insert },
|
|
||||||
["<C-y>"] = cmp.mapping(
|
|
||||||
cmp.mapping.confirm {
|
|
||||||
behavior = cmp.ConfirmBehavior.Insert,
|
|
||||||
select = true,
|
|
||||||
},
|
|
||||||
{ "i", "c" }
|
|
||||||
),
|
|
||||||
},
|
|
||||||
window = {
|
|
||||||
completion = cmp.config.window.bordered(),
|
|
||||||
documentation = cmp.config.window.bordered(),
|
|
||||||
},
|
|
||||||
-- Enable luasnip to handle snippet expansion for nvim-cmp
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
vim.snippet.expand(args.body)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@ -1,47 +1,6 @@
|
|||||||
-- Print variables function
|
|
||||||
P = function(v)
|
|
||||||
print(vim.inspect(v))
|
|
||||||
return v
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Custom keymaps
|
|
||||||
vim.g.mapleader = " "
|
vim.g.mapleader = " "
|
||||||
|
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
|
||||||
vim.keymap.set("n", "<leader>gg", vim.cmd.LazyGit)
|
vim.keymap.set("n", "<leader>gg", vim.cmd.LazyGit)
|
||||||
vim.keymap.set("n", "<leader>mv", function()
|
|
||||||
vim.cmd("Markview splitToggle")
|
|
||||||
end)
|
|
||||||
vim.keymap.set('n', '<leader><leader>r', function()
|
|
||||||
vim.cmd("w")
|
|
||||||
vim.cmd("source %")
|
|
||||||
end)
|
|
||||||
vim.keymap.set("n", "-", "<cmd>Oil<CR>")
|
|
||||||
vim.keymap.set("n", "<CR>", "<cmd>w!<CR>")
|
|
||||||
vim.keymap.set("n", "<leader>nh", "<cmd>noh<CR>")
|
|
||||||
vim.keymap.set("n", "<leader>wq", "<cmd>wq!<CR>")
|
|
||||||
vim.keymap.set("n", "<leader>fh", "<cmd>Telescope help_tags<CR>")
|
|
||||||
|
|
||||||
-- Terminal in neovim --
|
|
||||||
vim.api.nvim_create_autocmd('TermOpen', {
|
|
||||||
group = vim.api.nvim_create_augroup('open-terminal', { clear = true }),
|
|
||||||
callback = function()
|
|
||||||
vim.opt.number = false
|
|
||||||
vim.opt.relativenumber = false
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
local job_id = 0
|
|
||||||
vim.keymap.set("n", "<leader>tt", function()
|
|
||||||
vim.cmd.vnew()
|
|
||||||
vim.cmd.term()
|
|
||||||
vim.cmd.wincmd("J")
|
|
||||||
vim.api.nvim_win_set_height(0, 15)
|
|
||||||
job_id = vim.bo.channel
|
|
||||||
end)
|
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>build", function()
|
|
||||||
vim.fn.chansend(job_id, { "ls -lah<CR>" })
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- General config
|
|
||||||
vim.cmd("set expandtab")
|
vim.cmd("set expandtab")
|
||||||
vim.cmd("set tabstop=2")
|
vim.cmd("set tabstop=2")
|
||||||
vim.cmd("set softtabstop=2")
|
vim.cmd("set softtabstop=2")
|
||||||
@ -53,12 +12,8 @@ vim.cmd("set relativenumber")
|
|||||||
vim.cmd("set rnu")
|
vim.cmd("set rnu")
|
||||||
vim.cmd("set number relativenumber")
|
vim.cmd("set number relativenumber")
|
||||||
vim.cmd("set nu rnu")
|
vim.cmd("set nu rnu")
|
||||||
-- vim.cmd("set guicursor=n-v-c-i:block")
|
|
||||||
-- vim.cmd("set guicursor=a:blinkon100")
|
|
||||||
vim.api.nvim_set_option("clipboard","unnamed")
|
vim.api.nvim_set_option("clipboard","unnamed")
|
||||||
|
vim.api.nvim_create_user_command("DiagnosticToggle", function()
|
||||||
-- Command to turn off diagnostics, if crowding screen
|
|
||||||
vim.api.nvim_create_user_command("DiagnosticsToggle", function()
|
|
||||||
local config = vim.diagnostic.config
|
local config = vim.diagnostic.config
|
||||||
local vt = config().virtual_text
|
local vt = config().virtual_text
|
||||||
config {
|
config {
|
||||||
@ -67,4 +22,3 @@ vim.api.nvim_create_user_command("DiagnosticsToggle", function()
|
|||||||
signs = not vt,
|
signs = not vt,
|
||||||
}
|
}
|
||||||
end, { desc = "toggle diagnostic" })
|
end, { desc = "toggle diagnostic" })
|
||||||
vim.keymap.set("n", "<leader>dt", "<cmd>DiagnosticsToggle<CR>")
|
|
||||||
|
|||||||
@ -1,3 +1,2 @@
|
|||||||
return {
|
return {
|
||||||
-- Call local plugins here.
|
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
lua/plugins/.DS_Store
vendored
Normal file
BIN
lua/plugins/.DS_Store
vendored
Normal file
Binary file not shown.
@ -1,9 +0,0 @@
|
|||||||
return {
|
|
||||||
-- dir = "/Users/danchadwick/Projects/neovim/ahoy.nvim",
|
|
||||||
"calcu1on/ahoy.nvim",
|
|
||||||
config = function()
|
|
||||||
local ahoy = require('ahoy')
|
|
||||||
vim.keymap.set('n', '<leader>sf', function() ahoy.save_file() end)
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
76
lua/plugins/alpha.lua
Normal file
76
lua/plugins/alpha.lua
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
return {
|
||||||
|
"goolord/alpha-nvim",
|
||||||
|
event = "VimEnter", -- load plugin after all configuration is set
|
||||||
|
dependencies = {
|
||||||
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
},
|
||||||
|
|
||||||
|
config = function()
|
||||||
|
local alpha = require("alpha")
|
||||||
|
local dashboard = require("alpha.themes.dashboard")
|
||||||
|
|
||||||
|
dashboard.section.header.val = {
|
||||||
|
[[ ]],
|
||||||
|
[[ ]],
|
||||||
|
[[ ]],
|
||||||
|
[[ ]],
|
||||||
|
[[ ]],
|
||||||
|
[[ ]],
|
||||||
|
[[ ]],
|
||||||
|
[[ ]],
|
||||||
|
[[ ████ ██████ █████ ██ ]],
|
||||||
|
[[ ███████████ █████ ]],
|
||||||
|
[[ █████████ ███████████████████ ███ ███████████ ]],
|
||||||
|
[[ █████████ ███ █████████████ █████ ██████████████ ]],
|
||||||
|
[[ █████████ ██████████ █████████ █████ █████ ████ █████ ]],
|
||||||
|
[[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]],
|
||||||
|
[[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]],
|
||||||
|
[[ ]],
|
||||||
|
[[ ]],
|
||||||
|
[[ ]],
|
||||||
|
}
|
||||||
|
|
||||||
|
_Gopts = {
|
||||||
|
position = "center",
|
||||||
|
hl = "Type",
|
||||||
|
-- wrap = "overflow";
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Set menu
|
||||||
|
dashboard.section.buttons.val = {
|
||||||
|
-- dashboard.button("SPC j", " Restore Session", ":SessionRestore<cr>"),
|
||||||
|
dashboard.button("e", " New file", ":ene <BAR> startinsert <CR>"),
|
||||||
|
dashboard.button("f", " Find file", ":cd $HOME/dotfiles/.config | Telescope find_files<CR>"),
|
||||||
|
dashboard.button("g", " Find word", ":Telescope live_grep<CR>"),
|
||||||
|
dashboard.button("r", " Recent", ":Telescope oldfiles<CR>"),
|
||||||
|
dashboard.button("c", " Config", ":e $MYVIMRC <CR>"),
|
||||||
|
dashboard.button("m", " Mason", ":Mason<CR>"),
|
||||||
|
dashboard.button("l", " Lazy", ":Lazy<CR>"),
|
||||||
|
dashboard.button("u", " Update plugins", "<cmd>lua require('lazy').sync()<CR>"),
|
||||||
|
dashboard.button("q", " Quit NVIM", ":qa<CR>"),
|
||||||
|
}
|
||||||
|
|
||||||
|
--local function footer()
|
||||||
|
--return "Mohammed Babiker Babai"
|
||||||
|
--end
|
||||||
|
|
||||||
|
--dashboard.section.footer.val = footer()
|
||||||
|
|
||||||
|
dashboard.opts.opts.noautocmd = true
|
||||||
|
alpha.setup(dashboard.opts)
|
||||||
|
|
||||||
|
require("alpha").setup(dashboard.opts)
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("User", {
|
||||||
|
pattern = "LazyVimStarted",
|
||||||
|
callback = function()
|
||||||
|
local stats = require("lazy").stats()
|
||||||
|
local count = (math.floor(stats.startuptime * 100) / 100)
|
||||||
|
dashboard.section.footer.val = {
|
||||||
|
" " .. stats.count .. " plugins loaded in " .. count .. " ms"
|
||||||
|
}
|
||||||
|
pcall(vim.cmd.AlphaRedraw)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
@ -1,18 +1,44 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/cmp-nvim-lsp"
|
||||||
lazy = false,
|
},
|
||||||
priority = 100,
|
{
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"onsails/lspkind.nvim",
|
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
|
||||||
"hrsh7th/cmp-path",
|
|
||||||
"hrsh7th/cmp-buffer",
|
|
||||||
{ "L3MON4D3/LuaSnip", build = "make install_jsregexp" },
|
|
||||||
"saadparwaiz1/cmp_luasnip",
|
"saadparwaiz1/cmp_luasnip",
|
||||||
},
|
"rafamadriz/friendly-snippets"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
config = function()
|
config = function()
|
||||||
require "dan.completions"
|
local cmp = require("cmp")
|
||||||
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
|
cmp.setup({
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
window = {
|
||||||
|
completion = cmp.config.window.bordered(),
|
||||||
|
documentation = cmp.config.window.bordered(),
|
||||||
|
},
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||||
|
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||||
|
['<C-Space>'] = cmp.mapping.complete(),
|
||||||
|
['<C-e>'] = cmp.mapping.abort(),
|
||||||
|
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||||
|
}),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
-- { name = 'nvim_lsp' },
|
||||||
|
-- { name = 'vsnip' }, -- For vsnip users.
|
||||||
|
{ name = 'luasnip' }, -- For luasnip users.
|
||||||
|
}, {
|
||||||
|
{ name = 'buffer' },
|
||||||
|
})
|
||||||
|
})
|
||||||
end
|
end
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +0,0 @@
|
|||||||
return {
|
|
||||||
"tpope/vim-fugitive",
|
|
||||||
config = function()
|
|
||||||
vim.keymap.set("n", "<leader>gs", "<cmd>Git<CR>")
|
|
||||||
vim.keymap.set("n", "<leader>gvd", "<cmd>Gvdiff<CR>")
|
|
||||||
vim.keymap.set("n", "<leader>gc", "<cmd>Git commit<CR>")
|
|
||||||
vim.keymap.set("n", "<leader>gp", "<cmd>Git push<CR>")
|
|
||||||
end
|
|
||||||
}
|
|
||||||
@ -26,11 +26,11 @@ return {
|
|||||||
sorter = conf.generic_sorter({}),
|
sorter = conf.generic_sorter({}),
|
||||||
}):find()
|
}):find()
|
||||||
end
|
end
|
||||||
-- vim.keymap.set("n", "<C-h>", function() toggle_telescope(harpoon:list()) end, { desc = "Open harpoon window" })
|
vim.keymap.set("n", "<C-h>", function() toggle_telescope(harpoon:list()) end, { desc = "Open harpoon window" })
|
||||||
vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end)
|
vim.keymap.set("n", "<leader>a", function() harpoon:list():append() end)
|
||||||
vim.keymap.set("n", "<leader>c", function() harpoon:list():clear() end)
|
vim.keymap.set("n", "<leader>c", function() harpoon:list():clear() end)
|
||||||
vim.keymap.set("n", "<leader>r", function() harpoon:list():remove() end)
|
vim.keymap.set("n", "<leader>r", function() harpoon:list():remove() end)
|
||||||
vim.keymap.set("n", "<leader>h", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
-- vim.keymap.set("n", "<C-h>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
||||||
-- Toggle previous & next buffers stored within Harpoon list
|
-- Toggle previous & next buffers stored within Harpoon list
|
||||||
-- vim.keymap.set("n", "<C-S-P>", function() harpoon:list():prev() end)
|
-- vim.keymap.set("n", "<C-S-P>", function() harpoon:list():prev() end)
|
||||||
-- vim.keymap.set("n", "<C-S-N>", function() harpoon:list():next() end)
|
-- vim.keymap.set("n", "<C-S-N>", function() harpoon:list():next() end)
|
||||||
|
|||||||
@ -1,35 +1,36 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require("mason").setup()
|
require("mason").setup()
|
||||||
end,
|
end
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"williamboman/mason-lspconfig.nvim",
|
"williamboman/mason-lspconfig.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require("mason-lspconfig").setup({
|
require("mason-lspconfig").setup({
|
||||||
ensure_installed = { "lua_ls", "phpactor", "rust_analyzer" },
|
ensure_installed = { "lua_ls", "phpactor", "rust_analyzer" }
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
config = function()
|
|
||||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
|
||||||
local lspconfig = require("lspconfig")
|
|
||||||
lspconfig.lua_ls.setup({
|
|
||||||
capabilities = capabilities,
|
|
||||||
})
|
})
|
||||||
lspconfig.phpactor.setup({
|
end
|
||||||
capabilities = capabilities,
|
},
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
config = function()
|
||||||
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
|
local lspconfig = require("lspconfig")
|
||||||
|
lspconfig.lua_ls.setup({
|
||||||
|
capabilities = capabilities
|
||||||
})
|
})
|
||||||
lspconfig.rust_analyzer.setup({
|
lspconfig.phpactor.setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities
|
||||||
})
|
})
|
||||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, {})
|
lspconfig.rust_analyzer.setup({
|
||||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, {})
|
capabilities = capabilities
|
||||||
vim.keymap.set({ "n" }, "<leader>ca", vim.lsp.buf.code_action, {})
|
})
|
||||||
end,
|
vim.keymap.set("n", 'K', vim.lsp.buf.hover, {})
|
||||||
},
|
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {})
|
||||||
|
vim.keymap.set({ 'n' }, '<leader>ca', vim.lsp.buf.code_action, {})
|
||||||
|
|
||||||
|
end
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,9 +4,9 @@ return {
|
|||||||
'nvim-tree/nvim-web-devicons'
|
'nvim-tree/nvim-web-devicons'
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require('lualine').setup({
|
require('lualine'). setup({
|
||||||
options= {
|
options= {
|
||||||
theme = 'material'
|
theme = 'dracula'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|||||||
@ -8,6 +8,6 @@ return {
|
|||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
vim.keymap.set("n", "<C-n>", ':Neotree filesystem reveal left<CR>', {})
|
vim.keymap.set("n", "<C-n>", ':Neotree filesystem reveal left<CR>', {})
|
||||||
vim.keymap.set("n", "<C-e>", ':Neotree filesystem reveal current<CR>', {})
|
vim.keymap.set("n", "<C-e>", ':Neotree position=current<CR>', {})
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,20 +0,0 @@
|
|||||||
return {
|
|
||||||
{
|
|
||||||
'stevearc/oil.nvim',
|
|
||||||
---@module 'oil'
|
|
||||||
---@type oil.SetupOpts
|
|
||||||
opts = {
|
|
||||||
view_options = {
|
|
||||||
show_hidden = true,
|
|
||||||
is_always_hidden = function(name, _)
|
|
||||||
return name == "node_modules" or name == ".git"
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
-- Optional dependencies
|
|
||||||
dependencies = { { "echasnovski/mini.icons", opts = {} } },
|
|
||||||
-- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons
|
|
||||||
-- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
|
|
||||||
lazy = false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
return {
|
|
||||||
"supermaven-inc/supermaven-nvim",
|
|
||||||
config = function()
|
|
||||||
require("supermaven-nvim").setup({})
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@ -4,7 +4,7 @@ return {
|
|||||||
config = function()
|
config = function()
|
||||||
local configs = require("nvim-treesitter.configs")
|
local configs = require("nvim-treesitter.configs")
|
||||||
configs.setup({
|
configs.setup({
|
||||||
ensure_installed = { "php", "lua", "vim", "javascript", "html", "yaml", "twig", "vimdoc", "markdown", "markdown_inline" },
|
ensure_installed = { "php", "lua", "vim", "javascript", "html", "yaml", "twig" },
|
||||||
sync_install = false,
|
sync_install = false,
|
||||||
highlight = { enable = true },
|
highlight = { enable = true },
|
||||||
indent = { enable = true },
|
indent = { enable = true },
|
||||||
|
|||||||
@ -1,54 +0,0 @@
|
|||||||
local t_opts = {silent = true}
|
|
||||||
vim.keymap.set('t', '<C-n>', '<C-\\><C-N>', t_opts)
|
|
||||||
vim.keymap.set('t', '<C-h>', '<cmd>Danterm<CR>')
|
|
||||||
vim.keymap.set('n', '<leader>dt', '<cmd>Danterm<CR>')
|
|
||||||
|
|
||||||
local state = {
|
|
||||||
floating = {
|
|
||||||
buf = -1,
|
|
||||||
win = -1,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
local function dan_term(opts)
|
|
||||||
opts = opts or {}
|
|
||||||
local width = opts.width or math.floor(vim.o.columns * 0.8)
|
|
||||||
local height = opts.height or math.floor(vim.o.lines * 0.8)
|
|
||||||
local screen_width = vim.o.columns
|
|
||||||
local screen_height = vim.o.lines
|
|
||||||
local col = math.floor((screen_width - width) / 2)
|
|
||||||
local row = math.floor((screen_height - height) / 2)
|
|
||||||
|
|
||||||
local buf = nil
|
|
||||||
if vim.api.nvim_buf_is_valid(opts.buf) then
|
|
||||||
buf = opts.buf
|
|
||||||
else
|
|
||||||
buf = vim.api.nvim_create_buf(false, true)
|
|
||||||
end
|
|
||||||
|
|
||||||
local win_config = {
|
|
||||||
relative = 'editor',
|
|
||||||
width = width,
|
|
||||||
height = height,
|
|
||||||
col = col,
|
|
||||||
row = row,
|
|
||||||
style = 'minimal',
|
|
||||||
border = 'rounded', -- optional, choose 'none', 'single', 'double', etc.
|
|
||||||
}
|
|
||||||
|
|
||||||
local win = vim.api.nvim_open_win(buf, true, win_config)
|
|
||||||
|
|
||||||
return { buf = buf, win = win }
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.api.nvim_create_user_command("Danterm", function()
|
|
||||||
if not vim.api.nvim_win_is_valid(state.floating.win) then
|
|
||||||
state.floating = dan_term { buf = state.floating.buf }
|
|
||||||
if vim.bo[state.floating.buf].buftype ~= "terminal" then
|
|
||||||
vim.cmd.term()
|
|
||||||
vim.api.nvim_input("i")
|
|
||||||
end
|
|
||||||
else
|
|
||||||
vim.api.nvim_win_hide(state.floating.win)
|
|
||||||
end
|
|
||||||
end, {})
|
|
||||||
Loading…
x
Reference in New Issue
Block a user