diff options
author | flyxyz123 <gky44px1999@gmail.com> | 2021-04-01 06:13:26 -0700 |
---|---|---|
committer | flyxyz123 <gky44px1999@gmail.com> | 2021-04-01 06:13:26 -0700 |
commit | 53c1f71f83922425447c60e7dfcaf5f4b8f42f33 (patch) | |
tree | b40dee46ff16769aacde4ceee61358c082ae2b56 /.config/nvim |
add dotfiles
Diffstat (limited to '.config/nvim')
-rw-r--r-- | .config/nvim/init.vim | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim new file mode 100644 index 00000000..7cdc0494 --- /dev/null +++ b/.config/nvim/init.vim @@ -0,0 +1,60 @@ +language en_US + +" hybrid number numbers +set number relativenumber + +" Spaces & Tabs +set tabstop=4 " number of visual spaces per TAB +set softtabstop=4 " number of spaces in tab when editing +set shiftwidth=4 " number of spaces to use for autoindent +" set expandtab " tabs are space + +" read chinese characters, first line might not work, added the 2nd line might work +" both line needed for the task, 2nd line seems is default to neovim but not vim +set fileencodings=ucs-bom,utf-8,utf-16,gbk,big5,gb18030,latin1 +set encoding=utf-8 + +" don't generate those three types of files +set nobackup +set noswapfile +set noundofile + +" set dir to current editing file's dir +set autochdir + +" vim-plug +" call plug#begin() +" Plug 'preservim/nerdtree' +" Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } +" Plug 'junegunn/fzf.vim' +" Plug 'vim-airline/vim-airline' +" call plug#end() + +" map ctrl+h/j/k/l to move between split windows +map <C-h> <C-w>h +map <C-j> <C-w>j +map <C-k> <C-w>k +map <C-l> <C-w>l + +" search case sensitive only if have uppercase +set ignorecase +set smartcase + +" default statusline:set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P +set statusline+=%< +set statusline+=%f " %F or 1CTRL+G to show full path +set statusline+=\ %m +set statusline+=%= +set statusline+=\ %y +set statusline+=\ %{&fileencoding?&fileencoding:&encoding} +set statusline+=\ \[%{&fileformat}\] +set statusline+=\ %-10.(%l,%c%V%) +set statusline+=\ %P + +" moving in long line +nnoremap k gk +nnoremap j gj + +" disable auto line break (tc) and insert comment (cro) +filetype plugin on " seems nvim needs this for next line of code to work? +autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o formatoptions-=t |