From cdacf6205ea92eb468a6181349e2cb1f3c779941 Mon Sep 17 00:00:00 2001 From: MineralwaterXu Date: Sat, 1 Aug 2020 23:29:55 +0800 Subject: modified nvim config --- init.vim | 135 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 121 insertions(+), 14 deletions(-) diff --git a/init.vim b/init.vim index b1f0b62..f8e5fea 100644 --- a/init.vim +++ b/init.vim @@ -2,17 +2,23 @@ " Author : @MineralwaterXu " Special Thanks : @theniceboy -"=== -"=== Auto load for the first time -"=== +" === +" === Auto load for the first time +" === if empty(glob('~/.config/nvim/autoload/plug.vim')) silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim autocmd VimEnter * PlugInstall --sync | source $MYVIMRC endif -let mapleader=" " -syntax on + + +" ==================== +" === Editor Setup === +" ==================== +" === +" === Editor behavior +" === set number set relativenumber set cursorline @@ -20,45 +26,146 @@ set wrap set showcmd set wildmenu set hlsearch -exec "nohlsearch" set incsearch set ignorecase set smartcase + + +" === +" === Basic Mappings +" === +" set as +let mapleader=" " + +" syntax +syntax on + +" Save & quit +noremap Q :q +noremap S :w + +" Open the vimrc file anytime +noremap rc :e ~/.config/nvim/init.vim + +" Search +noremap :nohlsearch + + + +" === +" === Cursor movement +" === +" ^ +" k +" < h l > +" j +" v + +" J/K keys for 5 times j/k (faster navigation) noremap J 5j noremap K 5k noremap = nzz noremap - Nzz -noremap :nohlsearch -map S :w -map s -map Q :q -map R :source $MYVIMRC + + +" === +" === Window management +" === + +" Disable the default s key +noremap s + +" split the screens to up (horizontal), down (horizontal), left (vertical), right (vertical) map sk :set nosplitbelow:split:set splitbelow map sj :set splitbelow:split map sh :set nosplitright:vsplit:set splitright map sl :set splitright:vsplit +" Resize splits with arrow keys map :res +5 map :res -5 map :vertical resize-5 map :vertical resize+5 +" Place the two screens up and down noremap s[ tK +" Place the two screens side by side noremap s] tH + + +" === +" === Install Plugins with Vim-Plug +" === + call plug#begin('~/.config/nvim/plugged') -Plug 'vim-airline/vim-airline' -Plug 'vim-airline/vim-airline-themes' + +" Pretty Dress Plug 'bling/vim-bufferline' Plug 'bpietravalle/vim-bolt' Plug 'ajmwagar/vim-deus' +" Status line +Plug 'liuchengxu/eleline.vim' + +" Other visual enhancement +Plug 'ryanoasis/vim-devicons' +Plug 'luochen1990/rainbow' +Plug 'mg979/vim-xtabline' +Plug 'wincent/terminus' + call plug#end() +set re=0 + + -set termguicolors +" === +" === Dress up my vim +" === +set termguicolors " enable true colors support let $NVIM_TUI_ENABLE_TRUE_COLOR=1 +"set background=dark +"let ayucolor="mirage" +"let g:oceanic_next_terminal_bold = 1 +"let g:oceanic_next_terminal_italic = 1 +"let g:one_allow_italics = 1 + +"color dracula +"color one color deus +"color gruvbox +"let ayucolor="light" +"color ayu +"color xcodelighthc +"set background=light +"set cursorcolumn + hi NonText ctermfg=gray guifg=grey10 +"hi SpecialKey ctermfg=blue guifg=grey70 + + + +" ===================== Start of Plugin Settings ===================== + + +" === +" === eleline.vim +" === +let g:airline_powerline_fonts = 0 + +" === +" === rainbow +" === +let g:rainbow_active = 1 + + +" ===================== End of Plugin Settings ===================== + + +" === +" === Necessary Commands to Execute +" === +exec "nohlsearch" \ No newline at end of file -- cgit v1.2.1