I would like to type :make in Vim to compile my LaTeX document. I wrote down compilation rules in a Makefile, but as soon as I enable the LatexSuite Vim extension, the Makefile is no longer used. Instead, Vim runs latex -interaction=nonstopmode (note the absence of a filename) and hangs in that command. I did not change the g:Tex_UseMakefile option from its default 1 to 0 and according to the documentation, that should cause my Makefile to be used, but it's not.
What configuration is needed to tell LatexSuite to just use my Makefile?
LatexSuite was obtained via OpenSuSE repositories: vim-plugin-latex-20120125-21.1.1.noarch
You can override this via following setting in your vimrc.
autocmd FileType tex let g:Tex_CompileRule_dvi = 'make'
Alternatively, set makeprg in $HOME/.vim/after/ftplugin/tex.vim
set makeprg='make'
Helpful in-source documentation of file <latex-suite-root-folder>/compiler/tex.vim
Section " Customization of 'makeprg': {{{
This (g:Tex_CompileRule_dvi) is a string which should be directly be able to be cast into
" &makeprg.
Related
I use the Verilog mode from emacs.
My question is:
What is full syntax of command that includes verilog-library-directories ?
emacs --batch f.sv -q --eval='(setq-default verilog-typedef-regexp
".*_t$")' -f verilog-batch-auto
For including verilog libraries I use the following comment at the end of the file:
// verilog-library-flags:("-y ../rtl")
I think then you can reuse this syntax for command line.
Working with .sh files on Windows causes issues when running them in Linux Docker containers if they have EOL of CRLF. Can I make VS Code always work with LF for specific file type such as .sh while still using CRLF for all others?
I only find "files.eol": "\r\n" in settings, but this is global.
I understand you can change this in the bottom toolbar on a per-file basis, but I would like this to be the default for all .sh files.
In your settings window, go to
Settings > Text Editor > Files > Eol option. You'll fine following available options there
- \n
- \r\n
- auto (default)
Here \n represents LF, \r\n represents CRLF, and auto use the operating system specific EL operator.
Select your option and save.
VS Code: version 1.13.3
You can use EditorConfig.
Install the editorconfig extension, and then add a .editorconfig file at the root of your project with this:
[*]
end_of_line = crlf
[*.{sh}]
end_of_line = lf
But as #axiac said, I would recommend to always use lf...
EDIT : I was a bit "premature" with this answer. But it now works as of v1.40. See https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_40.md#fileseol-per-language
You can do this in vscode without an extension. You can make a language-specific setting:
In the command palette, search for "Configure language specific", select it and choose "shellscript" from the language options:
This will create the following in your settings:
"[shellscript]": {
},
Now add in whatever you want to apply to shellscript files only like (not all settings will work in there but most do):
"[shellscript]": {
"files.eol": "\n"
},
VERY, VERY IMPORTANT:
The end-of-line sequence is used for new files. For existing files,
the existing end-of-line sequence is always preserved. To change the
end-of-line sequence for an existing file, use the Change End Of Line
Sequence command.
from https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_40.md#fileseol-per-language
I am using shells using UTF-8 and others using Latin-1. However, when I change the default with set-language-environment, also the existing shells change their buffer-coding-system - indicator in the status-line.
How can I make a shell-buffer stick to its encoding?
Have you tried looking at the Emacs Wiki? It has a tip on how to edit the ~/.emacs file:
Working around a broken LANG
If your LANG is not set up correctly, and you don’t want to fix it,
you can do the setup in your ~/.emacs file:
(set-language-environment "Latin-1")
Usually you would do it interactively: ‘C-x RET l’.
To check the environment you want see ‘M-x
describe-language-environment’ and TAB to see all completions.
as suggested here,
simply create a shell script such as e.g.latinshell.sh (adjust the desired variables):
#!/bin/sh
LANG=de_DE:Latin-1
and then run it in a shell with:
. latinshell.sh
I am trying to set a mapping for FileType perl. The mapping is for the case when I forgot to use semicolon at the end of the line.
So first I tried adding in my .vimrc autocmd! FileType perl nnoremap <leader>; $a;<esc> and it worked fine but than I thought of using ftlugin/perl.vim .
So I added the below line in my corresponding ~/.vim/after/ftplugin/perl.vim
nnoremap <buffer> <leader>; $a;<esc>
but it didn't work.
Any idea why it is not working ?
My perl version is perl 5, version 14.
Try putting the file in ~/.vim/ftplugin/perl.vim instead of ~/.vim/after/ftplugin/perl.vim. From :help after-directory:
*after-directory*
4. In the "after" directory in the system-wide Vim directory. This is
for the system administrator to overrule or add to the distributed
defaults (rarely needed)
5. In the "after" directory in your home directory. This is for
personal preferences to overrule or add to the distributed defaults
or system-wide settings (rarely needed).
From :help ftplugin:
If you do want to use the default plugin, but overrule one of the settings,
you can write the different setting in a script: >
setlocal textwidth=70
Now write this in the "after" directory, so that it gets sourced after the
distributed "vim.vim" ftplugin |after-directory|. For Unix this would be
"~/.vim/after/ftplugin/vim.vim". Note that the default plugin will have set
"b:did_ftplugin", but it is ignored here.
One thing I just noticed that was driving me crazy: <buffer> must be lowercase! Out of habit, I uppercase all of my <BRACKET> prefixes... and I had done the same for <BUFFER>. None of my ftplugin mappings worked and I couldn't figure it out... until I wasted hours trying different things, only to find that it must be lowercase <buffer>.
Synopsis:
When calling vim's make command, it changes the current working directory (cwd) to the directory of the current file. It then runs the makeprg from there. I want to prevent the make command from changing the cwd, and instead call the makeprg from the directory of the parent vim instance
Example:
I have the following standard perl project hierarchy
project/
lib/
My/
Module/
Foo.pm
My PERL5LIB is set to
PERL5LIB=':lib'
In my .vimrc I have
compiler perl
set makeprg=perl\ -c\ %
I edit my module using vim from the root project level:
/path/to/project$ vim lib/My/Module/Foo.pm
In vim :pwd works as expected:
:pwd
"/path/to/project"
Also calling !perl -c works as expected, finds my project lib, and displays the result in a shell window:
:!perl-c %
OUTPUT:
perl -c lib/My/Module/Foo.pm
lib/My/Module/Foo.pm Syntax ok
However :make returns an error
:make
"Can't open perl script lib/My/Module/Foo.pm : No such file or directory"
Setting makeprg to pwd shows the problem
:set makeprg=pwd
:make
"/path/to/project/lib/My/Module"
So before make runs makeprg it is changing to the directory of the current file, which is why perl can't find 'lib/.../Foo.pm' there.
Is there any way to prevent make from doing this?
If Vim's :make command is changing the current working directory, and autochdir is not set, a plugin may have added an autocommand to the QuickFixCmdPre set. One plugin that does this is eclim, which calls the QuickFixLocalChangeDirectory() function if g:EclimMakeLCD is set to 1.
Use :au to find all the autocommands in your current configuration, paying particular attention to entries for QuickFixCmdPre and make.