From 1414292741a72f59ce5823ebf0c97d90a3e0488a Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 22 Jul 2016 01:15:57 -0500 Subject: [PATCH] nostartofline --- vim/config/init.vim | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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!