Last active
September 3, 2024 05:20
-
-
Save calvinf/87a19da5d7dc8f4f0cf8 to your computer and use it in GitHub Desktop.
.vimrc file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 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//,.// |
Other useful Linux tools:
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Shell essentials
While not directly vim related, you're probably also trying to remember to install the following:
Other dot files
.bashrc
file: https://gist.github.com/calvinf/fcb92711feccf3c4b4de.tmux.conf
file: https://gist.github.com/calvinf/6243987.gitconfig
file: https://gist.github.com/calvinf/0b715fdaec435397fa75.ackrc
file: https://gist.github.com/calvinf/1479064