toggleterm fixes
This commit is contained in:
1
init.lua
1
init.lua
@ -15,3 +15,4 @@ require('plugins/symbols-outline')
|
||||
require('plugins/nvim-lsp-installer')
|
||||
require('plugins/neoscroll')
|
||||
require('plugins/marks')
|
||||
require('plugins/toggleterm')
|
||||
|
||||
@ -6,6 +6,7 @@ local default_opts = { noremap = true, silent = true }
|
||||
|
||||
-- Fast saving with <leader> and s
|
||||
map('n', '<leader>s', ':w<CR>', default_opts)
|
||||
map('n', '<leader>a', ':w|:luafile %<CR>', default_opts)
|
||||
map('i', '<leader>s', '<C-c>:w<CR>', default_opts)
|
||||
|
||||
-- Move around splits using Ctrl + {h,j,k,l}
|
||||
@ -27,8 +28,9 @@ map('n', '<leader>r', ':tabclose<CR>', default_opts)
|
||||
-- Applications and Plugins shortcuts
|
||||
-----------------------------------------------------------
|
||||
|
||||
-- Open terminal
|
||||
-- map('n', '<C-t>', ':Term<CR>', { noremap = true })
|
||||
-- Open terminal as Float
|
||||
--map('n', '<c-o>', ':ToggleTerm dir=/Users/normrasmussen/ direction=float<CR>', default_opts)
|
||||
|
||||
-- Vista Shortcuts
|
||||
map('n', '<leader>v', ':Vista!!<CR>', default_opts) -- show Vista panel
|
||||
|
||||
|
||||
@ -35,10 +35,8 @@ return require'packer'.startup(function()
|
||||
|
||||
-- Allow Popups for Telescope etc
|
||||
use 'nvim-lua/popup.nvim'
|
||||
|
||||
-- Various Color Schemes
|
||||
use 'tanvirtin/monokai.nvim'
|
||||
|
||||
-- Various Color Schemes
|
||||
use 'Mofiqul/dracula.nvim'
|
||||
use 'lunarvim/colorschemes'
|
||||
use { 'rose-pine/neovim', as = 'rose-pine' }
|
||||
@ -62,7 +60,16 @@ return require'packer'.startup(function()
|
||||
{'nvim-lua/plenary.nvim'},
|
||||
}
|
||||
}
|
||||
|
||||
-- Terminal Integration
|
||||
use {"akinsho/toggleterm.nvim",
|
||||
tag = 'v1.*',
|
||||
config = function()
|
||||
require('toggleterm').setup({
|
||||
shell = '/usr/bin/local/fish',
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
use {
|
||||
'feline-nvim/feline.nvim',
|
||||
requires = { 'kyazdani42/nvim-web-devicons' },
|
||||
|
||||
36
lua/plugins/toggleterm.lua
Normal file
36
lua/plugins/toggleterm.lua
Normal file
@ -0,0 +1,36 @@
|
||||
local status_ok, toggleterm = pcall(require, "toggleterm")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
toggleterm.setup({
|
||||
size = 20,
|
||||
open_mapping = [[<c-\>]],
|
||||
hide_numbers = true,
|
||||
shade_filetypes = {},
|
||||
shade_terminals = true,
|
||||
shading_factor = 1,
|
||||
start_in_insert = true,
|
||||
insert_mappings = true,
|
||||
persist_size = true,
|
||||
direction = "horizontal",
|
||||
close_on_exit = true,
|
||||
shell = vim.o.shell,
|
||||
})
|
||||
|
||||
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()')
|
||||
--vim.cmd('set shell=fish')
|
||||
|
||||
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local node = Terminal:new({ cmd = "node", hidden = true })
|
||||
@ -251,6 +251,12 @@ _G.packer_plugins = {
|
||||
path = "/Users/normrasmussen/.local/share/nvim/site/pack/packer/start/telescope.nvim",
|
||||
url = "https://github.com/nvim-telescope/telescope.nvim"
|
||||
},
|
||||
["toggleterm.nvim"] = {
|
||||
config = { "\27LJ\2\nY\0\0\3\0\4\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\3\0B\0\2\1K\0\1\0\1\0\1\nshell\24/usr/bin/local/fish\nsetup\15toggleterm\frequire\0" },
|
||||
loaded = true,
|
||||
path = "/Users/normrasmussen/.local/share/nvim/site/pack/packer/start/toggleterm.nvim",
|
||||
url = "https://github.com/akinsho/toggleterm.nvim"
|
||||
},
|
||||
["tokyonight.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/normrasmussen/.local/share/nvim/site/pack/packer/start/tokyonight.nvim",
|
||||
@ -284,14 +290,18 @@ _G.packer_plugins = {
|
||||
}
|
||||
|
||||
time([[Defining packer_plugins]], false)
|
||||
-- Config for: telescope.nvim
|
||||
time([[Config for telescope.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n1\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\22plugins/telescope\frequire\0", "config", "telescope.nvim")
|
||||
time([[Config for telescope.nvim]], false)
|
||||
-- Config for: nvim-autopairs
|
||||
time([[Config for nvim-autopairs]], true)
|
||||
try_loadstring("\27LJ\2\n<\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\19nvim-autopairs\frequire\0", "config", "nvim-autopairs")
|
||||
time([[Config for nvim-autopairs]], false)
|
||||
-- Config for: telescope.nvim
|
||||
time([[Config for telescope.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n1\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\22plugins/telescope\frequire\0", "config", "telescope.nvim")
|
||||
time([[Config for telescope.nvim]], false)
|
||||
-- Config for: toggleterm.nvim
|
||||
time([[Config for toggleterm.nvim]], true)
|
||||
try_loadstring("\27LJ\2\nY\0\0\3\0\4\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\3\0B\0\2\1K\0\1\0\1\0\1\nshell\24/usr/bin/local/fish\nsetup\15toggleterm\frequire\0", "config", "toggleterm.nvim")
|
||||
time([[Config for toggleterm.nvim]], false)
|
||||
if should_profile then save_profiles() end
|
||||
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user