Skip to content

Commit

Permalink
the repo you deserve
Browse files Browse the repository at this point in the history
suck it emmet

feat: some changes and I don't even know what they are.

feat: some new updates

feat: update

single commit for master
  • Loading branch information
ThePrimeagen committed Dec 1, 2021
1 parent 1f1da91 commit 68b6835
Show file tree
Hide file tree
Showing 33 changed files with 610 additions and 353 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bin/.local/bin/solang

16 changes: 16 additions & 0 deletions bin/.local/bin/nrdp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

set -x
build_name=$(basename $(pwd))
nrdp_path=$HOME/work/nrdp/$build_name
build_path=$HOME/work/builds/$build_name
thread_count=$(projector thread_count || echo 50)

if [[ $1 == "configure" ]]; then
$nrdp_path/configure $(projector configure)
cp $build_path/compile_commands.json $nrdp_path
elif [[ $1 == "pvm-add" ]]; then
pvm build add $nrdp_path -name $2 -- $(projector configure)
elif [[ $1 == "build" ]]; then
ninja -C $build_path -j $thread_count
fi
1 change: 1 addition & 0 deletions bin/.local/bin/proj.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"aliases":{},"projects":{"/home/mpaulson/work/projector":{"foo":"bar222"}}}
Binary file added bin/.local/bin/projector
Binary file not shown.
2 changes: 1 addition & 1 deletion bin/.local/bin/screenkey
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

while [ : ]; do
pkill screenkey
/usr/local/bin/screenkey -s large --scr 1 -p bottom --geometry 1210x300+712+810 --timeout 1.5 &
/usr/bin/screenkey -s large --scr 1 -p bottom --geometry 1210x300+712+810 --timeout 1.5 &
sleep 15
echo "Restarting"
done
Expand Down
7 changes: 5 additions & 2 deletions bin/.local/bin/tmux-cht.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#!/usr/bin/env bash
selected=`cat ~/.tmux-cht-languages ~/.tmux-cht-command | fzf`
if [[ -z $selected ]]; then
exit 0
fi

read -p "Enter Query: " query

if grep -qs "$selected" ~/.tmux-cht-languages; then
query=`echo $query | tr ' ' '+'`
tmux neww bash -c "curl cht.sh/$selected/$query & while [ : ]; do sleep 1; done"
tmux neww bash -c "echo \"curl cht.sh/$selected/$query/\" & curl cht.sh/$selected/$query & while [ : ]; do sleep 1; done"
else
tmux neww bash -c "curl cht.sh/$selected~$query & while [ : ]; do sleep 1; done"
tmux neww bash -c "curl -s cht.sh/$selected~$query | less"
fi

49 changes: 49 additions & 0 deletions bin/.local/bin/tmux-nrdp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env bash

nrdp_commands() {

branch_name=$(basename $1)
nrdp="$NRDP/$branch_name"
build="$NRDP_BUILDS/$branch_name"

mkdir -p $build
cd $build

# configure the damn script
if [ "$2" != "just-build" ]; then
pushd $nrdp
git submodule update
popd

$nrdp/configure $(projector --pwd $nrdp configure)
rm $nrdp/compile_commands.json
cp compile_commands.json $nrdp
fi

# build netflix
$(projector build)

if [ "$2" != "just-build" ]; then
notify-send --icon=gtk-info "NRDP Build $branch_name" "has completed"
else
notify-send --icon=gtk-info "NRDP Build $branch_name" "has been configured and built"
fi
}

case "$1" in
"tmux")

session_name=$(tmux display-message -p '#S');
clean_arg=$(basename $2 | tr '/.' '__')
target="$session_name:$clean_arg"

if ! tmux has-session -t $target; then
tmux neww -dn $clean_arg
fi
tmux send-keys -t $target "tmux-nrdp $2 $3"
;;
*)
nrdp_commands $1 $2
;;
esac

Expand Down
60 changes: 11 additions & 49 deletions bin/.local/bin/tmux-sessionizer
Original file line number Diff line number Diff line change
@@ -1,63 +1,25 @@
#!/usr/bin/env bash

TMUX_HISTORY_LENGTH=10
TMUX_HISTORY_FILE=$HOME/.tmux-sessionizer

add_new_line() {
tail -n1 $1 | read -r _ || echo >> $1
}

update_history() {
# TODO: Probably change this to .config once i have the proper version of tmux
if [[ ! -e "$TMUX_HISTORY_FILE" ]]; then
touch $TMUX_HISTORY_FILE
fi
tmux_contents=`cat $TMUX_HISTORY_FILE`
printf "$1\n$tmux_contents" > $TMUX_HISTORY_FILE
sed -ni "1,${TMUX_HISTORY_LENGTH}p" $TMUX_HISTORY_FILE
add_new_line $TMUX_HISTORY_FILE
}

clear_history() {
rm $TMUX_HISTORY_FILE
touch $TMUX_HISTORY_FILE
}

if [[ "$1" = "clear" ]]; then
clear_history
exit 0
elif [[ "$1" = "-v" ]]; then
cat $TMUX_HISTORY_FILE
exit 0
elif [[ $# -eq 1 ]]; then
if [[ $# -eq 1 ]]; then
selected=$1
elif [[ $# -eq 2 && "$1" = "restore" ]]; then
history_length=`cat $TMUX_HISTORY_FILE | wc -l`
if [[ $2 -gt $history_length ]]; then
echo "Requested $2 item, but there is only $history_length available."
exit 1
elif [[ $2 -ge $TMUX_HISTORY_LENGTH ]]; then
echo "cannot provide a length greater than $TMUX_HISTORY_LENGTH"
exit 1
fi
selected=`cat $TMUX_HISTORY_FILE | sed -n "$2,${2}p"`
else
items=`find ~/work -maxdepth 1 -mindepth 1 -type d`
items+=`find ~/personal -maxdepth 1 -mindepth 1 -type d`
items+=`find ~ -maxdepth 1 -mindepth 1 -type d`
selected=`echo "$items" | fzf`
selected=$(find ~/work/builds ~/ ~/work ~/personal ~/personal/yt -mindepth 1 -maxdepth 1 -type d | fzf)
fi

if [[ -z $selected ]]; then
exit 0
fi

tmux_session_name=`basename $selected | tr . _`
update_history $selected
selected_name=$(basename "$selected" | tr . _)
tmux_running=$(pgrep tmux)

tmux switch-client -t $tmux_session_name
if [[ $? -eq 0 ]]; then
if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then
tmux new-session -s $selected_name -c $selected
exit 0
fi

tmux new-session -c $selected -d -s $tmux_session_name && tmux switch-client -t $tmux_session_name || tmux new -c $selected -A -s $tmux_session_name
if ! tmux has-session -t $selected_name 2> /dev/null; then
tmux new-session -ds $selected_name -c $selected
fi

tmux switch-client -t $selected_name
12 changes: 12 additions & 0 deletions bin/.local/bin/tmux-tvui
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
tmux-windowizer client 
tmux-windowizer server 

branch_name=$(basename $1)
tmux-windowizer client cd $branch_name
tmux-windowizer client ./tvui client

tmux-windowizer server cd $branch_name
tmux-windowizer server ./tvui server


13 changes: 13 additions & 0 deletions bin/.local/bin/tmux-windowizer
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

branch_name=$(basename $1)
session_name=$(tmux display-message -p "#S")
clean_name=$(echo $branch_name | tr "./" "__")
target="$session_name:$clean_name"

if ! tmux has-session -t $target 2> /dev/null; then
tmux neww -dn $clean_name
fi

shift
tmux send-keys -t $target "$*"
Expand Down
25 changes: 25 additions & 0 deletions i3/.config/i3/config
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,31 @@ bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10

# switch to workspace
#_ bindsym $mod+Shift+equal workspace 1
#_ bindsym $mod+bracketleft workspace 2
#_ bindsym $mod+Shift+bracketleft workspace 3
#_ bindsym $mod+Shift+9 workspace 4
#_ bindsym $mod+Shift+7 workspace 5
#_ bindsym $mod+equal workspace 6
#_ bindsym $mod+Shift+0 workspace 7
#_ bindsym $mod+Shift+bracketright workspace 8
#_ bindsym $mod+bracketright workspace 9
#_ bindsym $mod+Shift+8 workspace 10
#_
#_ # move focused container to workspace
#_ bindsym $mod+1 move container to workspace 1
#_ bindsym $mod+2 move container to workspace 2
#_ bindsym $mod+3 move container to workspace 3
#_ bindsym $mod+4 move container to workspace 4
#_ bindsym $mod+5 move container to workspace 5
#_ bindsym $mod+6 move container to workspace 6
#_ bindsym $mod+7 move container to workspace 7
#_ bindsym $mod+8 move container to workspace 8
#_ bindsym $mod+9 move container to workspace 9
#_ bindsym $mod+0 move container to workspace 10


# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
Expand Down
35 changes: 29 additions & 6 deletions nvim/.config/nvim/init.vim
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
" hello front end masters
set path+=**

" Nice menu when typing `:find *.py`
Expand All @@ -19,7 +20,14 @@ Plug 'ambv/black'

" Plebvim lsp Plugins
Plug 'neovim/nvim-lspconfig'
Plug 'hrsh7th/nvim-compe'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/nvim-cmp'
Plug 'tzachar/cmp-tabnine', { 'do': './install.sh' }
Plug 'onsails/lspkind-nvim'
" Plug 'github/copilot.vim'
Plug 'nvim-lua/lsp_extensions.nvim'

" Plug 'nvim-lua/completion-nvim'
Plug 'glepnir/lspsaga.nvim'
Plug 'simrat39/symbols-outline.nvim'
Expand All @@ -31,7 +39,8 @@ Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'nvim-treesitter/playground'

" Debugger Plugins
Plug 'puremourning/vimspector'
Plug 'mfussenegger/nvim-dap'
Plug 'Pocco81/DAPInstall.nvim'
Plug 'szw/vim-maximizer'

" Snippets
Expand All @@ -41,13 +50,15 @@ Plug 'rafamadriz/friendly-snippets'
Plug 'rust-lang/rust.vim'
Plug 'darrikonn/vim-gofmt'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rhubarb'
Plug 'junegunn/gv.vim'
Plug 'vim-utils/vim-man'
Plug 'mbbill/undotree'
Plug 'tpope/vim-dispatch'
Plug 'theprimeagen/vim-be-good'
Plug 'gruvbox-community/gruvbox'
Plug 'tpope/vim-projectionist'
Plug 'tomlion/vim-solidity'

" telescope requirements...
Plug 'nvim-lua/popup.nvim'
Expand All @@ -72,15 +83,15 @@ Plug 'sbdchd/neoformat'
call plug#end()

" Adding local modules
let &runtimepath.=',' . expand("$HOME") . '/personal/harpoon/master'
let &runtimepath.=',' . expand("$HOME") . '/personal/harpoon/tmux'
let &runtimepath.=',' . expand("$HOME") . '/personal/vim-with-me/ui'
let &runtimepath.=',' . expand("$HOME") . '/personal/git-worktree.nvim/master'
let &runtimepath.=',' . expand("$HOME") . '/personal/refactoring.nvim/get-locals-2'
let &runtimepath.=',' . expand("$HOME") . '/personal/refactoring.nvim/master'

" let g:vimspector_install_gadgets = [ 'debugpy', 'vscode-cpptools', 'CodeLLDB' ]

lua require("theprimeagen")
lua require'nvim-treesitter.configs'.setup { indent = { enable = true }, highlight = { enable = true }, incremental_selection = { enable = true }, textobjects = { enable = true }}
lua require'nvim-treesitter.configs'.setup { highlight = { enable = true }, incremental_selection = { enable = true }, textobjects = { enable = true }}
let g:vim_be_good_log_file = 1
let g:vim_apm_log = 1

Expand All @@ -101,7 +112,10 @@ imap <silent><expr> <C-E> luasnip#choice_active() ? '<Plug>luasnip-next-choice'
smap <silent><expr> <C-E> luasnip#choice_active() ? '<Plug>luasnip-next-choice' : '<C-E>'
nnoremap <silent> Q <nop>
nnoremap <silent> <C-f> :lua require("harpoon.term").sendCommand(1, "tmux-sessionizer\n"); require("harpoon.term").gotoTerminal(1)<CR>
nnoremap <silent> <C-f> :silent !tmux neww tmux-sessionizer<CR>
" Probably rename this, because its straight silly to be a worktree.
nnoremap <leader>; :lua require("theprimeagen.git-worktree").execute(vim.loop.cwd(), "just-build")<CR>
nnoremap <leader>vwh :h <C-R>=expand("<cword>")<CR><CR>
nnoremap <leader>bs /<C-R>=escape(expand("<cWORD>"), "/")<CR><CR>
nnoremap <leader>u :UndotreeShow<CR>
Expand All @@ -119,10 +133,18 @@ nnoremap <leader>dwm :lua require("vim-with-me").disconnect()<CR>
nnoremap <leader>gll :let g:_search_term = expand("%")<CR><bar>:Gclog -- %<CR>:call search(g:_search_term)<CR>
nnoremap <leader>gln :cnext<CR>:call search(_search_term)<CR>
nnoremap <leader>glp :cprev<CR>:call search(_search_term)<CR>
nnoremap <leader>nf :!./scripts/format.py %
nnoremap <leader>x :silent !chmod +x %<CR>
vnoremap J :m '>+1<CR>gv=gv
vnoremap K :m '<-2<CR>gv=gv
nnoremap Y yg$
nnoremap n nzzzv
nnoremap N Nzzzv
nnoremap J mzJ`z
" greatest remap ever
xnoremap <leader>p "_dP
Expand Down Expand Up @@ -164,6 +186,7 @@ augroup END

augroup THE_PRIMEAGEN
autocmd!
autocmd BufWritePre lua,cpp,c,h,hpp,cxx,cc Neoformat
autocmd BufWritePre * %s/\s\+$//e
autocmd BufEnter,BufWinEnter,TabEnter *.rs :lua require'lsp_extensions'.inlay_hints{}
augroup END
19 changes: 19 additions & 0 deletions nvim/.config/nvim/lua/theprimeagen/debugger.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
local dap_install = require("dap-install")
dap_install.config("chrome", {})


local dap = require("dap");
dap.configurations.typescriptreact = { -- change to typescript if needed
{
type = "chrome",
request = "attach",
program = "${file}",
cwd = vim.fn.getcwd(),
sourceMaps = true,
protocol = "inspector",
port = 9222,
webRoot = "${workspaceFolder}"
}
}

require('dap.ext.vscode').load_launchjs()
Loading

0 comments on commit 68b6835

Please sign in to comment.