夏天流鼻血是什么原因
百度 特别不凑巧,UR-V就是那个三分天注定七分还很拼的实力选手。
An annotation at the beginning or end of a text document to configure the editor for that document
27 questions
1
vote
2
answers
156
views
TeX syntax: is it possible to change from "stylish" to "non-stylish" after the file is loaded?
When editing a .tex file, is it possible to change the syntax highlighting after a file is loaded so that @ is able to be recognized as part of a command? Normally, this is done at load-time when .sty,...
0
votes
2
answers
112
views
indent python files with only 2 chars on linux
I have this project where python files are indented with 2 chars, not 4.
On my mac, I use macvim (VIM - Vi IMproved 9.1 (2024 Jan 02, compilé Jan 4 2024 03:08:50)). When I edit a file like this:
#!/...
2
votes
3
answers
184
views
Define a match group for a modeline
Looking to define a match group for modelines. vim defines two patterns for modelines:
The first form:
[text{white}]{vi:|vim:|ex:}[white]{options}
[text{white}] empty or any text followed by at least ...
3
votes
1
answer
80
views
Modeline to hide specific lines
I have a long .csv log file that I regularly append data to. I am usually interested in editing last 10 entries or so. I suppose Vim modelines do not support Ex commands due to security reasons. Is ...
2
votes
1
answer
117
views
Cannot set textwidth through modeline in Python files
I am trying to set the textwidth option in a python file and I added the following line at the end of my .py file:
# vim: set textwidth=120
However:
:set textwidth?,
:echo &l:textwidth and
:echo ...
1
vote
1
answer
196
views
List known abbreviations for filetypes
This VI StackExchange message thread provides useful tips for generating a list of known filetypes. However, I often see Vim modelines use abbreviations like js for javascript. These abbreviated ...
-1
votes
1
answer
48
views
noremap not working in modeline
For a specific file I need some dedicate configurations.
So, I put this in the top of the file:
% vim: noremap a <ESC>l<ESC>
I get the following error message:
"test" 2L, 30B
...
0
votes
2
answers
112
views
Extending modeline functionality?
Not long ago, I discovered the modeline feature that sets up options on a per-file basis. I wonder if it is possible to extend this functionality with other possibilities?
For example, setting up a ...
0
votes
1
answer
59
views
Vim modeline settings options words appear in selected in red
The vim modeline settings options words appear in selected in red in the first line :
# vim: set ft=json noet:
I'm using vim 7.4 on CentOS Linux 7.9.
How can I disable that ?
2
votes
1
answer
149
views
What is the name of the feature where one includes a set of options at the bottom of a file to be invoked immediately when opening it?
Basically something like this:
.
.
bla
.
.
<special incantation of vim>
set tabstop=2
expandtab
set foldmethod=marker
<end-of-file>
I know that Emacs has the same feature, which is how I ...
1
vote
1
answer
66
views
Is there any way to prevent modelines getting reapplied when files are saved / written?
For some Markdown documents, I like them to open with some sections initially folded (I use the plugin vim-markdown-folding). I've tried setting a modeline that looks like this:
<!-- vi: set ...
1
vote
1
answer
911
views
Vim's "path" variable isn't changing or updating with modeline setting (finding header file in different directory)
I'm trying to do something relatively simple: Editing a file in src and pointing Vim to the header file located in include. My .vimrc file has set modeline on, and the first line in my file is: // vim:...
3
votes
1
answer
374
views
Mode line not working even if everything seems correct
I'm editing a file with the following pattern:
# stock comment
# stock comment
# stock comment
# stock comment
# stock comment
conf
conf
conf
conf
very_long_conf_line_xxxxxx (600+ chars)
It's the ...
0
votes
1
answer
119
views
modelines not executed when opening new file in new tab
I'm often switching between files with a unix encoding and those with a dos encoding. I find that when I start with a unix encoded file, and then open a dos encoded file, vim attempts to use the ...
7
votes
1
answer
787
views
Is there a way to make some modeline that applies to all files in a directory, recursively?
I have a project consisting of files that Vim doesn't recognize by default, but has support for highlighting and indentation. I would like to have a vimrc file or a vimmodeline (or whatever similar) ...