Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [options]

runtime settings that modify the behavior of the editor

0
votes
1answer
42 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
40 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
40 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
38 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
32 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
2answers
86 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?'\ \ [+]':''} ...
3
votes
0answers
73 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
53 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
85 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 ...
0
votes
1answer
296 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
117 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" ...
2
votes
1answer
376 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
149 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
0answers
47 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 ...
0
votes
1answer
533 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
138 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
53 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
185 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
60 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
227 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)...
5
votes
2answers
1k 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
90 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 ...
14
votes
2answers
1k 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?
4
votes
2answers
498 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, ...
3
votes
2answers
856 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
736 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
381 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
0answers
47 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, ...
3
votes
1answer
103 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
38 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
74 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
81 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
260 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 + ...
5
votes
3answers
1k views

How to save and restore the result of the command 'set'?

From :h :set we know that :se[t] Show all options that differ from their default value. In a vimscript I'd like to save all these options which have been modified by the user, modify them and ...
3
votes
1answer
102 views

Sourcing vimrc changes vimrc's formatoptions

I do vim .vimrc and my vimrc opens with formatoptions=jcroql. Then I do :source .vimrc and check the formatoptions again; they changed to tcq. As far as I know there's nothing in my file that ...
6
votes
1answer
145 views

cpoptions and parenthesis text objects

Haskell has a literal syntax for anonymous functions of \pattern0 pattern1 [...] patternN -> expression which interacts oddly with vim's parenthesis text objects when pattern0 starts with a (. ...
6
votes
1answer
169 views

How do I exclude the → from file name characters?

I have several files that prefix file names with a → character, for example In →path/to/some/file, there is a foo, in →path/to/other/file, there is a bar. etc. When the cursor is over such a path, I'...
2
votes
1answer
184 views

How to disable extends/precedes charaters in nowrap

I want to view a big blob of text (ascii-graphics), but when I use :set nowrap some < and > symbols appears at the left and right borders of the buffer window. They are kinda annoying and I ...
4
votes
1answer
50 views

How do I set an option only if there are multiple windows?

Sometimes when I load several buffers at once into multiple windows I might get confused with the position of the cursor, I get lost when I change from buffer to buffer. Therefore I'd like to trigger ...
5
votes
1answer
72 views

Are spaces OK in set statements?

Is it OK to use spaces for better readability in a .vimrc? For example, right now I have: set number| "show line numbers set history=1000 Would it be OK to write instead: set number | "show line ...
9
votes
1answer
336 views

What controls indentation of lines following an open square bracket when using cindent?

I am trying to build my own indent file for JavaScript. The default indent file for JavaScript turns cindent on, with minimal modifications, and I am using that as a base. On Vim 7.3 for OSX El ...
16
votes
1answer
701 views

The simplest way to start Vim in private mode

I want to be able to easily start Vim in a private mode. Let's define a private mode as one that utilizes this set of commands: set history=0 set nobackup set nomodeline set noshelltemp set ...
5
votes
3answers
239 views

Is there a trick to set 'ignorecase' locally

ignorecase is a global option, so it's not possible to locally set ic :setlocal ic This is a bit unfortunate, since I work on buffers in which I need to search case insensitively and other buffers ...
5
votes
7answers
553 views

Is there a vim command line option to edit last edited file?

Is there a way to run vim from command line to edit the last edited file? Let say I first edit file giorgio.sh: $ vi giorgio.sh Afterwards, I exit back to terminal $ do something... $ do something ...
16
votes
4answers
2k views

How can I suppress the “reading from STDIN” message from within Vim?

When using Vim to read from stdin, it prints a informative message: $ echo foo | vim - Vim: Reading from stdin... $ This is just an example. The actual use doesn't allow shell constructs. vim <(...
4
votes
1answer
398 views

Vimscript insert after cursor

I am aware of the startinsert command which switch to insert mode as if the i key was pressed. With the ! it behaves like A. Do you know if there is some kind of option to go to insert mode like we ...
2
votes
1answer
94 views

Avoid junk in the console buffer on win32

When I run vim in a win32 console window, after I exit I end up with a bunch of junk on the screen - old command output, etc, because cmd doesn't clear line contents when scrolling down. I've included ...
6
votes
2answers
640 views

Is it possible to change the message display location?

If editing a buffer in the right side window when using two vertical split windows in a big display screen, we have to move our eyes all across the screen to the bottom left corner to see any messages ...
1
vote
2answers
345 views

How to set both files to the encoding in vim diff from command line?

I've opened the files I want to diff using the following command: C:\temp\robocopyTasks>vim -c "edit ++enc=ucs-2le" -d C:\temp\robocopyTasks\acl\tasks_temp.txt C:\temp\robocopyTasks\acl\tasks_win....
20
votes
1answer
4k views

Setting a vim option from the command line?

How does one set a vim option when launching from bash or another shell?