dotfiles

$HOME is where the <3 is
git clone git://git.alexkarle.com/dotfiles.git
Log | Files | Refs | Submodules | README

commit 4650767a733ce61f84d9901080bc61de334dd837 (patch)
parent bbe0bec265cb861dd569776d66bab5d18e1e117c
Author: Alexander Karle <akarle@umass.edu>
Date:   Wed,  2 May 2018 12:51:17 -0400

Tweaking to adhere better to vimrc tips (link below)

https://www.reddit.com/r/vim/wiki/vimrctips

Diffstat:
Mvim/functions.vim | 2+-
Mvim/theme.vim | 12+++++++-----
Mvim/vimrc | 14+++++---------
3 files changed, 13 insertions(+), 15 deletions(-)

diff --git 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 @@ -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 @@ -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!