GithubHelp home page GithubHelp logo

xolox / vim-shell Goto Github PK

View Code? Open in Web Editor NEW
169.0 8.0 13.0 578 KB

Improved integration between Vim and its environment (fullscreen, open URL, background command execution)

Home Page: http://peterodding.com/code/vim/shell/

Vim Script 73.41% Shell 1.99% C 24.60%

vim-shell's Introduction

Improved integration between
Vim and its environment

This plug-in aims to improve the integration between Vim vim and its environment (your operating system) by providing the following functionality:

  • The :Fullscreen command and <F11> mapping toggle Vim between normal and full-screen mode (see the screenshots screenshots). To invoke this functionality without using the :Fullscreen command see the xolox#shell#fullscreen() and xolox#shell#is_fullscreen() functions.

    • The :Maximize command and <Control-F11> mapping toggle Vim between normal and maximized state: They show/hide Vim's menu bar, tool bar and/or tab line without hiding the operating system task bar.
  • The :Open command and <F6> mapping know how to open file and directory names, URLs and e-mail addresses in your favorite programs (file manager, web browser, e-mail client, etc).

  • The xolox#misc#os#exec() function enables other Vim plug-ins (like my [easytags.vim] easytags plug-in) to execute external commands in the background (i.e. asynchronously) without opening a command prompt window on Windows.

Two [Windows DLL files] dll are included to perform these functions on Windows, while on UNIX external commands are used. MacVim supports full-screen out of the box (and vim-shell knows how to enable it) but is otherwise treated as UNIX.

Installation

Please note that the vim-shell plug-in requires my vim-misc plug-in which is separately distributed.

Unzip the most recent ZIP archives of the [vim-shell] download-shell and [vim-misc] download-misc plug-ins inside your Vim profile directory (usually this is ~/.vim on UNIX and %USERPROFILE%\vimfiles on Windows), restart Vim and execute the command :helptags ~/.vim/doc (use :helptags ~\vimfiles\doc instead on Windows).

If you prefer you can also use Pathogen pathogen, Vundle vundle or a similar tool to install & update the [vim-shell] github-shell and [vim-misc] github-misc plug-ins using a local clone of the git repository.

After you've installed the plug-in and restarted Vim, the following commands will be available to you:

Usage (commands & functions)

The :Maximize command

This command toggles the visibility of Vim's main menu, tool bar and/or tab line. It's mapped to <Control-F11> by default, see g:shell_mappings_enabled if you don't like this. If you want to change which items are hidden see the g:shell_fullscreen_items option.

The :Fullscreen command

The :Fullscreen command toggles Vim between normal and [full-screen mode] screenshots. It's mapped to <F11> by default, see g:shell_mappings_enabled if you don't like this. This command first executes :Maximize and then (if possible) switches Vim's [GUI window] gui to real full-screen mode (hiding any [taskbars, panels or docks] taskbars). When you leave full-screen Vim's main menu, toolbar and tabline are restored and the [GUI window] gui is switched back to normal mode.

Note that on UNIX this command even works inside of graphical terminal emulators like gnome-terminal or xterm (try it out!).

The :Open command

The :Open command knows how to open files, directories, URLs and e-mail addresses. It's mapped to <F6> by default, see g:shell_mappings_enabled if you don't like this. You can provide a filename, URL or e-mail address as argument to the command or if there's a filename, URL or e-mail address under the text cursor that will be used. If both of those fail, the directory containing the current file will be opened. You can use the command as follows:

:Open http://www.vim.org/

This will launch your preferred (or the best available) web browser. Likewise the following command will open your file manager in the directory of Vim's runtime files:

:Open $VIMRUNTIME

Note that on UNIX if the environment variable $DISPLAY is empty the plug-in will fall back to a command-line web browser. Because such web browsers are executed in front of Vim you have to quit the web browser to return to Vim.

The :MakeWithShell command

This command is a very simple replacement for the :make [] command that does not pop up a console window on Windows. It doesn't come with all of the bells and whistles that Vim's built-in make command does but it should work. It properly triggers the QuickFixCmdPre [] and QuickFixCmdPost [] events, although it does so using :silent [] to avoid printing two "No matching autocommands" messages.

Because Vim's v:shell_error [] variable is read only (which means it cannot be set by a Vim plug-in) the vim-shell plug-in defines its own variable with the exit code of the make process executed by :MakeWithShell. This variable is called g:xolox#shell#make_exit_code. The semantics are exactly the same as for v:shell_error [].

The :MakeWithShell command uses Vim's quickfix window []. To make the shell plug-in use the location-list [] instead you can use the command :LMakeWithShell instead.

The xolox#shell#execute_with_dll() function

The function xolox#shell#execute_with_dll() is used by xolox#misc#os#exec() and shouldn't be called directly; instead please call xolox#misc#os#exec() (this is what my plug-ins do). For this reason the remainder of the following text discusses the xolox#misc#os#exec() function.

This function enables other Vim plug-ins to execute external commands in the background (i.e. asynchronously) without opening a command prompt window on Windows. For example try to execute the following command on Windows ([vimrun.exe] vimrun is only included with Vim for Windows because it isn't needed on other platforms):

:call xolox#misc#os#exec({'command': 'vimrun', 'async': 1})

Immediately after executing this command Vim will respond to input again because xolox#misc#os#exec() doesn't wait for the external command to finish when the 'async' argument is true (1). In addition no command prompt window will be shown which means [vimrun.exe] vimrun is running completely invisible in the background.

The function returns a dictionary of return values. In asynchronous mode the dictionary is empty. In synchronous mode it contains the following key/value pairs:

:echo xolox#misc#os#exec({'command': 'echo "this is stdout" && echo "this is stderr" >&2 && exit 42', 'check': 0})
{'exit_code': 42, 'stdout': ['this is stdout'], 'stderr': ['this is stderr']}

If you want to verify that this function works as described, execute the command mentioning vimrun above, open the Windows task manager by pressing Control-Shift-Escape and check that the process vimrun.exe is listed in the processes tab. If you don't see the problem this is solving, try executing [vimrun.exe] vimrun using Vim's built-in [system()] system function instead:

:call system('vimrun')

Vim will be completely unresponsive until you "press any key to continue" in the command prompt window that's running [vimrun.exe] vimrun. Of course the [system()] system function should only be used with non-interactive programs (the documentation says as much) but the point is to simulate an external command that takes a while to finish and blocks Vim while doing so.

Note that on Windows this function uses Vim's ['shell'] sh_opt and ['shellcmdflag'] shcf_opt options to compose the command line passed to the DLL.

The xolox#shell#fullscreen() function

Call this function to toggle Vim's full screen status. The :Fullscreen command is just a shorter way to call this function.

The xolox#shell#is_fullscreen() function

Call this function to determine whether Vim is in full screen mode. My [session.vim plug-in] vim-session uses this to persist full screen mode.

The g:shell_fullscreen_items option

This variable is a string containing any combination of the following characters:

  • m: Hide the [main menu] go-m when switching to full-screen;
  • T: Hide the [toolbar] go-T when switching to full-screen;
  • e: Hide the [tabline] go-e when switching to full-screen (this also toggles the [showtabline option] stal).

By default all the above items are hidden in full-screen mode. You can also set the buffer local variable b:shell_fullscreen_items to change these settings for specific buffers.

The g:shell_fullscreen_always_on_top option

On Windows the :Fullscreen command sets the Vim window to "always on top". Some people don't like this which is why this option was added. Its default value is true (1) so to disable the "always on top" feature you would add this to your [vimrc script] vimrc:

:let g:shell_fullscreen_always_on_top = 0

The g:shell_fullscreen_message option

When you enter full screen the plug-in shows a Vim message explaining how to leave full screen. If you don't want to see this message you can set this option to false (0).

The g:shell_mappings_enabled option

If you don't like the default mappings for the :Open and :Fullscreen commands then add the following to your [vimrc script] vimrc:

:let g:shell_mappings_enabled = 0

Since no mappings will be defined now you can add something like the following to your [vimrc script] vimrc:

:inoremap <Leader>fs <C-o>:Fullscreen<CR>
:nnoremap <Leader>fs :Fullscreen<CR>
:inoremap <Leader>op <C-o>:Open<CR>
:nnoremap <Leader>op :Open<CR>

The g:shell_verify_urls option

When you use the :Open command or the <F6> mapping to open the URL under the text cursor, the shell plug-in uses a regular expression to guess where the URL starts and ends. This works 99% percent of the time but it can break, because in this process the shell plug-in will strip trailing punctuation characters like dots (because they were likely not intended to be included in the URL).

If you actually deal with URLs that include significant trailing punctuation and your Vim is compiled with Python support you can enable the option g:shell_verify_urls (by setting it to 1 in your [vimrc script] vimrc). When you do this the plug-in will perform an HTTP HEAD request on the URL without stripping trailing punctuation. If the request returns an HTTP status code that indicates some form of success (the status code is at least 200 and less than 400) the URL including trailing punctuation is opened. If the HEAD request fails the plug-in will try again without trailing punctuation.

The g:shell_use_dll option

If you set this to false (0) the DDL is never used. This is very useful during testing :-).

Background

Vim has a limited ability to call external libraries using the Vim script function [libcall()] libcall. A few years ago when I was still using Windows a lot I created a [Windows DLL] dll that could be used with [libcall()] libcall to toggle Vim vim's GUI window between regular and full-screen mode. I also added a few other useful functions, e.g. openurl() to launch the default web browser and execute() which works like Vim's [system()] system function but doesn't wait for the process to finish and doesn't show a command prompt.

Since then I switched to Linux and didn't look back, which meant the DLL sat in my ~/.vim/etc/ waiting to be revived. Now that I've published my [easytags.vim] easytags plug-in and put a lot of effort into making it Windows compatible, the execute() function from the DLL would be very useful to run [Exuberant Ctags] ctags in the background without stealing Vim's focus by opening a command prompt window. This is why I've decided to release the DLL. Because I switched to Linux I've also added an autoload script that wraps the DLL on Windows and calls out to external programs such as wmctrl, gnome-open, kde-open, and others on UNIX.

Other full-screen implementations

After publishing this plug-in I found that the Vim plug-ins VimTweak vimtweak and gvimfullscreen_win32 gvimfullscreen_win32 also implement full-screen on Windows using a similar approach as my plug-in. I prefer the effect of my plug-in because it seems to hide window decorations more effectively. Also note that my plug-in was developed independently of the other two.

Contact

If you have questions, bug reports, suggestions, etc. the author can be contacted at [email protected]. The latest version is available at http://peterodding.com/code/vim/shell/ and http://github.com/xolox/vim-shell. If you like the plug-in please vote for it on [Vim Online] vim_scripts_entry.

License

This software is licensed under the [MIT license] mit. © 2014 Peter Odding <[email protected]>.

vim-shell's People

Contributors

inkarkat avatar kergoth avatar mmontu avatar tarmack avatar xolox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-shell's Issues

Open & Fullscreen focus

When Vim is not in fullscreen and :Open is executed the external application (file browser, web browser) opens in front of Vim and get the focus - which I believe is the expected behavior, as you'd normally use the application that was just started.

But if :Fullscreen is executed before :Open then the external application opens but Vim retains the focus. Is there an option to make the external application to get the focus?

install on Windows question

I use Vim to write prose and notes; Opening links from markdown files is a huge convenience.
So I installed vim-shell on Windows 7 with Vundle and Vim 7.4.
But vim-shell is not working. Maybe I did something wrong on the install.

This is in my _vimrc file:
Plugin 'file:///C:/Users/wolf/vimfiles/vim-misc/autoload/xolox/misc.vim'
Plugin 'file:///C:/Users/wolf/vimfiles/shell/autoload/xolox/shell.vim'

This is my directory:
vim-shell

Do I have it set up right?
Thank you.

using vim-shell with netrw.vim?

I'm using netrw.vim on a windows 7 machine and there is a console flash from vimrun when the file is saved. Is there a way to use netrw.vim to suppress this?

Thanks!

Doesn't open URLs from Apple mail.app

I'm running into a problem where the Open command isn't getting the correct URL. I think the problem is that the URLs for message links have a % sign in them.

The link should be:

message://%3cCAC1F077.18CFC%[email protected]%3e

Calling :Open on this tells mail to open:

message://%253cCAC1F077.18CFC%[email protected]%253e

Mail doesn't know how to open this due to the spurious %25's.

GrepWithShell

Following the same idea of :MakeWithShell and :LMakeWithShell, is it possible to create :GrepWithShell?

This would make possible to integrate :Fullscreen with ack.vim.

Open visually selected path / file / url ...

Hi
first of all thanks for the great plugin!

I am wondering how I could open a visually selected path / file / url ... with Open (or the underlying function). On Windows I often have a path like "C:\some directory\with a file.docx". So the <F6> / the Open command does not work because of the spaces. I would love to be able to visually select it and to open it with e.g. <F6> (copy and pasting it into the command window with Open works).

get silent

Is there an option to avoid messages being displayed when going to fullscreen, when I go to fullscreen there's a long message which I'd prefer to avoid if possible.

vim-shell opens text files in NotePad

I am reading a .txt file in Vim 7.4, on Windows 7.
When I F-6 on a .txt or .text file URI in Vim, the file opens in NotePad.

file:///C:/Users/wolf/Documents/a.txt
file:///C:/Users/wolf/Documents/b.text

When I click on a.txt or b.text from Explorer, the file opens in Vim. The irony :)
From Explorer > Properties > Opens with: Vi Improved - A Text Editor.

Is there a way to make vim-shell open .txt files in Vim?

vim-shell opens these file types as expected:
.doc
.odt
.cvs
.bmp

vim-shell is unresponsive when I F-6 on these file types:
.markdown (Explorer opens it in Vim)

vim-shell opens these file types in NotePad:
.txt (Explorer opens it in Vim)
.text (Explorer opens it in Vim)

Can <F6> open the vim files in the current window?

I use vim-shell to open links to other vim files.
opens the vim files in a new instance of Vim.
Is there a way to make open the vim files in the current window?
I am using vim 7.4 on Linux.

Thank you for writing vim-shell, the fastest way to open links.

Restoring window size & position when toggling off fullscreen

Thanks for all your work on the vim plugins, really enjoying the full screen in windows.

One thing I often do in other editors is jump from a small window to fullscreen to get a closer look at some code, and then toggle back to the smaller window when done.. The current default behaviour of fullscreen() leaves the window maximised after toggling full screen off. I've attached a patch that makes the function save the window size and position the same way it saves the guioptions.

I'm new to vim, so apologies if you've covered this already (or if it's even in vim proper somewhere). Don't know if this will work on anything other than gVim under windows.. I'm just hacking :)

--- shell.vim.bak   Fri Dec 17 12:58:48 2010
+++ shell.vim   Fri Dec 17 12:53:27 2010
@@ -142,6 +142,9 @@
   " and tab line. Remember which components were actually hidden and should be
   " restored when leaving full-screen later.
   if !s:fullscreen_enabled
+   let s:olines = &lines
+   let s:ocolumns = &columns
+   let s:opos = getwinposx() . ' ' . getwinposy()
     let s:go_toggled = ''
     for item in split(g:shell_fullscreen_items, '.\zs')
       if &go =~# item
@@ -184,6 +187,9 @@
       let &stal = s:stal_save
       unlet s:stal_save
     endif
+   let &lines = s:olines
+   let &columns = s:ocolumns
+   exec ':winpos ' . s:opos
   endif

   " Toggle the boolean status returned by xolox#shell#is_fullscreen().

Duplicate helptag warning for 'xolox#misc#os#exec()'.

I am using both of your plugins vim-shell and vim-misc, great work!

You put the help text of 'xolox#misc#os#exec()' both in vim-shell/doc/shell.txt and vim-misc/doc/misc.txt, which will incur 'neobundle' to complain of 'duplicated helptags', becuase the neobundle, I guess, adopts a strategy that is to collect all plugins' doc files under its charge to a centralized place (i.e. .vim/neobundle/.neobundle/doc) for sake of performance.

White Border in fullscreen on windows fix

while in full screen, type

:set guioptions += m
F11(to exit full screen)
F11(to enter full screen again)
:set guioptions -=m

and white border on the left will be gone

Lots of Errors after merge

Commit 49bd3bf (Merge branch 'master' into dev) turned the plugin unusable for me. Currently I'm using previous commit (I've git bisect the offending commit).

Here's the error log when trying :Fullscreen (sorry, I tried hard to disable VIM translation, didn't find how):

Erro detectado ao processar /home/francisco/.vim/addons/github-xolox-vim-shell/autoload/xolox/shell.vim:
linha  348:
E117: Função desconhecida: xolox#misc#os#is_win
E15: Expressão inválida: xolox#misc#os#is_win()
Erro detectado ao processar function xolox#shell#fullscreen:
linha    7:
E117: Função desconhecida: xolox#misc#os#is_win
E15: Expressão inválida: xolox#misc#os#is_win()
Erro detectado ao processar function xolox#shell#fullscreen..xolox#shell#maximize:
linha    7:
E117: Função desconhecida: xolox#misc#option#get
E15: Expressão inválida: xolox#misc#option#get('shell_fullscreen_items', 'mTe')
linha    8:
E121: Variável indefinida: fullscreen_items
E116: Argumentos inválidos para a função split(fullscreen_items, '.\zs')
E15: Expressão inválida: split(fullscreen_items, '.\zs')
linha   14:
E121: Variável indefinida: fullscreen_items
E15: Expressão inválida: fullscreen_items =~# 'e' && &stal != 0
Erro detectado ao processar function xolox#shell#fullscreen:
linha   47:
E117: Função desconhecida: xolox#misc#msg#warn

In truth, errors start to happen all the time, not just when executing vim-shell commands.

shellslash setting

If I set shellslash in my vimrc for both linux and windows environments (I like uniform front slashes everywhere, even windows). I get this error when starting up with easytags on windows:

shell.vim 0.9.13: Failed to get output of command "C:\Windows\system32\cm
d.exe /c ctags --version > 'C:/Users/walesi/AppData/Local/Temp/VIA9EB2.tm
p' 2>&1"! at function 49_InitEasyTags..49_CheckCtags..xolox#sh
ell#execute, line 32

easytags.vim 2.7: Plug-in not loaded because Exuberant Ctags isn't installed!
Please download & install Exuberant Ctags from http://ctags.sf.net

It all comes down to the part in autoload/xolox/shell.vim with the shellescape()

105 if a:synchronous
106 let tempout = tempname()
107 let cmd .= ' > ' . shellescape(tempout) . ' 2>&1'
108 endif

The double quotes from the shellescape() are what make the temp file access impossible in the execute command. I can fix the problem by removing the shellescape, but I don't know if that is the only way

Increasing window size in fullscreen

In a dual monitor setup under Windows 7 64bit (main left, secondary to the right) I can go without problem in/out fullscreen mode by pressing F11 (default) and vim fills one screen as intended.

When I am already in fullscreen mode and press Ctrl+F11 to "show" menu bar, the window grows to the right on the next screen. When I press Ctrl+F11 again, the menu bar disappears again and the windows grows again more to the right.

Going out and again in normal fullscreen (F11), window size is corrected to "one screen fullscreen".

Stretching happens only to the right side. Tested it with fullscreen on secondary monitor to the right.

There is no function xolox#misc#option#get

Hi
I use vundle to manage my plugins and clone vim-shell and vim-easytags in seperate folds in "vimfiles/", then vim tell me undefined function "xolox#misc#option#get". When I comment "Bundle vim-shell", this error message won't appear.
And then I found "...\vim-shell\autoload\xolox\misc\option.vim" has no funtion "get".
Would you please update that?

Option for WS_EX_TOPMOST

Is it possible to add an option so that :Fullscreen command will not make the maximized Vim window stay "allways on top" ?

It would be nice to be able to Alt+Tab to other windows, even if my Vim window is in full-screen mode.

I believe this should also solve issue #9 Open&Fullscreen focus

make/makeprg integration

Hi Peter,

Thanks for your work with Vim plugins!!
I 'm still starting using them (just moving from open.vim to shell.vim), but I'm impressed with the great ideas of easytags and session.

I've started using shell.vim due to the DLL in order to avoid the command prompt windows.
The Fullscreen command is also very nice. I didn't intended to use it, but I've changed my mind after I tried it for some time. Unfortunately it is conflicting with some silent make commands present on some mappings.

I've some mappings to execute tasks such as [build], [clean], [clean+build] and [build+run] that are based on silent make. The problem is that when gVim is fullscreen and silent make is executed it leaves fullscreen for a while, as a command prompt get the window focus. This also make the start menu bar to hide gVim statusline, which is used to display some status messages.

I was wondering if it is possible to use xolox#shell#execute() to run the make command, but it isn't easy to see how this can be accomplished. I was thinking about using 'makeprg' and 'shell' options, but as 'shell' is already used by xolox#shell#execute() this probably won't work.

Have you already went through this issue, or have any ideas?

Fullscreen & Sessions corrupting tabline

When a session is save the full screen mode is persisted. But after reloading the session, exiting fullscreen shows a tabline that is corrupted. Entering and exiting fullscreen mode doesn't restores the tabline to its normal graphics.

gVim on Windows 7/64bit

Hey Peter,

Great work on all Vim plug-ins, really enjoying vim-session and vim-easytags. I have an issue with shell.dll from vim-shell on Windows 7 and the 64-bit build of Vim from Google Code. I am not sure how exactly to debug it and I've tried everything I can think of (with my limited Vimscript abilities). All I get to is a very cryptic message: E364: Library call failed. I imagine it could be caused by the 32-bit nature of the DLL and Vim being entirely 64-bit?

Have you tried the .dll on 64-bit installs (not just 64-bit OS, but rather 64-bit Vim)? I could try installing the Windows SDK and re-compiling the DLL to target x64, but before I go ahead and do that I wanted to pick your brain.

shell-x64.dll broken in latest 0.12.7 version.

After upgrading to vim-shell 0.12.7, I get the following error on GVIM startup on Windows/x64, caused by the easytags plugin:

Error detected while processing function <SNR>259_InitEasyTags..<SNR>259_CheckCtags..xolox#misc#os#exec..xolox#shell#execute_with_dll:
line   12:
E605: Exception not caught: execute_synchronous('C:\Windows\system32\cmd.exe /c (ctags --version) 1>"D:\TEMP\VIA8873.tmp" 2>"D:\TEMP\VIB8874.tmp"') failed! (output: exit_cod�)

(The last character of the output is U+0080 PADDING CHARACTER!)

This can then be reproduced with other calls to xolox#misc#os#exec(). The problem does not occur with a 32-bit GVIM on the same system; downgrading to the previous commit of shell-x64.dll also fixes the problem, so the issue seems to be related to the latest build of that DLL.

I'm on Windows 7 Ultimate SP1 English 64-bit, and can reproduce this on 2 different systems, and using both a self-compiled Vim 7.3.823/x64 as well as with the old 7.3.000 64-bit build provided by George Reilly.

Please let me know if you need any other information. Thanks!

Configuration of browser when opening URL

Hi,

I read through the documentation of the plugin how I can customize which Browser is called when I press F6 to open a link. The default browser is Firefox and I want to use Chrome instead. Even the documentation of your open.vim plugin (http://peterodding.com/code/vim/open-associated-programs/) says:

that the xolox#open#url() function takes a string argument containing a URL or e-mail address and opens it in your favorite or >the best available web browser / email client.

On line 61 of open.vim https://github.com/xolox/vim-open-associated-programs/blob/master/open.vim you are calling

call xolox#open#file(url, 'firefox', 'google-chrome')

Is it possible to pass the arguments in this function with a predefined variable so that the user can put the option into the .vimrc

MakeWithShell & C#

Hello Peter,

I've just noticed that :MakeWithShell doesn't works very well when compiling C# code.

Using compiler msbuild (from https://groups.google.com/forum/?fromgroups=#!topic/vim_dev/q644Mx3ehYM) and :make on files with errors, followed by :cwindow does open the quickfix window. Replacing make with :MakeWithShell doesn't opens the quickfix, similar to sucessful compilation result.

Is it possible to change :MakeWithShell so it works like :make on this case?

Query Strings in urls for :Open?

I'm running gvim 7.3 with vim-shell and vim-misc on Windows 7. The :Open command works great for urls without query strings, but I'd like to create mappings that yank the current word and start a search query on duckduckgo and jquery. They use ?s= and ?q= to start queries.

Here's a screenshot of my mapping and the error I'm getting with Vim:
image

Here's the mapping in text format:

"Search JQuery API Docs online against the word under cursor
nnoremap <Leader>jqa "zyw:exec "Open http://api.jquery.com/?s=".@z<CR>

"Jump start a DuckDuckGo Search 
nnoremap <Leader>ddg :Open http://duckduckgo.com/?q=

Is it possible to get :Open to recognize these as urls?

File name expansion does not work with MakeWithShell

I have the following line in my c.vim.

set makeprg=make\ %:r

So when I type make at vim command line when editting filename.c, it will run make filename.
This does not with MakeWithShell though. I know I can change it to

let &l:makeprg = 'make '.expand('%:r')

but the first configuration is just more elegant.

xolox#shell#highlight_urls() seems to slow down Vim

Hello,

I can't pinpoint when it started to happen but it seems xolox#shell#highlight_urls() is slowing down Vim.

Vim would hang for a while and more often than not disable syntax highlighting because redraw time its the timemout.

When it happens and I press CTRL+C, I get:

Error detected while processing function xolox#shell#highlight_urls:
line   14:
E409: Unknown group name: .*String.*
E475: Invalid argument: CommentEmail /\<\w[^@ \t\r<>]*\w@\w[^@ \t\r<>]\+\w\>/ contained containedin=.*Comment.*,.*String.*
Interrupt: Press ENTER or type command to continue

I'm using

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Mar  4 2020 22:40:59)
macOS version
Included patches: 1-350
Compiled by Homebrew

And c19945c

how do you use vim-shell ? Practice, suggestions ?

Hi,

Thanks for creating this convenient vim plugin!

I'm trying to switch to vim-shell from vim-conque.

In vim-conque., I normally visual select text and transfer and run them into a Python or Scheme shell with a shortcut <F9>.

In the documentation of vim-shell, I noticed VimShellSendString and VimShellSendBuffer.
Then I should create a shortcut with VimShellSendString to send text to a shell, right ?

How do you configure and use vim-shell ?

Thanks in advance.
Hongying

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.