├── .bash_profile ├── .gitignore ├── .ignore ├── .vimrc ├── com.googlecode.iterm2.plist ├── install-programs.sh ├── nvim ├── init.lua ├── lazy-lock.json ├── lua │ └── trash │ │ ├── autocmds.lua │ │ ├── colorscheme.lua │ │ ├── init.lua │ │ ├── keymaps.lua │ │ ├── options.lua │ │ ├── plugins │ │ ├── configs │ │ │ ├── bufferline.lua │ │ │ ├── cmp.lua │ │ │ ├── copilot.lua │ │ │ ├── dap.lua │ │ │ ├── lspconfig.lua │ │ │ ├── lualine.lua │ │ │ ├── neo-tree.lua │ │ │ ├── telescope.lua │ │ │ ├── treesitter.lua │ │ │ ├── ufo.lua │ │ │ └── which-key.lua │ │ └── init.lua │ │ └── utils.lua └── stylua.toml ├── setup-symlinks.sh └── zsh-custom ├── functions.zsh ├── fzf.zsh └── general_aliases.zsh /.bash_profile: -------------------------------------------------------------------------------- 1 | confirm() { 2 | read -r -p "${1:-Are you sure? [y/N]} " response 3 | case "$response" in 4 | [yY][eE][sS]|[yY]) 5 | true 6 | ;; 7 | *) 8 | false 9 | ;; 10 | esac 11 | } 12 | 13 | 14 | ######################################### 15 | # DOCKER 16 | ######################################### 17 | alias dlist="docker ps -a" 18 | docker_ids() { docker ps -aq; } 19 | docker_stop_all() { docker stop $(docker_ids); } 20 | docker_remove_all() { docker rm $(docker_ids); } 21 | 22 | # Shortcuts 23 | 24 | alias g="git" 25 | 26 | alias gs="git status" 27 | 28 | alias gsl="git stash list" 29 | 30 | alias gc="git checkout" 31 | 32 | alias gcp="git cherry-pick" 33 | 34 | alias gb="git branch" 35 | 36 | alias guc="git reset HEAD~" 37 | 38 | alias h="history" 39 | 40 | alias ch='history | grep "git commit"' 41 | 42 | alias home='cd ~/' 43 | 44 | alias gp="git fetch origin --prune" 45 | 46 | # clean up branches that no longer exist on origin off local 47 | alias cb="git remote prune origin && git branch -vv | grep '\[[^]]* gone]' | awk '{ print $1 }' | xargs git branch -D" 48 | 49 | alias startpost="pg_ctl -D ~/.asdf/installs/postgres/9.6.8/data -l logfile start" 50 | 51 | alias stoppost="pg_ctl -D ~/.asdf/installs/postgres/9.6.8/data stop -s -m fast" 52 | 53 | alias profile="open ~/.bash_profile" 54 | 55 | alias containers="docker ps -a" 56 | 57 | alias pgreload="pg_ctl reload" 58 | 59 | alias reload="source ~/.bash_profile" 60 | 61 | scon() { 62 | docker stop `docker ps -aq` 63 | } 64 | 65 | rmcon() { 66 | docker rm `docker ps -aq` 67 | } 68 | 69 | sig () { 70 | declare -f "$1" 71 | } 72 | 73 | # Git branch in prompt. 74 | parse_git_branch() { 75 | git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ [\1]/' 76 | } 77 | export PS1="\u@\h \W\[\033[01;33m\]\$(parse_git_branch)\[\033[00m\] $ " 78 | 79 | # Project helpers 80 | 81 | alias ..='cd ../' # Go back 1 directory level 82 | 83 | alias ...='cd ../../' # Go back 2 directory levels 84 | 85 | alias .3='cd ../../../' # Go back 3 directory levels 86 | 87 | alias .4='cd ../../../../' # Go back 4 directory levels 88 | 89 | alias .5='cd ../../../../../' # Go back 5 directory levels 90 | 91 | alias .6='cd ../../../../../../' # Go back 6 directory levels 92 | 93 | alias c='clear' # Clear terminal display 94 | 95 | alias path='echo -e ${PATH//:\\\n}' # Echo all executable Paths 96 | 97 | alias edit='open -a TextEdit' # open using TextEdit 98 | 99 | alias l='ls -altr' # list all in order 100 | 101 | # List all files colorized in long format, including dot files 102 | 103 | alias la="ls -lahF ${colorflag}" 104 | 105 | # Show/hide hidden files in Finder 106 | 107 | alias show="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder" 108 | 109 | alias hide="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder" 110 | 111 | searchAndDestroy() { 112 | 113 | lsof -i TCP:$1 | grep LISTEN | awk '{print $2}' | xargs kill -9 114 | 115 | echo "Port" $1 "found and killed." 116 | 117 | } 118 | 119 | searchProfile() { 120 | cat ~/.bash_profile | grep $1 121 | } 122 | 123 | #Delete remote branch and local branch 124 | 125 | gd() { 126 | confirm "Force delete $(curbranch) on both your local machine AND origin?" && git push origin --delete $1 && gb -D $1 127 | } 128 | 129 | gsp() { 130 | git stash push -u -m $1; 131 | echo "Stash created with name" $1 132 | } 133 | 134 | #Delete local branch 135 | 136 | gdl() { 137 | 138 | gb -D $1 139 | 140 | } 141 | 142 | export GOPATH="$HOME/go" 143 | export PATH="$PATH:$HOME/go/bin" 144 | 145 | export NVM_DIR="$HOME/.nvm" 146 | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm 147 | [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion 148 | 149 | # --------------------------- 150 | # FZF config for use with vim 151 | # --------------------------- 152 | # --files: List files that would be searched but do not search 153 | # --no-ignore: Do not respect .gitignore, etc... 154 | # --hidden: Search hidden files and folders 155 | # --follow: Follow symlinks 156 | # --glob: Additional conditions for search (in this case ignore everything in the .git/ folder) 157 | export FZF_DEFAULT_COMMAND='rg --files --hidden --follow' 158 | 159 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | undodir 3 | -------------------------------------------------------------------------------- /.ignore: -------------------------------------------------------------------------------- 1 | .git 2 | -------------------------------------------------------------------------------- /.vimrc: -------------------------------------------------------------------------------- 1 | " vim-plug as the plugin manager 2 | if empty(glob('~/.vim/autoload/plug.vim')) 3 | silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs 4 | \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim 5 | 6 | endif 7 | call plug#begin('~/.vim/plugged') 8 | Plug 'neovim/nvim-lspconfig' 9 | Plug 'anott03/nvim-lspinstall' 10 | Plug 'nvim-lua/completion-nvim' 11 | Plug 'ryanoasis/vim-devicons' 12 | Plug 'ervandew/supertab' " better tab completion 13 | Plug 'ianks/vim-tsx' " Syntax highlighting and indenting for TSX 14 | Plug 'sheerun/vim-polyglot' " syntax highlighting 15 | Plug 'janko/vim-test' " granular testing 16 | Plug 'jiangmiao/auto-pairs' " auto close brackets 17 | Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } 18 | Plug 'junegunn/fzf.vim' " fuzzy finding with ag 19 | Plug 'jparise/vim-graphql' " graphql syntax 20 | Plug 'mattn/gist-vim' " quickly put code into a gist 21 | Plug 'mattn/webapi-vim' " quickly put code into a gist 22 | Plug 'neoclide/coc.nvim', {'do': { -> coc#util#install()}} 23 | Plug 'prettier/vim-prettier' " code formatting 24 | Plug 'scrooloose/nerdcommenter' " easy commenting 25 | Plug 'scrooloose/nerdtree' " find files by dir tree 26 | Plug 'styled-components/vim-styled-components', { 'branch': 'main' } 27 | "Plug 'drewtempelmeyer/palenight.vim' " theme 28 | Plug 'chriskempson/base16-vim' 29 | Plug 'tpope/vim-dispatch' " async command line commands 30 | Plug 'tpope/vim-fugitive' " git integration 31 | Plug 'tpope/vim-rhubarb' " github for fugitive 32 | Plug 'tpope/vim-surround' " surround with tags 33 | Plug 'vim-airline/vim-airline' " status bar plugin 34 | Plug 'vim-airline/vim-airline-themes' " airline theme 35 | Plug 'leafgarland/typescript-vim' " typescript plugin 36 | Plug 'mbbill/undotree' " undo mgmt 37 | Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' } 38 | Plug 'mattn/emmet-vim' " emmet 39 | call plug#end() 40 | 41 | " map leader to spacebar (best thing ever) 42 | let mapleader = ' ' 43 | 44 | let g:airline_theme='base16' 45 | let g:github_enterprise_urls = ['https://github.prod.hulu.com'] 46 | 47 | " theme 48 | set cursorcolumn 49 | syntax enable " Enable code highlighting 50 | set guioptions-=r 51 | set termguicolors 52 | colorscheme base16-onedark 53 | set background=dark 54 | "hi Normal ctermfg=250 guifg=#d0d0d0 ctermbg=black guibg=#0c0c0c 55 | highlight Normal guibg=none 56 | highlight CursorColumn guibg=#404040 57 | 58 | "s line Numbers 59 | set relativenumber 60 | set number 61 | set numberwidth=2 62 | set laststatus=2 63 | set list 64 | set listchars=eol:¬,tab:>·,trail:.,extends:>,precedes:<,space:. 65 | hi CursorLineNr term=bold ctermfg=Yellow gui=bold guifg=Yellow 66 | hi LineNr term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE gui=NONE guifg=DarkGrey guibg=NONE 67 | 68 | 69 | " search stuff 70 | set incsearch 71 | set gdefault 72 | set visualbell 73 | set nohlsearch 74 | 75 | " characters and movement 76 | filetype plugin indent on 77 | set expandtab 78 | set shiftwidth=2 79 | set tabstop=2 80 | set autoindent 81 | set smartindent 82 | set backspace=indent,eol,start 83 | set title 84 | autocmd BufEnter *.{js,jsx,ts,tsx} :syntax sync fromstart 85 | autocmd BufLeave *.{js,jsx,ts,tsx} :syntax sync clear 86 | let g:SuperTabDefaultCompletionType = "" 87 | 88 | " split windows 89 | nnoremap j 90 | nnoremap k 91 | nnoremap l 92 | nnoremap h 93 | tnoremap h h 94 | tnoremap j j 95 | tnoremap k k 96 | tnoremap l l 97 | 98 | " moving between buffers 99 | nnoremap :bnext 100 | nnoremap :bprevious 101 | 102 | " close all buffers 103 | nnoremap x :bd 104 | nnoremap xx :%bd 105 | nnoremap :bp\|bd # 106 | 107 | " search and replace under cursor 108 | nnoremap r :%s/\<\>/ 109 | 110 | nnoremap u :UndotreeToggle 111 | 112 | " set one directory for .swp files 113 | set backupdir=/var/tmp,/tmp 114 | set directory=/var/tmp,/tmp 115 | 116 | " Airline / Status line options 117 | let g:airline_powerline_fonts = 1 118 | let g:airline#extensions#tabline#enabled = 1 119 | let g:airline#extensions#tabline#buffer_min_count = 2 120 | let g:airline#extensions#tabline#formatter = 'unique_tail' 121 | let g:airline_section_y='' 122 | let g:airline_skip_empty_sections = 1 123 | 124 | " vim-fugitive 125 | nnoremap g :Gstatus 126 | 127 | " vim-test 128 | let test#strategy = 'neovim' 129 | let test#neovim#term_position = "vertical" 130 | let test#javascript#jest#options = '--watch' 131 | 132 | " LESS / CSS Highlighting 133 | augroup VimCSS3Syntax 134 | autocmd! 135 | autocmd FileType css setlocal iskeyword+=- 136 | augroup END 137 | 138 | " vim-prettier options 139 | noremap p :PrettierAsync 140 | 141 | " FZF options 142 | let g:fzf_layout = { 'down': '~50%' } " - down / up / left / right 143 | command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --hidden --follow --color "always" '.shellescape(), 1, 0) 144 | command! -bang -nargs=* FindCurrentWord call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --hidden --follow --color "always" '.shellescape(expand('')), 1, 0) 145 | set grepprg=rg\ --vimgrep 146 | noremap f :FindCurrentWord 147 | noremap s :Files 148 | noremap b :Buffers 149 | 150 | " NERDCommenter options 151 | let g:NERDCustomDelimiters = { 'less': { 'left': '// ', 'right': '', 'leftAlt': '/* ', 'rightAlt': ' */' }, 'javascript': { 'left': '// ', 'right': '', 'leftAlt': '/* ', 'rightAlt': ' */' } } 152 | 153 | " NERDTree options 154 | noremap t :NERDTreeFind 155 | noremap tt :NERDTreeToggle 156 | noremap tc :NERDTreeClose 157 | noremap tf :NERDTreeFocus 158 | let g:NERDTreeWinSize = 50 159 | 160 | " Language Server (coc) options 161 | let g:coc_global_extensions = ['coc-emmet'] 162 | set signcolumn=yes 163 | set hidden 164 | set cmdheight=2 165 | set updatetime=300 166 | set shortmess+=c 167 | nmap d (coc-definition) 168 | nmap rn (coc-rename) 169 | noremap e :CocList diagnostics 170 | " Remap keys for applying codeAction to the current line. 171 | nmap ac (coc-codeaction) 172 | " Apply AutoFix to problem on the current line. 173 | nmap qf (coc-fix-current) 174 | set completeopt=longest,menuone 175 | inoremap coc#refresh() 176 | " Use K to show documentation in preview window 177 | nnoremap K :call show_documentation() 178 | function! s:show_documentation() 179 | if (index(['vim','help'], &filetype) >= 0) 180 | execute 'h '.expand('') 181 | else 182 | call CocAction('doHover') 183 | endif 184 | endfunction 185 | 186 | " disable arrow keys cause im NOOB 187 | noremap 188 | noremap 189 | noremap 190 | noremap 191 | 192 | " the below didnt play with HTML, it kept auto selecting first suggestion 193 | "lua require'lspconfig'.tsserver.setup{ on_attach=require'completion'.on_attach } 194 | "lua require'lspconfig'.tsserver.setup{} 195 | "lua require'lspconfig'.bashls.setup{ on_attach=require'completion'.on_attach } 196 | 197 | " GO options 198 | nnoremap gi :GoImports 199 | nnoremap gb :GoBuild 200 | nnoremap gf :GoFmt 201 | nnoremap gr :GoRun 202 | -------------------------------------------------------------------------------- /install-programs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Install xcode command-line tools 4 | xcode-select --install 5 | 6 | # Make sure we’re using the latest Homebrew 7 | brew update 8 | brew upgrade 9 | 10 | # GNU core utilities (those that come with OS X are outdated) 11 | brew install coreutils 12 | brew install moreutils 13 | brew install findutils 14 | brew install gnu-sed --with-default-names 15 | 16 | # upgrade bash 17 | brew install bash 18 | brew install bash-completion 19 | brew install homebrew/completions/brew-cask-completion 20 | 21 | # Install wget with IRI support 22 | brew install wget --with-iri 23 | 24 | # Install more recent versions of some OS X tools 25 | brew install vim --with-override-system-vi 26 | brew install ripgrep 27 | 28 | # Install other useful binaries 29 | brew install ffmpeg --with-libvpx 30 | brew install fzf 31 | brew install git 32 | brew install gnupg 33 | brew install imagemagick --with-webp 34 | brew install node # This installs `npm` too using the recommended installation method 35 | brew install rename 36 | brew install svgo 37 | brew install the_silver_searcher 38 | brew install terminal-notifier 39 | brew install awscli 40 | 41 | # Remove outdated versions from the cellar 42 | brew cleanup 43 | 44 | npm install -g prettier 45 | npm install -g ngrok 46 | npm install -g typescript 47 | npm install -g javascript-typescript-langserver 48 | -------------------------------------------------------------------------------- /nvim/init.lua: -------------------------------------------------------------------------------- 1 | require("trash").setup() 2 | -------------------------------------------------------------------------------- /nvim/lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, 3 | "auto-pairs": { "branch": "master", "commit": "39f06b873a8449af8ff6a3eee716d3da14d63a76" }, 4 | "bufferline.nvim": { "branch": "main", "commit": "0b2fd861eee7595015b6561dade52fb060be10c4" }, 5 | "cloak.nvim": { "branch": "main", "commit": "648aca6d33ec011dc3166e7af3b38820d01a71e4" }, 6 | "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, 7 | "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, 8 | "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, 9 | "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, 10 | "cmp-vsnip": { "branch": "main", "commit": "989a8a73c44e926199bfd05fa7a516d51f2d2752" }, 11 | "copilot.vim": { "branch": "release", "commit": "782461159655b259cff10ecff05efa761e3d4764" }, 12 | "emmet-vim": { "branch": "master", "commit": "6c511a8d7d2863066f32e25543e2bb99d505172c" }, 13 | "friendly-snippets": { "branch": "main", "commit": "00ba9dd3df89509f95437b8d595553707c46d5ea" }, 14 | "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, 15 | "lspkind-nvim": { "branch": "master", "commit": "59c3f419af48a2ffb2320cea85e44e5a95f71664" }, 16 | "lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" }, 17 | "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, 18 | "mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" }, 19 | "mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" }, 20 | "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, 21 | "neo-tree.nvim": { "branch": "v2.x", "commit": "80dc74d081823649809f78370fa5b204aa9a853a" }, 22 | "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, 23 | "none-ls-extras.nvim": { "branch": "main", "commit": "ebb09961f1c0a377f9ed1685740cdf87b5cd39a8" }, 24 | "none-ls.nvim": { "branch": "main", "commit": "68a39ec218a9f15ebb2bb36c8c245681d5e61144" }, 25 | "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, 26 | "nvim": { "branch": "main", "commit": "63685e1562ef53873c9764b483d7ac5c7a608922" }, 27 | "nvim-bqf": { "branch": "main", "commit": "1b24dc6050c34e8cd377b6b4cd6abe40509e0187" }, 28 | "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, 29 | "nvim-dap": { "branch": "master", "commit": "5ba8ceace596360321cf33fa4b56d9d46e057ce9" }, 30 | "nvim-lspconfig": { "branch": "master", "commit": "056f569f71e4b726323b799b9cfacc53653bceb3" }, 31 | "nvim-treesitter": { "branch": "master", "commit": "36b78d112bddd69a05e24679241962e29e494d9e" }, 32 | "nvim-ts-context-commentstring": { "branch": "main", "commit": "375c2d86cee6674afd75b4f727ce3a80065552f7" }, 33 | "nvim-ufo": { "branch": "main", "commit": "203c9f434feec57909ab4b1e028abeb3349b7847" }, 34 | "nvim-web-devicons": { "branch": "master", "commit": "26220156aafb198b2de6a4cf80c1b120a3768da0" }, 35 | "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, 36 | "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, 37 | "rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" }, 38 | "sg.nvim": { "branch": "master", "commit": "76c97d91f8d8818a4fcf14817fadd98412aa44c8" }, 39 | "tailwind-highlight.nvim": { "branch": "main", "commit": "cfd53d0f6318e8eaada03e10c7f2e4e57ec430c5" }, 40 | "telescope.nvim": { "branch": "master", "commit": "cb3f98d935842836cc115e8c9e4b38c1380fbb6b" }, 41 | "trouble.nvim": { "branch": "main", "commit": "254145ffd528b98eb20be894338e2d5c93fa02c2" }, 42 | "undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" }, 43 | "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, 44 | "vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" }, 45 | "vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" }, 46 | "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, 47 | "vim-test": { "branch": "master", "commit": "c090bfd93919888bb0b86e1ab707bc6a3095097f" }, 48 | "vim-vsnip": { "branch": "master", "commit": "02a8e79295c9733434aab4e0e2b8c4b7cea9f3a9" }, 49 | "which-key.nvim": { "branch": "main", "commit": "fb070344402cfc662299d9914f5546d840a22126" } 50 | } 51 | -------------------------------------------------------------------------------- /nvim/lua/trash/autocmds.lua: -------------------------------------------------------------------------------- 1 | -- Transparent highlights 2 | local function transparent_cb() 3 | -- vim.api.nvim_set_hl(0, "Normal", { bg = "NONE" }) 4 | vim.api.nvim_set_hl(0, "SignColumn", { bg = "NONE" }) 5 | vim.api.nvim_set_hl(0, "CursorColumn", { bg = "#404040" }) 6 | vim.api.nvim_set_hl(0, "CursorLine", { bg = "#404040" }) 7 | vim.api.nvim_set_hl(0, "CursorLineNr", { fg = "Yellow", bold = true }) 8 | vim.api.nvim_set_hl(0, "LineNr", { bg = "NONE", fg = "DarkGrey", bold = false, underline = false, italic = false }) 9 | vim.api.nvim_set_hl(0, "NormalFloat", { bg = "NONE" }) 10 | vim.api.nvim_set_hl(0, "FloatBorder", { bg = "NONE", fg = "#eeeeee" }) 11 | vim.api.nvim_set_hl(0, "ErrorFloat", { bg = "NONE" }) 12 | vim.api.nvim_set_hl(0, "WarningFloat", { bg = "NONE" }) 13 | vim.api.nvim_set_hl(0, "InfoFloat", { bg = "NONE" }) 14 | vim.api.nvim_set_hl(0, "HintFloat", { bg = "NONE" }) 15 | end 16 | 17 | local transparent_group = vim.api.nvim_create_augroup("TransparentGroup", { clear = true }) 18 | vim.api.nvim_create_autocmd("ColorScheme", { 19 | group = transparent_group, 20 | callback = transparent_cb, 21 | desc = "Transparent highlights", 22 | }) 23 | 24 | -- Briefly highlight code on yank 25 | local yank_group = vim.api.nvim_create_augroup("YankGroup", { 26 | 27 | group = yank_group, 28 | }) 29 | vim.api.nvim_create_autocmd("TextYankPost", { 30 | group = yank_group, 31 | callback = function() 32 | vim.highlight.on_yank({ higroup = "IncSearch", timeout = 250 }) 33 | end, 34 | desc = "Briefly highlight code on yank", 35 | }) 36 | -------------------------------------------------------------------------------- /nvim/lua/trash/colorscheme.lua: -------------------------------------------------------------------------------- 1 | local ok, catppuccin = pcall(require, "catppuccin") 2 | 3 | if not ok then 4 | return 5 | end 6 | 7 | vim.g.catppuccin_flavour = "mocha" 8 | 9 | catppuccin.setup({ 10 | flavour = "mocha", -- latte, frappe, macchiato, mocha 11 | term_colors = true, 12 | transparent_background = true, 13 | no_italic = false, 14 | no_bold = false, 15 | styles = { 16 | comments = {}, 17 | conditionals = {}, 18 | loops = {}, 19 | functions = {}, 20 | keywords = {}, 21 | strings = {}, 22 | variables = {}, 23 | numbers = {}, 24 | booleans = {}, 25 | properties = {}, 26 | types = {}, 27 | }, 28 | color_overrides = { 29 | mocha = { 30 | base = "#000000", 31 | mantle = "#000000", 32 | crust = "#000000", 33 | }, 34 | }, 35 | highlight_overrides = { 36 | mocha = function(C) 37 | return { 38 | TabLineSel = { bg = C.pink }, 39 | CmpBorder = { fg = C.surface2 }, 40 | Pmenu = { bg = C.none }, 41 | TelescopeBorder = { link = "FloatBorder" }, 42 | } 43 | end, 44 | }, 45 | }) 46 | 47 | pcall(vim.cmd, "colorscheme catppuccin") 48 | -------------------------------------------------------------------------------- /nvim/lua/trash/init.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | local function init() 4 | -- Enable provider for only python3 and node 5 | vim.g.python3_host_prog = vim.fn.exepath("python3") 6 | vim.g.loaded_python_provider = 0 7 | vim.g.loaded_perl_provider = 0 8 | vim.g.loaded_ruby_provider = 0 9 | 10 | vim.g.github_enterprise_urls = { "https://github.prod.hulu.com" } 11 | vim.g["test#strategy"] = "neovim" 12 | vim.g["test#neovim#term_position"] = "vertical" 13 | vim.g["test#javascript#jest#options"] = "--watch" 14 | end 15 | 16 | function M.setup() 17 | init() 18 | 19 | require("trash.autocmds") 20 | require("trash.keymaps") 21 | require("trash.options") 22 | require("trash.plugins") 23 | require("trash.colorscheme") 24 | end 25 | 26 | return M 27 | -------------------------------------------------------------------------------- /nvim/lua/trash/keymaps.lua: -------------------------------------------------------------------------------- 1 | vim.g.mapleader = " " 2 | 3 | vim.keymap.set("n", "", "") 4 | vim.keymap.set("n", "", "") 5 | vim.keymap.set("n", "", "") 6 | vim.keymap.set("n", "", "") 7 | vim.keymap.set("i", "", "") 8 | vim.keymap.set("i", "", "") 9 | vim.keymap.set("i", "", "") 10 | vim.keymap.set("i", "", "") 11 | 12 | vim.keymap.set("n", "x", "bd", { desc = "Close current buffer" }) 13 | vim.keymap.set("n", "xx", "%bd", { desc = "Close all buffer" }) 14 | vim.keymap.set("n", "xo", "%bde#bd#", { desc = "Close all buffer but current" }) 15 | vim.keymap.set("n", "j", "", { desc = "Move cursor bottom window" }) 16 | vim.keymap.set("n", "k", "", { desc = "Move cursor top window" }) 17 | vim.keymap.set("n", "l", "", { desc = "Move cursor left window" }) 18 | vim.keymap.set("n", "h", "", { desc = "Move cursor right window" }) 19 | vim.keymap.set("n", "r", ":%s//", { desc = "Replace word" }) 20 | vim.keymap.set("n", "w", "write", { desc = "Save current file" }) 21 | 22 | vim.keymap.set("n", "", "bp|bd #", { desc = "Close buffer, except the last one" }) 23 | vim.keymap.set("n", "", "bnext", { desc = "Go to next buffer" }) 24 | vim.keymap.set("n", "", "bprevious", { desc = "Go to previous buffer" }) 25 | vim.keymap.set("n", "", "noh", { desc = "Go to normal mode, clear any highlights" }) 26 | 27 | vim.keymap.set("n", "z", require("trash.utils").reload_config, { desc = "Reload vim config" }) 28 | -------------------------------------------------------------------------------- /nvim/lua/trash/options.lua: -------------------------------------------------------------------------------- 1 | vim.opt.shortmess:append("c") 2 | vim.opt.errorbells = false 3 | vim.opt.smartcase = true 4 | vim.opt.showmatch = true 5 | vim.opt.showmode = false 6 | vim.opt.swapfile = false 7 | vim.opt.backup = false 8 | vim.opt.undodir = vim.fn.stdpath("data") .. "/undodir" 9 | vim.opt.undofile = true 10 | vim.opt.incsearch = true 11 | vim.opt.hidden = true 12 | vim.opt.completeopt = { "menuone", "noinsert", "noselect" } 13 | vim.opt.autoindent = true 14 | vim.opt.smartindent = true 15 | vim.opt.tabstop = 2 16 | vim.opt.softtabstop = 2 17 | vim.opt.shiftwidth = 2 18 | vim.opt.expandtab = true 19 | vim.opt.signcolumn = "yes" 20 | vim.opt.wrap = true 21 | vim.opt.cursorcolumn = true 22 | vim.opt.cursorline = true 23 | vim.opt.list = true 24 | vim.opt.number = true 25 | vim.opt.numberwidth = 2 26 | vim.opt.laststatus = 2 27 | vim.opt.scrolloff = 5 28 | vim.opt.showtabline = 2 29 | vim.opt.ttimeoutlen = 50 30 | vim.opt.ignorecase = true 31 | vim.opt.wildignorecase = true 32 | vim.opt.smarttab = true 33 | vim.opt.mouse = "a" 34 | vim.opt.termguicolors = true 35 | vim.opt.relativenumber = true 36 | vim.opt.relativenumber = true 37 | -------------------------------------------------------------------------------- /nvim/lua/trash/plugins/configs/bufferline.lua: -------------------------------------------------------------------------------- 1 | require("bufferline").setup({ 2 | highlights = { 3 | fill = { bg = "NONE" }, 4 | background = { bg = "NONE" }, 5 | tab = { bg = "NONE" }, 6 | tab_selected = { bg = "NONE" }, 7 | tab_close = { bg = "NONE" }, 8 | close_button = { bg = "NONE" }, 9 | close_button_visible = { bg = "NONE" }, 10 | close_button_selected = { bg = "NONE" }, 11 | buffer_visible = { bg = "NONE" }, 12 | buffer_selected = { bg = "NONE" }, 13 | numbers = { bg = "NONE" }, 14 | numbers_visible = { bg = "NONE" }, 15 | numbers_selected = { bg = "NONE" }, 16 | diagnostic = { bg = "NONE" }, 17 | diagnostic_visible = { bg = "NONE" }, 18 | diagnostic_selected = { bg = "NONE" }, 19 | hint = { bg = "NONE" }, 20 | hint_visible = { bg = "NONE" }, 21 | hint_selected = { bg = "NONE" }, 22 | hint_diagnostic = { bg = "NONE" }, 23 | hint_diagnostic_visible = { bg = "NONE" }, 24 | hint_diagnostic_selected = { bg = "NONE" }, 25 | info = { bg = "NONE" }, 26 | info_visible = { bg = "NONE" }, 27 | info_selected = { bg = "NONE" }, 28 | info_diagnostic = { bg = "NONE" }, 29 | info_diagnostic_visible = { bg = "NONE" }, 30 | info_diagnostic_selected = { bg = "NONE" }, 31 | warning = { bg = "NONE" }, 32 | warning_visible = { bg = "NONE" }, 33 | warning_selected = { bg = "NONE" }, 34 | warning_diagnostic = { bg = "NONE" }, 35 | warning_diagnostic_visible = { bg = "NONE" }, 36 | warning_diagnostic_selected = { bg = "NONE" }, 37 | error = { bg = "NONE" }, 38 | error_visible = { bg = "NONE" }, 39 | error_selected = { bg = "NONE" }, 40 | error_diagnostic = { bg = "NONE" }, 41 | error_diagnostic_visible = { bg = "NONE" }, 42 | error_diagnostic_selected = { bg = "NONE" }, 43 | modified = { bg = "NONE" }, 44 | modified_visible = { bg = "NONE" }, 45 | modified_selected = { bg = "NONE" }, 46 | duplicate_selected = { bg = "NONE" }, 47 | duplicate_visible = { bg = "NONE" }, 48 | duplicate = { bg = "NONE" }, 49 | separator_selected = { bg = "NONE" }, 50 | separator_visible = { bg = "NONE" }, 51 | separator = { bg = "NONE" }, 52 | indicator_selected = { bg = "NONE" }, 53 | pick_selected = { bg = "NONE" }, 54 | pick_visible = { bg = "NONE" }, 55 | pick = { bg = "NONE" }, 56 | offset_separator = { bg = "NONE" }, 57 | }, 58 | }) 59 | -------------------------------------------------------------------------------- /nvim/lua/trash/plugins/configs/cmp.lua: -------------------------------------------------------------------------------- 1 | local cmp = require("cmp") 2 | 3 | -- vsnip 4 | vim.g.vsnip_filetypes = { 5 | javascriptreact = { "javascript" }, 6 | typescriptreact = { "typescript" }, 7 | } 8 | 9 | local function has_words_before() 10 | local line, col = unpack(vim.api.nvim_win_get_cursor(0)) 11 | return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil 12 | end 13 | 14 | local function feedkey(key, mode) 15 | vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true) 16 | end 17 | 18 | -- Setup nvim-cmp 19 | cmp.setup({ 20 | snippet = { 21 | expand = function(args) 22 | vim.fn["vsnip#anonymous"](args.body) 23 | end, 24 | }, 25 | 26 | mapping = { 27 | [""] = cmp.mapping.complete({}), 28 | [""] = cmp.mapping.confirm({ select = true, behavior = cmp.ConfirmBehavior.Replace }), 29 | [""] = cmp.mapping.confirm({ select = true, behavior = cmp.ConfirmBehavior.Replace }), 30 | [""] = cmp.mapping(function(fallback) 31 | if cmp.visible() then 32 | cmp.select_next_item() 33 | elseif vim.fn["vsnip#available"](1) == 1 then 34 | feedkey("(vsnip-expand-or-jump)", "") 35 | elseif has_words_before() then 36 | cmp.complete() 37 | else 38 | fallback() -- The fallback function sends a already mapped key. In this case, it's probably ``. 39 | end 40 | end, { "i", "s" }), 41 | 42 | [""] = cmp.mapping(function(fallback) 43 | if cmp.visible() then 44 | cmp.select_next_item() 45 | elseif vim.fn["vsnip#available"](1) == 1 then 46 | feedkey("(vsnip-expand-or-jump)", "") 47 | elseif has_words_before() then 48 | cmp.complete() 49 | else 50 | fallback() -- The fallback function sends a already mapped key. In this case, it's probably ``. 51 | end 52 | end, { "i", "s" }), 53 | 54 | [""] = cmp.mapping(function() 55 | if cmp.visible() then 56 | cmp.select_prev_item() 57 | elseif vim.fn["vsnip#jumpable"](-1) == 1 then 58 | feedkey("(vsnip-jump-prev)", "") 59 | end 60 | end, { "i", "s" }), 61 | 62 | [""] = cmp.mapping(function() 63 | if cmp.visible() then 64 | cmp.select_prev_item() 65 | elseif vim.fn["vsnip#jumpable"](-1) == 1 then 66 | feedkey("(vsnip-jump-prev)", "") 67 | end 68 | end, { "i", "s" }), 69 | }, 70 | 71 | sources = cmp.config.sources({ 72 | { name = "nvim_lsp" }, 73 | { name = "vsnip" }, -- For vsnip users. 74 | }, { 75 | { name = "buffer" }, 76 | { name = "path" }, 77 | }), 78 | 79 | window = { 80 | -- completion = cmp.config.window.bordered(), 81 | documentation = cmp.config.window.bordered("rounded"), 82 | }, 83 | 84 | formatting = { 85 | format = require("lspkind").cmp_format({ 86 | mode = "symbol_text", 87 | menu = { 88 | buffer = "[BUF]", 89 | nvim_lsp = "[LSP]", 90 | vsnip = "[SNIP]", 91 | path = "[PATH]", 92 | }, 93 | }), 94 | }, 95 | }) 96 | 97 | -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). 98 | cmp.setup.cmdline({ "/", "?" }, { 99 | mapping = cmp.mapping.preset.cmdline(), 100 | sources = { 101 | { name = "buffer" }, 102 | }, 103 | }) 104 | 105 | -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). 106 | cmp.setup.cmdline(":", { 107 | mapping = cmp.mapping.preset.cmdline(), 108 | sources = cmp.config.sources({ 109 | { name = "path" }, 110 | }, { 111 | { name = "cmdline" }, 112 | }), 113 | }) 114 | -------------------------------------------------------------------------------- /nvim/lua/trash/plugins/configs/copilot.lua: -------------------------------------------------------------------------------- 1 | -- vim.keymap.set( 2 | -- "i", 3 | -- "", 4 | -- 'copilot#Accept("")', 5 | -- { silent = true, script = true, expr = true, desc = "Accept the current suggestion shown" } 6 | -- ) 7 | -- vim.g.copilot_no_tab_map = true 8 | 9 | vim.cmd([[ 10 | imap