From dd4ef41fa41263f70851a0271a4489cfaab7a3f4 Mon Sep 17 00:00:00 2001 From: jdhao Date: Thu, 18 Jul 2019 22:31:51 +0800 Subject: [PATCH] Update init.vim --- init.vim | 102 +++++++++++++++++++++++++++---------------------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/init.vim b/init.vim index ef59ab9..58f2079 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-06-10 16:03:18+0800 +" Update: 2019-07-13 20:56:51+0800 "}} "{{ License: MIT License @@ -53,9 +53,9 @@ " faster. see https://neovim.io/doc/user/provider.html. Change this variable " in accordance with your system. if executable('python') + " The output of `system()` function contains a newline character which + " should be removed. if has('win32') " for Windows - " the output of `system()` function contains a newline character which - " should be removed let g:python3_host_prog=substitute(system('where python'), '.exe\n\+$', '', 'g') elseif has('unix') " for Linux and Mac let g:python3_host_prog=substitute(system('which python'), '\n\+$', '', 'g') @@ -147,6 +147,7 @@ function! RandInt(Low, High) abort return l:milisec % (a:High - a:Low + 1) + a:Low endfunction +set foldcolumn=0 function! VimFolds(lnum) " custom fold expr, adapted from https://vi.stackexchange.com/a/9094/15292 @@ -181,9 +182,7 @@ function! MyFoldText() let line = strpart(line, 0, windowwidth - 2 - len(foldedlinecount)) " let fillcharcount = windowwidth - len(line) - len(foldedlinecount) - 80 let fillcharcount = &textwidth - len(line) - len(foldedlinecount) - 8 - let l_fillcount = fillcharcount/2 - let r_fillcount = fillcharcount - l_fillcount - return line . '...'. repeat('-', l_fillcount) . ' (' . foldedlinecount . ' L) ' . repeat('-', r_fillcount) + return line . '...'. repeat('-', fillcharcount) . ' (' . foldedlinecount . ' L)' endfunction "} @@ -201,7 +200,9 @@ set splitbelow splitright " Time in milliseconds to wait for a mapped sequence to complete " see https://goo.gl/vHvyu8 for more info set timeoutlen=800 -set updatetime=1000 + +" for CursorHold events +set updatetime=2000 " clipboard settings, always use clipboard for all delete, yank, change, put " operation, see https://goo.gl/YAHBbJ @@ -235,7 +236,7 @@ set linebreak set showbreak=↪ " list all items and start selecting matches -set wildmode=list:longest,full +set wildmode=list:full set cursorline " whether to show the line cursor is in set colorcolumn=80 " set a ruler at column 80, see https://goo.gl/vEkF5i @@ -324,8 +325,6 @@ set spelllang=en,cjk " spell languages " tilde ~ is an operator (thus must be followed by motions like `e` or `w`) set tildeop - -set pyxversion=3 " set pyx version to use python3 by default "} "{ Custom key mappings @@ -408,9 +407,9 @@ nnoremap Y y$ " move cursor based on physical lines not the actual lines. nnoremap j (v:count == 0 ? 'gj' : 'j') nnoremap k (v:count == 0 ? 'gk' : 'k') -nnoremap $ g$ -nnoremap ^ g^ -nnoremap 0 g0 +nnoremap $ g$ +nnoremap ^ g^ +nnoremap 0 g0 " do not include white space character when using $ in visual mode, " see https://goo.gl/PkuZox @@ -480,6 +479,12 @@ inoremap :set spell! :AutoSaveToggle " decrease indent level in insert mode with shift+tab inoremap <