Mercurial > dotfiles
comparison dot_config/nvim/config.lua @ 338:890fe7d01f19
Use toggleterm as more robust terminal integration
author | zegervdv <zegervdv@me.com> |
---|---|
date | Fri, 22 Jan 2021 21:58:01 +0100 |
parents | e89bdbc1a2dd |
children | fbec60e4ee05 |
comparison
equal
deleted
inserted
replaced
337:e89bdbc1a2dd | 338:890fe7d01f19 |
---|---|
107 use {'justinmk/vim-dirvish'} | 107 use {'justinmk/vim-dirvish'} |
108 | 108 |
109 -- Colorscheme | 109 -- Colorscheme |
110 use {'zegervdv/nvcode-color-schemes.vim'} | 110 use {'zegervdv/nvcode-color-schemes.vim'} |
111 | 111 |
112 -- Terminal | |
113 use {'akinsho/nvim-toggleterm.lua'} | |
114 | |
112 end) | 115 end) |
113 end | 116 end |
117 | |
118 require'toggleterm'.setup { | |
119 size = 20, | |
120 open_mapping = [[+]], | |
121 shade_filetypes = {}, | |
122 shade_terminals = true, | |
123 persist_size = true, | |
124 direction = 'horizontal', | |
125 } | |
114 | 126 |
115 -- This came from https://github.com/tjdevries/config_manager/blob/master/xdg_config/nvim/lua/lsp_config.lua | 127 -- This came from https://github.com/tjdevries/config_manager/blob/master/xdg_config/nvim/lua/lsp_config.lua |
116 local mapper = function(mode, key, result, noremap) | 128 local mapper = function(mode, key, result, noremap) |
117 if noremap == nil then | 129 if noremap == nil then |
118 noremap = true | 130 noremap = true |
119 end | 131 end |
120 vim.fn.nvim_buf_set_keymap(0, mode, key, result, {noremap=noremap, silent=true}) | 132 vim.fn.nvim_buf_set_keymap(0, mode, key, result, {noremap=noremap, silent=true}) |
121 end | 133 end |
122 | |
123 -- Terminal | |
124 vim.cmd "nnoremap <silent> <c-z> <cmd>lua require'terminal'.toggle()<CR>" | |
125 vim.cmd "tnoremap <silent> <c-z> <c-\\><c-n>:lua require'terminal'.toggle()<CR>" | |
126 | 134 |
127 -- LSP and Treesitter config | 135 -- LSP and Treesitter config |
128 | 136 |
129 local lsp = require'lspconfig' | 137 local lsp = require'lspconfig' |
130 local lsputil = require'lspconfig.util' | 138 local lsputil = require'lspconfig.util' |