Improved terminal keybindings

master
Jef Roosens 2021-02-02 10:33:34 +01:00
parent e71e7f1c48
commit 6eda27510a
3 changed files with 20 additions and 9 deletions

View File

@ -80,11 +80,15 @@ inoremap <Esc> <nop>
nnoremap <leader>a <C-^>
" Terminal keybindings
" I use the terminal inside Neovim a lot, so I have some keybindings to easily
" open one
" Use jk in terminal as well
tnoremap <silent> jk <C-\><C-n>
" Open terminal in different locations
nnoremap <silent> <leader>rr :terminal<CR>
nnoremap <silent> <leader>rh :vsp<CR>:wincmd h<CR>:term<CR>
nnoremap <silent> <leader>rl :vsp<CR>:term<CR>
nnoremap <silent> <leader>rk :sp<CR>:wincmd k<CR>:term<CR>
nnoremap <silent> <leader>rj :sp<CR>:term<CR>
" I explicitely use $SHELL, because my main shell is not necessarily Bash, and
" I want to use my main shell inside Vim as well
nnoremap <silent> <leader>rr :e term://$SHELL<CR>
nnoremap <silent> <leader>rh :vsp<CR>:wincmd h<CR>:e term://$SHELL<CR>
nnoremap <silent> <leader>rl :vsp<CR>:e term://$SHELL<CR>
nnoremap <silent> <leader>rk :sp<CR>:wincmd k<CR>:e term://$SHELL<CR>
nnoremap <silent> <leader>rj :sp<CR>:e term://$SHELL<CR>

View File

@ -1,6 +1,6 @@
" Listing of paths to ignore. I think I could use something similar to CtrlP
" here as well, but I want NERDTree to also show some non-version
" controlled files
" controlled files. It ignores the following files:
" Vim
" Other IDEs
" Python
@ -12,8 +12,9 @@
let NERDTreeIgnore = [
\ '^\.vim$[[dir]]',
\ '^\.vscode$[[dir]]', '.*\.code-workspace$[[file]]', '^\.idea$[[dir]]',
\ '^__pycache__$[[dir]]', '^\.pytest_cache$[[dir]]', '^venv$[[dir]]', '\.egg-info$[[dir]]', '^dist$[[dir]]',
\ '^build$[[dir]]', '^\.eggs$[[dir]]',
\ '^__pycache__$[[dir]]', '^\.pytest_cache$[[dir]]', '^venv$[[dir]]',
\ '\.egg-info$[[dir]]', '^dist$[[dir]]', '^build$[[dir]]',
\ '^\.eggs$[[dir]]',
\ '^out$[[dir]]',
\ '^\.git$[[dir]]',
\ '^\.stack-work$[[dir]]', '\.lock$',

View File

@ -1,3 +1,9 @@
" Terminal
" As I often use non-standard shells, certain things can break if this isn't
" explicitely set
" TODO maybe use which to find the executable?
set shell=/bin/bash
" Colorscheme
" This forces (Neo)Vim to assume the terminal supports 256 colors.
" Without this, some colorschemes (including mine) don't work properly.