diff options
author | Xiao Pan <gky44px1999@gmail.com> | 2023-10-25 06:45:08 +0000 |
---|---|---|
committer | Xiao Pan <gky44px1999@gmail.com> | 2023-10-25 06:45:08 +0000 |
commit | e4db0b25bf6540386e737594a47cb92a83c0cbea (patch) | |
tree | 70f85967663aa539fabe40e40803fa638acfae00 /home/xyz/.config/nvim | |
parent | 12bda1ac3390f2d16a401d895faf0ef2418f874c (diff) |
update
Diffstat (limited to 'home/xyz/.config/nvim')
-rw-r--r-- | home/xyz/.config/nvim/init.vim | 63 |
1 files changed, 36 insertions, 27 deletions
diff --git a/home/xyz/.config/nvim/init.vim b/home/xyz/.config/nvim/init.vim index b08d967d..d73e0ba0 100644 --- a/home/xyz/.config/nvim/init.vim +++ b/home/xyz/.config/nvim/init.vim @@ -8,18 +8,19 @@ call plug#begin() "Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } "Plug 'junegunn/fzf.vim' "Plug 'vim-perl/vim-perl', { 'for': 'perl', 'do': 'make clean carp dancer highlight-all-pragmas moose test-more try-tiny' } -Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } } +"Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } } " chriskempson/base16-vim doesn't do bold/italic for markdown syntax, and not maintained -" fnune/base16-vim and RRethy/nvim-base16 seem both work, both support tree-sitter -Plug 'fnune/base16-vim' +" tinted-theming/base16-vim and RRethy/nvim-base16 seem both work, both support tree-sitter +" I prefer tinted-theming/base16-vim in the past because of darker status bar color? +Plug 'tinted-theming/base16-vim' " nvim-treesitter does not support markdown right now, so wait "Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} " We recommend updating the parsers on update " use latest vim-markdown Plug 'tpope/vim-markdown' " alternatives: h-hg/fcitx.nvim, rlue/vim-barbaric, lilydjwg/fcitx.vim -Plug 'rlue/vim-barbaric' +"Plug 'rlue/vim-barbaric' " alternatives: 'thinca/vim-ref' with 'eiiches/vim-ref-info', 'HiPhish/info.vim', 'alx741/vinfo' -Plug 'HiPhish/info.vim' +Plug 'https://gitlab.com/HiPhish/info.vim.git' call plug#end() " next line must put below `Plug 'glacambre/firenvim'`, else if click github issue textarea, then click elsewhere, then click textarea, textarea will not be selected (no cursor in it), not sure why @@ -57,7 +58,8 @@ augroup END " :h markdown, for vim default tpope/vim-markdown "let g:markdown_folding = 1 -let g:markdown_minlines = 500 +" g:markdown_minlines before nvim 0.8, 500 works well; version 0.8 makes even 400 noticeable slow when keep pressing gk +let g:markdown_minlines = 350 "let g:markdown_fenced_languages = ['python', 'sh', 'vim', 'c', 'cpp'] " netrw-p preview vertial split @@ -68,7 +70,7 @@ let g:netrw_winsize = 20 filetype plugin on " fold is slow and buggy, at least for different kinds of vim-markdown, disable it, not sure if works or not -set nofoldenable +"set nofoldenable language en_US set number relativenumber @@ -80,9 +82,6 @@ colorscheme base16-tomorrow-night " set dir to current editing file's dir set autochdir -" always use system for ALL instead of use + and * operator? -"set clipboard+=unnamedplus - " Spaces & Tabs set tabstop=4 " number of visual spaces per TAB set softtabstop=4 " number of spaces in tab when editing @@ -90,24 +89,30 @@ set shiftwidth=4 " number of spaces to use for autoindent "set expandtab " tabs are space " https://www.zhihu.com/question/22363620/answer/21199296 -" last line seems is default to neovim but not vim -set fileencodings=ucs-bom,utf-8,utf-16,gbk,big5,gb18030,latin1 +" euc-cn=gb2312, cp936=gbk +" it is recommended by `:h fileencodings` to put ucs-bom at first and latin1 at last +" based on my experience, if put utf-16 in front of euc-cn, euc-cn will have mojibake +" based on my experience, if put big5 in front of euc-cn and cp936, euc-cn will have mojibake +" according to zhihu comment, if put gb18030 in front of big5 , big5 will have mojibake +" according to wikipedia articles, euc-cn is preceded by cp936 which is preceded by gb18030, gb18030 is backward compatible with cp936 which seems is backward compatible with euc-cn +set fileencodings=ucs-bom,utf-8,euc-cn,cp936,big5,gb18030,utf-16,latin1 +" seems is default to neovim but not vim set encoding=utf-8 " some file on win10 display as unix but is dos -"if has('win32') -" set fileformats=dos -" " windows 10 bug, need this to change cursor back to vertical bar after leaving neovim -" " the number after ver seems no effects, maybe because neovim is exited -" " https://github.com/alacritty/alacritty/issues/2839#issuecomment-766421840 -" " use of ! after autocmd see youtube video above, not fully understood -" autocmd! VimLeave * set guicursor=a:ver25 -"endif - -" don't generate those three types of files -set nobackup -set noswapfile -set noundofile +if has('win32') + set fileformats=dos + " windows 10 bug, need this to change cursor back to vertical bar after leaving neovim + " the number after ver seems no effects, maybe because neovim is exited + " https://github.com/alacritty/alacritty/issues/2839#issuecomment-766421840 + " use of ! after autocmd see youtube video above, not fully understood + autocmd! VimLeave * set guicursor=a:ver25 +endif + +" if don't want to generate swap file +"set noswapfile +" nvim backup file defualt off, see `:h nobackup` `:set backup?` +" nvim undo file default off, see `:h noundofile` `:set undofile?` " gg=G work for .xml files now,:h matchit-activate " https://stackoverflow.com/questions/21408222/vim-indent-xml-file/28365920#28365920 @@ -117,6 +122,10 @@ packadd! matchit set ignorecase set smartcase +" disable mouse support +" :h disable-mouse +set mouse= + " map ctrl+h/j/k/l to move between split windows map <C-h> <C-w>h map <C-j> <C-w>j @@ -124,8 +133,8 @@ map <C-k> <C-w>k map <C-l> <C-w>l " moving in long line -nnoremap k gk -nnoremap j gj +"nnoremap k gk +"nnoremap j gj nnoremap o o<Esc> nnoremap O O<Esc> |