Skip to content

Commit

Permalink
Use slime_default_config
Browse files Browse the repository at this point in the history
  • Loading branch information
thejohnfreeman committed Feb 12, 2017
1 parent c55987d commit 69a7c7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
9 changes: 3 additions & 6 deletions README.md
Expand Up @@ -122,10 +122,6 @@ tmux socket name:
If you started tmux with the -L or -S flag, use that same socket name or path here.
If you didn't put anything, the default name is "default".

You can set the default, e.g. to choose the same tmux session that is running vim:

let g:slime_default_tmux_socket_name = split($TMUX, ",")[0]

tmux target pane:

Note that all of these ordinals are 0-indexed by default.
Expand All @@ -137,9 +133,10 @@ Note that all of these ordinals are 0-indexed by default.
(either session name or number), the ith window and the jth pane
"%i" means i refers the pane's unique id

You can set the default:
You can configure the defaults for these options. If you generally run vim in
a split tmux window with a REPL in the other pane:

let g:slime_default_tmux_target_pane = ":.2"
let g:slime_default_config = {"socket_name": split($TMUX, ",")[0], "target_pane": ":.2"}

### whimrepl

Expand Down
10 changes: 1 addition & 9 deletions plugin/slime.vim
Expand Up @@ -20,14 +20,6 @@ if !exists("g:slime_paste_file")
let g:slime_paste_file = expand("$HOME/.slime_paste")
end

if !exists("g:slime_default_tmux_socket_name")
let g:slime_default_tmux_socket_name = "default"
end

if !exists("g:slime_default_tmux_target_pane")
let g:slime_default_tmux_target_pane = ":"
end

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Screen
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Expand Down Expand Up @@ -83,7 +75,7 @@ endfunction

function! s:TmuxConfig() abort
if !exists("b:slime_config")
let b:slime_config = {"socket_name": g:slime_default_tmux_socket_name, "target_pane": g:slime_default_tmux_target_pane}
let b:slime_config = {"socket_name": "default", "target_pane": ":"}
end
let b:slime_config["socket_name"] = input("tmux socket name or absolute path: ", b:slime_config["socket_name"])
let b:slime_config["target_pane"] = input("tmux target pane: ", b:slime_config["target_pane"], "custom,<SNR>" . s:SID() . "_TmuxPaneNames")
Expand Down

0 comments on commit 69a7c7d

Please sign in to comment.