From eeafed8f36691e04fc621aa31ccf062d74f50d08 Mon Sep 17 00:00:00 2001 From: Shaun Reed Date: Mon, 5 Aug 2019 09:38:01 +0000 Subject: [PATCH] Cleaned printf statements in setup-vim.sh --- scripts/config-vim/README.md | 43 ++++++++++++++++++++++++ scripts/config-vim/backup/.vimrc | 22 ++++++++++++ scripts/config-vim/backup/.vimrc~ | 22 ++++++++++++ scripts/config-vim/configs/.vimrc | 22 ++++++++++++ scripts/config-vim/configs/.vimrc-README | 24 +++++++++++++ scripts/setup-vim.sh | 25 +++++++------- 6 files changed, 146 insertions(+), 12 deletions(-) create mode 100644 scripts/config-vim/README.md create mode 100644 scripts/config-vim/backup/.vimrc create mode 100644 scripts/config-vim/backup/.vimrc~ create mode 100644 scripts/config-vim/configs/.vimrc create mode 100644 scripts/config-vim/configs/.vimrc-README diff --git a/scripts/config-vim/README.md b/scripts/config-vim/README.md new file mode 100644 index 0000000..817c607 --- /dev/null +++ b/scripts/config-vim/README.md @@ -0,0 +1,43 @@ +# klips +Snippets that I frequently use and share + +This repository is a collection of code snippets that I reuse, clone, or frequently refer to in regards to configurations or settings. This can be cloned as a whole and refered to locally as needed, or copied around and used to lay out templates for larger projects. + +The snippets are organized within topic-labeled folders. 'plates' is short-hand for templates, and houses all folders / projects that can be copied and edited / adjusted locally as templates for larger projects. + +Other directories could contain configuration files, bash exports, scripts, etc. + +All snippets will be listed below with the directories in the master branch. If you are not on master, I cant guarentee anything will be anywhere unless otherwise described. + +### Contents + +``` +https://github.com/shaunrd0/... + +klips/ +├──── plates/ +│ ├── cpp-cmake (Simple cpp executable template, built using cmake) +│ │ +│ └── cpp-launcher (Simple cpp launcher template, built using cmake. Easily expandable.) +│ +├──── refs/ +│ └── doxygenROT (Basic rule-of-thumb for Doxygen commenting) +│ +├──── scripts/ +│ ├── cmake-build.sh (Script to toss around and build cmake projects) +│ │ +│ ├── setup-vim.sh (Script for setting up vim configuration) +│ │ +│ └── README.md (Any instructions that might be needed for the scripts within this directory) +│ +├──── configs/ +│ ├──.vimrc (Various settings for vim, can be copied or used with setup-vim.sh) + │ + └──.vimrc-README (What these settings do, output when setup-vim.sh is ran.) + +# Copy / paste below symbols for editing this README / updating hierarchy + + │ ├ ─ └ + +``` + diff --git a/scripts/config-vim/backup/.vimrc b/scripts/config-vim/backup/.vimrc new file mode 100644 index 0000000..881a65c --- /dev/null +++ b/scripts/config-vim/backup/.vimrc @@ -0,0 +1,22 @@ +" Single-quote is a comment written to be read +" Double-quotes ("") are commented out code and can be removed or added + +" Set tabwidth=2, adjust Vim shiftwidth to the same +set tabstop=2 shiftwidth=2 + +" expandtab inserts spaces instead of tabs +set expandtab + +" autindent inserts the next line at your current depth +set autoindent + +" mouse=a allows for mouse interaction with vim when supported +set mouse=a + +" Enable Syntax Highlighting in Vim +syntax on + +" Enable Pathogen plugin manager +execute pathogen#infect() +filetype plugin indent on + diff --git a/scripts/config-vim/backup/.vimrc~ b/scripts/config-vim/backup/.vimrc~ new file mode 100644 index 0000000..881a65c --- /dev/null +++ b/scripts/config-vim/backup/.vimrc~ @@ -0,0 +1,22 @@ +" Single-quote is a comment written to be read +" Double-quotes ("") are commented out code and can be removed or added + +" Set tabwidth=2, adjust Vim shiftwidth to the same +set tabstop=2 shiftwidth=2 + +" expandtab inserts spaces instead of tabs +set expandtab + +" autindent inserts the next line at your current depth +set autoindent + +" mouse=a allows for mouse interaction with vim when supported +set mouse=a + +" Enable Syntax Highlighting in Vim +syntax on + +" Enable Pathogen plugin manager +execute pathogen#infect() +filetype plugin indent on + diff --git a/scripts/config-vim/configs/.vimrc b/scripts/config-vim/configs/.vimrc new file mode 100644 index 0000000..881a65c --- /dev/null +++ b/scripts/config-vim/configs/.vimrc @@ -0,0 +1,22 @@ +" Single-quote is a comment written to be read +" Double-quotes ("") are commented out code and can be removed or added + +" Set tabwidth=2, adjust Vim shiftwidth to the same +set tabstop=2 shiftwidth=2 + +" expandtab inserts spaces instead of tabs +set expandtab + +" autindent inserts the next line at your current depth +set autoindent + +" mouse=a allows for mouse interaction with vim when supported +set mouse=a + +" Enable Syntax Highlighting in Vim +syntax on + +" Enable Pathogen plugin manager +execute pathogen#infect() +filetype plugin indent on + diff --git a/scripts/config-vim/configs/.vimrc-README b/scripts/config-vim/configs/.vimrc-README new file mode 100644 index 0000000..83b6d02 --- /dev/null +++ b/scripts/config-vim/configs/.vimrc-README @@ -0,0 +1,24 @@ +Packages Installed / Updated: +- vim, git, clang + +Vimrc Settings: +- tabwidth is 2, and set to insert SPACE characters instead of TAB symbols with expandtab +- shiftwidth is 2 so we can compensate for the conflict with default tab settings +- autoindent is on, when moving to a newline vim will indent to the current depth +- syntax highlighting is on +- mouse interaction is enabled when supported by connecting systems +-- https://github.com/shaunrd0/klips/tree/master/configs + +Plugin Settings: +- Pathogen vim plugin manager has been installed and .vimrc configured for its use. +-- Install new vim plugins by cloning their repositories into ~/.vim/bundle/ +-- https://github.com/tpope/vim-pathogen + +- Clang_complete vim plugin has been installed and .vimrc configured for its use. +- Code-completion is enabled with default clang_complete settings +-- https://github.com/xavierd/clang_complete + +- Supertab vim plugin has been installed and .vimrc configured for its use. +- Allows the use of TAB to enable code-completion context menu +-- https://github.com/ervandew/supertab + diff --git a/scripts/setup-vim.sh b/scripts/setup-vim.sh index eb84c12..220861d 100755 --- a/scripts/setup-vim.sh +++ b/scripts/setup-vim.sh @@ -10,9 +10,12 @@ RED=$(tput setaf 1) UNDERLINE=$(tput smul) NORMAL=$(tput sgr0) -printf "\nEnter 1 to configure vim with the Klips repository, any other value to exit." -printf "\nThe up-to-date .vimrc config can be found here: https://github.com/shaunrd0/klips/tree/master/configs" -printf "\n${RED}Configuring Vim with this tool will update / upgrade your packages${NORMAL}\n\n" + +welcome=( "\nEnter 1 to configure vim with the Klips repository, any other value to exit." \ + "The up-to-date .vimrc config can be found here: https://github.com/shaunrd0/klips/tree/master/configs" \ + "${RED}Configuring Vim with this tool will update / upgrade your packages${NORMAL}\n\n") + +printf '%b\n' "${welcome[@]}" read cChoice if [ $cChoice -eq 1 ] ; then @@ -51,7 +54,6 @@ if [ $cChoice -eq 1 ] ; then printf "\n${GREEN}Installing Pathogen plugin manager for Vim....\n"\ "\nIf they don't exist, we will create the following directories:\n"\ "~/.vim/autoload/ ~/.vim/bundle/${NORMAL}" - # Sudo is required for curl below mkdir -pv ~/.vim/autoload ~/.vim/bundle && \ sudo curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim printf "\n${GREEN}Pathogen has been installed! Plugins plugins can now be easily installed.\n"\ @@ -63,14 +65,13 @@ if [ $cChoice -eq 1 ] ; then # Clone plugin repos into pathogen plugin directory printf "\n${GREEN}Installing updated plugins...${NORMAL}\n" - (cd ~/.vim/bundle/ && \ - sudo git clone https://github.com/ervandew/supertab && \ - printf "\n${GREEN}Supertab plugin has been installed${NORMAL}\n\n" && \ - sudo git clone https://github.com/xavierd/clang_complete && \ - printf "\n${GREEN}Clang Completion plugin has been installed${NORMAL}\n\n") - - printf "\n${UNDERLINE}Vim has been configured with the Klips repository.${NORMAL}" - printf "\n\nConfiguration Changes: \n" + git clone https://github.com/ervandew/supertab ~/.vim/bundle/supertab && \ + printf "\n${GREEN}Supertab plugin has been installed${NORMAL}\n\n" && \ + git clone https://github.com/xavierd/clang_complete ~/.vim/bundle/clang_complete && \ + printf "\n${GREEN}Clang Completion plugin has been installed${NORMAL}\n\n" + vimConf=( "\n${UNDERLINE}Vim has been configured with the Klips repository.${NORMAL}" \ + "\nConfiguration Changes: " ) + printf '%b\n' "${vimConf[@]}" cat config-vim/configs/.vimrc-README else