Compare commits
35 Commits
b5b26754bd
...
slim
| Author | SHA1 | Date | |
|---|---|---|---|
| eaa9ac358a | |||
| b66c4a6eff | |||
|
|
42369bc959 | ||
|
|
d2261a927c | ||
|
|
e49ce77ec4 | ||
|
|
3eef18f9cd | ||
|
|
69ec44c865 | ||
|
|
a2ed35c726 | ||
|
|
6eda929dd3 | ||
|
|
074e475d40 | ||
|
|
c47b4da611 | ||
|
|
b3fdc6d580 | ||
|
|
3a4fcf5762 | ||
|
|
cb535f28e4 | ||
|
|
cf575950da | ||
|
|
de6697239e | ||
|
|
09e62e8940 | ||
|
|
cbce3193f9 | ||
|
|
17f72e1552 | ||
|
|
06f73e3f29 | ||
|
|
0f831a46b1 | ||
|
|
d171bfe6f3 | ||
|
|
7d8372c71f | ||
|
|
547d9b000a | ||
|
|
0129204a78 | ||
|
|
1796a835f8 | ||
|
|
dc60249576 | ||
|
|
bb66b8fa82 | ||
|
|
571341310a | ||
|
|
6358e87244 | ||
|
|
ab66632f7f | ||
|
|
d5a3a49cb1 | ||
|
|
945caaefb1 | ||
|
|
b3ab200719 | ||
|
|
9fa1a2fa85 |
82
init.lua
82
init.lua
@@ -14,73 +14,25 @@ if not vim.loop.fs_stat(lazypath) then
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
require("lazy").setup("plugins")
|
||||
|
||||
-- SET NEOVIM THEME --
|
||||
vim.cmd.colorscheme('catppuccin')
|
||||
vim.o.termguicolors = true
|
||||
-- vim.cmd "let g:everforest_background = 'hard'"
|
||||
-- vim.cmd.colorscheme('sistine')
|
||||
vim.o.background = "dark"
|
||||
|
||||
-- XDEBUG --
|
||||
local dap = require('dap')
|
||||
require('telescope').load_extension('dap')
|
||||
dap.adapters.php = {
|
||||
type = "executable",
|
||||
command = "node",
|
||||
args = { os.getenv("HOME") .. "/vscode-php-debug/out/phpDebug.js" }
|
||||
}
|
||||
dap.configurations.php = {
|
||||
{
|
||||
type = "php",
|
||||
request = "launch",
|
||||
name = "Listen for Xdebug",
|
||||
port = 9003,
|
||||
log = true,
|
||||
},
|
||||
{
|
||||
name = "listen for Xdebug docker",
|
||||
type = "php",
|
||||
request = "launch",
|
||||
port = 9003,
|
||||
log = true,
|
||||
-- this is where your file is in the container
|
||||
pathMappings = {
|
||||
["/var/www/html/web"] = "${workspaceFolder}"
|
||||
}
|
||||
}
|
||||
}
|
||||
-- Load Plugins
|
||||
require("lazy").setup("plugins")
|
||||
vim.cmd.colorscheme('everforest')
|
||||
|
||||
-- vim.cmd [[
|
||||
-- highlight Normal guibg=none
|
||||
-- highlight NonText guibg=none
|
||||
-- highlight Normal ctermbg=none
|
||||
-- highlight NonText ctermbg=none
|
||||
-- ]]
|
||||
vim.keymap.set("n", "<leader>ct", "<cmd>Telescope colorscheme<CR>")
|
||||
|
||||
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>N', function() dap.step_over() end)
|
||||
vim.keymap.set('n', '<leader>n', function() dap.step_into() end)
|
||||
vim.keymap.set('n', '<leader>E', function() dap.step_out() end)
|
||||
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>dr', function() dap.repl.open() end)
|
||||
vim.keymap.set('n', '<leader>dl', function() dap.run_last() end)
|
||||
vim.keymap.set('n', '<leader>db', function()
|
||||
local widgets = require('dap.ui.widgets')
|
||||
widgets.centered_float(widgets.scopes)
|
||||
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 }
|
||||
-- LSP --
|
||||
vim.o.winborder = 'rounded'
|
||||
vim.lsp.enable({'intelephense'})
|
||||
vim.lsp.enable({'rust_analyzer'})
|
||||
vim.lsp.enable({'elixirls'})
|
||||
vim.lsp.enable({'lexical'})
|
||||
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, {})
|
||||
|
||||
@@ -1,36 +1,40 @@
|
||||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
|
||||
"LuaSnip": { "branch": "master", "commit": "b3104910bb5ebf40492aadffae18f2528fa757d9" },
|
||||
"ahoy.nvim": { "branch": "main", "commit": "a08ced2a95ac9e0b8cf7048d9daa7c39756b8261" },
|
||||
"catppuccin": { "branch": "main", "commit": "5b5e3aef9ad7af84f463d17b5479f06b87d5c429" },
|
||||
"barbar.nvim": { "branch": "master", "commit": "549ee11d97057eae207bafa2c23c315942cca097" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
|
||||
"cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" },
|
||||
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"everforest": { "branch": "master", "commit": "3fffb096f6ac11372944ac964c60f8af41d8809f" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "23ae90a2a52fdc9b8c50dc61d6c30ebb18521343" },
|
||||
"harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||
"lazygit.nvim": { "branch": "main", "commit": "b9eae3badab982e71abab96d3ee1d258f0c07961" },
|
||||
"lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "1517caa8fff05e4b4999857319d3b0609a7f57fa" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
|
||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "ea387e0819ab189d536bb4067e4d8ece3801a292" },
|
||||
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
|
||||
"mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" },
|
||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "9b5d67119c46e3262ffe1508fe6d8540b79ad75d" },
|
||||
"nui.nvim": { "branch": "main", "commit": "8d3bce9764e627b62b07424e0df77f680d47ffdb" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "059e89495b3ec09395262f16b1ad441a38081d04" },
|
||||
"nvim-dap": { "branch": "master", "commit": "7aade9e99bef5f0735cf966e715b3ce45515d786" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "bc81f8d3440aede116f821114547a476b082b319" },
|
||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "df66808cd78b5a97576bbaeee95ed5ca385a9750" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "40f120c10ea4b87311175539a183c3b75eab95a3" },
|
||||
"kanagawa.nvim": { "branch": "master", "commit": "debe91547d7fb1eef34ce26a5106f277fbfdd109" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
||||
"lazygit.nvim": { "branch": "main", "commit": "2305deed25bc61b866d5d39189e9105a45cf1cfb" },
|
||||
"lspkind.nvim": { "branch": "master", "commit": "3ddd1b4edefa425fda5a9f95a4f25578727c0bb3" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" },
|
||||
"markview.nvim": { "branch": "main", "commit": "3b9ad1ef6527c220b9b6b0c0d7694c74a95524f4" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "f760507df8c49a4bf46a4d12e1fc616797508979" },
|
||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "86389a3dd687cfaa647b6f44731e492970034baa" },
|
||||
"mason.nvim": { "branch": "main", "commit": "b3689a41dd77e5294498dba9757fb22cc80cbebd" },
|
||||
"mini.icons": { "branch": "main", "commit": "e8fae66cb400744daeedf6e387347df50271c252" },
|
||||
"nightfox": { "branch": "main", "commit": "ba47d4b4c5ec308718641ba7402c143836f35aa9" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
|
||||
"nvim-dap": { "branch": "master", "commit": "7367cec8e8f7a0b1e4566af9a7ef5959d11206a7" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" },
|
||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
|
||||
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "30654ee72a69e7c76a54b66d748dae088429e863" },
|
||||
"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" },
|
||||
"nvim-treesitter": { "branch": "main", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "f6b0920f452bfd7595ee9a9efe5e1ae78e0e2997" },
|
||||
"oil.nvim": { "branch": "master", "commit": "919e155fdf38e9148cdb5304faaaf53c20d703ea" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"rose-pine": { "branch": "main", "commit": "72a04c4065345b51b56aed4859ea1d884f734097" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "5d9dacd09876eed33bde204d224fa7596ac850e8" },
|
||||
"telescope-dap.nvim": { "branch": "master", "commit": "783366bd6c1e7fa0a5c59c07db37f49c805a28df" },
|
||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" },
|
||||
"vim-commentary": { "branch": "master", "commit": "64a654ef4a20db1727938338310209b6a63f60c9" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" }
|
||||
"vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" }
|
||||
}
|
||||
|
||||
11
lsp/elixirls.lua
Normal file
11
lsp/elixirls.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
return {
|
||||
filetypes = { 'elixir', 'eelixir', 'heex', 'surface' },
|
||||
root_dir = function(bufnr, on_dir)
|
||||
local fname = vim.api.nvim_buf_get_name(bufnr)
|
||||
local matches = vim.fs.find({ 'mix.exs' }, { upward = true, limit = 2, path = fname })
|
||||
local child_or_root_path, maybe_umbrella_path = unpack(matches)
|
||||
local root_dir = vim.fs.dirname(maybe_umbrella_path or child_or_root_path)
|
||||
|
||||
on_dir(root_dir)
|
||||
end,
|
||||
}
|
||||
12
lsp/intelephense.lua
Normal file
12
lsp/intelephense.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
return {
|
||||
cmd = { 'intelephense', '--stdio' },
|
||||
filetypes = { 'php' },
|
||||
root_dir = function(bufnr, on_dir)
|
||||
local fname = vim.api.nvim_buf_get_name(bufnr)
|
||||
local cwd = assert(vim.uv.cwd())
|
||||
local root = vim.fs.root(fname, { 'composer.json', '.git' })
|
||||
|
||||
-- prefer cwd if root is a descendant
|
||||
on_dir(root and vim.fs.relpath(cwd, root) and cwd)
|
||||
end,
|
||||
}
|
||||
4
lsp/lexical.lua
Normal file
4
lsp/lexical.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
filetypes = { 'elixir', 'eelixir', 'heex', 'surface' },
|
||||
root_markers = { 'mix.exs', '.git' },
|
||||
}
|
||||
96
lsp/rust_analyzer.lua
Normal file
96
lsp/rust_analyzer.lua
Normal file
@@ -0,0 +1,96 @@
|
||||
local function reload_workspace(bufnr)
|
||||
local clients = vim.lsp.get_clients { bufnr = bufnr, name = 'rust_analyzer' }
|
||||
for _, client in ipairs(clients) do
|
||||
vim.notify 'Reloading Cargo Workspace'
|
||||
client.request('rust-analyzer/reloadWorkspace', nil, function(err)
|
||||
if err then
|
||||
error(tostring(err))
|
||||
end
|
||||
vim.notify 'Cargo workspace reloaded'
|
||||
end, 0)
|
||||
end
|
||||
end
|
||||
|
||||
local function is_library(fname)
|
||||
local user_home = vim.fs.normalize(vim.env.HOME)
|
||||
local cargo_home = os.getenv 'CARGO_HOME' or user_home .. '/.cargo'
|
||||
local registry = cargo_home .. '/registry/src'
|
||||
local git_registry = cargo_home .. '/git/checkouts'
|
||||
|
||||
local rustup_home = os.getenv 'RUSTUP_HOME' or user_home .. '/.rustup'
|
||||
local toolchains = rustup_home .. '/toolchains'
|
||||
|
||||
for _, item in ipairs { toolchains, registry, git_registry } do
|
||||
if vim.fs.relpath(item, fname) then
|
||||
local clients = vim.lsp.get_clients { name = 'rust_analyzer' }
|
||||
return #clients > 0 and clients[#clients].config.root_dir or nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
cmd = { 'rust-analyzer' },
|
||||
filetypes = { 'rust' },
|
||||
root_dir = function(bufnr, on_dir)
|
||||
local fname = vim.api.nvim_buf_get_name(bufnr)
|
||||
local reused_dir = is_library(fname)
|
||||
if reused_dir then
|
||||
on_dir(reused_dir)
|
||||
return
|
||||
end
|
||||
|
||||
local cargo_crate_dir = vim.fs.root(fname, { 'Cargo.toml' })
|
||||
local cargo_workspace_root
|
||||
|
||||
if cargo_crate_dir == nil then
|
||||
on_dir(
|
||||
vim.fs.root(fname, { 'rust-project.json' })
|
||||
or vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1])
|
||||
)
|
||||
return
|
||||
end
|
||||
|
||||
local cmd = {
|
||||
'cargo',
|
||||
'metadata',
|
||||
'--no-deps',
|
||||
'--format-version',
|
||||
'1',
|
||||
'--manifest-path',
|
||||
cargo_crate_dir .. '/Cargo.toml',
|
||||
}
|
||||
|
||||
vim.system(cmd, { text = true }, function(output)
|
||||
if output.code == 0 then
|
||||
if output.stdout then
|
||||
local result = vim.json.decode(output.stdout)
|
||||
if result['workspace_root'] then
|
||||
cargo_workspace_root = vim.fs.normalize(result['workspace_root'])
|
||||
end
|
||||
end
|
||||
|
||||
on_dir(cargo_workspace_root or cargo_crate_dir)
|
||||
else
|
||||
vim.schedule(function()
|
||||
vim.notify(('[rust_analyzer] cmd failed with code %d: %s\n%s'):format(output.code, cmd, output.stderr))
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end,
|
||||
capabilities = {
|
||||
experimental = {
|
||||
serverStatusNotification = true,
|
||||
},
|
||||
},
|
||||
before_init = function(init_params, config)
|
||||
-- See https://github.com/rust-lang/rust-analyzer/blob/eb5da56d839ae0a9e9f50774fa3eb78eb0964550/docs/dev/lsp-extensions.md?plain=1#L26
|
||||
if config.settings and config.settings['rust-analyzer'] then
|
||||
init_params.initializationOptions = config.settings['rust-analyzer']
|
||||
end
|
||||
end,
|
||||
on_attach = function()
|
||||
vim.api.nvim_buf_create_user_command(0, 'LspCargoReload', function()
|
||||
reload_workspace(0)
|
||||
end, { desc = 'Reload current cargo workspace' })
|
||||
end,
|
||||
}
|
||||
@@ -7,9 +7,6 @@ end
|
||||
-- Custom keymaps
|
||||
vim.g.mapleader = " "
|
||||
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 %")
|
||||
@@ -17,15 +14,17 @@ 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>")
|
||||
vim.keymap.set("n", "<leader>sq", "<cmd>wq!<CR>")
|
||||
vim.keymap.set("n", "<leader>lg", "<cmd>LazyGit<CR>")
|
||||
|
||||
-- Terminal in neovim --
|
||||
vim.keymap.set('t', '<C-space>', "<C-\\><C-n><C-w>h",{silent = true})
|
||||
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
|
||||
vim.api.nvim_input("i")
|
||||
end,
|
||||
})
|
||||
local job_id = 0
|
||||
@@ -37,10 +36,6 @@ vim.keymap.set("n", "<leader>tt", function()
|
||||
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 tabstop=2")
|
||||
@@ -49,14 +44,16 @@ vim.cmd("set shiftwidth=2")
|
||||
vim.cmd("set syntax=on")
|
||||
vim.cmd("set number")
|
||||
vim.cmd("set nu")
|
||||
vim.cmd("set relativenumber")
|
||||
vim.cmd("set rnu")
|
||||
vim.cmd("set number relativenumber")
|
||||
vim.cmd("set nu rnu")
|
||||
-- vim.cmd("set guicursor=n-v-c-i:block")
|
||||
-- vim.cmd("set guicursor=a:blinkon100")
|
||||
vim.cmd("set linebreak")
|
||||
vim.cmd("set termguicolors")
|
||||
-- vim.cmd("set guicursor=n-v-c:block")
|
||||
vim.api.nvim_set_option("clipboard","unnamed")
|
||||
|
||||
-- Markview
|
||||
vim.keymap.set("n", "<leader>mv", function()
|
||||
vim.cmd("Markview splitToggle")
|
||||
end)
|
||||
|
||||
-- Command to turn off diagnostics, if crowding screen
|
||||
vim.api.nvim_create_user_command("DiagnosticsToggle", function()
|
||||
local config = vim.diagnostic.config
|
||||
@@ -67,4 +64,5 @@ vim.api.nvim_create_user_command("DiagnosticsToggle", function()
|
||||
signs = not vt,
|
||||
}
|
||||
end, { desc = "toggle diagnostic" })
|
||||
vim.keymap.set("n", "<leader>dt", "<cmd>DiagnosticsToggle<CR>")
|
||||
vim.keymap.set("n", "<leader>dtog", "<cmd>DiagnosticsToggle<CR>")
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
14
lua/plugins/barbar.lua
Normal file
14
lua/plugins/barbar.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
return {
|
||||
'romgrk/barbar.nvim',
|
||||
dependencies = {
|
||||
'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status
|
||||
'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons
|
||||
},
|
||||
config = function()
|
||||
local opts = { noremap = true, silent = true }
|
||||
vim.keymap.set("n", "<C-k>", "<cmd>BufferNext<CR>")
|
||||
vim.keymap.set("n", "<C-j>", "<cmd>BufferPrevious<CR>")
|
||||
vim.keymap.set('n', '<C-p>', '<Cmd>BufferPin<CR>')
|
||||
vim.keymap.set('n', '<C-q>', '<Cmd>BufferClose<CR>')
|
||||
end
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
return {
|
||||
'catppuccin/nvim',
|
||||
priority = 1000,
|
||||
name = "catppuccin",
|
||||
config = function()
|
||||
require("catppuccin").setup({
|
||||
flavour = "macchiato", -- latte, frappe, macchiato, mocha
|
||||
background = { -- :h background
|
||||
light = "latte",
|
||||
dark = "mocha",
|
||||
},
|
||||
transparent_background = false, -- disables setting the background color.
|
||||
show_end_of_buffer = false, -- shows the '~' characters after the end of buffers
|
||||
term_colors = false, -- sets terminal colors (e.g. `g:terminal_color_0`)
|
||||
dim_inactive = {
|
||||
enabled = false, -- dims the background color of inactive window
|
||||
shade = "dark",
|
||||
percentage = 0.15, -- percentage of the shade to apply to the inactive window
|
||||
},
|
||||
no_italic = false, -- Force no italic
|
||||
no_bold = false, -- Force no bold
|
||||
no_underline = false, -- Force no underline
|
||||
styles = { -- Handles the styles of general hi groups (see `:h highlight-args`):
|
||||
comments = { "italic" }, -- Change the style of comments
|
||||
conditionals = { "italic" },
|
||||
loops = {},
|
||||
functions = {},
|
||||
keywords = {},
|
||||
strings = {},
|
||||
variables = {},
|
||||
numbers = {},
|
||||
booleans = {},
|
||||
properties = {},
|
||||
types = {},
|
||||
operators = {},
|
||||
-- miscs = {}, -- Uncomment to turn off hard-coded styles
|
||||
},
|
||||
color_overrides = {},
|
||||
custom_highlights = {},
|
||||
default_integrations = true,
|
||||
integrations = {
|
||||
cmp = true,
|
||||
gitsigns = true,
|
||||
nvimtree = true,
|
||||
treesitter = true,
|
||||
notify = false,
|
||||
mini = {
|
||||
enabled = true,
|
||||
indentscope_color = "",
|
||||
},
|
||||
-- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations)
|
||||
},
|
||||
})
|
||||
end
|
||||
}
|
||||
10
lua/plugins/colorizer.lua
Normal file
10
lua/plugins/colorizer.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
"norcalli/nvim-colorizer.lua",
|
||||
config = function()
|
||||
require("colorizer").setup({
|
||||
'css',
|
||||
'scss',
|
||||
'javascript',
|
||||
})
|
||||
end,
|
||||
}
|
||||
5
lua/plugins/everforest.lua
Normal file
5
lua/plugins/everforest.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
"sainnhe/everforest",
|
||||
priority = 1000,
|
||||
name = "everforest",
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -9,30 +9,9 @@ return {
|
||||
-- REQUIRED
|
||||
harpoon:setup()
|
||||
-- REQUIRED
|
||||
-- basic telescope configuration
|
||||
local conf = require("telescope.config").values
|
||||
local function toggle_telescope(harpoon_files)
|
||||
local file_paths = {}
|
||||
for _, item in ipairs(harpoon_files.items) do
|
||||
table.insert(file_paths, item.value)
|
||||
end
|
||||
|
||||
require("telescope.pickers").new({}, {
|
||||
prompt_title = "Harpoon",
|
||||
finder = require("telescope.finders").new_table({
|
||||
results = file_paths,
|
||||
}),
|
||||
previewer = conf.file_previewer({}),
|
||||
sorter = conf.generic_sorter({}),
|
||||
}):find()
|
||||
end
|
||||
-- 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>c", function() harpoon:list():clear() 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)
|
||||
-- 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-N>", function() harpoon:list():next() end)
|
||||
end
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
return {
|
||||
"kdheepak/lazygit.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
}
|
||||
}
|
||||
@@ -9,27 +9,8 @@ return {
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
config = function()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = { "lua_ls", "phpactor", "rust_analyzer" },
|
||||
ensure_installed = { "lua_ls", "intelephense", "rust_analyzer", "elixirls" },
|
||||
})
|
||||
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({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
lspconfig.rust_analyzer.setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
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,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ return {
|
||||
config = function()
|
||||
require('lualine').setup({
|
||||
options= {
|
||||
theme = 'material'
|
||||
theme = 'everforest'
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
config = function()
|
||||
vim.keymap.set("n", "<C-n>", ':Neotree filesystem reveal left<CR>', {})
|
||||
vim.keymap.set("n", "<C-e>", ':Neotree filesystem reveal current<CR>', {})
|
||||
end
|
||||
}
|
||||
4
lua/plugins/rosepine.lua
Normal file
4
lua/plugins/rosepine.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
"rose-pine/neovim",
|
||||
name = "rose-pine",
|
||||
}
|
||||
70
lua/plugins/snacks.lua
Normal file
70
lua/plugins/snacks.lua
Normal file
@@ -0,0 +1,70 @@
|
||||
return {
|
||||
"folke/snacks.nvim",
|
||||
---@type snacks.Config
|
||||
opts = {
|
||||
picker = {
|
||||
ignored = true,
|
||||
hidden = true,
|
||||
exclude = {
|
||||
".git",
|
||||
".DS_Store",
|
||||
}
|
||||
},
|
||||
explorer = {},
|
||||
indent = {},
|
||||
animate = {},
|
||||
lazygit = {},
|
||||
scroll = {},
|
||||
},
|
||||
keys = {
|
||||
-- Top Pickers & Explorer
|
||||
{ "<leader><space>", function() Snacks.picker.smart() end, desc = "Smart Find Files" },
|
||||
{ "<leader>,", function() Snacks.picker.buffers() end, desc = "Buffers" },
|
||||
{ "<leader>/", function() Snacks.picker.grep() end, desc = "Grep" },
|
||||
{ "<leader>:", function() Snacks.picker.command_history() end, desc = "Command History" },
|
||||
{ "<leader>n", function() Snacks.picker.notifications() end, desc = "Notification History" },
|
||||
{ "<leader>e", function() Snacks.explorer() end, desc = "File Explorer" },
|
||||
-- find
|
||||
{ "<leader>fb", function() Snacks.picker.buffers() end, desc = "Buffers" },
|
||||
{ "<leader>fc", function() Snacks.picker.files({ cwd = vim.fn.stdpath("config") }) end, desc = "Find Config File" },
|
||||
{ "<leader>ff", function() Snacks.picker.files() end, desc = "Find Files" },
|
||||
{ "<leader>fg", function() Snacks.picker.git_files() end, desc = "Find Git Files" },
|
||||
{ "<leader>fp", function() Snacks.picker.projects() end, desc = "Projects" },
|
||||
{ "<leader>fr", function() Snacks.picker.recent() end, desc = "Recent" },
|
||||
-- Grep
|
||||
{ "<leader>sb", function() Snacks.picker.lines() end, desc = "Buffer Lines" },
|
||||
{ "<leader>sB", function() Snacks.picker.grep_buffers() end, desc = "Grep Open Buffers" },
|
||||
{ "<leader>sg", function() Snacks.picker.grep() end, desc = "Grep" },
|
||||
{ "<leader>sw", function() Snacks.picker.grep_word() end, desc = "Visual selection or word", mode = { "n", "x" } },
|
||||
-- search
|
||||
{ '<leader>s"', function() Snacks.picker.registers() end, desc = "Registers" },
|
||||
{ '<leader>s/', function() Snacks.picker.search_history() end, desc = "Search History" },
|
||||
{ "<leader>sa", function() Snacks.picker.autocmds() end, desc = "Autocmds" },
|
||||
{ "<leader>sb", function() Snacks.picker.lines() end, desc = "Buffer Lines" },
|
||||
{ "<leader>sc", function() Snacks.picker.command_history() end, desc = "Command History" },
|
||||
{ "<leader>sC", function() Snacks.picker.commands() end, desc = "Commands" },
|
||||
{ "<leader>sd", function() Snacks.picker.diagnostics() end, desc = "Diagnostics" },
|
||||
{ "<leader>sD", function() Snacks.picker.diagnostics_buffer() end, desc = "Buffer Diagnostics" },
|
||||
{ "<leader>sh", function() Snacks.picker.help() end, desc = "Help Pages" },
|
||||
{ "<leader>sH", function() Snacks.picker.highlights() end, desc = "Highlights" },
|
||||
{ "<leader>si", function() Snacks.picker.icons() end, desc = "Icons" },
|
||||
{ "<leader>sj", function() Snacks.picker.jumps() end, desc = "Jumps" },
|
||||
{ "<leader>sk", function() Snacks.picker.keymaps() end, desc = "Keymaps" },
|
||||
{ "<leader>sl", function() Snacks.picker.loclist() end, desc = "Location List" },
|
||||
{ "<leader>sm", function() Snacks.picker.marks() end, desc = "Marks" },
|
||||
{ "<leader>sM", function() Snacks.picker.man() end, desc = "Man Pages" },
|
||||
{ "<leader>sp", function() Snacks.picker.lazy() end, desc = "Search for Plugin Spec" },
|
||||
{ "<leader>sq", function() Snacks.picker.qflist() end, desc = "Quickfix List" },
|
||||
{ "<leader>sR", function() Snacks.picker.resume() end, desc = "Resume" },
|
||||
{ "<leader>su", function() Snacks.picker.undo() end, desc = "Undo History" },
|
||||
{ "<leader>uC", function() Snacks.picker.colorschemes() end, desc = "Colorschemes" },
|
||||
-- LSP
|
||||
{ "gd", function() Snacks.picker.lsp_definitions() end, desc = "Goto Definition" },
|
||||
{ "gD", function() Snacks.picker.lsp_declarations() end, desc = "Goto Declaration" },
|
||||
{ "gr", function() Snacks.picker.lsp_references() end, nowait = true, desc = "References" },
|
||||
{ "gI", function() Snacks.picker.lsp_implementations() end, desc = "Goto Implementation" },
|
||||
{ "gy", function() Snacks.picker.lsp_type_definitions() end, desc = "Goto T[y]pe Definition" },
|
||||
{ "<leader>ss", function() Snacks.picker.lsp_symbols() end, desc = "LSP Symbols" },
|
||||
{ "<leader>sS", function() Snacks.picker.lsp_workspace_symbols() end, desc = "LSP Workspace Symbols" },
|
||||
},
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
return {
|
||||
"supermaven-inc/supermaven-nvim",
|
||||
config = function()
|
||||
require("supermaven-nvim").setup({})
|
||||
end,
|
||||
}
|
||||
@@ -7,10 +7,10 @@ return {
|
||||
},
|
||||
config = function()
|
||||
local builtin = require('telescope.builtin')
|
||||
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
|
||||
vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
|
||||
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
|
||||
-- vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
|
||||
-- vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
|
||||
-- vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
|
||||
-- vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
|
||||
end
|
||||
},
|
||||
{
|
||||
@@ -29,11 +29,5 @@ return {
|
||||
-- load_extension, somewhere after setup function:
|
||||
require("telescope").load_extension("ui-select")
|
||||
end
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope-dap.nvim",
|
||||
config = function()
|
||||
require('telescope').load_extension('dap')
|
||||
end
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,10 @@ return {
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
end
|
||||
end,
|
||||
dependencies = {
|
||||
"OXY2DEV/markview.nvim"
|
||||
},
|
||||
lazy = false
|
||||
}
|
||||
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
return {
|
||||
{
|
||||
'mfussenegger/nvim-dap',
|
||||
},
|
||||
{
|
||||
"jay-babu/mason-nvim-dap.nvim",
|
||||
config = function()
|
||||
require("mason-nvim-dap").setup({
|
||||
ensure_installed = { "php-debug-adapter" }
|
||||
})
|
||||
end
|
||||
},
|
||||
{
|
||||
'theHamsta/nvim-dap-virtual-text',
|
||||
config = function()
|
||||
require("nvim-dap-virtual-text").setup()
|
||||
end
|
||||
},
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
dependencies = {
|
||||
"mfussenegger/nvim-dap",
|
||||
"nvim-neotest/nvim-nio"
|
||||
},
|
||||
config = function()
|
||||
require("dapui").setup()
|
||||
end
|
||||
}
|
||||
}
|
||||
@@ -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, {})
|
||||
Reference in New Issue
Block a user