Skip to content

Commit

Permalink
work with local non-virttualfish vevns
Browse files Browse the repository at this point in the history
  • Loading branch information
lvu committed Apr 11, 2018
1 parent bb097bb commit ec968e9
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
6 changes: 6 additions & 0 deletions auto_venv.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Defined in /var/folders/7z/7p0_kxn92hx5j19278gxgw9r0000gn/T//fish.6l3bme/auto_venv.fish @ line 1
function auto_venv --description 'automatically activate venv (non-virtualfish)' --on-variable PWD
status --is-command-substitution; and return
functions -q deactivate; and deactivate
test -f venv/bin/activate.fish; and source venv/bin/activate.fish
end
10 changes: 9 additions & 1 deletion config.fish
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,13 @@
eval (python -m virtualfish auto_activation global_requirements)
eval (docker-machine env default)

alias vim (which nvim)

test -e {$HOME}/.iterm2_shell_integration.fish ; and source {$HOME}/.iterm2_shell_integration.fish
bass source /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.bash.inc

set -x VIRTUAL_ENV_DISABLE_PROMPT 1

. ~/dotfiles/venv_prompt.fish
. ~/dotfiles/auto_venv.fish
auto_venv
# bass source /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.bash.inc
6 changes: 4 additions & 2 deletions init.vim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set runtimepath+=~/.config/nvim/dein/repos/github.com/Shougo/dein.vim
let g:python_host_prog = '/Users/valentynl/.virtualenvs/nvim2/bin/python'
let g:python3_host_prog = '/Users/valentynl/.virtualenvs/nvim3/bin/python'
let g:python_host_prog = '/Users/vlavrinenko/.virtualenvs/nvim2/bin/python'
let g:python3_host_prog = '/Users/vlavrinenko/.virtualenvs/nvim3/bin/python'

" Required:
if dein#load_state('~/.config/nvim/dein')
Expand Down Expand Up @@ -62,6 +62,8 @@ let g:deoplete#enable_at_startup = 1
autocmd FileType python setlocal omnifunc=jedi#completions
let g:jedi#completions_enabled = 0
let g:jedi#auto_vim_configuration = 0
let g:jedi#show_call_signatures = "2"
let g:jedi#goto_command = "gd"

call neomake#configure#automake('w')
let g:neomake_python_enabled_makers = ['flake8', 'python']
Expand Down
9 changes: 9 additions & 0 deletions venv_prompt.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
functions -c fish_prompt orig_fish_prompt

function fish_prompt
if set -q VIRTUAL_ENV
echo -n -s (set_color -b blue white) "(" (basename "$VIRTUAL_ENV") ")" (set_color normal) " "
end
orig_fish_prompt
end

0 comments on commit ec968e9

Please sign in to comment.