I understand that vim would not know until told that some file maps to a particular type. Currently my VIM setting fails to recognize my .ng file as '.html' hence it reads it like a plain text.
I want to know the global command to enable that.
PS: I think my sytastic plugin is not working for the same reason.
Put this into your .vimrc
autocmd BufNewFile,BufRead *.ng set filetype=html
Related
Hi looking to be able to do something like:
vim syntaxfile=custom_c.vim
I do not want to set a syntax type, I want to specify a syntax file by pathname.
Please assist / give pointers.
Willing to write c code to achieve this.
Sure you can, you use:
set syntax=custom_c
This will then look for a file called custom_c.vim in one of the syntax paths.
i.e.
~/.vim/syntax/custom_c.vim
Or
~/.vim/after/syntax/custom_c.vim
The answer here is really good, and goes into more details generally.
Somewhere to look in the help system would be:
:help mysyntaxfile
To automate you could use an autogroup to detect if file is in a given path and set the syntax= setting accordingly.
I would like to ask if there is any possibility to run code with custom parameters in CLion. And where to put the file.txt in project folder.
Something equivalent to ./program <file.txt
It seems as if redirection of stdin for the program to be run or debugged is still not implemented. See the issue "Add an option to specify default input and output streams for console applications" at JetBrain's bugtracker.
Other IDEs like Eclipse can do this.
In CLion, go to your Run/Debug Configurations. There's a field named Program arguments. This field allows you to set "a custom parameter":
You can find the corresponding documentation here.
An excerpt from the documentation to help finding the correct dialog:
With the Navigation bar visible (View | Appearance | Navigation Bar), the available run/debug configurations are displayed in the run/debug configuration selector in the Run area:
Note that this of course only works for executable targets (or non executable targets that have an executable set).
Also note that this will most likely not allow you to do any shell redirection. Setting the field to < myfile.txt will not have the effects you are looking for. It will literally copy the strings < and myfile.txt as input arguments 1 and 2 (0 being the binary name).
If you want to pass file contents in this manner you'll have to just pass the file path using this method and then open & load the file in your application.
This is now possible.
In the Run/Debug Configuration, you’ll find a new field called
Redirect input from. Enable it, and fill in the file path/name:
Source: https://blog.jetbrains.com/clion/2020/03/clion-2020-1-eap-input-redirection-config-macros/#input_redirection
I'm trying to work with mega.nz via command line (batch file), use for it megatools
https://github.com/megous/megatools
Sync work fine, download work fine, but i can't found how to generate shareable link to file on mega. Is there any possible way?
May be use Megacmd, or something else?
https://github.com/meganz/MEGAcmd
Can't find command to share file...
put YouUploadFileName
export -a YouUploadFileName
https://github.com/meganz/MEGAcmd/blob/master/UserGuide.md
This question already has answers here:
Enable syntax highlighting for various filetypes in vim
(4 answers)
Closed 5 years ago.
I have to edit a bunch of files in a programming language that has C-like syntax (and which may or may not be used only within the confines of my university).
To get syntax highlighting without going through the hassle of creating a new syntax configuration in Vim, I just use :set syntax=c to force the C syntax highlighting.
To get this automatically, I set syntax=c in my .vimrc file. The problem is, whenever I open a new file in a new window with :sp or :vsp, there is no syntax highlighting, which indicates that the set command in my .vimrc is only executed when I first open Vim itself.
How do I make it so this gets executed for every new file opened?
vim load syntax highlight file according to filetype. usually it is judged by file name extension. ex. if your programming language file with extension as .mine, you should add following configuration to .vimrc
au BufRead,BufNewFile *.mine set filetype=c
You can refer to filetype.txt for more tricks.
What you are looking for belongs in your ~/.vimrc. You don't need to set syntax to a specific file type, all you need is:
syntax on
That will invoke syntax highlighting for each file you open -- with the proper syntax file (vim is pretty smart...)
You can see the effect before you modify your ~/.vimrc simply by issuing the following within vim in command-mode
:syntax on
I have bunch of files that need to have a (.) dot removed from the file-name. Eg. "Mr.-John-Smith.jpg" to "Mr-John-Smith.jpg". I don't have real experience with programming and know only html/css and a little javascript. I found another identical question here on stackoverflow, but what I gathered it was fixed on linux system and BASH was used.
Anyways, if anyone could provide me a tutorial on which program to use for this and what code to execute in that program to make it happen I'd be grateful.
if you are using a windows environment (which i guess you do)
you can download this free utility to mass change file names !
main page :
http://www.bulkrenameutility.co.uk/Main_Intro.php
download page :
http://www.bulkrenameutility.co.uk/Download.php
its easy to use
enjoy
If your file names in a file...
1- Open Microsoft Word or any text editor. Press ctrl+h and then search "." without quotes then replace it with blank character.
2- It will remove all dots, again bring "." to your file extention such as .jpg , .png searh your file extention for example "jpg" and replace it with ".jpg"
It will works %100, i am using this method everytime.
if they are not in a file and if you want do somethings in your operation systems' file system
Try this program. It is very useful for this operation;
Download
To remove all except the extension dot from all files in a directory, you can use PowerShell that comes with newer versions of Windows, and can be downloaded for older versions;
Line breaks inserted for readability, this should go on one line;
PS> dir | rename-item -newname {
[System.IO.Path]::GetFileNameWithoutExtension($_.name).Replace(".","") +
[System.IO.Path]::GetExtension($_.name); }
What it does is to take the file name without an extension and remove all dots in it, and then add back the extension. It then renames the file to the resulting name.
This will change for example do.it.now to doit.now, or in your case, Mr.-John-Smith.jpg to Mr-John-Smith.jpg.