1
mirror of https://github.com/neovim/neovim.git synced 2025-01-01 17:23:36 -07:00

Merge from justinmk/defaults

defaults: 'ruler', 'showcmd', 'belloff=all'
This commit is contained in:
Justin M. Keyes 2017-03-17 13:00:19 +01:00 committed by GitHub
commit 0c1f783164
13 changed files with 48 additions and 54 deletions

View File

@ -979,7 +979,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'balloonexpr' 'bexpr' Removed. {Nvim} 'balloonexpr' 'bexpr' Removed. {Nvim}
*'belloff'* *'bo'* *'belloff'* *'bo'*
'belloff' 'bo' string (default "") 'belloff' 'bo' string (default "all")
global global
Specifies for which events the bell will not be rung. It is a comma Specifies for which events the bell will not be rung. It is a comma
separated list of items. For each item that is present, the bell separated list of items. For each item that is present, the bell
@ -2186,9 +2186,8 @@ A jump table for the options with a short description can be found at |Q_op|.
Ring the bell (beep or screen flash) for error messages. This only Ring the bell (beep or screen flash) for error messages. This only
makes a difference for error messages, the bell will be used always makes a difference for error messages, the bell will be used always
for a lot of errors without a message (e.g., hitting <Esc> in Normal for a lot of errors without a message (e.g., hitting <Esc> in Normal
mode). See 'visualbell' on how to make the bell behave like a beep, mode). See 'visualbell' to make the bell behave like a screen flash
screen flash or do nothing. See 'belloff' to finetune when to ring the or do nothing. See 'belloff' to finetune when to ring the bell.
bell.
*'errorfile'* *'ef'* *'errorfile'* *'ef'*
'errorfile' 'ef' string (default: "errors.err") 'errorfile' 'ef' string (default: "errors.err")
@ -4822,10 +4821,8 @@ A jump table for the options with a short description can be found at |Q_op|.
The 'rightleft' option must be set for 'rightleftcmd' to take effect. The 'rightleft' option must be set for 'rightleftcmd' to take effect.
*'ruler'* *'ru'* *'noruler'* *'noru'* *'ruler'* *'ru'* *'noruler'* *'noru'*
'ruler' 'ru' boolean (default off) 'ruler' 'ru' boolean (default on)
global global
{not available when compiled without the
|+cmdline_info| feature}
Show the line and column number of the cursor position, separated by a Show the line and column number of the cursor position, separated by a
comma. When there is room, the relative position of the displayed comma. When there is room, the relative position of the displayed
text in the file is shown on the far right: text in the file is shown on the far right:
@ -5530,11 +5527,8 @@ A jump table for the options with a short description can be found at |Q_op|.
"n" flag to 'cpoptions'. "n" flag to 'cpoptions'.
*'showcmd'* *'sc'* *'noshowcmd'* *'nosc'* *'showcmd'* *'sc'* *'noshowcmd'* *'nosc'*
'showcmd' 'sc' boolean (Vim default: on (off for Unix), 'showcmd' 'sc' boolean (Vim default: on, Vi default: off)
Vi default: off)
global global
{not available when compiled without the
|+cmdline_info| feature}
Show (partial) command in the last line of the screen. Set this Show (partial) command in the last line of the screen. Set this
option off if your terminal is slow. option off if your terminal is slow.
In Visual mode the size of the selected area is shown: In Visual mode the size of the selected area is shown:
@ -6709,14 +6703,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'visualbell'* *'vb'* *'novisualbell'* *'novb'* *beep* *'visualbell'* *'vb'* *'novisualbell'* *'novb'* *beep*
'visualbell' 'vb' boolean (default off) 'visualbell' 'vb' boolean (default off)
global global
Use visual bell instead of beeping. The terminal code to display the Use visual bell instead of beeping. Also see 'errorbells'.
visual bell is given with 't_vb'. When no beep or flash is wanted,
use ":set vb t_vb=".
Note: When the GUI starts, 't_vb' is reset to its default value. You
might want to set it again in your |gvimrc|.
In the GUI, 't_vb' defaults to "<Esc>|f", which inverts the display
for 20 msec. If you want to use a different time, use "<Esc>|40f",
where 40 is the time in msec. Also see 'errorbells'.
*'warn'* *'nowarn'* *'warn'* *'nowarn'*
'warn' boolean (default on) 'warn' boolean (default on)

View File

@ -37,6 +37,7 @@ these differences.
- 'autoread' is set by default - 'autoread' is set by default
- 'backspace' defaults to "indent,eol,start" - 'backspace' defaults to "indent,eol,start"
- 'backupdir' defaults to .,~/.local/share/nvim/backup (|xdg|) - 'backupdir' defaults to .,~/.local/share/nvim/backup (|xdg|)
- 'belloff' defaults to "all"
- 'complete' doesn't include "i" - 'complete' doesn't include "i"
- 'directory' defaults to ~/.local/share/nvim/swap// (|xdg|), auto-created - 'directory' defaults to ~/.local/share/nvim/swap// (|xdg|), auto-created
- 'display' defaults to "lastline" - 'display' defaults to "lastline"
@ -49,7 +50,9 @@ these differences.
- 'listchars' defaults to "tab:> ,trail:-,nbsp:+" - 'listchars' defaults to "tab:> ,trail:-,nbsp:+"
- 'nocompatible' is always set - 'nocompatible' is always set
- 'nrformats' defaults to "bin,hex" - 'nrformats' defaults to "bin,hex"
- 'ruler' is set by default
- 'sessionoptions' doesn't include "options" - 'sessionoptions' doesn't include "options"
- 'showcmd' is set by default
- 'smarttab' is set by default - 'smarttab' is set by default
- 'tabpagemax' defaults to 50 - 'tabpagemax' defaults to 50
- 'tags' defaults to "./tags;,tags" - 'tags' defaults to "./tags;,tags"

View File

@ -10,8 +10,11 @@
void handle_register_##name(type *name); \ void handle_register_##name(type *name); \
void handle_unregister_##name(type *name); void handle_unregister_##name(type *name);
// handle_get_buffer handle_register_buffer, handle_unregister_buffer
HANDLE_DECLS(buf_T, buffer) HANDLE_DECLS(buf_T, buffer)
// handle_get_window handle_register_window, handle_unregister_window
HANDLE_DECLS(win_T, window) HANDLE_DECLS(win_T, window)
// handle_get_tabpage handle_register_tabpage, handle_unregister_tabpage
HANDLE_DECLS(tabpage_T, tabpage) HANDLE_DECLS(tabpage_T, tabpage)
void handle_init(void); void handle_init(void);

View File

@ -190,7 +190,7 @@ return {
type='string', list='comma', scope={'global'}, type='string', list='comma', scope={'global'},
vi_def=true, vi_def=true,
varname='p_bo', varname='p_bo',
defaults={if_true={vi=""}} defaults={if_true={vi="all"}}
}, },
{ {
full_name='binary', abbreviation='bin', full_name='binary', abbreviation='bin',
@ -1883,7 +1883,7 @@ return {
vim=true, vim=true,
redraw={'statuslines'}, redraw={'statuslines'},
varname='p_ru', varname='p_ru',
defaults={if_true={vi=false}} defaults={if_true={vi=true}}
}, },
{ {
full_name='rulerformat', abbreviation='ruf', full_name='rulerformat', abbreviation='ruf',
@ -2119,11 +2119,7 @@ return {
type='bool', scope={'global'}, type='bool', scope={'global'},
vim=true, vim=true,
varname='p_sc', varname='p_sc',
defaults={ defaults={if_true={vi=false, vim=true}}
condition='UNIX',
if_true={vi=false, vim=false},
if_false={vi=false, vim=true},
}
}, },
{ {
full_name='showfulltag', abbreviation='sft', full_name='showfulltag', abbreviation='sft',

View File

@ -1,5 +1,9 @@
" Common preparations for running tests. " Common preparations for running tests.
set noruler
set noshowcmd
set belloff=
" Make sure 'runtimepath' does not include $HOME. " Make sure 'runtimepath' does not include $HOME.
set rtp=$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after set rtp=$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after

View File

@ -7,14 +7,10 @@ local ok, set_session, spawn = helpers.ok, helpers.set_session, helpers.spawn
local shada_file = 'test.shada' local shada_file = 'test.shada'
--
-- helpers.clear() uses "-i NONE", which is not useful for this test.
--
local function _clear() local function _clear()
set_session(spawn({nvim_prog, set_session(spawn({nvim_prog, '--embed', '-u', 'NONE', '--cmd',
'-u', 'NONE', -- Need shada for these tests.
'--cmd', 'set noswapfile undodir=. directory=. viewdir=. backupdir=.', 'set noswapfile undodir=. directory=. viewdir=. backupdir=. belloff= noshowcmd noruler'}))
'--embed'}))
end end
describe(':oldfiles', function() describe(':oldfiles', function()
@ -63,7 +59,7 @@ describe(':browse oldfiles', function()
_clear() _clear()
execute('rshada! ' .. shada_file) execute('rshada! ' .. shada_file)
-- Ensure nvim is out of "Press ENTER..." screen -- Ensure nvim is out of "Press ENTER..." prompt.
feed('<cr>') feed('<cr>')
-- Ensure v:oldfiles isn't busted. Since things happen so fast, -- Ensure v:oldfiles isn't busted. Since things happen so fast,

View File

@ -20,9 +20,12 @@ local filter = global_helpers.filter
local start_dir = lfs.currentdir() local start_dir = lfs.currentdir()
-- XXX: NVIM_PROG takes precedence, QuickBuild sets it. -- XXX: NVIM_PROG takes precedence, QuickBuild sets it.
local nvim_prog = os.getenv('NVIM_PROG') or os.getenv('NVIM_PRG') or 'build/bin/nvim' local nvim_prog = os.getenv('NVIM_PROG') or os.getenv('NVIM_PRG') or 'build/bin/nvim'
-- Default settings for the test session.
local nvim_set = 'set shortmess+=I background=light noswapfile noautoindent'
..' laststatus=1 undodir=. directory=. viewdir=. backupdir=.'
..' belloff= noshowcmd noruler'
local nvim_argv = {nvim_prog, '-u', 'NONE', '-i', 'NONE', '-N', local nvim_argv = {nvim_prog, '-u', 'NONE', '-i', 'NONE', '-N',
'--cmd', 'set shortmess+=I background=light noswapfile noautoindent laststatus=1 undodir=. directory=. viewdir=. backupdir=.', '--cmd', nvim_set, '--embed'}
'--embed'}
local mpack = require('mpack') local mpack = require('mpack')
@ -597,6 +600,7 @@ local M = {
nvim = nvim, nvim = nvim,
nvim_async = nvim_async, nvim_async = nvim_async,
nvim_prog = nvim_prog, nvim_prog = nvim_prog,
nvim_set = nvim_set,
nvim_dir = nvim_dir, nvim_dir = nvim_dir,
buffer = buffer, buffer = buffer,
window = window, window = window,

View File

@ -11,9 +11,7 @@ local neq = helpers.neq
local function init_session(...) local function init_session(...)
local args = { helpers.nvim_prog, '-i', 'NONE', '--embed', local args = { helpers.nvim_prog, '-i', 'NONE', '--embed',
'--cmd', 'set shortmess+=I background=light noswapfile noautoindent', '--cmd', helpers.nvim_set }
'--cmd', 'set laststatus=1 undodir=. directory=. viewdir=. backupdir=.'
}
for _, v in ipairs({...}) do for _, v in ipairs({...}) do
table.insert(args, v) table.insert(args, v)
end end

View File

@ -10,7 +10,7 @@ local function nvim_argv(shada_file)
local rtp_value = ('\'%s/runtime\''):format( local rtp_value = ('\'%s/runtime\''):format(
paths.test_source_path:gsub('\'', '\'\'')) paths.test_source_path:gsub('\'', '\'\''))
local nvim_args = {nvim_prog, '-u', 'NORC', '-i', shada_file or 'NONE', '-N', local nvim_args = {nvim_prog, '-u', 'NORC', '-i', shada_file or 'NONE', '-N',
'--cmd', 'set shortmess+=I background=light noswapfile', '--cmd', 'set shortmess+=I background=light noswapfile belloff= noshowcmd noruler',
'--cmd', 'let &runtimepath=' .. rtp_value, '--cmd', 'let &runtimepath=' .. rtp_value,
'--cmd', additional_cmd, '--cmd', additional_cmd,
'--embed'} '--embed'}
@ -23,7 +23,7 @@ end
local session = nil local session = nil
local reset = function(...) local function reset(...)
if session then if session then
session:close() session:close()
end end
@ -31,7 +31,7 @@ local reset = function(...)
set_session(session) set_session(session)
end end
local set_additional_cmd = function(s) local function set_additional_cmd(s)
additional_cmd = s additional_cmd = s
end end

View File

@ -12,7 +12,7 @@ describe('api', function()
helpers.clear() helpers.clear()
os.remove(socket_name) os.remove(socket_name)
screen = child_session.screen_setup(0, '["'..helpers.nvim_prog screen = child_session.screen_setup(0, '["'..helpers.nvim_prog
..'", "-u", "NONE", "-i", "NONE", "--cmd", "set noswapfile"]') ..'", "-u", "NONE", "-i", "NONE", "--cmd", "'..helpers.nvim_set..'"]')
end) end)
after_each(function() after_each(function()
os.remove(socket_name) os.remove(socket_name)
@ -28,7 +28,7 @@ describe('api', function()
{4:~ }| {4:~ }|
{4:~ }| {4:~ }|
{4:~ }| {4:~ }|
{5:[No Name] }| {4:~ }|
]]..socket_name..[[ | ]]..socket_name..[[ |
{3:-- TERMINAL --} | {3:-- TERMINAL --} |
]]) ]])
@ -43,7 +43,7 @@ describe('api', function()
{4:~ }| {4:~ }|
{4:~ }| {4:~ }|
{4:~ }| {4:~ }|
{5:[No Name] [+] }| {4:~ }|
{3:-- INSERT --} | {3:-- INSERT --} |
{3:-- TERMINAL --} | {3:-- TERMINAL --} |
]]) ]])
@ -59,7 +59,7 @@ describe('api', function()
[socket 1] this is more t{4: }| [socket 1] this is more t{4: }|
han 25 columns {4: }| han 25 columns {4: }|
[socket 2] input{1: } {4: }| [socket 2] input{1: } {4: }|
{5:[No Name] [+] }| {4:~ }|
{3:-- INSERT --} | {3:-- INSERT --} |
{3:-- TERMINAL --} | {3:-- TERMINAL --} |
]]) ]])

View File

@ -13,7 +13,8 @@ describe('tui', function()
before_each(function() before_each(function()
helpers.clear() helpers.clear()
screen = thelpers.screen_setup(0, '["'..helpers.nvim_prog..'", "-u", "NONE", "-i", "NONE", "--cmd", "set noswapfile"]') screen = thelpers.screen_setup(0, '["'..helpers.nvim_prog
..'", "-u", "NONE", "-i", "NONE", "--cmd", "set noswapfile noshowcmd noruler"]')
-- right now pasting can be really slow in the TUI, especially in ASAN. -- right now pasting can be really slow in the TUI, especially in ASAN.
-- this will be fixed later but for now we require a high timeout. -- this will be fixed later but for now we require a high timeout.
screen.timeout = 60000 screen.timeout = 60000
@ -177,7 +178,8 @@ describe('tui with non-tty file descriptors', function()
end) end)
it('can handle pipes as stdout and stderr', function() it('can handle pipes as stdout and stderr', function()
local screen = thelpers.screen_setup(0, '"'..helpers.nvim_prog..' -u NONE -i NONE --cmd \'set noswapfile\' --cmd \'normal iabc\' > /dev/null 2>&1 && cat testF && rm testF"') local screen = thelpers.screen_setup(0, '"'..helpers.nvim_prog
..' -u NONE -i NONE --cmd \'set noswapfile noshowcmd noruler\' --cmd \'normal iabc\' > /dev/null 2>&1 && cat testF && rm testF"')
feed(':w testF\n:q\n') feed(':w testF\n:q\n')
screen:expect([[ screen:expect([[
:w testF | :w testF |
@ -196,7 +198,8 @@ describe('tui focus event handling', function()
before_each(function() before_each(function()
helpers.clear() helpers.clear()
screen = thelpers.screen_setup(0, '["'..helpers.nvim_prog..'", "-u", "NONE", "-i", "NONE", "--cmd", "set noswapfile"]') screen = thelpers.screen_setup(0, '["'..helpers.nvim_prog
..'", "-u", "NONE", "-i", "NONE", "--cmd", "set noswapfile noshowcmd noruler"]')
execute('autocmd FocusGained * echo "gained"') execute('autocmd FocusGained * echo "gained"')
execute('autocmd FocusLost * echo "lost"') execute('autocmd FocusLost * echo "lost"')
end) end)
@ -313,7 +316,7 @@ describe("tui 't_Co' (terminal colors)", function()
-- This is ugly because :term/termopen() forces TERM=xterm-256color. -- This is ugly because :term/termopen() forces TERM=xterm-256color.
-- TODO: Revisit this after jobstart/termopen accept `env` dict. -- TODO: Revisit this after jobstart/termopen accept `env` dict.
screen = thelpers.screen_setup(0, string.format( screen = thelpers.screen_setup(0, string.format(
[=[['sh', '-c', 'LANG=C TERM=%s %s %s -u NONE -i NONE --cmd "silent set noswapfile"']]=], [=[['sh', '-c', 'LANG=C TERM=%s %s %s -u NONE -i NONE --cmd "silent set noswapfile noshowcmd noruler"']]=],
term, term,
(colorterm ~= nil and "COLORTERM="..colorterm or ""), (colorterm ~= nil and "COLORTERM="..colorterm or ""),
helpers.nvim_prog)) helpers.nvim_prog))

View File

@ -8,13 +8,13 @@ describe("shell command :!", function()
before_each(function() before_each(function()
session.clear() session.clear()
screen = child_session.screen_setup(0, '["'..session.nvim_prog.. screen = child_session.screen_setup(0, '["'..session.nvim_prog..
'", "-u", "NONE", "-i", "NONE", "--cmd", "set noswapfile"]') '", "-u", "NONE", "-i", "NONE", "--cmd", "'..session.nvim_set..'"]')
screen:expect([[ screen:expect([[
{1: } | {1: } |
{4:~ }| {4:~ }|
{4:~ }| {4:~ }|
{4:~ }| {4:~ }|
{5:[No Name] }| {4:~ }|
| |
{3:-- TERMINAL --} | {3:-- TERMINAL --} |
]]) ]])
@ -32,7 +32,7 @@ describe("shell command :!", function()
screen:expect([[ screen:expect([[
{4:~ }| {4:~ }|
{4:~ }| {4:~ }|
{5:[No Name] }| {4:~ }|
:!printf foo; sleep 200 | :!printf foo; sleep 200 |
| |
foo | foo |

View File

@ -9,7 +9,7 @@ local eval = helpers.eval
describe('Initial screen', function() describe('Initial screen', function()
local screen local screen
local nvim_argv = {helpers.nvim_prog, '-u', 'NONE', '-i', 'NONE', '-N', local nvim_argv = {helpers.nvim_prog, '-u', 'NONE', '-i', 'NONE', '-N',
'--cmd', 'set shortmess+=I background=light noswapfile', '--cmd', 'set shortmess+=I background=light noswapfile belloff= noshowcmd noruler',
'--embed'} '--embed'}
before_each(function() before_each(function()