From de52bc6ece55395f22a0e588562ce9b9207843b6 Mon Sep 17 00:00:00 2001 From: Graham McMillan <30657475+gmcmillan82@users.noreply.github.com> Date: Wed, 12 Jun 2024 17:20:54 +0200 Subject: [PATCH] Add nvterm among other things --- init.lua | 48 +++++++++++++++--------------- lua/custom/plugins/catppuccin.lua | 7 ----- lua/custom/plugins/colorscheme.lua | 14 +++++++++ lua/custom/plugins/copilot.lua | 4 +++ lua/custom/plugins/lualine.lua | 24 +++++++++++++++ lua/custom/plugins/neogit.lua | 1 + lua/custom/plugins/nvterm.lua | 47 +++++++++++++++++++++++++++++ 7 files changed, 114 insertions(+), 31 deletions(-) delete mode 100644 lua/custom/plugins/catppuccin.lua create mode 100644 lua/custom/plugins/colorscheme.lua create mode 100644 lua/custom/plugins/copilot.lua create mode 100644 lua/custom/plugins/lualine.lua create mode 100644 lua/custom/plugins/nvterm.lua diff --git a/init.lua b/init.lua index 5a8287a6..5fcfa7a7 100644 --- a/init.lua +++ b/init.lua @@ -729,7 +729,7 @@ require('lazy').setup({ -- Accept ([y]es) the completion. -- This will auto-import if your LSP supports it. -- This will expand snippets if the LSP sent a snippet. - [''] = cmp.mapping.confirm { select = true }, + -- [''] = cmp.mapping.confirm { select = true }, -- If you prefer more traditional completion keymaps, -- you can uncomment the following lines @@ -773,23 +773,23 @@ require('lazy').setup({ end, }, - { -- You can easily change to a different colorscheme. - -- Change the name of the colorscheme plugin below, and then - -- 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`. - 'folke/tokyonight.nvim', - priority = 1000, -- Make sure to load this before all the other start plugins. - init = function() - -- Load the colorscheme here. - -- Like many other themes, this one has different styles, and you could load - -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight-night' - - -- You can configure highlights by doing something like: - vim.cmd.hi 'Comment gui=none' - end, - }, + -- { -- You can easily change to a different colorscheme. + -- -- Change the name of the colorscheme plugin below, and then + -- -- 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`. + -- 'folke/tokyonight.nvim', + -- priority = 1000, -- Make sure to load this before all the other start plugins. + -- init = function() + -- -- Load the colorscheme here. + -- -- Like many other themes, this one has different styles, and you could load + -- -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. + -- -- vim.cmd.colorscheme 'tokyonight-night' + -- + -- -- You can configure highlights by doing something like: + -- vim.cmd.hi 'Comment gui=none' + -- end, + -- }, -- Highlight todo, notes, etc in comments { '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. -- You could remove this setup call if you don't like it, -- 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 - 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 -- default behavior. For example, here we set the section for -- cursor location to LINE:COLUMN - ---@diagnostic disable-next-line: duplicate-set-field - statusline.section_location = function() - return '%2l:%-2v' - end + -- ---@diagnostic disable-next-line: duplicate-set-field + -- statusline.section_location = function() + -- return '%2l:%-2v' + -- end -- ... and there is more! -- Check out: https://github.com/echasnovski/mini.nvim diff --git a/lua/custom/plugins/catppuccin.lua b/lua/custom/plugins/catppuccin.lua deleted file mode 100644 index a8f69156..00000000 --- a/lua/custom/plugins/catppuccin.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - { - 'catppuccin/nvim', - name = 'catppuccin', - priority = 1000, - }, -} diff --git a/lua/custom/plugins/colorscheme.lua b/lua/custom/plugins/colorscheme.lua new file mode 100644 index 00000000..4b0d5db9 --- /dev/null +++ b/lua/custom/plugins/colorscheme.lua @@ -0,0 +1,14 @@ +return { + { + 'catppuccin/nvim', + name = 'catppuccin', + lazy = false, + priority = 1000, + opts = { + flavour = 'mocha', + }, + config = function() + vim.cmd.colorscheme 'catppuccin' + end, + }, +} diff --git a/lua/custom/plugins/copilot.lua b/lua/custom/plugins/copilot.lua new file mode 100644 index 00000000..aec09108 --- /dev/null +++ b/lua/custom/plugins/copilot.lua @@ -0,0 +1,4 @@ +return { + 'github/copilot.vim', + enabled = false, +} diff --git a/lua/custom/plugins/lualine.lua b/lua/custom/plugins/lualine.lua new file mode 100644 index 00000000..e6c75ae2 --- /dev/null +++ b/lua/custom/plugins/lualine.lua @@ -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, + }, +} diff --git a/lua/custom/plugins/neogit.lua b/lua/custom/plugins/neogit.lua index 7f48d4d4..15876bb7 100644 --- a/lua/custom/plugins/neogit.lua +++ b/lua/custom/plugins/neogit.lua @@ -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', diff --git a/lua/custom/plugins/nvterm.lua b/lua/custom/plugins/nvterm.lua new file mode 100644 index 00000000..9b2fdbfd --- /dev/null +++ b/lua/custom/plugins/nvterm.lua @@ -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', + '', + function() + terminal.send(ft_cmds[vim.bo.filetype]) + end, + }, + { + toggle_modes, + '', + function() + terminal.toggle 'horizontal' + end, + }, + { + toggle_modes, + '', + function() + terminal.toggle 'vertical' + end, + }, + { + toggle_modes, + '', + 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, + }, +}