Just like this
let @+ = &statusline
Or like this
call setreg("+", getbufvar("%", "&statusline"))
Or even like this...
call provider#clipboard#Call("set", [[matchstr(execute("set statusline"), "=\@=.*"], "v", "+"])
The primary difference is that readonly is per-buffer and write is global to vim.
readonly is generally used when editing specific files that you do not have access to write (like /etc/fstab). Any buffer can be set to readonly if you want to prevent accidentally writing it to file.
nowrite can be used to put vim into view-only mode, like pager utilities ...
Function defined in ftplugins
In ftplugins we can define script local functions and global functions that are defined only when a buffer of the given filtetype is loaded.
In the second case, the function is still global and can be hidden by any other script.
In both cases, the functions will be redefined every time a new buffer of the same filetype is opened,...
In Bash and Zsh, a DEBUG trap can be used to chain a given set of commands or function
to each issued command. Thus,
trap 'clear; "$@"' DEBUG
solves your problem.
Presumably you do not want to do it manually every single time, nor to affect every
interactive shells, only those in Vim's terminal buffer.
In that case, the solution is to add this to ...
:set guicursor& should restore cursor defaults in GVim.
To change the blink rate try using guicursor=a instead of guicursor=n like this :
This will ONLY work in GVim, not Vim.
There's a lot missing there. Ignoring the part after the first <CR> for now...
First, there are some contexts, i.e. where a filename is expected, where you can use <cword> bare. But in many cases, including this one, you need to force it to be resolved or "expanded". That can be done with, naturally, expand('<cword>'). ...
I think you are confusing buffers which are in memory representation of a file (:h buffers) and registers which are in memory places to store yanked and deleted text (:h registers). I think you would benefit from reading the doc on these topics and get a better understanding, you'll get less confusion in the long run.
First a reminder on commands and motions:...
(Doesn't look like @filbranden or @AndrewHo-Lee are planning to answer this, so adding a Community Wiki answer with the diagnosis they figured out.)
The problem turned out to be that 'compatible' was set when the mapping was defined.
With this set, the 'cpoptions' setting contains the < flag, which means that Vim will not treat the <Esc> in the ...
Using :substitute to replace end/beginning of line with return got the results OP wanted.
nnoremap o :s/$/\r/ <cr>
nnoremap O :s/^/\r/ <cr>
I can't get just o to be remapped without a recursive error. But a reasonable compromise you might consider from this answer is to use oo for new line. This leaves single o ...
I think there are several points to address in your question:
Firstly, if line("$") > 10 does test if the number of lines in the current buffer is greater than 10, or more precisely as :h line() explains that tests if the line number (line()) of the last line of the buffer ($) is greater than 10.
Now there are a couple of things which can't work ...
To compile with javac filename.java, then use javac %. (+the backslash)
If you want to execute java filename without the extension, then use java %< .
Note, there is exists a :compiler javac that also change the 'errorformat' option, but it won't inject the current filename, you'd have to compile with :make %
This is quite easy thanks to auto commands. They allow you to specify vimscript to be run when certain events occur in Vim. There are event types for many different things that happen in Vim including loading and exiting/saving a buffer (file).
You'll need something like this in your vimrc.
autocmd BufReadPost,BufWritePre * :...
In theory you could give the same path to both plugins managers so that they install the plugins in the same directory:
In theory you could use one of the managers to install your plugins (PlugInstall for vim-plug or PluginInstall for Vundle), this plugin ...
The idiomatic answer is
Mass mentions searchcount() which returns a dictionary of interesting items. You'll need to set the last search pattern, though (e.g., / or write to @/), or pass pattern in the options to the function.
You can use:
(You can also include the other entries from the default 'tags', such as just tags, which means a file with that name in the current directory, and also the uppercase variants, if those interest you as well. Use commas to separate different entries. The ; is not a separator.)
This will look for a file named tags on either the ...