diff --git a/init.lua b/init.lua index cb145bb..db27bb1 100755 --- a/init.lua +++ b/init.lua @@ -15,3 +15,4 @@ require('plugins/symbols-outline') require('plugins/nvim-lsp-installer') require('plugins/neoscroll') require('plugins/marks') +require('plugins/toggleterm') diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 892173d..0dd4829 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -6,6 +6,7 @@ local default_opts = { noremap = true, silent = true } -- Fast saving with and s map('n', 's', ':w', default_opts) +map('n', 'a', ':w|:luafile %', default_opts) map('i', 's', ':w', default_opts) -- Move around splits using Ctrl + {h,j,k,l} @@ -27,8 +28,9 @@ map('n', 'r', ':tabclose', default_opts) -- Applications and Plugins shortcuts ----------------------------------------------------------- --- Open terminal --- map('n', '', ':Term', { noremap = true }) +-- Open terminal as Float +--map('n', '', ':ToggleTerm dir=/Users/normrasmussen/ direction=float', default_opts) + -- Vista Shortcuts map('n', 'v', ':Vista!!', default_opts) -- show Vista panel diff --git a/lua/plugins/plugins.lua b/lua/plugins/plugins.lua index 192242e..f18317e 100755 --- a/lua/plugins/plugins.lua +++ b/lua/plugins/plugins.lua @@ -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' }, diff --git a/lua/plugins/toggleterm.lua b/lua/plugins/toggleterm.lua new file mode 100644 index 0000000..24a3dd6 --- /dev/null +++ b/lua/plugins/toggleterm.lua @@ -0,0 +1,36 @@ +local status_ok, toggleterm = pcall(require, "toggleterm") +if not status_ok then + return +end + +toggleterm.setup({ + size = 20, + open_mapping = [[]], + 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', '', [[]], opts) + vim.api.nvim_buf_set_keymap(0, 't', 'jk', [[]], opts) + vim.api.nvim_buf_set_keymap(0, 't', '', [[h]], opts) + vim.api.nvim_buf_set_keymap(0, 't', '', [[j]], opts) + vim.api.nvim_buf_set_keymap(0, 't', '', [[k]], opts) + vim.api.nvim_buf_set_keymap(0, 't', '', [[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 }) diff --git a/plugin/packer_compiled.lua b/plugin/packer_compiled.lua index 1ae5c8a..69ae326 100644 --- a/plugin/packer_compiled.lua +++ b/plugin/packer_compiled.lua @@ -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)