From 53107c56f3743f01fc62a2b677ef527997493140 Mon Sep 17 00:00:00 2001 From: Julian Tellez <4896851+juliantellez@users.noreply.github.com> Date: Tue, 25 Aug 2020 01:33:58 +0100 Subject: [PATCH] feature: add neovim plus config (#15) * feature: add nvim config * docs: update readme * chore: bump version --- README.md | 13 ++++++++- config/nvim/init.vim | 66 ++++++++++++++++++++++++++++++++++++++++++++ dependencies/nvim.sh | 31 +++++++++++++++++++++ main.sh | 5 ++++ packages/brews.txt | 2 +- utils/version.sh | 2 +- 6 files changed, 116 insertions(+), 3 deletions(-) create mode 100644 config/nvim/init.vim create mode 100644 dependencies/nvim.sh diff --git a/README.md b/README.md index c54e1aa..c8ef64d 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ sh -c "$(curl -fsSL https://raw.githubusercontent.com/juliantellez/up/master/ins # Editors - [visual-studio-code](https://code.visualstudio.com/): Code editor redefined and optimized for building and debugging modern web and cloud applications. -- [vim](https://github.com/vim/vim): Improved version of the good old UNIX editor Vi. +- [neoVim](https://github.com/neovim/neovim): Vim-fork focused on extensibility and usability. # Databases - [postgress](https://www.postgresql.org/): reliable and robust object-relational database. @@ -157,6 +157,17 @@ follow the description below and import them from the color_presets folder. Iterm2 > Preferences > Profiles > Colors > Color Presets > Import ``` +# NeoVim + +Neovim plugins are powered by [vim Plug](https://github.com/junegunn/vim-plug). + +``` +$ nvim + +:PlugStatus +:PlugInstall +``` + # Acknowledgements These configs and dotfiles stand on the shoulders of the following giants: diff --git a/config/nvim/init.vim b/config/nvim/init.vim new file mode 100644 index 0000000..0c8d452 --- /dev/null +++ b/config/nvim/init.vim @@ -0,0 +1,66 @@ +"-----PLUGIN SETTINGS------- + +" Plugins will be downloaded under the specified directory. +call plug#begin('~/.vim/plugged') + +" Intellisense engine for Vim8 & Neovim +" https://github.com/neoclide/coc.nvim +Plug 'neoclide/coc.nvim', {'branch': 'release'} + +" Lean & mean status/tabline for vim that's light as air +" https://github.com/vim-airline/vim-airline +Plug 'bling/vim-airline' + +" A tree explorer plugin for vim. +" https://github.com/preservim/nerdtree +Plug 'scrooloose/nerdtree' + +" A plugin of NERDTree showing git status +" https://github.com/Xuyuanp/nerdtree-git-plugin +Plug 'Xuyuanp/nerdtree-git-plugin' + +" Extra syntax and highlight for nerdtree files +" https://github.com/tiagofumo/vim-nerdtree-syntax-highlight +Plug 'tiagofumo/vim-nerdtree-syntax-highlight' + +" A Vim plugin which shows git diff markers in the sign column and stages/previews/undoes hunks and partial hunks. +" https://github.com/airblade/vim-gitgutter +Plug 'airblade/vim-gitgutter' + +" Fuzzy file, buffer, mru, tag, etc finder. +" https://github.com/kien/ctrlp.vim +Plug 'ctrlpvim/ctrlp.vim' + +" VIM Darcula Theme +" https://github.com/blueshirts/darcula +Plug 'blueshirts/darcula' + +" List ends here. Plugins become visible to Vim after this call. +call plug#end() + +"-----GENERAL SETTINGS------- +syntax enable +colorscheme darcula + +let g:auto_save = 1 "enable AutoSave on startup +set laststatus=2 "see the current mode, file name, file status, ruler, etc...2 + +set number "Show line numbers +set autoindent "Auto-indent new lines +set shiftwidth=2 "Number of auto-indent spaces +set smartindent "Enable smart-indent +set smarttab "Enable smart-tabs +set softtabstop=2 "Number of spaces per Tab + +set ruler "Show row and column ruler information +set undolevels=1000 "Number of undo levels +set backspace=indent,eol,start "Backspace behaviour + +"-----SEARCH------- +set ignorecase "case insensitive +set smartcase "use case if any caps used +set incsearch "show match as search proceeds +set hlsearch "search highlighting + +autocmd VimEnter * NERDTree "open NERDTree automatically +let g:NERDTreeIgnore = ['^node_modules$'] diff --git a/dependencies/nvim.sh b/dependencies/nvim.sh new file mode 100644 index 0000000..c6b589d --- /dev/null +++ b/dependencies/nvim.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +. $(pwd)/helpers/ask.sh +. $(pwd)/helpers/create_backup.sh +. $(pwd)/helpers/print.sh + +install_vim_plug () { + local file=$HOME/.config/nvim/autoload/plug.vim + + if ! [[ -f $file ]]; then + curl -fLo $file --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + print_success "Vim Plug installed" + else + print_success "Vim Plug already installed" + fi +} + +copy_vim_plug_configuration () { + local file=$HOME/.config/nvim/init.vim + + if ask "Would you like to copy this vim plug config? ${1}" Y; then + create_backup "nvim" "init.vim" $file + + cp $1 $file + print_success "nvim config updated" + else + print_error "Aborting..." + fi +} + +copy_vim_plug_configuration /Users/juliantellez/github/juliantellez/up/config/nvim/init.vim diff --git a/main.sh b/main.sh index 71f90bc..b8d5fc8 100644 --- a/main.sh +++ b/main.sh @@ -6,6 +6,7 @@ . $(pwd)/dependencies/mac.sh . $(pwd)/dependencies/iterm2.sh . $(pwd)/dependencies/nodejs.sh +. $(pwd)/dependencies/nvim.sh . $(pwd)/dependencies/zsh/autocomplete.sh . $(pwd)/dependencies/zsh/powerlevel9k.sh . $(pwd)/dependencies/zsh/syntax_highlight.sh @@ -68,6 +69,10 @@ steps(){ step "Config: Copy zshrc" copy_zsh_configuration $(pwd)/config/.zshrc + step "Config: nvim" + install_vim_plug + copy_nvim_configuration $(pwd)/config/nvim/init.vim + step "Config: mac" configure_mac } diff --git a/packages/brews.txt b/packages/brews.txt index 6cc17db..b5053d2 100644 --- a/packages/brews.txt +++ b/packages/brews.txt @@ -10,11 +10,11 @@ hub kubectl kops mas +neovim postgresql redis tree terraform the_silver_searcher vault -vim z diff --git a/utils/version.sh b/utils/version.sh index 1e6a9f2..4b3cc44 100644 --- a/utils/version.sh +++ b/utils/version.sh @@ -1 +1 @@ -UP_VERSION="0.1.7" +UP_VERSION="0.2.0"