The Stack Overflow podcast is back! Listen to an interview with our new CEO.

New answers tagged

0

I have found all of these answers lacking. After struggling through the xargs issue, the very simplest way--for me!--to do these search-and-opens on a generic box is the following: vim -O `grep -lir mySearchTerm *` I have no issue using find with xargs and grep, but I find the syntax annoying. And as a daily coder who uses vim and the terminal as their IDE,...


0

I know you said you "don't want to leave vim [terminal] window" and "Vim 8.1 is supposed to have [a] fully featured [sic] terminal"—but let's consider that You have to leave the terminal to do editing; and, No "fully featured [sic] terminal" that I am aware of prevents programs run in it from doing any line wrapping they want to. So, I propose the use of a ...


1

First off, you might like to look into any of the many plugins that incorporate a REPL into Vim (vim-slime is the one I use). They don't do exactly what you're asking, but they do something very similar and are far more flexible. If you want your exact behaviour, though, then here's a proof of concept that shows how you can implement it: augroup ...


0

function! ClearTerminal() set scrollback=1 let &g:scrollback=1 echo &scrollback call feedkeys("\i") call feedkeys("clear\<CR>") call feedkeys("\<C-\>\<C-n>") call feedkeys("\i") sleep 100m let &scrollback=s:scroll_value endfunction


4

has('terminal') is for Vim only. In Neovim this feature is always present, and so checking it is not supported. :h feature-compile Nvim always includes ALL features, in contrast to Vim (which ships with various combinations of 100+ optional features). Think of it as a leaner version of Vim's "HUGE" build. This reduces surface area for bugs, and removes a ...


0

I've managed to write something that achieves desired effect. function! Terminal_cd() if &buftype == 'terminal' call chansend(b:terminal_job_id, 'NVIM_LISTEN_ADDRESS= cd "' . getcwd() . "\"\<cr>") endif endfunction function! Terminal_restore() let curtab = tabpagenr() let curwin = winnr() ...


1

AFAIK, there's no "good" way to do it, but there is a "hacky" way. Suppose you want <c-w><c-l> combination to clear vim internal buffer in both normal and terminal(insert) modes. The mappings in vimrc would look like this: nmap <c-w><c-l> :set scrollback=1 \| sleep 100m \| set scrollback=10000<cr> tmap <c-w><c-l> &...


1

should I base this setup upon neovim or vim 8? If you don't have any problems with Vim, there's no need to switch to Neovim. In particular, Vim's terminal support is very decent. Open new splits with terminal similar to tmux (each split is a separate terminal) Yes, it's trivial. In fact, it's hard to avoid this. Ability to go into netrw from terminal ...


1

Both clear and Ctrl+l work for me using Neovim and bash. Would have asked you to try it in a comment before posting as an answer but I don't have enough rep.


Top 50 recent answers are included