Update multiple things

This commit is contained in:
Justin Lin
2022-08-07 10:18:14 +08:00
parent 8275315dc9
commit 4557f2e97f
16 changed files with 140 additions and 24 deletions

View File

@@ -17,19 +17,29 @@ Plug 'vimwiki/vimwiki'
Plug 'vim-airline/vim-airline'
Plug 'tpope/vim-commentary'
Plug 'ap/vim-css-color'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
" Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
" Plug 'leafOfTree/vim-vue-plugin'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
call plug#end()
set title
set bg=light
set go=a
set mouse=a
set nohlsearch
set clipboard+=unnamedplus
set noshowmode
set noruler
set laststatus=0
set noshowcmd
set tabstop=4 expandtab softtabstop=4 shiftwidth=4
set scrolloff=5
" Tab
nnoremap H gT
nnoremap L gt
" Rename
nnoremap <F2> :GoRename<CR>
" Some basics:
nnoremap c "_c
@@ -59,7 +69,8 @@ set noshowcmd
let NERDTreeBookmarksFile = stdpath('data') . '/NERDTreeBookmarks'
else
let NERDTreeBookmarksFile = '~/.vim' . '/NERDTreeBookmarks'
endif
endif" Open the existing NERDTree on each new tab.
autocmd BufWinEnter * if getcmdwintype() == '' | silent NERDTreeMirror | endif
" vimling:
nm <leader><leader>d :call ToggleDeadKeys()<CR>
@@ -99,7 +110,7 @@ set noshowcmd
" Ensure files are read as what I want:
let g:vimwiki_ext2syntax = {'.Rmd': 'markdown', '.rmd': 'markdown','.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'}
map <leader>v :VimwikiIndex<CR>
let g:vimwiki_list = [{'path': '~/.local/share/nvim/vimwiki', 'syntax': 'markdown', 'ext': '.md'}]
let g:vimwiki_list = [{'path': '~/Notes', 'syntax': 'markdown', 'ext': '.md'}]
autocmd BufRead,BufNewFile /tmp/calcurse*,~/.calcurse/notes/* set filetype=markdown
autocmd BufRead,BufNewFile *.ms,*.me,*.mom,*.man set filetype=groff
autocmd BufRead,BufNewFile *.tex set filetype=tex
@@ -114,11 +125,11 @@ set noshowcmd
autocmd BufRead,BufNewFile /tmp/neomutt* map ZQ :Goyo\|q!<CR>
" Automatically deletes all trailing whitespace and newlines at end of file on save. & reset cursor position
autocmd BufWritePre * let currPos = getpos(".")
autocmd BufWritePre * %s/\s\+$//e
autocmd BufWritePre * %s/\n\+\%$//e
autocmd BufWritePre *.[ch] %s/\%$/\r/e
autocmd BufWritePre * cal cursor(currPos[1], currPos[2])
" autocmd BufWritePre * let currPos = getpos(".")
" autocmd BufWritePre * %s/\s\+$//e
" autocmd BufWritePre * %s/\n\+\%$//e
" autocmd BufWritePre *.[ch] %s/\%$/\r/e
" autocmd BufWritePre * cal cursor(currPos[1], currPos[2])
" When shortcut files are updated, renew bash and ranger configs with new material:
autocmd BufWritePost bm-files,bm-dirs !shortcuts
@@ -157,3 +168,7 @@ nnoremap <leader>h :call ToggleHiddenAll()<CR>
" if typed fast without the timeout.
source ~/.config/nvim/shortcuts.vim
au filetype go inoremap <buffer> . .<C-x><C-o>
inoremap {<CR> {<CR>}<ESC>O
source ~/.config/nvim/coc.vim
command! -nargs=0 Prettier :CocCommand prettier.forceFormatDocument