Skip to content

Instantly share code, notes, and snippets.

@calvinf
Last active September 3, 2024 05:20
Show Gist options
  • Save calvinf/87a19da5d7dc8f4f0cf8 to your computer and use it in GitHub Desktop.
Save calvinf/87a19da5d7dc8f4f0cf8 to your computer and use it in GitHub Desktop.
.vimrc file
" Enable pathogen
call pathogen#infect()
" Standard Vim settings
filetype on
filetype indent on
filetype plugin on
syntax on
set number
set showmatch
set ignorecase
set smartcase
set shiftwidth=2
set softtabstop=2
set smartindent
set autoindent
set bs=indent,eol,start "backspace over everything in insert mode
" Color settings, may be needed for some terminals
" http://vim.wikia.com/wiki/256_colors_in_vim
" set t_Co=256 " uncomment if something isn't working
set background=dark
colorscheme dracula
highlight Normal ctermbg=NONE
highlight nonText ctermbg=NONE
" vim-airline settings
set laststatus=2
" vim-gitgutter
let g:gitgutter_enabled = 1
" For when you forget to sudo.. Really Write the file.
cmap w!! w !sudo tee % >/dev/null
" https://github.com/thoughtstream/Damian-Conway-s-Vim-Setup
"====[ Show when lines extend past column 80 "]================================>-<=====================
highlight ColorColumn ctermbg=magenta
function! MarkMargin (on)
if exists('b:MarkMargin')
try
call matchdelete(b:MarkMargin)
catch /./
endtry
unlet b:MarkMargin
endif
if a:on
let b:MarkMargin = matchadd('ColorColumn', '\%81v', 100)
endif
endfunction
augroup MarkMargin
autocmd!
autocmd BufEnter * :call MarkMargin(1)
autocmd BufEnter *.vp* :call MarkMargin(0)
augroup END
" Automatically create a directory for the vim swap files
if filewritable("/tmp") && ! filewritable("/tmp/vim")
silent execute '!umask 002; mkdir /tmp/vim'
endif
" Use /tmp for the swap files
set backupdir=/tmp/vim//,/tmp//,./.backup//,.//
set directory=/tmp/vim//,/tmp//,./.backup//,.//
@calvinf
Copy link
Author

calvinf commented Feb 20, 2021

@calvinf
Copy link
Author

calvinf commented Sep 3, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment