From 4650767a733ce61f84d9901080bc61de334dd837 Mon Sep 17 00:00:00 2001 From: Alexander Karle Date: Wed, 2 May 2018 12:51:17 -0400 Subject: [PATCH] Tweaking to adhere better to vimrc tips (link below) https://www.reddit.com/r/vim/wiki/vimrctips --- vim/functions.vim | 2 +- vim/theme.vim | 12 +++++++----- vim/vimrc | 14 +++++--------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/vim/functions.vim b/vim/functions.vim index cae07d8..12775ae 100644 --- a/vim/functions.vim +++ b/vim/functions.vim @@ -1,6 +1,6 @@ " A function to execute a command and return to the old position " CREDIT: http://vimcasts.org/episodes/tidying-whitespace/ -function! CMDPreserve(command) +function! CMDPreserve(command) abort " Preparation: save last search, and cursor position. let _s=@/ let l = line(".") diff --git a/vim/theme.vim b/vim/theme.vim index 5ea2a79..fc70a50 100644 --- a/vim/theme.vim +++ b/vim/theme.vim @@ -6,8 +6,13 @@ syntax on " Set cursor line when in insert mode (to indicate insert mode) if(has('autocmd')) - autocmd InsertEnter,InsertLeave * set cul! - autocmd BufNewFile,BufRead *.notes set filetype=markdown + augroup MyCustomAucmds + " removes all autocmds from this group (needed when re-sourcing) + autocmd! + + autocmd InsertEnter,InsertLeave * set cul! + autocmd BufNewFile,BufRead *.notes set filetype=markdown + augroup END " goes back to default augroup endif " COLORSCHEME @@ -18,11 +23,8 @@ if (has("termguicolors")) let g:gruvbox_italic = 1 set termguicolors colorscheme gruvbox - "let g:gruvbox_contrast_dark='hard' " make pythonSelf red not grey highlight link pythonSelf GruvboxBlue - " make functions no longer bold - " hi! link Function GruvboxGreen endif " Needed for termgui in tmux--&term begins w screen-... diff --git a/vim/vimrc b/vim/vimrc index bfb33f2..e1d5f17 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1,17 +1,13 @@ -"============================= -"tab and line number stuff -"============================= "line numbers on set number -"set relativenumber + "tab is really spaces set expandtab + "4 spaces per tab -set tabstop=4 set softtabstop=4 set shiftwidth=4 -"set smartindent --> temp. turned off due to -"python # bug... theres a workaround somewhere +set expandtab set autoindent set smarttab @@ -69,8 +65,8 @@ if(has('persistent_undo') && !empty(finddir('~/.vim/undo', '~'))) set undoreload=10000 endif -" Backup files -set directory=~/.vim/swp +" Backup files to ~/.vim/swp if present, else . +set directory=~/.vim/swp,. " Source helper files " Only load plugins if vim-plug installed! -- libgit2 0.28.4