From b37d7b5cd8cfa8cb9569451a2d0a486d40357114 Mon Sep 17 00:00:00 2001 From: Pavel Lutskov Date: Mon, 11 Feb 2019 20:19:10 +0100 Subject: [PATCH] deal with vims without terminal. add .screenrc --- .screenrc | 5 +++++ plugin/settings.vim | 13 ++++++++----- setup.sh | 10 ++++++++++ 3 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 .screenrc diff --git a/.screenrc b/.screenrc new file mode 100644 index 0000000..c47b2e0 --- /dev/null +++ b/.screenrc @@ -0,0 +1,5 @@ +term screen-256color +hardstatus alwayslastline +hardstatus string '%w' +startup_message off +vbell off diff --git a/plugin/settings.vim b/plugin/settings.vim index 7873703..80b55fc 100644 --- a/plugin/settings.vim +++ b/plugin/settings.vim @@ -5,7 +5,7 @@ syntax enable syntax sync maxlines=100 set synmaxcol=200 -augroup customft +augroup customvimft autocmd! autocmd BufNewFile,BufRead *.vim* set filetype=vim augroup END @@ -129,10 +129,13 @@ augroup END " For Terminal " {{{ -augroup terminalsettings - autocmd! - autocmd TerminalOpen * setlocal nonu -augroup END + +if has('terminal') + augroup terminalsettings + autocmd! + autocmd TerminalOpen * setlocal nonu + augroup END +endif " }}} " Mappings diff --git a/setup.sh b/setup.sh index 556e5be..12da422 100755 --- a/setup.sh +++ b/setup.sh @@ -12,6 +12,16 @@ WARNING: if you do, the existing ~/.vimrc will be deleted! echo "Created ~/.vimrc from template"; } \ || echo "Not creating ~/.vimrc from template" +read -p " +Would you like to also use the .screenrc from this repo? +WARNING: if you do, the existing ~/.screenrc will be deleted! +[y/n]: " responce + +[[ "$responce" = "y" ]] \ + && { ln -sf "$repo/.screenrc" "$HOME/.screenrc"; \ + echo "Created a .screenrc"; } \ + || echo "Not using .screenrc from this repo." + [ -d "$HOME/.vim" ] || { mkdir "$HOME/.vim"; \ echo "Created .vim directory in your HOME"; }