From 9cb45314f8ee5781f8cb572b86c58f62e61e677b Mon Sep 17 00:00:00 2001 From: Zev Averbach Date: Wed, 6 Oct 2021 11:26:32 +0200 Subject: [PATCH] quite a lot of changes --- vimrc | 63 ++++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 49 insertions(+), 14 deletions(-) diff --git a/vimrc b/vimrc index 3eeadf8..ba86828 100644 --- a/vimrc +++ b/vimrc @@ -1,30 +1,65 @@ +" avoid 'X more file(s) to edit' +filetype on set nocompatible +set confirm + +" prevent the 'no write since last change' message when changing buffers +set hidden + +" Reopen the last edited position in files +au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif + set history +" undo persists after quit +set undofile +set undodir=$HOME/.vim/undo + +" italicize comments +highlight Comment cterm=italic gui=italic set relativenumber " four-space tabs -filetype plugin indent on +filetype indent plugin on +set smartindent + setlocal shiftwidth=2 softtabstop=2 expandtab -au FileType python setl shiftwidth=4 tabstop=4 - -" ctrl-s for save -nnoremap :w -" save and close -nnoremap w :w:bw - -" buffer nav -nnoremap :bp -nnoremap :bn - +au FileType python setl softtabstop=4 shiftwidth=4 tabstop=4 let mapleader = "\" + +" toggle comment +nnoremap gc + +" save all and quit +nnoremap q :waZQ +" save +nnoremap :w +" save and close buffer +nnoremap w :w:bw +nnoremap :bp +nnoremap :bn +" clear highlights +nnoremap :noh +nnoremap p :PlugInstall + +nnoremap f call Black() + +" show number of lines in buffer +nnoremap l :echo line("$") " quickly source vimrc with + s nnoremap s :source ~/.vimrc -" prevent the 'no write since last change' message when changing buffers -set hidden +let g:python3_host_prog = $HOME . '/.local/venv/nvim/bin/python' +let g:black#settings = { + \ 'fast': 1, + \ 'line_length': 100 +\} + call plug#begin('~/.vim/plugged') Plug 'folke/tokyonight.nvim', { 'branch': 'main' } + Plug 'averms/black-nvim', {'do': ':UpdateRemotePlugins'} + Plug 'tpope/vim-commentary' call plug#end() + colorscheme tokyonight