Update neovim config

This commit is contained in:
Mikkel Svartveit 2025-09-27 16:07:39 +02:00
parent 9a53d8fa76
commit a5008165d3
2 changed files with 32 additions and 22 deletions

View file

@ -76,12 +76,6 @@ nnoremap <expr> gP (v:register ==# '"' ? '"+' : '') . 'P'
xnoremap <expr> gp (v:register ==# '"' ? '"+' : '') . 'p'
xnoremap <expr> gP (v:register ==# '"' ? '"+' : '') . 'P'
" Press Enter to clear search highlighting
" nnoremap <silent><CR> :nohlsearch<CR>
" Fix terminal cursor after exiting
" au VimLeave * set guicursor=a:ver100
" Use Bash as shell for internal Vim commands (fish is slow)
set shell=/bin/bash

View file

@ -81,8 +81,17 @@ require("lazy").setup({
-- Enter key confirms completion item
["<CR>"] = cmp.mapping.confirm({ select = false }),
-- Ctrl + space triggers completion menu
-- Ctrl + space triggers LSP completion menu
["<C-Space>"] = cmp.mapping.complete(),
-- Ctrl + a triggers AI autocompletion
["<C-a>"] = cmp.mapping.complete({
config = {
sources = {
{ name = "supermaven" },
},
},
}),
}),
snippet = {
expand = function(args)
@ -171,16 +180,14 @@ require("lazy").setup({
-- AI autocompletion
{
"supermaven-inc/supermaven-nvim",
config = function()
init = function()
vim.api.nvim_create_user_command("CPE", "SupermavenStart", {})
vim.api.nvim_create_user_command("CPD", "SupermavenStop", {})
require("supermaven-nvim").setup({})
-- Disable on startup
local api = require("supermaven-nvim.api")
api.stop()
end,
config = function()
require("supermaven-nvim").setup({
disable_inline_completion = true,
})
end,
},
@ -199,11 +206,21 @@ require("lazy").setup({
},
},
config = true,
keys = {
{ "<C-,>", "<cmd>ClaudeCodeFocus<cr>", mode = { "n", "v", "i", "t" }, desc = "Toggle Claude" },
{ "<C-.>", "<cmd>ClaudeCodeSend<cr>", mode = "v", desc = "Send to Claude" },
},
init = function()
vim.keymap.set(
{ "n", "v", "i", "t" },
"<C-,>",
"<cmd>ClaudeCodeFocus<CR>",
{ noremap = true, silent = true }
)
vim.keymap.set(
{ "n", "v", "i", "t" },
"<C-.>",
"<cmd>ClaudeCodeSend<CR>",
{ noremap = true, silent = true }
)
-- Update buffer when Claude Code has made changes
vim.api.nvim_create_autocmd({
"BufEnter",
@ -331,9 +348,8 @@ require("lazy").setup({
mode = "toggleterm",
filetype = {
python = "python3",
javascript = "node",
typescript = "ts-node --esm",
c = "gcc -o main % && ./main",
javascript = "bun",
typescript = "bun",
go = "go run",
},
},