Skip to content

Commit

Permalink
apple script activate browser tab
Browse files Browse the repository at this point in the history
  • Loading branch information
joelpalmer committed May 3, 2021
1 parent 3dbe13f commit 8a8331f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
**/.DS_Store
osascripts/tabact.scpt
5 changes: 5 additions & 0 deletions public dots/vim-nvim/init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'nvim-treesitter/playground'
call plug#end()

let g:matchup_surround_enabled = 1

" fzf-gh settings
let g:fzf_gh_website=1

Expand Down Expand Up @@ -239,6 +241,9 @@ require'nvim-treesitter.configs'.setup {
indent = {
enable = true,
disable = { "javascript" }
},
matchup = {
enable = true,
},
autopairs = {
enable = true
Expand Down
7 changes: 6 additions & 1 deletion public dots/zsh/functions.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ rdf() {
rustup doc $1 || (echo "Searching..." && open "https://doc.rust-lang.org/std/?search=$query")
}

# set Active Browser Tab: @titleText → finds tab with title that contains the text
abt() {
osascript ~/dotfiles/osascripts/tabact.scpt $1
}

# screenshot
sc() {
screencapture -x ~/Screenshots/$1
Expand Down Expand Up @@ -120,7 +125,7 @@ cdg() {
}

fvh() {
rg "$1" --ignore-case --files-with-matches --no-messages ~/notes/ ~/dotfiles/ ~/.vim/ ~/.config/nvim/ | fzf --preview "highlight -O ansi -l {} 2> /dev/null | rg --colors 'match:bg:yellow' --ignore-case --pretty --context 6 '$1' || rg --ignore-case --pretty --context 6 '$1' {}" --preview-window=right:60% --multi --select-1 --exit-0
rg "$1" --ignore-case --files-with-matches --no-messages ~/notes/ ~/dotfiles/ ~/.vim/ ~/.config/nvim/ /usr/local/Caskroom/neovim-nightly/latest/nvim-osx64/share/nvim/runtime/doc/ | fzf --preview "highlight -O ansi -l {} 2> /dev/null | rg --colors 'match:bg:yellow' --ignore-case --pretty --context 6 '$1' || rg --ignore-case --pretty --context 6 '$1' {}" --preview-window=right:60% --multi --select-1 --exit-0
}

# for `vg` grep- find-in-file(s)
Expand Down
14 changes: 14 additions & 0 deletions tabact.applescript
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
on run argv
tell application "Brave Browser"
repeat with w in (windows)
set j to 0
repeat with t in (tabs of w)
set j to j + 1
if title of t contains (item 1 of argv) then
set (active tab index of w) to j
return
end if
end repeat
end repeat
end tell
end run

0 comments on commit 8a8331f

Please sign in to comment.