├── .gitignore ├── ghci └── .ghci ├── idea └── .ideavimrc ├── README.md ├── setup.sh ├── zsh └── .zshrc ├── iterm2 └── Argonaut.itermcolors └── nvim └── init.vim /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /ghci/.ghci: -------------------------------------------------------------------------------- 1 | :set prompt "\x03BB> " 2 | :set prompt-cont " > " 3 | -------------------------------------------------------------------------------- /idea/.ideavimrc: -------------------------------------------------------------------------------- 1 | " =========== 2 | " KEYBINDINGS 3 | " =========== 4 | 5 | " Back to normal mode 6 | imap jj 7 | set shiftwidth=2 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dotfiles 2 | These dotfiles aren't special, but they're mine. 3 | 4 | 1. Install `zsh`, `nvim` and `prezto` 5 | 2. run `setup.sh` 6 | 7 | ## `` fix for neovim: 8 | ``` 9 | cd ~ 10 | infocmp $TERM | sed 's/kbs=^[hH]/kbs=\\177/' > $TERM.ti 11 | tic $TERM.ti 12 | ``` 13 | 14 | -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | # 3 | # # ZSH 4 | # rm ~/.zshrc 5 | # ln -s ~/Setup/dotfiles/zsh/.zshrc ~/.zshrc 6 | # 7 | # Neovim 8 | mkdir -p ~/.config/nvim/ 9 | ln -s ~/Setup/dotfiles/nvim/init.vim ~/.config/nvim/init.vim 10 | 11 | # GHCi 12 | ln -s ~/Setup/dotfiles/ghci/.ghci ~/.ghci 13 | # 14 | # # Idea 15 | # ln -s ~/Setup/dotfiles/idea/.ideavimrc ~/.ideavimrc 16 | # 17 | # hush macoS login 18 | touch ~/.hushlogin 19 | -------------------------------------------------------------------------------- /zsh/.zshrc: -------------------------------------------------------------------------------- 1 | # Source Prezto. 2 | if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then 3 | source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" 4 | fi 5 | 6 | # Customize to your needs... 7 | wd() { 8 | . /Users/cor/bin/wd/wd.sh 9 | } 10 | 11 | # Open book script 12 | alias ob='~/Setup/SchoolScripts/open-book.swift' 13 | alias eob='nvim ~/Setup/SchoolScripts/open-book.swift' 14 | 15 | export VISUAL=nvim 16 | export EDITOR="$VISUAL" 17 | export GPG_TTY=$(tty) #GPG fix for macOS 18 | 19 | test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh" 20 | -------------------------------------------------------------------------------- /iterm2/Argonaut.itermcolors: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ansi 0 Color 6 | 7 | Blue Component 8 | 0.13574660633484159 9 | Green Component 10 | 0.13574660633484159 11 | Red Component 12 | 0.13574660633484159 13 | 14 | Ansi 1 Color 15 | 16 | Blue Component 17 | 0.058871746063232422 18 | Green Component 19 | 0.0 20 | Red Component 21 | 1 22 | 23 | Ansi 10 Color 24 | 25 | Blue Component 26 | 0.35646489677720017 27 | Green Component 28 | 0.88189995290000001 29 | Red Component 30 | 0.67126059688058637 31 | 32 | Ansi 11 Color 33 | 34 | Blue Component 35 | 0.25792301594327316 36 | Green Component 37 | 0.82281720845913986 38 | Red Component 39 | 1 40 | 41 | Ansi 12 Color 42 | 43 | Blue Component 44 | 1 45 | Green Component 46 | 0.5733030673510271 47 | Red Component 48 | 0.00053359762918048226 49 | 50 | Ansi 13 Color 51 | 52 | Blue Component 53 | 0.92307692307692313 54 | Green Component 55 | 0.37417232689266022 56 | Red Component 57 | 0.60504487800788187 58 | 59 | Ansi 14 Color 60 | 61 | Blue Component 62 | 0.94094775504779782 63 | Green Component 64 | 1 65 | Red Component 66 | 0.4042010611351281 67 | 68 | Ansi 15 Color 69 | 70 | Blue Component 71 | 1 72 | Green Component 73 | 1 74 | Red Component 75 | 1 76 | 77 | Ansi 2 Color 78 | 79 | Blue Component 80 | 0.04123397171497345 81 | Green Component 82 | 0.88189995288848877 83 | Red Component 84 | 0.54928803443908691 85 | 86 | Ansi 3 Color 87 | 88 | Blue Component 89 | 0.0 90 | Green Component 91 | 0.72656995058059692 92 | Red Component 93 | 1 94 | 95 | Ansi 4 Color 96 | 97 | Blue Component 98 | 0.97294086217880249 99 | Green Component 100 | 0.55481654405593872 101 | Red Component 102 | 0.0 103 | 104 | Ansi 5 Color 105 | 106 | Blue Component 107 | 0.65052211284637451 108 | Green Component 109 | 0.26314744353294373 110 | Red Component 111 | 0.42564234137535095 112 | 113 | Ansi 6 Color 114 | 115 | Blue Component 116 | 0.92260181903839111 117 | Green Component 118 | 0.84575581550598145 119 | Red Component 120 | 0.0 121 | 122 | Ansi 7 Color 123 | 124 | Blue Component 125 | 1 126 | Green Component 127 | 1 128 | Red Component 129 | 1 130 | 131 | Ansi 8 Color 132 | 133 | Blue Component 134 | 0.26696832579185525 135 | Green Component 136 | 0.26696832579185525 137 | Red Component 138 | 0.26696832579185525 139 | 140 | Ansi 9 Color 141 | 142 | Blue Component 143 | 0.24923402424592656 144 | Green Component 145 | 0.15470406080870669 146 | Red Component 147 | 1 148 | 149 | Background Color 150 | 151 | Blue Component 152 | 0.097826063632965088 153 | Green Component 154 | 0.060920167714357376 155 | Red Component 156 | 0.0540635846555233 157 | 158 | Bold Color 159 | 160 | Blue Component 161 | 0.60246169567108154 162 | Green Component 163 | 0.6100342869758606 164 | Red Component 165 | 0.61956524848937988 166 | 167 | Cursor Color 168 | 169 | Blue Component 170 | 0.0940093994140625 171 | Green Component 172 | 0.0 173 | Red Component 174 | 1 175 | 176 | Cursor Text Color 177 | 178 | Blue Component 179 | 0.0940093994140625 180 | Green Component 181 | 0.0 182 | Red Component 183 | 1 184 | 185 | Foreground Color 186 | 187 | Blue Component 188 | 0.95548701286315918 189 | Green Component 190 | 0.98048108816146851 191 | Red Component 192 | 1 193 | 194 | Selected Text Color 195 | 196 | Blue Component 197 | 1 198 | Green Component 199 | 1 200 | Red Component 201 | 1 202 | 203 | Selection Color 204 | 205 | Blue Component 206 | 0.23076923191547394 207 | Green Component 208 | 0.16498950123786926 209 | Red Component 210 | 0.0 211 | 212 | 213 | 214 | -------------------------------------------------------------------------------- /nvim/init.vim: -------------------------------------------------------------------------------- 1 | set nocompatible 2 | " =========== 3 | " KEYBINDINGS 4 | " =========== 5 | 6 | " Back to normal mode 7 | imap jj 8 | tnoremap (&filetype == "fzf") ? "" : "" 9 | 10 | 11 | " ========= 12 | " BEHAVIOUR 13 | " ========= 14 | 15 | set tabstop=4 softtabstop=4 shiftwidth=4 noexpandtab 16 | set incsearch 17 | set encoding=utf-8 18 | 19 | set undofile " Use undofile for persistent undo 20 | set undodir=~/.vimundo/ " set a directory to store the undo history 21 | set regexpengine=1 " improve syntaxhighlight performance 22 | set mouse=a 23 | 24 | 25 | 26 | " ===== 27 | " LOOKS 28 | " ===== 29 | 30 | set showcmd 31 | set number 32 | set nowrap 33 | set noshowmode 34 | set cursorline 35 | set scrolloff=10 36 | set signcolumn=yes 37 | 38 | " Color configurations 39 | if (has("termguicolors")) 40 | set termguicolors 41 | endif 42 | 43 | let $NVIM_TUI_ENABLE_TRUE_COLOR = 1 44 | 45 | 46 | highlight CursorLineNR guibg=NONE guifg=NONE 47 | highlight SignColumn guibg=NONE gui=bold 48 | 49 | 50 | syntax on 51 | 52 | 53 | " ========== 54 | " STATUSLINE 55 | " ========== 56 | " Statusline for when it is visible 57 | set statusline=%{StatuslineGit()}\ %0.50F\ %=%l,%c\ \ %p%%\ %{StatusLineLsp()}\ 58 | highlight StatusLine guifg=black guibg=#444444 59 | 60 | function! LspStatus() abort 61 | if luaeval('#vim.lsp.buf_get_clients() > 0') 62 | return luaeval("vim.lsp.buf_get_clients()[1].name") 63 | endif 64 | 65 | return '' 66 | endfunction 67 | 68 | function! GitBranch() 69 | return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'") 70 | endfunction 71 | 72 | function! StatuslineGit() 73 | let l:branchname = GitBranch() 74 | return strlen(l:branchname) > 0 ? ' '.l:branchname.' ' : '' 75 | endfunction 76 | 77 | function! StatusLineLsp() 78 | let l:ls = LspStatus() 79 | return strlen(l:ls) > 0 ? ' '.l:ls : '' 80 | endfunction 81 | 82 | 83 | 84 | " ======= 85 | " PLUGINS 86 | " ======= 87 | 88 | 89 | call plug#begin('~/.vim/plugged') 90 | 91 | " GENERAL 92 | Plug 'tpope/vim-surround' " Wrap text easily 93 | Plug 'preservim/nerdtree' " File browser 94 | Plug 'Xuyuanp/nerdtree-git-plugin' " Show git statusses in file browser 95 | Plug 'airblade/vim-gitgutter' " Show git changes 96 | Plug 'godlygeek/tabular' " Easy text align 97 | Plug 'ryanoasis/vim-devicons' " File icons 98 | Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } " Fast file finder 99 | Plug 'junegunn/fzf.vim' 100 | 101 | " HASKELL 102 | Plug 'neovimhaskell/haskell-vim' 103 | 104 | 105 | " RUST LANGUAGE SERVER 106 | Plug 'neovim/nvim-lspconfig' " Collection of common configurations for the Nvim LSP client 107 | Plug 'tjdevries/lsp_extensions.nvim' " Extensions to built-in LSP, for example, providing type inlay hints 108 | Plug 'nvim-lua/completion-nvim' " Autocompletion framework for built-in LSP 109 | Plug 'nvim-lua/diagnostic-nvim' " Diagnostic navigation and settings for built-in LSP 110 | 111 | 112 | " THEMES 113 | Plug 'vim-airline/vim-airline-themes' 114 | Plug 'chriskempson/vim-tomorrow-theme' 115 | Plug 'flazz/vim-colorschemes' 116 | Plug 'altercation/vim-colors-solarized' 117 | Plug 'jdkanani/vim-material-theme' 118 | Plug 'nanotech/jellybeans.vim' 119 | Plug 'morhetz/gruvbox' 120 | Plug 'marcopaganini/termschool-vim-theme' 121 | Plug 'godlygeek/csapprox' 122 | Plug 'jacoborus/tender' 123 | Plug 'endel/vim-github-colorscheme' 124 | Plug 'larsbs/vimterial' 125 | Plug 'bcicen/vim-vice' 126 | Plug 'dylanaraps/wal.vim' 127 | Plug 'chriskempson/base16-vim' 128 | 129 | call plug#end() 130 | 131 | 132 | " ====================== 133 | " LANGUAGE SERVER CONFIG 134 | " ====================== 135 | syntax enable 136 | filetype plugin indent on 137 | colorscheme molokai 138 | 139 | 140 | " Set completeopt to have a better completion experience 141 | " :help completeopt 142 | " menuone: popup even when there's only one match 143 | " noinsert: Do not insert text until a selection is made 144 | " noselect: Do not select, force user to select one from the menu 145 | set completeopt=menuone,noinsert,noselect 146 | 147 | " Avoid showing extra messages when using completion 148 | " set shortmess+=c 149 | 150 | " Configure LSP 151 | " https://github.com/neovim/nvim-lspconfig#rust_analyzer 152 | lua < 171 | inoremap 172 | \ pumvisible() ? "\" : 173 | \ check_back_space() ? "\" : 174 | \ completion#trigger_completion() 175 | 176 | function! s:check_back_space() abort 177 | let col = col('.') - 1 178 | return !col || getline('.')[col - 1] =~ '\s' 179 | endfunction 180 | 181 | " Code navigation shortcuts 182 | nnoremap lua vim.lsp.buf.definition() 183 | nnoremap K lua vim.lsp.buf.hover() 184 | nnoremap gD lua vim.lsp.buf.implementation() 185 | nnoremap lua vim.lsp.buf.signature_help() 186 | nnoremap 1gD lua vim.lsp.buf.type_definition() 187 | nnoremap gr lua vim.lsp.buf.references() 188 | nnoremap g0 lua vim.lsp.buf.document_symbol() 189 | nnoremap gW lua vim.lsp.buf.workspace_symbol() 190 | nnoremap gd lua vim.lsp.buf.declaration() 191 | nnoremap ga lua vim.lsp.buf.code_action() 192 | 193 | 194 | " Visualize diagnostics 195 | let g:diagnostic_enable_virtual_text = 1 196 | let g:diagnostic_trimmed_virtual_text = '40' 197 | " Don't show diagnostics while in insert mode 198 | let g:diagnostic_insert_delay = 1 199 | 200 | " Set updatetime for CursorHold 201 | " 300ms of no cursor movement to trigger CursorHold 202 | set updatetime=300 203 | " Show diagnostic popup on cursor hold 204 | autocmd CursorHold * lua vim.lsp.util.show_line_diagnostics() 205 | 206 | " Goto previous/next diagnostic warning/error 207 | nnoremap g[ PrevDiagnosticCycle 208 | nnoremap g] NextDiagnosticCycle 209 | 210 | " have a fixed column for the diagnostics to appear in 211 | " this removes the jitter when warnings/errors flow in 212 | set signcolumn=yes 213 | 214 | " Enable type inlay hints 215 | autocmd CursorMoved,InsertLeave,BufEnter,BufWinEnter,TabEnter,BufWritePost * 216 | \ lua require'lsp_extensions'.inlay_hints{ prefix = '', highlight = "Comment" } 217 | 218 | 219 | 220 | " ======== 221 | " NERDTREE 222 | " ======== 223 | 224 | " Nerd Tree settings 225 | let g:nerdtree_tabs_open_on_gui_startup = 0 226 | map :NERDTreeToggle 227 | 228 | " Open nerdtree on startup 229 | autocmd vimenter * NERDTree 230 | autocmd StdinReadPre * let s:std_in=1 231 | autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif 232 | 233 | " close vim if the only window left open is a NERDTree? 234 | autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif 235 | 236 | " =============== 237 | " LEADER COMMANDS 238 | " =============== 239 | " 240 | let mapleader = "\" 241 | nnoremap w :w 242 | nnoremap q :q! 243 | nnoremap p :Files 244 | nnoremap g :GFiles? 245 | nnoremap f :Lines 246 | nnoremap / :BLines 247 | nnoremap b :Buffers 248 | nnoremap n :NERDTreeToggle 249 | 250 | 251 | 252 | 253 | 254 | --------------------------------------------------------------------------------