New answers tagged

1

As of patch 8.1.2350, Ctrl-V will emit again the translated key, even if modifyOtherKeys has been set. To get the raw escape sequence, you can instead use now Ctrl-Shift-V


1

It concerns more shell than an editor. I guess, adding this to shell's profile should work vimgrep() { $EDITOR "+vimgrep $1 $2" "+copen"; } To call from terminal do not forget to put single quotation marks: vimgrep '/pattern/' '*.tex'


1

set t_TE= t_TI= This in vimrc disables modifyOtherKeys (:h modifyOtherKeys), which was causing the problems


0

A slight adaptation of @dedowsdi answer for neoterm. This plugin https://github.com/kassio/neoterm that provides improved terminal. you can use this in the bash_profile if [[ ! -z "$NVIM_LISTEN_ADDRESS" ]]; then hookvim fi But I don't. Because in the code I assume that the terminal is in an opened tab to the right (switch to the window and back). one can ...


2

Make a buffer active by its number You can combine win_gotoid() & win_findbuf() to accomplish this: :call win_gotoid(get(win_findbuf(g:tn), 0)) But we can do better for terminal like things by improving a few things: Automatically set our variable on TerminalOpen autocmd Provide methods to send text to the terminal Provide a command to jump to the ...


2

So the top buffer became "a mirror" of the terminal buffer with the number 2. Your problem is that you confuse "buffer" and "window". Those "rectangles" you see are called "windows", while their contents are called "buffers". So the command :b 2 says "I want a buffer number two to be shown in the current window". And that's not what you really wanted. ...


1

Syntax highlighting can only match what's actually inside the buffer; it will end at the final character of a line (or wrap and continue with the next line). I'd simply accept that as it is. The only alternative are hacks like messing with the ANSI escape codes in the terminal, or mis-using different Vim features to highlight the entire line: If you specify ...


1

As @statox suggested in comments I should have used tnoremap to implement it. The following works fine: execute "tnoremap ".g:toggle_term ." <C-w>:call ToggleTerminal()<CR>" The mistake I initially made was the space right after the N execute "tnoremap ".g:toggle_term ." <C-w>N :call ToggleTerminal()<CR>" and since I rebound ...


1

Any command opening a split in Vim is influenced by splitbelow (horizontal) and splitright (vertical) options. So terminal opens on top, because you have set nosplitbelow (this is the default setting). So you can either change a global setting, or use an additional "modifier" command as needed. These modifiers are aboveleft, belowright, topleft and botright....


2

I'm not sure you've seen this, but :help 'balloonexpr' says this: To check whether line breaks in the balloon text work use this check: if has("balloon_multiline") When they are supported "\n" characters will start a new line. If the expression evaluates to a |List| this is equal to using each List item as a string and putting "\n" in ...


5

Create a special function in your vimrc that's callable from terminal, it's name must starts with Tapi_. " arglist : [ cwd ] " change window local working directory function! Tapi_lcd(bufnum, arglist) let winid = bufwinid(a:bufnum) let cwd = get(a:arglist, 0, '') if winid == -1 || empty(cwd) return endif call win_execute(winid, 'lcd ' . cwd) ...


Top 50 recent answers are included