mirror of
https://github.com/halfdan/dotfiles.git
synced 2025-09-10 19:56:24 +00:00
Nvim
This commit is contained in:
@@ -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
|
||||
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 = {
|
||||
|
@@ -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')
|
||||
|
@@ -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',
|
||||
|
@@ -1,6 +0,0 @@
|
||||
-- local luasnip = require('luasnip')
|
||||
luasnip.config.set_config {
|
||||
history = true,
|
||||
updateevents = "TextChanged,TextChangedI"
|
||||
}
|
||||
|
@@ -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")
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user