Hot answers tagged

12 votes
Accepted

Cursor shape under vim + tmux

It seems the problem is that tmux doesn't send your cursor-changing escape codes to the terminal emulator. You need to wrap your desired escape codes in a special sequence that tells tmux that it ...
  • 236
6 votes

How do I pick a line and write it to an external file?

You can use :[range]w >> file to append the given range to the given file. If the file does not yet exist, use the ! argument to the :w command to force writing the new file. So this means you ...
6 votes

Can't Move to End of Line With Vim on Cygwin

Vim's cursor is always on a character position, never between character positions, even though some cursor shapes make it appear that the cursor is between character positions. When your cursor ...
  • 5,964
4 votes

Cursor shape under vim + tmux

The correct value of $TERM environments variable is very important. Make sure that it is different from screen-256color. Set it to xterm-256color for example.
3 votes
Accepted

Explanation of command :'<, '>

Surprisingly, better than Google is to search in Vim's builtin help. :h '< '< `< To the first line or character of the last selected Visual area in the current buffer. For block ...
  • 4,268
3 votes
Accepted

Why syncolor.vim is sourced at the end of cygwin vim started and replaced the specifed colorscheme

There's a simpler workaround. Just add let g:syntax_cmd = "skip" to your .vimrc. From :h syntax_cmd: The "syntax_cmd" variable is set to one of these values when the syntax/syncolor.vim files are ...
  • 216
2 votes
Accepted

Vim Looks Very Weird When Using chcp 65001

Fixed by adding set encoding=utf-8 to .vimrc (called _vimrc on Windows).
  • 21
2 votes

Why syncolor.vim is sourced at the end of cygwin vim started and replaced the specifed colorscheme

Okay, Okay, I found the reason. There's code shows in /usr/share/vim/vim74/syntax/synload.vim: $ cat -n /usr/share/vim/vim74/syntax/synload.vim ... 17 " Set the default highlighting colors. ...
  • 133
2 votes
Accepted

Using the same plugin folders for gvim and with vim in cygwin

There are several different types of symlinks on Cygwin. Only the native NTFS symlink type will be understood by a non-Cygwin build of gVim. That gives you two options, depending on which direction ...
2 votes
Accepted

Using the execute shell command (:!) on Windows and MSYS2

The comments by B layer and Ben Knoble were both helpful in finding the answer. Vim correctly set the shell based on the $SHELL variable, but did not set shellcmdflag appropriately, and that was what ...
1 vote
Accepted

Why does this pattern make :global work only on the first line of the highligted match?

I believe this is because the :g command doesn't operate on your search pattern directly, but rather on the line that the search pattern starts on. According the help (:help :g), the way the :g ...
  • 1,050
1 vote

Explanation of command :'<, '>

'<,'> is not a command, but a range. You can prefix any command with a range. If you want to know more: :h ranges. '<,'> is always displayed, when you select with visual mode and it ...
  • 919
1 vote

Windows context menu "open with vim" symlink error

Found a solution/hack: If you set a Windows %HOME% environment variable to a path for a folder that contains _vimrc things will work. Experiments with MYVIMRC, MYGVIMRC, and VIM environment ...
  • 21
1 vote
Accepted

Why is this particular keystroke (shown inline) highlighted in VIM version 8.0 under Cygwin, and how to remove it?

As determined in the comments, ]; formed the last search pattern (as set by :global, :substitute, /, or ?—cf. :help quote_/), and 'hlsearch' was set. Therefore, the characters were highlighted (...
  • 21.8k
1 vote
Accepted

Why Backspace key do not work in insert mode in shell file by default in Cygwin?

Backwards compatibility (with vi, and also with earlier Vim releases) is a big thing in Vim. However, there have been many complaints like yours in the past, so Vim 8.0 introduced a :help defaults.vim ...
1 vote
Accepted

Scroll wheel inserts seemingly-random characters in cygwin vim, depending on where on the screen the mouse cursor is

Try this: :set nolazyredraw I was looking at your config and that setting caught my eye. The default is false but you have it enabled. When I enable it in my Cygwin environment and then use the ...
  • 18.5k
1 vote

Getting Error while opening files through vim

Though Cygwin is installed in Windows, it resembles linux. So, setting the fileformat to unix solves the problem. :set fileformat=unix Now, the unicode characters are accepted by Cygwin.
  • 3,112

Only top scored, non community-wiki answers of a minimum length are eligible