mirror of
https://github.com/akelge/zsh
synced 2025-08-15 14:28:35 +00:00
Moved to Vundle
Adopted vim-templates plugin, instead of homegrown skeleton
This commit is contained in:
31
vim/bundle/open-terminal-filemanager/README
Normal file
31
vim/bundle/open-terminal-filemanager/README
Normal file
@ -0,0 +1,31 @@
|
||||
This is a mirror of http://www.vim.org/scripts/script.php?script_id=2896
|
||||
|
||||
Some vim user want to shell like emacs's eshell. But vim don't support shell,
|
||||
terminal interface in vim (at least 7.x version).
|
||||
|
||||
In this situation, I try some terminal patches or shell attached plugins. But everyone don't perfectly emulate native terminal or have much dependencies. So I use simple native terminal and filemanager open script for my various platforms.
|
||||
|
||||
|
||||
|
||||
Commmands
|
||||
:OpenTerminal Open native terminal sw.
|
||||
:OpenFilemanager Open native file manager.
|
||||
|
||||
|
||||
|
||||
Key map recommendations (I'm using)
|
||||
nnoremap <silent> <F9> :OpenTerminal<CR>
|
||||
nnoremap <silent> <F10> :OpenFilemanager<CR><CR>
|
||||
|
||||
|
||||
|
||||
Tested platform
|
||||
* Mac ~ Terminal.app, finder
|
||||
* MacVim
|
||||
* Windows 7 64bit, XP ~cmd.exe , explorer
|
||||
* [portable] gVim
|
||||
* Gnome ~ gnome-terminal, nautilus
|
||||
* gVim
|
||||
|
||||
This is very simple script. If plugin show wrong operation feedback to me. I can't test in windows xp, KDE etc :)
|
||||
|
71
vim/bundle/open-terminal-filemanager/doc/open_terminal.txt
Normal file
71
vim/bundle/open-terminal-filemanager/doc/open_terminal.txt
Normal file
@ -0,0 +1,71 @@
|
||||
*open-terminal* Open Terminal, Filemanager for various platform
|
||||
|
||||
Open Terminal Help File
|
||||
|
||||
Introduction |open-terminal-introduction|
|
||||
Commmands |open-terminal-commands|
|
||||
Requires |open-terminal-requires|
|
||||
Key map examples |open-terminal-keymap|
|
||||
Changelog |open-terminal-changelog|
|
||||
About |open-terminal-about|
|
||||
|
||||
==============================================================================
|
||||
Introduction *open-terminal-introduction*
|
||||
|
||||
Some vim user want to shell like emacs's eshell. But vim don't support shell,
|
||||
terminal interface in vim (at least 7.x version).
|
||||
|
||||
In this situation, I use native terminal software open script for my various
|
||||
working platforms.
|
||||
|
||||
==============================================================================
|
||||
Commmands *open-terminal-commands*
|
||||
|
||||
*OpenTerminal*
|
||||
:OpenTerminal Open native terminal sw. Check |requires| list
|
||||
|
||||
*OpenFilemanager*
|
||||
:OpenFilemanager Open native file manager. Check |requires| list
|
||||
|
||||
|
||||
==============================================================================
|
||||
Map key examples *open-terminal-keymap*
|
||||
>
|
||||
nnoremap <silent> <F9> :OpenTerminal<CR>
|
||||
nnoremap <silent> <F10> :OpenFilemanager<CR><CR>
|
||||
<
|
||||
|
||||
==============================================================================
|
||||
Requires (per platform) *open-terminal-requires*
|
||||
|
||||
I use Mac, Gnome, Windows(gvim). I don't test in KDE environment.
|
||||
|
||||
Platform Terminal File manager ~
|
||||
>
|
||||
Mac Terminal.app Finder
|
||||
(with Applescript)
|
||||
Gnome gnome-terminal nautilus
|
||||
KDE konsole konqueror
|
||||
Windows cmd explorer
|
||||
(with start)
|
||||
cygwin bash explorer
|
||||
<
|
||||
==============================================================================
|
||||
Changelog *open-terminal-changelog*
|
||||
|
||||
0.1:
|
||||
- First release used script for everyone.
|
||||
|
||||
|
||||
==============================================================================
|
||||
About *open-terminal-about*
|
||||
|
||||
Copyright (c) 2009 by neocoin ~
|
||||
File: open_terminal.vim
|
||||
Author: Sangmin Ryu (neocoin@gmail.com)
|
||||
Date: Tue Dec 22 13:33:32 PST 2009
|
||||
License: The MIT License
|
||||
|
||||
==============================================================================
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
9
vim/bundle/open-terminal-filemanager/doc/tags
Normal file
9
vim/bundle/open-terminal-filemanager/doc/tags
Normal file
@ -0,0 +1,9 @@
|
||||
OpenFilemanager open_terminal.txt /*OpenFilemanager*
|
||||
OpenTerminal open_terminal.txt /*OpenTerminal*
|
||||
open-terminal open_terminal.txt /*open-terminal*
|
||||
open-terminal-about open_terminal.txt /*open-terminal-about*
|
||||
open-terminal-changelog open_terminal.txt /*open-terminal-changelog*
|
||||
open-terminal-commands open_terminal.txt /*open-terminal-commands*
|
||||
open-terminal-introduction open_terminal.txt /*open-terminal-introduction*
|
||||
open-terminal-keymap open_terminal.txt /*open-terminal-keymap*
|
||||
open-terminal-requires open_terminal.txt /*open-terminal-requires*
|
108
vim/bundle/open-terminal-filemanager/plugin/open_terminal.vim
Normal file
108
vim/bundle/open-terminal-filemanager/plugin/open_terminal.vim
Normal file
@ -0,0 +1,108 @@
|
||||
"
|
||||
" File: open_terminal.vim
|
||||
"
|
||||
" Requires:
|
||||
" platform Terminal File manager
|
||||
" Mac Terminal.app Finder
|
||||
" (with Applescript)
|
||||
" Gnome gnome-terminal nautilus
|
||||
" KDE konsole konqueror
|
||||
" Windows cmd explorer
|
||||
" (with start)
|
||||
" cygwin bash explorer
|
||||
"
|
||||
" Example:
|
||||
" nnoremap <silent> <F9> :OpenTerminal<CR>
|
||||
" nnoremap <silent> <F10> :OpenFilemanager<CR><CR>
|
||||
"
|
||||
" Commands:
|
||||
" OpenTerminal
|
||||
" OpenFilemanager
|
||||
"
|
||||
|
||||
" OpenTerminal {{{1
|
||||
function! s:open_terminal()
|
||||
let l:current_dir = getcwd()
|
||||
execute("chdir " . escape(expand("%:p:h"), " \"'"))
|
||||
|
||||
if has("mac")
|
||||
let l:cmd = "
|
||||
\ tell application 'System Events' \n
|
||||
\ set is_term_running to exists application process '$Terminal' \n
|
||||
\ end tell \n
|
||||
\
|
||||
\ set cmd to 'cd $current_path' \n
|
||||
\ tell application '$Terminal' \n
|
||||
\ activate \n
|
||||
\ if is_term_running is true then \n
|
||||
\ do script with command cmd \n
|
||||
\ else \n
|
||||
\ do script with command cmd in window 1 \n
|
||||
\ end if \n
|
||||
\ end tell \n
|
||||
\ "
|
||||
let l:cmd = substitute(l:cmd, "'", '\\"', 'g')
|
||||
let l:cmd = substitute( l:cmd, "$Terminal", "Terminal", "g" )
|
||||
let l:cmd = substitute( l:cmd, "$current_path", "'" . expand("%:p:h") . "'" , "g")
|
||||
call system('osascript -e " ' . l:cmd . '"')
|
||||
|
||||
elseif has("gui_gnome") && executable("gnome-terminal")
|
||||
call system("gnome-terminal &")
|
||||
elseif has("gui_gnome") && executable("konsole")
|
||||
call system("konsole &")
|
||||
elseif has("gui_win32")
|
||||
try
|
||||
call system("start cmd")
|
||||
catch /E484:/
|
||||
echo "Ignore E484 error in Windows platform"
|
||||
endtry
|
||||
elseif executable("bash")
|
||||
!bash
|
||||
elseif has("win32")
|
||||
stop
|
||||
endif
|
||||
|
||||
execute("chdir " . escape(l:current_dir, " \"'"))
|
||||
endfunction
|
||||
|
||||
command! -nargs=0 -bar OpenTerminal call s:open_terminal()
|
||||
|
||||
"}}}1
|
||||
|
||||
" OpenFilemanager {{{1
|
||||
function! s:open_filemanager()
|
||||
let l:cmd = "$cmd ."
|
||||
|
||||
let l:current_dir = getcwd()
|
||||
execute("chdir " . escape(expand("%:p:h"), " \"'"))
|
||||
|
||||
if has("mac")
|
||||
call system("open .")
|
||||
elseif has("gui_gnome") && executable("nautilus")
|
||||
call system("nautilus .")
|
||||
elseif has("gui_gnome") && executable("konqueror")
|
||||
call system("konqueror .")
|
||||
elseif has("gui_win32") || has("win32")
|
||||
call system("explorer .")
|
||||
elseif executable("bash")
|
||||
!bash
|
||||
endif
|
||||
|
||||
execute("chdir " . escape(l:current_dir, " \"'"))
|
||||
endfunction
|
||||
|
||||
command! -nargs=0 -bar OpenFilemanager call s:open_filemanager()
|
||||
" }}}1
|
||||
|
||||
" About file info {{{1
|
||||
"=============================================================================
|
||||
" Copyright (c) 2009 by neocoin
|
||||
" File: open_terminal.vim
|
||||
" Author: Sangmin Ryu (neocoin@gmail.com)
|
||||
" Date: Tue Dec 22 13:33:32 PST 2009
|
||||
" License: The MIT License
|
||||
" Version: 0.1
|
||||
"=============================================================================
|
||||
" }}}1
|
||||
|
||||
" vim: set fdm=marker:
|
Reference in New Issue
Block a user