Skip to content

Instantly share code, notes, and snippets.

View ctaylo21's full-sized avatar

Caleb Taylor ctaylo21

  • PlayStation
  • San Diego, CA
View GitHub Profile
@ctaylo21
ctaylo21 / terminal-integration-test.tsx
Created April 8, 2020 16:51
Example integration test for terminal app
test('ls <tab> with no arg should cycle through options', async (): Promise<void> => {
const { getByLabelText } = render(
<Terminal fileSystem={exampleFileSystem} />,
);
const input = getByLabelText('terminal-input') as HTMLInputElement;
await userEvent.type(input, 'ls ');
await fireTabInput(input);
await fireTabInput(input);
expect(input.value).toBe('ls home/');
@ctaylo21
ctaylo21 / typescript.tsx.snip
Created April 14, 2019 20:23
Snippet file for Typescript React files
snippet react-functional-component
alias rfc
abbr React.FC<T> = (p): JSX.Element => {..}
options head
import React from 'react';
interface ${1:component-name}Props{
${2}
}
@ctaylo21
ctaylo21 / coc-settings.vim
Created April 14, 2019 18:58
coc.nvim settings for Jarvis
" === coc.nvim === "
nmap <silent> <leader>dd <Plug>(coc-definition)
nmap <silent> <leader>dr <Plug>(coc-references)
nmap <silent> <leader>dj <Plug>(coc-implementation)
@ctaylo21
ctaylo21 / Denite-settings.vim
Created April 14, 2019 18:12
Base configuration options for Denite setup in Jarvis
" Custom options for Denite
" auto_resize - Auto resize the Denite window height automatically.
" prompt - Customize denite prompt
" direction - Specify Denite window direction as directly below current pane
" winminheight - Specify min height for Denite window
" highlight_mode_insert - Specify h1-CursorLine in insert mode
" prompt_highlight - Specify color of prompt
" highlight_matched_char - Matched characters highlight
" highlight_matched_range - matched range highlight
let s:denite_options = {'default' : {
@ctaylo21
ctaylo21 / coc-settings.json
Created April 13, 2019 18:50
Coc.nvim settings for Jarvis
{
"suggest.echodocSupport": true,
"suggest.maxCompleteItemCount": 20,
"coc.preferences.formatOnSaveFiletypes": ["javascript", "typescript", "typescriptreact", "json", "javascriptreact"],
"eslint.filetypes": ["javascript", "typescript", "typescriptreact", "javascriptreact"],
"diagnostic.errorSign": "•",
"diagnostic.warningSign": "•",
"diagnostic.infoSign": "•"
}
@ctaylo21
ctaylo21 / denite-mappings.vim
Created April 13, 2019 00:47
Neovim mappings for Denite
" === Denite shorcuts === "
" ; - Browser currently open buffers
" <leader>t - Browse list of files in current directory
" <leader>g - Search current directory for occurences of given term and
" close window if no results
" <leader>j - Search current directory for occurences of word under cursor
nmap ; :Denite buffer -split=floating -winrow=1<CR>
nmap <leader>t :Denite file/rec -split=floating -winrow=1<CR>
nnoremap <leader>g :<C-u>Denite grep:. -no-empty -mode=normal<CR>
nnoremap <leader>j :<C-u>DeniteCursorWord grep:. -mode=normal<CR>
@ctaylo21
ctaylo21 / denite.vim
Created March 21, 2019 02:02
Denite mappings
" === Denite shorcuts === "
" ; - Browser currently open buffers
" <leader>t - Browse list of files in current directory
" <leader>g - Search current directory for occurences of given term and
" close window if no results
" <leader>j - Search current directory for occurences of word under cursor
" <leader>d - Delete item under cursor (useful for delete buffers in normal mode)
nmap ; :Denite buffer<CR>
nmap <leader>t :Denite file_rec<CR>
nnoremap <leader>g :<C-u>Denite grep:. -no-empty -mode=normal<CR>
@ctaylo21
ctaylo21 / fzf.sh
Created October 7, 2018 16:40
Alias for using fzf to fuzzy-find files and then open the match with vim
# fo [FUZZY PATTERN] - Open the selected file with the default editor
# - Bypass fuzzy finder if there's only one match (--select-1)
# - Exit if there's no match (--exit-0)
fo() {
local files
IFS=$'\n' files=($(fzf-tmux --query="$1" --multi --select-1 --exit-0))
[[ -n "$files" ]] && ${EDITOR:-vim} "${files[@]}"
}
@ctaylo21
ctaylo21 / init.vim
Created July 1, 2018 17:00
Customizing background color of terminal windows
" Background colors for terminal windows
hi ActiveTerminal guibg=#333333
" Call method on window enter
augroup WindowManagement
autocmd!
autocmd WinEnter * call Handle_Win_Enter()
augroup END
" Change highlight group of terminal window
@ctaylo21
ctaylo21 / init.vim
Created July 1, 2018 16:29
Example of customizing preview window highlighting
" Call method on window enter
augroup WindowManagement
autocmd!
autocmd WinEnter * call Handle_Win_Enter()
augroup END
" Change highlight group of preview window when open
function! Handle_Win_Enter()
if &previewwindow
setlocal winhighlight=Normal:MarkdownError