Skip to content

Instantly share code, notes, and snippets.

@zstatmanweil
Last active June 9, 2021 23:17
Show Gist options
  • Save zstatmanweil/d3bdb97ce1917e5923c7ef1160290a90 to your computer and use it in GitHub Desktop.
Save zstatmanweil/d3bdb97ce1917e5923c7ef1160290a90 to your computer and use it in GitHub Desktop.
call plug#begin('~/.vim/plugged')
"" Dracula
Plug 'dracula/vim', {'as': 'dracula'}
"" One Half color scheme
Plug 'sonph/onehalf', {'as': 'onehalf'}
"" Molokai color scheme
Plug 'tomasr/molokai'
"" Gruvbox color scheme
Plug 'morhetz/gruvbox'
"" Gruvbox config
"let g:gruvbox_contrast_dark = 'hard'
let g:gruvbox_termcolors = '16'
Plug 'christoomey/vim-tmux-navigator'
" Auto indent plug
Plug 'vim-scripts/indentpython.vim'
" Ale for syntax checking
Plug 'dense-analysis/ale'
call plug#end()
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => DISPLAY
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
syntax on
colorscheme molokai
" don't allow colorschemes to set a background color
highlight normal ctermbg=None
highlight nonText ctermbg=None
" see file name
set laststatus=2
" add numbers and relative numbers
set number
set relativenumber
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => ALE
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"" Fixers
let g:ale_fixers = {'javascript': ['prettier'], 'scss': ['stylelint'], 'python': ['black']}
"" Disable warnings about trailing whitespace for Python files.
let g:ale_warn_about_trailing_whitespace = 0
"" Update Ale signs
let g:ale_sign_error = '>>'
let g:ale_sign_warning = '--'
"" Fix automatically on save (not working)
let g:ale_fix_on_save = 1
" Bind F8 to fixing problems with ALE
nmap <F8> <Plug>(ale_fix)
"" Autocompletion using ale
let g:ale_completion_enabled = 1
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => MISC
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""add proper PEP 8 indentation
au BufNewFile,BufRead *.py
\ set tabstop=4 |
\ set softtabstop=4 |
\ set shiftwidth=4 |
\ set textwidth=79 |
\ set expandtab |
\ set autoindent |
\ set fileformat=unix |
" add commands for full stack development
au BufNewFile,BufRead *.js, *.html, *.css
\ set tabstop=2 |
\ set softtabstop=2 |
\ set shiftwidth=2 |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => MAPPINGS
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Map space bar so it adds a space in normal mode
map <space> a<space><esc>
" Map F2 to paste toggle
set pastetoggle=<F2>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"" CHEAT SHEET
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"" EDITING
"" :%s/<search>/<replace>/g "Search and replace entire doc
"" :%s/<search>/<replace>/gc "Confirm search and replace
"" :1,3 s/<search>/<replace>/g "Search and replace lines 1-3
"" C-v (select lines) Shift-I (make edits) ESC "Make same edit to many lines
"" dd "Delete entire line
"" d$ "Delete to end of line
"" d0 "Delete to begin of line
"" dw "Delete word
"" r "Replace letter
"" cw "Change to end of word, insert
"" C "Change to end of line, i
"" INFO
"" C-G "See summary of doc
"" % "Move to matching (,[,{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment