How do you run a shell command from within Vim?
:!ls
Use :! followed by any shell command.
73 results for ":ls"
:!ls
Use :! followed by any shell command.
:filter /pattern/ ls
When you have many open buffers, plain :ls output gets noisy fast.
:ls +
The :ls command (or :buffers) supports filter flags that narrow the buffer list to specific states.
:ls!
:ls (or :buffers) shows Vim's buffer list, but it hides unlisted buffers — help files, directory listings (netrw), terminal buffers, and scratch buffers marke
:ls
The :ls command displays a list of all open buffers in Vim, showing their buffer number, status indicators, file name, and the line the cursor was last on.
:!ls -la
Vim lets you execute any shell command directly from within the editor using the :! (bang) command.
:setlocal nobuflisted
Setting nobuflisted removes a buffer from the :ls output and buffer-switching commands like :bnext/:bprev, while keeping it loaded and accessible.
buffers-windows #buffers-windows #buffers #unlisted #management
vim.lsp.config()
Neovim 0.
vim.lsp.enable()
Neovim 0.
:filter /pattern/ command
The :filter command restricts the output of another Ex command to only lines matching a given pattern.
:b {number}
The :b command followed by a buffer number switches directly to that buffer.
vim.lsp.config('*', { ... })
Neovim 0.
:sbuffer {N}
:sbuffer {N} opens buffer number N in a new horizontal split, leaving your current window untouched.
buffers-windows #buffers-windows #buffers #windows #navigation
:b N
How it works Every buffer in Vim is assigned a unique number when it is opened.
:tab sbuffer {bufnr}<CR>
If a file is already loaded as a buffer, reopening it with :tabedit can trigger another read and may lose the exact in-memory context you want.
:b3
Use :b followed by the buffer number.
:redir @a | {cmd} | redir END
The :redir command redirects the output of Ex commands to a register, file, or variable instead of displaying it on the screen.
command-line #command-line #ex-commands #registers #productivity #advanced
:bunload
Use :bunload or :bun to unload the current buffer from memory while keeping it in the buffer list.
:!command
The :!command syntax lets you execute any shell command directly from within Vim without leaving the editor.
:keepalt sbuffer {bufnr}
The alternate-file register (#) is easy to disturb when jumping around buffers, and many advanced motions depend on it (, # expansions, quick two-file toggles).