From 6c4636290a7bec3864fe8af017d2ed6ddb7edf8c Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Thu, 1 Aug 2024 11:08:14 +0800 Subject: 2024-08-01 snapshot --- .vimrc | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to '.vimrc') diff --git a/.vimrc b/.vimrc index 14bd21d..57731d5 100644 --- a/.vimrc +++ b/.vimrc @@ -21,7 +21,9 @@ Plugin 'nvim-lua/plenary.nvim' Plugin 'nvim-telescope/telescope.nvim' Plugin 'tpope/vim-surround' Plugin 'puremourning/vimspector' +Plugin 'ilyachur/cmake4vim' " File types +Plugin 'rust-lang/rust.vim' Plugin 'neovimhaskell/haskell-vim' Plugin 'peterhoeg/vim-qml' Plugin 'lervag/vimtex' @@ -72,11 +74,19 @@ autocmd FileType python set ts=4 sw=4 sts=4 expandtab autocmd FileType markdown set ts=4 sw=4 sts=4 expandtab autocmd FileType tex set ts=4 sw=4 sts=4 expandtab autocmd FileType haskell set ts=4 sw=4 sts=4 expandtab +autocmd FileType rust set ts=4 sw=4 sts=4 expandtab autocmd FileType qml set ts=4 sw=4 sts=4 expandtab autocmd FileType c,cpp,asm set ts=8 sw=8 sts=8 noexpandtab +autocmd FileType javascript set ts=8 sw=8 sts=8 noexpandtab set autoindent smartindent +" Force 2 spaces, 4 spaces or 1 tab +nnoremap 2 :set ts=2 sw=2 sts=2 expandtab +nnoremap 4 :set ts=4 sw=4 sts=4 expandtab +nnoremap 8 :set ts=8 sw=8 sts=8 noexpandtab + set background=dark +colorscheme vim let g:airline_theme='onedark' " Popup menu colors @@ -87,8 +97,11 @@ highlight PmenuSel guibg=#61AFEF " Generic shortcuts inoremap :wa nnoremap \ :noh + +" Autoformat autocmd FileType python nnoremap b :!black %:e autocmd FileType c,cpp nnoremap b :pyf /usr/share/clang/clang-format.py +autocmd FileType rust nnoremap b :!rustfmt %:e " ale nnoremap a :ALEToggle @@ -116,6 +129,22 @@ let g:NERDCommentEmptyLines = 1 let g:NERDTrimTrailingWhitespace = 1 let g:NERDToggleCheckAllLines = 1 +" Vimspector +nmap VimspectorToggleBreakpoint +nmap VimspectorStop +nmap VimspectorRestart +nmap VimspectorContinue +nmap VimspectorPause +nmap VimspectorUpFrame +nmap VimspectorDownFrame +nmap VimspectorStepOver +nmap VimspectorStepInto +nmap VimspectorStepOut +nmap di VimspectorBalloonEval +xmap di VimspectorBalloonEval +nmap B VimspectorBreakpoints +nmap D VimspectorDisassemble + " vimtex let g:vimtex_view_general_viewer = 'okular' let g:vimtex_view_general_options = '--unique file:@pdf\#src:@line@tex' @@ -135,8 +164,8 @@ let g:pencil#map#suspend_af = 'K' let g:pencil#textwidth = 74 augroup pencil autocmd! - " autocmd FileType markdown,mkd call pencil#init() - autocmd FileType text call pencil#init() + autocmd FileType markdown,mkd call pencil#init() + " autocmd FileType text call pencil#init() augroup END " vim-workspace -- cgit v1.2.3