Last active
March 7, 2025 21:12
-
-
Save damienstanton/2e09f1cbff5ae530445afa84b7e6fdd7 to your computer and use it in GitHub Desktop.
dot2 exports
This file contains hidden or 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
{ | |
"diagnostic.virtualText": true, | |
"diagnostic.errorSign": "💣", | |
"diagnostic.warningSign": "🚧 ", | |
"diagnostic.infoSign": "📘 ", | |
"diagnostic.hintSign": "🔎 ", | |
"python.linting.mypyEnabled": true, | |
"haskell.liquidOn": true, | |
"languageserver": { | |
"go": { | |
"command": "gopls", | |
"rootPatterns": ["go.mod"], | |
"trace.server": "verbose", | |
"filetypes": ["go"] | |
}, | |
"haskell": { | |
"command": "haskell-language-server-wrapper", | |
"args": ["--lsp"], | |
"rootPatterns": [ | |
"*.cabal", | |
"stack.yaml", | |
"cabal.project", | |
"package.yaml", | |
"hie.yaml" | |
], | |
"filetypes": ["haskell", "lhaskell"] | |
}, | |
"ocaml-lsp": { | |
"command": "opam", | |
"args": ["config", "exec", "--", "ocamllsp"], | |
"filetypes": ["ocaml", "reason"] | |
} | |
} | |
} |
This file contains hidden or 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
#!/usr/bin/env zsh | |
if [[ "$USER" == "root" ]]; then USERCOLOR="red"; else USERCOLOR="yellow"; fi | |
check_git_prompt_info() { | |
if git rev-parse --git-dir > /dev/null 2>&1; then | |
if [[ -z $(git_prompt_info) ]]; then | |
echo "%{$fg[blue]%}detached-head%{$reset_color%}) $(git_prompt_status)%{$fg[yellow]%}::" | |
else | |
echo "$(git_prompt_info) $(git_prompt_status)%{$fg_bold[cyan]%}:: " | |
fi | |
else | |
echo "%{$fg_bold[cyan]%}:: " | |
fi | |
} | |
# Updates editor information when the keymap changes. | |
zle-keymap-select() { | |
zle reset-prompt | |
zle -R | |
} | |
zle -N zle-keymap-select | |
function vi_mode_prompt_info() { | |
echo "${${KEYMAP/vicmd/[% N]%}/(main|viins)/[% I]%}" | |
} | |
PROMPT='%{$fg_no_bold[magenta]%}[%2~]\ | |
$(check_git_prompt_info)\ | |
%{$reset_color%}' | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[blue]%}[ " | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[blue]%}]" | |
ZSH_THEME_GIT_PROMPT_DIRTY="" | |
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[green]%} ✔" | |
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg_bold[green]%}+" | |
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg_bold[blue]%}!" | |
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg_bold[red]%}-" | |
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg_bold[magenta]%}>" | |
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[yellow]%}#" | |
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[cyan]%}?" | |
ZSH_THEME_GIT_PROMPT_AHEAD=" %{$fg_bold[white]%}^" | |
ZSH_THEME_GIT_PROMPT_SHA_BEFORE=" %{$fg_bold[white]%}[%{$fg_bold[blue]%}" | |
ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$fg_bold[white]%}]" |
This file contains hidden or 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
"""""""""" | |
" +----+ " | |
" | DS | " | |
" +----+ " | |
"""""""""" | |
" General Editor Config | |
" --------------------- | |
set tabstop=4 | |
set shiftwidth=4 | |
set noexpandtab | |
set autoindent | |
set number | |
set relativenumber | |
set mouse=a | |
set backspace=indent,eol,start | |
set updatetime=300 | |
set splitbelow | |
set ignorecase smartcase | |
set colorcolumn=80 | |
set textwidth=80 | |
set timeoutlen=1000 ttimeoutlen=0 " adjust for esc delay | |
set splitright | |
" enable remap of motions captured by the terminal | |
silent !stty -ixon > /dev/null 2>/dev/null | |
call plug#begin('~/.vim/plugged') | |
" General Plugins | |
" --------------- | |
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } | |
Plug 'airblade/vim-gitgutter' | |
Plug 'matze/vim-move' | |
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } | |
Plug 'junegunn/fzf.vim' | |
Plug 'terryma/vim-multiple-cursors' | |
Plug 'zivyangll/git-blame.vim' | |
Plug 'tpope/vim-commentary' | |
Plug 'christoomey/vim-system-copy' | |
Plug 'cormacrelf/vim-colors-github' | |
Plug 'tomasiser/vim-code-dark' | |
Plug 'neoclide/coc.nvim' | |
Plug 'neoclide/coc.nvim', {'branch': 'release'} | |
Plug 'itchyny/lightline.vim' | |
Plug 'machakann/vim-highlightedyank' | |
Plug 'rust-lang/rust.vim' | |
Plug 'rhysd/vim-clang-format' | |
" Colorschemes | |
" ------ | |
Plug 'NLKNguyen/papercolor-theme' | |
" Language plugins | |
" ---------------- | |
Plug 'cespare/vim-toml' | |
Plug 'leafgarland/typescript-vim' | |
Plug 'damienstanton/vim-swift' | |
Plug 'fatih/vim-go' | |
Plug 'derekelkins/agda-vim' | |
call plug#end() | |
" Style & Function | |
" ---------------- | |
set grepprg=rg\ --vimgrep\ --no-heading\ --smart-case | |
" Uncomment if running in a possibly non-truecolor term | |
" if exists('+termguicolors') | |
" let &t_8f="\<Esc>[38;2;%lu;%lu;%lum" | |
" let &t_8b="\<Esc>[48;2;%lu;%lu;%lum" | |
" set termguicolors | |
" endif | |
" indent by 2 for js/ts | |
au FileType javascript setlocal ts=2 sw=2 expandtab | |
au FileType typescript setlocal ts=2 sw=2 expandtab | |
set termguicolors | |
set background=light | |
colorscheme PaperColor | |
hi normal guibg=NONE ctermbg=NONE | |
let g:lightline = { | |
\ 'colorscheme': 'PaperColor', | |
\ 'active': { | |
\ 'left': [ [ 'mode', 'paste' ], | |
\ [ 'cocstatus', 'readonly', 'filename', 'modified' ] ] | |
\ }, | |
\ 'component_function': { | |
\ 'filename': 'LightlineFilename', | |
\ 'cocstatus': 'coc#status' | |
\ } | |
\} | |
" following functions and mappings provide LSP details in LightLine | |
" and allow for forced autocompletion via ctrl+. | |
function! LightlineFilename() | |
return expand('%:t') !=# '' ? @% : '[No Name]' | |
endfunction | |
inoremap <silent><expr> <TAB> | |
\ pumvisible() ? "\<C-n>" : | |
\ <SID>check_back_space() ? "\<TAB>" : | |
\ coc#refresh() | |
function! s:check_back_space() abort | |
let col = col('.') - 1 | |
return !col || getline('.')[col - 1] =~# '\s' | |
endfunction | |
inoremap <silent><expr> <c-.> coc#refresh() | |
if exists('*complete_info') | |
inoremap <expr> <cr> complete_info()["selected"] != "-1" ? "\<C-y>" : "\<C-g>u\<CR>" | |
else | |
imap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>" | |
endif | |
let g:tmuxline_powerline_separators=0 | |
set cmdheight=2 | |
set updatetime=300 | |
set signcolumn=yes | |
set splitright | |
set splitbelow | |
" Language specific lints/syntax | |
" ------------------------------ | |
" JSON | |
" ---- | |
autocmd FileType json syntax match Comment +\/\/.\+$+ | |
" Rust | |
" ---- | |
let g:rust_clip_command = 'pbcopy' | |
let g:rustfmt_autosave = 1 | |
nnoremap <leader>h :CocCommand rust-analyzer.toggleInlayHints<CR> | |
nnoremap <leader>tr :CocCommand rust-analyzer.syntaxTree<CR> | |
nnoremap <leader>hr :CocCommand rust-analyzer.viewHir<CR> | |
" Go | |
" -- | |
let g:go_fmt_command = "goimports" | |
" Go (with generics & go2go tool) | |
" ------------------------------- | |
au BufNewFile,BufRead,BufReadPost *.go2 set syntax=go | |
" Java | |
" ---- | |
let java_ignore_javadoc=1 | |
" Turn markdown buffers into PDFs automatically | |
function! ToPDF() | |
augroup markdown_render | au! | |
autocmd BufWritePost *.md !md-to-pdf <afile>:p:S | |
augroup end | |
augroup lhs_render | au! | |
autocmd BufWritePost *.lhs !pandoc <afile> -s -o <afile>.pdf | |
augroup end | |
endfunction | |
" Keybindings | |
" ----------- | |
let g:move_key_modifier='C' | |
let g:multi_cursor_use_default_mapping=0 | |
let g:multi_cursor_start_key='g<C-x>' | |
let g:multi_cursor_next_key='<C-x>' | |
let g:multi_cursor_quit_key='<Esc>' | |
nmap <silent> [g <Plug>(coc-diagnostic-prev) | |
nmap <silent> ]g <Plug>(coc-diagnostic-next) | |
nmap <silent> gd <Plug>(coc-definition) | |
nmap <silent> gy <Plug>(coc-type-definition) | |
nmap <silent> gi <Plug>(coc-implementation) | |
nmap <silent> gr <Plug>(coc-references-used) | |
nnoremap <silent> <C-b> :NERDTreeToggle<CR> | |
nnoremap <C-q> :qa<CR> | |
nnoremap <C-f> :Rg<CR> | |
noremap <silent> <C-p> :Files<CR> | |
nnoremap <silent> gf :GFiles<CR> | |
nnoremap <silent> vt :vnew <bar> term<CR>a | |
nnoremap <silent> ht :new <bar> term<CR>a | |
nnoremap <silent> <C-t> :tabNext<CR> | |
nnoremap <silent> K :call <SID>show_documentation()<CR> | |
nnoremap <leader><SPACE> :CocAction<CR> | |
nnoremap <silent> <space>o :<C-u>CocList outline<cr> | |
nnoremap <silent> <space>s :<C-u>CocList -I symbols<cr> | |
nnoremap <silent> <space>i :call CocActionAsync('codeAction', '', 'Implement missing members')<cr> | |
nnoremap <silent> <space>a :CocAction<cr> | |
vnoremap <C-f> y/<C-R>"<CR> | |
vnoremap <leader>" c""<ESC>P | |
inoremap jk <ESC> | |
tnoremap <Esc> <C-\><C-n> | |
" Symbol renaming. | |
nmap <leader>rn <Plug>(coc-rename) | |
nmap <silent> <TAB> <Plug>(coc-range-select) | |
autocmd CursorHold * silent call CocActionAsync('highlight') | |
" Keywords | |
" -------- | |
:command JSON %!jq '.' | |
:command PDF :call ToPDF() | |
" vscode-like autocompletion | |
inoremap <silent><expr> <TAB> | |
\ coc#pum#visible() ? coc#_select_confirm() : | |
\ coc#expandableOrJumpable() ? | |
\ "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" : | |
\ CheckBackSpace() ? "\<TAB>" : | |
\ coc#refresh() | |
function! CheckBackSpace() abort | |
let col = col('.') - 1 | |
return !col || getline('.')[col - 1] =~# '\s' | |
endfunction | |
let g:coc_snippet_next = '<tab>' | |
" Distraction free mode | |
runtime presentation.vim |
This file contains hidden or 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
font_size 14.0 | |
font_family Iosevka | |
background #ffffff | |
foreground #414141 | |
cursor #5e76c7 | |
selection_background #6f6a4e | |
color0 #414141 | |
color8 #3e3e3e | |
color1 #b23670 | |
color9 #da3365 | |
color2 #66781d | |
color10 #829428 | |
color3 #cc6e33 | |
color11 #cc6e33 | |
color4 #3b5ea7 | |
color12 #3b5ea7 | |
color5 #a353b2 | |
color13 #a353b2 | |
color6 #66781d | |
color14 #829428 | |
color7 #ffffff | |
color15 #f1f1f1 | |
selection_foreground #ffffff | |
disable_ligatures never |
This file contains hidden or 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
let s:hidden_all=0 | |
function! ToggleHiddenAll() | |
if s:hidden_all == 0 | |
let s:hidden_all=1 | |
" syntax off | |
set noshowmode | |
set noruler | |
set laststatus=0 | |
set noshowcmd | |
set colorcolumn= | |
set nonumber | |
set norelativenumber | |
else | |
let s:hidden_all=0 | |
" syntax on | |
set showmode | |
set ruler | |
set laststatus=2 | |
set showcmd | |
set colorcolumn=100 | |
set number | |
set relativenumber | |
endif | |
endfunction | |
nnoremap <silent> <S-h> :call ToggleHiddenAll()<CR> |
This file contains hidden or 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
add_newline = true | |
command_timeout = 2000 | |
[directory] | |
home_symbol = "🏠 " | |
[character] | |
success_symbol = "[::](bold green)" | |
vicmd_symbol = "[v:](bold green)" | |
error_symbol = "[::](bold red)" |
This file contains hidden or 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
########## | |
# +----+ # | |
# | DS | # | |
# +----+ # | |
########## | |
export EDITOR="nvim" | |
export GIT_EDITOR="nvim" | |
export TERM="xterm-256color" | |
export ZSH=$HOME/.oh-my-zsh | |
export BAT_THEME="OneHalfLight" | |
DEFAULT_USER="damien" | |
ZSH_THEME="ds" | |
COMPLETION_WAITING_DOTS="true" | |
KEYTIMEOUT=1 | |
plugins=(git dirhistory git-extras pip macos sudo wd vi-mode) | |
# imports | |
source $HOME/zsh/lang.sh | |
source $ZSH/oh-my-zsh.sh | |
# custom binaries | |
export PATH="$HOME/bin:$PATH" | |
# cargo-installed binaries | |
export PATH="$HOME/.cargo/bin:$PATH" | |
# pip-installed binaries | |
export PATH="$HOME/.local/bin:$PATH" | |
# fzf and fd configs | |
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh | |
export FZF_DEFAULT_COMMAND="fd --type file --color=always" | |
export FZF_DEFAULT_OPTS="--ansi" | |
source $HOME/fzf-theme/fzf-papercolor.sh | |
# opam configuration | |
test -r /Users/damien/.opam/opam-init/init.zsh && . /Users/damien/.opam/opam-init/init.zsh > /dev/null 2> /dev/null || true | |
export PATH="$HOME/.opam/default/bin:$PATH" | |
# haskell path | |
export PATH="$HOME/.ghcup/bin:$PATH" | |
export PATH="$HOME/.ghcup/ghc/8.10.5/bin:$PATH" | |
# starship promot | |
eval "$(starship init zsh)" | |
# force theme (m2 bug?) | |
omz theme use ds | |
# force brew onto path (m2 bug?) | |
eval "$(/opt/homebrew/bin/brew shellenv)" | |
# fzf | |
if [[ ! "$PATH" == */opt/homebrew/opt/fzf/bin* ]]; then | |
PATH="${PATH:+${PATH}:}/opt/homebrew/opt/fzf/bin" | |
fi | |
[[ $- == *i* ]] && source "/opt/homebrew/opt/fzf/shell/completion.zsh" 2> /dev/null | |
source "/opt/homebrew/opt/fzf/shell/key-bindings.zsh" | |
[ -f "/Users/damien/.ghcup/env" ] && source "/Users/damien/.ghcup/env" # ghcup-env | |
# openjdk | |
export PATH="/opt/homebrew/opt/openjdk/bin:$PATH" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment