nvim: reformat files

This commit is contained in:
Hedy Li 2021-08-19 17:45:25 +08:00
parent bbf11b1e2d
commit 37942e8ec7
Signed by: hedy
GPG Key ID: B51B5A8D1B176372
3 changed files with 66 additions and 66 deletions

View File

@ -22,14 +22,14 @@ nnoremap <silent> <space>y :<C-u>CocList -A --normal yank<cr>
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
" other plugin before putting this into your config.
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" Use <c-space> to trigger completion.
@ -39,9 +39,9 @@ inoremap <silent><expr> <c-space> coc#refresh()
" position. Coc only does snippet and additional edit on confirm.
" <cr> could be remapped by other vim plugin, try `:verbose imap <CR>`.
if exists('*complete_info')
inoremap <expr> <cr> complete_info()["selected"] != "-1" ? "\<C-y>" : "\<C-g>u\<CR>"
inoremap <expr> <cr> complete_info()["selected"] != "-1" ? "\<C-y>" : "\<C-g>u\<CR>"
else
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
endif
" Use `[g` and `]g` to navigate diagnostics
@ -58,11 +58,11 @@ nmap <silent> gr <Plug>(coc-references)
nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
else
call CocAction('doHover')
endif
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
else
call CocAction('doHover')
endif
endfunction
" Highlight the symbol and its references when holding the cursor.

View File

@ -64,9 +64,9 @@ set undofile
" Ignore compiled files
set wildignore=*.o,*~,*.pyc
if has("win16") || has("win32")
set wildignore+=.git\*,.hg\*,.svn\*
set wildignore+=.git\*,.hg\*,.svn\*
else
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store
endif
" Return to last edit position when opening files
@ -84,17 +84,17 @@ match ErrorMsg '\s\+$'
" IsWSL function sourced in functions.vim, declared in ~/iswsl.vim
" I think this is a neovim-only thing, +1 for neovim :smirk:
if IsWSL()
let g:clipboard = {
\ 'name': 'WSLClip',
\ 'copy': {
\ '+': 'clip.exe',
\ '*': 'clip.exe',
\ },
\ 'paste': {
\ '+': 'pbpaste',
\ '*': 'pbpaste',
\ },
\ 'cache_enabled': 0,
\ }
let g:clipboard = {
\ 'name': 'WSLClip',
\ 'copy': {
\ '+': 'clip.exe',
\ '*': 'clip.exe',
\ },
\ 'paste': {
\ '+': 'pbpaste',
\ '*': 'pbpaste',
\ },
\ 'cache_enabled': 0,
\ }
endif

View File

@ -43,35 +43,35 @@ colorscheme dracula " Probably THE most important nvim configuration ;-;
" === Lightline Settings ===
let g:lightline = {
\ 'colorscheme': 'dracula',
\ 'mode_map': {
\ 'n' : 'NORM',
\ 'i' : 'INS',
\ 'R' : 'REP',
\ 'v' : 'VIS',
\ 'V' : 'VL',
\ "\<C-v>": 'VB',
\ 'c' : 'C',
\ 's' : 'S',
\ 'S' : 'SL',
\ "\<C-s>": 'SB',
\ 't': 'T',
\ },
\ 'component': {
\ 'tagbar': '%{tagbar#currenttag("[%s]", "")}',
\ },
\ 'component_function': {
\ 'fugitive': 'LightlineFugitive',
\ 'diagnosticscount': 'LightlineDiagnostics',
\ },
\ 'component_type': {
\ 'diagnosticscount': 'error',
\ },
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ], ['tagbar'] ],
\ 'right': [ [ 'diagnosticscount' ], ['percent'], ['fileformat', 'fileencoding', 'filetype'] ]
\ },
\ }
\ 'colorscheme': 'dracula',
\ 'mode_map': {
\ 'n' : 'NORM',
\ 'i' : 'INS',
\ 'R' : 'REP',
\ 'v' : 'VIS',
\ 'V' : 'VL',
\ "\<C-v>": 'VB',
\ 'c' : 'C',
\ 's' : 'S',
\ 'S' : 'SL',
\ "\<C-s>": 'SB',
\ 't': 'T',
\ },
\ 'component': {
\ 'tagbar': '%{tagbar#currenttag("[%s]", "")}',
\ },
\ 'component_function': {
\ 'fugitive': 'LightlineFugitive',
\ 'diagnosticscount': 'LightlineDiagnostics',
\ },
\ 'component_type': {
\ 'diagnosticscount': 'error',
\ },
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ], ['tagbar'] ],
\ 'right': [ [ 'diagnosticscount' ], ['percent'], ['fileformat', 'fileencoding', 'filetype'] ]
\ },
\ }
function! LightlineFugitive()
" Referenced from Lightline docs; I'm not 100% what this does but seems like
@ -115,17 +115,17 @@ noremap <Leader>nt :NERDTreeToggle<CR>
" NerdTree Git plugin
let g:NERDTreeGitStatusIndicatorMapCustom = {
\ "Modified" : "M",
\ "Staged" : "A",
\ "Untracked" : "?",
\ "Renamed" : "R",
\ "Unmerged" : "═",
\ "Deleted" : "D",
\ "Dirty" : "X",
\ "Clean" : "✔︎",
\ 'Ignored' : 'i',
\ "Unknown" : "??"
\ }
\ "Modified" : "M",
\ "Staged" : "A",
\ "Untracked" : "?",
\ "Renamed" : "R",
\ "Unmerged" : "═",
\ "Deleted" : "D",
\ "Dirty" : "X",
\ "Clean" : "✔︎",
\ 'Ignored' : 'i',
\ "Unknown" : "??"
\ }
" tagbar
nnoremap <leader>tt :TagbarToggle<CR>