Questions tagged [options]

runtime settings that modify the behavior of the editor

Filter by
Sorted by
Tagged with
1
vote
0answers
27 views

rulerformat truncated when filename included

Given the limited screen real estate on my device (27x48), I'm trying set laststatus=1 set rulerformat=%25(%<%f%M\ %=%l\|%c%) No matter the minwid prefix, or if I apply it to %() or %f, or if I ...
1
vote
1answer
19 views

Typing Russian characters in vim with vim-LaTeX

Occasionally, I need to type documents in Russian in LaTeX format. To use Russian in vim I follow the guidelines from this Habr post. In short, I have the following settings in my .vimrc file: set ...
2
votes
0answers
23 views

Tell vim to treat character as full width

I am wondering if it is possible to tell vim to treat an individial code point in the unicode plain. I am aware of the ambiwidth option, but it does not help with my current task because the relevant ...
1
vote
2answers
109 views

Is there a 'let' equivalent for setting an option only local to a buffer/window?

When working with options that often have complex or calculated string values (e.g. formatprg, which might have additional parameters, separated by whitespace), it's often easier to use let to set ...
2
votes
0answers
40 views

Check valid values of an option (e.g. check if completeopt+=popup is valid)

I want to know if I can use the popup option for my completeopt in the running version of vim/neovim. The example is just for clarity, I'm looking for a solution that is generic. I know I can check ...
3
votes
1answer
41 views

Unnamed buffer not using options from my vimrc

In my vimrc I use :setg tabstop=4 shiftwidth=4. Why aren't unnamed buffers set correctly with these values? Using VIM 8.2.460 (2019 Dec 12) I opened vim with some piped output and noticed tab width ...
2
votes
1answer
39 views

How to change in gvim GTK file browser the default file mask wildcard (glob)?

In gvim the command :browse confirm e launches a GTK file browser. The default file mask in this window depends on the filetype from which the browse window is invoked. I would like to change that ...
3
votes
2answers
277 views

What is the proper way to allow the user of a plugin to modify settings?

So I have a plugin that I am writing which should allow the user to set whether they want to enable a feature. I want the feature to be disabled by default, and allow the user to change it by adding ...
5
votes
1answer
303 views

How do I use a variable or return value in option, command, or mapping?

I have a variable foo with let foo='value', and a function F like function F() return 'value' endfunction and I want to use them in an option: :set option=foo, :set option=F(); or in a command: :...
0
votes
0answers
37 views

Is there an `edefault` in the spirit of `gdefault` for setting the appropriate flags in vim's substitution commands?

To perform a buffer-wide substitution on all occurrences of foo (and not just the 1st one in a line), we can do %s/foo/bar/g The g flag may be omitted by setting this in the vimrc as set ...
1
vote
1answer
114 views

NeoVim: Single-Line Comments Also Format the Next Line [duplicate]

So, I started using NeoVim a little while ago and discovered a rather annoying quirk when using C++-style single-line comments // in source code of any language. Specifically, when you create a new ...
2
votes
1answer
107 views

How to find all scripts which modified a certain vim setting?

I can figure out which script changed a vim setting the last time with :verbose set errorformat? However, sometimes a setting is modified/appended several times and I want to see all scripts who ...
0
votes
0answers
183 views

how does t_AB and t_Sb option difference in vim?

I see three sets of options for terminal colors on the vim documentation. The first set of options: t_AB set background color (ANSI) *t_AB* *'t_AB'* t_AF set foreground color (ANSI) ...
2
votes
0answers
65 views

vi -u doesn't seem to work?

As system administrator I have to work under several user IDs, some of which are shared with others. We all have different tastes in what we like in terms of settings for our vi, so I am looking at ...
4
votes
5answers
169 views

Can I define something in .vimrc to speed up pasting of large amounts of data?

Occasionally, I paste large amounts of data into vim, using Ctrl+v in my terminal emulator (in Linux). This takes several seconds before vim is responsive again. I have tried two other methods, which ...
1
vote
0answers
98 views

Is there a way to customize the characters used in fold column?

Seems to me that fillchars option doesn't include these characters.
0
votes
1answer
230 views

how could I use different `.vimrc` with `-u` option

I have configured my .vimrc to make my vim work, and then I renamed my .vimrc to be .vimrc2. After that my vim can run as clean mode, but when I run my vim with vim -u .vimrc2, there are errors like ...
0
votes
1answer
177 views

Option set in vimrc is overwritten - nvim

I'm trying to disable autochdir in nvim by adding the following in init.vim: set autochdir! but when I start nvim, I check the value of this option by echo &autochdir and find it equals to 1. I ...
2
votes
1answer
82 views

showcmd on first line instead of last line

From the help file for showcmd: Show (partial) command in the last line of the screen Is it possible to have the commands displayed on the first line instead? I can't find anything in the help or ...
1
vote
1answer
164 views

Saving .swp/.un~ files to subdirectories

Is there any way to save these files to automatically created subdirs? Google gave me no answers. The reason is simple- I work on several computers which I keep synced via git, so having these files ...
0
votes
1answer
123 views

“-u {vimrc}” not working as expected

I am trying to set up vim so I can get different functions in with different files (i.e. x.lisp and x.scm) and in the manual it says starting with the option "-u ufile" uses "ufile" as the vimrc My ...
1
vote
0answers
41 views

Why are my bulleted lines automatically joining?

I use the a formatoption to make my text hard wrap, and the n formatoption to recognize numbered lists. The help says that the n option should use the formatlistpat regex to determine which lines not ...
-1
votes
1answer
206 views

Showing read-only or non-modifiable status in status line

I am building my statusline. Previously I used functions to return information, but recently I learnt that these can be done in one line. For example: set statusline+=%{&modified?'\ \ [+]':''} ...
4
votes
0answers
163 views

What is the default “effective” titlestring?

Is the effective default value for titlestring documented somewhere? By effective, I mean the one that displays $(basename) ($(dirname)) (m of n) - GVIM1 or ... ((m) of n), even though titlestring is ...
0
votes
1answer
56 views

Having a modified relativenumber

In my experience with vim I found relative numbers pretty useful. But I would like to know if is there an argument I could give to the my neovim configuration file so I could configure it in such way ...
0
votes
2answers
233 views

Prevent saving buffer with new name

I am developing a command line application that uses VIM to edit an existing file - think visudo or crontab -e When I launch VIM, I'm passing it the path of an existing file. I want the user to be ...
1
vote
1answer
1k views

Can I disable running shell commands in Vim?

I am developing a command line application that uses Vim to edit an existing file. Think visudo or crontab -e. Is there any command line option that I can pass to Vim to disable shell commands?
3
votes
1answer
157 views

Does each indention option override the previous one?

From :h indent.txt: ...each one overrides the previous if it is enabled... Now if I set 'cin' after 'ai', Does 'cin' disable the effect of 'ai'?. If no, so what is the purpose of "override" ...
3
votes
1answer
2k views

Differences between local & global

From :h 'ar': ...If this option has a local value, use this command to switch back to using the global value: :set autoread< What do local & global value exactly mean? I ...
0
votes
1answer
673 views

Differences between indention options

I have read 'ai', 'si', 'cin', 'ci' help pages in Vim but I still cannot realize that what indention option is good for me. Yes, I can read that :help pages again and set whatever I need in my vimrc ...
6
votes
1answer
65 views

Why are tabs adjacent to concealed tabs displayed wider than a single tabstop?

I just wrote the following code in an answer to another question: syntax match HideTwoIndents /\v^\t(\t)?/ conceal set conceallevel=2 This works great if 'list' is set and if 'listchars' does not ...
1
vote
1answer
2k views

Can I set multiple 'options' with a single `:set` command spread over multiple lines?

Is there any way to set options typed on multiple lines with a single :set command? Here is a part of my vimrc: se nu se sm se hls And as you see, I have se on every line in which I set an option. ...
1
vote
1answer
480 views

Differ between 'softtabstop' and 'expandtab' options in function

If you use of softtabstop and expandtab options in vary ways and try to test them, these options are opposite in function (at least as I think). et option will produce the appropriate number of space ...
0
votes
1answer
132 views

A request for explain some options

I am writing my first vimrc and I already read help pages for hidden & nostartofline options and some other article (like that and others FAQ) But I still can't understand what the purpose of this ...
1
vote
2answers
671 views

There is no timeout on option

According to: this wiki & :help timeout in vim when I set this option: set notimeout ttimeout ttimeoutlen=200 It should set a keycode timeout in 200ms when I add this in my .vimrc file But ...
1
vote
1answer
96 views

Vim prints options on quit

I've noticed that recently when I quit vim it prints the following text to the terminal: --- Options --- background=dark helplang=en relativenumber cursorline number scroll=11 runtimepath=~/...
2
votes
2answers
406 views

set formatprg dynamically based on textwidth?

I've set formatprg in my vimrc to use the par text formatter when I type gq. setg formatprg=par\ -w90 When I'm in a buffer whose textwidth has been set (e.g. the gitcommit filetype sets textwidth=72)...
15
votes
2answers
5k views

When to use the after/ directory?

I understand it's the place to put things that should have the final say and not be overridden by another source, but I'm unclear on how to decide when to put something in, say, ~/.vim/after/ftplugin/ ...
4
votes
2answers
184 views

Change the looks of the character limit ruler

I wonder if there is a way to have a ruler displayed between the 80th and the 81th character in vim. I know that one can highlight the 81th column, but that actually looks as ugly as something from ...
17
votes
2answers
3k views

How to apply a setting in all open tabs and windows?

Is there an option to apply a setting in all tabs and windows, e.g. apply :set number to all open tabs?
3
votes
2answers
939 views

In VIM, Change the number that relative lines numbers start from

I've turned on vim's relative line numbers, it starts from 0 but doing somthing like 10dd means I only get up to line 9, leaving the last one behind (becuase it's 10 including the current line). Yes, ...
8
votes
2answers
3k views

`set` option with variables

I am trying to rewrite adding a string to option with variable. The original string is set rtp+=~/.vim/bundle/Vundle.vim The following is the working let way: let MYVIMDIR='/home/loom/foo' let &...
10
votes
2answers
1k views

How to list the available options of a plugin?

I recently found out that YouCompleteMe has an g:ycm_autoclose_preview_window_after_insertion option that automatically hides the documentation preview window after exiting insert mode, and I also ...
6
votes
1answer
725 views

How to show trailing spaces, while leaving tabs as they are?

I like the ability to show trailing whitespaces, so I have this setting. set list listchars=tab:\ \ ,trail:· I never use tabs (although I don't think tabs are bad, it's just a convention), but ...
1
vote
1answer
86 views

I don't understand the purpose and behavior of options “local to a window”

I don't understand the purpose of options that are "local to a window", such as for example colorcolumn and how they behave. This is a sequence to demonstrate what I mean: I start gvim. An empty, ...
2
votes
1answer
425 views

Problem converting the string “0.5” to a number

I'm currently reading Learn Vimscript the Hard Way. I did the following experiments as an exercise in the book. :let &wrap="1.5" :let &wrap="0.5" :let &wrap=str2nr("0.5",8) The first one ...
0
votes
1answer
46 views

When I view local options (i.e. :setlocal) - what do the “odd” prefixes (i.e. '--') mean?

I'm working with CentOS 7, and Vim 7.4, :setl --- Local option values --- autoindent define= include= path= softtabstop=4 --autoread ...
1
vote
1answer
106 views

How do I delete/unset a buffer local option (such as autoread)?

In a new buffer, the expression &l:autoread evaluates to the value -1, indicating that the local option autoread has not yet been set with :setl autoread or :setl noautoread. When I set the local ...
3
votes
1answer
108 views

How to not display a certain error

My situation is, I have set nowrapscan, however now, when I hit the end of a file, it will display E385: search hit BOTTOM without match for: \v^[^=]*(… How can I avoid that from displaying? I used ...
0
votes
2answers
777 views

Is there some way to echo from terminal into new vim buffer [duplicate]

Let's say I do a simple shell command like ls. Is there some way to directly pipe the output into a new vim buffer, so that I could edit it in place or just have a look at it. Basically like less + ...