From 11a249233f95e9589e8d2e2a6f8973a2f290f279 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 15 Dec 2020 14:30:19 +0200 Subject: Added improved folding, cursor changes shape in insert mode, enabled and improved C# programming tools --- .vimrc | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to '.vimrc') diff --git a/.vimrc b/.vimrc index dd225a9..8714c6d 100644 --- a/.vimrc +++ b/.vimrc @@ -19,11 +19,12 @@ Plug 'neoclide/coc.nvim', {'branch': 'release'} " IntelliSense practically Plug 'itchyny/lightline.vim' " Statusline for Vim Plug 'tpope/vim-fugitive' " git integration Plug 'mbbill/undotree' " Easily interact with undo history -" Plug 'OmniSharp/omnisharp-vim' " C# tools (autocompletion, ...) +Plug 'OmniSharp/omnisharp-vim' " C# tools (autocompletion, ...) Plug 'wakatime/vim-wakatime' " Time tracking via wakaime.com Plug 'dense-analysis/ale' " Syntax checker via LSP Plug 'ryanoasis/vim-devicons' " Icons on stuff like NERDTree Plug 'honza/vim-snippets' " Ready snippets for some langauges +Plug 'pseewald/vim-anyfold' " Better folding """""""""""""""""""""""""""""""" @@ -90,11 +91,34 @@ let g:syntastic_auto_loc_list=1 let g:syntastic_check_on_open=1 let g:syntastic_check_on_wq=0 +""""""""""""""""""""""""""""""" +" Vim-anyfold settings +""""""""""""""""""""""""""""""" + +filetype plugin indent on +syntax on +autocmd Filetype * AnyFoldActivate " activate for all filetypes +set foldlevel=99 " Open all folds by default + """"""""""""""""""""""""""""""" " Vim settings """"""""""""""""""""""""""""""" +autocmd InsertEnter,InsertLeave * set cul! " Highlight current line, when in insert mode set backspace=indent,eol,start " Better backspace functionality +set scrolloff=0 " Don't keep any screen lines above or below the cursor + +" Thin cursor in insert mode in Gnome-Terminal (version >=3.16 ; also works with Terminator) +if has("autocmd") + au VimEnter,InsertLeave * silent execute '!echo -ne "\e[1 q"' | redraw! + au InsertEnter,InsertChange * + \ if v:insertmode == 'i' | + \ silent execute '!echo -ne "\e[5 q"' | redraw! | + \ elseif v:insertmode == 'r' | + \ silent execute '!echo -ne "\e[3 q"' | redraw! | + \ endif + au VimLeave * silent execute '!echo -ne "\e[ q"' | redraw! +endif " Ctrl+c, Ctrl+v, Ctrl+z, Ctrl+a and Ctrl+s bindings " Partly taken from: https://gist.github.com/jshih/3423345 @@ -120,7 +144,6 @@ nnoremap :tabn nnoremap :tabp set number " Show line numbers to the left -set cursorline " Highlight the current line nnoremap = :tab ter ++close lazygit @@ -135,7 +158,7 @@ set mouse=a " Mouse support set tabstop=4 " Show tabs as 4 wide set shiftwidth=4 " Indent with 4 spaces -set expandtab " Convert tabs to spaces +" set expandtab " Convert tabs to spaces autocmd Filetype css setlocal tabstop=2 " Show CSS tabs as 2 spaces " When you press F6 it will toggle a "spell check mode", @@ -288,6 +311,7 @@ autocmd Filetype cs nmap gi : OmniSharpFindImplementations gr : OmniSharpFindUsages autocmd FileType cs nmap : OmniSharpRename autocmd FileType cs nmap ff : OmniSharpCodeFormat +autocmd FileType cs nmap fu : OmniSharpFixUsings """"""""""""""""""""""""""""""" " COC settings -- cgit v1.2.3