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'
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) " Use Bash as shell for internal Vim commands (fish is slow)
set shell=/bin/bash set shell=/bin/bash

View file

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