Questions tagged [options]
For questions about runtime settings that modify the behavior of the editor. When applicable, tag the version of the editor.
107
questions
2
votes
1
answer
24
views
Setting an option to a string containing control characters
I'm trying to configure Vim to be able to properly determine the background color when run inside GNU Screen. I know I need to set the option t_RB to the string \eP\e]11;?\x03\e\\ (where \e is the ...
1
vote
1
answer
53
views
Toggling the `spell` option with Lua does not redraw the screen until an additional command is entered
While porting my init.vim to init.lua, I noticed some strange behaviour.
In vimscript, one can toggle spell in the following way:
noremap <Leader>ss :setlocal spell!<CR>
Observe that this ...
1
vote
1
answer
52
views
List Vim arguments options
Is there a way to list the command line arguments showed by vim -h or vim --help from within Vim?
Besides :r!vim -h which seems to be a workaround to achieve this.
1
vote
2
answers
142
views
Why is Vim ignoring my `expandtab` setting?
In my vimrc, I have set expandtab. When I edit a Tex file, however, Vim inserts tab characters , instead of spaces , when I press tab. I figured noexpandtab must be set by the TeX ftplugin for some ...
0
votes
2
answers
134
views
How to display runtimepath value in echo or echomsg?
I have modified the 'runtimepath' in my .vimrc file.
As I am having problems of not found files, I would like to display the runtimepath value in an :echo or :echomsg
I already know about he existence ...
0
votes
1
answer
29
views
Can I copy options (everything shown when I run `:set` with no arguments) between active windows
I have two windows opened in the same terminal. These are actual vim windows within the same vim instance. The first window is a .py file which has many options set by default, plus additional options ...
1
vote
1
answer
164
views
Statusline vs Rulerformat - What is the Difference?
Question
What is the purpose of the ruler?
I have recently learned about the statusline and the rulerformat, and was wondering what the difference between them is.
Why does the ruler exist? Why can't ...
1
vote
1
answer
88
views
Specify sorting in wildmenu list?
EDIT
per accepted answer below, I have the following:
function! MySortDirEnts(ent1, ent2)
if a:ent1[strchars(a:ent1)-1] == '/' && a:ent2[strchars(a:ent2)-1] != '/'
return -1
elseif a:...
1
vote
1
answer
26
views
Inconsistent string handling [duplicate]
I've been assembling strings in vimscript using a . as the join command.
But when I try and use the same command to join a string when setting an option, such as:
:setlocal foldtext=v:folddashes . &...
-1
votes
1
answer
82
views
Specific filetype files should end with new line
my work project requires a newline at the end of a file. If I add a new line and save, it gets automatically removed. I work in Golang but the same behavior is observed in Lua, Rust and probably ...
0
votes
1
answer
29
views
How do I move the cursor feely past the EOLs?
I vaguely remember I've read about this option and also tried it out, but I can't remember the name...
It allows using l to move past the EOL, even though $ still brings you to the EOL, not to the ...
1
vote
1
answer
968
views
How to set keywordprg to call a lua function in neovim?
A plugin unidentified is setting the keywordprg option to :Man but I want it to be LSP based.
So I attempted
set keywordprg=:lua\ vim.lsp.buf.signature_help()
but it gives me the following error and ...
1
vote
1
answer
1k
views
How to configure options in :terminal (NeoVim)
I've read the help section for term, terminal, termopen, buftype, and I've read several stack questions, but I haven't been able to find a solution for settings options in terminal mode. I know about ...
0
votes
0
answers
560
views
Mouse navigation not working in VIM
I started using VIM today and I found out that we could use the mouse pointer to go to a line in vim using set mouse=a
But unfortunately, it is not working
here is the config file
https://pastebin.com/...
2
votes
2
answers
197
views
Choose template option for newfiles in Vim?
I have different templates in this directory ~/Documents/Library/
like: Template.cpp, normal.cpp, advanced.cpp
Normally I use this:
autocmd BufNewFile *.cpp 0r ~/Documents/Library/Template.cpp
I ...
4
votes
2
answers
277
views
Change 'lastline' display character (@@@)
You can set display to lastline to see "@@@" at the end of the last line when it doesn't fit the screen. I'd prefer to use a different character for that purpose, such as ... or ---.
Is ...
0
votes
0
answers
146
views
Does vim have support for processing its comma-separated options?
Vim has comma-separated dictionary options like 'comments' and 'listchars':
:set comments?
comments=s:--[[,m: ,e:]],:--
:set listchars?
listchars=tab:⇥ ,trail:␣,extends:⇉,precedes:⇇,nbsp:⚭
Commas ...
6
votes
1
answer
301
views
remove from comma-separated option (listchars)?
I don't do tabs, so usually my
listchars=tab:▸ ,nbsp:␠,trail:·,precedes:«,extends:»
But it gets annoying with some sources. I'd like to subtract tab: from lcs in some filetypes. I've tried setlocal ...
2
votes
1
answer
338
views
Obscure Vim feature: +footer?
Inspecting some of Vim's features listed by vim --version I have noticed some obscure ones, for example, balloon_eval, balloon_eval_term and footer.
There is an example in the documentation to test ...
2
votes
1
answer
121
views
Options readonly vs nowrite
Apologies if this is duplicate. I have searched and haven't found any related questions.
What is the difference between the options readonly and nowrite? The reference manual says:
readonly: If on, ...
0
votes
1
answer
43
views
How to copy the current value of a `set` option into the clipboard?
I sometimes need to copy the current value of a set option, e.g. set statusline, into the clipboard (+) to paste its value here.
I know how to show the current value of a set option, e.g. set ...
1
vote
0
answers
36
views
Can't redefine tabstop, softtabstop and softwidth after syntax detection
I've a vim:
VIM - Vi IMproved 8.2 (2019 Dec 12, собрано Apr 8 2020 14:10:43)
and I tried to redefine tabstop, softtabstop and softwidth values for a file after detection of its syntax. I.e. I have a ...
2
votes
1
answer
49
views
Freeze after File No Longer Available Message
When I go to a buffer where the file was deleted Vim shows:
E211: File "foo" no longer available
Vim freezes for about a second before it resumes. Where can I change/disable this delay or ...
1
vote
1
answer
36
views
Is there a reason why the short for `'modifiable'` is `'ma'` and not `'mo'`?
Is there a reason why the short for 'modifiable' is 'ma' and not 'mo'?
I've entered :h 'mo' and I got E149, so there doesn't seem to be any clash...
0
votes
2
answers
104
views
How can I make a mapping to toggle cursorbind?
I know that adding a ! to the end of an option works for some commands, but it doesn't work for cursorbind. How can I toggle between cursorbind and nocursorbind with a keybinding?
1
vote
1
answer
493
views
Difference between buffer-local and global-local options
:h local-options says:
for each buffer-local option there also is a global value, which is used for
new buffers. With ":set" both the local and global value is changed. With
"setlocal&...
3
votes
1
answer
2k
views
What are the benefits and use cases of relativenumber?
I have tried the relativenumber option several times, and I really don't get the point.
People say that it's easier because they don't have to do the mental math of how many lines to go up or down ...
3
votes
0
answers
58
views
Wrong width for certain characters
Using this:
https://github.com/vim/vim-win32-installer/releases/download/v8.2.1505/gvim_8.2.1505_x64.zip
All of these characters (and perhaps others):
ℹ ⌨ ⏏ ⏭ ⏮ ⏯ ⏱ ⏲ ⏸ ⏹ ⏺ ☀ ☁ ☂ ☃ ☄ ☎ ☑ ☝ ☠
☠️ ☢ ☣ ☦ ☪...
1
vote
0
answers
829
views
All of my Vim text is underlined
I have configured Vim and then noticed that all of my text is underlined for some reason. I am running WSL with the Hyper terminal and I also configured Vim using the Ultimate Vim Configuration. Is ...
1
vote
0
answers
71
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 ...
2
votes
2
answers
1k
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
0
answers
136
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
2
answers
128
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
0
answers
214
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
1
answer
88
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
1
answer
145
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 ...
4
votes
1
answer
878
views
what is the purpose of the view folder in the .vim folder?
I got an error when opening my .vimrc with vim saying
".vimrc" 138L, 3781C
Error detected while processing /home/fbence/.vim/view/~=+.vimrc=:
line 117:
E518: Unknown option: termkey=
line 118:
...
3
votes
2
answers
283
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 ...
12
votes
1
answer
3k
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: :...
1
vote
0
answers
72
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 ...
2
votes
1
answer
912
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 ...
3
votes
1
answer
422
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
0
answers
543
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
0
answers
119
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
5
answers
532
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 ...
2
votes
0
answers
302
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
1
answer
762
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
1
answer
562
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 ...
3
votes
1
answer
245
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
1
answer
274
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 ...