Getting gvim to automatically translate a cygwin path - cygwin

I love cygwin and the native windows version of gvim and I use them together all the time. The only problem I have is with cygwin path names. Gvim for windows doesn't understand them so I have to resort to typing things like:
gvim `cygpath -wa ~/scripts/myscript.pl`
Which is annoying!
I was wondering if there's a neat way of using autocmds to detect if a cygwin path has been provided and, if so, convert it to a windows path on the FileReadPre event. Does anyone know if/how this can be acomplished?

There exist several solutions (see vim.wikia.com, cygwin category).
I'm maintaining the more flexible one: cyg-wrapper.sh (flexible in the sense it knows that (vim) flags are not pathnames, and it can even be told that "binary" flags like -c expect another argument that is not a pathname, and in the sense that it is not vim specific)
Regarding the invocation of cygwin executables from win32-vim, you won't have any troubles ... as long as the executable won't return pathnames expressed in *nix format.
For all compilation related executables (gcc/make/doxygen/...) I also have a solution. In the past it was a simple standalone perl script (still available on vim.org). Now I have a full solution that does other compilation related stuff: BuildToolsWrapper (that requires lh-vim-lib on the same site)
Regarding things like :e /etc/hosts, I have no solutions. A long time ago, I've tried to play with FileReadPre & co, but I gave up along the way, and I don't remember why ^^'.

Related

What language is used in Linux scripts in dotfiles?

I'm trying to figure out which language is used in Linux scripts to make the system more personal? I mean things like you put in the dotfiles — like .vimrc, or .zshrc — or to make a function for the terminal (like one that compiles a .tex file with bibtex and then pdflatex and then opens that .pdf with some reader).
What you call dotfiles are just configuration files of one or another program. So the "language" of each of those configuration files depends on the program that is going to use it.
In fact, that doesn't have to be a language, in general, hence the quotes in the previous paragraph. Those config files just have to match the format that the program that uses them expects. This occasionally means that configuarion files are required to use a specific language; an example is .vimrc, which has to use the vimscript language (aka VimL).
I think the term "Linux Scripts" will cause misunderstandment in here.
These dotfiles have a particular syntax for each one, but it's not a programming language.
It's allways a good idea to read the official documentation.
https://www.vim.org/docs.php
https://www.zsh.org/
For vimscript learning, I had a good experience with this one:
https://learnvimscriptthehardway.stevelosh.com/

Move Emacs from Linux to Windows

I've had a break from programming the last two years and want to start up again. Right now I'm using a Windows computer, but my work and compiler is on my Linux computer.
My question is:
Is it possible to move my entire emacs work environment from Ubuntu to Windows 10? I did some changes in emacs back in the days that I got used to and would love to continue like that on my Windows computer.
Briefly...
The most important things to copy are your ~/.emacs.d directory and your init file (see C-hig (emacs)Init File for the different filenames this might have, or check with C-hv user-init-file).
See C-hig (emacs)Windows HOME regarding where the .emacs.d directory should live on your Windows system.
Note the comments in that Info node on the site-lisp directory as well, in case you've been using elisp libraries in there (possibly without realising), as they can form part of your Emacs configuration as well.
Any byte-compiled elisp (.elc files) should remain compatible so long as you're moving to an equal-or-newer version of Emacs (which sounds likely in this case). Natuarally things do change between releases, though, and it's possible to encounter incompatibilities when upgrading, but I wouldn't worry about that in advance -- try the latest version first, and if you run into problems that you can't solve (which shouldn't be very likely), you can always install the version of Emacs you were originally using.

Compile Actionscript From Vim

I switched to Vim from Textmate a while back but I miss the Actionscript bundle for Textmate—particulate the ability to compile Actionscript directly from Textmate.
Has anyone found a way to compile Actionscript directly from Vim?
Yes, compiling AS3 from Vim is very easy.
One basic way, assuming you have main.as file open and you are in --NORMAL-- mode, type this:
:!/path/to/flex45/bin/mxmlc %
to obtain main.swf file next to main.as or:
:!/path/to/flex45/bin/mxmlc -output=../deploy/%<.swf %
to obtain ../deploy/main.swf (relative to main.as).
! means "the following is a shell command".
% means "this file, here, in the current buffer".
%< means "this file's name without the point and the extension".
Obviously it's not really smart but you can make mxmlc read a configuration XML, for more control. See the Flex doc for the list of possible arguments. Using this way it's going to suck a lot to debug your builds.
Another way is to set mxmlc as the build program for actionscript files with:
set makeprg=/path/to/flex45/bin/mxmlc
Then, type :make % to build your project. Errors will be displayed in the quickfix window.
That said, the actual "programming" part of doing AS3 with Vim sucks hard because the only omni-completion script available (to my knowledge) has been very very limited and unfinished for years (it's not an attack against the author which must be praised for his efforts).
I've started to augment that script a couple of months ago but it's far from being finished (and a low level priority) and not that good anyway compared to what you may get in Flash Builder or FDT.
Actually, the AS3 bundle is the only thing I miss from my TextMate days, it was surprisingly polished.
In the official vim documentation, there is an topic called: "fcsh tools : you can compile .as and .mxml files from vim via fcsh : Flex Comipler SHell". That topic describe all process of compilation .as and .mxml, but as noticed there, it tested only on unix systems.
If you want to use FCSH on vim, take a look on https://github.com/lucasdupin/vim-utils/blob/master/bin/fcshd - it works exactly like the FCSH daemon you have on TextMate.

Cygwin - ypcat command equivalent

I've been trying to find the equivalent command for the UNIX ypcat utility for Cygwin, but there is almost no documentation for it i regards to its presence (if any) for Cygwin. Can anybody help me find or teach me its equivalent, and if they can a brief explanation on how to use it if it differs from ypcat (it happened to me that Cygwin uses aspell for spell checking, replacing ispell or spell, and does not use the same entry format). TIA!
Someone made a port, but the files are no longer available at the specified domain, it seems.
http://www.cygwin.com/ml/cygwin-apps/2003-09/msg00144.html
You may have to contact the owner by e-mail to get a copy.

How can I hook into tcsh's TAB completion on Linux

I have some directories with a number of "hidden" files. One example of this is I'm in a source controlled sandbox and some of the files have not been checked out yet.
When I hit TAB, I'd like the option of seeing these files.
A similar question has been asked before: CVS Tab completion for modules under linux
The answers to that question summarize to: "Ubuntu's got that built in".
I don't have the option of switching to Ubuntu, but surely I can use the same mechanisms.
how can I hook into the TAB-completion feature of tcsh to add additional file Support for CVS, SVN and BitKeeper would all be useful.
More important than support for a specific source control system is the ability to control the returned list myself.
An acceptable solution would also be to use a key-binding other than TAB. (ctrl- perhaps)
From the manpage:
the complete builtin command can be used to tell the shell how to complete words other than filenames, commands and variables
might get you started
I do not know how to program in tcsh. But if you can, then you could look at the file named "bash_completion" from the archive (find the download link here.)
On line 1673 begins CVS completion code - and this might be portable to csh if you are familiar with the differences between bash/tcsh.
On my ubuntu machine, there is also a section for SVN completion (in /etc/bash_completion) that doesn't seem to be present in the maintainer's archive.
That's not Ubuntu-specific behavior, it's the bash-completion project.
You could use that, if you can switch from tcsh to bash.

Resources