This commit is contained in:
Fabian Becker
2025-09-04 17:01:42 +02:00
parent bbece9eade
commit c30a121b99
12 changed files with 110 additions and 385 deletions

View File

@@ -1,129 +0,0 @@
if vim.g.vscode then
return
end
local Worktree = require("git-worktree")
local Job = require("plenary.job")
local FTerm = require("FTerm")
local function file_exists(name)
local f=io.open(name,"r")
if f~=nil then io.close(f) return true else return false end
end
local function schedule_notify(message, level)
vim.schedule(function()
vim.notify.notify(message, level or "info")
end)
end
local function is_elixir_project()
return file_exists(vim.loop.cwd() .. "/" .. "mix.exs")
end
-- Run mix compile
local compile_job = Job:new({
command = "mix",
args = { "compile" },
on_start = function()
schedule_notify("Compiling...", "debug")
end,
on_exit = function(_j, _return_val)
schedule_notify("Compiling done")
end
})
-- Run mix deps.get
local deps_job = Job:new({
command = "mix",
args = { "deps.get" },
on_start = function()
schedule_notify("Fetching dependencies...")
end,
on_exit = function(_j, _return_val)
schedule_notify("Fetched dependencies")
end
})
local function create_docker_up_job(path)
return Job:new({
command = "docker-compose",
args = { "up" },
cwd = path,
detached = true,
on_start = function ()
schedule_notify("Running docker in " .. path, "debug")
end,
on_exit = function (_j, return_val)
if return_val ~= 0 then
schedule_notify("Error running docker for " .. path, "error")
end
end
})
end
local function create_docker_down_job(path)
return Job:new({
command = "docker-compose",
args = { "down" },
cwd = path,
on_start = function ()
schedule_notify("Shutting down containers at " .. path, "debug")
end,
on_exit = function ()
schedule_notify("Shut down containers at " .. path, "debug")
end,
})
end
local iex = FTerm:new({
cmd = { "iex", "-S", "mix" },
dimensions = {
height = 0.9,
width = 0.9
}
})
vim.keymap.set('t', '<A-t>', function ()
iex:toggle()
end)
vim.keymap.set('n', '<A-t>', function ()
iex:toggle()
end)
Worktree.on_tree_change(function(op, metadata)
if op == Worktree.Operations.Create and is_elixir_project() then
deps_job:and_then(compile_job)
deps_job:start()
end
if op == Worktree.Operations.Switch and is_elixir_project() then
local docker_down = create_docker_down_job(metadata.prev_path)
local docker_up = create_docker_up_job(metadata.path)
docker_down:and_then(docker_up)
compile_job:start()
docker_down:start()
iex:close(true)
end
end)
local group = vim.api.nvim_create_augroup('MyCustomNeogitEvents', { clear = true })
vim.api.nvim_create_autocmd('User', {
pattern = 'NeogitPullComplete',
group = group,
callback = function ()
deps_job:and_then(compile_job)
deps_job:start()
end,
})
vim.api.nvim_create_autocmd('User', {
pattern = 'NeogitBranchCheckout',
group = group,
callback = function ()
deps_job:and_then(compile_job)
deps_job:start()
end,
})

View File

@@ -1,39 +0,0 @@
if vim.g.vscode then
return
end
local nnoremap = require('halfdan.keymap').nnoremap
local actions = require("telescope.actions")
local action_state = require "telescope.actions.state"
local worktree = require("git-worktree")
local function create_workspace_for_issue()
require'telescope'.extensions.jira.live_search({
attach_mappings =function ()
actions.select_default:replace(
function ()
local selection = action_state.get_selected_entry()
local branch_name = "fb/" .. selection.key:lower()
vim.schedule(function ()
-- Create worktree
worktree.create_worktree(branch_name, branch_name, "origin")
end)
end
)
return true
end,
assignee = "fbecker@adobe.com",
})
end
nnoremap("<leader>jw", function ()
create_workspace_for_issue()
end)
nnoremap("<leader>js", function ()
require'telescope'.extensions.jira.live_search({
project="BES"
})
end)

View File

@@ -83,13 +83,6 @@ vim.lsp.protocol.CompletionItemKind = {
vim.api.nvim_set_keymap('n', '<leader>e', '<cmd>Lspsaga show_line_diagnostics<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>q', '<cmd>lua vim.diagnostic.setloclist()<CR>', { noremap = true, silent = true })
-- LSP settings
local lsp_status = require('lsp-status')
lsp_status.register_progress()
local lspconfig = require 'lspconfig'
local configs = require 'lspconfig.configs'
-- Global mappings.
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float)
@@ -149,94 +142,54 @@ local on_attach = function(client, bufnr)
lsp_status.on_attach(client, bufnr)
end
local function config(_config)
_config = vim.tbl_deep_extend("force", {
log_level = vim.lsp.protocol.MessageType.Log,
message_level = vim.lsp.protocol.MessageType.Log,
capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()),
on_attach = on_attach,
}, _config or {})
-- Set default client capabilities plus window/workDoneProgress
_config.capabilities = vim.tbl_extend('keep', _config.capabilities or {}, lsp_status.capabilities)
return _config
end
-- Enable the following language servers
-- local servers = { 'gopls', 'julials', 'rust_analyzer', 'pyright' }
-- for _, lsp in ipairs(servers) do
-- lspconfig[lsp].setup(config())
-- end
require'lspconfig'.lua_ls.setup {
vim.lsp.config("lua_ls", {
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = 'LuaJIT',
-- Tell the language server which version of Lua you're using
version = "LuaJIT",
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = {'vim'},
globals = { "vim" },
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
-- Do not send telemetry data containing a randomized but unique identifier
enable = false,
},
},
},
}
require('rust-tools').setup({
tools = {
runnables = {
use_telescope = true,
},
inlay_hints = {
auto = true,
parameter_hints_prefix = "",
other_hints_prefix = "",
}
},
server = {
on_attach = on_attach,
settings = {
["rust-analyzer"] = {
checkOnSave = {
command = "clippy",
},
},
},
},
})
-- Enable it
vim.lsp.enable("lua_ls")
local lexical_config = {
filetypes = { "elixir", "eelixir", "heex" },
cmd = { "/Users/fbecker/code/lexical/_build/dev/package/lexical/bin/start_lexical.sh" },
settings = {},
}
if not configs.lexical then
configs.lexical = {
default_config = {
filetypes = lexical_config.filetypes,
cmd = lexical_config.cmd,
root_dir = function(fname)
return lspconfig.util.root_pattern("mix.exs", ".git")(fname) or vim.loop.os_homedir()
end,
-- optional settings
settings = lexical_config.settings,
vim.lsp.config('gopls', {
cmd = { "gopls" },
filetypes = { "go", "gomod", "gowork", "gotmpl" },
root_markers = { "go.work", "go.mod", ".git" },
settings = {
gopls = {
analyses = {
unusedparams = true,
shadow = true,
},
staticcheck = true,
},
}
end
},
})
lspconfig.lexical.setup({})
vim.lsp.enable 'gopls'
lspconfig.gleam.setup({})
vim.lsp.config('expert', {
cmd = { 'expert' },
root_markers = { 'mix.exs', '.git' },
filetypes = { 'elixir', 'eelixir', 'heex' },
})
vim.lsp.enable 'expert'
vim.lsp.enable 'gleam'

View File

@@ -1,16 +0,0 @@
if vim.g.vscode then
return
end
local ok, nls = pcall(require, 'null-ls')
if not ok then
return
end
nls.setup({
sources = {
nls.builtins.formatting.stylua,
nls.builtins.diagnostics.credo,
},
})

View File

@@ -37,12 +37,6 @@ nnoremap("<leader>vh", function()
builtin.help_tags()
end)
nnoremap("<leader>wc", function()
require('telescope').extensions.git_worktree.create_git_worktree()
end)
nnoremap("<leader>ws", function()
require('telescope').extensions.git_worktree.git_worktrees()
end)
nnoremap("<leader>gc", function()
builtin.git_branches()
end)

View File

@@ -3,70 +3,66 @@
"FTerm.nvim": { "branch": "master", "commit": "d1320892cc2ebab472935242d9d992a2c9570180" },
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
"cmp-git": { "branch": "main", "commit": "483ffb9a7471409a841df099d7c13556234365a4" },
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" },
"cmp-git": { "branch": "main", "commit": "b24309c386c9666c549a1abaedd4956541676d06" },
"cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" },
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"editorconfig-vim": { "branch": "master", "commit": "3c2813f2566d9392ff3614248c5db43c3fda9d5f" },
"elixir-tools.nvim": { "branch": "main", "commit": "f7e18753f5587b422aac628249fa46c66ed24af3" },
"fzf-lua": { "branch": "main", "commit": "c23f777b28da6aa5603cde1b713e9f6973805d5d" },
"git-blame.nvim": { "branch": "master", "commit": "2883a7460f611c2705b23f12d58d398d5ce6ec00" },
"git-worktree.nvim": { "branch": "master", "commit": "f247308e68dab9f1133759b05d944569ad054546" },
"editorconfig-vim": { "branch": "master", "commit": "6a58b7c11f79c0e1d0f20533b3f42f2a11490cf8" },
"fzf-lua": { "branch": "main", "commit": "f6a570cc42596efb73359fc453061e24abb71d9f" },
"git-blame.nvim": { "branch": "master", "commit": "8503b199edf9a666fe7b1a989cf14e3c26b2eb03" },
"gruvbox-baby": { "branch": "main", "commit": "bd52e62d8134647090108189e69c8b3cd18bdbbf" },
"harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" },
"lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" },
"lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" },
"lspsaga.nvim": { "branch": "main", "commit": "13b3cdc9a53ec821b9e693ee71501cc2d6cf206c" },
"lspsaga.nvim": { "branch": "main", "commit": "8efe00d6aed9db6449969f889170f1a7e43101a1" },
"lua-utils.nvim": { "branch": "main", "commit": "e565749421f4bbb5d2e85e37c3cef9d56553d8bd" },
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "e6645ecfcba3e064446a6def1c10d788c9873f51" },
"neogit": { "branch": "master", "commit": "63124cf520ff24d09deb3b850e053908ab0fc66a" },
"neorg": { "branch": "main", "commit": "81ee90cb2d72ac43bfadb7dd276646f34c8f85be" },
"neorg-telescope": { "branch": "main", "commit": "ddb2556644cae922699a239bbb0fe16e25b084b7" },
"neotest": { "branch": "master", "commit": "d66cf4e05a116957f0d3a7755a24291c7d1e1f72" },
"lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "f1deac7ecec88c28a250d890ba7bb35843e69cbd" },
"neogit": { "branch": "master", "commit": "4046f747739cf7e7b9aada447f3edc59c947b111" },
"neorg": { "branch": "main", "commit": "e206c9642f4a115cd836e76c98ef785623d335bc" },
"neorg-telescope": { "branch": "main", "commit": "7fb6ca6a632c3c095601d379a664c0c1f802dc6c" },
"neotest": { "branch": "master", "commit": "35a59c1f59dbb954d92b74ab64a966a668cea495" },
"neotest-elixir": { "branch": "master", "commit": "a242aebeaa6997c1c149138ff77f6cacbe33b6fc" },
"neotest-rust": { "branch": "main", "commit": "e1cb22ecf0341fb894ef2ebde344389fe6e6fc8e" },
"neotest-go": { "branch": "main", "commit": "92950ad7be2ca02a41abca5c6600ff6ffaf5b5d6" },
"neotest-rust": { "branch": "main", "commit": "2c9941d4a358839918fac21d20fc8fef0e1ad05f" },
"neotest-vim-test": { "branch": "master", "commit": "75c4228882ae4883b11bfce9b8383e637eb44192" },
"nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" },
"null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
"nvim-cmp": { "branch": "main", "commit": "8c82d0bd31299dbff7f8e780f5e06d2283de9678" },
"nvim-dap": { "branch": "master", "commit": "99807078c5089ed30e0547aa4b52c5867933f426" },
"nvim-dap-ui": { "branch": "master", "commit": "0d5c37a43bc039c42a0a9bf801e53f77adf06a24" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "df66808cd78b5a97576bbaeee95ed5ca385a9750" },
"nvim-lsp-installer": { "branch": "main", "commit": "17e0bfa5f2c8854d1636fcd036dc8284db136baa" },
"nvim-lspconfig": { "branch": "master", "commit": "d1871c84b218931cc758dbbde1fec8e90c6d465c" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
"nvim-dap": { "branch": "master", "commit": "7891b01beedc37cef4eaf2e92563bd0a5b6e9c58" },
"nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
"nvim-notify": { "branch": "master", "commit": "22f29093eae7785773ee9d543f8750348b1a195c" },
"nvim-treesitter": { "branch": "master", "commit": "07bd1b53bf465e42d53253b48b7437892d6c45e8" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" },
"nvim-web-devicons": { "branch": "master", "commit": "aafa5c187a15701a7299a392b907ec15d9a7075f" },
"nvim-notify": { "branch": "master", "commit": "397c7c1184745fca649e5104de659e6392ef5a4d" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "71385f191ec06ffc60e80e6b0c9a9d5daed4824c" },
"nvim-web-devicons": { "branch": "master", "commit": "6e51ca170563330e063720449c21f43e27ca0bc1" },
"outline.nvim": { "branch": "main", "commit": "0eb9289ab39c91caf8b3ed0e3a17764809d69558" },
"pathlib.nvim": { "branch": "main", "commit": "57e5598af6fe253761c1b48e0b59b7cd6699e2c1" },
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
"plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" },
"rose-pine": { "branch": "main", "commit": "42f0724e0bca9f57f0bcfa688787c37b8d4befe8" },
"rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" },
"rose-pine": { "branch": "main", "commit": "72a04c4065345b51b56aed4859ea1d884f734097" },
"rust.vim": { "branch": "master", "commit": "889b9a7515db477f4cb6808bef1769e53493c578" },
"smart-open.nvim": { "branch": "0.2.x", "commit": "7770b01ce4d551c143d7ec8589879320796621b9" },
"sqlite.lua": { "branch": "master", "commit": "b487fcc8937b683942a1f7d9662fcf50ca5acd58" },
"symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" },
"tagbar": { "branch": "master", "commit": "8de7694c0aeda253073098bbc9fb890b2902ddb8" },
"rustaceanvim": { "branch": "master", "commit": "12504405821c05874d2d1f6b5ec919f9808e2c99" },
"smart-open.nvim": { "branch": "0.2.x", "commit": "560d8f16e17977c8303db6f9660db58a4415ca41" },
"sqlite.lua": { "branch": "master", "commit": "50092d60feb242602d7578398c6eb53b4a8ffe7b" },
"tagbar": { "branch": "master", "commit": "2ef4ecba94440fcf8a8c692a0f2b36b332f1f0f2" },
"telescope-dap.nvim": { "branch": "master", "commit": "783366bd6c1e7fa0a5c59c07db37f49c805a28df" },
"telescope-egrepify.nvim": { "branch": "master", "commit": "a8070970a661330c4e00450d25f874f6c2b00af9" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" },
"telescope.nvim": { "branch": "master", "commit": "415af52339215926d705cccc08145f3782c4d132" },
"telescope-egrepify.nvim": { "branch": "master", "commit": "8da5e3ba5faf3bdd6bbfaccb3eb3b8e7ebf9b131" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
"vim-dispatch": { "branch": "master", "commit": "a2ff28abdb2d89725192db5b8562977d392a4d3f" },
"vim-easy-align": { "branch": "master", "commit": "9815a55dbcd817784458df7a18acacc6f82b1241" },
"vim-fugitive": { "branch": "master", "commit": "d74a7cff4cfcf84f83cc7eccfa365488f3bbabc2" },
"vim-gitgutter": { "branch": "main", "commit": "7b0b5098e3e57be86bb96cfbf2b8902381eef57c" },
"vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" },
"vim-gitgutter": { "branch": "main", "commit": "488c0555e47e2aabe273c635f7dd233e985311a6" },
"vim-highlightedyank": { "branch": "master", "commit": "285a61425e79742997bbde76a91be6189bc988fb" },
"vim-projectionist": { "branch": "master", "commit": "5ff7bf79a6ef741036d2038a226bcb5f8b1cd296" },
"vim-sneak": { "branch": "master", "commit": "c13d0497139b8796ff9c44ddb9bc0dc9770ad2dd" },
"vim-sneak": { "branch": "master", "commit": "18b1faf020e6a66c1ce09b3ff5e6b6feb182973b" },
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
"vim-test": { "branch": "master", "commit": "844b51ee092ee4bd5f9b140874c1568751b6f37c" }
"vim-test": { "branch": "master", "commit": "8c76f6c0953edaa13a37c29ac9c6a7bb56ddce89" }
}

View File

@@ -6,7 +6,6 @@ local source_mapping = {
nvim_lsp = "[LSP]",
nvim_lua = "[Lua]",
path = "[Path]",
jira = "[Jira]",
}
local has_words_before = function()
@@ -21,23 +20,24 @@ cmp.setup({
snippet = {
expand = function(args)
vim.snippet.expand(args.body)
end
end,
},
mapping = {
['<C-p>'] = cmp.mapping(cmp.mapping.select_prev_item(), { 'i', 'c' }),
['<C-n>'] = cmp.mapping(cmp.mapping.select_next_item(), { 'i', 'c' }),
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(),
['<CR>'] = cmp.mapping.confirm {
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.close(),
["<CR>"] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = false, -- only replace if explicitly selected
select = false, -- only confirm if explicitly selected
},
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif vim.snippet.jumpable(1) then
elseif vim.snippet.active({ direction = 1 }) then
vim.snippet.jump(1)
elseif has_words_before() then
cmp.complete()
@@ -49,33 +49,34 @@ cmp.setup({
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif vim.snippet.jumpable(-1) then
elseif vim.snippet.active({ direction = -1 }) then
vim.snippet.jump(-1)
else
fallback()
end
end, { "i", "s" })
end, { "i", "s" }),
},
sources = cmp.config.sources({
{ name = 'luasnip' },
{ name = 'nvim_lsp' },
{ name = "nvim_lsp" },
}, {
{ name = 'buffer'}
{ name = "buffer" },
}),
formatting = {
format = function(entry, vim_item)
vim_item.kind = lspkind.presets.default[vim_item.kind]
local menu = source_mapping[entry.source.name]
vim_item.menu = menu
return vim_item
end
end,
},
experimental = {
ghost_text = false,
}
},
})
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ '/', '?' }, {
sources = {

View File

@@ -11,7 +11,6 @@ else
-- require('halfdan.globals')
require('halfdan.keymap')
require('halfdan.cmp')
-- require('halfdan.luasnip')
require('halfdan.colorscheme')
require('halfdan.treesitter')
require('halfdan.telescope')

View File

@@ -51,10 +51,12 @@ require("lazy").setup({
{
"nvim-neotest/neotest",
dependencies = {
"nvim-neotest/nvim-nio",
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
"antoinemadec/FixCursorHold.nvim",
-- plugins
"nvim-neotest/neotest-go",
"jfpedroza/neotest-elixir",
"rouge8/neotest-rust",
}
@@ -146,20 +148,16 @@ require("lazy").setup({
{'machakann/vim-highlightedyank'},
-- LSP / Language Server Protocol
{
'neovim/nvim-lspconfig',
'williamboman/nvim-lsp-installer',
},
{
'nvimdev/lspsaga.nvim',
config = function()
require('lspsaga').setup({
symbol_in_winbar = {
enable = false,
},
code_action = {
lightbulb = { enable = false }
}
})
end,
dependencies = {
@@ -184,16 +182,17 @@ require("lazy").setup({
-- Used to display LSP status in Lualine
{'nvim-lua/lsp-status.nvim'},
-- null-ls for a collection of LSP-like plugins
{
"jose-elias-alvarez/null-ls.nvim",
config = function()
require("null-ls").setup()
end,
dependencies = { "nvim-lua/plenary.nvim" },
"hedyhli/outline.nvim",
lazy = true,
cmd = { "Outline", "OutlineOpen" },
keys = { -- Example mapping to toggle outline
{ "<leader>o", "<cmd>Outline<CR>", desc = "Toggle outline" },
},
opts = {
-- Your setup opts here
},
},
{'simrat39/symbols-outline.nvim', config=true},
{
'numToStr/Comment.nvim',
config = function()
@@ -218,7 +217,6 @@ require("lazy").setup({
},
{'numToStr/FTerm.nvim'},
{'theprimeagen/git-worktree.nvim'},
{'theprimeagen/harpoon'},
-- Debugging
@@ -229,39 +227,14 @@ require("lazy").setup({
-- => Language Support
{'rust-lang/rust.vim'},
{'simrat39/rust-tools.nvim'},
{
"elixir-tools/elixir-tools.nvim",
version = "*",
event = { "BufReadPre", "BufNewFile" },
config = function()
local elixir = require("elixir")
local elixirls = require("elixir.elixirls")
--
elixir.setup {
nextls = {enable = false},
credo = {},
elixirls = {
enable = true,
settings = elixirls.settings {
dialyzerEnabled = false,
enableTestLenses = true,
},
on_attach = function()
vim.keymap.set("n", "<space>fp", ":ElixirFromPipe<cr>", { buffer = true, noremap = true })
vim.keymap.set("n", "<space>tp", ":ElixirToPipe<cr>", { buffer = true, noremap = true })
vim.keymap.set("v", "<space>em", ":ElixirExpandMacro<cr>", { buffer = true, noremap = true })
end,
}
}
end,
dependencies = {
"nvim-lua/plenary.nvim",
},
'mrcjkb/rustaceanvim',
version = '^6', -- Recommended
lazy = false, -- This plugin is already lazy
},
{'tpope/vim-projectionist'},
-- themes & colorschemes
-- {'gruvbox-community/gruvbox'},
{ "rose-pine/neovim", name = "rose-pine" },
{'luisiacc/gruvbox-baby'},
{'akinsho/bufferline.nvim', version = "*", dependencies = 'nvim-tree/nvim-web-devicons',

View File

@@ -1,6 +0,0 @@
-- local luasnip = require('luasnip')
luasnip.config.set_config {
history = true,
updateevents = "TextChanged,TextChangedI"
}

View File

@@ -61,7 +61,6 @@ require('telescope').setup {
},
}
require("telescope").load_extension("git_worktree")
require('telescope').load_extension("fzf")
require('telescope').load_extension("dap")
require('telescope').load_extension("smart_open")

View File

@@ -3,7 +3,7 @@ if vim.g.vscode then
end
require('nvim-treesitter.configs').setup({
ensure_installed = { "python", "go", "elixir", "heex", "rust", "gomod", "json", "lua", "yaml", "norg", "query", "markdown", "markdown_inline", "gleam"},
ensure_installed = { "python", "go", "elixir", "heex", "rust", "gomod", "json", "lua", "yaml", "norg", "query", "markdown", "markdown_inline", "gleam", "zig", "odin"},
ignore_install = { "haskell" },
highlight = {
enable = true,