This commit is contained in:
iofq 2024-08-21 00:30:13 -05:00
parent b0cd1f6bb8
commit 4ceceff9bf
7 changed files with 22 additions and 30 deletions

View file

@ -17,7 +17,6 @@ with final.pkgs.lib; let
mkNeovim = pkgs.callPackage ./mkNeovim.nix { inherit pkgs-wrapNeovim; }; mkNeovim = pkgs.callPackage ./mkNeovim.nix { inherit pkgs-wrapNeovim; };
all-plugins = with pkgs.vimPlugins; [ all-plugins = with pkgs.vimPlugins; [
aerial-nvim
cmp-buffer cmp-buffer
cmp-cmdline cmp-cmdline
cmp-nvim-lsp cmp-nvim-lsp
@ -98,7 +97,6 @@ with final.pkgs.lib; let
gopls gopls
lua-language-server lua-language-server
nil nil
phpactor
python312Packages.jedi-language-server python312Packages.jedi-language-server
# debuggers # debuggers
@ -115,6 +113,10 @@ in {
plugins = all-plugins; plugins = all-plugins;
appName = "nvim"; appName = "nvim";
extraPackages = basePackages; extraPackages = basePackages;
ignoreConfigRegexes = [
"*/lsp.lua"
"*/debug.lua"
];
}; };
nvim-luarc-json = final.mk-luarc-json { nvim-luarc-json = final.mk-luarc-json {

View file

@ -1,9 +1,8 @@
vim.opt.backspace = 'indent,eol,start' vim.opt.backspace = 'indent,eol,start'
vim.opt.clipboard = 'unnamedplus' vim.opt.clipboard = 'unnamedplus'
vim.opt.completeopt = 'menuone' vim.opt.completeopt = {'menu', 'menuone', 'noselect'}
vim.opt.expandtab = true -- insert tabs as spaces vim.opt.expandtab = true -- insert tabs as spaces
vim.opt.inccommand = 'split' -- incremental live completion vim.opt.inccommand = 'split' -- incremental live completion
vim.opt.laststatus = 1
vim.opt.list = true vim.opt.list = true
vim.opt.nrformats:append('alpha') -- let Ctrl-a do letters as well vim.opt.nrformats:append('alpha') -- let Ctrl-a do letters as well
vim.opt.path:append('**') -- enable fuzzy :find ing vim.opt.path:append('**') -- enable fuzzy :find ing

View file

@ -19,22 +19,21 @@ return {
require('luasnip').lsp_expand(args.body) require('luasnip').lsp_expand(args.body)
end, end,
}, },
experimental = {
native_menu = false,
ghost_text = true,
},
mapping = cmp.mapping.preset.insert { mapping = cmp.mapping.preset.insert {
['<C-j>'] = cmp.mapping.scroll_docs(-4), ['<C-u>'] = cmp.mapping.scroll_docs(-4),
['<C-k>'] = cmp.mapping.scroll_docs(4), ['<C-d>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(), ['<C-n>'] = cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Insert },
['<esc>'] = cmp.mapping.abort(), ['<C-p>'] = cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Insert },
['<CR>'] = cmp.mapping.confirm { select = true }, -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. ['<C-Space>'] = cmp.mapping.confirm {
select = true,
behavior = cmp.SelectBehavior.Insert
},
}, },
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = 'nvim_lsp' }, { name = 'nvim_lsp', keyword_length = 1 },
{ name = 'luasnip' }, { name = 'luasnip' },
}, {
{ name = 'buffer' }, { name = 'buffer' },
{ name = 'path' },
}), }),
} }
@ -68,13 +67,13 @@ return {
} }
require('luasnip.loaders.from_vscode').lazy_load() require('luasnip.loaders.from_vscode').lazy_load()
vim.keymap.set({ 'i', 's' }, '<C-K>', function() vim.keymap.set({ 'i', 's' }, '<C-J>', function()
if ls.expand_or_jumpable() then if ls.expand_or_jumpable() then
ls.expand_or_jump() ls.expand_or_jump()
end end
end, { silent = true }) end, { silent = true })
vim.keymap.set({ 'i', 's' }, '<C-J>', function() vim.keymap.set({ 'i', 's' }, '<C-K>', function()
if ls.jumpable(-1) then if ls.jumpable(-1) then
ls.jump(-1) ls.jump(-1)
end end
@ -85,14 +84,6 @@ return {
ls.change_choice(1) ls.change_choice(1)
end end
end, { silent = true }) end, { silent = true })
--------------------
-- Snippets --
--------------------
local fmta = require('luasnip.extras.fmt').fmta
ls.add_snippets('go', {
ls.snippet('ie', fmta('if err != nil {\n\treturn <err>\n}', { err = ls.insert_node(1, 'err') })),
})
end, end,
}, },
} }

View file

@ -68,7 +68,6 @@ return {
} }
lspconfig.jedi_language_server.setup {} lspconfig.jedi_language_server.setup {}
lspconfig.nil_ls.setup {} lspconfig.nil_ls.setup {}
lspconfig.phpactor.setup {}
lspconfig.lua_ls.setup { lspconfig.lua_ls.setup {
on_init = function(client) on_init = function(client)
local path = client.workspace_folders[1].name local path = client.workspace_folders[1].name

View file

@ -1,7 +1,7 @@
return { return {
{ {
'echasnovski/mini.nvim', 'echasnovski/mini.nvim',
event = "VeryLazy", lazy = false,
config = function() config = function()
require('mini.ai').setup() require('mini.ai').setup()
require('mini.comment').setup() require('mini.comment').setup()
@ -28,6 +28,7 @@ return {
return summary return summary
end end
local diagnostics = MiniStatusline.section_diagnostics { trunc_width = 75 } local diagnostics = MiniStatusline.section_diagnostics { trunc_width = 75 }
local lsp = MiniStatusline.section_lsp { trunc_width = 75 }
local filename = MiniStatusline.section_filename { trunc_width = 140 } local filename = MiniStatusline.section_filename { trunc_width = 140 }
local search = MiniStatusline.section_searchcount { trunc_width = 75 } local search = MiniStatusline.section_searchcount { trunc_width = 75 }
@ -36,7 +37,7 @@ return {
'%<', -- Mark general truncate point '%<', -- Mark general truncate point
{ hl = 'MiniStatuslineFilename', strings = { filename } }, { hl = 'MiniStatuslineFilename', strings = { filename } },
'%=', -- End left alignment '%=', -- End left alignment
{ hl = 'MiniStatusDevinfo', strings = { git(), diff(), diagnostics } }, { hl = 'MiniStatusDevinfo', strings = { git(), diff(), diagnostics, lsp} },
{ hl = mode_hl, strings = { search } }, { hl = mode_hl, strings = { search } },
} }
end, end,

View file

@ -24,7 +24,7 @@ return {
}, },
{ {
'OXY2DEV/markview.nvim', 'OXY2DEV/markview.nvim',
lazy = false, event = 'VeryLazy',
dependencies = { dependencies = {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
"nvim-tree/nvim-web-devicons" "nvim-tree/nvim-web-devicons"

View file

@ -1,7 +1,7 @@
return { return {
{ {
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
event = 'VeryLazy', lazy = false,
dependencies = { dependencies = {
'nvim-treesitter/nvim-treesitter-context', 'nvim-treesitter/nvim-treesitter-context',
'nvim-treesitter/nvim-treesitter-textobjects', 'nvim-treesitter/nvim-treesitter-textobjects',