summaryrefslogtreecommitdiff
path: root/init.vim
diff options
context:
space:
mode:
authorMineralwaterXu <[email protected]>2020-08-01 23:29:55 +0800
committerMineralwaterXu <[email protected]>2020-08-01 23:29:55 +0800
commitcdacf6205ea92eb468a6181349e2cb1f3c779941 (patch)
treed127555836e1d966bf8fde8301a0d8439ec6eb64 /init.vim
parent3f397bf8e4c131297363a4443b1a5a15ca92a3b0 (diff)
modified nvim config
Diffstat (limited to 'init.vim')
-rw-r--r--init.vim135
1 files 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 <LEADER> as <SPACE>
+let mapleader=" "
+
+" syntax
+syntax on
+
+" Save & quit
+noremap Q :q<CR>
+noremap S :w<CR>
+
+" Open the vimrc file anytime
+noremap <LEADER>rc :e ~/.config/nvim/init.vim<CR>
+
+" Search
+noremap <LEADER><CR> :nohlsearch<CR>
+
+
+
+" ===
+" === 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 <LEADER><CR> :nohlsearch<CR>
-map S :w<CR>
-map s <nop>
-map Q :q<CR>
-map R :source $MYVIMRC<CR>
+
+
+" ===
+" === Window management
+" ===
+
+" Disable the default s key
+noremap s <nop>
+
+" split the screens to up (horizontal), down (horizontal), left (vertical), right (vertical)
map sk :set nosplitbelow<CR>:split<CR>:set splitbelow<CR>
map sj :set splitbelow<CR>:split<CR>
map sh :set nosplitright<CR>:vsplit<CR>:set splitright<CR>
map sl :set splitright<CR>:vsplit<CR>
+" Resize splits with arrow keys
map <up> :res +5<CR>
map <down> :res -5<CR>
map <left> :vertical resize-5<CR>
map <right> :vertical resize+5<CR>
+" Place the two screens up and down
noremap s[ <C-w>t<C-w>K
+" Place the two screens side by side
noremap s] <C-w>t<C-w>H
+
+
+" ===
+" === 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