[feat] update config

This commit is contained in:
Jay 2021-01-16 11:06:20 +08:00
parent 263f59ca76
commit 034c3500e3
2 changed files with 43 additions and 12 deletions

View File

@ -2,9 +2,12 @@
[user] [user]
# Please adapt and uncomment the following lines: # Please adapt and uncomment the following lines:
name = Jay name = Jay
email = jay@rtj.tw email = jay@lawsnote.com
[merge]
tool = vimdiff
[diff] [diff]
tool = vimdiff tool = vimdiff
trustExitCode = true
[difftool] [difftool]
prompt = false prompt = false
[alias] [alias]
@ -15,3 +18,5 @@
ls = log --graph --pretty=format:\"%h <%an> %ar %s\" --all ls = log --graph --pretty=format:\"%h <%an> %ar %s\" --all
st = status st = status
br = branch br = branch
[mergetool]
keepBackup = false

30
.vimrc
View File

@ -89,9 +89,24 @@ set hlsearch
set nowrap set nowrap
" enable backspace " enable backspace
set backspace=indent,eol,start set backspace=indent,eol,start
set encoding=utf-8
" set font
" set guifont=Hack\ Nerd\ Font:h11
set background=dark set background=dark
function! AdaptColorscheme()
highlight clear CursorLine
highlight Normal ctermbg=none
highlight LineNr ctermbg=none
highlight Folded ctermbg=none
highlight NonText ctermbg=none
highlight SpecialKey ctermbg=none
highlight VertSplit ctermbg=none
highlight SignColumn ctermbg=none
endfunction
autocmd ColorScheme * call AdaptColorscheme()
" colorscheme turtles " colorscheme turtles
colorscheme afterglow colorscheme afterglow
@ -122,7 +137,7 @@ call defx#custom#option('_', {
\ 'direction': 'topleft', \ 'direction': 'topleft',
\ 'buffer_name': '', \ 'buffer_name': '',
\ 'toggle': 1, \ 'toggle': 1,
\ 'resume': 1 \ 'resume': 1,
\ }) \ })
nmap <F3> :Defx<CR> nmap <F3> :Defx<CR>
nmap <leader>me :Defx<CR> nmap <leader>me :Defx<CR>
@ -252,6 +267,8 @@ nmap <silent> <Leader>gv :vsplit \| :LspDefinition <CR>
nmap <silent> <Leader>gf :LspDocumentFormat<CR> nmap <silent> <Leader>gf :LspDocumentFormat<CR>
let g:lsp_diagnostics_enabled = 0 " disable diagnostics support let g:lsp_diagnostics_enabled = 0 " disable diagnostics support
let g:lsp_diagnostics_float_cursor = 0
let g:lsp_diagnostics_echo_cursor = 1
" require node module " require node module
" npm i -g dockerfile-language-server-nodejs " npm i -g dockerfile-language-server-nodejs
@ -277,6 +294,14 @@ if executable('gopls')
autocmd FileType go setlocal omnifunc=lsp#complete autocmd FileType go setlocal omnifunc=lsp#complete
endif endif
if executable('deno')
au User lsp_setup call lsp#register_server({
\ 'name': 'deno',
\ 'cmd': {server_info->[&shell, &shellcmdflag, 'deno lsp']},
\ 'whitelist': ['typescript', 'typescript.tsx', 'typescriptreact'],
\ })
endif
" rustup update " rustup update
" rustup component add rls rust-analysis rust-src " rustup component add rls rust-analysis rust-src
" if executable('rls') " if executable('rls')
@ -372,6 +397,7 @@ let g:go_highlight_extra_types = 1
" for rust-vim " for rust-vim
let g:rust_recommended_style = 0 let g:rust_recommended_style = 0
let g:rustfmt_autosave = 1
let g:syntastic_rust_checkers = ['cargo'] let g:syntastic_rust_checkers = ['cargo']
let g:airline#extensions#tabline#enabled = 1 let g:airline#extensions#tabline#enabled = 1