Split out plugins and extra config

This commit is contained in:
Eric Tiedemann 2023-11-25 15:54:02 -05:00
parent 162b44a00a
commit 25a94d9353
9 changed files with 124 additions and 88 deletions

View file

@ -0,0 +1,30 @@
function _G.set_terminal_keymaps()
local opts = { noremap = true }
vim.api.nvim_buf_set_keymap(0, 't', '<esc>', [[<C-\><C-n>]], opts)
vim.api.nvim_buf_set_keymap(0, 't', 'jk', [[<C-\><C-n>]], opts)
vim.api.nvim_buf_set_keymap(0, 't', '<C-h>', [[<C-\><C-n><C-W>h]], opts)
vim.api.nvim_buf_set_keymap(0, 't', '<C-j>', [[<C-\><C-n><C-W>j]], opts)
vim.api.nvim_buf_set_keymap(0, 't', '<C-k>', [[<C-\><C-n><C-W>k]], opts)
vim.api.nvim_buf_set_keymap(0, 't', '<C-l>', [[<C-\><C-n><C-W>l]], opts)
end
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
local Terminal = require("toggleterm.terminal").Terminal
local python = Terminal:new({ cmd = "python3", hidden = true })
function _PYTHON_TOGGLE()
python:toggle()
end
require('which-key').register {
['<leader>t'] = {
name = "[T]erminal",
p = { "<cmd>lua _PYTHON_TOGGLE()<cr>", "Python" }, -- Python Terminal
f = { "<cmd>ToggleTerm direction=float<cr>", "Float" }, -- Floating Terminal
-- Play with size according to your needs.
h = { "<cmd>ToggleTerm size=10 direction=horizontal<cr>", "Horizontal" }, -- Horizontal Terminal,
v = { "<cmd>ToggleTerm size=80 direction=vertical<cr>", "Vertical" }, -- Vertical Terminal
},
}

View file

@ -0,0 +1,24 @@
-- Set up the treesitter nodes for the Python language.
local lang_utils = require("treesj.langs.utils")
local options = {
join = { space_in_brackets = false },
split = { last_separator = true },
}
require("treesj").setup(
{
use_default_keymaps = false,
langs = {
python = {
argument_list = lang_utils.set_preset_for_args(options),
assignment = { target_nodes = { "list", "set", "tuple", "dictionary" } },
call = { target_nodes = { "argument_list" } },
dictionary = lang_utils.set_preset_for_dict(options),
list = lang_utils.set_preset_for_list(options),
parameters = lang_utils.set_preset_for_args(options),
set = lang_utils.set_preset_for_list(options),
tuple = lang_utils.set_preset_for_list(options),
}
}
}
)

View file

@ -2,4 +2,7 @@
-- I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information
return {}
return {
'mg979/vim-visual-multi',
'nvim-treesitter/nvim-treesitter-context',
}

View file

@ -0,0 +1,6 @@
return {
{
'windwp/nvim-autopairs',
opts = {}
}
}

View file

@ -0,0 +1,6 @@
return {
{
'kylechui/nvim-surround',
opts = { config = {} }
}
}

View file

@ -0,0 +1,11 @@
return {
{
'nvim-tree/nvim-tree.lua',
opts = {
sort_by = "case_sensitive",
view = { width = 30, },
renderer = { group_empty = true, },
filters = { dotfiles = true, },
}
}
}

View file

@ -0,0 +1,26 @@
return {
{
'akinsho/toggleterm.nvim',
opts = {
version = "*",
size = 20,
open_mapping = [[c-\]],
hide_numbers = true,
shading_factor = 2,
start_in_insert = true,
insert_mappings = true,
persist_size = true,
direction = "float",
close_on_exit = true,
shel = vim.o.shell,
float_opts = {
border = "curved",
winblend = 0,
highlights = {
border = "Normal",
background = "Normal",
},
},
}
}
}

View file

@ -0,0 +1,7 @@
return {
{
'Wansmer/treesj',
dependencies = { 'nvim-treesitter/nvim-treesitter' },
opts = {},
},
}