From 6297a85c48d56c3c08a41c1733f7443a5b9adb99 Mon Sep 17 00:00:00 2001 From: jdhao Date: Fri, 3 May 2019 20:37:02 +0800 Subject: [PATCH] Update init.vim --- init.vim | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/init.vim b/init.vim index 02fe7ab..9b0d882 100644 --- a/init.vim +++ b/init.vim @@ -20,7 +20,7 @@ " not recommend downloading this file and replace your own init.vim. Good " configurations are built over time and take your time to polish. " Author: jdhao (jdhao@hotmail.com). Blog: https://jdhao.github.io -" Update: 2019-04-29 21:07:02+0800 +" Update: 2019-04-30 19:31:40+0800 "}} "{{ License: MIT License @@ -304,7 +304,7 @@ set undofile " persistent undo even after you close and file and reopen it set shortmess+=c set completeopt+=noinsert " auto select the first completion entry - +set completeopt+=menuone " show menu even if there is only one item " disable the preview window during autocompletion, see also https://goo.gl/18zNPD set completeopt-=preview @@ -326,11 +326,8 @@ set signcolumn=yes " always show sign column set formatoptions+=mM " dictionary files for different systems -if has('unix') - set dictionary+=/usr/share/dict/words -else - set dictionary+=~/AppData/Local/nvim/words -endif +let $MY_DICT = stdpath('config') . '/dict/words' +set dictionary+=$MY_DICT set spelllang=en,cjk " spell languages @@ -368,8 +365,8 @@ vnoremap / /\v nnoremap p op nnoremap P Op -" shortcut for faster quit -" nmap w :w +" shortcut for faster save and quit +nmap w :w nnoremap q :q nnoremap Q :qa @@ -401,8 +398,16 @@ inoremap " insert a blank line below or above current line (do not move the cursor) " see https://stackoverflow.com/a/16136133/6064933 -nnoremap oo @='m`o``' -nnoremap OO @='m`O``' +nnoremap oo 'm`' . v:count1 . 'o``' +nnoremap OO 'm`' . v:count1 . 'O``' + +" nnoremap oo @='m`o``' +" nnoremap OO @='m`O``' + +" the following two mappings work, but if you change double quote to single, it +" work not work +" nnoremap oo @="m`o\Esc>``" +" nnoremap oo @="m`o\e``" " insert a space after current character nnoremap ah @@ -496,9 +501,6 @@ tnoremap " when we are doing spell checking) nnoremap :set spell! :AutoSaveToggle inoremap :set spell! :AutoSaveToggle - -" spell checking related mapping, take from http://tinyurl.com/y5gwgs3d -nnoremap ]s1z= "} "{ Auto commands @@ -729,7 +731,7 @@ Plug 'morhetz/gruvbox' Plug 'sickill/vim-monokai' Plug 'ajmwagar/vim-deus' Plug 'hzchirs/vim-material' -Plug 'nanotech/jellybeans.vim' +Plug 'sjl/badwolf' " Plug 'joshdick/onedark.vim' " Plug 'challenger-deep-theme/vim' " Plug 'lifepillar/vim-solarized8' @@ -1227,11 +1229,11 @@ let g:highlighturl_underline=1 " toggle nerdtree window and keep cursor in file window, " adapted from http://tinyurl.com/y2kt8cy9 -nnoremap :NERDTreeToggle:wincmd p +nnoremap s :NERDTreeToggle:wincmd p " reveal currently editted file in nerdtree widnow, " see https://goo.gl/kbxDVK -nnoremap ,nf :NERDTreeFind +nnoremap f :NERDTreeFind " ignore certain files and folders let NERDTreeIgnore = ['\.pyc$', '^__pycache__$'] @@ -1260,7 +1262,7 @@ let NERDTreeMinimalUI=0 """"""""""""""""""""""""""" tagbar settings """""""""""""""""""""""""""""""""" " shortcut to toggle tagbar window -nnoremap :TagbarToggle +nnoremap t :TagbarToggle "}} "{{ file editting @@ -1474,6 +1476,7 @@ if has('win32') || has('macunix') " shortcut to start markdown previewing nnoremap :MarkdownPreview + nnoremap :MarkdownPreviewStop endif """"""""""""""""""""""""vim-markdownfootnotes settings"""""""""""""""""""""""" @@ -1595,7 +1598,7 @@ let g:indentLine_concealcursor = '' " disable indentline for certain filetypes augroup indentline_disable_ft autocmd! - autocmd FileType help,startify let g:indentLine_enabled = 0 + autocmd FileType help,startify :IndentLinesDisable augroup END """""""""""""""""""""""""""vim-airline setting"""""""""""""""""""""""""""""" @@ -1739,6 +1742,7 @@ if HasColorscheme('gruvbox') " see https://goo.gl/8nXhcp let g:gruvbox_italic=1 let g:gruvbox_contrast_dark='hard' + let g:gruvbox_italicize_strings=1 colorscheme gruvbox else @@ -1818,4 +1822,4 @@ endif " - https://github.com/gkapfham/dotfiles/blob/master/.vimrc " The ascii art on the frontpage is generated using http://tinyurl.com/y6szckgd -"} \ No newline at end of file +"}