Commit Graph

244 Commits

Author SHA1 Message Date
Björn Linse
81e84f2aae floats: add NormalFloat highlight and 'nonumber' default 2019-03-12 17:17:54 +01:00
Justin M. Keyes
c12cf5bde7 autocmd: introduce "once" feature
Adds a new feature to :autocmd which sets the handler to be executed at
most one times.

Before:

    augroup FooGroup
      autocmd!
      autocmd FileType foo call Foo() | autocmd! FooGroup * <buffer>
    augroup END

After:

    autocmd FileType foo once call Foo()
2019-03-10 04:58:30 +01:00
Justin M. Keyes
c5173230f0 UI: 'pumblend' for cterm (256-color TUI)
hl_rgb2cterm_color, hl_cterm2rgb_color were adapted from Vim 8.1
(color2index, cterm_color2rgb).
ref: c5cd88554f
2019-02-12 09:26:06 +01:00
Björn Linse
37f8df8824 UI: implement 'pumblend' option for semi-transparent popupmenu
Why?

- Because we can.
- Because the TUI is just another GUI™
- Because it looks kinda nice, and provides useful context like 1 out of 100
  times

Complies with "don't pay for what you don't use".

Some crashes for resizing were unfolded, add tests for those.
2019-02-07 16:43:51 +01:00
Marco Hinz
70f6939fd4 events: add "Signal" event #9564
..which gets triggered when SIGUSR1 is sent to the nvim process.

Closes #9562
2019-02-04 02:39:05 +01:00
Marco Hinz
28f87c505d
Merge #9539 "options: make 'listchars' and 'fillchars' local to window" 2019-01-28 00:45:59 +01:00
Justin M. Keyes
c70c8b607f doc [ci skip] #9478
- Lua
- developer guidelines
- MAINTAIN.md
- TUI: cleanup
- TUI: mention Windows terminfo builtins
- cleanup if_pyth, redirect python-bindeval tag

Helped-by: Björn Linse <bjorn.linse@gmail.com>
Helped-by: erw7 <erw7.github@gmail.com>
2019-01-26 20:38:14 +01:00
Marco Hinz
352811fe5f
options: make 'fillchars'/'listchars' local to window
Using 'listchars' is a nice way to highlight tabs that were included by accident
for buffers that set 'expandtab'.

But maybe one does not want this for buffers that set 'noexpandtab', so now one
can use:

    autocmd FileType go let &l:listchars .= ',tab:  '
2019-01-26 14:45:47 +01:00
Justin M. Keyes
37a499148f Visual: highlight char-at-cursor
Decide whether to highlight the visual-selected character under the
cursor, depending on 'guicursor' style:

- Highlight if cursor is blinking or non-block (vertical, horiz).
- Do NOT highlight if cursor is non-blinking block.

Traditionally Vim's visual selection does "reverse mode", which perhaps
conflicts with the non-blinking block cursor. But 'guicursor' defaults
to a vertical bar for selection=exclusive, and this confuses users who
expect to see the text highlighted.

closes #8983
2019-01-04 01:28:44 +01:00
Justin M. Keyes
deb18a050e
defaults: background=dark #2894 (#9205)
By historical accident, Nvim defaults to background=light. So on a dark
background, `:colorscheme default` looks completely wrong.

The "smart" logic that Vim uses is confusing for anyone who uses Vim on
multiple platforms, so rather than mimic that, pick the (hopefully) most
common default.

- Since Neovim is dark-powered, we assume most users have dark backgrounds.
- Most of the GUIs tend to have a dark background by default.

ref #6289
2018-11-20 10:52:49 +01:00
Reto Schnyder
bddcbbb571 signs: Add "numhl" argument #9113
close #9113
ref #9040
2018-10-13 19:39:56 +02:00
Justin M. Keyes
b11f5aa119 doc: xdg, MAINTAIN.md, channel-id, job control
- tutor: emphasize K
2018-10-11 19:32:31 +02:00
zandr
064495a53a doc/defaults: document ttimeoutlen default (#8943) 2018-09-01 18:17:49 +02:00
Justin M. Keyes
add2a62398 runtime/doc: fix broken links found by make html 2018-08-25 16:38:24 +02:00
Shougo Matsushita
03bd5a4b91 Make "v:errmsg", "v:shell_error" and "v:this_session" distinct 2018-07-23 08:47:51 +09:00
Yichao Zhou
12481781a0 highlight: high-priority CursorLine if fg is set. #8578
closes #7383
closes #7715

This implements the compromise described in #7383:
* low-priority CursorLine if foreground is not set
* high-priority ("same as Vim" priority) CursorLine if foreground is set

ref d1874ab282
ref 56eda2aa17
2018-06-28 01:49:40 +02:00
Justin M. Keyes
b7514493a0
defaults: shortmess+=F (#8619)
Because we default to laststatus=2 (statusline is always visible), the
:edit message is not useful.

ref #6289
2018-06-22 08:18:02 +02:00
Justin M. Keyes
9c2099d585 Ex mode: use getexline() instead of getexmodeline()
This changes Ex mode (Q, -e) to work like Vim's "improved Ex mode"
(gQ, -E).  That brings some small behavior differences, but should not
impact most Ex scripts (unless, for example, they depend on mappings
being disabled--but that can be solved for -e by skipping user config).

Before this change:
* the screen test hangs.

After this change:
* Q acts like gQ.
* -e/-es differs from -E/-Es only in its treatment of stdin.

This moves towards potentially removing getexmodeline().
(HINT: That does NOT mean "removing Ex mode", it means removing the
Vi-compatible Ex mode, which differs from Vim's "improved Ex mode" only
in some minor details (e.g. mappings are disabled).)

ref #1089 :-)~
2018-06-17 14:50:53 +02:00
Björn Linse
5442f0b622 fillchars: make checks more strict and improve tests 2018-06-14 14:00:09 +02:00
Björn Linse
050f3975f6 options: remove 'maxcombine` option (always use 6) 2018-06-13 10:11:35 +02:00
Justin M. Keyes
f52ace459a doc 2018-06-12 09:18:25 +02:00
Justin M. Keyes
f72f638f97 doc: job/channel, misc #7783
doc: termios defaults. ref #6992
doc: :help shell-powershell
doc: provider: Python minimum version is 2.7, 3.4
doc: remove :!start special-case. #5844
doc: mention #7917 change which accepts empty Array for Dictionary parameter
doc: <Cmd> pseudokey
doc: lmap change #5658
doc: -s, -es
2018-06-11 00:08:27 +02:00
Justin M. Keyes
1f300e08b8 win/startup: remove --literal
Fixes 2 failing tests in startup_spec.lua.

The Windows-only `--literal` option complicates support of "stdin-as-text
+ file-args" (#7679).  Could work around it, but it's not worth
the trouble:
- users have a reasonable (and englightening) alternative: nvim +"n *"
- "always literal" is more consistent/predictable
- avoids platform-specific special-case

Unrelated changes:
- Replace fileno(stdxx) with STDXX_FILENO for consistency (not motivated
  by any observed technical reason).
2018-06-04 02:09:27 +02:00
Justin M. Keyes
2aa308c685
Merge #5658 'Apply :lmap in macros' 2018-05-17 02:13:31 +02:00
Justin M. Keyes
e46534b423 Merge #4486 'refactor: Remove maxmem, maxmemtot options'
After this change we never release blocks from memory (in practice it
never happened because the memory limits are never reached).  Let the OS
take care of that.

---

On today's systems the 'maxmem' and 'maxmemtot' values are huge (4+ GB)
so the limits are never reached in practice, but Vim wastes a lot of
time checking if the limit was reached.

If the limit is reached Vim starts saving pieces of the swap file that were in
memory to the disk. Said in a different way: Vim implements its own
memory-paging mechanism. This is unnecessary and inefficient since the
operating system already has virtual memory and will swap to the disk if
programs start using too much memory.

This change does...

1. Reduce the number of config options and need for documentation.
2. Make the code more efficient as we don't have to keep track of memory
   usage nor check if the memory limits were reached to start swapping
   to disk every time we need memory for buffers.
3. Simplify the code. Once memfile.c is simple enough it could be
   replaced by actual operating system memory mapping (mmap,
   MemoryViewOfFile...). This change does not prevent Vim to recover
   changes from swap files since the swapping code is never triggered
   with the huge limits set by default.
2018-05-02 10:14:42 +02:00
Björn Linse
98e7112390 msg: do not scroll entire screen (#8088) 2018-03-31 11:12:27 +02:00
Matthew Malcomson
cc58ec9a80 Update documentation
Update vim_diff.txt with :lmap differences, update documentation on
'keymap', and add tests.

The tests added are to demonstrate the behaviour specified in the
documentation of :loadkeymap.
2018-03-14 10:39:14 +00:00
Justin M. Keyes
0c930c2969 defaults: 'fillchars'
Most fonts should have these by now. Both are a significant visual
improvement.

- Vertical connecting bar `│` is used by tmux, pstree, Windows 7 cmd.exe
  and nvim-qt.exe.
- Middle dot `·` works on Windows 7 cmd.exe, nvim-qt.exe.

For reference: tmux uses these chars to draw lines: │ ├ ─
2018-02-23 00:48:35 +01:00
Justin M. Keyes
c8356e1151 vim-patch:8.0.0440: not enough test coverage in Insert mode
[Nvim note: test_override() omitted]

Problem:    Not enough test coverage in Insert mode.
Solution:   Add lots of tests.  Add test_override(). (Christian Brabandt,
            closes vim/vim#1521)
eb992cb90f
2018-02-11 15:27:55 +01:00
Justin M. Keyes
a265334406 defaults: sidescroll=1
ref #6289
2018-02-09 02:15:25 +01:00
Justin M. Keyes
53749e1749 defaults: enable 'cscopeverbose', and deprecate it 2018-01-21 13:18:05 +01:00
Justin M. Keyes
fe60fa9faa doc
vim-patch:8.0.1206: no autocmd for entering or leaving the command line
(commit a4f6cec7a3)

NA patches:
vim-patch:8.0.0320: warning for unused variable with small build
2017-12-26 03:58:28 +01:00
Justin M. Keyes
ad9c2d3cb9 doc
closes #7622
2017-12-10 17:13:22 +01:00
Justin M. Keyes
3cc7ebf810 Merge #7234 'built-in expression parser' 2017-12-09 18:47:34 +01:00
Justin M. Keyes
3aa24042a8 tui: dump termcap info if -V3 ('verbose' >= 3)
Get terminal debugging info by starting Nvim with 'verbose' level 3:

    nvim -V3log

This is like Vim's `:set termcap`, which was removed in Nvim (and would
be very awkward to restore because of the decoupled UI).
2017-12-05 01:45:39 +01:00
ZyX
b588ccddd7 Merge branch 'master' into expression-parser 2017-11-30 02:02:55 +03:00
Justin M. Keyes
944e3c0619 tui: expose terminal type in 'term' option
Since "builtin" terminfo definitions were implemented (7cbf52db1b),
the decisions made by tui.c and terminfo.c are more relevant. Exposing
that decision in the 'term' option helps with troubleshooting.

Also: remove code that allowed setting t_Co. `:set t_Co=…` has never
worked; the highlight_spec test asserting that nvim_set_option('t_Co')
_does_ work makes no sense, and should not have worked.
2017-11-27 09:45:32 +01:00
ZyX
1ffa4e5047 doc: Update documentation 2017-11-19 23:33:02 +03:00
Justin M. Keyes
314ff440f7 doc/vim_diff.txt: mention NormalNC 2017-11-10 02:44:18 +01:00
Marco Hinz
9837a9c401 compat: "v:count" distinct from "count" (#7407) 2017-11-09 02:20:12 +01:00
Justin M. Keyes
c598c3ac77
doc: deprecate 'highlight'; remove howto.txt (#7497) 2017-11-07 00:51:03 +01:00
Justin M. Keyes
842a54a1bb doc 2017-11-06 01:56:04 +01:00
Justin M. Keyes
7068370560 help, man.vim: change "outline" map to gO (#7405) 2017-10-21 02:33:58 +02:00
Justin M. Keyes
d214df4e9b doc: replace ":CheckHealth" with ":checkhealth" 2017-10-17 01:51:21 +02:00
Justin M. Keyes
56eda2aa17 syntax: 'cursorline': revert priority change (#7400)
ref #7383
reverts d1874ab282
ref #6380
2017-10-16 08:18:03 +02:00
Justin M. Keyes
d1874ab282 syntax: 'cursorline': low priority #6380 2017-10-07 16:45:15 +02:00
Justin M. Keyes
7a832c312f syntax: 'cursorcolumn', 'colorcolumn': low priority #6380 2017-10-07 16:31:34 +02:00
Justin M. Keyes
af046a3a81 version: tweak layout, doc 2017-08-18 21:43:57 +02:00
Justin M. Keyes
bb70eec177 Merge #6364 'command-line color hook' 2017-08-16 00:20:37 +02:00
ZyX
474aa823dc Merge branch 'master' into colored-cmdline 2017-08-06 15:25:17 +03:00
Justin M. Keyes
8aa0dfd684 doc: "terminal" always means "embedded terminal emulator"
- Prefer "TUI" where possible to refer to the host terminal.
- Remove obsolete tags and ancient TTY exposition.
- Establish "terminal" to consistently mean "terminal emulator" in all
  Nvim documentation. This removes the need for verbose qualifiers in
  tags and prose.

References #6280
References #6803
2017-08-03 00:29:51 +02:00
ZyX
a356d3c895 Merge branch 'master' into colored-cmdline 2017-07-31 13:13:14 +03:00
Justin M. Keyes
b5e713e70d options: remove ghost of :set termcap (#7102)
Closes #6763
2017-07-31 02:50:34 +02:00
ZyX
fbe60af538 Merge branch 'master' into colored-cmdline 2017-07-31 02:05:02 +03:00
Justin M. Keyes
3c2640cce4 doc 2017-07-29 14:21:58 +02:00
Justin M. Keyes
3b45f676c0 menu_get(): doc 2017-07-28 02:34:24 +02:00
ZyX
d23c0de0c1 doc: Update documentation 2017-07-26 12:31:01 +03:00
Jonathan de Boyne Pollard
5bdad50307 doco: Document constant 'term' in more detail.
Also expand the example in term-dependent-settings.
2017-07-09 19:08:35 +01:00
Justin M. Keyes
0ea7e45bc1 'cpoptions': remove "<" flag; ignore <special>
Closes #6937 "nvim_get_keymap output is unreliable"
2017-07-08 16:34:35 +02:00
Justin M. Keyes
78c5201234 'cpoptions': remove "k" flag
This was already removed in 3baba1e7bc, except the documentation and
CPO_VI entry. find_term_bykeys() is irrelevant to Nvim.
2017-07-08 16:34:33 +02:00
Justin M. Keyes
105d680aea Merge #6816 'TUI improvements'
Removed these commits (test-suite changes):
e2fba01910
7c809c4bc7
18e7cd9e97
2017-07-07 00:34:37 +02:00
Jonathan de Boyne Pollard
533f5c38c4 doco: Note some common $TERM mistakes and how to fix them.
Also explain more clearly the difference between Vim and Nvim
when it comes to built-in terminfo entries.
2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
d65cff9de8 doc: Document some more terminal behaviours.
This documents 256-colour and true colour handling, cursor shapes,
and scrolling regions.

Almost all of these headings are taken from the Vim doco, so that
the :help commands that people learn are a transferable skill.
2017-06-03 18:53:27 +01:00
Jonathan de Boyne Pollard
6be921b71c doc: Relegate xterm-8bit to a removed feature. 2017-06-03 18:53:27 +01:00
ZyX
97602371e6 lua: Add paths from &runtimepath to package.path and package.cpath 2017-05-25 16:27:40 +03:00
Justin M. Keyes
872465cf1d doc 2017-05-21 00:01:52 +02:00
Justin M. Keyes
8e052f677e Merge #6737 "options: make 'highlight' read-only" 2017-05-15 14:53:31 +02:00
Björn Linse
8d8b6224d9 options: make 'highlight' read-only 2017-05-15 07:22:31 +02:00
Justin M. Keyes
17531ed082 Merge #6480 from ZyX-I/colored-cmdline'/input-dict 2017-05-13 21:17:33 +02:00
ZyX
d01f140bb3 doc: Add a note to vim_diff.txt 2017-05-13 18:16:41 +03:00
Justin M. Keyes
edfe0980f1 doc: Lua (#6722)
Closes #6705
2017-05-11 17:45:11 +02:00
ZyX
09f849b600 Merge branch 'master' into luaviml'/lua 2017-05-08 15:43:45 +03:00
Justin M. Keyes
45ef3d9d0c doc: Replace hardcoded TOCs with <M-]> advice. 2017-05-01 17:48:06 +02:00
Justin M. Keyes
fa1ee0ac73 doc: bracketed-paste-mode 2017-05-01 14:55:26 +02:00
Justin M. Keyes
0df1b6655b doc: Removed t_XX options/keycodes. (#6616)
Closes #4482

TODO: revisit find_key_option_len()
2017-04-29 16:56:40 +02:00
ZyX
043d8ff9f2 Merge branch 'master' into luaviml'/lua 2017-04-08 01:54:58 +03:00
Yichao Zhou
bc6d868d00 'listchars': Whitespace highlight group #6367 2017-04-03 14:10:40 +02:00
Justin M. Keyes
c2826a7830 'guicursor': Empty means "block cursor in all modes".
Also: update default 'guicursor' to match the documentation.
2017-04-01 23:14:05 +02:00
Justin M. Keyes
33ff29fc74 Merge #6344 'vim-patch:7.4.2236,7.4.2306' 2017-04-01 17:42:15 +02:00
ZyX
ebad046220 doc: Update vim_diff data regarding ShaDa 2017-03-27 00:13:16 +03:00
ZyX
279e3410cf doc: Update vim_diff.txt 2017-03-27 00:13:16 +03:00
Justin M. Keyes
82c67768fa doc: Replace "For Vim ... Last change ..." headers (#6328) 2017-03-21 17:08:19 +01:00
Justin M. Keyes
a90beeadbb defaults: 'showcmd', 'belloff', 'ruler'
- Vim "unix default" of 'noshowcmd' is serving few users. And it's
  inconsistent.
- 'ruler' and 'belloff=all' improve the out-of-the-box experience.
- Continue to use 'noshowcmd' and 'noruler' by default in the functional
  tests to keep them fast.

TODO: Add a "disable slow stuff" command or mapping to address the
use-case of a very slow terminal connection.
2017-03-16 18:44:10 +01:00
Justin M. Keyes
36fd879b25 doc: eval.txt fixup, README.md 2017-03-13 15:50:50 +01:00
raichoo
1743df82f9 'cpoptions': "_" flag to toggle cw behaviour #6235
`cw` and `cW` behave like `ce` and `cE` respectively. This is
inconsistent compared to `dw` and `dW`.
Introduce a new cpoptions flag "_" to toggle the Vi behavior.

Closes #6234
Patch-by: Christian Brabandt <cblists@256bit.org>

References:
https://github.com/chrisbra/vim-mq-patches/blob/master/cpo_changeword
https://groups.google.com/d/msg/vim_use/aaBqT6ECkA4/ALf4odKzEDgJ
https://groups.google.com/d/msg/vim_dev/Dpn3xtUF16I/T6JcOPKN6usJ
http://www.reddit.com/r/vim/comments/26nut8/why_does_cw_work_like_ce/
2017-03-10 19:24:04 +01:00
Justin M. Keyes
22337b1c01 Merge #6137 from justinmk/cmdline-ctrl-r
cmdline: CTRL-R: Omit trailing ^M character
2017-02-19 14:20:52 +01:00
Justin M. Keyes
baab49ee89 cmdline: CTRL-R: Omit trailing <CR>.
The "technically correct" interpretation is to execute the first line
that is seen (and this is what happens on middle-click paste in Vim).
^M is only intended to "defuse" the newline, so the user can review it.

The parent commit changed the behavior to insert <Space> between lines,
but that's a higher-risk change: it is arguably possible that some user
*wants* the literal ^M chars when e.g. assigning to a register:
    :let @a='<C-R>b'

To avoid that risk, keep the old behavior and only omit the last ^M.
This makes `yy:<C-R>0` nicer at no cost.
2017-02-18 23:24:35 +01:00
Justin M. Keyes
308ccb6f5e cmdline: CTRL-R: <Space> instead of CR between lines.
^M isn't any more "correct" than space: the "technically correct"
interpretation is to execute the first line that is seen (and this is
what happens on middle-click paste in Vim). ^M is only intended to
defuse the newline, so that the user can review the command. We can do
that with a space instead, and then the command can be executed without
having to fix it up first.
2017-02-18 14:49:05 +01:00
Justin M. Keyes
158ea52854 options: Remove 'esckeys' (#6138)
This was never supported and it does not make sense for Nvim.
2017-02-18 14:01:20 +01:00
Nikolai Aleksandrovich Pavlov
abdbfd26bc eval: Add id() function and make printf("%p") return something useful (#6095) 2017-02-11 19:47:02 +01:00
Justin M. Keyes
224f99b85d win: Append process dir to $PATH
This allows executables to be found by :!, system(), and executable() if
they live next to ("sibling" to) nvim.exe. This is what gvim on Windows
does, and also matches the behavior of Win32 SearchPath().

c4a249a736/src/os_win32.c (L354-L370)
2017-02-04 11:07:49 +01:00
Justin M. Keyes
81525dc5c3 defaults: Revert 'mouse=a' (#6022)
This default causes too much confusion for terminal users. Until
a better approach is implemented, revert to the traditional default.

Better solution would be:
- Implement a right-click menu for TUI
- Set 'mouse=a' *only* if clipboard is working.

Closes #5938
2017-01-28 14:30:57 +01:00
Marco Hinz
20867e6319
Document DirChanged 2017-01-13 15:30:01 +01:00
Justin M. Keyes
e43f7425ee refactor: Remove VimL function test()
vim-patch:7.4.1838
2017-01-04 07:23:13 +01:00
Michael Ennen
2c4e92abea vim-patch:7.4.1731 Mark as NA
Leave a note in vim_diff.txt about it.
2016-12-12 10:17:35 -05:00
Justin M. Keyes
cb58999007 os/shell: do_os_system(): Always show last chunk.
This ameliorates use-cases like:
    :!cat foo.txt
    :make
where the user is interested in the last few lines of output.

Try these shell-based ex-commands before/after this commit:
    :grep -r '' *
    :make
    :!yes
    :!grep -r '' *
    :!git grep ''
    :!cat foo
    :!echo foo
    :!while true; do date; done
    :!for i in `seq 1 20000`; do echo XXXXXXXXXX $i; done

In all cases the last few lines of the command should always be shown,
regardless of where throttling was triggered.
2016-12-10 01:26:34 +01:00
Justin M. Keyes
97204e1cef os/shell: Throttle :! output, pulse "..." message.
Periodically skip :! spam. This is a "cheat" that works for all UIs and greatly
improves responsiveness when :! spams MB or GB of output:
    :!yes
    :!while true; do date; done
    :!git grep ''
    :grep -r '' *

After ~10KB of data is seen from a single :! invocation, output will be skipped
for ~1s and three dots "..." will pulse in the bottom-left. Thereafter the
behavior alternates at every:
    * 10KB received
    * ~1s throttled

This also avoids out-of-memory which could happen with large :! outputs.

Note: This commit does not change the behavior of execute(':!foo').
      execute(':!foo') returns the string ':!foo^M', it captures *only* Vim
      messages, *not* shell command output. Vim behaves the same way.
      Use system('foo') for capturing shell command output.

Closes #1234

Helped-by: oni-link <knil.ino@gmail.com>
2016-12-09 18:51:17 +01:00
Justin M. Keyes
0213e99aaf Merge #5561 'inccommand'
Initial work by:
  Robin Elrharbi-Fleury (Robinhola)
  Audrey Rayé (Adrey06)
  Philémon Hullot (DesbyP)
  Aymeric Collange (aym7)
  Clément Guyomard (Clement0)

Major revisions by:
  KillTheMule
  Björn Linse <bjorn.linse@gmail.com>
  Justin M. Keyes <justinkz@gmail.com>
2016-11-09 03:19:22 +01:00
Justin M. Keyes
6a3f8d48d0 'inccommand': rename 'incsubstitute'
'inccommand' allows us to expand the feature to other commands, such as:
    :cdo
    :cfdo
    :global

Also rename "IncSubstitute" highlight group to "Substitute".
2016-11-08 21:22:13 +01:00
Justin M. Keyes
d0689eb0b2 'inccommand': disable 'cursorline', 'spell' in preview 2016-11-08 21:21:43 +01:00