Skip to content

Instantly share code, notes, and snippets.

@ryanknutson
Last active May 19, 2017 15:10
Show Gist options
  • Save ryanknutson/4bfd570f3fa53d78b0298c03da082516 to your computer and use it in GitHub Desktop.
Save ryanknutson/4bfd570f3fa53d78b0298c03da082516 to your computer and use it in GitHub Desktop.
My Vimrc and Zshrc
set ruler " show the ruler
set nocompatible " need this to do cool stuff
filetype plugin on " filetypes are used
syntax enable " enable syntax processing
set tabstop=4 " number of visual spaces per TAB
set softtabstop=4 " number of spaces in tab when editing
set expandtab " tabs are spaces
set showcmd " show command in bottom bar
set relativenumber " show relative line numbers
set number " show line numbers
set cursorline " highlight current line
filetype indent on " load filetype-specific indent files
set wildmenu " visual autocomplete for command menu
set lazyredraw " redraw only when we need to.
set showmatch " highlight matching [{()}]
set incsearch " search as characters are entered
set hlsearch " highlight matches
let html_no_rendering=1 " Removes link underline when editing html files
set autoread " set to auto read when a file is changed from the outside
let mapleader="," " leader is comma
" turn off search highlight
nnoremap <leader><space> :nohlsearch<CR>
" Makes the cursor work in tmux
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
endif
augroup configgroup
autocmd!
autocmd VimEnter * highlight clear SignColumn
autocmd BufWritePre *.php,*.py,*.js,*.txt,*.hs,*.java,*.md
\:call <SID>StripTrailingWhitespaces()
autocmd FileType java setlocal noexpandtab
autocmd FileType java setlocal list
autocmd FileType java setlocal listchars=tab:+\ ,eol:-
autocmd FileType java setlocal formatprg=par\ -w80\ -T4
autocmd FileType php setlocal expandtab
autocmd FileType php setlocal list
autocmd FileType php setlocal listchars=tab:+\ ,eol:-
autocmd FileType php setlocal formatprg=par\ -w80\ -T4
autocmd FileType ruby setlocal tabstop=2
autocmd FileType ruby setlocal shiftwidth=2
autocmd FileType ruby setlocal softtabstop=2
autocmd FileType ruby setlocal commentstring=#\ %s
autocmd FileType python setlocal commentstring=#\ %s
autocmd BufEnter *.cls setlocal filetype=java
autocmd BufEnter *.zsh-theme setlocal filetype=zsh
autocmd BufEnter Makefile setlocal noexpandtab
autocmd BufEnter *.sh setlocal tabstop=2
autocmd BufEnter *.sh setlocal shiftwidth=2
autocmd BufEnter *.sh setlocal softtabstop=2
augroup END
# I use zsh - this is the bottom of my file
alias fbcapa="fbcap -z CDT=-0500,CST=-0600"
alias lsmod="ls -l --color | awk '{k=0;for(i=0;i<=8;i++)k+=((substr(\$1,i+2,1)~/[rwx]/) \
*2^(8-i));if(k)printf(\"%0o \",k);print}'"
export EDITOR='vim'
alias tb="nc termbin.com 9999"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment