Skip to content

Instantly share code, notes, and snippets.

@kmatt
Last active September 16, 2026 19:10
Show Gist options
  • Select an option

  • Save kmatt/fc9444a9f415f2efeebbe509cf8bc980 to your computer and use it in GitHub Desktop.

Select an option

Save kmatt/fc9444a9f415f2efeebbe509cf8bc980 to your computer and use it in GitHub Desktop.
MYVIMRC
" Linux: curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
" PowerShell: iwr -useb https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim |` ni $HOME/.vim/autoload/plug.vim -Force
" `:!pip install setuptools` may be needed for python-mode
let g:pymode_python = 'python3'
let g:python3_host_prog = expand('~/.local/bin/python')
"let g:python3_host_prog = expand('/usr/bin/python3')
set clipboard=unnamed "system clipboard
set encoding=utf-8
set fillchars+=stl:─,stlnc:─ " Lines between splits
set go+=b
set hlsearch
set ignorecase
set incsearch
set laststatus=2
set modeline
set mouse=n
"set mouse=r
set nocul
set nofoldenable
set noundofile
set nu
set pastetoggle=<F2>
set smartcase
set splitright
set switchbuf=useopen,usetab
set tabstop=4 softtabstop=4 shiftwidth=4 expandtab
set vb t_vb= " Turn off visual bell, error flash
set wrap
call plug#begin()
":'<,'>sort /Plug '\w\+\//
Plug 'jlanzarotta/bufexplorer'
Plug 'rickhowe/diffchar.vim'
Plug 'whiteinge/diffconflicts'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'itchyny/lightline.vim'
Plug 'yegappan/mru'
Plug 'mtth/scratch.vim'
Plug 'godlygeek/tabular'
Plug 'csexton/trailertrash.vim'
Plug 'tpope/vim-commentary'
Plug 'chrisbra/vim-diff-enhanced'
Plug 'tpope/vim-fugitive'
Plug 'gabrielelana/vim-markdown'
Plug 'lbrayner/vim-rzip'
Plug 'tpope/vim-vinegar'
Plug 'stephpy/vim-yaml'
Plug 'kmatt/rainbow_csv.vim'
Plug 'cespare/vim-toml'
Plug 'shaoran/vim-ruff'
Plug 'python-mode/python-mode', { 'for': 'python', 'branch': 'develop' }
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'jpalardy/vim-slime'
"Plug 'bullets-vim/bullets.vim'
" Colorschemes
Plug 'dsolstad/vim-wombat256i'
Plug 'ericbn/vim-solarized'
Plug 'felipefdl/warm-burnout', { 'rtp': 'vim' }
Plug 'gryf/wombat256grf'
Plug 'nordtheme/vim'
call plug#end()
let g:age_enc_params="-R i~/.ssh/id_rsa.pub -a"
let g:age_dec_params="-d -i ~/.ssh/id_rsa"
let g:bullets_enabled_file_types = ['markdown','text','gitcommit','scratch']
let g:DiffUnit = 'Char'
let g:go_version_warning = 0
let g:lsp_use_native_client = 1
let g:lightline = { 'colorscheme': 'wombat' }
let g:netrw_altv=1
let g:pymode_options_colorcolumn = 0
let g:pymode_lint_ignore = ["C901","E115","E265","E401","E402","E501","E702","W0401"]
let g:python_highlight_all = 1
let g:rcsv_max_columns = 30
let g:scratch_height=0.5
let g:scratch_persistence_file='/tmp/vimscratch'
let g:wiki_root = '~/wiki'
let g:yaml_revealer_include_current_key = 1
let g:yaml_revealer_list_item_names = 1
let g:slime_target = "zellij"
let g:slime_python_ipython = 1
function! _EscapeText_python(text)
if slime#config#resolve("python_ipython") && len(split(a:text,"\n")) > 1
return ["%cpaste -q\n", slime#config#resolve("dispatch_ipython_pause"), a:text, "--\n"]
else
let empty_lines_pat = '\(^\|\n\)\zs\(\s*\n\+\)\+'
let no_empty_lines = substitute(a:text, empty_lines_pat, "", "g")
let dedent_pat = '\(^\|\n\)\zs'.matchstr(no_empty_lines, '^\s*')
let dedented_lines = substitute(no_empty_lines, dedent_pat, "", "g")
let except_pat = '\(elif\|else\|except\|finally\)\@!'
let add_eol_pat = '\n\s[^\n]\+\n\zs\ze\('.except_pat.'\S\|$\)'
return substitute(dedented_lines, add_eol_pat, "\n", "g")
end
endfunction
" TSV -> quoted CSV (strips existing commas)
function! TsvToCsv(line1, line2) abort
let l:r = a:line1 . ',' . a:line2
execute 'keeppatterns ' . l:r . "s:,::ge"
execute 'keeppatterns ' . l:r . "s:\t:,:ge"
execute 'keeppatterns ' . l:r . "s:^:':ge"
execute 'keeppatterns ' . l:r . "s:,:',':ge"
execute 'keeppatterns ' . l:r . "s:$:':ge"
endfunction
command! -range=% TsvToCsv call TsvToCsv(<line1>, <line2>)
nnoremap <Leader>tc :TsvToCsv<CR>
xnoremap <Leader>tc :TsvToCsv<CR>
syntax enable
" vim-diff-enhanced
if &diff
let &diffexpr='EnhancedDiff#Diff("git diff", "--diff-algorithm=patience")'
endif
filetype on
filetype indent on
filetype plugin on
set background=dark
colorscheme wombat256grf
set guifont=FiraCode-Regular:h12
if has('gui_running')
colorscheme warm-burnout-dark
"colorscheme wombat256grf
endif
" Indent guides
let g:leadmultispace = ' ⋮ · ⋮ · ⋮ · ⋮ · ⋮ · ⋮ · ⋮ · ⋮'
set listchars=trail:·,precedes:«,extends:»,tab:▸\
"autocmd FileType python,yaml call interdental#toggle(1)
" JSON format
command! Jsonf :execute '%!jq .'
" SQL format
command! Sqlf :execute '%!sqlfluff format -i all --dialect duckdb - 2>/dev/null'
" Buffer nav
noremap <C-S-left> :bp<CR>
noremap <C-S-right> :bn<CR>
nnoremap <silent> <F12> :BufExplorer<CR>
" Tabs to spaces
nnoremap <Leader>detab :%s:\t: :g<CR>
" Trim trailing whitespac
hi iCursor guifg=Black guibg=White
" When using vimdiff or diff mode
highlight DiffAdd term=bold ctermbg=darkgreen ctermfg=white cterm=bold guibg=DarkGreen guifg=White gui=bold
highlight DiffText term=reverse,bold ctermbg=darkred ctermfg=yellow cterm=bold guibg=DarkRed guifg=yellow gui=bold
highlight DiffChange term=bold ctermbg=black ctermfg=white cterm=bold guibg=Black guifg=White gui=bold
highlight DiffDelete term=none ctermbg=darkblue ctermfg=darkblue cterm=none guibg=DarkBlue guifg=DarkBlue gui=none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment