Skip to content

Commit

Permalink
simplify list commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Hanson committed Feb 24, 2012
1 parent 6c0054a commit 570b84c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugin/tslime.vim
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@ endfunction

" Session completion
function! Tmux_Session_Names(A,L,P)
return system("tmux list-sessions | sed -e 's/:.*$//'")
return system("tmux list-sessions")
endfunction

" Window completion
function! Tmux_Window_Names(A,L,P)
return system("tmux list-windows -t" . b:tmux_sessionname . ' | grep -e "^\w:" | sed -e "s/ \[[0-9x]*\]$//"')
return system("tmux list-windows -t" . b:tmux_sessionname)
endfunction

" Pane completion
function! Tmux_Pane_Numbers(A,L,P)
return system("tmux list-panes -t " . b:tmux_sessionname . ":" . b:tmux_windowname . " | sed -e 's/:.*$//'")
return system("tmux list-panes -t " . b:tmux_sessionname . ":" . b:tmux_windowname)
endfunction

" set tslime.vim variables
function! s:Tmux_Vars()
let b:tmux_sessionname = input("session name: ", "", "custom,Tmux_Session_Names")
let b:tmux_sessionname = substitute(input("session name: ", "", "custom,Tmux_Session_Names"), ":.*$", '', 'g')
let b:tmux_windowname = substitute(input("window name: ", "", "custom,Tmux_Window_Names"), ":.*$" , '', 'g')
let b:tmux_panenumber = input("pane number: ", "", "custom,Tmux_Pane_Numbers")

Expand Down

0 comments on commit 570b84c

Please sign in to comment.