Browse Source

keybindings: added toggleterm with F keys

my-config
NTBBloodbath 4 years ago
parent
commit
27a6b93b29
No known key found for this signature in database GPG Key ID: 18D6730BC846AAC5
  1. 7
      autoload/doom/functions.vim
  2. 19
      config/keybindings.vim
  3. 9
      config/plugins/leader-mapper.vim

7
autoload/doom/functions.vim

@ -22,6 +22,13 @@ function! doom#functions#get_root() abort
return root return root
endfunction endfunction
" ToggleTerm custom function to avoid having
" line numbers inside the terminal buffer
" because that is not from God.
function! doom#functions#toggle_terminal() abort
execute "ToggleTerm"
set nonumber norelativenumber
endfunction
function! doom#functions#quit_doom(write, force) abort function! doom#functions#quit_doom(write, force) abort
try try

19
config/keybindings.vim

@ -22,9 +22,10 @@ let g:mapleader = " "
" ESC = Search highlighting off " " ESC = Search highlighting off "
" F2 = Toggle Tagbar " " F2 = Toggle Tagbar "
" F3 = Toggle Tree Explorer " " F3 = Toggle Tree Explorer "
" F4 = Toggle Minimap " " F4 = Toggle Terminal "
" F5 = Toggle distraction-free " " F5 = Toggle Minimap "
" F6 = Run dot-http " " F6 = Toggle distraction-free "
" F7 = Run dot-http "
" " " "
"========================================" "========================================"
@ -58,14 +59,18 @@ endif
if index(g:doom_disabled_plugins, 'tree') == -1 if index(g:doom_disabled_plugins, 'tree') == -1
nnoremap <F3> :NvimTreeToggle<CR> nnoremap <F3> :NvimTreeToggle<CR>
endif endif
if index(g:doom_disabled_plugins, 'terminal') == -1
nnoremap <F4> :call doom#functions#toggle_terminal()<CR>
endif
if index(g:doom_disabled_plugins, 'minimap') == -1 if index(g:doom_disabled_plugins, 'minimap') == -1
nnoremap <F4> :MinimapToggle<CR> nnoremap <F5> :MinimapToggle<CR>
endif endif
if index(g:doom_disabled_plugins, 'goyo') == -1 if index(g:doom_disabled_plugins, 'goyo') == -1
nnoremap <F5> :Goyo<CR> nnoremap <F6> :Goyo<CR>
endif endif
if index(g:doom_disabled_modules, 'web') == -1 if index(g:doom_disabled_modules, 'web') == -1 \
nnoremap <F6> :DotHttp<CR> && index(g:doom_disabled_plugins, 'restclient') == -1
nnoremap <F7> :DotHttp<CR>
endif endif
"=====================" "====================="

9
config/plugins/leader-mapper.vim

@ -204,13 +204,6 @@ function ToggleNumbers()
set number! set number!
endif endif
endfunction endfunction
" ToggleTerm custom function to avoid having
" line numbers inside the terminal buffer
" because that is not from God.
function ToggleTerm()
execute "ToggleTerm"
set nonumber norelativenumber
endfunction
" Toggle Menu " Toggle Menu
let g:lmap.t = {'name': 'Toggler Menu'} let g:lmap.t = {'name': 'Toggler Menu'}
" Toggle Line Numbers " Toggle Line Numbers
@ -239,7 +232,7 @@ if index(g:doom_disabled_plugins, 'vista') == -1
endif endif
if index(g:doom_disabled_plugins, 'toggleterm') == -1 if index(g:doom_disabled_plugins, 'toggleterm') == -1
" Open a new terminal " Open a new terminal
nnoremap <leader>tt :call ToggleTerm()<CR> nnoremap <leader>tt :call doom#functions#toggle_terminal()<CR>
let g:lmap.t.t = 'Toggle terminal' let g:lmap.t.t = 'Toggle terminal'
endif endif

Loading…
Cancel
Save