Terminal & git bindings

master
Jef Roosens 2020-08-20 14:29:03 +02:00
parent aa00a2dcae
commit cfc2d2784f
6 changed files with 42 additions and 11 deletions

View File

@ -1,5 +0,0 @@
let g:netrw_dirhistmax =10
let g:netrw_dirhistcnt =3
let g:netrw_dirhist_3='/home/jjr/work/suzybot'
let g:netrw_dirhist_2='/home/jjr/work/suzybot/suzybot'
let g:netrw_dirhist_1='/home/jjr/work/suzybot'

View File

@ -17,3 +17,6 @@ inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>" inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
" Select first option if no option is selected on enter " Select first option if no option is selected on enter
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm() : "\<C-g>u\<CR>" inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm() : "\<C-g>u\<CR>"
" Project refactoring keybinding
nnoremap <silent> <leader>pwr :CocSearch <C-R>=expand("<cword>")<CR><CR>

View File

@ -6,4 +6,7 @@ nnoremap <silent> <leader>gc :Gcommit<CR>
" Push " Push
nnoremap <silent> <leader>gp :Gpush<CR> nnoremap <silent> <leader>gp :Gpush<CR>
" Show diffs " Show diffs
nnoremap <silent> <leader>gd :Gdiffsplit<CR> nnoremap <silent> <leader>gd :Gdiffsplit!<CR>
" Easily resolve merges
nnoremap <silent> <leader>gh :diffget //2<CR>
nnoremap <silent> <leader>gl :diffget //3<CR>

View File

@ -51,11 +51,6 @@ nnoremap <silent> <leader>u :tabprevious<CR>
nnoremap <silent> <leader>mr :make! run<CR> nnoremap <silent> <leader>mr :make! run<CR>
nnoremap <silent> <leader>mt :make! test<CR> nnoremap <silent> <leader>mt :make! test<CR>
" Built-in Terminal
" Remap <Esc> in terminal
tnoremap <silent> <Esc> <C-\><C-n>
" Open terminal in horizontal split
nnoremap <silent> <leader><CR> :split<CR>:terminal<CR>
" Keybinding for switching between light/dark colorschemes " Keybinding for switching between light/dark colorschemes
function! ColorschemeToggle() function! ColorschemeToggle()
@ -77,3 +72,16 @@ nnoremap <silent> <leader>ve :split<CR>:exec 'CtrlP ' . fnamemodify($MYVIMRC, ':
" Overwrite Esc (experiment) " Overwrite Esc (experiment)
inoremap jk <Esc> inoremap jk <Esc>
inoremap <Esc> <nop> inoremap <Esc> <nop>
" Switch between 2 files quickly
nnoremap <leader>a <C-^>
" Terminal keybindings
" 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>

20
init/netrw.vim 100644
View File

@ -0,0 +1,20 @@
" Open in tree view by default
let g:netrw_liststyle = 3
" Hide banner at the top
let g:netrw_banner = 0
" Change how netrc opens files
" 1 - horizontal split
" 2 - vertical split
" 3 - new tab
" 4 - previous window
let g:netrw_browse_split = 4
" Width of the view
let g:netrw_winsize = 15
" Start netrc on startup
augroup netrc
autocmd!
augroup END

View File

@ -36,4 +36,6 @@ Plug 'hynek/vim-python-pep8-indent'
" Text object based on current indent level (e.g. Python) " Text object based on current indent level (e.g. Python)
Plug 'michaeljsmith/vim-indent-object' Plug 'michaeljsmith/vim-indent-object'
Plug 'scrooloose/nerdtree'
call plug#end() call plug#end()