diff options
Diffstat (limited to '.vimrc')
-rw-r--r-- | .vimrc | 33 |
1 files changed, 31 insertions, 2 deletions
@@ -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 <leader>2 :set ts=2 sw=2 sts=2 expandtab<CR> +nnoremap <leader>4 :set ts=4 sw=4 sts=4 expandtab<CR> +nnoremap <leader>8 :set ts=8 sw=8 sts=8 noexpandtab<CR> + set background=dark +colorscheme vim let g:airline_theme='onedark' " Popup menu colors @@ -87,8 +97,11 @@ highlight PmenuSel guibg=#61AFEF " Generic shortcuts inoremap <C-s> <esc>:w<CR>a nnoremap <leader>\ :noh<CR> + +" Autoformat autocmd FileType python nnoremap <leader>b :!black %<CR>:e<CR> autocmd FileType c,cpp nnoremap <leader>b :pyf /usr/share/clang/clang-format.py<CR> +autocmd FileType rust nnoremap <leader>b :!rustfmt %<CR>:e<CR> " ale nnoremap <leader>a :ALEToggle<CR> @@ -116,6 +129,22 @@ let g:NERDCommentEmptyLines = 1 let g:NERDTrimTrailingWhitespace = 1 let g:NERDToggleCheckAllLines = 1 +" Vimspector +nmap <F2> <Plug>VimspectorToggleBreakpoint +nmap <F3> <Plug>VimspectorStop +nmap <F4> <Plug>VimspectorRestart +nmap <F5> <Plug>VimspectorContinue +nmap <F6> <Plug>VimspectorPause +nmap <F7> <Plug>VimspectorUpFrame +nmap <F8> <Plug>VimspectorDownFrame +nmap <F10> <Plug>VimspectorStepOver +nmap <F11> <Plug>VimspectorStepInto +nmap <F12> <Plug>VimspectorStepOut +nmap <leader>di <Plug>VimspectorBalloonEval +xmap <leader>di <Plug>VimspectorBalloonEval +nmap <leader>B <Plug>VimspectorBreakpoints +nmap <leader>D <Plug>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 |