From 8de802f73a8f2831d27a69f02eb5d125c4b9e80b Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Mon, 10 May 2021 19:03:35 +0200 Subject: [PATCH] Update vimrc --- home/.config/vim/vimrc | 138 +++++++++++++++++------------------------ 1 file changed, 56 insertions(+), 82 deletions(-) diff --git a/home/.config/vim/vimrc b/home/.config/vim/vimrc index da4799d..4bcd911 100755 --- a/home/.config/vim/vimrc +++ b/home/.config/vim/vimrc @@ -1,54 +1,34 @@ -" TODO: Spell Checking - -set nocompatible " Disable vi compatibilty (Use vi improved only) - required for Vundle set encoding=utf-8 " Use UTF-8 -syntax enable " Turn on syntax highlighting set showmatch " Show matching brackets set ignorecase " Do case insensitive matching set incsearch " Show partial matches for a search phrase set number " Show numbers set relativenumber " Show relative numbersi set undolevels=999 " Lots of these +set history=1000 " More history set hlsearch " Highlight Search -set tabstop=4 " Tab size set noexpandtab " Do not expand tab into spaces (change to expandtab to use spaces) +set tabstop=4 " Tab size set shiftwidth=4 " Indentation size set softtabstop=4 " Tabs/Spaces interrop +set tabpagemax=50 " More tabs set autoindent " Enable autoindent set ruler " Show cursor position set cursorline " Highlight cursor line -set mouse=a " Enable mouse mode set backspace=indent,eol,start " Delete everything set laststatus=2 " Always show status line set wildmode=longest,list,full " Enable autocompletion set splitbelow splitright " Split in more natural way - -"set nomodeline " Disable as a security precaution -"set termguicolors " Enable true colors (breaks TTY vim) -"set wildmenu " Enable wildmenu -"set conceallevel=0 " Disable concealing -"set complete-=i " Better completion -"set smarttab " Better tabs -"set ttimeout " Set timeout -"set ttimeoutlen=100 -"set synmaxcol=500 " Syntax limit -"set scrolloff=3 " Scroll offset -"set sidescrolloff=5 -"set autoread " Reload files on change -"set tabpagemax=50 " More tabs -"set history=1000 " More history -"set viminfo^=! " Better viminfo -"set formatoptions+=j " Delete comment character when joining commented lines - -"set listchars=tab:,nbsp:_,trail:,extends:>,precedes:< -"set list " Highlight non whitespace characters -"set nrformats-=octal " 007 != 010 -"set sessionoptions-=options -"set viewoptions-=option -"set listchars=tab:\|\ " Set tab lines -"set listchars=tab:\|\- " Set tab lines with - +set formatoptions+=j " Delete comment character when joining commented lines +set autoread " Reload files on change +set mouse=a " Enable mouse mode (won't have any effect on TTY) +syntax enable " Turn on syntax highlighting +" Non TTY Settings (Uncomment if you are on full graphical environment) +set encoding=utf-8 " Use UTF-8, not ASCII +"set termguicolors " Use true colors (256) " XDG Support +" Avoid using this with root, sudo causes issues with this if empty($MYVIMRC) | let $MYVIMRC = expand(':p') | endif if empty($XDG_CACHE_HOME) | let $XDG_CACHE_HOME = $HOME."/.cache" | endif @@ -70,63 +50,71 @@ set backupdir=$XDG_CACHE_HOME/vim/backup | call mkdir(&backupdir, 'p') set directory=$XDG_CACHE_HOME/vim/swap | call mkdir(&directory, 'p') set undodir=$XDG_CACHE_HOME/vim/undo | call mkdir(&undodir, 'p') -" Always use terminal background -autocmd ColorScheme * highlight! Normal ctermbg=NONE guibg=NONE - " Have Vim jump to the last position when reopening a file if has("autocmd") au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" endif -" Shortcutting split navigation, saving a keystroke -map h -map j -map k -map l - -" Check file in shellcheck -map s :!clear && shellcheck % - -" Copy selected text to system clipboard (requires gvim) -vnoremap "*Y :let @+=@* -map "+P - " Automatically deletes all trailing whitespace on save autocmd BufWritePre * %s/\s\+$//e -" Vundle Init +" Perform shellcheck on files +map s :!clear && shellcheck % + +" Remap splits navigation to just CTRL + hjkl +nnoremap h +nnoremap j +nnoremap k +nnoremap l + +" Make adjusing split sizes a bit more friendly +noremap :vertical resize +3 +noremap :vertical resize -3 +noremap :resize +3 +noremap :resize -3 + +" Vundle +filetype off " required +set nocompatible " be iMproved, required + set rtp+=~/.local/share/vim/bundle/Vundle.vim call vundle#begin('~/.local/share/vim/bundle') -" Plugins -Plugin 'VundleVim/Vundle.vim' -Plugin 'airblade/vim-gitgutter' " Shows Git diff -Plugin 'joshdick/onedark.vim' " OneDark Theme -Plugin 'tpope/vim-fugitive' " Git Wrapper (also shows branch on statusline) -Plugin 'vim-airline/vim-airline' " AirLine statusline -Plugin 'vim-airline/vim-airline-themes' " AirLine statusline themes -Plugin 'scrooloose/nerdtree' " Adds File-tree -Plugin 'Xuyuanp/nerdtree-git-plugin' " Shows git status in nerd-tree +Plugin 'VundleVim/Vundle.vim' " Let vundle manage itself +Plugin 'airblade/vim-gitgutter' " Shows Git diff +Plugin 'joshdick/onedark.vim' " OneDark theme +Plugin 'vim-airline/vim-airline' " AirLine statusline +Plugin 'vim-airline/vim-airline-themes' " AirLine statusline themes Plugin 'vim-syntastic/syntastic' " Syntax checking -Plugin 'PotatoesMaster/i3-vim-syntax' " Add syntax for i3 config -Plugin 'jmcantrell/vim-virtualenv' " Manage Virtual Enviroment -" Vundle End +Plugin 'vim-python/python-syntax' " Python highlighting + call vundle#end() filetype plugin indent on -" NERD Tree -autocmd StdinReadPre * let s:std_in=1 -" Show tree when opening directory -autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif -" Use Ctrl+n to open tree -map :NERDTreeToggle +" User interface / Theme +colorscheme onedark +"autocmd ColorScheme * highlight! Normal ctermbg=NONE guibg=NONE " Terminal background +set guioptions-=m " remove menubar +set guioptions-=T " remove toolbar +set guioptions-=r " remove right-hand scrollbar +set guioptions-=L " remove left-hand scrollbar + +let g:python_highlight_all = 1 " Enable pyhton-syntax support + +" Airline +let g:airline_theme='onedark' +let g:airline#extensions#tabline#enabled = 1 +let g:airline#tabline#formatter = 'unique_tail' +let g:airline_symbols_ascii = 1 " Enable ASCII only for TTY +let g:airline_left_sep = "\uE0B0" " Change to ASCII symbol on TTY (>) +let g:airline_right_sep = "\uE0B2" " Change to ASCII symbol on TTY (<) " Syntastic set statusline+=%#warningmsg# set statusline+=%{SyntasticStatuslineFlag()} set statusline+=%* -let g:syntastic_always_populate_loc_list = 1 +let g:syntastic_alays_populate_loc_list = 1 let g:syntastic_auto_loc_list = 0 let g:syntastic_check_on_open = 1 let g:syntastic_check_on_wq = 0 @@ -135,19 +123,5 @@ let g:syntastic_python_checkers = ['flake8'] map c :SyntasticCheck map z :Errors -" Airline -let g:airline_theme='onedark' -let g:airline#extensions#tabline#enabled = 1 -let g:airline#extensions#tabline#formatter = 'unique_tail' -let g:airline_left_sep = "\uE0B0" -let g:airline_right_sep = "\uE0B2" -" One Dark -let g:onedark_color_overrides = { -\ "comment_grey": {"gui": "#69747C","cterm": "245", "cterm16": "8"}, -\ "gutter_fg_grey": { "gui": "#69747C", "cterm": "245", "cterm16": "8"} -\} -if !exists('$TMUX') - let g:onedark_terminal_italics = 1 -endif -colorscheme onedark +