Last active
January 30, 2018 22:54
Revisions
-
awinograd revised this gist
Feb 3, 2013 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ #! /usr/bin/env ruby # Modified from : http://www.tkalin.com/blog_posts/using-console-vim-as-vim-protocol-handler-in-ubuntu # NOTE: This opens with a link to the mvim protocol for compatibility with RailsPanel # goes to /usr/local/bin/cvim -
awinograd created this gist
Feb 3, 2013 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ #! /usr/bin/env ruby # NOTE: This opens with a link to the mvim protocol for compatibility with RailsPanel # goes to /usr/local/bin/cvim require 'uri' require 'cgi' full_path = ARGV[0] # for better_error which encodes the /'s full_path = full_path.gsub("%2F", "/") if full_path full_path = full_path.sub("mvim:\/\/open?url=","") uri = URI::parse(full_path) path = uri.path if path.index('&') > 0 path = path.split('&')[0] params = CGI::parse(uri.path) line = params["line"][0] else path = path end vim_params = %Q["#{path}"] vim_params << " +#{line}" if line end `gnome-terminal -x vim #{vim_params}` This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ # /usr/share/applications/cvim.desktop [Desktop Entry] Encoding=UTF-8 Name=Vim (Console) Comment=Edit text files in a console using Vim Exec=/usr/local/bin/cvim %U Terminal=false Type=Application Icon=/usr/src/vim/runtime/vim48x48.xpm Categories=Application;Utility;TextEditor; MimeType=text/plain;x-scheme-handler/mvim; StartupNotify=true StartupWMClass=CVIM