From 9270f1dd50f834e636e246408a0a4de898935fac Mon Sep 17 00:00:00 2001 From: arnaucube Date: Tue, 15 Sep 2020 15:29:24 +0200 Subject: [PATCH] Update vim configs --- .vimrc | 43 ++----------------------------------------- README.md | 7 +++++++ init.vim | 20 ++++++++++++-------- install-new-server.sh | 1 + vimconfigbase.vim | 41 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 63 insertions(+), 49 deletions(-) create mode 100644 vimconfigbase.vim diff --git a/.vimrc b/.vimrc index 7f7b180..19fe07e 100644 --- a/.vimrc +++ b/.vimrc @@ -1,3 +1,5 @@ +source ~/vimconfigbase.vim + call plug#begin(expand('~/.vim/plugged')) Plug 'morhetz/gruvbox' @@ -6,47 +8,6 @@ Plug 'morhetz/gruvbox' call plug#end() -" visual -syntax on -set ruler -set number -set title -set titlestring=nvim-%F -set t_Co=256 -set cursorline -set background=dark " for the dark version - -" abbreviations -cnoreabbrev W! w! -cnoreabbrev Q! q! -cnoreabbrev Qall! qall! -cnoreabbrev Wq wq -cnoreabbrev Wa wa -cnoreabbrev wQ wq -cnoreabbrev WQ wq -cnoreabbrev W w -cnoreabbrev Q q -cnoreabbrev Qall qall -cnoreabbrev Qa qa - -"" Switching windows -noremap j -noremap k -noremap l -noremap h - -"" esc mapping -inoremap jk -tnoremap jk - -" scroll -set scrolloff=5 " keep at least 5 lines above/below -set sidescrolloff=5 " keep at least 5 lines left/right - -colorscheme torte -set background=dark -hi statusline ctermfg=234 ctermbg=250 -hi LineNr ctermfg=246 colorscheme gruvbox diff --git a/README.md b/README.md index 9767e46..d5fd81e 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,14 @@ alias lst='exa -l -snew' --- + +- Vim: `.vimrc` + - put `vimconfigbase.vim` into `~/` + - put `.vimrc` into `~/` + - install https://github.com/junegunn/vim-plug + - inside vim, execute: `:PlugInstall` - NeoVim: `init.vim` + - put `vimconfigbase.vim` into `~/` - in `.config/nvim/init.vim` - install https://github.com/junegunn/vim-plug - inside neovim, execute: `:PlugInstall` diff --git a/init.vim b/init.vim index 718ab0b..6b5290c 100644 --- a/init.vim +++ b/init.vim @@ -1,4 +1,4 @@ -source ~/.vimrc +source ~/vimconfigbase.vim call plug#begin(expand('~/.config/nvim/plugged')) @@ -26,6 +26,9 @@ Plug 'majutsushi/tagbar' " rainbow parentheses Plug 'luochen1990/rainbow' +" git +Plug 'tpope/vim-fugitive' + " go Plug 'fatih/vim-go' " Amazing combination of features. Plug 'godoctor/godoctor.vim' " Some refactoring tools @@ -48,17 +51,18 @@ Plug 'tomlion/vim-solidity' " circom Plug 'iden3/vim-circom-syntax' -" deoplete -Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } -Plug 'zchee/deoplete-go', {'build': {'unix': 'make'}} -" neosnippet with deoplete -Plug 'Shougo/neosnippet.vim' -Plug 'Shougo/neosnippet-snippets' +" +" " deoplete +" Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } +" Plug 'zchee/deoplete-go', {'build': {'unix': 'make'}} +" " neosnippet with deoplete +" Plug 'Shougo/neosnippet.vim' +" Plug 'Shougo/neosnippet-snippets' " automatically adjust shiftwidth and expand tab based on current file Plug 'tpope/vim-sleuth' -let g:deoplete#enable_at_startup = 1 +" let g:deoplete#enable_at_startup = 1 " Plugin deoplete neosnippet key-mappings. " Note: It must be "imap" and "smap". It uses mappings. imap (neosnippet_expand_or_jump) diff --git a/install-new-server.sh b/install-new-server.sh index a5edbe5..27e559c 100644 --- a/install-new-server.sh +++ b/install-new-server.sh @@ -13,6 +13,7 @@ cp ./.tmux.conf ~/.tmux.conf # vim echo "setting vim config" cp ./.vimrc ~/.vimrc +cp ./vimconfigbase.vim ~/vimconfigbase.vim # neovim echo "installing neovim" diff --git a/vimconfigbase.vim b/vimconfigbase.vim new file mode 100644 index 0000000..693328d --- /dev/null +++ b/vimconfigbase.vim @@ -0,0 +1,41 @@ +" visual +syntax on +set ruler +set number +set title +set titlestring=nvim-%F +set t_Co=256 +set cursorline +set background=dark " for the dark version + +" abbreviations +cnoreabbrev W! w! +cnoreabbrev Q! q! +cnoreabbrev Qall! qall! +cnoreabbrev Wq wq +cnoreabbrev Wa wa +cnoreabbrev wQ wq +cnoreabbrev WQ wq +cnoreabbrev W w +cnoreabbrev Q q +cnoreabbrev Qall qall +cnoreabbrev Qa qa + +"" Switching windows +noremap j +noremap k +noremap l +noremap h + +"" esc mapping +inoremap jk +tnoremap jk + +" scroll +set scrolloff=5 " keep at least 5 lines above/below +set sidescrolloff=5 " keep at least 5 lines left/right + +" colorscheme torte +set background=dark +hi statusline ctermfg=234 ctermbg=250 +hi LineNr ctermfg=246