diff --git a/vim/config/init.vim b/vim/config/init.vim index 3159380..eb3584c 100644 --- a/vim/config/init.vim +++ b/vim/config/init.vim @@ -101,6 +101,7 @@ set softtabstop=2 set noexpandtab set autoindent smartindent set list +set nostartofline set listchars=trail:ยท,tab:\ \ " look and feel @@ -218,9 +219,16 @@ endif autocmd VimEnter * nested if bufname('')=='' && line('$') == 1 && col('$')==1 && !&modified | bd % | endif function! TerminalSplit() - vsplit - vertical resize 80 - terminal + let current_file = @% + echo current_file + if match(current_file, "term://*") != -1 + split + terminal + else + vsplit + vertical resize 80 + terminal + endif endfunction " bindings @@ -238,6 +246,7 @@ let mapleader = "\" " terminal mappings " open a terminal split at 80 columns nnoremap :call TerminalSplit() +tnoremap :call TerminalSplit() " close the terminal tnoremap :q!