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

@ -729,7 +729,7 @@ require('lazy').setup({
-- Accept ([y]es) the completion. -- Accept ([y]es) the completion.
-- This will auto-import if your LSP supports it. -- This will auto-import if your LSP supports it.
-- This will expand snippets if the LSP sent a snippet. -- This will expand snippets if the LSP sent a snippet.
['<C-y>'] = cmp.mapping.confirm { select = true }, -- ['<C-y>'] = cmp.mapping.confirm { select = true },
-- If you prefer more traditional completion keymaps, -- If you prefer more traditional completion keymaps,
-- you can uncomment the following lines -- you can uncomment the following lines
@ -773,23 +773,23 @@ require('lazy').setup({
end, end,
}, },
{ -- You can easily change to a different colorscheme. -- { -- You can easily change to a different colorscheme.
-- Change the name of the colorscheme plugin below, and then -- -- Change the name of the colorscheme plugin below, and then
-- change the command in the config to whatever the name of that colorscheme is. -- -- change the command in the config to whatever the name of that colorscheme is.
-- -- --
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. -- -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
'folke/tokyonight.nvim', -- 'folke/tokyonight.nvim',
priority = 1000, -- Make sure to load this before all the other start plugins. -- priority = 1000, -- Make sure to load this before all the other start plugins.
init = function() -- init = function()
-- Load the colorscheme here. -- -- Load the colorscheme here.
-- Like many other themes, this one has different styles, and you could load -- -- Like many other themes, this one has different styles, and you could load
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. -- -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
vim.cmd.colorscheme 'tokyonight-night' -- -- vim.cmd.colorscheme 'tokyonight-night'
--
-- You can configure highlights by doing something like: -- -- You can configure highlights by doing something like:
vim.cmd.hi 'Comment gui=none' -- vim.cmd.hi 'Comment gui=none'
end, -- end,
}, -- },
-- Highlight todo, notes, etc in comments -- Highlight todo, notes, etc in comments
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
@ -815,17 +815,17 @@ require('lazy').setup({
-- Simple and easy statusline. -- Simple and easy statusline.
-- You could remove this setup call if you don't like it, -- You could remove this setup call if you don't like it,
-- and try some other statusline plugin -- and try some other statusline plugin
local statusline = require 'mini.statusline' -- local statusline = require 'mini.statusline'
-- set use_icons to true if you have a Nerd Font -- set use_icons to true if you have a Nerd Font
statusline.setup { use_icons = vim.g.have_nerd_font } -- statusline.setup { use_icons = vim.g.have_nerd_font }
-- You can configure sections in the statusline by overriding their -- You can configure sections in the statusline by overriding their
-- default behavior. For example, here we set the section for -- default behavior. For example, here we set the section for
-- cursor location to LINE:COLUMN -- cursor location to LINE:COLUMN
---@diagnostic disable-next-line: duplicate-set-field -- ---@diagnostic disable-next-line: duplicate-set-field
statusline.section_location = function() -- statusline.section_location = function()
return '%2l:%-2v' -- return '%2l:%-2v'
end -- end
-- ... and there is more! -- ... and there is more!
-- Check out: https://github.com/echasnovski/mini.nvim -- Check out: https://github.com/echasnovski/mini.nvim

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 { return {
{ {
'NeogitOrg/neogit', 'NeogitOrg/neogit',
version = 'v0.0.1', -- Version required for nvim 0.9.5
dependencies = { dependencies = {
'nvim-lua/plenary.nvim', 'nvim-lua/plenary.nvim',
'sindrets/diffview.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,
},
}