FDinoff
  • Member for 6 years, 11 months
  • Last seen more than 1 year ago
Is there an easy way to close a scratch buffer/preview window?
Accepted answer
87 votes

The top window is called the preview window. So any of <c-w>z, <c-w><c-z> or :pc[lose][!] should work. The below is the help for :help :pclose CTRL-W z CTRL-W_z CTRL-W CTRL-...

View answer
What is the functional difference between :nohlsearch and :set nohlsearch?
Accepted answer
16 votes

From :h :nohlsearch :noh :nohlsearch :noh[lsearch] Stop the highlighting for the 'hlsearch' option. It is ...

View answer
Cursor moves one character backwards on exiting insert mode
Accepted answer
14 votes

First you should understand that the cursor is between characters in insert mode and on a character in normal mode. This means that when you exit insert mode the cursor needs to move onto a character. ...

View answer
How do I align C++ comments to be compliant with Google styling?
Accepted answer
11 votes

clang-format is a command line tool that formats c++ code. One of the default formatters is google. clang-format -style=google There are plugins that would allow you to run clang-format in vim. One ...

View answer
surround plugin and TeX quotes `'
Accepted answer
6 votes

You can create a customize surround by defining a variable g:surround_{key code} So for example you could do let g:surround_96 = "`\r'" Where 96 is the key code for `. You can make this more ...

View answer
How to add an item to Vim context menu?
Accepted answer
6 votes

The menu you are referring to is called "PopUp". To create new menu entries you use the command menu (It has all the same variations as map, plus a special one amenu for all modes) The following ...

View answer
Vim, lua and ctags
Accepted answer
6 votes

<c-]> only looks at the keyword under the cursor. Normally : is not defined as a keyword character. To define : as a keyword character you can put setlocal iskeyword+=: in ~/.vim/ftplugin/lua....

View answer
Reusing search pattern in ex mode
4 votes

In addition to @garyjohn's answer, you can use <c-r>/ to insert the search register into a command if you want to edit it or leaving out the search pattern isn't sufficient. :%s/<c-r>//...

View answer
How do I prevent ctrlp plugin from changing the default spell location?
Accepted answer
4 votes

The instructions found at http://kien.github.io/ctrlp.vim assume you don't have a plugin manager. So it tells you to do the runtime path fiddling yourself (which is an incorrect assumption in this ...

View answer
Showing colors in vim's quickfix window from Dispatch tasks
3 votes

Color is represented using ansi escape sequences. On my computer ^[[0m^[[01;34mWord^[[0m represents a blue word. (^[ is the escape character`) Obviously this isn't useful to have in the output if you ...

View answer
Neovim Python script hangs
Accepted answer
2 votes

Don't use the neovim interface for this, its designed to be used asynchronously and you are using it synchronously. (You are deadlocking neovim which is waiting for the nvim socket to respond but it ...

View answer
Regex that prefers shorter matches within a match? (This is more involved than non-greedy)
2 votes

There aren't enough examples but I think this does what you want. .*\zsp.\{-}u.\{-}t would match put in your example instead of public void put. Basically the .* forces the regex engine to start ...

View answer