Add nvterm among other things

This commit is contained in:
Graham McMillan 2024-06-12 17:20:54 +02:00
parent 1645f2fbe9
commit de52bc6ece
7 changed files with 114 additions and 31 deletions

View file

@ -1,7 +0,0 @@
return {
{
'catppuccin/nvim',
name = 'catppuccin',
priority = 1000,
},
}

View file

@ -0,0 +1,14 @@
return {
{
'catppuccin/nvim',
name = 'catppuccin',
lazy = false,
priority = 1000,
opts = {
flavour = 'mocha',
},
config = function()
vim.cmd.colorscheme 'catppuccin'
end,
},
}

View file

@ -0,0 +1,4 @@
return {
'github/copilot.vim',
enabled = false,
}

View file

@ -0,0 +1,24 @@
return {
{
'nvim-lualine/lualine.nvim',
dependencies = {
'nvim-tree/nvim-web-devicons',
},
config = function()
require('lualine').setup {
options = {
theme = 'dracula',
section_separators = '',
component_separators = '',
},
sections = {
lualine_a = {
'mode',
'buffers',
},
lualine_c = {},
},
}
end,
},
}

View file

@ -1,6 +1,7 @@
return {
{
'NeogitOrg/neogit',
version = 'v0.0.1', -- Version required for nvim 0.9.5
dependencies = {
'nvim-lua/plenary.nvim',
'sindrets/diffview.nvim',

View file

@ -0,0 +1,47 @@
return {
{
'NvChad/nvterm',
config = function()
require('nvterm').setup()
local ft_cmds = {
python = 'python3' .. vim.fn.expand '%',
}
local terminal = require 'nvterm.terminal'
local toggle_modes = { 'n', 't' }
local mappings = {
{
'n',
'<C-l>',
function()
terminal.send(ft_cmds[vim.bo.filetype])
end,
},
{
toggle_modes,
'<A-h>',
function()
terminal.toggle 'horizontal'
end,
},
{
toggle_modes,
'<A-v>',
function()
terminal.toggle 'vertical'
end,
},
{
toggle_modes,
'<A-i>',
function()
terminal.toggle 'float'
end,
},
}
local opts = { noremap = true, silent = true }
for _, mapping in ipairs(mappings) do
vim.keymap.set(mapping[1], mapping[2], mapping[3], opts)
end
end,
},
}